xforms-1.2.4/0000775000175000017500000000000012353624652010047 500000000000000xforms-1.2.4/Makefile.in0000664000175000017500000006047512353624173012046 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/libforms.spec.in \ $(top_srcdir)/config/common.am $(top_srcdir)/configure \ COPYING.LIB ChangeLog INSTALL subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = libforms.spec CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = config lib image gl fdesign fd2ps demos doc DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FL_FIXLEVEL = @FL_FIXLEVEL@ FL_REVISION = @FL_REVISION@ FL_VERSION = @FL_VERSION@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIB = @JPEG_LIB@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ TEXI2DVI = @TEXI2DVI@ TEXI2DVI_NEEDS_PDF = @TEXI2DVI_NEEDS_PDF@ TEXI2HTML = @TEXI2HTML@ VERSION = @VERSION@ XMKMF = @XMKMF@ XPM_LIB = @XPM_LIB@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign DISTCLEANFILES = *.orig *.rej *~ *.bak core makelog libforms.spec \ config.status config.cache config.log config.h MAINTAINERCLEANFILES = $(srcdir)/Makefile.in makelog \ $(srcdir)/aclocal.m4 $(srcdir)/configure \ $(srcdir)/acinclude.m4 $(srcdir)/lib/config.h.in AM_INSTALL_DATA_FLAGS = $(INSTALL) -m 644 -D ACLOCAL_AMFLAGS = -I config @BUILD_DEMOS_FALSE@DEMOS = @BUILD_DEMOS_TRUE@DEMOS = demos @BUILD_GL_FALSE@GL = @BUILD_GL_TRUE@GL = gl @BUILD_DOCS_FALSE@DOCS = @BUILD_DOCS_TRUE@DOCS = doc SUBDIRS = config lib image $(GL) fdesign fd2ps $(DEMOS) $(DOCS) # libforms.spec is needed as well as libforms.spec.in or else 'make rpmdist' # will fail. EXTRA_DIST = ChangeLog COPYING.LIB Copyright INSTALL INSTALL.git README \ README.rpmbuild autogen.sh libforms.spec.in libforms.spec all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/common.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/common.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): libforms.spec: $(top_builddir)/config.status $(srcdir)/libforms.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_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 case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ dist-zip distcheck distclean distclean-generic \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-recursive uninstall uninstall-am # Builds RPM packages (using the libforms.spec file), one (architecture- # dependend) binary package and a development, documentation and source # package libdist: dist tar -vxf $(PACKAGE)-$(VERSION).tar.gz; \ rm -f $(PACKAGE)-$(VERSION).tar.gz; \ mv $(PACKAGE)-$(VERSION) libforms-$(VERSION); \ tar -czf libforms-$(VERSION).tar.gz libforms-$(VERSION); \ rm -rf libforms-$(VERSION); rpmdist: libdist rpmbuild -ta libforms-$(VERSION).tar.gz; \ saved_status=$$?; \ exit $$saved_status # 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: xforms-1.2.4/libforms.spec.in0000664000175000017500000001631012257367667013103 00000000000000# The original name of the software package is 'xforms' but the # rpm packages go by the name 'libforms' in all distros. We need # the original name in some situations. %define origname @PACKAGE@ # Building a debug package doesn't seem to make too much sense %define debug_package %{nil} # Here we start... Summary: XForms library Name: libforms Version: @VERSION@ Release: 1%{?dist} Source0: %{name}-%{version}.tar.gz License: LGPLv2+ Group: Development/Libraries # To build the libraries we need the libXpm and libjpeg development # packages (which in turn depend on the corresponding library packages) BuildRequires: libXpm-devel BuildRequires: libjpeg-devel BuildRequires: mesa-libGL-devel BuildRoot: %{_tmppath}/%{name}-buildroot Prefix: %{_prefix} URL: http://xforms-toolkit.org/ %description This is a GUI toolkit based on the X library for X Window Systems. It features a rich set of objects, such as buttons, sliders, and menus etc. integrated into an easy and efficient object/event callback execution model that allows fast and easy construction of X-applications. In addition, the library is extensible and new objects can easily be created and added to the library. # Beside the normal package create a "development" package, containing # the header files for the three libraries, the static versions of the # libraries and the fdesign and fd2ps programs. %package devel Summary: Header files and tools Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel Header files, tools and static libraries for development with XForms. # Also create a documentation package with the full documentation in # info, HTML and PDF format. This is an architecture-independent # package. # # Note: older rpmbuild versions get very unhappy when you try to build # a 'noarch' sub-package together with architecture-dependent packages, # spitting out weird error messages and refusing to build the package, # so use 'noarch' only with newer versions of rpmbuild. %package doc Summary: XForms documentation Group: Development/Libraries Requires(post): info Requires(preun): info BuildRequires: texi2html BuildRequires: texinfo BuildRequires: texinfo-tex BuildRequires: ImageMagick %if 0%{?fedora} >= 10 || 0%{?rhel} >= 6 || 0%{?centos} >= 6 || 0%{?suse_version} >= 1230 BuildArch: noarch %endif %description doc Info, HTML, PDF documentation and demo programs for XForms. # Copy and unpack the tar-ball %prep %setup -q # Build everything ('make' can be done in parallel) %build ./configure --prefix=%{_prefix} \ --mandir=%{_mandir} \ --bindir=%{_bindir} \ --libdir=%{_libdir} \ --infodir=%{_infodir} \ --htmldir=%{_docdir}/%{name}/html \ --pdfdir=%{_docdir}/%{name} \ --enable-docs \ --disable-demos \ --disable-warnings \ --disable-debug \ --enable-optimization=-O2 make %{?_smp_mflags} rm -rf demos/.deps # Clear out the {buildroot} and install everything in {buildroot}, # then apply the following tweaks: # 1) Delete the dir file from {_infodir}, it's not to be distributed # and gets created (or updated) during installation on the target # machine. # 2) Strip the fdesign and fd2ps programs # 3) Copy the directory with the demo programs to the documentation # directory # 4) Create a symbolic link from the xforms.5 man page to libforms.5 # (do that in a sub-process to avoid changing the working directory). %install rm -rf %{buildroot} install -d -m 755 %{buildroot} make DESTDIR=%{buildroot} install rm -f %{buildroot}%{_infodir}/dir /usr/bin/strip %{buildroot}%{_libdir}/*.so.*.*.* /usr/bin/strip %{buildroot}%{_bindir}/* cp -r %{_builddir}/%{name}-%{version}/demos %{buildroot}%{_docdir}/%{name} `cd %{buildroot}%{_mandir}/man5 && ln -s %{origname}.5.gz %{name}.5.gz` %clean rm -rf %{buildroot} # Set up list of files in the binary package: just the libraries and the # man page for the libforms library. %files %{_libdir}/*.so.* %{_mandir}/man5/* %defattr(-,root,root) %doc COPYING.LIB Copyright ChangeLog README # Set up list of files going into the development package: header files, # static libraries, utility programs and their man pages %files devel %{_bindir}/* %{_includedir}/* %{_libdir}/*.so %{_libdir}/*.a %{_libdir}/*.la %{_mandir}/man1/* %defattr(-,root,root) # Set up list of files distributed with the documentation package: # info, HTML, PDF documentation and demo programs %files doc %{_docdir}/%{name}/* %{_infodir}/* %defattr(-,root,root) # Run ldconfig after install on the target machine to make the dynamic # linker aware of the new libraries %post /sbin/ldconfig # Run ldconfig after deinstall on the target machine of libraries %postun /sbin/ldconfig # Update the info dir file and undo the compression that rpmbuild # has applied to the image files below {_infodir} (these are image # file for use by emacs' info mode and can't be read when gzip'ed). %post doc /sbin/install-info %{_infodir}/%{origname}.info %{_infodir}/dir || : gunzip %{_infodir}/%{origname}_images/*.png.gz # Before uninstalling remove the entry for the XForms info file from # the dir file in {_infdir}. Also gzip the image files again because # that's what they were during installation %preun doc if [ $1 = 0 ] ; then /sbin/install-info --delete %{_infodir}/%{origname}.info %{_infodir}/dir || : gzip %{_infodir}/%{origname}_images/*.png fi %changelog * Sat Dec 21 2013 Jens Thoms Toerring 1.1.2.0-1 - spec file mostly rewritten for new 1.2.0 release, resulting packages now have a name starting with 'libforms' * Thu Jun 1 2010 Jens Thoms Toerring 1.0.93sp1 - New release 1.0.93sp1 * Wed Nov 4 2009 Jens Thoms Toerring 1.0.93sp1 - New release 1.0.91sp2 * Sat Nov 22 2008 Jens Thoms Toerring 1.0.91 - New release 1.0.91 - lots of bug fixes * Wed Oct 6 2004 Angus Leeming 1.0.90 - Re-write the 'post' and 'postun' scripts to create the symbolic links correctly without requiring the SO_VERSION hack. * Fri May 7 2004 Angus Leeming 1.0.90 - add code to the 'post' script to modify libforms.la et al. to prevent libtool from complaining that the files have been moved. * Thu May 6 2004 Angus Leeming 1.0.90 - fix 'Release' and 'Source0' info. - add 'post' and 'postun' scripts to create and remove symbolic links, respectively. * Thu May 6 2004 Angus Leeming 1.0.90 - no longer place devfiles and binfiles in ${RPM_BUILD_ROOT}. Prevents rpm from bombing with a "Checking for unpackaged files" error. * Sat Aug 31 2002 Duncan Haldane 1.0-RC4 - mv fdesign, fd2ps to devel. restore xforms name of rpm. * Sun Jul 14 2002 Greg Hosler 1.0-RC4 - Pass DESTDIR to makeinstall_std. * Thu Jul 11 2002 Peter Galbraith 1.0-RC4 - Move from libxforms to libforms to match other distros. * Tue Jul 8 2002 Chris Freeze 1.0-RC4 - First stab at spec file. xforms-1.2.4/README0000644000175000017500000001321612236400421010632 00000000000000 XForms Version 1.2.0 This is the Free Software distribution of the XForms Library, a graphical user interface toolkit for X Window Systems. It should work under X11 R4, R5 & R6. XForms is free software. It is licensed under the GNU LGPL (Lesser General Public License) version 2.1. See the file COPYING.LIB for the gory details. What's new? ----------- XForms 1.2.0 is a new stable version of the library. Numerous bugs have been fixed, new features have been added and the documentation is now part of the package. For more information, read the file ChangeLog. Getting XForms -------------- The XForms homepage is accessible at http://xforms-toolkit.org/ The sources can be downloaded from the project page at http://www.nongnu.org/xforms/ See the "Download Area" on that page. On this page you should select the file named 'xforms.latest_stable.tar.gz' (which will point to the latest stable release, including bug-fixes that may have become necessary) to download the sources - unless you're prepared to take part in testing the "bleeding edge" versions that have a name containing '-preX' (where X is some number), indicating that it is a pre-release on the way to a new stable release. Keeping in touch ---------------- There is a mailing list for XForms. To subscribe (or unsubscribe) go to http://lists.nongnu.org/mailman/listinfo/xforms-development or send an email to xforms-development-request@nongnu.org with a subject line consisting of just 'subscribe' or 'unsubscribe'. To use the mailing list, send your message to xforms-development@nongnu.org Remember your message will be sent to many people. Please DO NOT send subscribe/unsubscribe messages to the list, send it to xforms-request@nongnu.org The archive of the mailing list can be found at http://lists.gnu.org/archive/html/xforms-development/ Messages sent to the mailing list before August 2009 are at http://xforms-toolkit.org/old-archive/ Compiling XForms ---------------- You should be able to compile XForms on any 'reasonable' flavour of unix. XForms relies on some other libraries, namely (for compiling XForms you will need development versions, i.e. versions that contain the header files for the libraries) * libX11 * libXpm, version 4.7 or newer. * libjpeg, 6.0b or newer. * libGL (optional) You will find generic installation instructions common to all autoconf-based packages in the file INSTALL. In general, all it takes to compile and install XForms is ./configure make make install There are some features that you may want to control by using options when running the 'configure' script'. To find out about all of them run 'configure' with the '--help' option. The more commonly used include: o --disable-gl makes sure that gl support is not built even if you have proper GL libraries installed. o --enable-demos adds "demos/" to the list of directories to build. It contains various program demonstrating the use of the XForms library. o --enable-docs instructs the 'configure' script to also add the documentation (in info, HTML and PDF format) to the targets to be build. This requires some additional tools. For more complicated cases, ./configure takes the following specific flags: o --with-extra-lib=DIRECTORY that specifies the path where XForms will find extra libraries (Xpm, jpeg...) it needs. Defaults to NONE (i.e. search in standard places). You can specify several directories, separated by colons. o --with-extra-inc=DIRECTORY that gives the place where XForms will find headers. Defaults to NONE (i.e. search in standard places). You can specify several directories, separated by colons. o --with-extra-prefix[=DIRECTORY] that is equivalent to --with-extra-lib=DIRECTORY/lib --with-extra-inc=DIRECTORY/include If DIRECTORY is not specified, the current prefix is used. o --enable-optimization=VALUE enables you to set optimization to a higher level as the default (-O), for example --enable-optimization=-O3. o --disable-optimization - you can use this to disable compiler optimization of LyX. The compile may be much quicker with some compilers, but XForms applications will run more slowly. o --enable-debug will add debug information to your binary. This requires a lot more disk space, but is a must if you want to try to debug problems in XForms. The default is to have debug information for development versions and prereleases only. o --enable-bwc-bs-hack enables some workarounds for incompatibilities that may keep very old programs using XForms from working correctly. Please only use as a last resort. Moreover, the following generic configure flags may be useful: o --prefix=DIRECTORY specifies the root directory to use for installation. [defaults to /usr/local] o --enable-maintainer-mode enables some code that automatically rebuilds the configure script, makefiles templates and other useful files when needed. This is off by default, to avoid surprises. Note that the --with-extra-* commands are not really robust when it comes to use of relative paths. If you really want to use a relative path here, you can prepend it with "`pwd`/". If you do not like the default compile flags used (-g -O on gcc), you can set CFLAGS variable to other values as follows: ./configure CFLAGS='-O2' Similarly, if you want to force the use of some specific compiler, you can give a value to the CC variable. The following option might be useful in order to make the compiler more verbose about potential problems: o --enable-warnings that make the compiler output more warnings during the compilation. Opposite is --disable-warnings. xforms-1.2.4/acinclude.m40000664000175000017500000111016212353624170012155 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file 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. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS dnl Some useful functions for xforms configure.in -*- sh -*- dnl Author: Jean-Marc Lasgouttes (lasgouttes@lyx.org) dnl Lars Gullik Bjønnes (larsbj@lyx.org) dnl Allan Rae (rae@lyx.org) dnl Jens Thoms Törring (jt@toerring.de) ### Check for version and warn when a development version is used dnl Usage XFORMS_CHECK_VERSION dnl Sets variables VERSION, FL_VERSION, FL_REVISION, FL_FIXLEVEL and dnl xforms_devel_version. AC_DEFUN([XFORMS_CHECK_VERSION],[ AC_SUBST(PACKAGE, $PACKAGE_NAME) AC_SUBST(VERSION, $PACKAGE_VERSION) [eval] `echo $PACKAGE_VERSION | sed -e 's/\(.*\)\.\(.*\)\.\(.*\)/FL_VERSION=\1; FL_REVISION=\2; FL_FIXLEVEL=\3/'` AC_SUBST(FL_VERSION) AC_SUBST(FL_REVISION) AC_SUBST(FL_FIXLEVEL) echo "configuring xforms version $VERSION" xforms_devel_version=no case $FL_REVISION in *[[13579]]) xforms_devel_version=yes AC_DEFINE(DEVEL_VERSION, 1, Define if you are building a development version of xforms) echo "WARNING: This is a development version. Expect bugs." ;; esac ]) dnl Usage XFORMS_CHECK_LIB_JPEG: Checks for jpeg library AC_DEFUN([XFORMS_CHECK_LIB_JPEG],[ ### Check for Jpeg library AC_CHECK_LIB(jpeg, jpeg_CreateDecompress, JPEG_LIB="-ljpeg", [XFORMS_LIB_ERROR(libjpeg,jpeg)]) AC_SUBST(JPEG_LIB) ]) dnl Usage XFORMS_PATH_XPM: Checks for xpm library and header AC_DEFUN([XFORMS_PATH_XPM],[ ### Check for Xpm library SAVE_LIBS="$LIBS" LIBS="$X_PRE_LIBS $LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" AC_CHECK_LIB(Xpm, XpmCreateBufferFromImage, XPM_LIB="-lXpm", [XFORMS_LIB_ERROR(libXpm,Xpm)]) AC_SUBST(XPM_LIB) LIBS="$SAVE_LIBS" ### Check for Xpm headers SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$X_CFLAGS $CPPFLAGS" xforms_cv_xpm_h_location="" AC_CHECK_HEADER(X11/xpm.h,[ ac_cv_header_xpm_h=yes xforms_cv_xpm_h_location=""],[ AC_CHECK_HEADER(xpm.h,[],[ XFORMS_LIB_ERROR(xpm.h,Xpm)])]) AC_DEFINE_UNQUOTED(XPM_H_LOCATION,$xforms_cv_xpm_h_location, [define this to the location of xpm.h to be used with #include, e.g. ]) CPPFLAGS="$SAVE_CPPFLAGS" ### Test for the header version if test $ac_cv_header_xpm_h = yes; then AC_CACHE_CHECK([xpm header version],xforms_cv_xpmversion, [ cat > conftest.$ac_ext <&5 | \ grep '^"%%%"' 2>/dev/null | \ sed -e 's/^"%%%"\(.*\)"%%%"/\1/' -e 's/ //g'` case "$xforms_cv_xpmr" in changequote(,) [0-9]) xformsxpmr_alpha=`echo $xforms_cv_xpmr |tr 123456789 abcdefghi` xformsxpmv_alpha=" (aka 3.$xforms_cv_xpmv$xformsxpmr_alpha)";; changequote([,]) *) ;; esac xforms_cv_xpmversion="$xforms_cv_xpmv.$xforms_cv_xpmr$xformsxpmv_alpha" rm -f conftest*]) XPM_VERSION=${xforms_cv_xpmversion} case "$xforms_cv_xpmr" in changequote(,) [789]|[0-9][0-9]*) ;; changequote([,]) *) XFORMS_WARNING([Version $xforms_cv_xpmversion of the Xpm library is a bit old. If you experience strange crashes with xforms, try to upgrade to at least version 4.7 (aka 3.4g). If you have installed a newer version of the library, check whether you have an old xpm.h header file in your include path.]);; esac fi]) dnl Macro tests if 'texi2dvi' is installed and usable. Also test for 'convert' dnl and checks if PNG files must be converted to PDF files. AC_DEFUN([XFORMS_CHECK_TEXI2DVI],[ AC_CHECK_PROGS(TEXI2DVI,[texi2dvi],no) export TEXI2DVI AC_CHECK_PROGS(CONVERT,[convert],no) export CONVERT dnl If 'texi2dvi' doesn't exist there' nothing we can do. Otherwise we need to dnl check if the installed version of 'texi2dvi' uses programs that can't deal dnl with PNG files (as some older versions did). For this we create a minimal dnl texi file that just contains an image and run 'texi2dvi' on it. If this dnl fails we check the log file for a line complaining about a missing image. dnl If such a line doesn't exist 'texi2dvi' must be broken in a way we can't dnl deal with. Otherwise we need to convert the PNF files to PDF. This in turn dnl requires 'convert'. If it doesn't exist we can't create the PD dnl documentation, otherwise we set a variable that tells us in the Makefile dnl that all PNG files have to be converted to PDF. if test $TEXI2DVI = "no" then XFORMS_WARNING([Unable to find application 'texi2dvi', PDF documentation won't be built]) else cat > texi2dvi_test.texi < /dev/null 2>&1; if test $? != 0; then grep "cannot find image file" texi2dvi_test.log > /dev/null 2>&1 if test $? = 0; then if test $CONVERT = "no"; then TEXI2DVI="no" XFORMS_WARNING(['texi2dvi' requires the 'convert' application but which doesn't exist, so PDF documentation won't be built]) else TEXI2DVI_NEEDS_PDF="yes" export TEXI2DVI_NEEDS_PDF fi else TEXI2DVI="no" XFORMS_WARNING([Unable to find a working application 'texi2dvi', PDF documentation won't be built]) fi fi rm -f texi2dvi_test.* fi AC_SUBST(TEXI2DVI) AC_SUBST(CONVERT) AC_SUBST(TEXI2DVI_NEEDS_PDF) ]) dnl Macro tests if texi2html is installed. dnl AC_DEFUN([XFORMS_CHECK_TEXI2HTML],[ AC_CHECK_PROGS(TEXI2HTML,[texi2html],no) export TEXI2HTML; if test $TEXI2HTML = "no" ; then XFORMS_WARNING([Unable to find a 'texi2html' application, HTML documentation won't be built]); fi AC_SUBST(TEXI2HTML) ]) dnl Usage: XFORMS_ERROR(message) Displays the warning "message" and sets the dnl flag xforms_error to yes. AC_DEFUN([XFORMS_ERROR],[ xforms_error_txt="$xforms_error_txt ** $1 " xforms_error=yes]) dnl Usage: XFORMS_WARNING(message) Displays the warning "message" and sets the dnl flag xforms_warning to yes. AC_DEFUN([XFORMS_WARNING],[ xforms_warning_txt="$xforms_warning_txt == $1 " xforms_warning=yes]) dnl Usage: XFORMS_LIB_ERROR(file,library) Displays an error message indication dnl that 'file' cannot be found because 'lib' may be uncorrectly installed. AC_DEFUN([XFORMS_LIB_ERROR],[ XFORMS_ERROR([Cannot find $1. Please check that the $2 library is correctly installed on your system.])]) dnl Usage: XFORMS_CHECK_ERRORS Displays a warning message if a XFORMS_ERROR dnl has occured previously. AC_DEFUN([XFORMS_CHECK_ERRORS],[ if test x$xforms_error = xyes; then cat </dev/null`" = SunOS && uname -r | grep '^5' >/dev/null; then if test $ac_cv_cxx_compiler_gnu = yes ; then $1="${$1} -Wl[,]-R$2" else $1="${$1} -R$2" fi fi]) dnl Usage: XFORMS_ADD_INC_DIR(var-name,dir) Adds a -I directive to variable dnl var-name. AC_DEFUN([XFORMS_ADD_INC_DIR],[$1="${$1} -I$2 "]) dnl this is used by the macro below to general a proper config.h.in entry m4_define([XFORMS_AH_CHECK_DECL], [AH_TEMPLATE(AS_TR_CPP(HAVE_DECL_$1), [Define if you have the prototype for function `$1'])]) dnl Check things are declared in headers to avoid errors or warnings. dnl Called like XFORMS_CHECK_DECL(function, header1 header2...) dnl Defines HAVE_DECL_{FUNCTION} AC_DEFUN([XFORMS_CHECK_DECL], [XFORMS_AH_CHECK_DECL($1) for ac_header in $2 do AC_MSG_CHECKING([if $1 is declared by header $ac_header]) AC_EGREP_HEADER($1, $ac_header, [AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_DECL_$1)) break], [AC_MSG_RESULT(no)]) done]) # Macro added for some Cygwin-specific support -*- sh -*- # @author@: Kayvan Sylvan AC_DEFUN([CHECK_WITH_CYGWIN], [ case $host_os in cygwin* | mingw* | pw32* ) if test "$GCC" = yes; then # Ensure MSVC-compatible struct packing convention. # Depends on GCC version. gcc2 uses -fnative-struct while # gcc3 uses -mms-bitfields. # msnative_struct='' AC_MSG_CHECKING([how to get MSVC-compatible struct packing]) case `$CC --version | sed -e 's,\..*,.,' -e q` in 2.) if $CC -v --help 2>/dev/null | grep fnative-struct > /dev/null; then msnative_struct='-fnative-struct' fi ;; *) if $CC -v --help 2>/dev/null | grep ms-bitfields > /dev/null; then msnative_struct='-mms-bitfields' fi ;; esac if test x"$msnative_struct" = x; then AC_MSG_RESULT([no way]) AC_MSG_WARN([produced libraries might be incompatible with MSVC libs]) else CXXFLAGS="$CXXFLAGS $msnative_struct" AC_MSG_RESULT([${msnative_struct}]) fi fi # Export all symbols to Win32 DLL using MinGW 2.0 ld. WIN32_LD_EXPORT_ALL_SYMBOLS='' AC_MSG_CHECKING([whether ld accepts --export-all-symbols]) if $LD --help 2>&1 | egrep 'export-all-symbols' > /dev/null; then WIN32_LD_EXPORT_ALL_SYMBOLS='-Wl,--export-all-symbols' AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi if test x"$WIN32_LD_EXPORT_ALL_SYMBOLS" != x; then LDFLAGS="$LDFLAGS $WIN32_LD_EXPORT_ALL_SYMBOLS" fi ;; esac ]) xforms-1.2.4/aclocal.m40000664000175000017500000016524012353624172011634 00000000000000# generated automatically by aclocal 1.11.3 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, # Inc. # This file 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. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, [m4_warning([this file was generated for autoconf 2.68. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file 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. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file 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. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file 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. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file 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. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software # Foundation, Inc. # # This file 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. # serial 1 # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.3], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.3])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file 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. # serial 1 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file 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. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, # 2010, 2011 Free Software Foundation, Inc. # # This file 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. # serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file 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. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file 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. # serial 16 # 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. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, # Inc. # # This file 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. # serial 1 # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file 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. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, # 2011 Free Software Foundation, Inc. # # This file 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. # serial 5 # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless `enable' is passed literally. # For symmetry, `disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful (and sometimes confusing) to the casual installer], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file 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. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file 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. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, # Inc. # # This file 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. # serial 1 # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software # Foundation, Inc. # # This file 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. # serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file 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. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # 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" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $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]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file 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. # serial 1 # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file 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. # serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file 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. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([acinclude.m4]) xforms-1.2.4/image/0000775000175000017500000000000012353624653011132 500000000000000xforms-1.2.4/image/flimage_int.h0000644000175000017500000001576612247447500013512 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1996-2001 T.C. Zhao * All rights reserved. * * Headers used internally by image support */ #ifndef FLIMAGE_INT_H_ #define FLIMAGE_INT_H_ #include "ulib.h" #define fli_safe_free( p ) do { \ if ( p ) \ { \ fl_free( p ); \ p = NULL; \ } \ } while( 0 ) typedef struct flimageIO { const char * formal_name; const char * short_name; const char * signature; const char * extension; int type; FLIMAGE_Identify identify; FLIMAGE_Description read_description; FLIMAGE_Read_Pixels read_pixels; FLIMAGE_Write_Image write_image; int annotation; } FLIMAGE_IO; typedef struct { int w, h; int type; void * pixels; } FLIMAGE_BUFFER; /* Subimage for convolve etc */ typedef struct { int w, h; void * mat[ 3 ]; int comp; /* number of components */ } SubImage; SubImage * flimage_get_subimage( FL_IMAGE * im, int make ); #define FL_IsGray( t ) ( t == FL_IMAGE_GRAY || t == FL_IMAGE_GRAY16 ) #define FL_IsCI( t ) ( t == FL_IMAGE_CI || t == FL_IMAGE_MONO ) #define FLIMAGE_MAXLUT ( 1 << FL_LUTBITS ) extern FLIMAGE_IO *flimage_io; typedef int ( * FLIMAGE_QUANTIZE_RGB )( unsigned char **, unsigned char **, unsigned char **, int, int, int, unsigned short **, int *, int *, int *, int *, FL_IMAGE * ); typedef int ( * FLIMAGE_QUANTIZE_PACKED )( unsigned int **, int, int, int, unsigned short **, int *, int *, int *, int *, FL_IMAGE * ); extern FLIMAGE_QUANTIZE_RGB flimage_quantize_rgb; extern FLIMAGE_QUANTIZE_PACKED flimage_quantize_packed; void flimage_replace_image( FL_IMAGE *, int, int, void *, void *, void * ); int flimage_transform( FL_IMAGE *, int, int, float m[ ][ 2 ], float *shift, unsigned int, int subp ); int flimage_getmem( FL_IMAGE * ); void flimage_freemem( FL_IMAGE * ); void flimage_add_comments( FL_IMAGE *, const char *, int ); int j2pass_quantize_rgb( unsigned char **, unsigned char **, unsigned char **, int, int, int, unsigned short **, int *, int *, int *, int *, FL_IMAGE * ); int j2pass_quantize_packed( unsigned int **, int, int, int, unsigned short **, int *, int *, int *, int *, FL_IMAGE * ); /* These numbers can be anything, but should be less than < 128 and may not equal 0 */ enum { FL_GET_MATRIX = 100, FL_MAKE_MATRIX }; void flimage_enable_gzip( void ); void flimage_invalidate_pixels( FL_IMAGE * ); int flimage_get_closest_color_from_map( FL_IMAGE *, unsigned int ); int flimage_replace_pixel( FL_IMAGE *, unsigned int, unsigned int ); void flimage_free_gray( FL_IMAGE * ); void flimage_free_ci( FL_IMAGE * ); void flimage_free_rgb( FL_IMAGE * ); void pack_bits( unsigned char *, unsigned short *, int ); void unpack_bits( unsigned short *, unsigned char *, int ); void flimage_error( FL_IMAGE *, const char *, ... ); void flimage_enable_genesis( void ); int fl_spline_int_interpolate( const int *, const int *, int, int, int * ); unsigned int fl_value_to_bits( unsigned int val ); int flimage_get_linearlut( FL_IMAGE * ); void flimage_free_linearlut( FL_IMAGE * ); FLIMAGE_IO *flimage_find_imageIO( const char * ); void flimage_display_markers( FL_IMAGE * ); unsigned long flimage_color_to_pixel( FL_IMAGE *, int, int, int, int * ); int flimage_write_annotation( FL_IMAGE * ); int flimage_read_annotation( FL_IMAGE * ); int flimage_swapbuffer( FL_IMAGE * ); FL_IMAGE *flimage_dup_( FL_IMAGE *, int ); int flimage_to_ximage( FL_IMAGE *, FL_WINDOW, XWindowAttributes * ); #if ! defined( SEEK_SET ) #define SEEK_SET 0 #endif #if ! defined( SEEK_CUR ) #define SEEK_CUR 1 #endif #if ! defined( SEEK_END ) #define SEEK_END 2 #endif #endif /* FLIMAGE_INT_H */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/Makefile.in0000664000175000017500000005413412353624173013123 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/config/common.am subdir = image ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libflimage_la_DEPENDENCIES = ../lib/libforms.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_libflimage_la_OBJECTS = image.lo image_bmp.lo image_combine.lo \ image_convolve.lo image_crop.lo image_disp.lo image_fits.lo \ image_genesis.lo image_gif.lo image_gzip.lo image_io_filter.lo \ image_jpeg.lo image_jquant.lo image_marker.lo image_png.lo \ image_pnm.lo image_postscript.lo image_proc.lo \ image_replace.lo image_rotate.lo image_scale.lo image_sgi.lo \ image_text.lo image_tiff.lo image_type.lo image_warp.lo \ image_xbm.lo image_xpm.lo image_xwd.lo postscript.lo \ ps_core.lo ps_draw.lo ps_text.lo rgb_db.lo matrix.lo libflimage_la_OBJECTS = $(am_libflimage_la_OBJECTS) libflimage_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libflimage_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/lib depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libflimage_la_SOURCES) DIST_SOURCES = $(libflimage_la_SOURCES) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FL_FIXLEVEL = @FL_FIXLEVEL@ FL_REVISION = @FL_REVISION@ FL_VERSION = @FL_VERSION@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIB = @JPEG_LIB@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ TEXI2DVI = @TEXI2DVI@ TEXI2DVI_NEEDS_PDF = @TEXI2DVI_NEEDS_PDF@ TEXI2HTML = @TEXI2HTML@ VERSION = @VERSION@ XMKMF = @XMKMF@ XPM_LIB = @XPM_LIB@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign DISTCLEANFILES = *.orig *.rej *~ *.bak core makelog MAINTAINERCLEANFILES = $(srcdir)/Makefile.in makelog AM_INSTALL_DATA_FLAGS = $(INSTALL) -m 644 -D INCLUDES = -DMAKING_FORMS $(X_CFLAGS) include_HEADERS = flimage.h lib_LTLIBRARIES = libflimage.la libflimage_la_LDFLAGS = -no-undefined -version-info @SO_VERSION@ libflimage_la_LIBADD = ../lib/libforms.la $(JPEG_LIB) $(X_LIBS) -lX11 libflimage_la_SOURCES = \ flimage.h \ flimage_int.h \ image.c \ image_bmp.c \ image_combine.c \ image_convolve.c \ image_crop.c \ image_disp.c \ image_fits.c \ image_genesis.c \ image_gif.c \ image_gzip.c \ image_io_filter.c \ image_jpeg.c \ image_jquant.c \ image_marker.c \ image_png.c \ image_pnm.c \ image_postscript.c \ image_proc.c \ image_replace.c \ image_rotate.c \ image_scale.c \ image_sgi.c \ image_text.c \ image_tiff.c \ image_type.c \ image_warp.c \ image_xbm.c \ image_xpm.c \ image_xwd.c \ postscript.c \ ps_core.c \ ps_draw.c \ ps_text.c \ rgb_db.c \ matrix.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/common.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign image/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign image/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/common.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libflimage.la: $(libflimage_la_OBJECTS) $(libflimage_la_DEPENDENCIES) $(EXTRA_libflimage_la_DEPENDENCIES) $(libflimage_la_LINK) -rpath $(libdir) $(libflimage_la_OBJECTS) $(libflimage_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_bmp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_combine.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_convolve.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_crop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_disp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_fits.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_genesis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_gif.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_gzip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_io_filter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_jpeg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_jquant.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_marker.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_png.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_pnm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_postscript.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_proc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_replace.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_rotate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_scale.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_sgi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_tiff.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_type.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_warp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_xbm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_xpm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_xwd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matrix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/postscript.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ps_core.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ps_draw.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ps_text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rgb_db.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-includeHEADERS install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-includeHEADERS \ uninstall-libLTLIBRARIES # 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: xforms-1.2.4/image/image_marker.c0000644000175000017500000004155012251675266013647 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1998-2002 T.C. Zhao * All rights reserved. * * Handling misc. geometric markers * * TODO: consolidate symbol and markers. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "flimage.h" #include "flimage_int.h" #include #include #ifndef M_PI #define M_PI 3.1415926f #endif #define Min( a, b ) ( ( a ) < ( b ) ? ( a ) : ( b ) ) typedef void ( * Draw )( FLIMAGE_MARKER * ); static void draw_delta( FLIMAGE_MARKER * ); static void draw_arrow( FLIMAGE_MARKER * ); static void draw_thinarrow( FLIMAGE_MARKER * ); static void draw_cross( FLIMAGE_MARKER * ); static void draw_rect( FLIMAGE_MARKER * ); static void draw_oval( FLIMAGE_MARKER * ); static void draw_line( FLIMAGE_MARKER * ); static void draw_star( FLIMAGE_MARKER * ); typedef struct { const char * name; Draw draw_marker; const char * psdraw; } MARKER; /* M(moveto) LT(lineto) S(stroke) F(fill) LW(setlinewidth) C(closepath) */ static char ps_cross[ ] = "-1 0 1 0 L 0 -1 0 1 L"; static char ps_rect[ ] = "-1 1 -1 -1 L 1 1 LT 1 -1 LT C"; static char ps_delta[ ] = " -1 -1 0 1 L 1 -1 LT C"; static char ps_oval[ ] = " 0 0 1 0 360 arc"; static char ps_line[ ] = "0 1 0 -1 L"; static char ps_star[ ] = "0 1 0.2245 0.309 L -0.2245 0.309 LT -0.9511 0.309 LT\n" "-0.3633 -0.118 LT -0.5878 -0.809 LT 0 -0.382 LT 0.5878 -0.809 LT\n" "0.3633 -0.1180 LT 0.9511 0.309 LT 0.2245 0.309 LT C "; static char ps_arrow[ ] = "1 0 M 0.3 0.7 LT 0.3 0.3 LT -1 0.3 LT " "-1 -0.3 LT 0.3 -0.3 LT 0.3 -0.7 LT C"; static char ps_thinarrow[ ] = "1 0 M 0.6 0.4 LT 0.6 0.1 LT -1 0.1 LT " "-1 -0.1 LT 0.6 -0.1 LT 0.6 -0.4 LT C"; #define MaxMarkers 32 static MARKER markers[ MaxMarkers ] = { { "oval", draw_oval, ps_oval }, { "cross", draw_cross, ps_cross }, { "delta", draw_delta, ps_delta }, { "rect", draw_rect, ps_rect }, { "arrow", draw_arrow, ps_arrow }, { "thinarrow", draw_thinarrow, ps_thinarrow }, { "line", draw_line, ps_line }, { "star", draw_star, ps_star }, /* sentinel */ { NULL, NULL, NULL } }; /*************************************** ***************************************/ static MARKER * get_marker( const char *name ) { MARKER *m; for ( m = markers; m->name; m++ ) if ( ! strcmp( name, m->name ) ) return m; return 0; } /*************************************** ***************************************/ int flimage_define_marker( const char * name, void ( * draw )( FLIMAGE_MARKER * ), const char * psdraw ) { MARKER *m, *me; if ( ! name || ! *name || ! psdraw ) return -1; if ( ( m = get_marker( name ) ) ) { m->draw_marker = draw; m->psdraw = fl_strdup( psdraw ); return 0; } /* a new marker */ for ( m = markers, me = m + MaxMarkers - 1; m < me; m++ ) { if ( ! m->name ) { m->name = fl_strdup( name ); m->draw_marker = draw; m->psdraw = fl_strdup( psdraw ); break; } } return m->name ? 0 : -1; } /*************************************** ***************************************/ int flimage_add_marker( FL_IMAGE * im, const char * name, double x, double y, double w, double h, int style, int fill, int rot, unsigned int col, unsigned int bcol ) { int nm = im->nmarkers; FLIMAGE_MARKER *imarker; MARKER *m; if ( ! im ) { M_err( "AddMarker", "Bad image" ); return -1; } if ( ! name || ! *name || ! ( m = get_marker( name ) ) ) { flimage_error( im, "unknown marker: %s", name ); return -1; } im->marker = fl_realloc( im->marker, ( nm + 1 ) * sizeof *im->marker ); if ( ! im->marker ) return -1; while ( rot > 3600 ) rot -= 3600; while ( rot < 0 ) rot += 3600; imarker = im->marker + im->nmarkers; memset( imarker, 0, sizeof *imarker ); imarker->name = m->name; imarker->psdraw = m->psdraw; imarker->fill = fill != 0; imarker->angle = rot; imarker->color = col; imarker->bcolor = bcol; imarker->style = ( style >= 0 && style <= FL_LONGDASH ) ? style : FL_SOLID; imarker->x = im->xdist_offset + x * im->xdist_scale; imarker->y = im->ydist_offset + y * im->ydist_scale; imarker->w = w * im->xdist_scale; imarker->h = h * im->ydist_scale; im->free_markers = flimage_delete_all_markers; im->display_markers = flimage_display_markers; return ++im->nmarkers; } /*************************************** ***************************************/ int flimage_add_marker_struct( FL_IMAGE * im, const FLIMAGE_MARKER * min ) { int nm = im->nmarkers; FLIMAGE_MARKER *imarker; MARKER *m; if ( ! im || ! min ) return -1; if ( ! min->name || ! ( m = get_marker( min->name ) ) ) { M_err( "AddMarker", "bad marker name: %s", min->name ); return -1; } if ( im->marker ) im->marker = fl_realloc( im->marker, sizeof *im->marker * ( nm + 1 ) ); else im->marker = fl_malloc( sizeof *im->marker * ( nm + 1 ) ); if ( ! im->marker ) return -1; imarker = im->marker + nm; memcpy( imarker, min, sizeof *im->marker ); imarker->name = m->name; imarker->psdraw = m->psdraw; im->free_markers = flimage_delete_all_markers; im->display_markers = flimage_display_markers; return ++im->nmarkers; } /*************************************** ***************************************/ void flimage_delete_all_markers( FL_IMAGE * im ) { if ( ! im ) return; if ( im->marker ) fl_free( im->marker ); im->marker = 0; im->nmarkers = 0; } /*************************************** ***************************************/ void flimage_display_markers( FL_IMAGE * im ) { int r, g, b, newpix; unsigned long pixel; FLIMAGE_MARKER *m, *mend; MARKER *active; if ( im->dont_display_marker ) return; if ( ! im->markergc ) im->markergc = XCreateGC( im->xdisplay, im->win, 0, 0 ); for ( m = im->marker, mend = m + im->nmarkers; m < mend; m++ ) { active = get_marker( m->name ); if ( active && active->draw_marker ) { FL_UNPACK( m->color, r, g, b ); pixel = flimage_color_to_pixel( im, r, g, b, &newpix ); m->gc = im->markergc; m->win = im->win; m->display = im->xdisplay; m->x += im->wxd - im->sxd; m->y += im->wyd - im->syd; XSetForeground( m->display, m->gc, pixel ); fli_xlinestyle( m->display, m->gc, m->style ); active->draw_marker( m ); m->x -= im->wxd - im->sxd; m->y -= im->wyd - im->syd; if ( newpix ) XFreeColors( m->display, im->xcolormap, &pixel, 1, 0 ); } } } /********************************************************************** * Local support routines. Debatible if we should make use of symbol stuff *********************************************************************/ /*************************************** * rotate the coordinates by angle, with the rotation axis at (xo,yo) ***************************************/ static void rotate( FL_POINT * p, int n, int angle, int xo, int yo ) { static int last_angle; static double sina = 0, cosa = 1; int i, tx, ty; if ( angle == 0 || angle == 3600 ) return; if ( last_angle != angle ) { last_angle = angle; sina = sin( angle * M_PI / 1800.0 ); cosa = cos( angle * M_PI / 1800.0 ); } for ( i = 0; i < n; i++ ) { tx = p[ i ].x - xo; ty = p[ i ].y - yo; p[ i ].x = xo + tx * cosa + ty * sina + 0.5; p[ i ].y = yo - tx * sina + ty * cosa + 0.5; } } typedef struct { float x, y; } FL_FPOINT; static void rotatef( FL_FPOINT * p, int n, int angle, int xo, int yo) { static int last_angle; static double sina, cosa; int i, tx, ty; if ( angle == 0 || angle == 3600 ) return; if ( last_angle != angle ) { last_angle = angle; sina = sin( angle * M_PI / 1800.0 ); cosa = cos( angle * M_PI / 1800.0 ); } for ( i = 0; i < n; i++ ) { tx = p[ i ].x - xo; ty = p[ i ].y - yo; p[ i ].x = xo + tx * cosa + ty * sina; p[ i ].y = yo - tx * sina + ty * cosa; } } /*************************************** ***************************************/ static void scalef( FL_FPOINT * p, FL_FPOINT * pout, int n, int xscale, int yscale ) { int i; for ( i = 0; i < n; i++ ) { pout[ i ].x = p[ i ].x * xscale; pout[ i ].y = p[ i ].y * yscale; } } #define fill_point( p, sx, sy ) ( p.x = sx, p.y = sy ) /*************************************** ***************************************/ static void draw_cross( FLIMAGE_MARKER * m ) { int w = m->w / 2, h = m->h / 2; int xo = m->x, yo = m->y; FL_POINT p[ 4 ]; fill_point( p[ 0 ], xo - w, yo ); fill_point( p[ 1 ], xo + w, yo ); fill_point( p[ 2 ], xo, yo - h ); fill_point( p[ 3 ], xo, yo + h ); rotate( p, 4, m->angle, xo, yo ); XDrawLine( m->display, m->win, m->gc, p[ 0 ].x, p[ 0 ].y, p[ 1 ].x, p[ 1 ].y ); XDrawLine( m->display, m->win, m->gc, p[ 2 ].x, p[ 2 ].y, p[ 3 ].x, p[ 3 ].y ); } #define SEG 60 /*************************************** ***************************************/ static void draw_oval( FLIMAGE_MARKER * m ) { int xo = m->x, yo = m->y; int w = m->w / 2, h = m->h / 2; if ( m->angle % 3600 == 0 || w == h ) { ( m->fill ? XFillArc : XDrawArc ) ( m->display, m->win, m->gc, m->x - w, m->y - h, m->w, m->h, 0, 360 * 64 ); } else { static int mode = CoordModeOrigin; static FL_FPOINT fp[ SEG ], pp[ SEG ]; static int first = 1; int i; FL_POINT p[ SEG + 1 ]; if ( first ) { double t; for ( t = 0, i = 0; i < SEG; i++, t += 360.0 / ( SEG + 1 ) ) { fp[ i ].x = cos( t * M_PI / 180.0 ); fp[ i ].y = sin( t * M_PI / 180.0 ); } first = 0; } scalef( fp, pp, SEG, w, h ); rotatef( pp, SEG, m->angle, 0, 0 ); for ( i = 0; i < SEG; i++ ) { p[ i ].x = xo + pp[i].x + 0.5; p[ i ].y = yo - pp[i].y + 0.5; } fill_point( p[ SEG ], p[ 0 ].x, p[ 0 ].y ); if ( ! m->fill ) XDrawLines( m->display, m->win, m->gc, p, SEG + 1, mode ); else XFillPolygon( m->display, m->win, m->gc, p, SEG, Nonconvex, mode ); } } /*************************************** ***************************************/ static void draw_rect( FLIMAGE_MARKER * m ) { static int mode = CoordModeOrigin; int w = m->w / 2, h = m->h / 2; int xo = m->x, yo = m->y; FL_POINT p[ 5 ]; fill_point( p[ 0 ], xo - w, yo + h ); fill_point( p[ 1 ], xo + w, yo + h ); fill_point( p[ 2 ], xo + w, yo - h ); fill_point( p[ 3 ], xo - w, yo - h ); rotate( p, 4, m->angle, xo, yo ); fill_point( p[ 4 ], p[ 0 ].x, p[ 0 ].y ); if ( ! m->fill ) XDrawLines( m->display, m->win, m->gc, p, 5, mode ); else XFillPolygon( m->display, m->win, m->gc, p, 4, Convex, mode ); } /*************************************** ***************************************/ static float arrow_xhead, arrow_yhead, arrow_rod; static void drw_arrow( FLIMAGE_MARKER * m ) { static int mode = CoordModeOrigin; int w = m->w / 2, h = m->h / 2; int xo = m->x, yo = m->y; int xhead = 2 + ( int ) ( w * arrow_xhead ); int yhead = 2 + ( int ) ( h * arrow_yhead ); int rod = ( int ) ( h * arrow_rod ); FL_POINT p[ 8 ]; xhead = yhead = Min( xhead, yhead ); fill_point( p[ 0 ], xo - w, yo + rod ); fill_point( p[ 1 ], xo + w - xhead, yo + rod ); fill_point( p[ 2 ], xo + w - xhead, yo + yhead ); fill_point( p[ 3 ], xo + w, yo ); fill_point( p[ 4 ], xo + w - xhead, yo - yhead ); fill_point( p[ 5 ], xo + w - xhead, yo - rod ); fill_point( p[ 6 ], xo - w, yo - rod ); rotate( p, 7, m->angle, xo, yo ); fill_point( p[ 7 ], p[ 0 ].x, p[ 0 ].y ); if ( ! m->fill ) XDrawLines( m->display, m->win, m->gc, p, 8, mode ); else XFillPolygon( m->display, m->win, m->gc, p, 7, Nonconvex, mode ); } /*************************************** ***************************************/ static void draw_arrow( FLIMAGE_MARKER * m ) { arrow_xhead = arrow_yhead = 0.52; arrow_rod = 0.3; drw_arrow( m ); } /*************************************** ***************************************/ static void draw_thinarrow( FLIMAGE_MARKER * m ) { arrow_xhead = arrow_yhead = 0.26; arrow_rod = 0.15; drw_arrow( m ); } /*************************************** ***************************************/ static void draw_line( FLIMAGE_MARKER * m ) { int w = m->w / 2; int xo = m->x, yo = m->y; FL_POINT p[ 2 ]; fill_point( p[ 0 ], xo - w, yo ); fill_point( p[ 1 ], xo + w, yo ); rotate( p, 2, m->angle, xo, yo ); XDrawLine( m->display, m->win, m->gc, p[ 0 ].x, p[ 0 ].y, p[ 1 ].x, p[ 1 ].y); } /*************************************** ***************************************/ static void draw_delta( FLIMAGE_MARKER * m ) { static int mode = CoordModeOrigin; int w = m->w / 2, h = m->h / 2; int xo = m->x, yo = m->y; FL_POINT p[ 4 ]; fill_point( p[ 0 ], xo - w, yo + h ); fill_point( p[ 1 ], xo + w, yo + h ); fill_point( p[ 2 ], xo , yo - h ); rotate( p, 3, m->angle, xo, yo ); fill_point( p[ 3 ], p[ 0 ].x, p[ 0 ].y ); if ( ! m->fill ) XDrawLines( m->display, m->win, m->gc, p, 4, mode ); else XFillPolygon( m->display, m->win, m->gc, p, 3, Convex, mode ); } /*************************************** ***************************************/ static void draw_star( FLIMAGE_MARKER * m ) { static int mode = CoordModeOrigin; int w = m->w / 2, h = m->h / 2; int xo = m->x, yo = m->y; FL_POINT p[ 11 ]; static FL_FPOINT fp[ 10 ], pp[ 10 ]; static int first = 1; int i; /* generate a unit star */ if ( first ) { float t, l = sin( 18.0 * M_PI / 180.0 ) / sin( 54.0 * M_PI / 180.0 ); for ( i = 0, t = 54.0; i < 10; i += 2, t += 72.0 ) { fp[ i ].x = l * cos( t * M_PI / 180.0 ); fp[ i ].y = l * sin( t * M_PI / 180.0 ); } for ( i = 1, t = 90.0; i < 10; i += 2, t += 72.0 ) { fp[ i ].x = cos( t * M_PI / 180.0 ); fp[ i ].y = sin( t * M_PI / 180.0 ); } first = 0; } scalef( fp, pp, 10, w, h ); rotatef( pp, 10, m->angle, 0, 0 ); for ( i = 0; i < 10; i++ ) { p[ i ].x = xo + pp[i].x + 0.5; p[ i ].y = yo - pp[i].y + 0.5; } fill_point( p[ 10 ], p[ 0 ].x, p[ 0 ].y ); if ( ! m->fill ) XDrawLines( m->display, m->win, m->gc, p, 11, mode ); else XFillPolygon( m->display, m->win, m->gc, p, 10, Nonconvex, mode ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_gif.c0000644000175000017500000007702712251675306013136 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1993, 1998-2002 By T.C. Zhao * All rights reserved. * * BUGS: delay & input not handled * * "The Graphics Interchange Format(c) is the Copyright property of * CompuServ Incorporated. GIF(sm) is a Service Mark property of * CompuServ Incorporated. * * Signature * screen descriptor * global map * image descriptor --- 1 * raster --- 2 * terminator * * 1 & 2 can be repeated. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" #define IMAGESEP 0x2C /* ',' */ /*************************************** ***************************************/ static int GIF_identify( FILE * fp ) { char buf[ 7 ]; if ( fread( buf, 1, 6, fp ) != 6 ) return 0; rewind( fp ); return buf[ 0 ] == 'G' && buf[ 1 ] == 'I' && buf[ 2 ] == 'F' && buf[ 5 ] == 'a'; } static int read_descriptor_block( FL_IMAGE * im ); static int skip_extension( FILE * fp, FL_IMAGE * ); static void read_map( FL_IMAGE * ); /* plain text extension */ typedef struct { char str[ 512 ]; int x, y; int cw, ch; int tw, th; int tran; int bc, tc; } GIFTEXT; /* graphics control extension */ typedef struct { int tran; int delay; int input; int tran_col; } GIFGCNTL; #define MAXGIFTEXT 5 typedef struct { int interlace; int lsx, lsy; int bkcolor; int aspect; int cur_total; int globalmap; GIFGCNTL gc; int ctext; GIFTEXT giftext[ MAXGIFTEXT ]; } SPEC; static int GIF_next( FL_IMAGE * ); /*************************************** ***************************************/ static int GIF_description( FL_IMAGE * im ) { unsigned char buf[ 15 ]; FILE *fp = im->fpin; SPEC *sp = fl_calloc( 1, sizeof *sp ); im->io_spec = sp; im->spec_size = sizeof *sp; im->next_frame = GIF_next; sp->gc.tran = 0; /* identify should've already checked signature. */ if ( fread( buf, 1, 6, fp ) != 6 || fread( buf, 1, 7, fp ) != 7 ) { flimage_error( im, "%s: error while reading gif file", im->infile ); return -1; } sp->lsx = buf[ 0 ] + ( buf[ 1 ] << 8 ); sp->lsy = buf[ 2 ] + ( buf[ 3 ] << 8 ); sp->globalmap = buf[ 4 ] & 0x80; im->map_len = 1 << ( 1 + ( buf[ 4 ] & 0x07 ) ); flimage_getcolormap( im ); sp->bkcolor = buf[ 5 ]; sp->aspect = buf[ 6 ] ? ( int ) ( 1000.0 * ( buf[ 6 ] + 15 ) / 64.0 ) : 1000; /* err= buf[4] & 0x08; */ if ( sp->globalmap ) read_map( im ); return read_descriptor_block( im ); } /*************************************** ***************************************/ static void read_map( FL_IMAGE * im ) { int i; for ( i = 0; i < im->map_len; i++ ) { im->red_lut[ i ] = getc( im->fpin ); im->green_lut[ i ] = getc( im->fpin ); im->blue_lut[ i ] = getc( im->fpin ); } } /*************************************** ***************************************/ static void write_map( FL_IMAGE * im, int n ) { int i; for ( i = 0; i < im->map_len; i++ ) { putc( im->red_lut[ i ], im->fpout ); putc( im->green_lut[ i ], im->fpout ); putc( im->blue_lut[ i ], im->fpout ); } for ( ; i < n; i++ ) { putc( 0, im->fpout ); putc( 0, im->fpout ); putc( 0, im->fpout ); } } /*************************************** ***************************************/ static void generate_header_info( FL_IMAGE *im ) { SPEC *sp = im->io_spec; char buf[ 128 ]; if ( ! im->info && ! ( im->info = fl_malloc( 1024 ) ) ) return; sprintf( im->info, "Size=(%d x %d)\n", im->w, im->h ); sprintf( buf,"Colors=%d\nGlobalmap=%d\n", im->map_len, sp->globalmap ); strcat( im->info,buf ); sprintf( buf,"Aspect=%d\nInterlace=%d\n", sp->aspect, sp->interlace ); strcat( im->info, buf ); sprintf( buf,"Offset=(%d %d)\n", im->wx, im->wy ); strcat( im->info, buf ); } /*************************************** ***************************************/ static int read_descriptor_block( FL_IMAGE * im ) { int local_map, inbyte; FILE *fp = im->fpin; SPEC *sp = im->io_spec; /* Read the extension if any, and do nothing about it until get the image separator */ if ( skip_extension( fp, im ) != IMAGESEP ) { flimage_error( im, "%s: no separator or BadBlockMarker", im->infile ); return -1; } /* offset relative to lsx and lsy */ im->wx = fli_fget2LSBF( fp ); im->wy = fli_fget2LSBF( fp ); /* True image size */ im->w = fli_fget2LSBF( fp ); im->h = fli_fget2LSBF( fp ); if ( sp->lsx < im->w || sp->lsy < im->h ) { M_info( "", "Bad screen description. LX=%d W=%d LY=%d H=%d", sp->lsx, im->w, sp->lsy, im->h ); sp->lsx = im->w; sp->lsy = im->h; } inbyte = getc( fp ); sp->interlace = ( inbyte & 0x40 ) != 0; local_map = ( inbyte & 0x80 ); if ( ! sp->globalmap && !local_map ) { M_err( "GIFDescriptor", "%s: No ColorMap", im->infile ); /* return -1; *//* might want to continue */ } /* If local map, replace the global map */ if ( local_map ) { local_map = ( inbyte & 0x07 ) + 1; im->map_len = 1 << local_map; flimage_getcolormap( im ); read_map( im ); } /* Handle transparency */ if ( sp->gc.tran && sp->gc.tran_col < im->map_len ) im->tran_index = sp->gc.tran_col; if ( im->setup->header_info ) generate_header_info( im ); return 0; } #define Badfread( a, b, c, d ) ( fread( a, b, c, d ) != ( c ) ) #define Badfwrite( a, b, c, d ) ( fwrite( a, b, c, d ) != ( c ) ) /*************************************** ***************************************/ static void convert_gif_text( FL_IMAGE * im ) { SPEC *sp = im->io_spec; GIFTEXT *p = sp->giftext, *ps = p + sp->ctext; unsigned int tcol, bcol; int x, y; int fsize; while ( p < ps ) { int tc = p->tc, bc = p->bc; if ( ! p->str[ 0 ] ) continue; /* gif text size is given in pixels, convert to point. 1pixel = 0.75pt for a typical screen */ if ( ( fsize = ( int ) ( FL_min( p->cw, p->ch ) * 0.75 ) ) < 6 ) fsize = 6; else if ( fsize > 24 ) fsize = 24; /* convert text position to image based */ x = p->x - im->wx; y = p->y - im->wy; tcol = FL_PACK3( im->red_lut[ tc ], im->green_lut[ tc ], im->blue_lut[ tc ] ); bcol = FL_PACK3( im->red_lut[ bc ], im->green_lut[ bc ], im->blue_lut[ bc ] ); flimage_add_text( im, p->str, strlen( p->str ), 0, fsize, tcol, bcol, ! p->tran, x, y, 0 ); p++; } } /******************* local functions ******************/ static int readextension( FILE *, FL_IMAGE * ); static int next_lineno( int, int, int ); static int process_lzw_code( FL_IMAGE *, int ); static void outputline( FL_IMAGE *, unsigned char * ); /****************** decoder variables ******************/ static const unsigned int gif_codemask[ ] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, 0x01ff, 0x03ff, 0x07ff, 0x0fff }; /*************************************** * ouptut line simply copies one scanline at a time to the master * image structure, taking into account the possibility of * interlacing ***************************************/ static void outputline( FL_IMAGE * im, unsigned char * line ) { unsigned short *po; unsigned char *pi = line; SPEC *sp = im->io_spec; static int lines; int k; if ( sp->cur_total == 0 ) /* first entry */ lines = 0; /* figure out the real row number if interlace */ k = next_lineno( lines, im->h, sp->interlace ); sp->cur_total += im->w; /* stop to avoid buffer overrun if k is bad */ if ( k >= im->h ) return; for ( po = im->ci[ k ], line += im->w; pi < line; ) *po++ = *pi++; im->completed = ++lines; if ( ! ( im->completed & FLIMAGE_REPFREQ ) ) im->visual_cue( im, "Reading GIF" ); } /*************************************** * Get a single data block ***************************************/ static int getblock( FILE * fp, char * buf ) { int count; if ( ( count = getc( fp ) ) != EOF && count != 0 ) count = fread( buf, 1, count, fp ); return count; } #define EXTENSION 0x21 /* '!' introducer */ #define GIFEXT_PT 0x01 /* plain text */ #define GIFEXT_APP 0xFF /* application */ #define GIFEXT_GC 0xF9 /* graphics control */ #define GIFEXT_COM 0xFE /* comment */ #define TRAILER 0x3b /*************************************** * As long as we are not doing the extension, print it out to stderr ***************************************/ static int readextension( FILE * fp, FL_IMAGE * im ) { SPEC *sp = im->io_spec; int count = 0, label; char buf[ 258 ]; const char *f = "GIF_ext"; GIFTEXT *t = sp->giftext + sp->ctext; label = getc( fp ); switch ( label ) { case GIFEXT_PT : /* plain text extension */ M_info( 0, "%s: PlainText Extension", im->infile ); if ( getc( fp ) != 12 ) { flimage_error( im, "%s: bad PlainText extension", im->infile ); return EOF; } t->x = fli_fget2LSBF( fp ); /* left wrt left edge of ls */ t->y = fli_fget2LSBF( fp ); t->tw = fli_fget2LSBF( fp ); /* total width */ t->th = fli_fget2LSBF( fp ); /* total width */ t->cw = fgetc( fp ); /* cell width */ t->ch = fgetc( fp ); /* cell height */ t->tc = fgetc( fp ); /* text color */ t->bc = fgetc( fp ); /* bk color */ t->tran = sp->gc.tran; t->str[ 0 ] = '\0'; while ( ( count = getblock( fp, buf ) ) != 0 && count != EOF ) { buf[ count ] = '\0'; M_info( 0, buf ); if ( strlen( t->str ) + count > sizeof t->str ) count = sizeof t->str - strlen( t->str ) - 1; strncat( t->str, buf, count ); } sp->ctext++; break; case GIFEXT_COM : /* a comment extension */ M_info( 0, "%s:Comment Extension", im->infile ); while ( ( count = getblock( fp, buf ) ) != 0 && count != EOF ) { buf[ count ] = '\0'; flimage_add_comments( im, buf, count ); } break; case GIFEXT_GC : /* graphics control */ M_info( 0, "%s:GraphicsControl extension", im->infile ); while ( ( count = getblock( fp, buf ) ) != 0 && count != EOF ) { sp->gc.tran = buf[ 0 ] & 1; sp->gc.input = buf[ 0 ] & 2; sp->gc.delay = 10 * ( buf[ 0 ] + ( buf[ 1 ] << 8 ) ); if ( sp->gc.tran ) sp->gc.tran_col = buf[ 3 ]; } break; case GIFEXT_APP : /* application extension */ M_info( 0, "%s:ApplicationExtension", im->infile ); if ( getc( fp ) != 11 ) /* block length */ M_warn( "GifExt", "wrong block length" ); if ( fread( buf, 1, 8, fp ) != 8 ) return EOF; buf[ 8 ] = '\0'; M_info( 0, buf ); if ( fread( buf, 1, 3, fp ) != 3 ) return EOF; while ( ( count = getblock( fp, buf ) ) != 0 && count != EOF ) { buf[ count ] = '\0'; M_info( 0, buf ); } break; default : M_err( f, "%s: Bogus extension byte 0x%02x", im->infile, label ); break; } return count; } /*************************************** ***************************************/ static int skip_extension( FILE * fp, FL_IMAGE * im ) { int pchar, err = 0; while ( ! err && ( pchar = getc( fp ) ) != EOF && pchar != IMAGESEP ) { switch ( pchar ) { case '\0' : case TRAILER : break; case EXTENSION : err = readextension( fp, im ); break; default : M_warn( "GIFextension", "%s: Bogus byte 0x%02x", im->infile, pchar ); return EOF; } } return err ? EOF : pchar; } #define LZW_INIT 9000 static int bpp, ClearCode, EOFCode, CodeSize; #include static unsigned char * lhead, *lbuf, *stackp; /* local buffers */ /*************************************** ***************************************/ static int GIF_load( FL_IMAGE * im ) { int bits = 0, err, count, code = -1; unsigned int datum = 0; unsigned char *ch, buf[ 257 ]; SPEC *sp = im->io_spec; const char *func = "GIFReadPix"; FILE *fp = im->fpin; sp->ctext = 0; CodeSize = getc( fp ); if ( CodeSize > 8 || CodeSize < 2 ) { flimage_error( im, "Load: Bad CodeSize %d(%s)", CodeSize, im->infile ); return -1; } /* initialize the decompressor */ err = sp->cur_total = 0; process_lzw_code( im, LZW_INIT ); while ( ! err && ( count = getc( fp ) ) != EOF && count > 0 ) { err = Badfread( buf, 1, ( size_t )count, fp ); for ( ch = buf; count-- > 0; ch++ ) { datum += *ch << bits; bits += 8; while ( bits >= CodeSize && ! err ) { code = datum & gif_codemask[ CodeSize ]; datum >>= CodeSize; bits -= CodeSize; err = code == EOFCode || process_lzw_code( im, code ); } } /* EOFcode is not exactly an errr */ if ( err && code == EOFCode ) err = 0; if ( code != EOFCode && sp->cur_total > (long) im->w * im->h ) { flimage_error( im, "%s: Raster full before EOI", im->infile ); err = 1; } } if ( ! err ) { if ( ( code = getc( fp ) ) == EXTENSION ) { ungetc( code, fp ); while ( ( code = skip_extension( fp, im ) ) != EOF && code != IMAGESEP ) /* empty */ ; } if ( code == IMAGESEP ) { im->more = 1; ungetc( IMAGESEP, fp ); } else if ( code != EOF && fread( buf, 1, 50, fp ) && getc( fp ) != EOF ) { M_info( func, "%s: Garbage(> 50bytes) at end", im->infile ); } } count = sp->cur_total / im->w; /* final check: get pixels that are decoded but yet to be output */ if ( count < im->h ) { int leftover; leftover = lbuf - lhead; M_warn( func, "total %ld should be %d", sp->cur_total + leftover, im->w * im->h ); if ( leftover ) outputline( im, lhead ); } /* if more than 1/4 image is read, return positive value so that driver will try to display it. */ convert_gif_text( im ); return count >= im->h / 4 ? count : -1; } /*************************************** * process_lzw_code - Process a compression code. "clear" resets the * code table. Otherwise make a new code table entry, and output the * bytes associated with the code. * * Based on gifpaste by Kipp Hickman @ Silicon Graphics ***************************************/ #define OUTPIX( c ) ( *lbuf++ = ( c ) ) #define MC_SIZE 4097 /*************************************** * if we've got more than one scanline, output ***************************************/ static void flush_buffer( FL_IMAGE * im ) { int incode; incode = lbuf - lhead; if ( incode >= im->w ) { int i; lbuf = lhead; while ( incode >= im->w ) { outputline( im, lbuf ); incode -= im->w; lbuf += im->w; } /* copy the left over */ for ( i = 0; i < incode; i++ ) lhead[ i ] = *lbuf++; lbuf = lhead + incode; } } /*************************************** ***************************************/ static int process_lzw_code( FL_IMAGE * im, int code ) { int incode; static unsigned char firstchar; static unsigned char stack[ MC_SIZE ]; static int avail, oldcode; static unsigned char suffix[ MC_SIZE ]; static unsigned short prefix[ MC_SIZE ]; if ( code == LZW_INIT ) { lbuf = lhead = fl_realloc( lhead, im->w + 1 + 4096 ); bpp = CodeSize; ClearCode = 1 << bpp; EOFCode = ClearCode + 1; CodeSize = bpp + 1; for ( incode = ClearCode; --incode >= 0; ) { *( suffix + incode ) = incode; *( prefix + incode ) = 0; } avail = ClearCode + 2; oldcode = -1; stackp = stack; return lbuf ? 0 : -1; } if ( code == ClearCode ) { CodeSize = bpp + 1; avail = ClearCode + 2; oldcode = -1; return 0; } /* this is possible only if the image file is corrupt */ if ( code > avail || code < 0 ) { flimage_error( im, "GIFLZW(%s): Bad code 0x%04x", im->infile, code ); return -1; } if ( oldcode == -1 ) { OUTPIX( suffix[ code ] ); firstchar = oldcode = code; /* Clive Stubbings. * There is the posibility of an image with just alternate * single code bytes and resets. I know thats really dumb, * but I found one and it took a long time to work out why * it crashed... * So flush the buffer before it overuns. */ flush_buffer( im ); return 0; } incode = code; if ( code == avail ) { /* the first code is always < avail */ *stackp++ = firstchar; code = oldcode; } while ( code > ClearCode ) { *stackp++ = suffix[ code ]; code = prefix[ code ]; } if ( avail >= 4096 ) { flimage_error( im, "GIFLZW(%s): BadBlock--TableFull", im->infile ); return -1; } *stackp++ = firstchar = suffix[ code ]; prefix[ avail ] = oldcode; suffix[ avail ] = firstchar; avail++; if ( ( avail & gif_codemask[ CodeSize ] ) == 0 && avail < 4096 ) CodeSize++; oldcode = incode; do { OUTPIX( *--stackp ); } while ( stackp > stack ); /* if we've got more than one scanline, output */ flush_buffer( im ); return 0; } /*************************************** ***************************************/ static int GIF_next( FL_IMAGE * im ) { int ow = im->w, oh = im->h; int ret; read_descriptor_block( im ); /* It would seem from the doc that it is possible new image could be larger than last one */ if ( ow != im->w || oh != im->h ) flimage_getmem( im ); #if 0 del_text( ); #endif im->more = 0; /* gif_load will do turn it on if more */ im->modified = 1; ret = GIF_load( im ); return ret; } /******************* END of DECODER ****************************}*****/ /*************************************** * Given GIF sequence no. i, starting from 0, figure out the image * sequence number. If interlaced, the sequence will be independent * of i, sort of a bug, but for this application, it is perfectly ok. ***************************************/ static int next_lineno( int i, int h, int interlace ) { static const int steps[ 5 ] = { 8, 8, 4, 2, 0 }; static const int start[ 5 ] = { 0, 4, 2, 1, 0 }; static int pass, sofar, current; int line; /* init for each image */ if ( i == 0 ) pass = sofar = current = 0; line = i; /* unless interlace */ if ( interlace ) { line = current; if ( ( current += steps[pass] ) >= h ) current = start[ ++pass ]; } sofar++; return line; } /******************************************************************** * GIF encoding routine. * Original code ********************************************************************/ /************************************************************ * Write image to a disk file in GIF format. ************************************************************/ /* current char, cchar, must be of signed type, and code and prefix must be * at least 12 bits long. */ typedef struct strspace_ { struct strspace_ * next; /* link */ int code; /* emit code */ int cchar; /* current char */ } Strtab; typedef struct { int prefix, cchar, code; } WorkStr; #define MAXTABL 4097 static Strtab *strtab[ MAXTABL ], strspace[ MAXTABL ]; /************************************************************** * Check if current string is already in the string table **************************************************************/ static int in_table( WorkStr * cstr ) { Strtab *p = strtab[ cstr->prefix ]; for ( ; p && p->cchar != cstr->cchar; p = p->next ) /* empty */ ; return p ? p->code : -1; } #define USE_TAB_FUNC /* * A macro and function are supplied to insert a string into the * string table. */ #ifdef USE_TAB_FUNC /*************************************** ***************************************/ static void addto_table( WorkStr * cstr, int code ) { Strtab *p = &strspace[ code ]; p->code = code; p->cchar = cstr->cchar; p->next = strtab[ cstr->prefix ]; strtab[ cstr->prefix ] = p; } #else #define addto_table(cstr, ccode ) \ do { \ Strtab *p = &strspace[ ccode ]; \ p->code = ccode; \ p->cchar = cstr->cchar; \ p->next = strtab[ cstr->prefix ]; \ strtab[ cstr->prefix ] = p; \ } while( 0 ) #endif static void output_lzw_code( unsigned int, FILE * ); static void init_table( int, FILE * ); #if 0 static unsigned short * get_scan_line( FL_IMAGE *, int ); #endif static int interlace; /*************************************** ***************************************/ void flimage_gif_output_options( int inter ) { interlace = inter; } /*************************************** * for now, only write max 255 chars ***************************************/ static void write_gif_comments( FILE * fp, const char * str ) { char s[ 256 ]; const char *p = str; int len, k = strlen( str ); for ( len = 0; p < str + k; p += len ) { strncpy( s, p, 255 ); s[ 255 ] = '\0'; len = strlen( s ); putc( EXTENSION, fp ); fputc( GIFEXT_COM, fp ); putc( len, fp ); fwrite( s, 1, len, fp ); putc( 0, fp ); } } /*************************************** ***************************************/ static int write_descriptor( FL_IMAGE * im ) { unsigned char buf[ 10 ]; FILE *ffp = im->fpout; if ( im->app_background >= 0 ) { int tran = flimage_get_closest_color_from_map( im, im->app_background ); buf[ 0 ] = GIFEXT_GC; buf[ 1 ] = 4; /* count */ buf[ 2 ] = 0x1; buf[ 3 ] = 0; buf[ 4 ] = 0; buf[ 5 ] = tran; buf[ 6 ] = 0; /* end of block */ putc( EXTENSION, ffp ); fwrite( buf, 1, 7, ffp ); } /* image descriptions */ buf[ 0 ] = IMAGESEP; buf[ 1 ] = buf[ 2 ] = buf[ 3 ] = buf[ 4 ] = 0; /* offsets */ if ( Badfwrite( buf, 1, 5, ffp ) ) return -1; /* raster dimensions */ fli_fput2LSBF( im->w, ffp ); fli_fput2LSBF( im->h, ffp ); /* local_gifmap, interlace, etc. only set interlace if requested */ putc( interlace ? 0x40 : 0, ffp ); return 0; } /*************************************** * write the image description ***************************************/ static int write_desc( FL_IMAGE * im, FILE * ffp ) { int packed; /* get bits per pixel first */ bpp = 0; while ( im->map_len > 1 << bpp ) bpp++; if ( bpp < 1 || bpp > 8 ) { M_err( "GIF_dump", "%s: Bad bpp=%d", im->outfile, bpp ); bpp = 1; } if ( Badfwrite("GIF89a", 1, 6, ffp ) ) { M_err( "GIF_dump", im->outfile ); return -1; } /* always write the same logical screen/image size */ fli_fput2LSBF( im->w, ffp ); fli_fput2LSBF( im->h, ffp ); packed = 0x80 /* always output global map */ + ( ( bpp - 1 ) << 4 ) /* cr. does not mean much */ + ( bpp - 1 ); /* bits_per_pixel-1 */ putc( packed, ffp ); putc( 0, ffp ); putc( 0, ffp ); /* bk color and aspect ratio */ /* global color map. Entries must be 2^N */ write_map( im, 1 << bpp ); if ( im->comments ) write_gif_comments( ffp, im->comments ); return 0; } /******************************************************************* * The encoder *******************************************************************/ /*************************************** ***************************************/ static int write_pixels( FL_IMAGE * im ) { int j, code, ccode; unsigned short *scan, *ss; WorkStr *cstr; int colors; WorkStr workstring; FILE *fp = im->fpout; /* IMPORTANT: number of colors handed to this routine might not be 2^n, need to make it so to fool the encoder (colors-1 need to be full bits) */ colors = 1 << bpp; /* min bpp by definition is no smaller than 2 */ if ( bpp < 2 ) bpp = 2; /* initial codesize */ putc( bpp, fp ); ClearCode = 1 << bpp; /* set clear and end codes */ EOFCode = ClearCode + 1; CodeSize = bpp + 1; /* start encoding */ init_table( colors, fp ); /* initialize the LZW tables */ cstr = &workstring; ccode = EOFCode + 1; cstr->prefix = -1; /* start raster stream. Old way of doing things, that is as soon as we get 4095, a clearcode is emitted. */ for ( j = 0; j < im->h; j++ ) { scan = im->ci[ next_lineno( j, im->h, interlace ) ]; for ( ss = scan + im->w; scan < ss; scan++ ) { cstr->cchar = *scan & ( colors - 1 ); if ( cstr->prefix >= 0 ) { if ( ( code = in_table( cstr ) ) >= 0 ) cstr->prefix = code; else { addto_table( cstr, ccode ); output_lzw_code( cstr->prefix, fp ); cstr->prefix = cstr->cchar; if ( ccode >= 1 << CodeSize ) CodeSize++; ccode++; if ( ccode >= 4096 ) { output_lzw_code( cstr->prefix, fp ); init_table( colors, fp ); ccode = EOFCode + 1; cstr->prefix = -1; } } } else { /* root entry */ cstr->prefix = cstr->code = cstr->cchar; } } } output_lzw_code( cstr->prefix, fp ); output_lzw_code( EOFCode, fp ); putc( 0, fp ); /* end block */ return fflush( fp ); } /*************************************** ***************************************/ static int GIF_write( FL_IMAGE * sim ) { int err = 0; FL_IMAGE *im; if ( write_desc( sim, sim->fpout ) < 0 ) return -1; for ( err = 0, im = sim; !err && im; im = im->next ) { im->fpout = sim->fpout; err = write_descriptor( im ) < 0 || write_pixels( im ) < 0; if ( im != sim ) im->fpout = 0; } putc( ';', sim->fpout ); /* end stream */ fflush( sim->fpout ); return err ? -1 : 0; } /*************************************** ***************************************/ static void init_table( int rootlen, FILE * fp ) { int i; Strtab *sp = strspace; output_lzw_code( ClearCode, fp ); CodeSize = bpp + 1; for ( i = 0; i < rootlen; i++, sp++ ) { sp->next = 0; sp->code = i; sp->cchar = -1; strtab[ i ] = sp; } for ( ; i < MAXTABL; i++, sp++ ) strtab[ i ] = sp->next = 0; } /******************************************************************* * Packing and output an LZW code(bpp+1 to 12 bits long). * * Note: accum must be at least 19 bits long. accum and bits must be * re-initialized when EOFCode is written out. *******************************************************************/ static void output_lzw_code( unsigned int code, FILE * fp ) { static unsigned int bytes, bits; static unsigned char bbuf[ 255 + 3 ]; static unsigned long accum; unsigned char *ch; accum &= gif_codemask[ bits ]; accum |= code << bits; bits += CodeSize; ch = bbuf + bytes; bytes += bits >> 3; while ( bits >= 8 ) { bits -= 8; *ch++ = ( unsigned char ) ( accum & 255 ); accum >>= 8; } if ( bytes >= 254 || ( int ) code == EOFCode ) { if ( ( int ) code == EOFCode && bits ) { *ch = ( unsigned char ) ( accum & 255 ); bytes++; bits = accum = 0; } putc(bytes, fp); fwrite( bbuf, 1, bytes, fp ); bytes = 0; } } /*************************************** ***************************************/ void flimage_enable_gif( void ) { flimage_add_format( "CompuServ GIF", "gif", "gif", FL_IMAGE_CI, GIF_identify, GIF_description, GIF_load, GIF_write); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/rgb_db.c0000644000175000017500000000461712251675167012446 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1997-2002 T.C. Zhao * All rights reserved. * * search the rgb.txt database for a specific color */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" /*************************************** * This function is retained for compatibility reasons only. * It returns 1 always. ***************************************/ int fl_init_RGBdatabase( const char * f FL_UNUSED_ARG ) { return 1; } /*************************************** * A new implementation from Rouben Rostamian * Changed to make it work with machines that a color depth of 32 bit * but only 24 planes. It's a bit slow because each time the two colors * are queried but I did have any better idea at the moment how to figure * out how many bits the red, green and blue members of the XColor * structure have in every possible case and this looked like the * safest method... JTT ***************************************/ int fl_lookup_RGBcolor( const char * colname, int * r, int * g, int * b ) { XColor xc; XColor w; if ( XParseColor( fl_display, fl_state[ fl_vmode ].colormap, "rgb:ffff/ffff/ffff", &w ) == 0 || XParseColor( fl_display, fl_state[ fl_vmode ].colormap, colname, &xc ) == 0 ) return -1; *r = ( ( xc.red << 8 ) - 1 ) / w.red; *g = ( ( xc.green << 8 ) - 1 ) / w.green; *b = ( ( xc.blue << 8 ) - 1 ) / w.blue; return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/postscript.c0000644000175000017500000006542712251675210013434 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao * All rights reserved. * * Supports xyplot PostScript dump. Almost a verbatim copy of * xyplot.c */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/pxyplot.h" #include "private/pflps.h" #include static void ps_draw_xyplot( FL_OBJECT * ob ); /*************************************** ***************************************/ static int auto_orientation( float pw, float ph, float obw, float obh ) { int plm, pbm, llm, lbm; plm = ( pw - obw ) / 2; pbm = ( ph - obh ) / 2; llm = ( pw - obh ) / 2; lbm = ( ph - obw ) / 2; return ( FL_abs( lbm - llm ) < FL_abs( pbm - plm ) ) ? FLPS_LANDSCAPE : FLPS_PORTRAIT; } /*************************************** * find scale factor, in percentage point ***************************************/ static int auto_scale( float pw, float ph, float obw, float obh ) { float margin = 0.4 * 72; /* about 1cm */ int i = 100; pw -= 2 * margin; ph -= 2 * margin; if ( ( flps->orientation == FLPS_PORTRAIT && ( pw < obw || ph < obh ) ) || ( flps->orientation == FLPS_LANDSCAPE && ( pw < obh || ph < obw ) ) ) { float gscalex, gscaley; if ( flps->orientation == FLPS_PORTRAIT ) { gscalex = ( pw - 2.0 ) / obw; gscaley = ( ph - 2.0 ) / obh; } else { gscalex = ( pw - 2.0 ) / obh; gscaley = ( ph - 2.0 ) / obw; } i = 100.0 * ( ( gscalex < gscaley ) ? gscalex : gscaley ); } return i; } /*************************************** ***************************************/ static char * strip_newline( char * str ) { static char s[ 64 ]; char *c; strncpy( s, str, 63 ); s[ 63 ] = '\0'; for ( ; ( c = strchr( s, '\n' ) ); ) *c = ' '; return s; } /*************************************** ***************************************/ int fl_object_ps_dump( FL_OBJECT * ob, const char * fname ) { float bxi, /* bounding box */ byi, bxf, byf; float objw, objh, pw, ph; float fgscale; int gscale = 100; int orientation; if ( ! flps ) { flps = ( FLPSInfo * ) flps_init( ); if (ob->objclass == FL_XYPLOT) flps->ps_color = FLPS_BW;; } /* try to open the file */ if ( ! fname || ! *fname ) fname = fl_show_fselector( "Output Filename", "", "*ps", "" ); /* cancel */ if ( ! fname ) return 0; if ( ! *fname ) { M_err( "PS_dump", "null filename" ); return -1; } if ( strcmp( fname, "-" ) == 0 ) flps->fp = stdout; else flps->fp = fopen( fname, "w" ); if ( ! flps->fp ) { M_err( "PS_dump", "can't open %s", fname ); return -1; } /* we need to do this to get repeated call right */ flps_reset_cache( ); /* fill in some defaults */ if ( flps->drawbox < 0 ) flps->drawbox = 0; #if 0 fl_freeze_all_forms( ); fl_set_cursor( ob->form->window, XC_watch ); fl_update_display( 0 ); #endif flps->s2px = 72.0 / flps->xdpi; flps->s2py = 72.0 / flps->ydpi; flps->final_xscale = flps->xscale * flps->s2px; flps->final_yscale = flps->yscale * flps->s2py; /* bounding box always in point */ pw = flps->paper_w * 72; ph = flps->paper_h * 72; objw = ob->w * flps->final_xscale; objh = ob->h * flps->final_yscale; /* handle auto orientation */ if ( ( orientation = flps->orientation ) == FLPS_AUTO ) orientation = auto_orientation( pw, ph, objw, objh ); flps->landscape = orientation == FLPS_LANDSCAPE; if ( flps->auto_fit ) gscale = auto_scale( pw, ph, objw, objh ); fgscale = gscale * 0.01; flps->final_xscale *= fgscale; flps->final_yscale *= fgscale; if ( flps->landscape ) { bxi = ( pw - objh * fgscale ) * 0.5; byi = ( ph - objw * fgscale ) * 0.5; bxf = bxi + objh * fgscale; byf = byi + objw * fgscale; } else { bxi = ( pw - objw * fgscale ) * 0.5; byi = ( ph - objh * fgscale ) * 0.5; bxf = bxi + objw * fgscale; byf = byi + objh * fgscale; } flps_emit_header( strip_newline( ob->label ), 1, bxi, byi, bxf, byf ); flps_emit_prolog( ); if ( flps->landscape ) { /* from now on, we are in pixel unit */ flps_output( "gsave %.1f %.1f translate 90 rotate\n", bxi + objh, byi ); flps_output( "%.1f %.1f translate\n", -ob->x * flps->final_yscale, -ob->y * flps->final_xscale ); } else flps_output( "gsave %.1f %.1f translate\n", bxi - ob->x * flps->final_xscale, byi - ob->y * flps->final_yscale ); flps_output( "SX SY scale\n " ); switch ( ob->objclass ) { case FL_XYPLOT : ps_draw_xyplot( ob ); break; default : M_err( "PS_dump", "unsupported object class: %d", ob->objclass ); break; } fputs( "grestore\nshowpage\n", flps->fp ); fclose( flps->fp ); #if 0 fl_reset_cursor( ob->form->window ); fl_unfreeze_all_forms( ); #endif return 0; } static void flps_draw_text_point(int, int, int, FL_COLOR, int, int, char * ); #define PCOL( c ) ( ( flps->ps_color == FLPS_BW && ! flps->drawbox ) ? \ FL_BLACK : c ) #define SPEC FLI_XYPLOT_SPEC static int ym1, ym2; static float ay, by; #define FLIP( ys ) ( ym1 + ( sp->yf - ys ) ) #define FMIN 1.e-25 /*************************************** ***************************************/ static void mapw2s( FLI_XYPLOT_SPEC * sp, FL_POINT * p, int n1, int n2, float * x, float * y ) { int i; float ax = sp->ax, bx = sp->bx; float lbase, t; ay = ( sp->yf - sp->yi) / (sp->yscmax - sp->yscmin ); by = ym1 - ay * sp->yscmin; if ( sp->xscale == FL_LOG ) { lbase = 1.0 / sp->lxbase; for ( i = n1; i < n2; i++ ) { t = x[ i ] > 0 ? x[ i ] : FMIN; p[ i - n1 ].x = ax * log10( t ) * lbase + bx + 0.4; } } else { for ( i = n1; i < n2; i++ ) p[ i - n1 ].x = ax * x[ i ] + bx + 0.4; } if ( sp->yscale == FL_LOG ) { lbase = 1.0 / sp->lybase; for ( i = n1; i < n2; i++ ) { t = y[ i ] > 0 ? y[ i ] : FMIN; p[ i - n1 ].y = ay * log10( t ) * lbase + by + 0.4; } } else { for ( i = n1; i < n2; i++ ) p[ i - n1 ].y = ay * y[ i ] + by + 0.4; } } /*************************************** ***************************************/ static void add_border( FL_OBJECT * ob, FL_COLOR c ) { FLI_XYPLOT_SPEC *sp = ob->spec; if ( sp->xtic > 0 && sp->ytic > 0 ) flps_rect( sp->xi, ym1, sp->xf - sp->xi + 1, ym2 - ym1 + 1, c ); else if ( sp->xtic > 0 ) flps_line( sp->xi, ym1, sp->xf, ym1, c ); else if ( sp->ytic > 0 ) flps_line( sp->xi, ym1, sp->xi, ym2, c ); } /*************************************** ***************************************/ static void w2s( FL_OBJECT * ob, float wx, float wy, float * sx, float * sy ) { FLI_XYPLOT_SPEC *sp = ob->spec; *sx = wx * sp->ax + sp->bx; *sy = wy * ay + by; } /*************************************** ***************************************/ static void draw_inset( FL_OBJECT * ob ) { FLI_XYPLOT_SPEC *sp = ob->spec; int i; float tx, ty; for ( i = 0; i < sp->maxoverlay; i++ ) { if ( sp->text[ i ] ) { w2s( ob, sp->xt[ i ], sp->yt[ i ], &tx, &ty ); flps_draw_text_point( sp->talign[ i ], tx, ty, PCOL( sp->tcol[ i ] ), sp->lstyle, sp->lsize, sp->text[ i ] ); } } } #define XRound( s ) \ ( ( s )->xtic > 0 && ! ( s )->axtic[ 0 ] && ( s )->xmajor > 1 ) #define YRound( s ) \ ( ( s )->ytic > 0 && ! ( s )->aytic[ 0 ] && ( s )->ymajor > 1 ) /*************************************** ***************************************/ static void add_xtics( FL_OBJECT * ob ) { FLI_XYPLOT_SPEC *sp = ob->spec; float tic = sp->xtic; int xr, ticl = 6, yi, yf, i; char buf[ 80 ], *label, *p; if ( tic <= 0 ) return; yi = ym1; yf = yi - ticl / 2; for ( i = 0; i < sp->num_xminor; i++ ) { xr = sp->xtic_minor[ i ]; flps_line( xr, yi, xr, yf, ob->col2 ); } yi = ym1; yf = yi - ticl; for ( i = 0; i < sp->num_xmajor; i++ ) { xr = sp->xtic_major[ i ]; flps_line( xr, yi, xr, yf, ob->col2 ); if ( ! sp->axtic[ 0 ] ) fli_xyplot_nice_label( tic, sp->xminor, sp->xmajor_val[ i ], label = buf ); else { if ( ( p = strchr( sp->axtic[ i ], '@' ) ) ) { label = strcpy( buf, sp->axtic[ i ] ); label[ p - sp->axtic[ i ] ] = '\0'; } else label = sp->axtic[ i ]; } flps_draw_text( FL_ALIGN_TOP, xr, ym1 - ticl + 1, 0, 0, ob->col2, sp->lstyle, sp->lsize, label ); } } /*************************************** ***************************************/ static void add_logxtics( FL_OBJECT * ob ) { FLI_XYPLOT_SPEC *sp = ob->spec; float xw; int xr, ticl = 6, yi, yf, i; char label[ 80 ]; if ( sp->xtic < 0 ) return; yi = ym1; yf = yi - ticl / 2; for ( i = 0; i < sp->num_xminor; i++ ) { xr = sp->xtic_minor[ i ]; flps_line( xr, yi, xr, yf, ob->col2 ); } yi = ym1; yf = ym1 - ticl; for ( i = 0; i < sp->num_xmajor; i++ ) { xr = sp->xtic_major[ i ]; flps_line( xr, yi, xr, yf, ob->col2 ); xw = sp->xmajor_val[ i ]; if ( sp->xbase == 10.0 ) { sprintf( label, "%g", pow( 10.0, sp->xmajor_val[ i ] ) ); flps_draw_text( FL_ALIGN_TOP, xr, yf + 1, 1, 1, ob->col2, sp->lstyle, sp->lsize, label); } else { int len1, len2, ll; ll = sprintf( label, "%g", sp->xbase ); flps_draw_text( FL_ALIGN_TOP, xr - 3, yf - 1, 0, 0, ob->col2, sp->lstyle, sp->lsize, label ); len1 = fl_get_string_width( sp->lstyle, sp->lsize, label, ll ); ll = sprintf( label, "%d", ( int ) ceil( xw ) ); len2 = fl_get_string_width( sp->lstyle, sp->lsize - 2, label, ll ); flps_draw_text( FL_ALIGN_TOP, xr - 3 + len1 / 2 + len2 / 2, yf + 3, 0, 0, ob->col2, sp->lstyle, sp->lsize - 2, label ); } } } /*************************************** ***************************************/ static void add_ytics( FL_OBJECT * ob ) { FLI_XYPLOT_SPEC *sp = ob->spec; float tic = sp->ytic; int yr, ticl = 6, i; char buf[ 80 ], *label, *p; if ( sp->ytic <= 0 ) return; for ( i = 0; i < sp->num_yminor; i++ ) { yr = FLIP( sp->ytic_minor[ i ] ); flps_line( sp->xi, yr, sp->xi - ticl / 2, yr, ob->col2 ); } for ( i = 0; i < sp->num_ymajor; i++ ) { yr = FLIP( sp->ytic_major[ i ] ); flps_line( sp->xi - ticl, yr, sp->xi, yr, ob->col2 ); if ( ! sp->aytic[ 0 ] ) fli_xyplot_nice_label( tic, sp->yminor, sp->ymajor_val[ i ], label = buf ); else { if ( ( p = strchr( sp->aytic[ i ], '@' ) ) ) { label = strcpy( buf, sp->aytic[ i ] ); label[ p - sp->aytic[ i ] ] = '\0'; } else label = sp->aytic[ i - 1 ]; } flps_draw_text( FL_ALIGN_RIGHT, sp->xi - ticl + 1, yr, 0, 0, ob->col2, sp->lstyle, sp->lsize, label ); } } /*************************************** ***************************************/ static void add_logytics( FL_OBJECT * ob ) { FLI_XYPLOT_SPEC *sp = ob->spec; float yw; int yr, ticl = 6, i; char label[ 80 ]; if ( sp->ytic <= 0 ) return; for ( i = 0; i < sp->num_yminor; i++ ) { yr = FLIP( sp->ytic_minor[ i ] ); flps_line( sp->xi, yr, sp->xi - ticl / 2, yr, ob->col2 ); } for ( i = 0; i < sp->num_ymajor; i++ ) { yr = FLIP( sp->ytic_major[ i ] ); flps_line( sp->xi - ticl, yr, sp->xi, yr, ob->col2 ); yw = sp->ymajor_val[ i ]; if ( sp->ybase == 10.0 ) { sprintf( label, "%g", pow( sp->ybase, yw ) ); flps_draw_text( FL_ALIGN_RIGHT, sp->xi - ticl, yr, 1, 1, ob->col2, sp->lstyle, sp->lsize, label ); } else { int len, ll; ll = sprintf( label, "%d", ( int ) ceil( yw ) ); flps_draw_text( FL_ALIGN_RIGHT, sp->xi - ticl, yr + 3, 0, 0, ob->col2, sp->lstyle, sp->lsize - 2, label ); len = fl_get_string_width( sp->lstyle, sp->lsize - 2, label, ll ); sprintf( label, "%g", sp->ybase ); flps_draw_text( FL_ALIGN_RIGHT, sp->xi - ticl - len, yr, 0, 0, ob->col2, sp->lstyle, sp->lsize, label ); } } } /*************************************** ***************************************/ static void draw_square( FL_POINT * p, int n, int w, int h ) { int w2 = w / 2, h2 = h / 2; FL_POINT *ps = p + n; for ( ; p < ps; p++ ) flps_rectangle( 0, p->x - w2, p->y - h2, w, h, FL_NoColor ); } /*************************************** ***************************************/ static void draw_circle( FL_POINT * p, int n, int w, int h ) { FL_POINT *ps = p + n; int r = ( w + h ) / 4; for ( ; p < ps; p++ ) flps_circ( 0, p->x, p->y, r, FL_NoColor ); /* nocolor mean current */ } /*************************************** ***************************************/ static void draw_point( FL_POINT * p, int n, int w, int h ) { int w2 = w / 2, h2 = h / 2; FL_POINT *ps = p + n; for ( ; p < ps; p++ ) { flps_line( p->x, p->y - h2, p->x, p->y + h2, FL_NoColor ); flps_line( p->x - w2, p->y, p->x + w2, p->y, FL_NoColor ); flps_line( p->x - w2, p->y - h2, p->x + w2, p->y + h2, FL_NoColor ); flps_line( p->x + w2, p->y - h2, p->x - w2, p->y + h2, FL_NoColor ); } } /*************************************** ***************************************/ static void add_xgrid( FL_OBJECT * ob ) { FLI_XYPLOT_SPEC *sp = ob->spec; int xr, i; int savels = flps_get_linestyle( ); flps_linestyle( sp->grid_linestyle ); for ( i = 0; sp->xgrid == FL_GRID_MINOR && i < sp->num_xminor; i++ ) { xr = sp->xtic_minor[ i ]; flps_line( xr, ym1, xr, ym2, ob->col2 ); } for ( i = 0; i < sp->num_xmajor; i++ ) { xr = sp->xtic_major[ i ]; flps_line( xr, ym1, xr, ym2, ob->col2 ); } flps_linestyle( savels ); } /*************************************** ***************************************/ static void add_ygrid( FL_OBJECT * ob ) { FLI_XYPLOT_SPEC *sp = ob->spec; int yr, i, xi, xf; int savels = flps_get_linestyle( ); xi = sp->xi + 1; xf = sp->xf - 1; flps_linestyle( sp->grid_linestyle ); for ( i = 0; sp->ygrid == FL_GRID_MINOR && i < sp->num_yminor; i++ ) { yr = FLIP( sp->ytic_minor[ i ] ); flps_line( xi, yr, xf, yr, ob->col2 ); } for ( i = 0; i < sp->num_ymajor; i++ ) { yr = FLIP( sp->ytic_major[ i ] ); flps_line( xi, yr, xf, yr, ob->col2 ); } flps_linestyle( savels ); } /*************************************** * Draw xyplot in PostScript device. The driver sets things * up so the coordinate system is in pixels and the origin * of the coordinate system is at form's origin * * This is an almost verbatim copy of the X xyplot drawing ***************************************/ static void ps_draw_xyplot( FL_OBJECT * ob ) { FLI_XYPLOT_SPEC *sp = ob->spec; float *x, *y; FL_POINT *xp; int i, nplot, noline = 0, n1, n2, nxp, newn; void ( * drawsymbol )( FL_POINT *, int, int, int ); int savels = flps_get_linestyle( ); int savelw = flps_get_linewidth( ); int key_xs, key_ys; int dblbuffer; FL_COLOR col, savecol2; if ( ! ob->visible || ! ob->form->visible ) { M_err( "PSDrawXYPlot", "object must be visible" ); return; } flps_linewidth( 1 ); /* for BW output, always black ink */ savecol2 = ob->col2; ob->col2 = PCOL( ob->col2 ); /* bounding box and object label */ if ( flps->drawbox ) flps_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); flps_draw_text_beside( ob->align, ob->x, ob->y, ob->w, ob->h, PCOL(ob->lcol), ob->lstyle, ob->lsize, ob->label ); /* if we're in double buffer mode, need to shift the plot. */ dblbuffer = sp->bym - sp->by >= 1.0 || sp->bxm - sp->bx >= 1.0; if ( dblbuffer ) fprintf( flps->fp, "%d -%d translate\n", sp->objx, sp->objy ); /* ym1 and ym2 are the y-bounds in PostScript system, i.e., ym1y + ( ob->y + ob->h - 1 - sp->yf ); ym2 = ( ob->y + ob->h - 1 ) - ( sp->yi - ob->y ); add_border( ob, ob->col2 ); flps_set_clipping( sp->xi, ym1, sp->xf - sp->xi + 1, ym2 - ym1 + 1 ); if ( sp->xgrid != FL_GRID_NONE && sp->xtic > 0 ) add_xgrid( ob ); if ( sp->ygrid != FL_GRID_NONE && sp->ytic > 0 ) add_ygrid( ob ); /* too lazy to figure out the transformation to map X to PS. brute force */ { FL_POINT tmpp; float keyx = sp->key_x, keyy = sp->key_y; mapw2s( sp, &tmpp, 0, 1, &keyx, &keyy ); sp->key_xs = tmpp.x; sp->key_ys = tmpp.y; } flps_rectangle( 0, sp->key_xs - sp->key_maxw - 1, sp->key_ys - sp->key_maxh - 1, sp->key_maxw, sp->key_maxh, PCOL( sp->col[ 0 ] ) ); key_xs = sp->key_xs - sp->key_maxw + 1; key_ys = sp->key_ys - sp->key_ascend + sp->key_descend + ( sp->lsize > 12 ); for ( nplot = 0; nplot <= sp->maxoverlay; nplot++ ) { if ( sp->n[ nplot ] == 0 ) continue; fli_xyplot_compute_data_bounds( ob, &n1, &n2, nplot ); noline = 0; drawsymbol = NULL; col = PCOL( sp->col[ nplot ] ); flps_color( col ); /* for PostScript, we don't want 0, too thin */ flps_linewidth( sp->thickness[ nplot ] ? sp->thickness[ nplot ] : 1 ); if ( sp->interpolate[ nplot ] > 1 && n2 - n1 > 3 && ( newn = fli_xyplot_interpolate( ob, nplot, n1, n2 ) ) >= 0 ) { x = sp->wx; y = sp->wy; xp = sp->xpi; mapw2s( sp, xp, 0, newn, x, y ); nxp = sp->nxpi = newn; mapw2s( sp, sp->xp, n1, n2, sp->x[ nplot ], sp->y[ nplot ] ); sp->nxp = n2 - n1; } else { x = sp->x[ nplot ]; y = sp->y[ nplot ]; xp = sp->xp; mapw2s( sp, xp, n1, n2, x, y ); nxp = sp->nxp = n2 - n1; } switch ( sp->type[ nplot ] ) { case FL_SQUARE_XYPLOT : case FL_ACTIVE_XYPLOT : drawsymbol = draw_square; break; case FL_CIRCLE_XYPLOT : drawsymbol = draw_circle; break; case FL_POINTS_XYPLOT : noline = 1; /* fall through */ case FL_LINEPOINTS_XYPLOT : drawsymbol = draw_point; break; case FL_DOTTED_XYPLOT : flps_linestyle( FL_DOT ); break; case FL_DOTDASHED_XYPLOT : flps_linestyle( FL_DOTDASH ); break; case FL_DASHED_XYPLOT : flps_linestyle( FL_DASH ); break; case FL_LONGDASHED_XYPLOT : flps_linestyle( FL_LONGDASH ); break; case FL_FILL_XYPLOT : xp[ -1 ].x = xp[ 0 ].x; xp[ -1 ].y = ym1; xp[ nxp ].x = xp[ nxp - 1 ].x; xp[ nxp ].y = ym1; flps_poly( 1, xp - 1, nxp + 2, col ); noline = 1; break; case FL_IMPULSE_XYPLOT : noline = 1; for ( i = 0; i < sp->n[ nplot ]; i++ ) flps_line( sp->xp[ i ].x, ym1, sp->xp[ i ].x, sp->xp[ i ].y, col ); break; case FL_EMPTY_XYPLOT : noline = 1; break; case FL_NORMAL_XYPLOT : default: noline = 0; break; } if ( ! noline ) flps_lines( xp, nxp, col ); if ( drawsymbol ) { xp = sp->xp; /* always use original point for symbol */ nxp = sp->nxp; drawsymbol( xp, nxp, sp->ssize, sp->ssize ); } /* do keys */ if ( sp->key[ nplot ] ) { flps_linewidth( 0 ); if ( ! noline ) flps_line( key_xs, key_ys, key_xs + 20, key_ys, col ); if ( sp->type[ nplot ] == FL_IMPULSE_XYPLOT ) { flps_line( key_xs + 3, key_ys + 2, key_xs + 3, key_ys - 3, col ); flps_line( key_xs + 7, key_ys + 2, key_xs + 7, key_ys - 3, col ); flps_line( key_xs + 11, key_ys + 2, key_xs + 11, key_ys - 3, col ); flps_line( key_xs + 15, key_ys + 2, key_xs + 15, key_ys - 3, col ); } else if ( sp->type[ nplot ] == FL_FILL_XYPLOT ) flps_rectangle( 1, key_xs + 1, key_ys - 3, 19, 6, col ); if ( drawsymbol ) { FL_POINT p[ 3 ]; p[ 0 ].x = key_xs + 3; p[ 1 ].x = key_xs + 10; p[ 2 ].x = key_xs + 17; p[ 0 ].y = p[ 1 ].y = p[ 2 ].y = key_ys; drawsymbol( p, 3, 4, 4 ); } flps_draw_text( FL_ALIGN_LEFT, key_xs + 20, key_ys, 0, 0, col, sp->key_lstyle, sp->key_lsize, sp->key[ nplot ] ); key_ys -= sp->key_ascend + sp->key_descend; } flps_linestyle( savels ); flps_linestyle( savelw ); } flps_unset_clipping( ); flps_draw_text( FL_ALIGN_BOTTOM, ( sp->xi + sp->xf ) / 2, ym2 + 1, 1, 1, ob->col2, sp->lstyle, sp->lsize, sp->title ); ( sp->xscale == FL_LOG ? add_logxtics : add_xtics )( ob ); ( sp->xscale == FL_LOG ? add_logytics : add_ytics )( ob ); draw_inset( ob ); /* xlabel and y label */ flps_draw_text( FL_ALIGN_BOTTOM, ( sp->xi + sp->xf ) / 2, ob->y + FL_abs(ob->bw) + ( dblbuffer ? sp->objy : 0 ), 1, 1, ob->col2, sp->lstyle, sp->lsize, sp->xlabel ); flps_draw_text( FL_ALIGN_CENTER | FL_ALIGN_VERT, sp->xi - sp->maxytic - fl_get_char_height( sp->lstyle, sp->lsize, 0, 0 ) / 2, ( ym1 + ym2 ) / 2, 1, 1, ob->col2, sp->lstyle, sp->lsize, sp->ylabel ); ob->col2 = savecol2; } /*************************************** * Draw a string with alignment given relative to a point. * Figure out the bounding box etc so symbols can be drawn ***************************************/ static void flps_draw_text_point( int lalign, int x, int y, FL_COLOR col, int lstyle, int lsize, char * str ) { int align = fl_to_outside_lalign( lalign ); int bbox = 1.4 * lsize + 6; int xx = x, yy = y; switch ( align ) { case FL_ALIGN_CENTER : xx = x - bbox / 2; yy = y - bbox / 2; break; case FL_ALIGN_TOP : xx = x - bbox / 2; break; case FL_ALIGN_BOTTOM : xx = x - bbox / 2; yy = y - bbox; break; case FL_ALIGN_LEFT : yy = y - bbox / 2; break; case FL_ALIGN_RIGHT : xx = x - bbox; yy = y - bbox / 2; break; case FL_ALIGN_LEFT_TOP : xx = x - bbox; align = FL_ALIGN_RIGHT_TOP; break; case FL_ALIGN_RIGHT_TOP : align = FL_ALIGN_LEFT_TOP; break; case FL_ALIGN_RIGHT_BOTTOM : yy = y - bbox; align = FL_ALIGN_LEFT_BOTTOM; break; case FL_ALIGN_LEFT_BOTTOM : align = FL_ALIGN_RIGHT_BOTTOM; yy = y - bbox; xx = x - bbox; break; } flps_draw_text_beside( align, xx, yy, bbox, bbox, col, lstyle, lsize, str ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_genesis.c0000644000175000017500000000705112251675315014014 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1998-2002 By T.C. Zhao * All rights reserved. * * but genesis format. Eventually dicom will * be supported */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" #define IMG_MAGIC 0x494d4746 typedef struct { int magic; int hdr_len; int width; int height; int depth; int compress; int windoww; int windowl; } SPEC; /*************************************** ***************************************/ static int GENESIS_identify( FILE * fp ) { char buf[ 4 ]; size_t c; c = fread( buf, 1, 4, fp ); rewind( fp ); return c == 4 && strncmp( buf, "IMGF", 4 ) == 0; } /*************************************** ***************************************/ static int GENESIS_description( FL_IMAGE * im ) { SPEC *sp = fl_calloc( 1, sizeof *sp ); FILE *fp = im->fpin; im->io_spec = sp; im->spec_size = sizeof *sp; rewind( fp ); sp->magic = fli_fget4MSBF( fp ); sp->hdr_len = fli_fget4MSBF( fp ); sp->width = fli_fget4MSBF( fp ); sp->height = fli_fget4MSBF( fp ); sp->depth = fli_fget4MSBF( fp ); sp->compress = fli_fget4MSBF( fp ); sp->windoww = fli_fget4MSBF( fp ); sp->windowl = fli_fget4MSBF( fp ); if ( sp->depth < 8 || sp->compress != 1 ) return -1; im->type = sp->depth == 8 ? FL_IMAGE_GRAY : FL_IMAGE_GRAY16; im->gray_maxval = ( 1 << sp->depth ) - 1; im->w = sp->width; im->h = sp->height; return 0; } /*************************************** * convert MSBF ***************************************/ static void convert_msbf( unsigned short * pixels, int npixels ) { unsigned short *p = pixels, *ps = p + npixels; unsigned char *c = ( unsigned char * ) p; for ( ; p < ps; p++, c += 2 ) *p = ( c[ 0 ] << 8 ) | c[ 1 ]; } /*************************************** ***************************************/ static int GENESIS_load( FL_IMAGE * im ) { FILE *fp = im->fpin; SPEC *sp = im->io_spec; fseek( fp, sp->hdr_len, SEEK_SET ); if ( fread( im->gray[ 0 ], sp->depth / 8, im->w * im->h, fp ) != ( size_t ) im->w * im->h ) convert_msbf( im->gray[ 0 ], im->w * im->h ); return 0; } /*************************************** ***************************************/ void flimage_enable_genesis( void ) { flimage_add_format( "GE Genesis", "genesis", "ge", FL_IMAGE_GRAY16 | FL_IMAGE_GRAY, GENESIS_identify, GENESIS_description, GENESIS_load, 0 ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_tiff.c0000644000175000017500000010414112251675234013305 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 2000-2002 By T.C. Zhao * * TIFF file reader/writer for some tiff files. It is not possible to * develop a tiff reader to handle all possible valid tiffs. * * could use some optimization */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "ulib.h" #include "flimage.h" #include "flimage_int.h" #if defined __sun__ && ! defined SYSV int fgetc( FILE *stream ); int fputc( int c, FILE *stream ); #endif #define TIFF_DEBUG 0 static int get_image_info_from_ifd( FL_IMAGE * im ); typedef int ( * ReadIT )( FILE * ); typedef int ( * WriteIT )( int, FILE * ); typedef struct { int tag_value; char * tag_name; int type; int * value; int count; int offset; char * svalue; } TIFFTag; static TIFFTag *find_tag( int ); typedef struct { int endian; int ifd_offset; /* next ifd location. 0 indicates end */ int spp; /* samples per pixel */ int bps[ 4 ]; /* bits per sample */ int curr_pos; /* current writing location */ int next_pos; /* next writing location */ int ( * read2bytes ) ( FILE * ); int ( * read4bytes ) ( FILE * ); int ( * write2bytes ) ( int, FILE * ); int ( * write4bytes ) ( int, FILE * ); FL_IMAGE *image; ReadIT readit[ 15 ]; WriteIT writeit[ 15 ]; int strip_size; /* strip size in bytes */ int rowsPerStrip; /* preferred */ int nstrips; int *stripOffsets; int *stripByteCount; int offset_offset; int bytecount_offset; int max_tags; } SPEC; static void initialize_tiff_io( SPEC *, int ); /*************************************** ***************************************/ static int TIFF_identify( FILE * fp ) { char c[ 4 ]; size_t i; i = fread( c, 1, 4, fp ); rewind( fp ); return i == 4 && ( ( c[ 0 ] == 'I' && c[ 1 ] == 'I' ) || ( c[ 0 ] == 'M' && c[ 1 ] == 'M' ) ); } static int read_tiff_ifd( FILE * fp, SPEC * sp ); /*************************************** ***************************************/ static int TIFF_description( FL_IMAGE * im ) { FILE *fp = im->fpin; SPEC *sp = fl_malloc( sizeof *sp ); char buf[ 4 ]; im->io_spec = sp; im->spec_size = sizeof *sp; sp->image = im; if ( fread( buf, 1, 4, fp ) != 4 ) { flimage_error( im, "Failure to read TIFF file" ); fl_free( sp ); im->io_spec = NULL; im->spec_size = 0; return -1; } sp->endian = buf[ 0 ] == 'M' ? MSBFirst : LSBFirst; initialize_tiff_io( sp, sp->endian ); sp->ifd_offset = sp->read4bytes( fp ); if ( ! sp->ifd_offset ) { flimage_error( im, "Invalid TIFF: no IFD" ); fl_free( sp ); im->io_spec = NULL; im->spec_size = 0; return -1; } read_tiff_ifd( fp, sp ); if ( get_image_info_from_ifd( im ) < 0 ) { fl_free( sp ); im->io_spec = NULL; im->spec_size = 0; return -1; } return 0; } static int read_pixels( FL_IMAGE * im ); static int TIFF_next( FL_IMAGE * ); static int load_tiff_colormap( FL_IMAGE * ); /*************************************** ***************************************/ static int TIFF_readpixels( FL_IMAGE * im ) { SPEC *sp = im->io_spec; load_tiff_colormap( im ); if ( sp->ifd_offset ) im->next_frame = TIFF_next; else im->next_frame = 0; im->more = sp->ifd_offset != 0; return read_pixels(im); } /*************************************** ***************************************/ static int TIFF_next( FL_IMAGE * im ) { SPEC *sp = im->io_spec; read_tiff_ifd( im->fpin, sp ); if ( get_image_info_from_ifd( im ) < 0 ) { flimage_error( im, "Can't get image info" ); M_err( "Next", "Can't get image info" ); return -1; } flimage_getmem( im ); return TIFF_readpixels( im ); } static int write_ifd( FL_IMAGE *, SPEC * ); static int write_pixels( FL_IMAGE *, SPEC * ); /*************************************** ***************************************/ static int machine_endian( void ) { static unsigned short a = 0x1234; static unsigned char *c = ( unsigned char * ) &a; return c[ 0 ] == 0x12 ? MSBFirst : LSBFirst; } #define MaxStripSize 32767 /* max strip size */ /*************************************** ***************************************/ static int TIFF_write( FL_IMAGE * image ) { FILE *fp = image->fpout; FL_IMAGE *im = image; int err, t; SPEC *sp; /* we do not touch im->io_spec. Use this local copy */ sp = fl_calloc( 1, sizeof *sp ); t = ( im->w * im->h ) / ( im->type == FL_IMAGE_MONO ? 8 : 1 ); /* We always write StripByteCount at offset. Need to make sure we'll have more than one strips */ if ( t <= MaxStripSize ) sp->strip_size = ( t + 1 ) / 2; else sp->strip_size = MaxStripSize; sp->endian = machine_endian( ); initialize_tiff_io( sp, sp->endian ); fwrite( sp->endian == LSBFirst ? "II" : "MM", 1, 2, fp ); sp->write2bytes( 42, fp ); sp->next_pos = 4; sp->max_tags = 15; sp->write4bytes( sp->next_pos += 4, fp ); /* ifd location */ for ( err = 0; ! err && im; im = im->next ) { sp->curr_pos = sp->next_pos; sp->next_pos += sp->max_tags * 12; im->fpout = image->fpout; fseek( fp, sp->curr_pos, SEEK_SET ); err = write_ifd( im, sp ) < 0 || write_pixels( im, sp ) < 0; /* update the IFD location */ fseek( fp, sp->ifd_offset, SEEK_SET ); sp->write4bytes( im->next ? sp->next_pos : 0, fp ); } fl_free( sp->stripByteCount ); fl_free( sp->stripOffsets ); fl_free( sp ); return 0; } /*************************************** ***************************************/ void flimage_enable_tiff(void) { flimage_add_format( "Tag Image File Format", "tiff", "tif", FL_IMAGE_FLEX, TIFF_identify, TIFF_description, TIFF_readpixels, TIFF_write); } /************************************************************************* * TIFF tags *************************************************************************/ static int junkBuffer; #define NV(a,t) {a,#a,t,&junkBuffer,0,0,0} #define SubFileType 254 #define ReduceImage 1 #define Page 2 #define Mask 4 #define ImageWidth 256 #define ImageHeight 257 #define BitsPerSample 258 #define Compression 259 #define Uncompressed 1 #define LZW 5 #define JPEG 6 #define PackBits 32773 #define PhotometricI 262 #define PhotoBW0White 0 #define PhotoBW0Black 1 #define PhotoRGB 2 #define PhotoPalette 3 #define PhotoTransMask 4 #define PhotoCMYK 5 #define PhotoYCbCr 6 #define DocumentName 269 #define Description 270 #define StripOffsets 273 #define Orientation 274 #define TopLeft 1 #define TopRight 2 #define RightTop 6 #define SamplesPerPixel 277 #define RowsPerStrip 278 #define StripByteCount 279 #define MinSampleValue 280 #define MaxSampleValue 281 #define PlannarConfig 284 #define RGBRGB 1 #define RRGGBB 2 #define GrayResponse 291 #define ColorResponse 301 #define ColorMap 320 /* tiff support types */ enum { kUByte = 1, ASCII = 2, kUShort = 3, kULong = 4, RATIONAL = 5, SBYTE = 6, kShort = 8, kLong = 9, SRATIONAL = 10, kFloat = 11, kDouble = 12 }; /* type is used for writing only */ TIFFTag interestedTags[ ] = { NV( ImageWidth, kUShort ), NV( ImageHeight, kUShort ), NV( BitsPerSample, kUShort ), NV( Compression, kUShort ), NV( SamplesPerPixel, kUShort ), NV( PhotometricI, kUShort ), NV( DocumentName, ASCII ), NV( Description, ASCII ), NV( StripOffsets, kULong ), NV( Orientation, kUShort ), NV( RowsPerStrip, kULong ), NV( StripByteCount, kULong ), NV( MinSampleValue, kUShort ), NV( MaxSampleValue, kUShort ), NV( PlannarConfig, kUShort ), NV( GrayResponse, kUShort ), NV( ColorResponse, kUShort ), NV( ColorMap, kUShort ), /* sentinel */ NV( 0, kShort ) }; static TIFFTag * /*************************************** ***************************************/ find_tag( int val ) { TIFFTag *tag; /* if tags are more than about 20, binary search may be better */ for ( tag = interestedTags; tag->tag_value && tag->tag_value != val; tag++ ) /* empty */ ; return tag->tag_value ? tag : 0; /* &stag; */ } /*************************************** * convert tag value to image value ***************************************/ static int get_image_info_from_ifd( FL_IMAGE * im ) { TIFFTag *tag; SPEC *sp = im->io_spec; int i; if ( ! ( tag = find_tag( ImageWidth ) ) ) { flimage_error( im, "Bad ImageWidth tag" ); return -1; } im->w = tag->value[ 0 ]; if ( ! ( tag = find_tag( ImageHeight ) ) ) { flimage_error( im, "Bad ImageLength tag" ); return -1; } im->h = tag->value[ 0 ]; if ( im->w <= 0 || im->h <= 0 ) { fprintf( stderr, "bad image dimension: %d %d\n", im->w, im->h ); return -1; } if ( ! ( sp->spp = find_tag( SamplesPerPixel )->value[ 0 ] ) ) sp->spp = 1; tag = find_tag( BitsPerSample ); for ( i = 0; i < sp->spp; i++ ) { if ( ( sp->bps[ i ] = tag->value[ i ] ) <= 0 ) { flimage_error( im, "bad bps: %d\n", sp->bps[ i ] ); return -1; } } tag = find_tag( PhotometricI ); switch ( tag->value[ 0 ] ) { case PhotoBW0White : case PhotoBW0Black : im->type = sp->bps[ 0 ] == 1 ? FL_IMAGE_MONO : ( sp->bps[ 0 ] <= 8 ? FL_IMAGE_GRAY : FL_IMAGE_GRAY16 ); break; case PhotoRGB : im->type = FL_IMAGE_RGB; break; case PhotoPalette : im->type = FL_IMAGE_CI; if ( ( im->map_len = find_tag( ColorMap )->count / 3 ) <= 0 ) { flimage_error( im, "Colormap is missing for PhotoPalette" ); return -1; } break; default: flimage_error( im, "Unhandled photometricI %d\n", 0 ); break; } if ( im->type == FL_IMAGE_GRAY16 && ( tag = find_tag( MaxSampleValue ) ) ) im->gray_maxval = tag->value[ 0 ]; else im->gray_maxval = ( 1 << sp->bps[ 0 ] ) - 1; return 0; } static int typeSize[ 13 ]; /*************************************** * this need to be called everytime to avoid re-entrant problems ***************************************/ static void initialize_tiff_io( SPEC * sp, int endian ) { if ( ! typeSize[ kUByte ] ) { /* initialize the typeSize */ typeSize[ kUByte ] = typeSize[ SBYTE ] = 1; typeSize[ ASCII ] = 1; typeSize[ kShort ] = typeSize[ kUShort ] = 2; typeSize[ kLong ] = typeSize[ kULong ] = 4; typeSize[ RATIONAL ] = typeSize[ SRATIONAL ] = 8; typeSize[ kFloat ] = 4; typeSize[ kDouble ] = 8; } /* initialize the functions that reads various types */ sp->readit[ kUByte ] = sp->readit[SBYTE] = fgetc; sp->writeit[ kUByte ] = sp->writeit[SBYTE] = fputc; sp->readit[ ASCII ] = fgetc; sp->writeit[ ASCII ] = fputc; sp->readit[ kShort ] = endian == MSBFirst ? fli_fget2MSBF : fli_fget2LSBF; sp->readit[ kUShort ] = endian == MSBFirst ? fli_fget2MSBF : fli_fget2LSBF; sp->writeit[ kUShort ] = endian == MSBFirst ? fli_fput2MSBF : fli_fput2LSBF; sp->writeit[ kShort ] = endian == MSBFirst ? fli_fput2MSBF : fli_fput2LSBF; sp->readit[ kULong ] = endian == MSBFirst ? fli_fget4MSBF : fli_fget4LSBF; sp->readit[ kLong ] = endian == MSBFirst ? fli_fget4MSBF : fli_fget4LSBF; sp->writeit[ kULong ] = endian == MSBFirst ? fli_fput4MSBF : fli_fput4LSBF; sp->writeit[ kLong ] = endian == MSBFirst ? fli_fput4MSBF : fli_fput4LSBF; sp->read2bytes = sp->readit[ kShort ]; sp->read4bytes = sp->readit[ kLong ]; sp->write2bytes = sp->writeit[ kShort ]; sp->write4bytes = sp->writeit[ kLong ]; } /*************************************** ***************************************/ static void read_tag( FILE * fp, long offset, SPEC * sp ) { int tag_val, count, type, nbyte; TIFFTag *tag; fseek( fp, offset, SEEK_SET ); tag_val = sp->read2bytes( fp ); if ( ! ( tag = find_tag( tag_val ) ) ) { #if TIFF_DEBUG fprintf( stderr, "Unsupported tag 0x%x(%d)\n", tag_val, tag_val ); #endif return; } tag->type = type = sp->read2bytes( fp ); tag->count = count = sp->read4bytes( fp ); if ( type < 0 || type > kDouble || ( nbyte = count * typeSize[ type ] ) <= 0 ) { flimage_error( sp->image, "BadType (%d) or count (%d)\n", type, count ); M_err( "ReadTag", "BadType (%d) or count (%d)\n", type, count ); return; } if ( tag->value && tag->value != &junkBuffer ) fl_free( tag->value ); if ( ! ( tag->value = fl_malloc( sizeof *tag->value * tag->count ) ) ) { flimage_error( sp->image, "Can't allocate %d tag value buffer", tag->count ); return; } if ( nbyte > 4 ) { tag->offset = sp->read4bytes( fp ); tag->value[ 0 ] = tag->offset; fseek( fp, tag->offset, SEEK_SET ); } /* We read the colormap seperately */ if ( tag->tag_value != ColorMap ) { int i; for ( i = 0; i < count; i++) tag->value[ i ] = ( sp->readit[ type ] )( fp ); } } /*************************************** ***************************************/ static int read_tiff_ifd( FILE * fp, SPEC * sp ) { int num_tags, offset, i; TIFFTag *tag; fseek( fp, sp->ifd_offset, SEEK_SET ); num_tags = sp->read2bytes( fp ); for ( offset = sp->ifd_offset + 2, i = 0; i < num_tags; i++ ) { read_tag( fp, offset, sp ); offset += 12; } fseek( fp, sp->ifd_offset + num_tags * 12 + 2, SEEK_SET ); sp->ifd_offset = sp->read4bytes( fp ); /* validate the tags (sort of) */ if ( ! ( tag = find_tag( BitsPerSample ) )->count ) return -1; if ( tag->value[ 0 ] != 1 && tag->value[ 0 ] != 2 && tag->value[ 0 ] != 4 && tag->value[ 0 ] != 8 && tag->value[ 0 ] != 16 ) { M_err( "ReadIFD", "Unsupported bitsPerSample %d", tag->value[ 0 ] ); return -1; } #if TIFF_DEBUG for ( tag = interestedTags; tag->tag_value; tag++ ) { if ( tag->count ) fprintf( stderr, "%s\t count=%2d\t val=%d\n", tag->tag_name, tag->count, tag->value ? tag->value[ 0 ] : 0 ); } fprintf( stderr, "nextIFD at %d\n", sp->ifd_offset ); #endif return 0; } /*************************************** * parameter endian is the endian the input data is in ***************************************/ static unsigned short * convert2( unsigned short * sbuf, int nbytes, int endian ) { int nshort = nbytes / 2, i, j; unsigned char *buf = ( unsigned char * ) sbuf; if ( nbytes & 1 ) { fprintf( stderr, "Error: Bad ByteCount %d\n", nbytes ); return sbuf; } if ( endian == machine_endian( ) ) return sbuf; if ( endian == MSBFirst ) { for ( i = j = 0; i < nshort; i++, j += 2 ) sbuf[ i ] = ( buf[ j ] << 8 ) | buf[ j + 1 ]; } else { for ( i = j = 0; i < nshort; i++, j += 2 ) sbuf[ i ] = buf[ j ] | ( buf[ j + 1 ] << 8 ); } return sbuf; } /*************************************** ***************************************/ static int read_pixels( FL_IMAGE * im ) { SPEC *sp = im->io_spec; int nstrips, val, err, i, j, strip, row, bytecount; TIFFTag *tag, *bytecountTag, *rowsPerStripTag; unsigned char *tmpbuffer, *tmp; int compress, rps, bpl; unsigned short *sbuf; FILE *fp = im->fpin; rowsPerStripTag = find_tag( RowsPerStrip ); if ( ( val = rowsPerStripTag->value[ 0 ] ) <= 0 ) { flimage_error( im, "Bad RowsPerStrip tag" ); return -1; } if ( ( compress = find_tag( Compression )->value[ 0 ] ) && compress != Uncompressed ) { flimage_error( im, "can't handled compressed TIF" ); return -1; } nstrips = ( im->h + val - 1 ) / val; bytecountTag = find_tag( StripByteCount ); if ( nstrips != bytecountTag->count ) { flimage_error( im, "Inconsistent in number of strips" ); return -1; } bpl = ( im->w * sp->spp * find_tag( BitsPerSample )->value[ 0 ] + 7 ) / 8; rps = rowsPerStripTag->value[ 0 ]; tag = find_tag( StripOffsets ); if ( ! ( tmpbuffer = fl_malloc( bytecountTag->value[ 0 ] + 4 ) ) ) { flimage_error( im, "Can't allocate strip buffer (%d bytes)", bytecountTag->value[ 0 ] ); return -1; } for ( row = strip = err = 0; !err && strip < nstrips; strip++ ) { #if TIFF_DEBUG fprintf( stderr, "strip%d at %d\n", strip, tag->value[ strip ] ); #endif fseek( fp, tag->value[strip], SEEK_SET ); bytecount = bytecountTag->value[ strip ]; if ( ( err = ( fread( tmpbuffer, 1, bytecount, fp ) == 0 ) ) ) M_err( "ReadStrip", "Error reading ByteCount" ); /* TODO: de-compress the tmpbuffer */ tmp = tmpbuffer; if ( sp->spp == 1 ) { if ( sp->bps[ 0 ] == 8 ) { unsigned short **ctmp = FL_IsCI( im->type ) ? im->ci : im->gray; for ( i = 0; row < im->h && i < rps; i++, row++ ) { for ( j = 0; j < im->w; j++ ) ctmp[ row ][ j ] = tmp[ j ]; tmp += im->w; } } else if ( sp->bps[ 0 ] > 8 ) { unsigned short **ctmp = FL_IsCI( im->type ) ? im->ci : im->gray; /* TIFF SPEC did not define 16 bps, and seems libtiff always uses MSB. */ sbuf = convert2( ( void * ) tmp, bytecount, MSBFirst /* sp->endian */ ); for ( i = 0; row < im->h && i < rps; i++, row++ ) { memcpy( ctmp[ row ], sbuf, bpl ); sbuf += im->w; } } else if ( sp->bps[ 0 ] == 4 ) { for ( i = 0; row < im->h && i < rps; i++, row++, tmp += bpl ) { for ( j = 0; j < im->w - 1; tmp++ ) { im->ci[ row ][ j++ ] = ( *tmp >> 4 ) & 0x0f; im->ci[ row ][ j++ ] = *tmp & 0x0f; } im->ci[ row ][ j++ ] = ( *tmp >> 4 ) & 0x0f; if ( j < im->w ) im->ci[ row ][ j ] = *tmp & 0x0f; } } else if ( sp->bps[0] == 1 ) { for ( i = 0; row < im->h && i < rps; i++, row++, tmp += bpl ) unpack_bits( im->ci[ row ], tmp, im->w ); } else { M_err( "ReadStrip", "Unhandled bpp=%d\n", sp->bps[ 0 ] ); return -1; } } else if ( sp->spp == 3 || sp->spp == 4 ) { int config = find_tag( PlannarConfig )->value[ 0 ]; if ( sp->bps[ 0 ] == 8 ) { if ( config == RGBRGB ) { for ( i = 0; row < im->h && i < rps; i++, row++ ) { for ( j = 0; j < im->w; j++, tmp += sp->spp ) { im->red[ row ][ j ] = *tmp; im->green[ row ][ j ] = *( tmp + 1 ); im->blue[ row ][ j ] = *( tmp + 2 ); } } } else if ( config == RRGGBB ) { for ( i = 0; row < im->h && i < rps; i++, row++ ) { for ( j = 0; j < im->w; j++, tmp++ ) im->red[ row ][ j ] = *tmp; for ( j = 0; j < im->w; j++, tmp++ ) ; im->green[ row ][ j ] = *tmp; for ( j = 0; j < im->w; j++, tmp++ ) im->blue[ row ][ j ] = *tmp; } } else { M_err( "ReadRGB", "Unknown PlannarConfig %d", config ); return -1; } } else { flimage_error( im, "Unsupported bps=%d", sp->bps[ 0 ] ); return -1; } } else { flimage_error( im, "spp=%d unsupported", sp->spp ); return -1; } } fl_free( tmpbuffer ); if ( find_tag(BitsPerSample)->value[ 0 ] == 1 ) { int b = find_tag( PhotometricI )->value[0] != PhotoBW0Black; im->red_lut[ b ] = im->green_lut[ b ] = im->blue_lut[ b ] = 0; im->red_lut[ ! b ] = im->green_lut[ ! b ] = im->blue_lut[ ! b ] = FL_PCMAX; } /* TODO: post-processing gamma, color/gray response etc */ if ( err ) flimage_error( im, "ErrorReading" ); return err ? -1 : 0; } /*************************************** ***************************************/ static int load_tiff_colormap( FL_IMAGE * im ) { FILE *fp = im->fpin; TIFFTag *tag = find_tag( ColorMap ); SPEC *sp = im->io_spec; if ( ! tag->count ) return 0; if ( im->map_len != tag->count / 3 ) { flimage_error( im, "Bad Colormap" ); return -1; } if ( im->map_len > 0 ) { int i; fseek( fp, tag->offset, SEEK_SET ); for ( i = 0; i < im->map_len; i++ ) im->red_lut[ i ] = sp->readit[ kUShort ]( fp ) >> 8; for ( i = 0; i < im->map_len; i++ ) im->green_lut[ i ] = sp->readit[ kUShort ]( fp ) >> 8; for ( i = 0; i < im->map_len; i++ ) im->blue_lut[ i ] = sp->readit[ kUShort ]( fp ) >> 8; } return 0; } /*************************************** ***************************************/ static void write_tiff_colormap( FL_IMAGE * im, SPEC * sp, int len ) { FILE *fp = im->fpout; int i; sp->write2bytes( ColorMap, fp ); sp->write2bytes( kUShort, fp ); sp->write4bytes( len * 3, fp ); sp->write4bytes( sp->next_pos, fp ); fseek( fp, sp->next_pos, SEEK_SET ); /* red */ for ( i = 0; i < im->map_len; i++ ) sp->write2bytes( im->red_lut[ i ] << 8 | 0xff, fp ); for ( ; i < len; i++ ) sp->write2bytes( 0, fp ); /* green */ for ( i = 0; i < im->map_len; i++ ) sp->write2bytes( im->green_lut[ i ] << 8 | 0xff, fp ); for ( ; i < len; i++ ) sp->write2bytes( 0, fp ); /* blue */ for ( i = 0; i < im->map_len; i++ ) sp->write2bytes( im->blue_lut[ i ] << 8 | 0xff, fp ); for ( ; i < len; i++ ) sp->write2bytes( 0, fp ); } /*************************************** ***************************************/ static void write_tag( FILE * fp, SPEC * sp, int tag_val, int count, int * value, int * n ) { TIFFTag *tag; int i; tag = find_tag( tag_val ); sp->write2bytes( tag_val, fp ); sp->write2bytes( tag->type, fp ); sp->write4bytes( count, fp ); if ( typeSize[ tag->type ] * count > 4 ) { sp->write4bytes( sp->next_pos, fp ); fseek( fp, sp->next_pos, SEEK_SET ); if ( tag->type == ASCII || tag->type == SBYTE || tag->type == kUByte ) { char *p = ( char * ) value; for ( i = 0; i < count; i++ ) sp->writeit[ tag->type ]( p[ i ], fp ); } else for ( i = 0; i < count; i++ ) sp->writeit[ tag->type ]( value[ i ], fp ); sp->next_pos += count * typeSize[ tag->type ]; } else for ( i = 0; i < count; i++ ) sp->writeit[ tag->type ]( value[ i ], fp ); ( *n )++; /* tag is always 12bytes long */ fseek( fp, sp->curr_pos += 12, SEEK_SET ); } /*************************************** ***************************************/ static int write_ifd( FL_IMAGE * im, SPEC * sp ) { FILE *fp = im->fpout; int num_tags, itag, nstrips, bpl; int compression = Uncompressed, photometric; int plannarConfig = RGBRGB, orientation = TopLeft; char doc[ 256 ], *p; static const char *desc = "TIFF by XForms V1.0.91"; int minval = -1, maxval = -1; num_tags = 13; sp->spp = 1; /* strip path info */ if ( ! *strcpy( doc, ( p = strrchr( im->outfile, '/' ) ) ? p + 1 : im->outfile ) ) num_tags--; if ( im->type == FL_IMAGE_CI ) { num_tags++; sp->bps[ 0 ] = 8; photometric = PhotoPalette; } else if ( im->type == FL_IMAGE_MONO ) { sp->bps[ 0 ] = 1; photometric = im->red_lut[ 0 ] > im->red_lut[ 1 ] ? PhotoBW0White : PhotoBW0Black; } else if ( im->type == FL_IMAGE_GRAY || im->type == FL_IMAGE_GRAY16 ) { num_tags += im->type == FL_IMAGE_GRAY ? 0 : 2; sp->bps[ 0 ] = im->type == FL_IMAGE_GRAY ? 8 : 16; minval = 0; maxval = im->gray_maxval; photometric = PhotoBW0Black; } else if ( im->type == FL_IMAGE_RGB ) { sp->bps[ 0 ] = sp->bps[ 1 ] = sp->bps[ 2 ] = 8; sp->spp = 3; photometric = PhotoRGB; } bpl = ( im->w * sp->spp * sp->bps[ 0 ] + 7 ) / 8; sp->rowsPerStrip = sp->strip_size / bpl; nstrips = ( im->h + sp->rowsPerStrip - 1 ) / sp->rowsPerStrip; if ( sp->nstrips < nstrips ) { sp->stripOffsets = fl_calloc( sizeof( int ), nstrips ); sp->stripByteCount = fl_calloc( sizeof( int ), nstrips ); } sp->nstrips = nstrips; /* write the tags */ if ( num_tags > sp->max_tags ) { M_err( "WriteTIFFIFD", "InternalError: run out of tag space" ); return -1; } sp->write2bytes( num_tags, fp ); sp->curr_pos += 2; itag = 0; write_tag( fp, sp, ImageWidth, 1, &im->w, &itag ); write_tag( fp, sp, ImageHeight, 1, &im->h, &itag ); write_tag( fp, sp, BitsPerSample, sp->spp, sp->bps, &itag ); write_tag( fp, sp, Compression, 1, &compression, &itag ); write_tag( fp, sp, PhotometricI, 1, &photometric, &itag ); if ( doc[ 0 ] ) write_tag( fp, sp, DocumentName, strlen( doc ), ( int * ) doc, &itag ); write_tag( fp, sp, Description, strlen(desc), (int *) desc, &itag ); sp->offset_offset = sp->next_pos; write_tag( fp, sp, StripOffsets, nstrips, sp->stripOffsets, &itag ); write_tag( fp, sp, Orientation, 1, &orientation, &itag ); write_tag( fp, sp, SamplesPerPixel, 1, &sp->spp, &itag ); write_tag( fp, sp, RowsPerStrip, 1, &sp->rowsPerStrip, &itag ); sp->bytecount_offset = sp->next_pos; write_tag( fp, sp, StripByteCount, nstrips, sp->stripByteCount, &itag ); if ( im->type == FL_IMAGE_GRAY16 ) { write_tag( fp, sp, MinSampleValue, 1, &minval, &itag ); write_tag( fp, sp, MaxSampleValue, 1, &maxval, &itag ); } write_tag( fp, sp, PlannarConfig, 1, &plannarConfig, &itag ); if ( im->type == FL_IMAGE_CI ) { itag++; /* we always write 8bit palette image */ write_tiff_colormap( im, sp, 256 ); sp->next_pos += 256 * 3 * typeSize[ kShort ]; fseek( fp, sp->curr_pos += 12, SEEK_SET ); } if ( itag != num_tags ) { M_err( "WriteTIFFIFD", "wrong number of tags. wrote %d expect %d", itag, num_tags ); return -1; } /* we do not know where next IFD is at, but need to reserve space */ sp->ifd_offset = sp->curr_pos; sp->write4bytes( 0, fp ); sp->curr_pos += sp->curr_pos; return ( feof( fp ) || ferror( fp ) ) ? -1 : 0; } /*************************************** ***************************************/ static int write_pixels( FL_IMAGE * im, SPEC * sp ) { FILE *fp = im->fpout; int row, i, j, k, err, eof, strip; int bytesPerRow; unsigned char *tmpbuf; fseek( fp, 0, SEEK_END ); eof = ftell( fp ); bytesPerRow = ( im->w * sp->spp * sp->bps[ 0 ] + 7 ) / 8; for ( i = 0; i < sp->nstrips; i++ ) { sp->stripByteCount[ i ] = sp->rowsPerStrip * bytesPerRow; sp->stripOffsets[ i ] = eof + i * sp->stripByteCount[ i ]; } /* fix up the last strip, otherwise we need to pad the output */ sp->stripByteCount[ sp->nstrips - 1 ] = bytesPerRow * ( im->h - sp->rowsPerStrip * ( sp->nstrips - 1 ) ); fseek( fp, sp->offset_offset, SEEK_SET ); for ( i = 0; i < sp->nstrips; i++ ) sp->write4bytes( sp->stripOffsets[ i ], fp ); /* if compression, we won't know the bytecount until after writing */ fseek( fp, sp->bytecount_offset, SEEK_SET ); for ( i = 0; i < sp->nstrips; i++ ) sp->write4bytes( sp->stripByteCount[i], fp ); if ( ! ( tmpbuf = fl_malloc( bytesPerRow + 4 ) ) ) { flimage_error( im, "Can't allocate buffer (%d bytes)", bytesPerRow ); return -1; } for ( row = strip = err = 0; !err && strip < sp->nstrips; strip++ ) { fseek( fp, sp->stripOffsets[ strip ], SEEK_SET ); if ( im->type == FL_IMAGE_CI ) { for ( j = 0; row < im->h && j < sp->rowsPerStrip; j++, row++ ) { for ( k = 0; k < im->w; k++ ) tmpbuf[ k ] = im->ci[ row ][ k]; err = fwrite( tmpbuf, 1, bytesPerRow, fp ) != ( size_t ) bytesPerRow; } } else if ( im->type == FL_IMAGE_GRAY ) { for ( j = 0; row < im->h && j < sp->rowsPerStrip; j++, row++ ) { for ( k = 0; k < im->w; k++ ) tmpbuf[ k ] = im->gray[ row ][ k ]; err = fwrite( tmpbuf, 1, bytesPerRow, fp ) != ( size_t ) bytesPerRow; } } else if ( im->type == FL_IMAGE_GRAY16 ) { for ( j = 0; row < im->h && j < sp->rowsPerStrip; j++, row++ ) { /* tiff spec 6.0 did not define 16 bits samples. libtiff seems to use MSB always for this. We do the same */ for ( k = 0; k < im->w; k++ ) fli_fput2MSBF( im->gray[row][k], fp ); /* sp->write2bytes(im->gray[row][k], fp); */ } } else if ( im->type == FL_IMAGE_MONO ) { for ( j = 0; row < im->h && j < sp->rowsPerStrip; j++, row++ ) { pack_bits( tmpbuf, im->ci[row], im->w ); err = fwrite( tmpbuf, 1, bytesPerRow, fp ) != ( size_t ) bytesPerRow; } } else if ( im->type == FL_IMAGE_RGB ) { /* always write RGBRGB */ for ( j = 0; row < im->h && j < sp->rowsPerStrip; j++, row++ ) { for ( k = 0; k < im->w; k++ ) { tmpbuf[ 0 ] = im->red[ row ][ k ]; tmpbuf[ 1 ] = im->green[ row ][ k ]; tmpbuf[ 2 ] = im->blue[ row ][ k ]; err = fwrite( tmpbuf, 1, 3, fp ) != 3; } } } else { flimage_error( im, "unhandled type: %s", flimage_type_name( im->type ) ); return -1; } } fl_free( tmpbuf ); fseek( fp, 0, SEEK_END ); sp->next_pos = ftell( fp ); return err ? -1 : 0; } /*************************************** ***************************************/ #if 0 static int PackBitsDecode( char * input, char * output, int inlen, int outlen ) { int b, n; for ( n = 0; n < outlen; ) { b = *input; if ( b >= 128 ) b -= 256; if ( b == -128 ) ; if (b < 0) { b = -b + 1; input++; } } } #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_sgi.c0000644000175000017500000000475712251675241013151 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1998-2002 T.C. Zhao * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" /*************************************** ***************************************/ static int IRIS_identify( FILE * fp ) { char buf[ 2 ]; if ( fread( buf, 1, 2, fp ) != 2 ) return 0; return ( buf[ 0 ] == '\001' && buf[ 1 ] == '\332' ) || ( buf[ 0 ] == '\332' && buf[ 1 ] == '\001' ); } /*************************************** ***************************************/ static int IRIS_description( FL_IMAGE * im ) { static char *cmds[ ] = { "sgitopnm %s > %s", NULL }; return flimage_description_via_filter( im, cmds, "reading iris ...", 0 ); } /*************************************** ***************************************/ static int IRIS_load( FL_IMAGE * im FL_UNUSED_ARG ) { fprintf( stderr, "should never been here\n" ); return -1; } /*************************************** ***************************************/ static int IRIS_dump( FL_IMAGE * im ) { static char *cmds[ ] = { "pnmtosgi %s > %s", NULL }; static char *formats[ ] = { "ppm", "pgm", "pbm", NULL }; return flimage_write_via_filter( im, cmds, formats, 0 ); } /*************************************** ***************************************/ void flimage_enable_sgi( void ) { flimage_add_format( "SGI Iris", "iris", "rgb", FL_IMAGE_RGB | FL_IMAGE_GRAY | FL_IMAGE_MONO, IRIS_identify, IRIS_description, IRIS_load, IRIS_dump); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_io_filter.c0000644000175000017500000001623212251675277014343 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1993, 1998-2002 T.C. Zhao * All rights reserved. * * Use one of the builtin image reader and an external filter to * add new supported format. * * TODO: add signal handling to make sure the temp files are deleted. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" #include "private/flsnprintf.h" #include #include #include #include #ifdef FL_WIN32 #include #include #include #endif /*************************************** ***************************************/ static char * get_tmpf( char * obuf ) { static int k, seq; static char buf[ 15 ][ 256 ]; int fd = -1, tries = 0; char *name; k = ( k + 1 ) % 15; name = obuf ? obuf : buf[ k ]; do { if ( ( fd = mkstemp( name ) ) >= 0 ) /* empty */ ; else { fli_snprintf( buf[ k ], sizeof buf[ k ], "%s/.FL%03d_%d.tmp", "/tmp", seq++, ( int ) getpid( ) ); name = buf[ k ]; /* create the file now in exclusive mode (for security) */ fd = open( name, O_RDWR | O_CREAT | O_EXCL, S_IREAD | S_IWRITE ); } tries++; } while ( fd < 0 && tries < 30 ); if ( fd >= 0 ) { close( fd ); return name; } return 0; } /*************************************** ***************************************/ int flimage_description_via_filter( FL_IMAGE * im, char * const * cmds, const char * what, int verbose ) { char cmd[ 1024 ], *tmpf; char * const *q = cmds; int status = 0, n; if ( ! ( tmpf = get_tmpf( 0 ) ) ) { im->error_message( im, "can't get tmpfile!" ); return -1; } do { fli_snprintf( cmd, sizeof cmd - 12, *q, im->infile, tmpf ); if ( verbose ) fprintf( stderr, "executing %s\n", cmd ); else strcat( cmd, " 2>/dev/null" ); status = system( cmd ); } while ( status && *++q ); if ( status ) { M_err( "", "%s failed", cmd ); return -1; } /* first check if the converted image is something we can handle */ if ( ! ( n = flimage_is_supported( tmpf ) ) ) { im->error_message( im, "unknown filtered output" ); remove( tmpf ); return -1; } im->visual_cue( im, what ); /* now we're really ok */ fclose( im->fpin ); im->fpin = fopen( tmpf, "rb" ); strcpy( cmd, im->infile ); strcpy( im->infile, tmpf ); /* if verbose, delay the file deletion in case we want to look at it */ --n; if ( verbose ) fprintf( stderr, " reading %s via %s\n", ( ( FLIMAGE_IO * ) im->image_io )->short_name, flimage_io[ n ].short_name ); if ( strcmp( im->fmt_name, "gzip" ) == 0 ) im->fmt_name = flimage_io[ n ].short_name; im->image_io = flimage_io + n; im->type = flimage_io[ n ].type; flimage_io[ n ].identify( im->fpin ); /* advance file position */ status = flimage_io[ n ].read_description( im ); remove( tmpf ); strcpy( im->infile, cmd ); return status; } /********************************************************************** * write via external filters **********************************************************************/ /* Given several formats, say ppm, pgm, and pbm, check if the image * type is the same as one of the requested. If yes, return the IO struct * else return the first match. Therefore, * caller should place the formats in decreasing order of generality, * i.e., ppm, pgm, pbm, never pbm, pgm, ppm. */ static FLIMAGE_IO * best_format( FL_IMAGE * im, char * const formats[ ] ) { FLIMAGE_IO *io = flimage_io; char *const *fmts = formats; FLIMAGE_IO *first = 0, *best_sofar = 0; int found; for ( ; *fmts; fmts++ ) { for ( io = flimage_io, found = 0; ! found && io->formal_name; io++ ) found = strcasecmp( io->formal_name, *fmts ) == 0 || strcasecmp( io->short_name, *fmts ) == 0; if ( found ) { io--; best_sofar = ( im->type & io->type ) ? io : 0; if ( ! first ) first = best_sofar; } else fprintf( stderr, "bad format name: %s\n", *fmts ); } return best_sofar ? best_sofar : first; } /*************************************** ***************************************/ int flimage_write_via_filter( FL_IMAGE * im, char * const * cmds, /* shell commands */ char *const formats[ ], /* formats */ int verbose ) { char *tmpf; char ofile[ 256 ], cmd[ 1024 ]; char * const *shellcmd; FLIMAGE_IO *io; int err, status; /* check if we can handle the type */ if ( ! ( io = best_format( im, formats ) ) ) { fprintf( stderr, "can't find format handler\n" ); return -1; } if ( ! ( io->type & im->type ) ) flimage_convert( im, io->type, 256 ); tmpf = get_tmpf( 0 ); strcpy( ofile, im->outfile ); strcpy( im->outfile, tmpf ); if ( ! ( im->fpout = fopen( im->outfile, "wb" ) ) ) { fprintf( stderr, "can't open %s\n", tmpf ); remove( tmpf ); return -1; } /* skip the pre_write step */ err = io->write_image( im ) < 0; fclose( im->fpout ); if ( verbose ) fprintf( stderr, "Done writing %s (%s) \n", im->outfile, io->short_name ); /* now we have the intermediate image ready, generate the shell cmd */ for ( shellcmd = cmds, status = ! err; status && *shellcmd; shellcmd++ ) { fli_snprintf( cmd, sizeof cmd, *shellcmd, tmpf, ofile ); if ( ! verbose ) strcat( cmd, " 2>/dev/null" ); else fprintf( stderr, "executing %s\n", cmd ); status = system( cmd ); } remove( tmpf ); strcpy( im->outfile, ofile ); if ( status ) fprintf( stderr, "%s failed\n", cmd ); return status ? -1 : 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_bmp.c0000644000175000017500000004306712251675343013145 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1993,1998-2002 T.C. Zhao * All rights reserved. * * MS Windows/OS2 bmp file support */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" #include #include #include #define BMPDEBUG 0 typedef struct { long fsize; /* total file size */ long offset; int infosize; /* supposedly 40 bytes */ int bpp; /* bits per pixel */ int w, h; /* width & height in pixels */ int col_used; /* actual colors used */ int col_important; int planes; int encode; /* compression method */ long isize; /* (compressed) image size */ int xres, yres; /* pix per meter */ int bpl; /* bytes per line */ int pad; /* line pad */ } SPEC; static int load_24bit_bmp( FL_IMAGE *, SPEC * ); static int load_8bit_bmp( FL_IMAGE *, SPEC * ); static int load_4bit_bmp( FL_IMAGE *, SPEC * ); static int load_1bit_bmp( FL_IMAGE *, SPEC * ); /*************************************** ***************************************/ static int BMP_identify( FILE * fp ) { char buf[ 2 ]; size_t c; c = fread( buf, 1, 2, fp ); rewind( fp ); return c == 2 && buf[ 0 ] == 'B' && buf[ 1 ] == 'M'; } /*************************************** ***************************************/ #if BMPDEBUG static void dump_header( const char * where, SPEC * sp ) { fprintf( stderr, "%s\noffset=%ld infosize=%d\n", where, sp->offset, sp->infosize ); fprintf( stderr, "bpl=%d ", sp->bpl ); fprintf( stderr, "w=%d h=%d bpp=%d col_used=%d important=%d\n", sp->w, sp->h, sp->bpp, sp->col_used, sp->col_important ); } #endif enum { E_RGB, E_RLE8, E_RLE4 }; #define bad_bpp( b ) ( b != 1 && b != 4 && b != 8 && b != 24 ) /*************************************** ***************************************/ static void generate_header_info( FL_IMAGE * im ) { SPEC *sp = im->io_spec; static const char *encoding[ ] = { "RGB", "RLE8", "RLE4" }; char buf[ 128 ]; if ( ! ( im->info = fl_malloc( 512 ) ) ) return; sprintf( im->info,"Size=(%d x %d)\n", im->w, im->h ); sprintf( buf, "BitsPerPixel=%d\nBytesPerLine=%d\n", sp->bpp, sp->bpl ); strcat( im->info,buf ); if ( sp->bpp != 24 ) { sprintf( buf,"ColorUsed=%d\n", sp->col_used ); strcat( im->info,buf ); } sprintf( buf,"Encoding=%s", encoding[ sp->encode ] ); strcat( im->info,buf ); } /*************************************** ***************************************/ static int BMP_description( FL_IMAGE * im ) { SPEC *sp = fl_calloc( 1, sizeof *sp ); char buf[ 40 ]; if ( fread( buf, 1, 2, im->fpin ) != 2 ) { im->error_message( im, "error while readin bmp file" ); fl_free( sp ); return -1; } sp->fsize = fli_fget4LSBF( im->fpin ); if ( fread( buf, 1, 4, im->fpin ) != 4 ) { im->error_message( im, "error while reading bmp file" ); fl_free( sp ); return -1; } sp->offset = fli_fget4LSBF( im->fpin ); sp->infosize = fli_fget4LSBF( im->fpin ); if ( sp->infosize != 40 && sp->infosize != 64 ) { im->error_message( im, "unsupported old obsolete bmp file" ); fl_free( sp ); return -1; } im->io_spec = sp; sp->w = fli_fget4LSBF( im->fpin ); sp->h = fli_fget4LSBF( im->fpin ); sp->planes = fli_fget2LSBF( im->fpin ); sp->bpp = fli_fget2LSBF( im->fpin ); sp->encode = fli_fget4LSBF( im->fpin ); sp->isize = fli_fget4LSBF( im->fpin ); sp->xres = fli_fget4LSBF( im->fpin ); sp->yres = fli_fget4LSBF(im->fpin); sp->col_used = fli_fget4LSBF( im->fpin ); sp->col_important = fli_fget4LSBF( im->fpin ); if ( bad_bpp( sp->bpp ) ) { flimage_error( im, "%s: bad bpp (%d)", im->infile, sp->bpp ); fl_free( im->io_spec ); im->io_spec = 0; return -1; } if ( sp->infosize != 40 ) { int skip = sp->infosize - 40; if ( skip < 0 || fread( buf, 1, skip, im->fpin ) != ( size_t ) skip ) { flimage_error( im, "%s: error while reading bmp file", im->infile ); fl_free( im->io_spec ); im->io_spec = 0; return -1; } } im->w = sp->w; im->h = sp->h; /* read colormap */ if ( sp->bpp != 24 ) { int i; if ( ( im->map_len = sp->col_used ) <= 0 ) im->map_len = 1 << sp->bpp; flimage_getcolormap( im ); for ( i = 0; i < im->map_len; i++ ) { im->blue_lut[ i ] = getc( im->fpin ); im->green_lut[ i ] = getc( im->fpin ); im->red_lut[ i ] = getc( im->fpin ); im->alpha_lut[ i ] = getc( im->fpin ); } } sp->bpl = ( sp->w * sp->bpp + 7 ) / 8; sp->pad = ( ( sp->bpl + 3 ) / 4 ) * 4 - sp->bpl; /* pad to 4 bytes */ if ( sp->bpp == 24 ) im->type = FL_IMAGE_RGB; else if ( sp->bpp == 1 ) im->type = FL_IMAGE_MONO; else im->type = FL_IMAGE_CI; #if BMPDEBUG dump_header( "after read", sp ); #endif if ( im->setup->header_info ) generate_header_info( im ); return 1; } /*************************************** ***************************************/ static int BMP_read_pixels( FL_IMAGE * im ) { int status; SPEC *sp = im->io_spec; fseek( im->fpin, sp->offset, SEEK_SET ); im->completed = 0; if ( sp->bpp == 24 ) status = load_24bit_bmp( im, sp ); else if ( sp->bpp == 8 ) status = load_8bit_bmp( im, sp ); else if ( sp->bpp == 4 ) status = load_4bit_bmp( im, sp ); else status = load_1bit_bmp( im, sp ); return status; } /*************************************** ***************************************/ static int load_24bit_bmp( FL_IMAGE * im, SPEC * sp ) { FILE *fp = im->fpin; int i, j; unsigned char *red, *green, *blue; for ( i = im->h - 1; ! feof( fp ) && i >= 0; i--, im->completed++ ) { red = im->red[ i ]; green = im->green[ i ]; blue = im->blue[ i ]; for ( j = 0; j < im->w; j++ ) { blue[ j ] = getc( fp ); green[ j ] = getc( fp ); red[ j ] = getc( fp ); } for ( j = 0; j < sp->pad; j++ ) getc( fp ); if ( ! ( im->completed & FLIMAGE_REPFREQ ) ) im->visual_cue( im, "Reading 24bit BMP" ); } return ( i < im->h / 2 ) ? 1 : -1; } /*************************************** ***************************************/ static int load_8bit_bmp( FL_IMAGE * im, SPEC * sp ) { FILE *fp = im->fpin; int i, pix; unsigned short *ci; if ( sp->encode == E_RGB ) { for ( i = im->h - 1; i >= 0 && ! feof( fp ); i--, im->completed++ ) { int j; ci = im->ci[ i ]; for ( j = 0; j < im->w + sp->pad; j++ ) { /* check for EOF so we can display partial files */ if ( ( pix = getc( fp ) ) != EOF && j < im->w ) *ci++ = pix; } if ( ! ( im->completed & FLIMAGE_REPFREQ ) ) im->visual_cue( im, "Reading 8bit BMP" ); } } else { ci = im->ci[ im->h - 1 ]; for ( i = im->h - 1; i >= 0 && ! feof( fp ); ) { int len = getc( fp ); pix = getc( fp ); if ( len ) { while ( --len >= 0 ) *ci++ = pix; } else { if ( pix == 0 ) ci = im->ci[ --i ]; else if ( pix == 1 ) goto done; else if ( pix == 2 ) { /* the document is unclear. don't know what does down mean */ ci += getc( fp ); i += ( pix = getc( fp ) ); ci -= pix * im->w; } else { int k; for ( k = 0; k < pix; k++ ) *ci++ = getc( fp ); if ( k & 1 ) getc( fp ); } } if ( ! ( ( im->completed = im->h - i - 1 ) & FLIMAGE_REPFREQ ) ) im->visual_cue( im, "Reading 8bit encoded BMP" ); } } done: return i < ( 2 * im->h / 3 ) ? 1 : -1; } /*************************************** ***************************************/ static int load_4bit_bmp( FL_IMAGE * im, SPEC * sp ) { FILE *fp = im->fpin; int i = -1; unsigned short *ci, *cis = 0; if ( sp->encode == E_RGB ) { for ( i = im->h - 1; i >= 0 && ! feof( fp ); i--, im->completed++ ) { int j; ci = im->ci[ i ]; cis = ci + im->w; for ( j = 0; j < sp->bpl; j++ ) { int c = getc( fp ); *ci++ = ( c >> 4 ) & 0x0f; if ( ci < cis ) *ci++ = c & 0x0f; } for ( ; j < sp->bpl + sp->pad; j++ ) getc( fp ); if ( ! ( im->completed & FLIMAGE_REPFREQ ) ) im->visual_cue( im, "Reading 4bit BMP" ); } } else { for ( i = im->h - 1; i >= 0 && ! feof( fp ); ) { int len = getc( fp ); int pix = getc( fp ); ci = im->ci[ i ]; if ( len ) { int k; /* len is the number of pixels, not bytes */ for ( k = 0; k < len; k++ ) *ci++ = ( ( k & 1 ) ? pix : ( pix >> 4 ) ) & 0x0f; } else { if ( pix == 0 ) ci = im->ci[ --i] ; else if ( pix == 1 ) goto done; else if ( pix == 2 ) { ci += getc( fp ); i += ( pix = getc( fp ) ); ci -= pix * im->w; } else { int k; for ( k = 0, len = pix; k < len; k++ ) { if ( ( k & 1 ) == 0 ) pix = getc( fp ); *ci++ = ( ( k & 1 ) ? pix : ( pix >> 4 ) ) & 0x0f; } /* take care of padding, 2bytes boundary */ pix = len % 4; if ( pix && pix != 3 ) getc( fp ); } } if ( ! ( ( im->completed = im->h - 1 - i ) & FLIMAGE_REPFREQ ) ) im->visual_cue( im, "Reading 4bit encoded BMP" ); } } done: return ( i < ( 2 * im->h / 3 ) ) ? 1 : -1; } /*************************************** ***************************************/ static int load_1bit_bmp( FL_IMAGE * im, SPEC * sp ) { int i, totalbpl = sp->bpl + sp->pad; unsigned char *buf = fl_malloc( totalbpl ); if( ! buf ) { im->error_message( im, "malloc() failed" ); return -1; } for ( i = im->h; --i >= 0 && ! feof( im->fpin ); ) { if ( fread( buf, 1, totalbpl, im->fpin ) != ( size_t ) totalbpl ) { fl_free( buf ); im->error_message( im, "malloc() failed" ); return -1; } unpack_bits( im->ci[ i ], buf, im->w ); } fl_free( buf ); return i < im->h / 2 ? 1 : -1; } /* write routine */ #define IS_RGB( im ) ( im->type == FL_IMAGE_RGB ) #define IS_BW( im ) ( im->type == FL_IMAGE_MONO ) #define IS_8bit( im ) ( im->map_len > 16 ) /*************************************** ***************************************/ static int write_bmp_header( FL_IMAGE * im, SPEC * sp ) { FILE *fp = im->fpout; int mapsize; sp->w = im->w; sp->h = im->h; sp->bpp = ( IS_RGB( im ) ? 24 : ( IS_BW( im ) ? 1 : 8 ) ); /* make exception for 16 colors or less */ if ( im->type == FL_IMAGE_CI && im->map_len <= 16 ) sp->bpp = im->map_len <= 2 ? 1 : 4; /* if grayscale, we can make it into a CI */ if ( im->type == FL_IMAGE_GRAY ) sp->bpp = 8; /* bytes per line */ sp->bpl = ( im->w * sp->bpp + 7 ) / 8; sp->pad = ( ( sp->bpl + 3 ) / 4 ) * 4 - sp->bpl; sp->infosize = 40; mapsize = 4 * ( sp->bpp != 24 ? ( 1 << sp->bpp ) : 0 ); sp->fsize = 14 + sp->infosize + mapsize + im->h * ( im->w + sp->pad ); sp->offset = 14 + sp->infosize + mapsize; sp->col_used = sp->col_important = sp->bpp != 24 ? im->map_len : 0; if ( sp->bpp == 1 ) sp->col_used = sp->col_important = 2; #if BMPDEBUG dump_header( "before write", sp ); #endif /* start writing */ fputc( 'B', fp ); fputc( 'M', fp ); fli_fput4LSBF( sp->fsize, fp ); fli_fput4LSBF( 0, fp ); fli_fput4LSBF( sp->offset, fp ); fli_fput4LSBF( sp->infosize, fp ); fli_fput4LSBF( sp->w, fp ); fli_fput4LSBF( sp->h, fp ); fli_fput2LSBF( 1, fp ); fli_fput2LSBF( sp->bpp, fp ); fli_fput4LSBF( E_RGB, fp ); fli_fput4LSBF( 0, fp ); /* encoded size */ fli_fput4LSBF( 96 * 36, fp ); fli_fput4LSBF( 96 * 36, fp ); fli_fput4LSBF( sp->col_used, fp ); /* actual colors */ fli_fput4LSBF( sp->col_important, fp ); /* important colors */ if ( sp->bpp != 24 ) { char junk[ ] = { 0, 0, 0, 0 }; int i; for ( i = 0; i < im->map_len; i++ ) { putc( im->blue_lut[ i ], fp ); putc( im->green_lut[ i ], fp ); putc( im->red_lut[ i ], fp ); putc( 0, fp ); } for ( ; i < 1 << sp->bpp; i++ ) fwrite( junk, 1, 4, fp ); } return 0; } /*************************************** ***************************************/ static int BMP_write_image( FL_IMAGE * im ) { SPEC *sp = fl_calloc( 1, sizeof *sp ); FILE *fp = im->fpout; int i, j; write_bmp_header( im, sp ); if ( sp->bpp == 24 ) { unsigned char *r, *g, *b; for ( i = im->h; --i >= 0 ; ) { r = im->red[ i ]; g = im->green[ i ]; b = im->blue[ i ]; for ( j = 0; j < im->w; j++, r++, g++, b++ ) { putc( *b, fp ); putc( *g, fp ); putc( *r, fp ); } for ( j = 0; j < sp->pad; j++ ) putc( 0, fp ); } } else if ( sp->bpp == 8 ) { unsigned short *p8, **ras = FL_IMAGE_CI ? im->ci:im->gray; for ( i = im->h; --i >= 0; ) { p8 = ras[ i ]; for ( j = 0; j < im->w; j++, p8++ ) putc( *p8, fp ); for ( j = 0; j < sp->pad; j++ ) putc( 0, fp ); } } else if ( sp->bpp == 4 ) { unsigned short *ci, *cis; unsigned char uc; for ( i = im->h; --i >= 0; ) { cis = ( ci = im->ci[ i ] ) + im->w; for ( j = 0; j < sp->bpl; j++ ) { uc = *ci++; uc <<= 4; if ( ci < cis ) uc |= *ci++; putc( uc, fp ); } for ( j = 0; j < sp->pad; j++ ) putc( 0, fp ); } } else if ( sp->bpp == 1 ) { int totalbpl = sp->bpl + sp->pad; unsigned char *tmpbuf = fl_malloc( totalbpl ); if ( ! tmpbuf ) { im->error_message( im, "malloc() failed" ); return -1; } for ( i = im->h; --i >= 0; ) { pack_bits( tmpbuf, im->ci[ i ], im->w ); fwrite( tmpbuf, 1, totalbpl, fp ); } fl_free( tmpbuf ); } fl_free( sp ); return 0; } /*************************************** ***************************************/ void flimage_enable_bmp( void ) { flimage_add_format( "Windows/OS2 BMP file", "bmp", "bmp", FL_IMAGE_FLEX & ~FL_IMAGE_GRAY16, BMP_identify, BMP_description, BMP_read_pixels, BMP_write_image ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_gzip.c0000644000175000017500000000472012251675301013323 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1998-2002 T.C. Zhao * All rights reserved. * * handle gzip/compress */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" /*************************************** ***************************************/ static int GZIP_identify( FILE * fp ) { char buf[ 2 ]; if ( fread( buf, 1, 2, fp ) != 2 ) return 0; return buf[ 0 ] == '\037' && ( buf[ 1 ] == '\213' || buf[ 1 ] == '\235' ); } /*************************************** ***************************************/ static int GZIP_description( FL_IMAGE * im ) { static char *cmds[ ] = { "gzip -dc %s > %s", NULL }; return flimage_description_via_filter( im, cmds, "reading gzip ...", 0 ); } /*************************************** ***************************************/ static int GZIP_load( FL_IMAGE * im FL_UNUSED_ARG ) { fprintf( stderr, "should never been here\n" ); return -1; } /*************************************** ***************************************/ static int GZIP_dump( FL_IMAGE * im ) { static char *cmds[ ] = {"gzip %s > %s", NULL }; static char *formats[ ] = { "ppm", "pgm", "pbm", NULL }; return flimage_write_via_filter( im, cmds, formats, 0 ); } /*************************************** ***************************************/ void flimage_enable_gzip( void ) { flimage_add_format( "GZIP format", "gzip", "gz", FL_IMAGE_FLEX, GZIP_identify, GZIP_description, GZIP_load, GZIP_dump ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_crop.c0000644000175000017500000002217512251675330013323 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1993, 1998-2002 T.C. Zhao * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" /*************************************** ***************************************/ int flimage_get_autocrop( FL_IMAGE * im, unsigned int bk, int * xl, int * yt, int * xr, int * yb ) { int ok, i, j; unsigned int p; if ( ! im || im->w <= 0 ) return -1; /* take the color at pixel(0,0) as the color */ if ( bk == FLIMAGE_AUTOCOLOR ) { if ( FL_IsCI( im->type ) ) { p = im->ci[ 0 ][ 0 ]; bk = FL_PACK( im->red_lut[ p ], im->green_lut[ p ], im->blue_lut[ p ] ); } else if ( im->type == FL_IMAGE_RGB ) { bk = FL_PACK( im->red[ 0 ][ 0 ], im->green[ 0 ][ 0 ], im->blue[ 0 ][ 0 ] ); } else if ( im->type == FL_IMAGE_GRAY || im->type == FL_IMAGE_GRAY16 ) { p = im->gray[ 0 ][ 0 ]; if ( im->type == FL_IMAGE_GRAY16 ) p = ( 255 * p ) / im->gray_maxval; bk = FL_PACK( p, p, p ); } } if ( FL_IsCI(im->type ) ) bk = flimage_get_closest_color_from_map( im, bk ); else if ( FL_IsGray( im->type ) ) bk = FL_RGB2GRAY( FL_GETR( bk ), FL_GETG( bk ), FL_GETB( bk ) ); if (im->type == FL_IMAGE_RGB) { /* do xl */ for ( *xl = 0, ok = 1; ok && *xl < im->w; ( *xl )++ ) { for ( i = 0; ok && i < im->h; i++ ) { p = FL_PACK( im->red[ i ][ *xl ], im->green[ i ][ *xl ], im->blue[ i ][ *xl ] ); ok = p == bk; } } /* do xr */ for ( *xr = 0, ok = 1; ok && *xr < im->w; ( *xr )++ ) { j = im->w - 1 - *xr; for ( i = 0; ok && i < im->h; i++ ) { p = FL_PACK( im->red[ i ][ j ], im->green[ i ][ j ], im->blue[ i ][ j ] ); ok = p == bk; } } /* do yt */ for ( *yt = 0, ok = 1; ok && *yt < im->h; ( *yt )++ ) { for ( i = 0; ok && i < im->w; i++ ) { p = FL_PACK( im->red[ *yt ][ i ], im->green[ *yt ][ i ], im->blue[ *yt ][ i ] ); ok = p == bk; } } /* do yb */ for ( *yb = 0, ok = 1; ok && *yb < im->h; ( *yb )++ ) { j = im->h - 1 - *yb; for ( i = 0; ok && i < im->w; i++ ) { p = FL_PACK( im->red[ j ][ i ], im->green[ j ][ i ], im->blue[ j ][ i ] ); ok = p == bk; } } } else { unsigned short **pix = FL_IsGray( im->type ) ? im->gray : im->ci; /* do xl */ for ( *xl = 0, ok = 1; ok && *xl < im->w; ( *xl )++ ) { for ( i = 0; ok && i < im->h; i++ ) ok = pix[ i ][ *xl ] == bk; } /* do xr */ for ( *xr = 0, ok = 1; ok && *xr < im->w; ( *xr )++ ) { j = im->w - 1 - *xr; for ( i = 0; ok && i < im->h; i++ ) ok = pix[ i ][ j ] == bk; } /* do yt */ for ( *yt = 0, ok = 1; ok && *yt < im->h; ( *yt )++ ) { for ( i = 0; ok && i < im->w; i++ ) ok = pix[ *yt ][ i ] == bk; } /* do yb */ for ( *yb = 0, ok = 1; ok && *yb < im->h; ( *yb )++ ) { j = im->h - 1 - *yb; for ( i = 0; ok && i < im->w; i++ ) ok = pix[ j ][ i ] == bk; } } --*xl; --*yt; --*xr; --*yb; return 0; } /*************************************** * crop an image using bk as the background ***************************************/ int flimage_autocrop( FL_IMAGE * im, unsigned int bk ) { int xl, xr, yt, yb; flimage_get_autocrop( im, bk, &xl, &yt, &xr, &yb ); return flimage_crop( im, xl, yt, xr, yb ); } /*************************************** * we allow croping region to be bigger than image, and in that case * we fill the regions that're outside of the image ***************************************/ int flimage_crop( FL_IMAGE * im, int xl, int yt, int xr, int yb ) { int nw = im->w - xl - xr, nh = im->h - yt - yb; unsigned short **us = 0, **pix = 0; unsigned char **red = 0, **green = 0, **blue = 0; unsigned int fill; int rows = FL_min( nh, im->h ), cols = FL_min( nw, im->w ); int hfill, wfill, err, i, j; int xx = xl < 0 ? 0 : xl, yy = yt < 0 ? 0 : yt; /* old image offset */ int x = xl < 0 ? -xl : 0, y = yt < 0 ? -yt : 0; /* new image offset */ if ( ( ! xl && ! xr && ! yt && ! yb ) || ! im ) return 0; im->completed = 0; im->visual_cue( im, "Cropping ..." ); wfill = ( im->w < nw ) ? FL_max( FL_abs( xl ), FL_abs( xr ) ) : 0; hfill = ( im->h < nh ) ? FL_max( FL_abs( yt ), FL_abs( yb ) ) : 0; fill = im->fill_color; if ( FL_IsGray( im->type ) || FL_IsCI( im->type ) ) { flimage_free_rgb( im ); err = ! ( us = fl_get_matrix( nh, nw, sizeof **us ) ); if ( FL_IsGray(im->type ) ) { fill = FL_RGB2GRAY( FL_GETR( fill ), FL_GETG( fill ), FL_GETB( fill ) ); if ( im->type == FL_IMAGE_GRAY16 ) fill = ( fill * im->gray_maxval ) / 255; pix = im->gray; } else { fill = flimage_get_closest_color_from_map( im, fill ); pix = im->ci; } } else { flimage_free_gray( im ); flimage_free_ci( im ); err = ! ( red = fl_get_matrix( nh, nw, sizeof **red ) ); err = err || ! ( green = fl_get_matrix( nh, nw, sizeof **green ) ); err = err || ! ( blue = fl_get_matrix( nh, nw, sizeof **blue ) ); } if ( err ) { im->error_message( im, "Crop: Failed to get memory" ); return -1; } /* now it's a go */ if ( FL_IsGray( im->type ) || FL_IsCI( im->type ) ) { for ( i = 0; i < hfill; i++ ) for ( j = 0; j < nw; j++ ) us[ i ][ j ] = us[ nh - 1 - i ][ j ] = fill; for ( j = 0; j < wfill; j++ ) for ( i = 0; i < nh; i++ ) us[ i ][ j ] = us[ i ][ nw - 1 - j ] = fill; for ( i = 0; i < rows; i++ ) memcpy( us[ i + y ] + x, pix[ i + yy ] + xx, cols * sizeof **us ); flimage_replace_image( im, nw, nh, us, 0, 0 ); } else { for ( i = 0; i < hfill; i++ ) for (j = 0; j < nw; j++ ) { red[ i ][ j ] = red[ nh - 1 - i ][ j ] = FL_GETR( fill ); green[ i ][ j ] = green[ nh - 1 - i ][ j ] = FL_GETG( fill ); blue[ i ][ j ] = blue[ nh - 1 - i ][ j ] = FL_GETB( fill ); } for ( j = 0; j < wfill; j++ ) for ( i = 0; i < nh; i++ ) { red[ i ][ j ] = red[ i ][ nw - 1 - j ] = FL_GETR( fill ); green[ i ][ j ] = green[ i ][ nw - 1 - j ] = FL_GETG( fill ); blue[ i ][ j ] = blue[ i ][ nw - 1 - j ] = FL_GETB( fill ); } for ( i = 0; i < rows; i++ ) { memcpy( red[ i + y ] + x, im->red[ i + yy ] + xx, cols ); memcpy( green[ i + y ] + x, im->green[ i + yy ] + xx, cols ); memcpy( blue[ i + y ] + x, im->blue[ i + yy ] + xx, cols ); } flimage_replace_image( im, nw, nh, red, green, blue ); } im->completed = im->total; im->visual_cue( im, "Done Cropping" ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/ps_draw.c0000644000175000017500000005601012251675202012646 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1997-2002 T.C. Zhao * All rights reserved. * * Some high-level drawing routines */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/pflps.h" #if defined __GNUC__ #define FL_UNUSED_ARG __attribute__ ((unused)) #else #define FL_UNUSED_ARG #endif /* rectangle with rounded corners */ #define RS 16 /* * 0.0, 0.034074, 0.1339746, 0.292893, 0.5, 0.741181, 1.0 */ static float offset[ ] = { 0.0, 0.07612, 0.29289, 0.61732, 1.0 }; #define RN ( sizeof offset / sizeof *offset ) /*************************************** ***************************************/ static int compute_rounded_corners( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_POINT * point ) { FL_POINT *xp; size_t i, n; float rsx, rsy; rsx = rsy = 0.42 * FL_min( w, h ); if ( rsx > RS ) rsx = rsy = RS; for ( xp = point, n = i = 0; i < RN; i++, n++, xp++ ) { xp->x = FL_nint( x + offset[ RN - i - 1 ] * rsx ); xp->y = FL_nint( y + offset[ i ] * rsy ); } for ( i = 0; i < RN; i++, n++, xp++ ) { xp->x = FL_nint( x + offset[ i ] * rsx ); xp->y = FL_nint( y + h - 1.0 - offset[ RN - i - 1 ] * rsy ); } for ( i = 0; i < RN; i++, n++, xp++ ) { xp->x = FL_nint( x + w - 1.0 - offset[ RN - i - 1 ] * rsx ); xp->y = FL_nint( y + h - 1.0 - offset[ i ] * rsy ); } for ( i = 0; i < RN; i++, n++, xp++ ) { xp->x = FL_nint( x + w - 1.0 - offset[ i ] * rsx ); xp->y = FL_nint( y + offset[ RN - i - 1 ] * rsy ); } return n; } #define AddVertex( p, xp, yp ) \ do { \ p->x = xp; \ p->y = yp; \ p++; \ } while ( 0 ) /*************************************** ***************************************/ void flps_roundrectangle( int fill, int x, int y, int w, int h, FL_COLOR col ) { FL_POINT point[ 5 * RN ]; int n; n = compute_rounded_corners( x, y, w, h, point ); flps_poly( fill, point, n, col ); } #define flps_rbox flps_roundrectangle /************ End of basic drawing routines ********}******/ /***************************************************************** * Some high level drawing routines *************************************************************{***/ static void flps_roundedbox( int style, int x, int y, int w, int h, FL_COLOR col, int bw ) { FL_POINT point[ 5 * RN + 2 ]; int n, lw = FL_abs( bw ), lw2 = lw / 2; n = compute_rounded_corners( x + lw2, y + lw2, w - lw, h - lw, point ); flps_poly( 1, point, n, col ); flps_linewidth( lw ); if ( style == FL_ROUNDED3D_UPBOX ) { flps_lines( point, 2 * RN, FL_TOP_BCOL ); flps_lines( point + 2 * RN - 3, RN + 1, FL_TOP_BCOL ); flps_lines( point + 3 * RN - 4, RN + 2, FL_BOTTOM_BCOL ); point[ n ] = point[ 0 ]; flps_lines( point + n - 3, 4, FL_BOTTOM_BCOL ); } else { flps_lines( point, 2 * RN, FL_BOTTOM_BCOL ); flps_lines( point + 2 * RN - 3, RN + 1, FL_BOTTOM_BCOL ); flps_lines( point + 3 * RN - 4, RN + 2, FL_LEFT_BCOL ); point[ n ] = point[ 0 ]; flps_lines( point + n - 3, 4, FL_TOP_BCOL ); } flps_reset_linewidth(); } /*************************************** ***************************************/ static void flps_ovalbox( int style, int x, int y, int w, int h, FL_COLOR col, int bw ) { int lw = FL_abs( bw ), cr = lw / 2; int extra = 1 + ( lw > 3 ); int xx, yy, ww, hh; x += cr; y += cr; w -= 2 * cr; h -= 2 * cr; xx = x + extra; yy = y + extra; ww = w - 2 * extra; hh = h - 2 * extra; flps_pieslice( 1, x, y, w, h, 0, 3600, col ); /* this should be replaced by a loop. Faking it with line thickness looks bad when w != h */ if ( style == FL_OVAL3D_UPBOX ) { flps_linewidth( bw ); flps_pieslice( 0, x, y, w, h, 450, 2250, FL_TOP_BCOL ); flps_pieslice( 0, x, y, w, h, 0, 450, FL_BOTTOM_BCOL ); flps_pieslice( 0, x, y, w, h, 2250, 3600, FL_BOTTOM_BCOL ); } else if ( style == FL_OVAL3D_FRAMEBOX ) { flps_linewidth( 1 ); flps_pieslice( 0, x, y, w, h, 450, 2250, FL_BOTTOM_BCOL ); flps_pieslice( 0, xx, yy, ww, hh, 450, 2250, FL_LEFT_BCOL ); flps_pieslice( 0, xx, yy, ww, hh, 0, 450, FL_BOTTOM_BCOL ); flps_pieslice( 0, x, y, w, h, 0, 450, FL_LEFT_BCOL ); flps_pieslice( 0, xx, yy, ww, hh, 2250, 3600, FL_BOTTOM_BCOL ); flps_pieslice( 0, x, y, w, h, 2250, 3600, FL_LEFT_BCOL ); } else if ( style == FL_OVAL3D_EMBOSSEDBOX ) { flps_linewidth( 1 ); flps_pieslice( 0, x, y, w, h, 450, 2250, FL_LEFT_BCOL ); flps_pieslice( 0, xx, yy, ww, hh, 450, 2250, FL_BOTTOM_BCOL ); flps_pieslice( 0, xx, yy, ww, hh, 0, 450, FL_LEFT_BCOL ); flps_pieslice( 0, x, y, w, h, 0, 450, FL_BOTTOM_BCOL ); flps_pieslice( 0, xx, yy, ww, hh, 2250, 3600, FL_LEFT_BCOL ); flps_pieslice( 0, x, y, w, h, 2250, 3600, FL_BOTTOM_BCOL ); } else { flps_linewidth( bw ); flps_pieslice( 0, x, y, w, h, 450, 2250, FL_BOTTOM_BCOL ); flps_pieslice( 0, x, y, w, h, 0, 450, FL_TOP_BCOL ); flps_pieslice( 0, x, y, w, h, 2250, 3600, FL_TOP_BCOL ); } flps_reset_linewidth( ); } #define vv2( x1, y1, x2, y2 ) \ do { \ AddVertex( xp, x1, y1 ); \ AddVertex( xp, x2, y2 ); \ } while ( 0 ) #define vv3( x1, y1, x2, y2, x3, y3 ) \ do { \ vv2( x1, y1, x2, y2 ); \ AddVertex( xp, x3, y3); \ } while ( 0 ) /*************************************** ***************************************/ static void flps_foldertab_box( int style, int x, int y, int w, int h, FL_COLOR col, int bw ) { float ctr, right, top; FL_POINT vert[ 10 ], *xp; int border = ( bw > 0 ); int i; float absbw = FL_abs( bw ); float C = 4; int savelw = fl_get_linewidth( ); ctr = absbw / 2; x += ctr; y += ctr; w -= 2 * absbw; h -= 2 * absbw; right = x + w - 1; top = y + h - 1; xp = vert; switch ( style ) { case FL_TOPTAB_UPBOX : vv3( x, y, x, top - C, x + C, top ); vv2( x + C, top, right - C, top ); vv3( right - C, top, right, top - C, right, y ); flps_poly( 1, vert, 8, col ); flps_linewidth( absbw ); flps_lines( vert, 3, FL_LEFT_BCOL ); flps_lines( vert + 3, 2, FL_TOP_BCOL ); flps_lines( vert + 5, 3, FL_BOTTOM_BCOL ); flps_reset_linewidth( ); if ( border ) for ( i = 0; i < 8; i++ ) { if ( vert[ i ].x > x + w / 2 ) vert[ i ].x += ctr; else vert[ i ].x -= ctr + 1; if ( vert[ i ].y > y + h / 2 ) vert[ i ].y += ctr; } break; case FL_SELECTED_TOPTAB_UPBOX : vv3( x, y - absbw, x, top - C, x + C, top ); vv2( x + C, top, right - C, top ); vv3( right - C, top, right, top - C, right, y - absbw ); flps_poly( 1, vert, 8, col ); flps_linewidth( absbw ); flps_lines( vert, 3, FL_LEFT_BCOL ); flps_lines( vert + 3, 2, FL_TOP_BCOL ); flps_lines( vert + 5, 3, FL_BOTTOM_BCOL ); break; default: break; } flps_linewidth( savelw ); } #define ShrinkBox( x, y, w, h, d ) \ do { \ x += d; \ y += d; \ w -= 2 * d; \ h -= 2 * d; \ } while ( 0 ) /*************************************** ***************************************/ void flps_draw_tbox( int style, int x, int y, int w, int h, FL_COLOR col, int bw ) { FL_POINT point[ 8 ], *fp; int absbw = FL_abs( bw ); int halfbw = absbw / 2; int xc = x + w / 2, yc = y + h / 2; if ( flps->verbose ) fprintf( flps->fp, "%%TBOX %d: %d %d %d %d\n", style, x, y, w, h ); fp = point; switch ( style ) { case FLI_TRIANGLE_UPBOX8 : AddVertex( fp, xc, y + h - absbw ); AddVertex( fp, x + w - bw, y + absbw ); AddVertex( fp, x + bw, y + bw ); flps_poly( 1, point, 3, col ); flps_linewidth( absbw ); ShrinkBox( x, y, w, h, halfbw ); flps_line( x, y, xc, y + h - 1, FL_LEFT_BCOL ); flps_line( xc, y + h - 1, x + w - 1, y, FL_RIGHT_BCOL ); flps_line( x + w - 1, y, x, y, FL_BOTTOM_BCOL ); flps_reset_linewidth( ); break; case FLI_TRIANGLE_UPBOX2 : AddVertex( fp, xc, y + absbw ); AddVertex( fp, xc, y + h - absbw ); AddVertex( fp, x + w - absbw, y + h - absbw ); flps_poly( 1, point, 3, col ); flps_linewidth( absbw ); ShrinkBox( x, y, w, h, halfbw ); flps_line( xc, y, x, y + h - 1, FL_LEFT_BCOL ); flps_line( x, y + h - 1, x + w - 1, y + h - 1, FL_TOP_BCOL ); flps_line( x + w - 1, y + h - 1, xc, y, FL_RIGHT_BCOL ); flps_reset_linewidth( ); break; case FLI_TRIANGLE_UPBOX6 : AddVertex( fp, x + bw, y + h - bw ); AddVertex( fp, x + w - bw, yc ); AddVertex( fp, x + bw, y + bw ); flps_poly( 1, point, 3, col ); flps_linewidth( absbw ); ShrinkBox( x, y, w, h, halfbw ); flps_line( x, y + h - 1, x + w - 1, yc, FL_RIGHT_BCOL ); flps_line( x + w - 1, yc, x, y, FL_BOTTOM_BCOL ); flps_line( x, y, x, y + h - 1, FL_LEFT_BCOL ); flps_reset_linewidth( ); break; case FLI_TRIANGLE_UPBOX4 : AddVertex( fp, x + bw, yc ); AddVertex( fp, x + w - bw, y + h - bw ); AddVertex( fp, x + w - bw, y ); flps_poly( 1, point, 3, col ); flps_linewidth( absbw ); ShrinkBox( x, y, w, h, halfbw ); flps_line( x, yc, x + w - 1, y + h - 1, FL_TOP_BCOL ); flps_line( x + w - 1, y + h - 1, x + w - 1, y, FL_RIGHT_BCOL ); flps_line( x + w - 1, y, x, yc, FL_BOTTOM_BCOL ); flps_reset_linewidth( ); break; } } /*************************************** ***************************************/ void flps_draw_box( int style, int x, int y, int w, int h, FL_COLOR col, int bw_in ) { int border, B; FL_POINT xpoint[ 8 ], *xp; int bw = bw_in; if ( ! ( border = ( bw > 0 ) ) ) bw = -bw; B = border; xp = xpoint; if ( flps->verbose ) fprintf( flps->fp, "%%BOX %d: %d %d %d %d\n", style, x, y, w, h ); switch ( style ) { case FL_NO_BOX : break; case FL_UP_BOX : flps_rectf( x + bw, y + bw, w - 2 * bw, h - 2 * bw, col ); flps_rectf( x + B, y, w - 2 * B, bw + 1, FL_BOTTOM_BCOL ); flps_rectf( x + B, y + h - 1 - bw, w - 2 * B, bw + 1, FL_TOP_BCOL ); /* left */ AddVertex( xp, x + B, y + B ); AddVertex( xp, x + B, y + h - 1 - B ); AddVertex( xp, x + bw + B, y + h - 1 - bw - B ); AddVertex( xp, x + bw + B, y + bw + B ); flps_poly( 1, xpoint, 4, FL_LEFT_BCOL ); xp = xpoint; AddVertex( xp, x + w - 1, y ); AddVertex( xp, x + w - 1, y + h - 1 ); AddVertex( xp, x + w - 1 - bw, y + h - 1 - bw ); AddVertex( xp, x + w - 1 - bw, y + bw ); flps_poly( 1, xpoint, 4, FL_RIGHT_BCOL ); if ( border ) flps_rect( x, y, w, h, FL_BLACK ); break; case FL_DOWN_BOX : flps_rectf( x, y, w, h, col ); flps_rectf( x, y + h - bw, w, bw, FL_BOTTOM_BCOL ); flps_rectf( x, y, w, bw, FL_TOP_BCOL ); AddVertex( xp, x, y ); AddVertex( xp, x, y + h - 1 ); AddVertex( xp, x + bw - 1, y + h - bw ); AddVertex( xp, x + bw - 1, y + bw - 1 ); flps_poly( 1, xpoint, 4, FL_RIGHT_BCOL ); /* right */ xp = xpoint; AddVertex( xp, x + w - 1, y ); AddVertex( xp, x + w - 1, y + h - 1 ); AddVertex( xp, x + w - bw, y + h - bw ); AddVertex( xp, x + w - bw, y + bw - 1 ); flps_poly( 1, xpoint, 4, FL_LEFT_BCOL ); break; case FL_FRAME_BOX : flps_rectf( x, y, w, h, col ); flps_linewidth( 1 ); flps_rect( x + 1.4, y, w - 1.4, h - 1.4, FL_TOP_BCOL ); flps_reset_linewidth( ); flps_rect( x, y + 1.4, w - 1.4, h - 1.4, FL_BOTTOM_BCOL ); break; case FL_EMBOSSED_BOX : flps_rectf( x, y, w, h, col ); flps_linewidth( 1 ); flps_rect( x + 1.4, y, w - 1.4, h - 1.4, FL_BOTTOM_BCOL ); flps_reset_linewidth( ); flps_rect( x, y + 1.4, w - 1.4, h - 1.4, FL_TOP_BCOL ); break; case FL_FLAT_BOX : flps_rectf( x, y, w, h, col ); break; case FL_SHADOW_BOX : if ( w > 100 && h > 100 ) bw++; flps_rectf( x + bw, y + bw, w - bw, -bw, FL_BOTTOM_BCOL ); flps_rectf( x + w - 1, y, -bw, h - bw - 1, FL_BOTTOM_BCOL ); flps_rectf( x, y + bw, w - bw, h - bw, col ); flps_rect( x, y + bw, w - bw, h - bw, FL_BLACK ); break; case FL_BORDER_BOX : flps_rectf( x, y, w, h, col ); flps_rect( x, y, w, h, FL_BLACK ); break; case FL_RFLAT_BOX : flps_rbox( 1, x, y, w, h, col ); break; case FL_ROUNDED_BOX : flps_rbox( 1, x, y, w, h, col ); flps_rbox( 0, x, y, w, h, FL_BLACK ); break; case FL_ROUNDED3D_UPBOX : case FL_ROUNDED3D_DOWNBOX : flps_roundedbox( style, x, y, w, h, col, bw ); break; case FL_RSHADOW_BOX : flps_rbox( 1, x + bw, y - 1, w - bw + 1, h - bw, FL_BOTTOM_BCOL ); flps_rbox( 1, x, y + bw - 1, w - bw + 1, h - bw + 1, col ); flps_rbox( 0, x, y + bw - 1, w - bw + 1, h - bw + 1, FL_BLACK ); break; case FL_OVAL_BOX : flps_oval( 1, x, y, w, h, col ); flps_oval( 0, x, y, w, h, FL_BLACK ); break; case FL_OVAL3D_UPBOX : case FL_OVAL3D_DOWNBOX : case FL_OVAL3D_FRAMEBOX : case FL_OVAL3D_EMBOSSEDBOX : flps_ovalbox( style, x, y, w, h, col, bw ); break; case FL_TOPTAB_UPBOX : case FL_SELECTED_TOPTAB_UPBOX : case FL_BOTTOMTAB_UPBOX : case FL_SELECTED_BOTTOMTAB_UPBOX : flps_foldertab_box( style, x, y, w, h, col, bw_in ); break; default: fprintf( stderr, "Unknown Boxtype %d\n", style ); break; } } /*************************************** * Frame is drawn OUTSIDE of the bounding box ***************************************/ void flps_draw_frame( int style, int x, int y, int w, int h, FL_COLOR col FL_UNUSED_ARG, int bw ) { int border; int B; FL_POINT xpoint[ 10], *xp; if ( ! ( border = ( bw > 0 ) ) ) bw = -bw; B = border; if ( flps->verbose ) fprintf( flps->fp, "%%frame (%d %d %d %d)\n", x, y, w, h ); switch ( style ) { case FL_UP_FRAME: flps_rectf( x - bw - B, y + h - 1, w + 2 * bw, bw + 1 + B, FL_TOP_BCOL ); flps_rectf( x - bw - B, y - bw - B, w + 2 * bw, bw + 1 + B, FL_BOTTOM_BCOL ); /* left */ xp = xpoint; AddVertex( xp, x - bw - B, y - bw - B ); AddVertex( xp, x, y ); AddVertex( xp, x, y + h - 1 ); AddVertex( xp, x - bw - B, y + h + bw + B - 1 ); flps_poly( 1, xpoint, 4, FL_LEFT_BCOL ); /* right */ xp = xpoint; AddVertex( xp, x + w - 1 + bw + B, y - bw - B ); AddVertex( xp, x + w - 1 + bw + B, y + h + bw + B - 1 ); AddVertex( xp, x + w - 1, y + h - 1 ); AddVertex( xp, x + w - 1, y ); flps_poly( 1, xpoint, 4, FL_RIGHT_BCOL ); break; case FL_DOWN_FRAME : flps_rectf( x - bw - B, y + h - 1, w + 2 * bw, bw + 1 + B, FL_BOTTOM_BCOL ); flps_rectf( x - bw - B, y - bw - B, w + 2 * bw, bw + 1 + B, FL_TOP_BCOL ); /* left */ xp = xpoint; AddVertex( xp, x - bw - B, y - bw - B ); AddVertex( xp, x, y ); AddVertex( xp, x, y + h - 1 ); AddVertex( xp, x - bw - B, y + h + bw + B - 1 ); flps_poly( 1, xpoint, 4, FL_RIGHT_BCOL ); /* right */ xp = xpoint; AddVertex( xp, x + w - 1 + bw + B, y - bw - B ); AddVertex( xp, x + w - 1 + bw + B, y + h + bw + B - 1 ); AddVertex( xp, x + w - 1, y + h - 1 ); AddVertex( xp, x + w - 1, y ); flps_poly( 1, xpoint, 4, FL_LEFT_BCOL ); break; case FL_ENGRAVED_FRAME : B = bw > 2 ? ( bw - 2 ) : 1; B *= 0.5; flps_draw_frame( FL_DOWN_FRAME, x, y, w, h, 0, 1 ); flps_draw_frame( FL_UP_FRAME, x + B, y + B, w - 2 * B, h - 2 * B, 0, -1 ); break; } } /*************************************** ***************************************/ void flps_draw_checkbox( int type, int x, int y, int w, int h, FL_COLOR col, int bw ) { FL_POINT xpoint[ 6 ], *xp; FL_POINT allp[ 10 ]; /* generate all points */ xp = allp; AddVertex( xp, x + w / 2, y ); AddVertex( xp, x, y + h / 2 ); AddVertex( xp, x + w / 2, y + h ); AddVertex( xp, x + w, y + h / 2 ); AddVertex( xp, x + w / 2, y + bw ); AddVertex( xp, x + bw, y + h / 2 ); AddVertex( xp, x + w / 2, y + h - bw ); AddVertex( xp, x + w - bw, y + h / 2 ); /* draw overall box */ xp = allp + 4; flps_poly( 1, xp, 4, col ); xp = xpoint; switch ( type ) { case FL_DOWN_BOX : AddVertex( xp, allp[ 0 ].x, allp[ 0 ].y ); AddVertex( xp, allp[ 1 ].x, allp[ 1 ].y ); AddVertex( xp, allp[ 5 ].x, allp[ 5 ].y ); AddVertex( xp, allp[ 4 ].x, allp[ 4 ].y ); flps_poly( 1, xp = xpoint, 4, FL_LEFT_BCOL ); AddVertex( xp, allp[ 0 ].x, allp[ 0 ].y ); AddVertex( xp, allp[ 4 ].x, allp[ 4 ].y ); AddVertex( xp, allp[ 7 ].x, allp[ 7 ].y ); AddVertex( xp, allp[ 3 ].x, allp[ 3 ].y ); flps_poly( 1, xp = xpoint, 4, FL_TOP_BCOL ); /* right bottom */ AddVertex( xp, allp[ 6 ].x, allp[ 6 ].y ); AddVertex( xp, allp[ 2 ].x, allp[ 2 ].y ); AddVertex( xp, allp[ 3 ].x, allp[ 3 ].y ); AddVertex( xp, allp[ 7 ].x, allp[ 7 ].y ); flps_poly( 1, xp = xpoint, 4, FL_RIGHT_BCOL ); AddVertex( xp, allp[ 1 ].x, allp[ 1 ].y ); AddVertex( xp, allp[ 2 ].x, allp[ 2 ].y ); AddVertex( xp, allp[ 6 ].x, allp[ 6 ].y ); AddVertex( xp, allp[ 5 ].x, allp[ 5 ].y ); flps_poly( 1, xp = xpoint, 4, FL_BOTTOM_BCOL ); break; case FL_UP_BOX : AddVertex( xp, allp[ 0 ].x, allp[ 0 ].y ); AddVertex( xp, allp[ 1 ].x, allp[ 1 ].y ); AddVertex( xp, allp[ 5 ].x, allp[ 5 ].y ); AddVertex( xp, allp[ 4 ].x, allp[ 4 ].y ); flps_poly( 1, xp = xpoint, 4, FL_BOTTOM_BCOL ); AddVertex( xp, allp[ 0 ].x, allp[ 0 ].y ); AddVertex( xp, allp[ 4 ].x, allp[ 4 ].y ); AddVertex( xp, allp[ 7 ].x, allp[ 7 ].y ); AddVertex( xp, allp[ 3 ].x, allp[ 3 ].y ); flps_poly( 1, xp = xpoint, 4, FL_RIGHT_BCOL ); /* right bottom */ AddVertex( xp, allp[ 6 ].x, allp[ 6 ].y ); AddVertex( xp, allp[ 2 ].x, allp[ 2 ].y ); AddVertex( xp, allp[ 3 ].x, allp[ 3 ].y ); AddVertex( xp, allp[ 7 ].x, allp[ 7 ].y ); flps_poly( 1, xp = xpoint, 4, FL_LEFT_BCOL ); AddVertex( xp, allp[ 1 ].x, allp[ 1 ].y ); AddVertex( xp, allp[ 2 ].x, allp[ 2 ].y ); AddVertex( xp, allp[ 6 ].x, allp[ 6 ].y ); AddVertex( xp, allp[ 5 ].x, allp[ 5 ].y ); flps_poly( 1, xp = xpoint, 4, FL_TOP_BCOL ); break; } if ( flps->verbose ) fprintf( flps->fp, "%%BOX }\n" ); } /******* End of high-level drawing routines **********}******/ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_fits.c0000644000175000017500000005461312251675322013330 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1993, 1998-2002 T.C. Zhao * All rights reserved. * * NASA/OST Flexble Image Transport Sysmtem suport. * Basic FITS (principle HUD) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" #include "ulib.h" #include #include #define FITS_DEBUG 0 /* number of bits of gray image to generate for float/double FITS */ static unsigned int fits_bit = 12; /*************************************** ***************************************/ int flimage_set_fits_bits( int bits ) { int old = fits_bit; if ( bits > 0 && bits < 16 ) { fits_bit = bits; return old; } return - old; } static int dogray = 1; /* how to do fits */ static float nan_replace = 0.0; /* what to do about NaNs */ static float blank_replace = 0.0; /* what to do about NaNs */ static int little_endian = -1; #define RECORD_LEN 2880 typedef double FLOAT64; typedef float FLOAT32; typedef union { FLOAT32 val; unsigned char uc[ 4 ]; } FLOAT_UNION; #define ISNAN( n, p ) ( ( p = n ), ( p != n ) ) /*************************************** ***************************************/ static int FITS_identify( FILE * fp ) { char buf[ 6 ]; size_t c; c = fread( buf, 1, 6, fp ); rewind( fp ); return c == 6 && ! strncmp( buf, "SIMPLE", 6 ); } #define MAXDIM 4 #define MAXLEN 73 typedef struct { double bzero; /* convert from data to physical */ double bscale; /* convert from data to physical */ double dmin; /* mininum physical quantity */ double dmax; /* maximum physical quantity */ double offset; /* scale data directly to pixel */ double scale; /* scale data directly to pixel */ double cdelta[ MAXDIM ]; int simple; /* only deal simple (basic) fits */ int xtension; /* if have extension */ int bpp; /* pixel size/array data size */ int ndim; /* number of dimensions in array */ int gcount; int pcount; int blank; int has_blank; int nframe; int dim[ MAXDIM ]; /* dimensions */ char label[ MAXDIM ][ MAXLEN ]; /* name of each dimension */ char bunit[ MAXLEN ]; /* unit name of the quantities */ char xtname[ MAXLEN ]; /* if and what extension */ } SPEC; #define bad_hdu( h ) ( ! h->simple || ( h->ndim == 0 && ! h->xtname[ 0 ] ) ) #define Bad_bpp( p ) ( p != 8 && p != 16 && abs( p ) != 32 && p != - 64 ) #define bad_dim( h ) ( h->ndim < 0 \ || ( h->ndim>MAXDIM && h->dim[ MAXDIM - 1 ] != 1 ) ) /*************************************** ***************************************/ static void detect_endian( void ) { FLOAT_UNION U; U.val = 1.0; little_endian = ( U.uc[ 3 ] == 0x3f ); } /*************************************** ***************************************/ static void init_fits( SPEC * sp ) { if ( little_endian < 0 ) detect_endian( ); sp->bpp = sp->ndim = -1; sp->bscale = 1.0; sp->gcount = sp->pcount = 1; sp->nframe = 1; } /*************************************** ***************************************/ static char ** FITS_header_info( const void * p ) { const SPEC *h = p; static char hbuf[ 15 ][ 80 ]; static char *buf[ 15 ]; int i, j; for ( i = 0; i < 15; i++ ) buf[ i ] = hbuf[ i ]; i = 0; sprintf( buf[ i++ ], "SIMPLE\t= %c", h->simple == 1 ? 'Y' : 'N' ); sprintf( buf[ i++ ], "NAXIS\t= %d", h->ndim); for ( j = 0; j < h->ndim; j++ ) sprintf( buf[ i++ ], " NAXIS%d=%d\t%s", j + 1, h->dim[ j ], h->label[j] ? h->label[ j ] : "" ); sprintf( buf[ i++ ], "PSIZE\t= %d", h->bpp ); sprintf( buf[ i++ ], "BSCALE\t= %g", h->bscale ); sprintf( buf[ i++ ], "BZERO\t= %g", h->bzero ); sprintf( buf[ i++ ], "DMIN\t= %g", h->dmin ); sprintf( buf[ i++ ], "DMAX\t= %g", h->dmax ); sprintf( buf[ i++ ], "BUNIT\t=%s", h->bunit ); sprintf( buf[ i++ ], "BLANK\t=%d", h->blank ); buf[ i ] = 0; return buf; } /*************************************** ***************************************/ static void generate_fits_header_info( FL_IMAGE * im ) { SPEC *h = im->io_spec; char **q; if ( ! ( im->info = fl_malloc( 1024 ) ) ) return; for ( im->info[ 0 ] = '\0', q = FITS_header_info( h ); *q; q++ ) strcat( strcat( im->info, *q ),"\n" ); } #if FITS_DEBUG static int verbose = 4; /*************************************** ***************************************/ static void echo_FITS_header( SPEC * h ) { char **q; if ( verbose <= ML_INFO1 ) return; for ( q = FITS_header_info( h ); *q; q++ ) fprintf( stderr, "%s\n", *q ); } #endif static int parse_fits_header( FILE *, SPEC *, FL_IMAGE * ); #define LBSIZE 12 #define LBFONT 0 /* default courier */ #define LBCOL 0 /* black */ static int FITS_next( FL_IMAGE * ); /*************************************** ***************************************/ static int FITS_description( FL_IMAGE * im ) { SPEC *sp = fl_calloc( 1, sizeof *sp ); init_fits( sp ); im->io_spec = sp; im->spec_size = sizeof *sp; if ( parse_fits_header( im->fpin, sp, im ) < 0 ) return -1; if ( feof( im->fpin ) ) return -1; /* sanity check */ if ( ! sp->simple || bad_dim( sp ) ) { flimage_error( im, "FITS: %s unsupported type--%sSIMPLE, NAXIS=%d", im->infile, sp->simple ? "" : "Not ", sp->ndim ); return -1; } if ( Bad_bpp( sp->bpp ) ) { flimage_error( im, "FITS:%s unsupported pixelsize %d", im->infile, sp->bpp ); return -1; } if ( sp->ndim == 0 ) { flimage_error( im, "FITS: unsupported %s", sp->xtname[ 0 ] ? sp->xtname : "null image" ); return -1; } /* now we have something to work with */ im->w = sp->dim[ 0 ]; im->h = sp->dim[ 1 ] ? sp->dim[ 1 ] : 1; /* handle 1-dim data */ if ( dogray ) { if ( FL_abs( sp->bpp ) > 8 ) { im->type = FL_IMAGE_GRAY16; im->gray_maxval = ( 1 << fits_bit ) - 1; } else { im->type = FL_IMAGE_GRAY; im->gray_maxval = ( 1 << 8 ) - 1; } } else { int i; /* fake a graymap */ im->type = FL_IMAGE_CI; im->map_len = 256; flimage_getcolormap( im ); for ( i = 0; i < 256; i++ ) im->red_lut[ i ] = im->green_lut[ i ] = im->blue_lut[ i ] = i; } im->more = sp->ndim > 2 && sp->dim[ 2 ] > 1; im->next_frame = FITS_next; /* label the axis if available */ if ( sp->label[ 0 ][ 0 ] ) { flimage_add_text( im, sp->label[ 0 ], strlen( sp->label[ 0 ] ), LBFONT, LBSIZE, FL_PACK(FL_PCMAX, FL_PCMAX, 0), FL_PACK(0, FL_PCMAX, FL_PCMAX), 1, im->w / 3, im->h + LBSIZE, 0); #if 0 img_add_mark( im, "Arrow", 5, -5, 54, 85, 2, 0, 0 ); #endif } if ( sp->label[ 1 ][ 0 ] ) { flimage_add_text( im, sp->label[ 1 ], strlen( sp->label[ 1 ] ), LBFONT, LBSIZE, FL_PACK(FL_PCMAX, FL_PCMAX, 0), FL_PACK(0, FL_PCMAX, FL_PCMAX), 1, im->w + 4, im->h / 2, 90 ); #if 0 img_add_mark( im, "Arrow", -5, 5, 54, 85, 2, 900, 0 ); #endif } return 0; } /******************************************************************** * Read fits header for keyword and value pairs. more lenient than * the standard demands ********************************************************************/ static char *comments[ ] = { "AUTHOR", "COMMENTS", "OBJECT", "DATE", "DATE_OBS", "INSTRUME", "TELESCOP", "ORIGIN", NULL }; /*************************************** ***************************************/ static int is_comments( const char * key ) { char **q = comments; while ( *q ) if ( strcmp( key, *q++ ) == 0 ) return 1; return 0; } /*************************************** ***************************************/ static int parse_fits_header( FILE * fp, SPEC * h, FL_IMAGE * im ) { char buf[ 90 ], key[ 90 ], val[ 90 ]; int done, i; doextension: done = 0; do { key[ 0 ] = buf[ 0 ] = val[ 0 ] = '\0'; /* each rec is 80 characters long */ if ( ! fgets( buf, 81, fp ) ) buf[ 0 ] = '\0'; buf[ 79 ] = '\n'; buf[ 80 ] = '\0'; sscanf( buf, "%[A-Z0-9]%*[ =]%s", key, val ); fli_space_de( val ); if ( key[ 0 ] ) flimage_add_comments( im, buf, 80 ); #if FITS_DEBUG M_err( "FITS", "key=%s_\t\t val=%s_", key, val ); #endif if ( strcmp( key, "SIMPLE" ) == 0 ) h->simple = val[ 0 ] == 'T'; else if ( strcmp(key, "BITPIX" ) == 0 ) h->bpp = atoi( val ); else if ( strcmp( key, "NAXIS" ) == 0 ) h->ndim = atoi( val ); else if ( strcmp( key, "BUNIT" ) == 0 ) strcpy( h->bunit, val ); else if ( strcmp( key, "BSCALE" ) == 0 ) h->bscale = atof( val ); else if ( strcmp( key, "BZERO" ) == 0 ) h->bzero = atof( val ); else if ( strcmp( key, "DATAMIN" ) == 0 ) h->dmin = atof( val ); else if ( strcmp( key, "DATAMAX" ) == 0 ) h->dmax = atof( val ); else if ( strcmp( key, "PCOUNT" ) == 0 ) h->pcount = atoi( val ); else if ( strcmp( key, "GCOUNT" ) == 0 ) h->gcount = atoi( val ); else if ( strcmp( key, "BLANK" ) == 0 ) { h->blank = atoi( val ); h->has_blank = 1; } else if ( strcmp(key, "XTENSION" ) == 0 ) strcpy( h->xtname, val ); else if (strcmp( key, "EXTEND" ) == 0 ) h->xtension = val[ 0 ] == 'T'; else if ( strncmp( buf, "END ", 4 ) == 0 ) done = 1; else if ( is_comments( key ) ) flimage_add_comments( im, buf, 80 ); for ( i = 1; i <= MAXDIM; i++ ) { sprintf( buf, "NAXIS%d", i ); if ( strcmp(buf, key ) == 0 ) h->dim[ i - 1 ] = atoi( val ); sprintf( buf, "CTYPE%d", i ); if ( strcmp( buf, key ) == 0 ) strcpy( h->label[ i - 1 ], fli_space_de( val ) ); sprintf( buf, "TTYPE%d", i ); if ( strcmp( buf, key ) == 0 ) strcpy( h->label[ i - 1 ], fli_space_de( val ) ); sprintf( buf, "CDELT%d", i ); if (strcmp( buf, key ) == 0 ) h->cdelta[ i - 1 ] = atoi( val ); } } while ( ! feof( fp ) && ! done ); /* skip padding */ while ( ( i = getc( fp ) ) == ' ' || i == '\n' ) /* empty */ ; if ( i != EOF ) ungetc( i, fp ); /* if empty data array && extension, try to do the extension */ if ( ! feof( fp ) && h->ndim == 0 && h->xtension && ! h->xtname[ 0 ] ) goto doextension; /* keep trying, until we get an extension we can handle */ if ( ! feof( fp ) && h->xtname[ 0 ] && ! strcmp( h->xtname, "'IMAGE") == 0 ) { long curpos = ftell( fp ); int total; for ( total = 1, i = 0; i < h->ndim; i++ ) total *= h->dim[ i ]; total = ( total * h->bpp ) / 8; /* round */ total = ( ( total + RECORD_LEN - 1 ) / RECORD_LEN ) * RECORD_LEN; fseek( fp, curpos + total, SEEK_SET ); goto doextension; } if ( strcmp( h->xtname, "'IMAGE" ) == 0 ) { im->visual_cue( im, "Found IMAGE extension" ); flimage_add_comments( im, "IMAGE EXTENSION", 16 ); } #if FITS_DEBUG echo_FITS_header( h ); #endif if( im->setup->header_info ) generate_fits_header_info( im ); return 0; } #define SWAP4( i, o ) do { \ o[ 0 ] = i[ 3 ]; \ o[ 1 ] = i[ 2 ]; \ o[ 2 ] = i[ 1 ]; \ o[ 3 ] = i[ 0 ]; \ } while( 0 ) #define SWAP8( i, o ) do { \ o[ 0 ] = i[ 7 ]; \ o[ 1 ] = i[ 6 ]; \ o[ 2 ] = i[ 5 ]; \ o[ 3 ] = i[ 4 ]; \ o[ 4 ] = i[ 3 ]; \ o[ 5 ] = i[ 2 ]; \ o[ 6 ] = i[ 1 ]; \ o[ 7 ] = i[ 0 ]; \ } while ( 0 ) /*************************************** * Assuming IEEE-745 floating point native ***************************************/ static int FITS_load( FL_IMAGE * im ) { unsigned short *ci = FL_IsGray( im->type ) ? im->gray[ 0 ] : im->ci[ 0 ]; SPEC *sp = im->io_spec; FLOAT64 offset, scale, dmin, dmax, *dval, tmp64; FILE *fp = im->fpin; int i, j, n, k, byte_per_pix, has_minmax, *ival, err; unsigned char *c, uc[ 8 ]; short *sval; FLOAT32 *fval, tmp32; void **vals; dmin = 1.0e30; dmax = -1.0e30; has_minmax = sp->dmax != sp->dmin; #if FITS_DEBUG M_err( "fits_load", "sp->dmax=%g sp->dmin=%g", sp->dmax, sp->dmin ); #endif /* read the data */ byte_per_pix = FL_abs( sp->bpp ) / 8; if ( ! ( vals = fl_get_matrix( im->h, im->w, byte_per_pix ) ) ) { im->error_message( im, "Can't get memory for FITS" ); return -1; } for ( err = 0, i = im->h - 1; !err && i >= 0; i--, im->completed++ ) { if ( ! ( im->completed & FLIMAGE_REPFREQ ) ) im->visual_cue( im, "Reading FITS" ); k = im->h - 1 - i; if ( ( err = ( fread( c = vals[ k ], byte_per_pix, im->w, fp ) != ( size_t ) im->w ) ) ) im->error_message( im, "Error reading FITS" ); /* now do data conversion to MSBF order */ switch ( sp->bpp ) { case 32 : for ( ival = vals[k], j = 0; j < im->w; j++, c += 4 ) { ival[ j ] = ( c[ 0 ] << 24 ) | ( c[ 1 ] << 16 ) | ( c[ 2 ] << 8 ) | c[ 3 ]; if ( sp->has_blank && ival[ j ] == sp->blank ) ival[ j ] = blank_replace; } if ( ! has_minmax ) { for ( j = 0; j < im->w; j++ ) if ( ival[ j ] < dmin ) dmin = ival[ j ]; else if ( ival[ j ] > dmax ) dmax = ival[ j ]; } break; case 16 : for ( sval = vals[ k ], j = 0; j < im->w; j++, c += 2 ) { sval[ j ] = ( c[ 0 ] << 8 ) | c[ 1 ]; if ( sp->has_blank && sval[ j ] == sp->blank ) sval[ j ] = blank_replace; } if ( ! has_minmax ) { for ( j = 0; j < im->w; j++ ) if ( sval[ j ] < dmin ) dmin = sval[ j ]; else if ( sval[ j ] > dmax ) dmax = sval[ j ]; } break; case 8 : if ( ! has_minmax ) { for ( j = 0; j < im->w; j++ ) if ( c[ j ] < dmin ) dmin = c[ j ]; else if ( c[ j ] > dmax ) dmax = c[ j ]; } break; case -32 : for ( fval = vals[ k ], j = 0; j < im->w; j++, c += 4 ) { if ( little_endian ) { /* Using fval[ j ] = * ( FLOAT32 * ) uc; results in type-punning warning, so instead: */ memcpy( fval + j, uc, 4 ); } if ( ISNAN( fval[ j ], tmp32 ) ) fval[ j ] = nan_replace; } if ( ! has_minmax ) { for ( j = 0; j < im->w; j++ ) if ( fval[ j ] < dmin ) dmin = fval[ j ]; else if ( fval[ j ] > dmax ) dmax = fval[ j ]; } break; case -64 : for ( dval = vals[ k ], j = 0; j < im->w; j++, c += 8 ) { if ( little_endian ) { SWAP8( c, uc ); /* Using dval[ j ] = * ( FLOAT64 * ) uc; results in type-punning warning, so instead: */ memcpy( dval + j, uc, 8 ); } if ( ISNAN( dval[ j ], tmp64 ) ) dval[ j ] = nan_replace; } if ( ! has_minmax ) { for ( j = 0; j < im->w; j++ ) if ( dval[ j ] < dmin ) dmin = dval[ j ]; else if ( dval[ j ] > dmax ) dmax = dval[ j ]; } break; } } if ( ! has_minmax ) { sp->dmin = sp->bzero + dmin * sp->bscale; sp->dmax = sp->bzero + dmax * sp->bscale; } /* now the overall offset and scale for physical data */ scale = im->gray_maxval / ( sp->dmax - sp->dmin ); offset = -sp->dmin * scale; /* figure in the raw to physcal transform */ offset = offset + sp->bzero * scale; scale = sp->bscale * scale; /* reverse transform */ im->poffset = -offset / scale; im->pscale = 1.0 / scale; im->pmin = sp->dmin; im->pmax = sp->dmax; im->xdist_scale = sp->cdelta[ 0 ]; im->ydist_scale = sp->cdelta[ 1 ]; /* remap data into pixels */ if ( sp->bpp == 8 ) for ( c = vals[ 0 ], n = im->w * im->h; --n > 0; ) ci[ n ] = offset + c[ n ] * scale; else if ( sp->bpp == 16 ) for ( sval = vals[ 0 ], n = im->w * im->h; --n > 0; ) ci[ n ] = offset + sval[ n ] * scale; else if ( sp->bpp == 32 ) for ( ival = vals[ 0 ], n = im->w * im->h; --n > 0; ) ci[ n ] = offset + ival[ n ] * scale; else if ( sp->bpp == -32 ) for ( fval = vals[ 0 ], n = im->w * im->h; --n > 0; ) ci[ n ] = offset + fval[ n ] * scale; else if ( sp->bpp == -64 ) for ( dval = vals[ 0 ], n = im->w * im->h; --n > 0; ) ci[ n ] = offset + dval[ n ] * scale; fl_free_matrix( vals ); return im->completed >= im->h / 2 ? 1 : -1; } /*************************************** ***************************************/ static void dump_space( FILE * fp, int n ) { while ( --n >= 0 ) putc( ' ', fp ); } /*************************************** ***************************************/ static int FITS_dump( FL_IMAGE * im ) { FILE *fp = im->fpout; unsigned short *ras; int n = 0, bits; bits = im->type == FL_IMAGE_GRAY ? 8 : 16; ras = im->gray[ 0 ]; /* write a brief header */ dump_space( fp, 80 - fprintf( fp, "SIMPLE = T " ) ); dump_space( fp, 80 - fprintf( fp, "BITPIX = %d ", bits ) ); dump_space( fp, 80 - fprintf( fp, "NAXIS = 2" ) ); dump_space( fp, 80 - fprintf( fp, "NAXIS1 = %d", im->w ) ); dump_space( fp, 80 - fprintf( fp, "NAXIS2 = %d", im->h ) ); dump_space( fp, 80 - fprintf( fp, "END ")); dump_space( fp, RECORD_LEN - 80 * 6 ); if ( bits == 8 ) for ( n = im->w * im->h; --n >= 0; ras++ ) putc( *ras & 0xff, fp ); else for ( n = im->w * im->h; --n >= 0; ras++ ) fli_fput2MSBF( *ras, fp ); return fflush( fp ); } /*************************************** ***************************************/ static int FITS_next( FL_IMAGE * im ) { int status; SPEC *sp = im->io_spec; sp->nframe++; #if FITS_DEBUG M_err( "FITS_next", "loading %d ", sp->nframe ); #endif status = FITS_load( im ); im->more = status >= 0 && ! ( feof( im->fpin ) || ferror( im->fpin ) ); im->more = im->more && sp->nframe < sp->dim[ 2 ]; return status; } /*************************************** ***************************************/ void flimage_enable_fits( void ) { flimage_add_format( "NASA/NOST FITS", "fits", "fits", FL_IMAGE_GRAY | FL_IMAGE_GRAY16, FITS_identify, FITS_description, FITS_load, FITS_dump ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_type.c0000644000175000017500000004645512251675231013350 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1998-2002 By T.C. Zhao * All rights reserved. * * image type conversions */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" /*************************************** * Specialized for image processing ***************************************/ static int spline_int_interpolate( const int * wx, const int * wy, int nin, int grid, int * y ) { int i, j, k, jo, ih, im, nout; double sig, p, h, a, b, x; static int nwork = 0; static double *y2 = NULL, *u = NULL; if ( nin <= 3 ) { M_warn( "fl_spline_int_interpolate", "too few points (less than 4) for interpolation" ); return -1; } if ( nwork < nin ) { y2 = fl_realloc( y2, nin * sizeof *y2 ); u = fl_realloc( u, nin * sizeof *u ); nwork = nin; } y2[ 0 ] = u[ 0 ] = 0.0; for ( i = 1; i < nin - 1; i++ ) { sig = ( double ) ( wx[ i ] - wx[ i - 1 ] ) / ( wx[ i + 1 ] - wx[ i - 1 ] ); p = sig * y2[ i - 1 ] + 2.0; y2[ i ] = ( sig - 1.0 ) / p; u[ i ] = ( double ) ( wy[ i + 1 ] - wy[ i ] ) / ( wx[ i + 1 ] - wx[ i ] ) - ( double ) ( wy[ i ] - wy[ i - 1 ] ) / ( wx[ i ] - wx[ i - 1 ] ); u[ i ] = ( 6.0 * u[ i ] / ( wx[ i + 1 ] - wx[ i - 1 ] ) - sig * u[ i - 1 ] ) / p; } y2[ nin - 1 ] = 0.0; for ( k = nin - 2; k >= 0; k-- ) y2[ k ] = y2[ k ] * y2[ k + 1 ] + u[ k ]; /* Outputs */ nout = ( int ) ( ( wx[ nin - 1 ] - wx[ 0 ] ) / grid + 1.01 ); y[ 0 ] = wy[ 0 ]; /* Start the main loop */ for ( jo = 0, i = 1; i < nout; i++ ) { x = wx[ 0 ] + i * grid; /* Center */ j = jo; ih = nin - 1; while ( ih - j > 1 ) { im = ( ih + j ) / 2; if ( x > wx[ im ] ) j = im; else ih = im; } jo = j; /* Interpolate */ h = wx[ ih ] - wx[ j ]; a = ( wx[ ih ] - x ) / h; b = ( x - wx[ j ] ) / h; y[i] = ( a * wy[ j ] + b * wy[ ih ] + ( ( a * a * a - a ) * y2[ j ] + ( b * b * b - b ) * y2[ ih ] ) * ( h * h ) / 6.0 ) + 0.1; /* Clamp */ if ( y[ i ] < 0 ) y[ i ] = 0; else if ( y[ i ] > FL_PCMAX ) y[ i ] = FL_PCMAX; } y[ nout - 1 ] = wy[ nin - 1 ]; return nout; } /*********************************************************************** * convert image types ***********************************************************************/ /*********************************************************************** * to rgba image *********************************************************************{*/ /*************************************** ***************************************/ static int packed_to_rgba( FL_IMAGE * im ) { FL_PACKED *packed = im->packed[ 0 ]; unsigned char *r, *g, *b, *a; int i, npix; r = im->red[ 0 ]; g = im->green[ 0 ]; b = im->blue[ 0 ]; a = im->alpha[ 0 ]; for ( i = 0, npix = im->w * im->h; i < npix; i++ ) FL_UNPACK4( packed[ i ], r[ i ], g[ i ], b[ i ], a[ i ] ); return 0; } /*************************************** ***************************************/ static int gray_to_rgba( FL_IMAGE * im ) { unsigned short *gray = im->gray[ 0 ]; unsigned char *r, *g, *b; int i, npix; r = im->red[ 0 ]; g = im->green[ 0 ]; b = im->blue[ 0 ]; for ( i = 0, npix = im->w * im->h; i < npix; i++ ) r[ i ] = g[ i ] = b[ i ] = gray[ i ]; return 0; } /*************************************** ***************************************/ static int gray16_to_rgba( FL_IMAGE * im ) { unsigned short *gray = im->gray[ 0 ]; unsigned char *r, *g, *b; float scale = ( FL_PCMAX + 0.001 ) / im->gray_maxval; int i, npix; r = im->red[ 0 ]; g = im->green[ 0 ]; b = im->blue[ 0 ]; for ( i = 0, npix = im->w * im->h; i < npix; i++ ) r[ i ] = g[ i ] = b[ i ] = gray[ i ] * scale; return 0; } /*************************************** ***************************************/ static int ci_to_rgba( FL_IMAGE * im ) { unsigned short *ci = im->ci[ 0 ]; unsigned char *r, *g, *b; int k, i; r = im->red[ 0 ]; g = im->green[ 0 ]; b = im->blue[ 0 ]; for ( i = im->w * im->h; --i >= 0; ) { k = ci[ i ]; r[ i ] = im->red_lut[ k ]; g[ i ] = im->green_lut[ k ]; b[ i ] = im->blue_lut[ k ]; } return 0; } /*}********************************************************************* * to grayscale *********************************************************************{*/ /*************************************** ***************************************/ static int packed_to_gray( FL_IMAGE * im ) { FL_PACKED *packed = im->packed[ 0 ]; int i, total = im->w * im->h; unsigned short *gray; gray = im->ci[ 0 ]; for ( i = 0; i < total; i++ ) gray[ i ] = FL_RGB2GRAY( FL_GETR( packed[ i ] ), FL_GETG( packed[ i ] ), FL_GETB( packed[ i ] ) ); return 0; } /*************************************** ***************************************/ static int rgba_to_gray( FL_IMAGE * im ) { int i, total; unsigned char *r, *g, *b; unsigned short *gray; gray = im->gray[ 0 ]; r = im->red[ 0 ]; g = im->green[ 0 ]; b = im->blue[ 0 ]; for ( i = 0, total = im->w * im->h; i < total; i++ ) gray[ i ] = FL_RGB2GRAY( r[ i ], g[ i ], b[ i ] ); return 0; } /*************************************** ***************************************/ static int ci_to_gray( FL_IMAGE * im ) { unsigned short *ci = im->ci[ 0 ]; unsigned short *gray = im->gray[ 0 ]; int i; for ( i = im->w * im->h; --i >= 0; ) gray[i] = FL_RGB2GRAY( im->red_lut[ ci[ i ] ], im->green_lut[ ci[ i ] ], im->blue_lut[ ci[ i ] ] ); return 0; } /*}********************************************************************* * Pack an image *********************************************************************{*/ /*************************************** ***************************************/ static int rgba_to_packed( FL_IMAGE * im ) { int npix, i; FL_PACKED *p; unsigned char *r, *g, *b, *a; r = im->red[ 0 ]; g = im->green[ 0 ]; b = im->blue[ 0 ]; a = im->alpha[ 0 ]; p = im->packed[ 0 ]; for ( i = 0, npix = im->w * im->h; i < npix; i++ ) p[ i ] = FL_PACK4( r[ i ], g[ i ], b[ i ], a[ i ] ); return 0; } /*************************************** ***************************************/ static int ci_to_packed( FL_IMAGE * im ) { int i; FL_PACKED *p; unsigned short *ci; p = im->packed[ 0 ]; ci = im->ci[ 0 ]; for ( i = im->w * im->h; --i >= 0; ) p[ i ] = FL_PACK4( im->red_lut[ ci[ i ] ], im->green_lut[ ci[ i ] ], im->blue_lut[ ci[ i ] ], 0 ); return 0; } /*}******************************************************************* * convert to color index *********************************************************************/ /*************************************** ***************************************/ static int rgb_to_ci( FL_IMAGE * im ) { return flimage_quantize_rgb( im->red, im->green, im->blue, im->w, im->h, im->map_len, im->ci, &im->map_len, im->red_lut, im->green_lut, im->blue_lut, im ); } /*************************************** ***************************************/ static int packed_to_ci( FL_IMAGE * im ) { return flimage_quantize_packed( im->packed, im->w, im->h, im->map_len, im->ci, &im->map_len, im->red_lut, im->green_lut, im->blue_lut, im ); } /*************************************** ***************************************/ static int gray_to_ci( FL_IMAGE * im ) { int i; float fact = ( FL_PCMAX + 0.001 ) / ( im->map_len - 1.0 ); float scale = ( im->map_len - 1.0 ) / 254.999; for ( i = 0; i < im->map_len; i++ ) im->red_lut[ i ] = im->green_lut[ i ] = im->blue_lut[ i ] = i * fact; if ( im->map_len != 256 ) for ( i = im->w * im->h; --i >= 0; ) im->ci[ 0 ][ i ] = im->gray[ 0 ][ i ] * scale; else for ( i = im->w * im->h; --i >= 0; ) im->ci[ 0 ][ i ] = im->gray[ 0 ][ i ]; return 0; } /*************************************** ***************************************/ static void scale_gray16( unsigned short * g16, unsigned short * g, int maxval, int len ) { float scale = ( FL_PCMAX + 0.001 ) / maxval; while ( --len >= 0 ) g[ len ] = g16[ len ] * scale; } /*************************************** ***************************************/ static int gray16_to_gray( FL_IMAGE * im ) { scale_gray16( im->gray[ 0 ], im->gray[ 0 ], im->gray_maxval, im->w * im->h ); return 0; } /*************************************** ***************************************/ static int gray_to_gray16( FL_IMAGE * im ) { im->type = FL_IMAGE_GRAY16; im->gray_maxval = 255; return 0; } /*************************************** ***************************************/ static int gray16_to_ci( FL_IMAGE * im ) { int i; float fact = ( FL_PCMAX + 0.001 ) / ( im->map_len - 1.0 ); for ( i = 0; i < im->map_len; i++ ) im->red_lut[ i ] = im->green_lut[ i ] = im->blue_lut[ i ] = i * fact; scale_gray16( im->gray[ 0 ], im->ci[ 0 ], im->gray_maxval, im->w * im->h ); return 0; } /*}********************************************************************* * Convert an image to B&W (half-toning) **********************************************************************/ enum { FS_DITHER, ORDERED8, DITHER_THRESHOLD }; static int dither_method = FS_DITHER; static int dither_threshold = ( 1 << FL_PCBITS ) / 2; /*************************************** * do floyd-steinberg dithering ***************************************/ static int fs_dither( unsigned short ** mat, int h, int w, unsigned short ** mm ) { unsigned short *m, *ras; int **tmp, *curr, *next = NULL; int i, j, n, err, dither2, lut[ 1 << FL_PCBITS ]; static int x[ 4 ] = { 0, 15, 240, 255 }; static int y[ 4 ] = { 0, 5, 250, 255 }; /* to preserve the errors on the edge, has to get one more row */ tmp = fl_get_matrix( h + 1, w, sizeof **tmp ); spline_int_interpolate( x, y, 4, 1, lut ); for ( ras = mat[ 0 ], curr = tmp[ 0 ], n = h * w; --n >= 0; ras++, curr++ ) *curr = lut[ *ras ]; /* because we have the raster in a consecutive array, we got the edge * errors right for free */ dither2 = ( 1 << FL_PCBITS ) - 1; for ( i = 0; i < h; i++ ) { curr = tmp[ i ]; /* can't have it run to h 'cause nextrow[j+1] will be wrong */ if ( i < h - 1 ) next = tmp[ i + 1 ]; for ( m = mm[ i ], j = 0; j < w; j++, m++ ) { /* the value of *m depends on how the colormap is assigned */ err = curr[ j ] - ( ( *m = curr[ j ] <= dither_threshold ) ? 0 : dither2 ); curr[ j + 1 ] += ( err * 7 ) / 16; next[ j - 1 ] += ( err * 3 ) / 16; next[ j ] += ( err * 5 ) / 16; next[ j + 1 ] += err / 16; } } fl_free_matrix( tmp ); return 0; } /*************************************** ***************************************/ static int gray_to_mono( FL_IMAGE * im ) { unsigned short **outm = fl_get_matrix( im->h, im->w, sizeof **outm ); unsigned short *in, *out, *end; int status = 0; if ( dither_threshold <= 0 ) dither_threshold = ( 1 << FL_PCBITS ) / 2; if ( dither_method == FS_DITHER ) status = fs_dither( im->gray, im->h, im->w, outm ); else if ( dither_method == DITHER_THRESHOLD ) { in = im->gray[ 0 ]; for ( out = outm[ 0 ], end = in + im->w * im->h; in < end; ) *out++ = *in++ >= dither_threshold; } if ( status >= 0 ) { fl_free_matrix( im->ci ); im->ci = outm; im->map_len = 2; flimage_getcolormap( im ); im->red_lut[ 0 ] = im->green_lut[ 0 ] = im->blue_lut[ 0 ] = FL_PCMAX; im->red_lut[ 1 ] = im->green_lut[ 1 ] = im->blue_lut[ 1 ] = 0; } return status; } /*************************************** * need to keep the original resolution ***************************************/ static int gray16_to_mono( FL_IMAGE * im ) { int status; unsigned short **gray, **save = im->gray; if ( ! ( gray = fl_get_matrix( im->h, im->w, sizeof **gray ) ) ) return -1; scale_gray16( save[ 0 ], gray[ 0 ], im->gray_maxval, im->w * im->h ); im->gray = gray; status = gray_to_mono( im ); fl_free_matrix( gray ); im->gray = save; return status; } /*************************************** ***************************************/ static int rgba_to_mono( FL_IMAGE * im ) { int otype = im->type; im->type = FL_IMAGE_GRAY; flimage_getmem( im ); rgba_to_gray( im ); im->type = otype; gray_to_mono( im ); return 0; } /*************************************** ***************************************/ static int packed_to_mono( FL_IMAGE * im ) { int otype = im->type; im->type = FL_IMAGE_GRAY; flimage_getmem( im ); packed_to_gray( im ); im->type = otype; gray_to_mono( im ); return 0; } /*************************************** ***************************************/ static int ci_to_mono( FL_IMAGE * im ) { int otype = im->type; im->type = FL_IMAGE_GRAY; flimage_getmem( im ); ci_to_gray( im ); im->type = otype; gray_to_mono( im ); return 0; } /*********************************************************************** * gloabl interface to type change **********************************************************************/ typedef struct { int from, to; int ( * cnvt )( FL_IMAGE * ); } Cnvt; /*************************************** ***************************************/ static int noop( FL_IMAGE * im FL_UNUSED_ARG ) { return 0; } static Cnvt cnvt[ ] = { /* to gray */ { FL_IMAGE_PACKED, FL_IMAGE_GRAY, packed_to_gray }, { FL_IMAGE_RGB, FL_IMAGE_GRAY, rgba_to_gray }, { FL_IMAGE_CI, FL_IMAGE_GRAY, ci_to_gray }, { FL_IMAGE_MONO, FL_IMAGE_GRAY, ci_to_gray }, { FL_IMAGE_GRAY16, FL_IMAGE_GRAY, gray16_to_gray }, { FL_IMAGE_GRAY, FL_IMAGE_GRAY16, gray_to_gray16 }, /* to rgb */ { FL_IMAGE_PACKED, FL_IMAGE_RGB, packed_to_rgba }, { FL_IMAGE_GRAY, FL_IMAGE_RGB, gray_to_rgba }, { FL_IMAGE_GRAY16, FL_IMAGE_RGB, gray16_to_rgba }, { FL_IMAGE_CI, FL_IMAGE_RGB, ci_to_rgba }, { FL_IMAGE_MONO, FL_IMAGE_RGB, ci_to_rgba }, /* to packed */ { FL_IMAGE_RGB, FL_IMAGE_PACKED, rgba_to_packed }, { FL_IMAGE_CI, FL_IMAGE_PACKED, ci_to_packed }, { FL_IMAGE_MONO, FL_IMAGE_PACKED, ci_to_packed }, /* to ci */ { FL_IMAGE_RGB, FL_IMAGE_CI, rgb_to_ci }, { FL_IMAGE_PACKED, FL_IMAGE_CI, packed_to_ci }, { FL_IMAGE_GRAY16, FL_IMAGE_CI, gray16_to_ci }, { FL_IMAGE_GRAY, FL_IMAGE_CI, gray_to_ci }, { FL_IMAGE_GRAY, FL_IMAGE_CI, gray_to_ci }, { FL_IMAGE_MONO, FL_IMAGE_CI, noop }, /* to mono */ { FL_IMAGE_RGB, FL_IMAGE_MONO, rgba_to_mono }, { FL_IMAGE_PACKED, FL_IMAGE_MONO, packed_to_mono }, { FL_IMAGE_GRAY, FL_IMAGE_MONO, gray_to_mono }, { FL_IMAGE_GRAY16, FL_IMAGE_MONO, gray16_to_mono }, { FL_IMAGE_CI, FL_IMAGE_MONO, ci_to_mono }, /* sentinel */ { FL_IMAGE_NONE, FL_IMAGE_NONE, 0 } }; /*************************************** ***************************************/ int flimage_convert( FL_IMAGE * image, int newtype, int ncolors ) { int found, status, otype; Cnvt *p = cnvt; if ( ! image || image->w <= 0 || image->type == FL_IMAGE_NONE ) return -1; if ( image->type == newtype ) return 0; if ( image->type == FL_IMAGE_MONO ) ncolors = 2; otype = image->type; if ( image->available_type & newtype && ! image->force_convert ) { /* If CI, we also need to verify the map_len is the same */ if ( newtype != FL_IMAGE_CI || image->map_len == ncolors ) { image->type = newtype; image->modified = 1; return 0; } } for ( p = cnvt, found = 0; p->from != FL_IMAGE_NONE && !found; p++ ) found = p->from == image->type && p->to == newtype; if ( ! found ) { fprintf( stderr, "requested conversion (%d to %d) not defined\n", image->type, newtype ); return -1; } if ( newtype == FL_IMAGE_CI ) { image->map_len = ncolors <= 1 ? 256 : ncolors; flimage_getcolormap( image ); } image->type = newtype; if ( flimage_getmem( image ) < 0 ) { image->error_message( image, "Convert: can't get memory" ); return -1; } if ( ( status = ( --p )->cnvt( image ) ) >= 0 ) { image->available_type |= otype; image->modified = 1; } else { image->type = p->from; image->error_message( image, "conversion failed" ); } image->force_convert = 0; return status; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image.c0000664000175000017500000013515712353623325012307 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1998-2002 T.C. Zhao * All rights reserved. * * Public API for image file IO */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "flimage.h" #include "flimage_int.h" #include "private/flsnprintf.h" #include #include static int visual_cue( FL_IMAGE *, const char * ); static void error_message( FL_IMAGE *, const char * ); static int nimage; static FLIMAGE_SETUP current_setup; #define MaxImageFileNameLen 260 FLIMAGE_IO *flimage_io; FLIMAGE_QUANTIZE_RGB flimage_quantize_rgb; FLIMAGE_QUANTIZE_PACKED flimage_quantize_packed; static int ppm_added, gzip_added; static void add_default_formats( void ); /********************************************************************* *****************************************************************{**/ static void null_op( FL_IMAGE * im FL_UNUSED_ARG ) { } /********************************************************************* * Setup and image structure creation *****************************************************************{**/ void flimage_setup( FLIMAGE_SETUP * setup ) { current_setup = *setup; if ( ( *setup ).max_frames == 0 ) current_setup.max_frames = 30; if ( ( *setup ).delay > 2000 ) current_setup.delay = 2000; add_default_formats( ); } /*************************************** ***************************************/ static void init_setup( void ) { if ( current_setup.max_frames || current_setup.delay ) return; current_setup.max_frames = 30; current_setup.delay = 50; } /*************************************** ***************************************/ FL_IMAGE * flimage_alloc( void ) { FL_IMAGE *image = fl_calloc( 1, sizeof *image ); init_setup( ); add_default_formats( ); image->setup = ¤t_setup; image->visual_cue = current_setup.visual_cue; image->error_message = current_setup.error_message; image->gray_maxval = 255; image->ci_maxval = 255; image->tran_index = -1; image->tran_rgb = -1; image->app_background = -1; image->app_data = current_setup.app_data; image->total_frames = 1; image->xdist_scale = image->ydist_scale = 1.0; image->pscale = 1.0; image->display = flimage_display; image->xdisplay = current_setup.xdisplay; image->infile = fl_malloc( MaxImageFileNameLen * sizeof *image->infile ); image->outfile = fl_malloc( MaxImageFileNameLen * sizeof *image->outfile ); image->infile[0] = image->outfile[ 0 ] = '\0'; if ( ! image->xdisplay ) image->xdisplay = fl_display; /* initialize the quantizer */ if ( ! flimage_quantize_rgb ) { flimage_quantize_rgb = j2pass_quantize_rgb; flimage_quantize_packed = j2pass_quantize_packed; } /* make sure visual_cue and error_message are ok */ if ( ! image->visual_cue ) image->visual_cue = visual_cue; if ( ! image->error_message ) image->error_message = error_message; /* annotation stuff */ image->display_markers = null_op; image->free_markers = null_op; image->display_text = null_op; image->free_text = null_op; return image; } /**}*********************************************************************** * Image identification *********************************************************************{****/ /* it's important that this routine be silient. is_supported calls this */ static FL_IMAGE * identify_image( const char *file ) { FILE *fp; FLIMAGE_IO *io; FL_IMAGE *image = 0; if ( ! file || ! *file ) return 0; if ( ! ( fp = fopen( file, "rb" ) ) ) { fprintf( stderr, "Can't open %s\n", file ); return NULL; } if ( ! ppm_added ) add_default_formats( ); for ( io = flimage_io; io->formal_name; io++ ) { if ( io->identify( fp ) > 0 ) { image = flimage_alloc( ); image->image_io = io; image->original_type = io->type; image->fpin = fp; strncpy( image->infile, file, MaxImageFileNameLen - 5 ); image->infile[ MaxImageFileNameLen - 5 ] = '\0'; return image; } else rewind( fp ); } return 0; } /*************************************** * check if the file is an image file. Should never bitch ***************************************/ int flimage_is_supported( const char * file ) { FILE *fp; FLIMAGE_IO *io; int n; if ( ! file || ! ( fp = fopen( file, "rb" ) ) ) return 0; if ( ! ppm_added ) add_default_formats( ); for ( n = 0, io = flimage_io; io->formal_name; io++, n++ ) { if ( io->identify( fp ) > 0 ) { fclose( fp ); return n + 1; } else rewind( fp ); } fclose( fp ); return 0; } /*}******************************************************************** * basic image file open routines ******************************************************************{**/ FL_IMAGE * flimage_open( const char * file ) { FL_IMAGE *im = identify_image( file ); if ( ! im ) M_err( "OpenImage", "%s: Unknown image format", file ? file : "null" ); return im; } /*************************************** ***************************************/ int flimage_close( FL_IMAGE * im ) { int status = 0; if ( ! im ) return -1; if ( im->fpin ) status = fclose( im->fpin ); if ( im->fpout ) status = fclose( im->fpout ); im->fpin = 0; im->fpout = 0; return status; } /************************************************************************ * Input routines **********************************************************************{*/ FL_IMAGE * flimage_read( FL_IMAGE * im ) { FL_IMAGE *image = im; FLIMAGE_IO *io; int error = 0; char buf[ 256 ]; if ( ! im || ! im->fpin ) return NULL; io = image->image_io; if ( ! io->read_description || ! io->read_pixels ) return NULL; /* copy some default info */ image->type = io->type; image->fmt_name = io->short_name; image->foffset = ftell( image->fpin ); if ( ( error = ( io->read_description( image ) < 0 ) ) ) return NULL; /* image_io can change between description and read_pixels for io_filter'ed image */ io = image->image_io; if ( ( error = ( flimage_getmem( image ) < 0 ) ) ) { im->error_message( im, "ImageGetMem:Failed to allocate memory" ); flimage_freemem( im ); return NULL; } image->completed = 0; image->total = im->h; image->error_message( image, "" ); error = error || ( io->read_pixels( image ) < 0 ); image->completed = im->total; sprintf( buf, "Done Reading %s", image->fmt_name ); image->visual_cue( image, error ? "Error Reading" : buf ); image->original_type = image->type; image->available_type = image->type; image->modified = 1; if ( error ) { flimage_freemem( image ); image = NULL; } return image; } /*************************************** * turn a random frame into next frame ***************************************/ static int default_next_frame( FL_IMAGE * im ) { return im->random_frame( im, im->current_frame ); } /*************************************** ***************************************/ FL_IMAGE * flimage_load( const char * file ) { FL_IMAGE *image, *im; int err, tc, total_frames = 1; char buf[ 256 ]; add_default_formats( ); if ( ( image = flimage_open( file ) ) ) { if ( ! ( im = flimage_read( image ) ) ) { flimage_free( image ); image = NULL; } else image = im; } if ( ! image ) return image; /* transparency */ tc = image->tran_index; if ( FL_IsCI( image->type ) && tc >= 0 && tc < image->map_len ) image->tran_rgb = FL_PACK3( image->red_lut[ tc ], image->green_lut[ tc ], image->blue_lut[ tc ] ); /* Create a next_frame function on the fly if possible */ if ( ! image->next_frame && image->random_frame ) image->next_frame = default_next_frame; if ( ! image->more || ! image->next_frame ) { if ( ( ( FLIMAGE_IO * ) image->image_io )->annotation ) flimage_read_annotation( image ); flimage_close( image ); fli_safe_free( image->io_spec ); image->spec_size = 0; image->display = flimage_sdisplay; return image; } image->current_frame = 1; /* we have multi-frames */ for ( err = 0, im = image; ! err && im->more && im->current_frame < current_setup.max_frames; ) { if ( ! ( err = ! ( im->next = flimage_dup_( im, 0 ) ) ) ) { im = im->next; im->current_frame++; } sprintf( buf, "Done image %d of %d", im->current_frame, current_setup.max_frames ); im->visual_cue( im, buf ); err = err || ( im->next_frame( im ) < 0 ); total_frames += ! err; } flimage_close( image ); image->completed = im->total; sprintf( buf, "Done Reading multi-frame %s", image->fmt_name ); image->visual_cue( image, err ? "Error Reading" : buf ); /* multi frame cleanup */ if ( image->cleanup ) image->cleanup( image ); /* update the number of frames */ image->total_frames = total_frames; return image; } /*}********************************************************************* * Output routines *******************************************************************{**/ static void convert_type( FL_IMAGE *, FLIMAGE_IO * ); int flimage_dump( FL_IMAGE * image, const char * filename, const char * fmt ) { FLIMAGE_IO *io = flimage_io; char buf[ 256 ], *p; FILE *fp; int status = -1, otype; FL_IMAGE *tmpimage; if ( ! image || image->type == FL_IMAGE_NONE ) { fprintf( stderr, "WriteImage: invalid or null image\n" ); return -1; } if ( ! fmt || ! *fmt ) fmt = image->fmt_name; for ( ; io->formal_name; io++ ) { if ( ( strcasecmp( io->formal_name, fmt ) == 0 || strcasecmp( io->short_name, fmt ) == 0 || strcasecmp( io->extension, fmt ) == 0 ) && io->write_image ) { strncpy( image->outfile, filename, MaxImageFileNameLen - 5 ); image->outfile[ MaxImageFileNameLen - 5 ] = '\0'; /* change extension */ if ( ! image->setup->no_auto_extension ) { if ( ( p = strrchr( image->outfile, '.' ) ) ) *p = '\0'; strcat( strcat( image->outfile, "." ), io->extension ); } if ( ! ( fp = fopen( image->outfile, "wb" ) ) ) { flimage_error( image, "can't open %s", image->outfile ); return -1; } image->fpout = fp; otype = image->type; for ( tmpimage = image; tmpimage; tmpimage = tmpimage->next ) convert_type( tmpimage, io ); if ( image->pre_write && image->pre_write( image ) < 0 ) { flimage_close( image ); return FL_CANCEL; } image->completed = 0; image->total = image->h; status = io->write_image( image ); if ( status >= 0 && image->post_write ) image->post_write( image ); image->type = otype; if ( io->annotation ) flimage_write_annotation( image ); flimage_close( image ); image->completed = image->total; fli_snprintf( buf, sizeof buf, "Done Writing %s(%s)", image->outfile, fmt ); image->visual_cue( image, buf ); return status; } } flimage_error( image, "don't know how to write %s", fmt ); return -1; } /*************************************** * convert the image to a type the output routine can handle ***************************************/ static void convert_type( FL_IMAGE * im, FLIMAGE_IO * io ) { const int types[ ] = { FL_IMAGE_RGB, FL_IMAGE_PACKED, FL_IMAGE_CI, FL_IMAGE_GRAY, FL_IMAGE_MONO }; int ntypes = sizeof types / sizeof *types; int i, done; /* if the output routine can handle the current image type, do nothing */ if ( ( im->type & io->type ) ) return; /* must force the conversion */ im->force_convert = 1; if ( im->type == FL_IMAGE_CI || im->type == FL_IMAGE_RGB ) { for ( i = done = 0; !done && i < ntypes; i++ ) { if ( ( done = io->type & types[ i ] ) ) flimage_convert( im, types[ i ], 256 ); } } else if ( im->type == FL_IMAGE_GRAY || im->type == FL_IMAGE_MONO ) { if ( io->type & FL_IMAGE_CI ) flimage_convert( im, FL_IMAGE_CI, 256 ); else { for ( i = done = 0; !done && i < ntypes; i++ ) { if ( ( done = io->type & types[ i ] )) flimage_convert( im, types[ i ], 256 ); } } } else if ( im->type == FL_IMAGE_GRAY16 ) { if ( io->type & FL_IMAGE_GRAY ) flimage_convert( im, FL_IMAGE_GRAY, 0 ); else { for ( i = done = 0; !done && i < ntypes; i++ ) { if ( ( done = io->type & types[ i ] ) ) flimage_convert( im, types[ i ], 256 ); } } } else { M_err( "Output", "InternalError: unhandled image type: %s", flimage_type_name( im->type ) ); im->force_convert = 0; } } /*}********************************************************************* */ /*********************************************************************** * memory related routines ********************************************************************{**/ void flimage_free( FL_IMAGE * image ) { FL_IMAGE *im, *imnext; for ( im = image; im; im = imnext) { flimage_freemem( im ); if ( im == image ) flimage_close( im ); imnext = im->next; fli_safe_free( im->infile ); fli_safe_free( im->outfile ); im->next = NULL; fl_free( im ); } } /*************************************** ***************************************/ int flimage_get_linearlut( FL_IMAGE * im ) { if ( ! im->map_len ) { im->map_len = FL_PCMAX + 1; flimage_getcolormap( im ); } if ( im->map_len > im->llut_len ) { fli_safe_free( im->llut[ 0 ] ); fli_safe_free( im->llut[ 1 ] ); fli_safe_free( im->llut[ 2 ] ); } if ( ! im->llut[ 0 ] ) { im->llut[ 0 ] = fl_malloc( im->map_len * sizeof **im->llut ); im->llut[ 1 ] = fl_malloc( im->map_len * sizeof **im->llut ); im->llut[ 2 ] = fl_malloc( im->map_len * sizeof **im->llut ); } if ( ! im->llut[ 2 ] ) { fli_safe_free( im->llut[ 0 ] ); fli_safe_free( im->llut[ 1 ]); return -1; } im->llut_len = im->map_len; return 0; } /*************************************** ***************************************/ void flimage_free_linearlut( FL_IMAGE * im ) { fli_safe_free( im->llut[ 0 ] ); fli_safe_free( im->llut[ 1 ] ); fli_safe_free( im->llut[ 2 ] ); im->llut_len = 0; } /*************************************** ***************************************/ int flimage_getmem( FL_IMAGE * im ) { int nomap, err = 0, same_size; unsigned int esize; if ( ! im || ! im->w || ! im->h ) return -1; same_size = im->w == im->matc && im->h == im->matr; switch ( im->type ) { case FL_IMAGE_CI: case FL_IMAGE_MONO: if ( ( nomap = ( im->map_len <= 0 ) ) ) im->map_len = 2; if ( flimage_getcolormap( im ) < 0 ) { flimage_error( im, "can't alloc colormap" ); return -1; } if ( im->type == FL_IMAGE_MONO && nomap ) { im->red_lut[ 0 ] = im->green_lut[ 0 ] = im->blue_lut[ 0 ] = FL_PCMAX; im->red_lut[ 1 ] = im->green_lut[ 1 ] = im->blue_lut[ 1 ] = 0; } if ( ! same_size || ! im->ci ) { if ( im->ci ) fl_free_matrix( im->ci ); err = ! ( im->ci = fl_get_matrix( im->h, im->w, sizeof **im->ci ) ); } break; case FL_IMAGE_GRAY: case FL_IMAGE_GRAY16: flimage_getcolormap( im ); if ( ! same_size || ! im->gray ) { if ( im->gray ) fl_free_matrix( im->gray ); err = ! ( im->gray = fl_get_matrix( im->h, im->w, sizeof **im->gray ) ); } if ( ! err && ( ! im->wlut || im->gray_maxval > im->wlut_len ) ) { fli_safe_free( im->wlut ); if ( ( im->wlut_len = im->gray_maxval + 1 ) < 256 ) im->wlut_len = 256; err = ! ( im->wlut = fl_malloc( im->wlut_len * sizeof *im->wlut ) ); } break; case FL_IMAGE_PACKED: if ( ! same_size || ! im->packed ) { if ( im->packed ) fl_free_matrix( im->packed ); err = ! ( im->packed = fl_get_matrix( im->h, im->w, sizeof **im->packed ) ); } break; case FL_IMAGE_RGB: /* it's possible for some image format to be RGB yet * have a redundant colormap in it (xwd for example) */ flimage_getcolormap( im ); if ( ! same_size || ! im->red ) { if ( im->red ) { fl_free_matrix( im->red ); fl_free_matrix( im->green ); fl_free_matrix( im->blue ); fl_free_matrix( im->alpha ); } esize = sizeof **im->red; err = ! ( im->red = fl_get_matrix( im->h, im->w, esize ) ) || ! ( im->green = fl_get_matrix( im->h, im->w, esize ) ) || ! ( im->blue = fl_get_matrix( im->h, im->w, esize ) ) || ! ( im->alpha = fl_get_matrix( im->h, im->w, esize ) ); if ( err ) { fl_free_matrix( im->red ); fl_free_matrix( im->green ); fl_free_matrix( im->blue ); fl_free_matrix( im->alpha ); im->red = NULL; } else { im->rgba[ 0 ] = im->red; im->rgba[ 1 ] = im->green; im->rgba[ 2 ] = im->blue; im->rgba[ 3 ] = im->alpha; } } break; default: return -1; } im->matr = im->h; im->matc = im->w; return err ? -1 : 0; } /*************************************** ***************************************/ int flimage_getcolormap( FL_IMAGE * im ) { int len = im->map_len; if ( len <= 0 ) return -1; if ( len > FLIMAGE_MAXLUT ) len = im->map_len = FLIMAGE_MAXLUT; im->red_lut = fl_realloc( im->red_lut, len * sizeof *im->red_lut ); im->green_lut = fl_realloc( im->green_lut, len * sizeof *im->green_lut ); im->blue_lut = fl_realloc( im->blue_lut, len * sizeof *im->blue_lut ); im->alpha_lut = fl_realloc( im->alpha_lut, len * sizeof *im->alpha_lut ); if ( ! im->alpha_lut ) { fli_safe_free( im->red_lut ); fli_safe_free( im->green_lut ); fli_safe_free( im->blue_lut ); return -1; } im->lut[ 0 ] = im->red_lut; im->lut[ 1 ] = im->green_lut; im->lut[ 2 ] = im->blue_lut; im->lut[ 3 ] = im->alpha_lut; if ( im->map_len > im->wlut_len && FL_IsGray( im->type ) ) { im->wlut = fl_realloc( im->wlut, im->map_len * sizeof *im->wlut ); if ( ! im->wlut ) { im->wlut_len = 0; return -1; } im->wlut_len = im->map_len; } return 0; } /*************************************** * before we modify the current image, need to invalidate/free all * other types ***************************************/ void flimage_invalidate_pixels( FL_IMAGE * im ) { if ( ! FL_IsGray( im->type ) ) { fl_free_matrix( im->gray ); im->gray = NULL; } if ( ! FL_IsCI( im->type ) ) { fl_free_matrix( im->ci ); im->ci = NULL; } if ( im->type != FL_IMAGE_PACKED ) { fl_free_matrix( im->packed ); im->packed = NULL; } if ( im->type != FL_IMAGE_RGB ) { fl_free_matrix( im->red ); fl_free_matrix( im->green ); fl_free_matrix( im->blue ); fl_free_matrix( im->alpha ); im->red = im->green = im->blue = im->alpha = NULL; } im->available_type = im->type; } /*************************************** * free all allocated memory associated with the image ***************************************/ void flimage_freemem( FL_IMAGE * image ) { if ( ! image || ! image->w || ! image->h ) return; if ( image->ci ) { fl_free_matrix( image->ci ); image->ci = NULL; } fli_safe_free( image->wlut ); image->wlut_len = 0; if ( image->gray ) { fl_free_matrix( image->gray ); image->gray = NULL; } if ( image->packed ) { fl_free_matrix( image->packed ); image->packed = NULL; } if ( image->red ) { fl_free_matrix( image->red ); fl_free_matrix( image->green ); fl_free_matrix( image->blue ); fl_free_matrix( image->alpha ); image->red = image->green = image->blue = image->alpha = NULL; } if ( image->map_len > 0 && image->red_lut ) { fl_free( image->red_lut ); fl_free( image->green_lut ); fl_free( image->blue_lut ); fl_free( image->alpha_lut ); image->red_lut = image->green_lut = image->blue_lut = NULL; image->map_len = 0; } fli_safe_free( image->comments ); image->comments_len = 0; image->free_text( image ); image->free_markers( image ); flimage_free_linearlut( image ); if ( image->pixmap ) { XFreePixmap( image->xdisplay, image->pixmap ); image->pixmap = None; image->pixmap_depth = 0; } if ( image->ximage ) { XDestroyImage( ( XImage * ) image->ximage ); image->ximage = NULL; } if ( image->gc ) { XFreeGC( image->xdisplay, image->gc ); image->gc = None; } if ( image->textgc ) { XFreeGC( image->xdisplay, image->textgc ); image->textgc = None; } if ( image->markergc ) { XFreeGC( image->xdisplay, image->markergc ); image->markergc = None; } if ( image->pixels ) { fl_free_matrix( image->pixels ); image->pixels = NULL; } fli_safe_free( image->io_spec ); image->spec_size = 0; fli_safe_free( image->info ); image->w = image->h = 0; image->matr = image->matc = 0; image->type = FL_IMAGE_NONE; image->available_type = FL_IMAGE_NONE; } /*************************************** ***************************************/ int flimage_add_format( const char * formal_name, const char * short_name, const char * extension, int type, FLIMAGE_Identify identify, FLIMAGE_Description description, FLIMAGE_Read_Pixels read_pixels, FLIMAGE_Write_Image write_image ) { int i, k; FLIMAGE_IO *thisIO; if ( ! formal_name || ! *formal_name || ! short_name || ! *short_name ) return -1; ppm_added = ppm_added || ( extension && strcmp( "ppm", extension ) == 0 ); gzip_added = gzip_added || ( extension && strcmp("gz", extension ) == 0 ); if ( type <= 0 || type > FL_IMAGE_FLEX ) return -1; if ( ! description || ! read_pixels || ! identify ) description = read_pixels = 0; if ( flimage_io == 0 ) { nimage = 1; /* sentinel */ flimage_io = fl_calloc( 3, sizeof *flimage_io ); } else flimage_io = fl_realloc( flimage_io, ( nimage + 2 ) * sizeof *flimage_io ); k = nimage; /* find out if the image format is already installed. Replace if yes */ for ( i = 0; flimage_io[ i ].formal_name; i++ ) { if ( strcmp( flimage_io[ i ].formal_name, formal_name ) == 0 && strcmp( flimage_io[ i ].short_name, short_name ) == 0 ) { M_err( "flimage_add_format", "%s already supported. Replaced", short_name ); k = i + 1; } } thisIO = flimage_io + k - 1; thisIO->formal_name = formal_name; thisIO->short_name = short_name; thisIO->extension = extension ? extension : short_name; thisIO->type = type; thisIO->identify = identify; thisIO->read_description = description; thisIO->read_pixels = read_pixels; thisIO->write_image = write_image; thisIO->annotation = 0; nimage += k == nimage; if ( ! strcmp( short_name, "ppm" ) || ! strcmp( short_name, "pgm" ) ) thisIO->annotation = 1; /* sentinel */ ( ++thisIO )->formal_name = NULL; return k; } /*************************************** ***************************************/ void flimage_set_annotation_support( int in, int flag ) { --in; if ( in < 0 || in >= nimage ) return; flimage_io[ in ].annotation = flag != 0; } #define VN( a ) {a,#a} static FLI_VN_PAIR types[ ] = { VN( FL_IMAGE_NONE ), VN( FL_IMAGE_CI ), VN( FL_IMAGE_MONO ), VN( FL_IMAGE_RGB ), VN( FL_IMAGE_PACKED ), VN( FL_IMAGE_GRAY ), VN( FL_IMAGE_GRAY16 ), VN( FL_IMAGE_FLEX ), { -1, NULL } }; /*************************************** ***************************************/ const char * flimage_type_name( int type ) { return fli_get_vn_name( types, type ); } /*************************************** ***************************************/ int flimage_get_number_of_formats( void ) { add_default_formats( ); return nimage - 1; } /*************************************** ***************************************/ #define MaxInfoBuffer 6 const FLIMAGE_FORMAT_INFO * flimage_get_format_info( int n ) { static FLIMAGE_FORMAT_INFO fmt_return[ MaxInfoBuffer ]; static int k; FLIMAGE_IO *io; FLIMAGE_FORMAT_INFO *fmtinfo; add_default_formats( ); if ( n <= 0 || n > nimage ) return 0; fmtinfo = fmt_return + k++ % MaxInfoBuffer; n--; io = flimage_io + n; fmtinfo->formal_name = io->formal_name; fmtinfo->short_name = io->short_name; fmtinfo->extension = io->extension; fmtinfo->type = io->type; fmtinfo->annotation = io->annotation; fmtinfo->read_write = ( io->write_image ? FLIMAGE_WRITABLE : 0 ) | ( io->read_pixels ? FLIMAGE_READABLE : 0 ); return fmtinfo; } /*************************************** ***************************************/ void flimage_replace_image( FL_IMAGE * im, int w, int h, void * r, void * g, void * b ) { /* if we replace an image, all old backingstore pixels are invalid. Free all images */ flimage_invalidate_pixels( im ); im->w = w; im->h = h; if ( im->type == FL_IMAGE_RGB ) { fl_free_matrix( im->red ); fl_free_matrix( im->green ); fl_free_matrix( im->blue ); fl_free_matrix( im->alpha ); im->red = r; im->green = g; im->blue = b; /* dont' have to preserve the alpha. remember to doc it */ im->alpha = fl_get_matrix( h, w, sizeof **im->alpha ); } else if ( FL_IsCI( im->type ) ) { fl_free_matrix( im->ci ); im->ci = r; } else if ( FL_IsGray( im->type ) ) { fl_free_matrix( im->gray ); im->gray = r; } else { M_err( "flimage_replace_image", "InternalError: bad type=%s", flimage_type_name( im->type ) ); return; } im->matr = h; im->matc = w; im->total = im->h; /* invalidate subimage settings if any */ im->sx = im->sy = im->sw = im->sh = 0; im->modified = 1; } /*************************************** ***************************************/ void flimage_add_comments( FL_IMAGE * im, const char * s, int len ) { /* null entry clears comments */ if ( ! s || len <= 0 ) { fli_safe_free( im->comments ); im->comments_len = 0; return; } im->comments = fl_realloc( im->comments, im->comments_len + len + 1 ); strcpy( im->comments + im->comments_len, s ); im->comments_len += len; } /*************************************** ***************************************/ int flimage_windowlevel( FL_IMAGE * im, int level, int width) { if ( ! im || im->type != FL_IMAGE_GRAY16 ) return -1; im->modified = im->level != level || im->wwidth != width; if ( im->modified ) { im->level = level > im->gray_maxval ? im->gray_maxval : level; im->wwidth = width; } return im->modified; } /*************************************** ***************************************/ static int visual_cue( FL_IMAGE * im, const char * s ) { if ( im->completed < 0 ) { /* don't know how long */ fprintf( stderr, "\r%s", s ); } else if ( im->completed >= 0 && im->completed != im->total ) { fprintf( stderr, "\r%s %3.0f%%(%d of %d) ", s, 100.0 * im->completed / ( im->total - 1.0 ), im->completed, im->h ); } else if ( im->completed == im->total ) fprintf( stderr, "\n%s 100%%(%d of %d)\n", s, im->total, im->total ); return 0; } /*************************************** ***************************************/ static void copy_pixels( FL_IMAGE * dim, FL_IMAGE * sim ) { unsigned int size; flimage_getmem( dim ); switch ( sim->type ) { case FLIMAGE_RGB: size = sim->w * sim->h * sizeof **sim->red; memcpy( dim->red[ 0 ], sim->red[ 0 ], size ); memcpy( dim->green[ 0 ], sim->green[ 0 ], size ); memcpy( dim->blue[ 0 ], sim->blue[ 0 ], size ); memcpy( dim->alpha[0 ], sim->alpha[ 0 ], size ); break; case FLIMAGE_CI: case FLIMAGE_MONO: size = sim->w * sim->h * sizeof **sim->ci; memcpy( dim->ci[ 0 ], sim->ci[ 0 ], size ); break; case FLIMAGE_GRAY: case FLIMAGE_GRAY16: size = sim->w * sim->h * sizeof **sim->gray; memcpy( dim->gray[ 0 ], sim->gray[ 0 ], size ); break; default: M_err( "copy_pixel", "Bad type: %d", sim->type ); break; } } /*************************************** ***************************************/ FL_IMAGE * flimage_dup( FL_IMAGE * sim ) { if ( ! sim || ! sim->w || sim->type == FLIMAGE_NONE ) return NULL; return flimage_dup_( sim, 1 ); } /*************************************** * duplicate an image, with or without the pixels ***************************************/ FL_IMAGE * flimage_dup_( FL_IMAGE * sim, int pix ) { FL_IMAGE *im = flimage_alloc( ); unsigned int mapsize = sim->map_len * sizeof *sim->red_lut; char *infile, *outfile; if ( ! im ) { flimage_error( sim,"malloc() failed in image_dup()" ); return 0; } infile = im->infile; outfile = im->outfile; memcpy( im, sim, sizeof *im ); /* reset all pointers */ im->red = im->green = im->blue = im->alpha = NULL; im->red_lut = im->green_lut = im->blue_lut = im->alpha_lut = NULL; im->gray = NULL; im->ci = NULL; im->red16 = im->green16 = im->blue16 = im->alpha16 = NULL; im->packed = NULL; im->wlut = NULL; im->llut[ 0 ] = im->llut[ 1 ] = im->llut[ 2 ] = NULL; im->extra_io_info = NULL; im->info = NULL; flimage_getmem( im ); im->available_type = im->type; im->next = NULL; strcpy( im->infile = infile, sim->infile ); strcpy( im->outfile = outfile, sim->outfile ); /* copy pixels if requested */ if ( pix ) copy_pixels( im, sim ); if ( mapsize ) { if ( flimage_getcolormap( im ) < 0 ) { flimage_error( im, "Can't alloc colormap" ); return 0; } memcpy( im->red_lut, sim->red_lut, mapsize ); memcpy( im->green_lut, sim->green_lut, mapsize ); memcpy( im->blue_lut, sim->blue_lut, mapsize ); memcpy( im->alpha_lut, sim->alpha_lut, mapsize ); } im->io_spec = NULL; if ( sim->spec_size && sim->io_spec ) { im->io_spec = fl_malloc( sim->spec_size ); memcpy( im->io_spec, sim->io_spec, sim->spec_size ); } /* Reset stuff that's on a per-image basis */ im->depth = 0; im->vclass = 0; im->display_type = 0; im->ximage = 0; im->visual = 0; im->pixels = 0; im->pixmap = None; im->ximage = NULL; im->info = 0; im->win = None; im->gc = im->textgc = im->markergc = None; im->text = NULL; im->ntext = 0; im->marker = 0; im->nmarkers = 0; im->comments = NULL; im->comments_len = 0; return im; } /*************************************** ***************************************/ static void error_message( FL_IMAGE * im FL_UNUSED_ARG, const char * s ) { if ( s && *s ) M_err( 0, s ); } /*************************************** * A short cut for error message generating ***************************************/ void flimage_error( FL_IMAGE * im, const char * fmt, ... ) { va_list args; char buf[ 1024 ]; buf[ 0 ] = '\0'; if ( fmt && *fmt ) { va_start( args, fmt ); fli_vsnprintf( buf, sizeof buf, fmt, args ); va_end( args ); } im->error_message( im, buf ); } /*************************************** ***************************************/ void flimage_free_rgb( FL_IMAGE * im ) { fl_free_matrix( im->red ); fl_free_matrix( im->green ); fl_free_matrix( im->blue ); fl_free_matrix( im->alpha ); im->red = im->green = im->blue = im->alpha = NULL; im->available_type &= ~FL_IMAGE_RGB; } /*************************************** ***************************************/ void flimage_free_ci( FL_IMAGE * im ) { fl_free_matrix( im->ci ); im->ci = NULL; im->available_type = ~ FL_IMAGE_CI; } /*************************************** ***************************************/ void flimage_free_gray( FL_IMAGE * im ) { fl_free_matrix( im->gray ); im->gray = NULL; im->available_type = ~FL_IMAGE_GRAY; } /*************************************** * unpack packed bits into color indeces (0 or 1). len is the length * of packed bytes ***************************************/ void unpack_bits( unsigned short * out, unsigned char * in, int len ) { unsigned int mask = 0x80; for ( ; --len >= 0; out++, mask >>= 1 ) { if ( ! mask ) { in++; mask = 0x80; } *out = ( *in & mask ) != 0; } } /*************************************** * pack color index (0 or 1 ) into bytes. len is number of indeces ***************************************/ void pack_bits( unsigned char * out, unsigned short * in, int len) { int k = 0, bit = 0; for ( k = bit = 0; --len >= 0; in++ ) { k = ( k << 1 ) | *in; if ( ++bit == 8 ) { *out++ = k; k = bit = 0; } } /* left overs */ if ( bit ) { k <<= 8 - bit; *out++ = k; } } /*************************************** * default supported image formats ***************************************/ static void add_default_formats( void ) { if ( ! ppm_added ) { flimage_enable_pnm( ); flimage_enable_genesis( ); } if ( ! gzip_added ) flimage_enable_gzip( ); } /*************************************** * given a format, find the corresponding io handler ***************************************/ FLIMAGE_IO * flimage_find_imageIO( const char *fmt ) { FLIMAGE_IO *io = flimage_io; for ( ; io && io->formal_name; io++ ) { if ( ! strcmp( io->formal_name, fmt ) || ! strcmp( io->short_name, fmt ) || ! strcmp( io->extension, fmt ) ) return io; } return NULL; } /*************************************** * Annoation IO ***************************************/ static int write_marker( FLIMAGE_MARKER * m, FILE * fp ) { int r, g, b; fprintf( fp, "%s %d %d %d %d %d %d %d %d", m->name, m->x, m->y, m->w, m->h, m->fill, m->angle, m->thickness, m->style ); FL_UNPACK( m->color, r, g, b ); fprintf( fp, " %d %d %d", r, g, b ); FL_UNPACK( m->bcolor, r, g, b ); fprintf( fp, " %d %d %d\n", r, g, b ); return 0; } /*************************************** ***************************************/ static int read_marker( FLIMAGE_MARKER * m, FILE * fp ) { char buf[ 128 ]; static char name[ 64 ]; int r, g, b, br, bg, bb; if ( fgets( buf, sizeof buf - 1, fp ) ) buf[ sizeof buf - 1 ] = '\0'; else return -1; if ( sscanf( buf, "%63s %d %d %d %d %d %d %d %d %d %d %d %d %d %d", name, &m->x, &m->y, &m->w, &m->h, &m->fill, &m->angle, &m->thickness, &m->style, &r, &g, &b, &br, &bg, &bb ) == 15 ) { m->name = name; m->color = FL_PACK( r, g, b ); m->bcolor = FL_PACK( br, bg, bb ); return 0; } return -1; } #define LB '(' #define RB ')' static FLI_VN_PAIR fonts_vn[ ] = { { FL_NORMAL_STYLE, "Helvetica" }, { FL_ITALIC_STYLE, "Helvetica-Oblique" }, { FL_BOLD_STYLE, "Helvetica-Bold" }, { FL_BOLDITALIC_STYLE, " Helvetica-BoldOblique" }, { FL_FIXED_STYLE, "Courier" }, { FL_FIXEDBOLD_STYLE, "Courier-Bold" }, { FL_FIXEDITALIC_STYLE, "Courier-Oblique" }, { FL_FIXEDBOLDITALIC_STYLE, "Courier-BoldOblique" }, { FL_TIMES_STYLE, "Times-Roman" }, { FL_TIMESBOLD_STYLE, "Times-Bold" }, { FL_TIMESITALIC_STYLE, "Times-Oblique" }, { FL_TIMESBOLDITALIC_STYLE, "Times-BoldOblique" }, { FL_SYMBOL_STYLE, "Symbol" }, { FL_SHADOW_STYLE, "Shadow" }, { FL_ENGRAVED_STYLE, "Engraved" }, { FL_ENGRAVED_STYLE, "Enbossed" }, { -1, NULL } /* sentinel */ }; /*************************************** ***************************************/ static const char * get_font_style( int fstyle ) { static char retbuf[ 128 ]; const char *font_spstyle = "normal"; int spstyle = fstyle / FL_SHADOW_STYLE; int style = fstyle % FL_SHADOW_STYLE; strcpy( retbuf, fli_get_vn_name( fonts_vn, style ) ); if ( spstyle ) font_spstyle = fli_get_vn_name( fonts_vn, spstyle * FL_SHADOW_STYLE ); return strcat( strcat( retbuf, " " ), font_spstyle ); } static FLI_VN_PAIR align_vn[ ] = { { FL_ALIGN_CENTER, "center" }, { FL_ALIGN_TOP, "top" }, { FL_ALIGN_LEFT, "left" }, { FL_ALIGN_RIGHT, "right" }, { FL_ALIGN_LEFT_TOP, "lefttop" }, { FL_ALIGN_RIGHT_TOP, "righttop" }, { FL_ALIGN_LEFT_BOTTOM, "leftbottom" }, { FL_ALIGN_RIGHT_BOTTOM, "rightbottom" }, { -1, NULL } /* sentinel */ }; /*************************************** ***************************************/ static void write_text( FLIMAGE_TEXT * t, FILE * fp ) { int r, g, b; char *p; /* output string. */ putc( LB, fp ); for ( p = t->str; p && *p; p++ ) { if ( *p == RB ) putc( '\\', fp ); putc( *p, fp ); } putc( RB, fp ); fprintf( fp, " %s %d %d %d %s %d %d", get_font_style( t->style ), t->size, t->x, t->y, fli_get_vn_name( align_vn, t->align ), t->angle, t->nobk ); FL_UNPACK( t->color, r, g, b ); fprintf( fp, " %d %d %d", r, g, b ); FL_UNPACK( t->bcolor, r, g, b ); fprintf( fp, " %d %d %d\n", r, g, b ); } /*************************************** ***************************************/ static int read_text( FLIMAGE_TEXT * t, FILE * fp ) { char buf[ 1024 ], fnt[ 64 ], style[ 64 ], align[ 64 ]; static char name[ 512 ]; int r, g, b, br, bg, bb; char *p = buf + 1, *s = name, *ss = name + sizeof name - 1; if ( fgets( buf, sizeof buf - 1, fp ) ) buf[ sizeof buf - 1 ] = '\0'; else buf[ 0 ] = '\0'; for ( ; s < ss && *p && ( *p != ')' || *( p - 1 ) == '\\' ); p++ ) *s++ = *p; *s = '\0'; if ( sscanf( p + 1, "%63s %63s %d %d %d %63s %d %d %d %d %d %d %d %d", fnt, style, &t->size, &t->x, &t->y, align, &t->angle, &t->nobk, &r, &g, &b, &br, &bg, &bb ) == 14 ) { t->str = name; t->len = s - name; t->style = fli_get_vn_value( fonts_vn, fnt ); t->style |= fli_get_vn_value( fonts_vn, style ); t->align = fli_get_vn_value( align_vn, align ); t->color = FL_PACK( r, g, b ); t->bcolor = FL_PACK( br, bg, bb ); return 0; } return -1; } /*************************************** ***************************************/ static int skip_line( FILE * fp ) { int c; if ( ( c = getc( fp ) ) == '#' ) { while ( ( c = getc( fp ) ) != '\n' && c != EOF ) /* empty */ ; } else ungetc( c, fp ); return c == '#' && c != EOF; } /*************************************** ***************************************/ #define TEXTVERSION 1 #define MARKERVERSION 1 int flimage_write_annotation( FL_IMAGE * im ) { FILE *fp; int i; FLIMAGE_MARKER *m; FLIMAGE_TEXT *t; if ( !im || im->type == FL_IMAGE_NONE ) return -1; fp = im->fpout; /* write markers first */ if ( im->nmarkers ) { fprintf( fp, "\n###markers %d %d\n", im->nmarkers, MARKERVERSION ); fprintf( fp, "# name x y w h fill angle thick style r g b r g b\n" ); m = im->marker; for ( i = 0; i < im->nmarkers; i++, m++ ) write_marker( m, fp ); } if ( im->ntext ) { fprintf( fp, "###text %d %d\n", im->ntext, TEXTVERSION ); fprintf( fp, "# (s) font style size x y align angle nobk " "r g b r g b\n" ); t = im->text; for ( i = 0; i < im->ntext; i++, t++ ) write_text( t, fp ); } return 0; } /*************************************** ***************************************/ int flimage_read_annotation( FL_IMAGE * im ) { FILE *fp; FLIMAGE_MARKER m; FLIMAGE_TEXT t; int c, done, v, nmarkers, i, ntext; char buf[ 1024 ]; if ( ! im || im->type == FL_IMAGE_NONE ) return -1; fp = im->fpin; /* Load the markers */ for ( done = 0; ! done; /* empty */ ) { while ( ( c = getc( fp ) ) != EOF && c != '#' ) /* empty */ ; done = c == EOF; if ( fgets( buf, sizeof buf - 1, fp ) ) buf[ sizeof buf - 1 ] = '\0'; else buf[ 0 ] = '\0'; if ( strstr( buf, "#marker" ) ) { sscanf( buf, "%*s %d %d", &nmarkers, &v ); if ( v > MARKERVERSION ) M_err( "ReadMarker", "wrong version" ); for ( i = 0; i < nmarkers; i++ ) { while ( skip_line( fp ) ) /* empty */ ; if ( read_marker( &m, fp ) >= 0 ) flimage_add_marker_struct( im, &m ); } } if ( strstr( buf, "#text" ) ) { sscanf( buf, "%*s %d %d", &ntext, &v ); if ( v > TEXTVERSION ) M_err( "ReadText", "wrong version" ); for ( i = 0; i < ntext; i++ ) { while ( skip_line( fp ) ) /* empty */ ; if ( read_text( &t, fp) >= 0 ) flimage_add_text_struct( im, &t ); } done = 1; } } return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/matrix.c0000644000175000017500000000476312251675213012525 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1998-2002 T.C. Zhao * All rights reserved. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" /*************************************** ***************************************/ void * fl_get_matrix( int nrows, int ncols, unsigned int esize ) { char **mat; int i; if ( ! ( mat = fl_malloc( ( nrows + 1 ) * sizeof *mat ) ) ) return NULL; mat[ 0 ] = ( void * ) FL_GET_MATRIX; if ( ! ( mat[ 1 ] = fl_calloc( nrows * ncols, esize ) ) ) { fl_free( mat ); return NULL; } for ( i = 2; i <= nrows; i++ ) mat[ i ] = mat[ i - 1 ] + ncols * esize; return mat + 1; } /*************************************** * Given a piece of memory, make a matrix out of it ***************************************/ void * fl_make_matrix( int nrows, int ncols, unsigned int esize, void * mem ) { char **mat = fl_malloc( ( nrows + 1 ) * sizeof *mat ); int i; if ( ! mat ) return NULL; mat[ 0 ] = ( char * ) FL_MAKE_MATRIX; for ( mat[ 1 ] = mem, i = 2; i <= nrows; i++ ) mat[ i ] = mat[ i - 1 ] + ncols * esize; return mat + 1; } /*************************************** ***************************************/ void fl_free_matrix( void *p ) { char **matrix = p; if ( ! p ) return; if ( matrix[ -1 ] && matrix[ 0 ] ) { if ( matrix[ -1 ] == ( char * ) FL_GET_MATRIX ) fl_free( matrix[ 0 ] ); fl_free( matrix - 1 ); } } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_text.c0000664000175000017500000001104012353623325013333 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1998-2002 T.C. Zhao * All rights reserved. * * Handling image annotation (text) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "flimage.h" #include "flimage_int.h" #include static void display_text( FL_IMAGE * im ); /*************************************** ***************************************/ int flimage_add_text( FL_IMAGE * im, const char * str, int len, int style, int size, unsigned int tcol, unsigned int bcol, int tran, double tx, double ty, int rot ) { FLIMAGE_TEXT *text; if ( ! str || ! *str || ! len || ! size || ! im ) return -1; im->text = fl_realloc( im->text, ( im->ntext + 1 ) * sizeof *im->text ); if ( ! im->text ) { flimage_error( im, "AddText: malloc failed" ); return -1; } text = im->text + im->ntext; memset( text, 0, sizeof *text ); text->str = fl_strdup( str ); text->len = len; text->angle = rot; text->size = size; text->style = style; text->color = tcol; text->bcolor = bcol; text->nobk = tran; text->x = im->xdist_offset + tx * im->xdist_scale; text->y = im->ydist_offset + ty * im->ydist_scale; im->free_text = flimage_delete_all_text; im->display_text = display_text; return ++im->ntext; } /*************************************** ***************************************/ int flimage_add_text_struct( FL_IMAGE * im, const FLIMAGE_TEXT * txt ) { FLIMAGE_TEXT *text; if ( ! txt || ! im || ! txt->str ) return -1; if ( txt->len <= 0 ) { flimage_error( im, "AddTextStruct: bad text length (%d)", txt->len ); return -1; } im->text = fl_realloc( im->text, ( im->ntext + 1 ) * sizeof *im->text ); if ( ! im->text) return -1; text = im->text + im->ntext; memcpy( text, txt, sizeof *text ); text->str = fl_malloc( txt->len + 1 ); memcpy( text->str, txt->str, txt->len ); text->str[ txt->len ] = '\0'; im->free_text = flimage_delete_all_text; im->display_text = display_text; return ++im->ntext; } /*************************************** ***************************************/ void flimage_delete_all_text( FL_IMAGE * im ) { int i; if ( ! im || ! im->ntext || ! im->text ) return; for ( i = 0; i < im->ntext; i++ ) fl_free( im->text[ i ].str ); fl_free( im->text ); im->ntext = 0; im->text = 0; } /*************************************** ***************************************/ static void display_text( FL_IMAGE * im ) { FLIMAGE_TEXT *t, *tend; FLI_TARGET target; if ( im->dont_display_text || im->ntext == 0 ) return; if ( ! im->textgc ) im->textgc = XCreateGC( im->xdisplay, im->win, 0, 0 ); memcpy( &target, fli_internal_init( ), sizeof target ); target.display = im->xdisplay; target.win = im->win; target.isRGBColor = 1; target.textgc = im->textgc; target.gc = im->gc; fli_switch_target( &target ); for ( t = im->text, tend = t + im->ntext; t < tend; t++ ) fli_draw_text_inside (t->align, t->x + im->wxd - im->sxd -1, t->y + im->wyd - im->syd -1, 2, 2, t->str, t->style, t->size, t->color, t->bcolor, ! t->nobk ); fli_restore_target( ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_png.c0000644000175000017500000000507712251675264013154 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1993, 1998-2002 By T.C. Zhao * All rights reserved. * * TODO: png should be implemented in real code */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" /*************************************** ***************************************/ static int PNG_identify( FILE * fp ) { char buf[ 9 ]; static unsigned char sig[ 9 ] = { 137, 80, 78, 71, 13, 10, 26, 10 }; if ( fread( buf, 1, 8, fp ) != 8 ) return 0; return strncmp( ( char * ) sig, buf, 8 ) == 0; } /*************************************** ***************************************/ static int PNG_description( FL_IMAGE * im ) { int status; static char *cmds[] = { "pngtopnm %s > %s", NULL }; status = flimage_description_via_filter( im, cmds, "reading png ...", 1 ); return status; } /*************************************** ***************************************/ static int PNG_load( FL_IMAGE * im FL_UNUSED_ARG ) { fprintf( stderr, "should never been here\n" ); return -1; } /*************************************** ***************************************/ static int PNG_dump( FL_IMAGE * im ) { char *cmds[ ] = { "pnmtopng %s > %s", NULL }; char *formats[ ] = { "ppm", "pgm", "pbm", NULL }; return flimage_write_via_filter( im, cmds, formats, 1 ); } /*************************************** ***************************************/ void flimage_enable_png( void ) { flimage_add_format( "Portable Network Graphics", "png", "png", FL_IMAGE_RGB | FL_IMAGE_GRAY, PNG_identify, PNG_description, PNG_load, PNG_dump); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_xbm.c0000644000175000017500000001220712251675223013142 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1993, 1998-2002 By T.C. Zhao * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" #include /*************************************** ***************************************/ static int XBM_identify( FILE * fp ) { int n = 3; char buf[ 128 ]; while ( --n >= 0 && fgets( buf, sizeof buf - 1, fp ) ) { if ( strstr( buf, "#define" ) && strstr( buf, "_width " ) ) { rewind( fp ); return 1; } } return -1; } /*************************************** ***************************************/ static int XBM_description( FL_IMAGE * im ) { char tmpstr[ 256 ]; int w = -1, h = -1, no_size = 1, c; while ( no_size && fgets( tmpstr, sizeof tmpstr, im->fpin ) ) { if ( sscanf( tmpstr, "#define %*s %d", &c ) == 1 ) { if ( strstr( tmpstr, "_width" ) ) w = c; else if ( strstr( tmpstr, "_height" ) ) h = c; no_size = w < 1 || h < 1; } } if ( no_size ) { im->error_message( im, "can't get xbm size" ); return -1; } im->w = w; im->h = h; im->map_len = 2; /* skip until we get brace */ while ( ( h = getc( im->fpin ) ) != EOF && h != '{' ) /* } VI */ /* empty */ ; return h == EOF ? EOF : 0; } /*************************************** ***************************************/ static int XBM_load( FL_IMAGE * im ) { int c, ct, i, j, err; unsigned short *bits; /* populate the colormap */ im->red_lut[ 0 ] = im->green_lut[ 0 ] = im->blue_lut[ 0 ] = FL_PCMAX; im->red_lut[ 1 ] = im->green_lut[ 1 ] = im->blue_lut[ 1 ] = 0; for ( j = err = c = 0; j < im->h && !err; j++ ) { bits = im->ci[ j ]; im->completed = j + 1; for (i = ct = 0; i < im->w && !err; i++, ct = ( ct + 1 ) & 7, c >>= 1 ) { if ( ! ct ) err = ( c = fli_readhexint( im->fpin ) ) < 0; *bits++ = c & 1; } } if ( err ) { im->error_message( im, "Junk in hex stream" ); } return j > im->h / 2 ? j : -1; } /*************************************** ***************************************/ static int XBM_write( FL_IMAGE * im ) { char tmpstr[ 256 ], *p; unsigned short *bits; int nbits, k, len, i, j; FILE *fp = im->fpout; strncpy( tmpstr, im->outfile, sizeof tmpstr - 25 ); tmpstr[ sizeof tmpstr - 25 ] = '\0'; if ( ( p = strchr( tmpstr, '.' ) )) *p = '\0'; if ( isdigit( ( int ) tmpstr[ 0 ] ) ) tmpstr[ 0 ] = 'a'; fprintf( fp, "#define %s_width %d\n#define %s_height %d\n", tmpstr, im->w, tmpstr, im->h ); fprintf( fp, "static char %s_bits[] = {\n ", tmpstr ); for ( j = 0, len = 1; j < im->h; j++ ) { bits = im->ci[ j]; im->completed = j; for ( i = nbits = k = 0; i < im->w; i++, bits++ ) { k = k >> 1; if ( *bits ) k |= 0x80; if ( ++nbits == 8 ) { fprintf( fp, "0x%02x", k &= 0xf ); if ( j != im->h - 1 || i != im->w - 1 ) putc( ',', fp ); if ( ( len += 5 ) > 70 ) { fprintf( fp, "\n " ); len = 1; } nbits = k = 0; } } /* check for possible padding */ if ( nbits ) { k >>= 8 - nbits; fprintf( fp, "0x%02x", k &= 0xff ); if ( j != im->h - 1 ) putc( ',', fp ); if ( ( len += 5 ) > 70 ) { fprintf( fp, "\n " ); len = 1; } } } fputs( "};\n", fp ); return fflush( fp ); } /*************************************** ***************************************/ void flimage_enable_xbm( void ) { flimage_add_format( "X11 Bitmap", "xbm", "xbm", FL_IMAGE_MONO, XBM_identify, XBM_description, XBM_load, XBM_write ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_jquant.c0000644000175000017500000013020512251675271013660 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * Copyright (C) 1991-1996, Thomas G. Lane. * This file is part of the XForms library package. * * The 2-pass quantizer from the JPEG distribution by the * Independent JPEG group. Except for minor interface changes, the code * here is almost verbatim copy of the IJG's code, which * has the following copyright: */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" /*************************************** ***************************************/ void fl_select_mediancut_quantizer( void ) { flimage_quantize_rgb = j2pass_quantize_rgb; flimage_quantize_packed = j2pass_quantize_packed; } #define R_SCALE 2 /* scale R distances by this much */ #define G_SCALE 3 /* scale G distances by this much */ #define B_SCALE 1 /* and B by this much */ #define C0_SCALE R_SCALE #define C1_SCALE G_SCALE #define C2_SCALE B_SCALE #define BITS_IN_JSAMPLE FL_PCBITS #define MAXJSAMPLE ( ( 1<fserrors ) fl_free( sp->fserrors ); if ( sp->error_limiter ) fl_free( sp->error_limiter - MAXJSAMPLE ); sp->error_limiter = NULL; sp->fserrors = NULL; if ( sp->histogram ) { int i; for ( i = 0; i < HIST_C0_ELEMS; i++ ) { if ( sp->histogram[ i ] ) fl_free( sp->histogram[ i ] ); sp->histogram[ i ] = NULL; } } fl_free( sp->histogram ); sp->histogram = NULL; fl_free( sp ); } /*************************************** ***************************************/ static SPEC * alloc_spec( int w, int h FL_UNUSED_ARG, int * rlut, int * glut, int * blut ) { int fs_size = ( w + 2 ) * ( 3 * sizeof( FSERROR ) ), i; SPEC *sp = fl_calloc( 1, sizeof *sp ); int err = ! sp; if ( ! err ) init_error_limit( sp ); err = err || ! ( sp->fserrors = fl_calloc( 1, fs_size ) ); err = err || ! ( sp->histogram = fl_calloc( 1, HIST_C0_ELEMS * sizeof( hist2d ) ) ); for ( i = 0; ! err && i < HIST_C0_ELEMS; i++ ) err = ! ( sp->histogram[ i ] = fl_calloc( 1, HIST_C1_ELEMS * HIST_C2_ELEMS * sizeof( histcell ) ) ); if ( err ) { cleanup_spec( sp ); sp = NULL; } else { sp->colormap[ 0 ] = rlut; sp->colormap[ 1 ] = glut; sp->colormap[ 2 ] = blut; } return sp; } /*************************************** ***************************************/ int j2pass_quantize_rgb( unsigned char ** red, unsigned char ** green, unsigned char ** blue, int w, int h, int max_color, unsigned short ** ci, int * actual_color, int * red_lut, int * green_lut, int * blue_lut, FL_IMAGE * im ) { SPEC *sp = alloc_spec( w, h, red_lut, green_lut, blue_lut ); int i; if ( ! sp ) { *actual_color = 0; if ( im ) im->error_message( im, "Failed to allocate working memory" ); return -1; } if ( *actual_color > 256 ) *actual_color = 256; sp->im = im; /* get histogram */ prescan_quantize( sp, red, green, blue, w, h ); select_colors( sp, max_color ); /* re-init histogram for inverse lookup */ for ( i = 0; i < HIST_C0_ELEMS; i++ ) memset( sp->histogram[ i ], 0, HIST_C1_ELEMS * HIST_C2_ELEMS * sizeof( histcell ) ); sp->on_odd_row = 0; pass2_fs_dither( sp, red, green, blue, ci, w, h ); *actual_color = sp->actual_number_of_colors; cleanup_spec( sp ); if ( im ) { im->completed = im->h; im->visual_cue( im, "Quantization Done" ); } return 0; } /*************************************** ***************************************/ int j2pass_quantize_packed( unsigned int ** packed, int w, int h, int max_color, unsigned short ** ci, int * actual_color, int * red_lut, int * green_lut, int * blue_lut, FL_IMAGE * im ) { SPEC *sp = alloc_spec( w, h, red_lut, green_lut, blue_lut ); unsigned char **red = NULL, **green = NULL, **blue = NULL; int i, err; if ( ! sp ) { if ( im ) im->error_message( im, "Quantize: can't allocate memory" ); *actual_color = 0; return -1; } sp->im = im; /* we can process the image one piece a time to avoid the heavy memory usage, but packed is not that common. For now, do it in one chunk */ err = ! ( red = fl_get_matrix( h, w, sizeof **red ) ) || ! ( green = fl_get_matrix( h, w, sizeof **green ) ) || ! ( blue = fl_get_matrix( h, w, sizeof **blue ) ); if ( err ) { const char *s = "Quantize: can't allocate memory"; if ( im ) im->error_message( im, s ); else fprintf( stderr, "%s\n", s ); fl_free_matrix( red ); fl_free_matrix( green ); fl_free_matrix( blue ); return -1; } for ( i = w * h; --i >= 0; ) FL_UNPACK( packed[ 0 ][ i ], red[ 0 ][ i ], green[ 0 ][ i ], blue[ 0 ][ i ]); /* get histogram */ prescan_quantize( sp, red, green, blue, w, h ); select_colors( sp, max_color ); /* re-init histogram for inverse lookup */ for ( i = 0; i < HIST_C0_ELEMS; i++ ) memset( sp->histogram[ i ], 0, HIST_C1_ELEMS * HIST_C2_ELEMS * sizeof( histcell ) ); sp->on_odd_row = 0; pass2_fs_dither( sp, red, green, blue, ci, w, h ); *actual_color = sp->actual_number_of_colors; fl_free_matrix( red ); fl_free_matrix( green ); fl_free_matrix( blue ); cleanup_spec( sp ); if ( im ) { im->completed = im->h; im->visual_cue( im, "Quantization Done" ); } return 0; } /* log2(histogram cells in update box) for each axis; this can be adjusted */ #define BOX_C0_LOG ( HIST_C0_BITS - 3 ) #define BOX_C1_LOG ( HIST_C1_BITS - 3 ) #define BOX_C2_LOG ( HIST_C2_BITS - 3 ) #define BOX_C0_ELEMS ( 1 << BOX_C0_LOG ) /* # of hist cells in update box */ #define BOX_C1_ELEMS ( 1 << BOX_C1_LOG ) #define BOX_C2_ELEMS ( 1 << BOX_C2_LOG ) #define BOX_C0_SHIFT ( C0_SHIFT + BOX_C0_LOG ) #define BOX_C1_SHIFT ( C1_SHIFT + BOX_C1_LOG ) #define BOX_C2_SHIFT ( C2_SHIFT + BOX_C2_LOG ) /*************************************** * Locate the colormap entries close enough to an update box to be candidates * for the nearest entry to some cell(s) in the update box. The update box * is specified by the center coordinates of its first cell. The number of * candidate colormap entries is returned, and their colormap indexes are * placed in colorlist[]. * This routine uses Heckbert's "locally sorted search" criterion to select * the colors that need further consideration. ***************************************/ static int find_nearby_colors( SPEC * sp, int minc0, int minc1, int minc2, JSAMPLE colorlist[ ] ) { int numcolors = sp->actual_number_of_colors; int maxc0, maxc1, maxc2; int centerc0, centerc1, centerc2; int i, x, ncolors; int minmaxdist, min_dist, max_dist, tdist; int mindist[ MAXNUMCOLORS ]; /* min distance to colormap entry i */ /* Compute true coordinates of update box's upper corner and center. * Actually we compute the coordinates of the center of the upper-corner * histogram cell, which are the upper bounds of the volume we care about. * Note that since ">>" rounds down, the "center" values may be closer to * min than to max; hence comparisons to them must be "<=", not "<". */ maxc0 = minc0 + ( ( 1 << BOX_C0_SHIFT ) - ( 1 << C0_SHIFT ) ); centerc0 = ( minc0 + maxc0 ) >> 1; maxc1 = minc1 + ( ( 1 << BOX_C1_SHIFT ) - ( 1 << C1_SHIFT ) ); centerc1 = ( minc1 + maxc1 ) >> 1; maxc2 = minc2 + ( ( 1 << BOX_C2_SHIFT ) - ( 1 << C2_SHIFT ) ); centerc2 = ( minc2 + maxc2 ) >> 1; /* For each color in colormap, find: 1. its minimum squared-distance to any point in the update box (zero if color is within update box) 2. its maximum squared-distance to any point in the update box. Both of these can be found by considering only the corners of the box. We save the minimum distance for each color in mindist[]; only the smallest maximum distance is of interest. */ minmaxdist = 0x7FFFFFFFL; for ( i = 0; i < numcolors; i++ ) { /* We compute the squared-c0-distance term, then add in the other two. */ x = sp->colormap[ 0 ][ i ]; if ( x < minc0 ) { tdist = ( x - minc0 ) * C0_SCALE; min_dist = tdist * tdist; tdist = ( x - maxc0 ) * C0_SCALE; max_dist = tdist * tdist; } else if ( x > maxc0 ) { tdist = ( x - maxc0 ) * C0_SCALE; min_dist = tdist * tdist; tdist = ( x - minc0 ) * C0_SCALE; max_dist = tdist * tdist; } else { /* within cell range so no contribution to min_dist */ min_dist = 0; if ( x <= centerc0 ) { tdist = ( x - maxc0 ) * C0_SCALE; max_dist = tdist * tdist; } else { tdist = ( x - minc0 ) * C0_SCALE; max_dist = tdist * tdist; } } x = sp->colormap[ 1 ][ i ]; if ( x < minc1 ) { tdist = ( x - minc1 ) * C1_SCALE; min_dist += tdist * tdist; tdist = ( x - maxc1 ) * C1_SCALE; max_dist += tdist * tdist; } else if ( x > maxc1 ) { tdist = ( x - maxc1 ) * C1_SCALE; min_dist += tdist * tdist; tdist = (x - minc1 ) * C1_SCALE; max_dist += tdist * tdist; } else { /* within cell range so no contribution to min_dist */ if ( x <= centerc1 ) { tdist = ( x - maxc1 ) * C1_SCALE; max_dist += tdist * tdist; } else { tdist = ( x - minc1 ) * C1_SCALE; max_dist += tdist * tdist; } } x = sp->colormap[ 2 ][ i ]; if ( x < minc2 ) { tdist = ( x - minc2 ) * C2_SCALE; min_dist += tdist * tdist; tdist = ( x - maxc2 ) * C2_SCALE; max_dist += tdist * tdist; } else if ( x > maxc2 ) { tdist = ( x - maxc2 ) * C2_SCALE; min_dist += tdist * tdist; tdist = ( x - minc2 ) * C2_SCALE; max_dist += tdist * tdist; } else { /* within cell range so no contribution to min_dist */ if ( x <= centerc2 ) { tdist = ( x - maxc2 ) * C2_SCALE; max_dist += tdist * tdist; } else { tdist = ( x - minc2 ) * C2_SCALE; max_dist += tdist * tdist; } } mindist[ i ] = min_dist; /* save away the results */ if ( max_dist < minmaxdist ) minmaxdist = max_dist; } /* Now we know that no cell in the update box is more than minmaxdist * away from some colormap entry. Therefore, only colors that are * within minmaxdist of some part of the box need be considered. */ ncolors = 0; for ( i = 0; i < numcolors; i++ ) if ( mindist[ i ] <= minmaxdist ) colorlist[ ncolors++ ] = ( JSAMPLE ) i; return ncolors; } /*************************************** * Find the closest colormap entry for each cell in the update box, * given the list of candidate colors prepared by find_nearby_colors. * Return the indexes of the closest entries in the bestcolor[] array. * This routine uses Thomas' incremental distance calculation method to * find the distance from a colormap entry to successive cells in the box. ***************************************/ static void find_best_colors( SPEC * sp, int minc0, int minc1, int minc2, int numcolors, JSAMPLE colorlist[ ], JSAMPLE bestcolor[ ] ) { int ic0, ic1, ic2; int i, icolor; int *bptr; /* pointer into bestdist[] array */ JSAMPLE *cptr; /* pointer into bestcolor[] array */ int dist0, dist1; /* initial distance values */ int dist2; /* current distance in inner loop */ int xx0, xx1; /* distance increments */ int xx2; int inc0, inc1, inc2; /* initial values for increments */ /* This array holds the distance to the nearest-so-far color for each cell */ int bestdist[ BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS ]; /* Initialize best-distance for each cell of the update box */ bptr = bestdist; for ( i = BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS - 1; i >= 0; i-- ) *bptr++ = 0x7FFFFFFFL; /* For each color selected by find_nearby_colors, * compute its distance to the center of each cell in the box. * If that's less than best-so-far, update best distance and color number. */ /* Nominal steps between cell centers ("x" in Thomas article) */ #define STEP_C0 ( ( 1 << C0_SHIFT ) * C0_SCALE ) #define STEP_C1 ( ( 1 << C1_SHIFT ) * C1_SCALE ) #define STEP_C2 ( ( 1 << C2_SHIFT ) * C2_SCALE ) for ( i = 0; i < numcolors; i++ ) { icolor = GETJSAMPLE( colorlist[ i ] ); /* Compute (square of) distance from minc0/c1/c2 to this color */ inc0 = ( minc0 - GETJSAMPLE( sp->colormap[ 0 ][ icolor] ) ) * C0_SCALE; dist0 = inc0 * inc0; inc1 = ( minc1 - GETJSAMPLE( sp->colormap[ 1 ][ icolor ] ) ) * C1_SCALE; dist0 += inc1 * inc1; inc2 = ( minc2 - GETJSAMPLE( sp->colormap[ 2 ][ icolor ] ) ) * C2_SCALE; dist0 += inc2 * inc2; /* Form the initial difference increments */ inc0 = inc0 * 2 * STEP_C0 + STEP_C0 * STEP_C0; inc1 = inc1 * 2 * STEP_C1 + STEP_C1 * STEP_C1; inc2 = inc2 * 2 * STEP_C2 + STEP_C2 * STEP_C2; /* Now loop over all cells in box, updating distance per Thomas method */ bptr = bestdist; cptr = bestcolor; xx0 = inc0; for ( ic0 = BOX_C0_ELEMS - 1; ic0 >= 0; ic0-- ) { dist1 = dist0; xx1 = inc1; for ( ic1 = BOX_C1_ELEMS - 1; ic1 >= 0; ic1-- ) { dist2 = dist1; xx2 = inc2; for ( ic2 = BOX_C2_ELEMS - 1; ic2 >= 0; ic2-- ) { if ( dist2 < *bptr ) { *bptr = dist2; *cptr = ( JSAMPLE ) icolor; } dist2 += xx2; xx2 += 2 * STEP_C2 * STEP_C2; bptr++; cptr++; } dist1 += xx1; xx1 += 2 * STEP_C1 * STEP_C1; } dist0 += xx0; xx0 += 2 * STEP_C0 * STEP_C0; } } } /*************************************** * Fill the inverse-colormap entries in the update box that contains * histogram cell c0/c1/c2. (Only that one cell MUST be filled, but * we can fill as many others as we wish.) ***************************************/ static void fill_inverse_cmap( SPEC * cquantize, int c0, int c1, int c2 ) { hist3d histogram = cquantize->histogram; int minc0, minc1, minc2; /* lower left corner of update box */ int ic0, ic1, ic2; JSAMPLE *cptr; /* pointer into bestcolor[] array */ histptr cachep; /* pointer into main cache array */ /* This array lists the candidate colormap indexes. */ JSAMPLE colorlist[ MAXNUMCOLORS ]; int numcolors; /* number of candidate colors */ /* This array holds the actually closest colormap index for each cell. */ JSAMPLE bestcolor[ BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS ]; /* Convert cell coordinates to update box ID */ c0 >>= BOX_C0_LOG; c1 >>= BOX_C1_LOG; c2 >>= BOX_C2_LOG; /* Compute true coordinates of update box's origin corner. * Actually we compute the coordinates of the center of the corner * histogram cell, which are the lower bounds of the volume we care about. */ minc0 = ( c0 << BOX_C0_SHIFT ) + ( ( 1 << C0_SHIFT ) >> 1 ); minc1 = ( c1 << BOX_C1_SHIFT ) + ( ( 1 << C1_SHIFT ) >> 1 ); minc2 = ( c2 << BOX_C2_SHIFT ) + ( ( 1 << C2_SHIFT ) >> 1 ); /* Determine which colormap entries are close enough to be candidates * for the nearest entry to some cell in the update box. */ numcolors = find_nearby_colors( cquantize, minc0, minc1, minc2, colorlist ); /* Determine the actually nearest colors. */ find_best_colors( cquantize, minc0, minc1, minc2, numcolors, colorlist, bestcolor ); /* Save the best color numbers (plus 1) in the main cache array */ c0 <<= BOX_C0_LOG; /* convert ID back to base cell indexes */ c1 <<= BOX_C1_LOG; c2 <<= BOX_C2_LOG; cptr = bestcolor; for ( ic0 = 0; ic0 < BOX_C0_ELEMS; ic0++ ) { for ( ic1 = 0; ic1 < BOX_C1_ELEMS; ic1++ ) { cachep = &histogram[ c0 + ic0 ][ c1 + ic1 ][ c2 ]; for ( ic2 = 0; ic2 < BOX_C2_ELEMS; ic2++ ) *cachep++ = ( histcell ) ( GETJSAMPLE( *cptr++ ) + 1 ); } } } #define RIGHT_SHIFT( x, shft) ( ( x ) >> ( shft ) ) /*************************************** * This version performs Floyd-Steinberg dithering ***************************************/ static void pass2_fs_dither( SPEC * sp, unsigned char ** red, unsigned char ** green, unsigned char ** blue, unsigned short ** output_buf, int width, int num_rows ) { hist3d histogram = sp->histogram; LOCFSERROR cur0, cur1, cur2; /* current error or pixel value */ LOCFSERROR belowerr0, belowerr1, belowerr2; /* error for pixel below cur */ LOCFSERROR bpreverr0, bpreverr1, bpreverr2; /* error for below/prev col */ FSERRPTR errorptr; /* => fserrors[] at column before current */ unsigned short *outptr; /* => current output pixel */ histptr cachep; int dir; /* +1 or -1 depending on direction */ int dir3; /* 3*dir, for advancing inptr & errorptr */ int row; int col; int *error_limit = sp->error_limiter; int *colormap0 = sp->colormap[0]; int *colormap1 = sp->colormap[1]; int *colormap2 = sp->colormap[2]; unsigned char *r, *g, *b; if ( sp->im ) { sp->im->completed = -1; sp->im->visual_cue( sp->im, "Dithering ..." ); } for ( row = 0; row < num_rows; row++ ) { r = red[ row ]; g = green[ row ]; b = blue[ row ]; outptr = output_buf[ row ]; if ( sp->on_odd_row ) { /* work right to left in this row */ r += width - 1; g += width - 1; b += width - 1; outptr += width - 1; dir = -1; dir3 = -3; errorptr = sp->fserrors + (width + 1 ) * 3; /* => entry after last column */ sp->on_odd_row = 0; /* flip for next time */ } else { /* work left to right in this row */ dir = 1; dir3 = 3; errorptr = sp->fserrors; /* => entry before first real column */ sp->on_odd_row = 1; /* flip for next time */ } /* Preset error values: no error propagated to first pixel from left */ cur0 = cur1 = cur2 = 0; /* and no error propagated to row below yet */ belowerr0 = belowerr1 = belowerr2 = 0; bpreverr0 = bpreverr1 = bpreverr2 = 0; for ( col = 0; col < width; col++ ) { /* curN holds the error propagated from the previous pixel on the current line. Add the error propagated from the previous line * to form the complete error correction term for this pixel, and * round the error term (which is expressed * 16) to an integer. * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct * for either sign of the error value. * Note: errorptr points to *previous* column's array entry. */ cur0 = RIGHT_SHIFT( cur0 + errorptr[ dir3 + 0 ] + 8, 4 ); cur1 = RIGHT_SHIFT( cur1 + errorptr[ dir3 + 1 ] + 8, 4 ); cur2 = RIGHT_SHIFT( cur2 + errorptr[ dir3 + 2 ] + 8, 4 ); /* Limit the error using transfer function set by init_error_limit. See comments with init_error_limit for rationale. */ cur0 = error_limit[ cur0 ]; cur1 = error_limit[ cur1 ]; cur2 = error_limit[ cur2 ]; /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE. The maximum error is +- MAXJSAMPLE (or less with error limiting); this sets the required size of the range_limit array. */ cur0 += *r; cur1 += *g; cur2 += *b; cur0 = FL_PCCLAMP( cur0 ); cur1 = FL_PCCLAMP( cur1 ); cur2 = FL_PCCLAMP( cur2 ); /* Index into the cache with adjusted pixel value */ cachep = &histogram[ cur0 >> C0_SHIFT ][ cur1 >> C1_SHIFT ][ cur2 >> C2_SHIFT ]; /* If we have not seen this color before, find nearest colormap */ /* entry and update the cache */ if ( *cachep == 0 ) fill_inverse_cmap( sp, cur0 >> C0_SHIFT, cur1 >> C1_SHIFT, cur2 >> C2_SHIFT ); /* Now emit the colormap index for this cell */ { int pixcode = *cachep - 1; *outptr = ( JSAMPLE ) pixcode; /* Compute representation error for this pixel */ cur0 -= colormap0[ pixcode ]; cur1 -= colormap1[ pixcode ]; cur2 -= colormap2[ pixcode ]; } /* Compute error fractions to be propagated to adjacent pixels. * Add these into the running sums, and simultaneously shift the * next-line error sums left by 1 column. */ { LOCFSERROR bnexterr, delta; bnexterr = cur0; /* Process component 0 */ delta = cur0 * 2; cur0 += delta; /* form error * 3 */ errorptr[ 0 ] = ( FSERROR ) ( bpreverr0 + cur0 ); cur0 += delta; /* form error * 5 */ bpreverr0 = belowerr0 + cur0; belowerr0 = bnexterr; cur0 += delta; /* form error * 7 */ bnexterr = cur1; /* Process component 1 */ delta = cur1 * 2; cur1 += delta; /* form error * 3 */ errorptr[ 1 ] = ( FSERROR ) ( bpreverr1 + cur1 ); cur1 += delta; /* form error * 5 */ bpreverr1 = belowerr1 + cur1; belowerr1 = bnexterr; cur1 += delta; /* form error * 7 */ bnexterr = cur2; /* Process component 2 */ delta = cur2 * 2; cur2 += delta; /* form error * 3 */ errorptr[ 2 ] = ( FSERROR ) ( bpreverr2 + cur2 ); cur2 += delta; /* form error * 5 */ bpreverr2 = belowerr2 + cur2; belowerr2 = bnexterr; cur2 += delta; /* form error * 7 */ } /* At this point curN contains the 7/16 error value to be propagated to the next pixel on the current line, and all the errors for the next line have been shifted over. We are therefore ready to move on. */ r += dir; g += dir; b += dir; outptr += dir; errorptr += dir3; /* advance errorptr to current column */ } /* Post-loop cleanup: we must unload the final error values into the final fserrors[] entry. Note we need not unload belowerrN because * it is for the dummy column before or after the actual array. */ errorptr[ 0 ] = ( FSERROR ) bpreverr0; /* unload prev errs into array */ errorptr[ 1 ] = ( FSERROR ) bpreverr1; errorptr[ 2 ] = ( FSERROR ) bpreverr2; } if( sp->im ) { sp->im->completed = sp->im->total = sp->im->h; sp->im->visual_cue( sp->im, "Dithering done" ); } } /*************************************** * Shrink the min/max bounds of a box to enclose only nonzero elements, * and recompute its volume and population ***************************************/ static void update_box( SPEC * sp, boxptr boxp ) { hist3d histogram = sp->histogram; histptr histp; int c0, c1, c2; int c0min, c0max, c1min, c1max, c2min, c2max; int dist0, dist1, dist2; long ccount; c0min = boxp->c0min; c0max = boxp->c0max; c1min = boxp->c1min; c1max = boxp->c1max; c2min = boxp->c2min; c2max = boxp->c2max; if ( c0max > c0min ) for ( c0 = c0min; c0 <= c0max; c0++ ) for ( c1 = c1min; c1 <= c1max; c1++) { histp = &histogram[ c0 ][ c1 ][ c2min ]; for ( c2 = c2min; c2 <= c2max; c2++ ) if ( *histp++ != 0 ) { boxp->c0min = c0min = c0; goto have_c0min; } } have_c0min: if ( c0max > c0min ) for ( c0 = c0max; c0 >= c0min; c0-- ) for ( c1 = c1min; c1 <= c1max; c1++ ) { histp = &histogram[ c0 ][ c1 ][ c2min ]; for ( c2 = c2min; c2 <= c2max; c2++ ) if ( *histp++ != 0 ) { boxp->c0max = c0max = c0; goto have_c0max; } } have_c0max: if ( c1max > c1min ) for ( c1 = c1min; c1 <= c1max; c1++ ) for ( c0 = c0min; c0 <= c0max; c0++ ) { histp = &histogram[ c0 ][ c1 ][ c2min ]; for ( c2 = c2min; c2 <= c2max; c2++ ) if ( *histp++ != 0 ) { boxp->c1min = c1min = c1; goto have_c1min; } } have_c1min: if ( c1max > c1min ) for ( c1 = c1max; c1 >= c1min; c1-- ) for ( c0 = c0min; c0 <= c0max; c0++ ) { histp = &histogram[ c0 ][ c1 ][ c2min ]; for ( c2 = c2min; c2 <= c2max; c2++ ) if ( *histp++ != 0 ) { boxp->c1max = c1max = c1; goto have_c1max; } } have_c1max: if ( c2max > c2min ) for ( c2 = c2min; c2 <= c2max; c2++ ) for ( c0 = c0min; c0 <= c0max; c0++ ) { histp = &histogram[ c0 ][ c1min ][ c2 ]; for ( c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS ) if ( *histp != 0 ) { boxp->c2min = c2min = c2; goto have_c2min; } } have_c2min: if ( c2max > c2min ) for ( c2 = c2max; c2 >= c2min; c2-- ) for ( c0 = c0min; c0 <= c0max; c0++ ) { histp = &histogram[ c0 ][ c1min ][ c2 ]; for ( c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS ) if ( *histp != 0 ) { boxp->c2max = c2max = c2; goto have_c2max; } } have_c2max: /* Update box volume. * We use 2-norm rather than real volume here; this biases the method * against making long narrow boxes, and it has the side benefit that * a box is splittable iff norm > 0. * Since the differences are expressed in histogram-cell units, * we have to shift back to JSAMPLE units to get consistent distances; * after which, we scale according to the selected distance scale factors. */ dist0 = ( ( c0max - c0min ) << C0_SHIFT ) * C0_SCALE; dist1 = ( ( c1max - c1min ) << C1_SHIFT ) * C1_SCALE; dist2 = ( ( c2max - c2min ) << C2_SHIFT ) * C2_SCALE; boxp->volume = dist0 * dist0 + dist1 * dist1 + dist2 * dist2; /* Now scan remaining volume of box and compute population */ ccount = 0; for ( c0 = c0min; c0 <= c0max; c0++ ) for ( c1 = c1min; c1 <= c1max; c1++ ) { histp = &histogram[ c0 ][ c1 ][ c2min ]; for ( c2 = c2min; c2 <= c2max; c2++, histp++ ) if ( *histp != 0 ) ccount++; } boxp->colorcount = ccount; } /*************************************** * Find the splittable box with the largest color population * Returns NULL if no splittable boxes remain ***************************************/ static boxptr find_biggest_color_pop( boxptr boxlist, int numboxes ) { boxptr boxp; int i; long maxc = 0; boxptr which = NULL; for ( i = 0, boxp = boxlist; i < numboxes; i++, boxp++ ) if ( boxp->colorcount > maxc && boxp->volume > 0 ) { which = boxp; maxc = boxp->colorcount; } return which; } /*************************************** * Find the splittable box with the largest (scaled) volume * Returns NULL if no splittable boxes remain ***************************************/ static boxptr find_biggest_volume( boxptr boxlist, int numboxes ) { boxptr boxp; int i; int maxv = 0; boxptr which = NULL; for ( i = 0, boxp = boxlist; i < numboxes; i++, boxp++ ) if ( boxp->volume > maxv ) { which = boxp; maxv = boxp->volume; } return which; } /*************************************** * Repeatedly select and split the largest box until we have enough boxes ***************************************/ static int median_cut( SPEC * sp, boxptr boxlist, int numboxes, int desired_colors ) { int n, lb; int c0, c1, c2, cmax; boxptr b1, b2; while ( numboxes < desired_colors ) { /* Select box to split. * Current algorithm: by population for first half, then by volume. */ if ( numboxes * 2 <= desired_colors ) b1 = find_biggest_color_pop( boxlist, numboxes ); else b1 = find_biggest_volume( boxlist, numboxes ); if ( b1 == NULL ) /* no splittable boxes left! */ break; b2 = &boxlist[ numboxes ]; /* where new box will go */ /* Copy the color bounds to the new box. */ b2->c0max = b1->c0max; b2->c1max = b1->c1max; b2->c2max = b1->c2max; b2->c0min = b1->c0min; b2->c1min = b1->c1min; b2->c2min = b1->c2min; /* Choose which axis to split the box on. * Current algorithm: longest scaled axis. * See notes in update_box about scaling distances. */ c0 = ( ( b1->c0max - b1->c0min ) << C0_SHIFT ) * C0_SCALE; c1 = ( ( b1->c1max - b1->c1min ) << C1_SHIFT ) * C1_SCALE; c2 = ( ( b1->c2max - b1->c2min ) << C2_SHIFT ) * C2_SCALE; /* We want to break any ties in favor of green, then red, blue last. * This code does the right thing for R,G,B or B,G,R color orders only. */ #if RGB_RED == 0 cmax = c1; n = 1; if ( c0 > cmax ) { cmax = c0; n = 0; } if ( c2 > cmax ) n = 2; #else cmax = c1; n = 1; if ( c2 > cmax ) { cmax = c2; n = 2; } if ( c0 > cmax ) n = 0; #endif /* Choose split point along selected axis, and update box bounds. * Current algorithm: split at halfway point. * (Since the box has been shrunk to minimum volume, * any split will produce two nonempty subboxes.) * Note that lb value is max for lower box, so must be < old max. */ switch ( n ) { case 0 : lb = ( b1->c0max + b1->c0min ) / 2; b1->c0max = lb; b2->c0min = lb + 1; break; case 1 : lb = ( b1->c1max + b1->c1min ) / 2; b1->c1max = lb; b2->c1min = lb + 1; break; case 2 : lb = ( b1->c2max + b1->c2min ) / 2; b1->c2max = lb; b2->c2min = lb + 1; break; } /* Update stats for boxes */ update_box( sp, b1 ); update_box( sp, b2 ); numboxes++; } return numboxes; } /*************************************** * Compute representative color for a box, put it in colormap[icolor] ***************************************/ static void compute_color( SPEC * sp, boxptr boxp, int icolor ) { /* Current algorithm: mean weighted by pixels (not colors) */ /* Note it is important to get the rounding correct! */ hist3d histogram = sp->histogram; histptr histp; int c0, c1, c2; int c0min, c0max, c1min, c1max, c2min, c2max; long count; long total = 0; long c0total = 0; long c1total = 0; long c2total = 0; c0min = boxp->c0min; c0max = boxp->c0max; c1min = boxp->c1min; c1max = boxp->c1max; c2min = boxp->c2min; c2max = boxp->c2max; for ( c0 = c0min; c0 <= c0max; c0++ ) for ( c1 = c1min; c1 <= c1max; c1++ ) { histp = &histogram[ c0][ c1 ][ c2min ]; for ( c2 = c2min; c2 <= c2max; c2++ ) { if ( ( count = *histp++ ) != 0 ) { total += count; c0total += ( ( c0 << C0_SHIFT ) + ( ( 1 << C0_SHIFT ) >> 1 ) ) * count; c1total += ( ( c1 << C1_SHIFT ) + ( ( 1 << C1_SHIFT ) >> 1 ) ) * count; c2total += ( ( c2 << C2_SHIFT ) + ( ( 1 << C2_SHIFT ) >> 1 ) ) * count; } } } sp->colormap[ 0 ][ icolor ] = ( JSAMPLE ) ( ( c0total + ( total >> 1 ) ) / total ); sp->colormap[ 1 ][ icolor ] = ( JSAMPLE ) ( ( c1total + ( total >> 1 ) ) / total ); sp->colormap[ 2 ][ icolor ] = ( JSAMPLE ) ( ( c2total + ( total >> 1 ) ) / total ); } /*************************************** * Master routine for color selection ***************************************/ static void select_colors( SPEC * sp, int desired_colors ) { boxptr boxlist; int numboxes; int i; if ( sp->im ) sp->im->visual_cue( sp->im, "Selecting Colors ..." ); /* Allocate workspace for box list */ boxlist = fl_malloc( desired_colors * sizeof( box ) ); /* Initialize one box containing whole space */ numboxes = 1; boxlist[ 0 ].c0min = 0; boxlist[ 0 ].c0max = MAXJSAMPLE >> C0_SHIFT; boxlist[ 0 ].c1min = 0; boxlist[ 0 ].c1max = MAXJSAMPLE >> C1_SHIFT; boxlist[ 0 ].c2min = 0; boxlist[ 0 ].c2max = MAXJSAMPLE >> C2_SHIFT; /* Shrink it to actually-used volume and set its statistics */ update_box( sp, &boxlist[ 0 ] ); /* Perform median-cut to produce final box list */ numboxes = median_cut( sp, boxlist, numboxes, desired_colors ); /* Compute the representative color for each box, fill colormap */ for ( i = 0; i < numboxes; i++ ) compute_color( sp, boxlist+ i, i ); sp->actual_number_of_colors = numboxes; fl_free( boxlist ); } /*************************************** * get histogram ***************************************/ static void prescan_quantize( SPEC * sp, unsigned char ** r, unsigned char ** g, unsigned char ** b, int width, int num_rows ) { histptr histp; hist3d histogram = sp->histogram; int row, col; if ( sp->im ) { sp->im->completed = 0; sp->im->visual_cue( sp->im, "Getting Histogram ..." ); } for ( row = 0; row < num_rows; row++ ) { for ( col = width; --col >= 0; ) { /* get pixel value and index into the histogram */ histp = &histogram[ r[ row ][ col ] >> C0_SHIFT ] [ g[ row ][ col ] >> C1_SHIFT ] [ b[ row ][ col ] >> C2_SHIFT ]; /* increment, check for overflow and undo increment if so. */ if ( ++( *histp ) <= 0 ) ( *histp )--; } } } /* * Initialize the error-limiting transfer function (lookup table). * The raw F-S error computation can potentially compute error values of up to * +- MAXJSAMPLE. But we want the maximum correction applied to a pixel to be * much less, otherwise obviously wrong pixels will be created. (Typical * effects include weird fringes at color-area boundaries, isolated bright * pixels in a dark area, etc.) The standard advice for avoiding this problem * is to ensure that the "corners" of the color cube are allocated as output * colors; then repeated errors in the same direction cannot cause cascading * error buildup. However, that only prevents the error from getting * completely out of hand; Aaron Giles reports that error limiting improves * the results even with corner colors allocated. * A simple clamping of the error values to about +- MAXJSAMPLE/8 works pretty * well, but the smoother transfer function used below is even better. Thanks * to Aaron Giles for this idea. */ /*************************************** * Allocate and fill in the error_limiter table ***************************************/ static void init_error_limit( SPEC *sp ) { int *table; int in, out; table = fl_malloc( ( MAXJSAMPLE * 2 + 1 ) * sizeof( int ) ); table += MAXJSAMPLE; /* so can index -MAXJSAMPLE .. +MAXJSAMPLE */ sp->error_limiter = table; #define STEPSIZE ( ( MAXJSAMPLE+1 ) / 16 ) /* Map errors 1:1 up to +- MAXJSAMPLE/16 */ for ( out = in = 0; in < STEPSIZE; in++, out++ ) { table[ in ] = out; table[ -in ] = -out; } /* Map errors 1:2 up to +- 3*MAXJSAMPLE/16 */ for ( ; in < STEPSIZE * 3; in++, out += ( in & 1 ) ? 0 : 1 ) { table[ in ] = out; table[ -in ] = -out; } /* Clamp the rest to final out value (which is (MAXJSAMPLE+1)/8) */ for ( ; in <= MAXJSAMPLE; in++ ) { table[ in ] = out; table[ -in ] = -out; } #undef STEPSIZE } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_combine.c0000644000175000017500000000606212251675336013777 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * combine two images in the following way * IM = IM1 * alpha + IM2 * (1-alpha) */ /*** UNFINISHED and UNTESTED */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" FL_IMAGE * flimage_combine( FL_IMAGE * im1, FL_IMAGE * im2, double alpha ) { FL_IMAGE *ret; int i, w, h, x, y; if ( ! im1 || im1->w <= 0 || ! im2 || im2->w <= 0 ) return 0; if ( ! ( ret = flimage_alloc( ) ) ) { flimage_error( im1, "can't allocate resulting image" ); return 0; } ret->w = im1->w; ret->h = im1->h; ret->type = FLIMAGE_RGB; flimage_get_linearlut( ret ); /* Convert to RGB */ flimage_convert( im1, FLIMAGE_RGB, 0 ); flimage_convert( im2, FLIMAGE_RGB, 0 ); /* Populate the lut */ for ( i = 0; i <= FL_PCMAX; i++ ) { ret->llut[ 0 ][ i ] = i * alpha + 0.5; ret->llut[ 1 ][ i ] = i - ret->llut[ 0 ][ i ]; } w = FL_min( im1->w, im2->w ); h = FL_min( im1->h, im2->h ); for ( y = 0; y < h; y++) { for ( x = 0; x < w; x++) { ret->red[ y ][ x ] = ret->llut[ 0 ][ im1->red[ y ][ x ] ] + ret->llut[ 1 ][ im2->red[ y ][ x ] ]; ret->green[ y ][ x ] = ret->llut[ 0 ][ im1->green[ y ][ x ] ] + ret->llut[ 1 ][ im2->green[ y ][ x ] ]; ret->blue[ y ][ x ] = ret->llut[ 0 ][ im1->blue[ y ][ x ] ] + ret->llut[ 1 ][ im2->blue[ y ][ x ] ]; } for ( ; x < im1->w; x++ ) { ret->red[ y ][ x ] = im1->red[ y ][ x ]; ret->green[ y ][ x ] = im1->green[ y ][ x ]; ret->blue[ y ][ x ] = im1->blue[ y ][ x ]; } } for ( ; y < im1->h; y++ ) for ( x = 0; x < im1->w; x++ ) { ret->red[ y ][ x ] = im1->red[ y ][ x ]; ret->green[ y ][ x ] = im1->green[ y ][ x ]; ret->blue[ y ][ x ] = im1->blue[ y ][ x ]; } return ret; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_warp.c0000644000175000017500000003530212251675226013331 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1998-2002 T.C. Zhao * All rights reserved. * * General non-perspective linear image warping. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" #include /*************************************** * linear interpolation ***************************************/ static void interpol2d_short( unsigned short * out, float y, float x, unsigned short ** mat, int nrow, int ncol, unsigned int fill ) { float wx, wy, wx1; int s00, s01, s10, s11, ix, iy; if ( x <= -1.0 || y <= -1.0 || x >= ncol || y >= nrow ) { *out = fill; return; } /* we need to fake one row/column of samples outside of the image to make the boundary look nice */ ix = x < 0 ? -1 : x; iy = y < 0 ? -1 : y; /* here we use extra samples outside of the image */ s00 = ( ix >= 0 && iy >= 0) ? mat[ iy ][ ix ] : fill; s10 = ( ix < ncol - 1 && iy >= 0 ) ? mat[ iy ][ ix + 1 ] : fill; s01 = ( ix >= 0 && iy < nrow - 1 ) ? mat[ iy + 1 ][ ix ] : fill; s11 = ( ix < ncol - 1 && iy < nrow - 1 ) ? mat[ iy + 1 ][ ix + 1 ] : fill; /* weights */ wx = x - ix; wy = y - iy; wx1 = 1.0 - wx; *out = ( s00 * wx1 + s10 * wx ) * ( 1.0 - wy ) + ( s01 * wx1 + s11 * wx ) * wy + 0.1; return; } /*************************************** * linear interpolation ***************************************/ static void interpol2d_uc( int out[ 3 ], float y, float x, unsigned char ** r, unsigned char ** g, unsigned char ** b, int nrow, int ncol, int fill[ ] ) { int ix, iy; float wx, wy, wx1, wy1; int s00[ 3 ], s01[ 3 ], s10[ 3 ], s11[ 3 ]; if ( x <= -1.0f || y <= -1.0f || x >= ncol || y >= nrow ) { out[ 0 ] = fill[ 0 ]; out[ 1 ] = fill[ 1 ]; out[ 2 ] = fill[ 2 ]; return; } ix = x < 0.0 ? -1 : ( int ) x; iy = y < 0.0 ? -1 : ( int ) y; /* we need to fake one row/column of samples outside of the image to make the boundary look nice */ if ( ix >= 0 && iy >= 0 ) { s00[ 0 ] = r[ iy ][ ix ]; s00[ 1 ] = g[ iy ][ ix ]; s00[ 2 ] = b[ iy ][ ix ]; } else { s00[ 0 ] = fill[ 0 ]; s00[ 1 ] = fill[ 1 ]; s00[ 2 ] = fill[ 2 ]; } if ( ix < ncol - 1 && iy >= 0 ) { s10[ 0 ] = r[ iy ][ ix + 1 ]; s10[ 1 ] = g[ iy ][ ix + 1 ]; s10[ 2 ] = b[ iy ][ ix + 1 ]; } else { s10[ 0 ] = fill[ 0 ]; s10[ 1 ] = fill[ 1 ]; s10[ 2 ] = fill[ 2 ]; } if ( ix >= 0 && iy < nrow - 1 ) { s01[ 0 ] = r[ iy + 1 ][ ix ]; s01[ 1 ] = g[ iy + 1 ][ ix ]; s01[ 2 ] = b[ iy + 1 ][ ix ]; } else { s01[ 0 ] = fill[ 0 ]; s01[ 1 ] = fill[ 1 ]; s01[ 2 ] = fill[ 2 ]; } if ( ix < ncol - 1 && iy < nrow - 1 ) { s11[ 0 ] = r[ iy + 1 ][ ix + 1 ]; s11[ 1 ] = g[ iy + 1 ][ ix + 1 ]; s11[ 2 ] = b[ iy + 1 ][ ix + 1 ]; } else { s11[ 0 ] = fill[ 0 ]; s11[ 1 ] = fill[ 1 ]; s11[ 2 ] = fill[ 2 ]; } /* weights */ wx = x - ix; wy = y - iy; wx1 = 1.0 - wx; wy1 = 1.0 - wy; out[ 0 ] = ( s00[ 0 ] * wx1 + s10[ 0 ] * wx ) * wy1 + ( s01[ 0 ] * wx1 + s11[ 0 ] * wx ) * wy; out[ 1 ] = ( s00[ 1 ] * wx1 + s10[ 1 ] * wx ) * wy1 + ( s01[ 1 ] * wx1 + s11[ 1 ] * wx ) * wy; out[ 2 ] = ( s00[ 2 ] * wx1 + s10[ 2 ] * wx ) * wy1 + ( s01[ 2 ] * wx1 + s11[ 2 ] * wx ) * wy; if ( out[ 0 ] < 0 || out[ 0 ] > FL_PCMAX || out[ 1 ] < 0 || out[ 1 ] > FL_PCMAX || out[ 2 ] < 0 || out[ 2 ] > FL_PCMAX) { M_err( "interpol2D", "out of range" ); exit( 1 ); } return; } #define Free( a ) if( a ) fl_free( a ) /*************************************** ***************************************/ static int get_luts( float ** lutx0, float ** lutx1, float ** luty0, float ** luty1, float m[ ][ 2 ], int shift[ ], int w, int h ) { int i, err = 0; *lutx0 = *luty0 = *lutx1 = *luty1 = NULL; err = ! ( *lutx0 = fl_malloc( sizeof **lutx0 * ( w + 1 ) ) ) || ! ( *luty0 = fl_malloc( sizeof **luty0 * ( w + 1 ) ) ) || ! ( *lutx1 = fl_malloc( sizeof **lutx1 * ( h + 1 ) ) ) || ! ( *luty1 = fl_malloc( sizeof **luty1 * ( h + 1 ) ) ); if ( err ) { Free( *lutx0 ); Free( *luty0 ); Free( *lutx1 ); Free( *luty1 ); return -1; } for ( i = 0; i <= w; i++ ) { ( *lutx0 )[ i ] = m[ 0 ][ 0 ] * ( i - shift[ 0 ] ); ( *luty0 )[ i ] = m[ 1 ][ 0 ] * ( i - shift[ 0 ] ); } for ( i = 0; i <= h; i++ ) { ( *lutx1 )[ i ] = m[ 0 ][ 1 ] * ( i - shift[ 1 ] ); ( *luty1 )[ i ] = m[ 1 ][ 1 ] * ( i - shift[ 1 ] ); } return 0; } #define Outside( ic, ir, w, h ) \ ( ic < 0 || ic > ( w ) - 1 || ir < 0 || ir > ( h ) - 1 ) /*************************************** * the short array passed in could be grayscale or color index ***************************************/ static int transform_short( unsigned short ** in, unsigned short ** out, int w, int h, int nw, int nh, float m[ ][ 2 ], int shift[ ], unsigned int fill, int subp, FL_IMAGE * im) { float *lutx[ 2 ], *luty[ 2 ]; int r, c, ir, ic; float fir, fic; if ( get_luts( lutx, lutx + 1, luty, luty + 1, m, shift, nw, nh ) < 0 ) return -1; for ( r = 0; r < nh; r++, im->completed++ ) { if ( ! ( im->completed & FLIMAGE_REPFREQ ) ) im->visual_cue( im, subp ? "GraySubP" : "Gray" ); if ( ! subp ) { for ( c = 0; c < nw; c++ ) { ic = lutx[ 0 ][ c ] + lutx[ 1 ][ r ] + 0.1; ir = luty[ 0 ][ c ] + luty[ 1 ][ r ] + 0.1; out[ r ][ c ] = Outside( ic, ir, w, h ) ? fill : in[ ir ][ ic ]; } } else { for ( c = 0; c < nw; c++ ) { fic = lutx[ 0 ][ c ] + lutx[ 1 ][ r ]; fir = luty[ 0 ][ c ] + luty[ 1 ][ r ]; interpol2d_short( &out[ r ][ c ], fir, fic, in, h, w, fill ); } } } fl_free( lutx[ 0 ] ); fl_free( lutx[ 1 ] ); fl_free( luty[ 0 ] ); fl_free( luty[ 1 ] ); return 1; } /*************************************** ***************************************/ static int transform_rgb( unsigned char ** or, unsigned char ** og, unsigned char ** ob, unsigned char ** nr, unsigned char ** ng, unsigned char ** nb, int w, int h, int nw, int nh, float m[ ][ 2 ], int shift[ ], unsigned int fill, int subp, FL_IMAGE * im ) { float *lutx[ 2 ], *luty[ 2 ]; int r, c, ir, ic, out[ 3 ]; float fir, fic; unsigned char fr = FL_GETR( fill ), fg = FL_GETG( fill ), fb = FL_GETB( fill ); int fillc[ 3 ]; if ( get_luts( lutx, lutx + 1, luty, luty + 1, m, shift, nw, nh ) < 0 ) return -1; fillc[ 0] = FL_GETR( fill ); fillc[ 1] = FL_GETG( fill ); fillc[ 2] = FL_GETB( fill ); for ( r = 0; r < nh; r++, im->completed++ ) { if ( ! ( im->completed & FLIMAGE_REPFREQ ) ) im->visual_cue( im, subp ? "RGBSubP" : "RGB" ); if ( ! subp ) { for ( c = 0; c < nw; c++ ) { ic = lutx[ 0 ][ c ] + lutx[ 1 ][ r ] + 0.1; ir = luty[ 0 ][ c ] + luty[ 1 ][ r ] + 0.1; nr[ r ][ c ] = Outside( ic, ir, w, h ) ? fr : or[ ir ][ ic ]; ng[ r ][ c ] = Outside( ic, ir, w, h ) ? fg : og[ ir ][ ic ]; nb[ r ][ c ] = Outside( ic, ir, w, h ) ? fb : ob[ ir ][ ic ]; } } else { for ( c = 0; c < nw; c++ ) { fic = lutx[ 0][ c ] + lutx[ 1 ][ r ]; fir = luty[ 0][ c ] + luty[ 1 ][ r ]; interpol2d_uc( out, fir, fic, or, og, ob, h, w, fillc ); nr[ r ][ c ] = out[ 0 ]; ng[ r ][ c ] = out[ 1 ]; nb[ r ][ c ] = out[ 2 ]; } } } fl_free(lutx[ 0 ] ); fl_free(lutx[ 1 ] ); fl_free(luty[ 0 ] ); fl_free(luty[ 1 ] ); return 1; } /*************************************** ***************************************/ int flimage_warp( FL_IMAGE * im, float m[ ][ 2 ], int nw, int nh, int option ) { int subp = option & FLIMAGE_SUBPIXEL, err = 0, i; int center = ! ( ( option & FLIMAGE_NOCENTER ) == FLIMAGE_NOCENTER ); int neww, newh, shift[ 2 ]; unsigned short **us = NULL; unsigned char **r = NULL, **g = NULL, **b = NULL; unsigned int fill; float x[ 4 ], y[ 4 ], xmin, ymin, xmax, ymax, inv[ 2 ][ 2 ]; double det; if ( ! im || im->w <= 0 ) return -1; /* first check if the inverse of the warping matrix exists */ det = m[ 0 ][ 0 ] * m[ 1 ][ 1 ] - m[ 1 ][ 0 ] * m[ 0 ][ 1 ]; if ( FL_abs( det ) < 1.0e-6 ) { flimage_error( im, "Bad warp matrix" ); return -1; } inv[ 0 ][ 0 ] = m[ 1 ][ 1 ] / det; inv[ 1 ][ 0 ] = -m[ 1 ][ 0 ] / det; inv[ 0 ][ 1 ] = -m[ 0 ][ 1 ] / det; inv[ 1 ][ 1 ] = m[ 0 ][ 0 ] / det; if ( subp ) { if ( im->type == FL_IMAGE_CI ) flimage_convert( im, FL_IMAGE_RGB, 0 ); else if ( im->type == FL_IMAGE_MONO ) flimage_convert( im, FL_IMAGE_GRAY, 0 ); } fill = im->fill_color; /* figure out the shifts by getting the extremas at (0,0), (w,0), (w,h), (0.h) */ xmin = xmax = ymin = ymax = x[ 0 ] = y[ 0 ] = 0.0; x[ 1 ] = m[ 0 ][ 0 ] * im->w; y[ 1 ] = m[ 1 ][ 0 ] * im->w; x[ 2 ] = m[ 0 ][ 0 ] * im->w + m[ 0 ][ 1 ] * im->h; y[ 2 ] = m[ 1 ][ 0 ] * im->w + m[ 1 ][ 1 ] * im->h; x[ 3 ] = m[ 0 ][ 1 ] * im->h; y[ 3 ] = m[ 1 ][ 1 ] * im->h; for ( i = 1; i < 4; i++ ) { if ( xmin > x[ i ] ) xmin = x[ i ]; if ( xmax < x[ i ] ) xmax = x[ i ]; if ( ymin > y[ i ] ) ymin = y[ i ]; if ( ymax < y[ i ] ) ymax = y[ i ]; } shift[ 0 ] = -( int ) FL_nint( xmin ); shift[ 1 ] = -( int ) FL_nint( ymin ); neww = xmax - xmin + 0.5; newh = ymax - ymin + 0.5; if ( ! nw || ! nh ) { nw = neww; nh = newh; } if ( center ) { shift[ 0 ] += ( nw - neww ) / 2; shift[ 1 ] += ( nh - newh ) / 2; } flimage_invalidate_pixels( im ); /* try get memory */ if ( FL_IsCI( im->type ) || FL_IsGray( im->type ) ) { err = ! ( us = fl_get_matrix( nh, nw, sizeof **us ) ); } else { flimage_free_ci( im ); flimage_free_gray( im ); err = ! ( r = fl_get_matrix( nh, nw, sizeof **r ) ); err = err || ! ( g = fl_get_matrix( nh, nw, sizeof **g ) ); err = err || ! ( b = fl_get_matrix( nh, nw, sizeof **b ) ); } if ( err ) { im->error_message( im, "Transform: can't get memory" ); fl_free_matrix( us ); fl_free_matrix( r ); fl_free_matrix( g ); fl_free_matrix( b ); return -1; } /* now do the transform */ im->completed = 1; im->visual_cue( im, "Transforming" ); if ( FL_IsGray( im->type ) ) { fill = FL_RGB2GRAY( FL_GETR( fill ), FL_GETG( fill ), FL_GETB( fill ) ); if ( ! ( err = ( transform_short( im->gray, us, im->w, im->h, nw, nh, inv, shift, fill, subp, im) < 0 ) ) ) flimage_replace_image( im, nw, nh, us, 0, 0 ); } else if ( FL_IsCI( im->type ) ) { fill = flimage_get_closest_color_from_map( im, fill ); if ( ! ( err = ( transform_short( im->ci, us, im->w, im->h, nw, nh, inv, shift, fill, 0, im ) < 0 ) ) ) flimage_replace_image( im, nw, nh, us, 0, 0 ); } else if ( im->type == FL_IMAGE_RGB ) { if ( ! ( err = ( transform_rgb( im->red, im->green, im->blue, r, g, b, im->w, im->h, nw, nh, inv, shift, fill, subp, im ) < 0 ) ) ) flimage_replace_image( im, nw, nh, r, g, b ); } else { M_err( "Transform", "InternalError. Bad type" ); return -1; } if ( err ) { im->error_message( im, "Transform failed" ); return -1; } else { im->completed = im->total; im->visual_cue( im, "Warp done" ); } return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/ps_core.c0000644000175000017500000012232112344061211012630 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1997-2002 by T.C. Zhao * All rights reserved. * * Some primitive drawing routines is PS * * (x,y) (w,h) passed to all drawing functions are relative * to PS coordinate system and the unit is pixel/point. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/pflps.h" #include #include FLPSInfo *flps; /*************************************** ***************************************/ FLPS_CONTROL * flps_init( void ) { static FLPSInfo *local_flps; if ( ! local_flps ) { local_flps = fl_calloc( 1, sizeof *flps ); local_flps->ps_color = FLPS_COLOR; local_flps->orientation = FLPS_AUTO; local_flps->paper_w = 8.5; local_flps->paper_h = 11.0; local_flps->auto_fit = 1; local_flps->xscale = local_flps->yscale = 1.0; /* driver will fill-in appropriate vals for minus */ local_flps->drawbox = -1; local_flps->xdpi = local_flps->ydpi = fl_dpi; local_flps->pack = 1; /* Cache */ local_flps->cur_color = FL_NoColor; local_flps->cur_style = local_flps->cur_size = -1; local_flps->cur_lw = -1; } return ( FLPS_CONTROL * ) ( flps = local_flps ); } /*************************************** ***************************************/ void flps_switch_flps( FLPSInfo * info ) { flps = info; } /*************************************** ***************************************/ void flps_restore_flps( void ) { flps_init( ); } /*************************************** ***************************************/ void flps_reset_cache( void ) { flps_invalidate_font_cache( ); flps_invalidate_color_cache( ); flps_invalidate_symbol_cache( ); flps_invalidate_linewidth_cache( ); } /*************************************** * write some arbitary text into the output stream ***************************************/ void flps_log( const char * s ) { fprintf( flps->fp, "%%%s", s ); } #include #define LEFT '(' #define RIGHT ')' /*************************************** ***************************************/ void flps_output( const char * fmt, ... ) { va_list args; char buf[ 2048 ], *q; int lastc = flps->lastc; /* Flush */ if ( ! fmt ) { if ( flps->pack && flps->len ) { putc( '\n', flps->fp ); flps->len = 0; } return; } va_start( args, fmt ); vsprintf( buf, fmt, args ); va_end( args ); if ( ! flps->pack ) fprintf( flps->fp, "%s", buf ); else { for ( q = buf; *q; q++ ) { if ( *q == '\n' ) *q = ' '; /* this is less than robust */ if ( *q == LEFT ) flps->literal = 1; else if ( *q == RIGHT ) flps->literal = 0; if ( lastc == ' ' && *q == ' ' && ! flps->literal ) continue; if ( *q == ' ' && flps->len == 0 ) continue; if ( *q == ' ' && flps->len >= 70 ) { putc( '\n', flps->fp ); flps->len = 0; } else { lastc = *q; flps->len++; putc( *q, flps->fp ); } } flps->lastc = lastc; } } /*************************************** * flps_linewidth() and flps_reset_linewidth() must be used in pairs ***************************************/ void flps_linewidth( int lw ) { float flw; if ( lw == flps->cur_lw ) return; flps->last_lw = flps->cur_lw; flps->cur_lw = lw; flw = 0.9 * lw; if ( flps->final_xscale + flps->final_yscale > 2 ) flw = 0.9 * lw; if ( flw < 0.4 ) flw = 0.4; flps_output( " %.1f %.1f LW\n", flw, flw ); } /*************************************** ***************************************/ int flps_get_linewidth( void ) { return flps->cur_lw; } /*************************************** ***************************************/ void flps_reset_linewidth( void ) { flps_linewidth( flps->last_lw ); flps_log( "resetline" ); } /*************************************** ***************************************/ void flps_invalidate_linewidth_cache( void ) { flps->cur_lw = -1; } static int ps_ls = FL_SOLID; /*************************************** ***************************************/ void flps_linestyle( int n ) { if ( ps_ls == n ) return; switch ( n ) { case FL_DOT : flps_output( "DT " ); break; case FL_DOTDASH : flps_output( "DTD " ); break; case FL_DASH : flps_output( "D " ); break; case FL_LONGDASH : flps_output( "LD " ); break; case FL_SOLID : case FL_USERDASH : case FL_USERDOUBLEDASH : case -1: flps_output( "SL " ); ps_ls = FL_SOLID; break; default: fprintf( stderr, "Unknown dashstyle: %d\n", n ); return; } ps_ls = n; } /*************************************** ***************************************/ int flps_get_linestyle( void ) { return ps_ls; } /*************************************** * Draw a line in abs coordinate system ***************************************/ void flps_line( int xi, int yi, int xf, int yf, FL_COLOR col ) { flps_color( col ); flps_output( "%d %d %d %d L S\n", xf, yf, xi, yi ); } /*************************************** * ghostview and some printers have problems with too many * points on the stack. We break the points into batches of * PSMAXP pairs ***************************************/ #define PSMAXP 350 static void small_flps_lines( FL_POINT * xp, int n, FL_COLOR col ) { FL_POINT *xps = xp + n; int cnt = 1; flps_color( col ); for ( ; xp < xps; xp++, cnt++ ) { flps_output( "%d %d ", ( int ) xp->x, ( int ) xp->y ); if ( cnt % 6 == 0 ) flps_output( "\n" ); } if ( n ) flps_output( "%d lines\n", n ); } /*************************************** ***************************************/ void flps_lines( FL_POINT * xp, int n, FL_COLOR col ) { int k = n / PSMAXP, r = n % PSMAXP; int b; /* need to backup one point if broken up the batch */ for ( b = 0; b < k; b++ ) small_flps_lines( xp + b * PSMAXP - ( b > 0 ), PSMAXP + ( b > 0 ), col ); if ( r ) small_flps_lines( xp + k * PSMAXP - ( k > 0 ), r + ( k > 0 ), col ); } /*************************************** ***************************************/ void flps_poly( int fill, FL_POINT * xp, int n, FL_COLOR col ) { FL_POINT *xps = xp + n; int cnt = 1; flps_color( col ); for ( ; xp < xps; xp++, cnt++ ) { flps_output( "%d %d ", ( int ) xp->x, ( int ) xp->y ); if ( cnt % 6 == 0 ) flps_output( "\n" ); } flps_output( "%d P %c\n", n, "SF"[ fill ] ); } /*************************************** ***************************************/ void flps_rectangle( int fill, int x, int y, int w, int h, FL_COLOR col) { flps_color( col ); flps_output( "%d %d %d %d %d %d %d %d 4 P", x, y, x, y + h - 1, x + w - 1, y + h - 1, x + w - 1, y ); flps_output( " %c\n", "SF"[ fill ] ); } /*************************************** ***************************************/ void flps_oval( int fill, int x, int y, int w, int h, FL_COLOR col ) { flps_pieslice( fill, x, y, w, h, 0.0, 3600.0, col ); } /*************************************** ***************************************/ void flps_circ( int fill, int x, int y, int r, FL_COLOR col ) { flps_color( col ); flps_output( "newpath %d %d %d 0 360 arc %c\n", x, y, r, "SF"[ fill ] ); } /*************************************** * Draw an circular arc, optionally filled. Angle t1 and t2 are in one-tenth of * a degree ***************************************/ void flps_arc( int fill, int x, int y, int r, int t1, int t2, FL_COLOR col ) { flps_color( col ); flps_output( "newpath %d %d %d %.1f %.1f arc %c\n", x, y, r, t1 * 0.1, t2 * 0.1, "SF"[ fill ] ); } /*************************************** * Only fill does a pie slice ***************************************/ void flps_pieslice( int fill, int x, int y, int w, int h, int t1, int t2, FL_COLOR col ) { float sx = 1.0, sy = ( float ) h / w; flps_color( col ); flps_output( "gsave newpath %.1f %.1f translate %.1f %.1f scale\n", x + 0.5f * w, y + 0.5f * h, sx, sy ); if ( ! fill ) flps_output( "0 0 %.1f %.1f %.1f arc S grestore\n", w * 0.5, t1 * 0.1, t2 * 0.1 ); else flps_output( "0 0 M 0 0 %.1f %.1f %.1f arc C F grestore\n", w * 0.5, t1 * 0.1, t2 * 0.1 ); flps_invalidate_color_cache( ); } /************************************************************** * basic color routines **************************************************************/ #define VN( a ) a,#a #define NV( a ) #a,a /* slightly different from XForms' built-in due to the difference * between printer and screen */ #define PREVIEW static FLI_IMAP fl_imap[ ] = { { NV( FL_BLACK ), 0, 0, 0, 0, 0 }, { NV( FL_WHITE ), 255, 255, 255, 0, 0 }, { NV( FL_COL1 ), 161, 161, 161, 0, 0 }, { NV( FL_BOTTOM_BCOL ), 89, 89, 89, 0, 0 }, { NV( FL_RIGHT_BCOL ), 41, 41, 41, 0, 0 }, { NV( FL_MCOL ), 191, 191, 191, 0, 0 }, { NV( FL_LEFT_BCOL ), 222, 222, 222, 0, 0 }, { NV( FL_SLATEBLUE ), 113, 113, 198, 0, 0 }, { NV( FL_INDIANRED ), 198, 113, 113, 0, 0 }, { NV( FL_RED ), 255, 0, 0, 0, 0 }, { NV( FL_BLUE ), 0, 0, 255, 0, 0 }, { NV( FL_GREEN ), 0, 255, 0, 0, 0 }, { NV( FL_YELLOW ), 255, 255, 0, 0, 0 }, { NV( FL_MAGENTA ), 255, 0, 255, 0, 0 }, { NV( FL_CYAN ), 0, 255, 255, 0, 0 }, { NV( FL_TOMATO ), 255, 99, 71, 0, 0 }, { NV(FL_INACTIVE ), 110, 110, 110, 0, 0 }, { NV(FL_TOP_BCOL ), 204, 204, 204, 0, 0 }, { NV( FL_PALEGREEN ), 113, 198, 113, 0, 0 }, { NV( FL_DARKGOLD ), 205, 149, 10, 0, 0 }, { NV( FL_ORCHID ), 205, 105, 201, 0, 0 }, { NV( FL_DARKCYAN ), 40, 170, 175, 0, 0 }, { NV( FL_DARKTOMATO ), 139, 54, 38, 0, 0 }, { NV( FL_WHEAT ), 255, 231, 155, 0, 0 }, { NV( FL_DARKORANGE ), 255, 128, 0, 0, 0 }, { NV( FL_DEEPPINK ), 255, 0, 128, 0, 0 }, { NV( FL_CHARTREUSE ), 128, 255, 0, 0, 0 }, { NV( FL_DARKVIOLET ), 128, 0, 255, 0, 0 }, { NV( FL_SPRINGGREEN ), 0, 255, 128, 0, 0 }, { NV( FL_DODGERBLUE ), 0, 128, 255, 0, 0 }, { NV( FL_DOGERBLUE ), 0, 128, 255, 0, 0 }, { NV( FL_LIGHTER_COL1 ), 204, 204, 204, 0, 0 }, { NV( FL_DARKER_COL1 ), 161, 161, 161, 0, 0 }, { NV( FL_ALICEBLUE ), 240, 248, 255, 0, 0 }, { NV( FL_ANTIQUEWHITE ), 250, 235, 215, 0, 0 }, { NV( FL_AQUA ), 0, 255, 255, 0, 0 }, { NV( FL_AQUAMARINE ), 127, 255, 212, 0, 0 }, { NV( FL_AZURE ), 240, 255, 255, 0, 0 }, { NV( FL_BEIGE ), 245, 245, 220, 0, 0 }, { NV( FL_BISQUE ), 255, 228, 196, 0, 0 }, { NV( FL_BLANCHEDALMOND ), 255, 235, 205, 0, 0 }, { NV( FL_BLUEVIOLET ), 138, 43, 226, 0, 0 }, { NV( FL_BROWN ), 165, 42, 42, 0, 0 }, { NV( FL_BURLYWOOD ), 222, 184, 135, 0, 0 }, { NV( FL_CADETBLUE ), 95, 158, 160, 0, 0 }, { NV( FL_CHOCOLATE ), 210, 105, 30, 0, 0 }, { NV( FL_CORAL ), 255, 127, 80, 0, 0 }, { NV( FL_CORNFLOWERBLUE ), 100, 149, 237, 0, 0 }, { NV( FL_CORNSILK ), 255, 248, 220, 0, 0 }, { NV( FL_CRIMSON ), 220, 20, 60, 0, 0 }, { NV( FL_DARKBLUE ), 0, 0, 139, 0, 0 }, { NV( FL_DARKGOLDENROD ), 184, 134, 11, 0, 0 }, { NV( FL_DARKGRAY ), 169, 169, 169, 0, 0 }, { NV( FL_DARKGREEN ), 0, 100, 0, 0, 0 }, { NV( FL_DARKGREY ), 169, 169, 169, 0, 0 }, { NV( FL_DARKKHAKI ), 189, 183, 107, 0, 0 }, { NV( FL_DARKMAGENTA ), 139, 0, 139, 0, 0 }, { NV( FL_DARKOLIVEGREEN ), 85, 107, 47, 0, 0 }, { NV( FL_DARKORCHID ), 153, 50, 204, 0, 0 }, { NV( FL_DARKRED ), 139, 0, 0, 0, 0 }, { NV( FL_DARKSALMON ), 233, 150, 122, 0, 0 }, { NV( FL_DARKSEAGREEN ), 143, 188, 143, 0, 0 }, { NV( FL_DARKSLATEBLUE ), 72, 61, 139, 0, 0 }, { NV( FL_DARKSLATEGRAY ), 47, 79, 79, 0, 0 }, { NV( FL_DARKSLATEGREY ), 47, 79, 79, 0, 0 }, { NV( FL_DARKTURQUOISE ), 0, 206, 209, 0, 0 }, { NV( FL_DEEPSKYBLUE ), 0, 191, 255, 0, 0 }, { NV( FL_DIMGRAY ), 105, 105, 105, 0, 0 }, { NV( FL_DIMGREY ), 105, 105, 105, 0, 0 }, { NV( FL_FIREBRICK ), 178, 34, 34, 0, 0 }, { NV( FL_FLORALWHITE ), 255, 250, 240, 0, 0 }, { NV( FL_FORESTGREEN ), 34, 139, 34, 0, 0 }, { NV( FL_FUCHSIA ), 255, 0, 255, 0, 0 }, { NV( FL_GAINSBORO ), 220, 220, 220, 0, 0 }, { NV( FL_GHOSTWHITE ), 248, 248, 255, 0, 0 }, { NV( FL_GOLD ), 255, 215, 0, 0, 0 }, { NV( FL_GOLDENROD ), 218, 165, 32, 0, 0 }, { NV( FL_GRAY ), 128, 128, 128, 0, 0 }, { NV( FL_GREENYELLOW ), 173, 255, 47, 0, 0 }, { NV( FL_GREY ), 128, 128, 128, 0, 0 }, { NV( FL_HONEYDEW ), 240, 255, 240, 0, 0 }, { NV( FL_HOTPINK ), 255, 105, 180, 0, 0 }, { NV( FL_INDIGO ), 75, 0, 130, 0, 0 }, { NV( FL_IVORY ), 255, 255, 240, 0, 0 }, { NV( FL_KHAKI ), 240, 230, 140, 0, 0 }, { NV( FL_LAVENDER ), 230, 230, 250, 0, 0 }, { NV( FL_LAVENDERBLUSH ), 255, 240, 245, 0, 0 }, { NV( FL_LAWNGREEN ), 124, 252, 0, 0, 0 }, { NV( FL_LEMONCHIFFON ), 255, 250, 205, 0, 0 }, { NV( FL_LIGHTBLUE ), 173, 216, 230, 0, 0 }, { NV( FL_LIGHTCORAL ), 240, 128, 128, 0, 0 }, { NV( FL_LIGHTCYAN ), 224, 255, 255, 0, 0 }, { NV( FL_LIGHTGOLDENRODYELLOW ), 250, 250, 210, 0, 0 }, { NV( FL_LIGHTGRAY ), 211, 211, 211, 0, 0 }, { NV( FL_LIGHTGREEN ), 144, 238, 144, 0, 0 }, { NV( FL_LIGHTGREY ), 211, 211, 211, 0, 0 }, { NV( FL_LIGHTPINK ), 255, 182, 193, 0, 0 }, { NV( FL_LIGHTSALMON ), 255, 160, 122, 0, 0 }, { NV( FL_LIGHTSEAGREEN ), 32, 178, 170, 0, 0 }, { NV( FL_LIGHTSKYBLUE ), 135, 206, 250, 0, 0 }, { NV( FL_LIGHTSLATEGRAY ), 119, 136, 153, 0, 0 }, { NV( FL_LIGHTSLATEGREY ), 119, 136, 153, 0, 0 }, { NV( FL_LIGHTSTEELBLUE ), 176, 196, 222, 0, 0 }, { NV( FL_LIGHTYELLOW ), 255, 255, 224, 0, 0 }, { NV( FL_LIME ), 0, 255, 0, 0, 0 }, { NV( FL_LIMEGREEN ), 50, 205, 50, 0, 0 }, { NV( FL_LINEN ), 250, 240, 230, 0, 0 }, { NV( FL_MAROON ), 128, 0, 0, 0, 0 }, { NV( FL_MEDIUMAQUAMARINE ), 102, 205, 170, 0, 0 }, { NV( FL_MEDIUMBLUE ), 0, 0, 205, 0, 0 }, { NV( FL_MEDIUMORCHID ), 186, 85, 211, 0, 0 }, { NV( FL_MEDIUMPURPLE ), 147, 112, 219, 0, 0 }, { NV( FL_MEDIUMSEAGREEN ), 60, 179, 113, 0, 0 }, { NV( FL_MEDIUMSLATEBLUE ), 123, 104, 238, 0, 0 }, { NV( FL_MEDIUMSPRINGGREEN ), 0, 250, 154, 0, 0 }, { NV( FL_MEDIUMTURQUOISE ), 72, 209, 204, 0, 0 }, { NV( FL_MEDIUMVIOLETRED ), 199, 21, 133, 0, 0 }, { NV( FL_MIDNIGHTBLUE ), 25, 25, 112, 0, 0 }, { NV( FL_MINTCREAM ), 245, 255, 250, 0, 0 }, { NV( FL_MISTYROSE ), 255, 228, 225, 0, 0 }, { NV( FL_MOCCASIN ), 255, 228, 181, 0, 0 }, { NV( FL_NAVAJOWHITE ), 255, 222, 173, 0, 0 }, { NV( FL_NAVY ), 0, 0, 128, 0, 0 }, { NV( FL_OLDLACE ), 253, 245, 230, 0, 0 }, { NV( FL_OLIVE ), 128, 128, 0, 0, 0 }, { NV( FL_OLIVEDRAB ), 107, 142, 35, 0, 0 }, { NV( FL_ORANGE ), 255, 165, 0, 0, 0 }, { NV( FL_ORANGERED ), 255, 69, 0, 0, 0 }, { NV( FL_PALEGOLDENROD ), 238, 232, 170, 0, 0 }, { NV( FL_PALETURQUOISE ), 175, 238, 238, 0, 0 }, { NV( FL_PALEVIOLETRED ), 219, 112, 147, 0, 0 }, { NV( FL_PAPAYAWHIP ), 255, 239, 213, 0, 0 }, { NV( FL_PEACHPUFF ), 255, 218, 185, 0, 0 }, { NV( FL_PERU ), 205, 133, 63, 0, 0 }, { NV( FL_PINK ), 255, 192, 203, 0, 0 }, { NV( FL_PLUM ), 221, 160, 221, 0, 0 }, { NV( FL_POWDERBLUE ), 176, 224, 230, 0, 0 }, { NV( FL_PURPLE ), 128, 0, 128, 0, 0 }, { NV( FL_ROSYBROWN ), 188, 143, 143, 0, 0 }, { NV( FL_ROYALBLUE ), 65, 105, 225, 0, 0 }, { NV( FL_SADDLEBROWN ), 139, 69, 19, 0, 0 }, { NV( FL_SALMON ), 250, 128, 114, 0, 0 }, { NV( FL_SANDYBROWN ), 244, 164, 96, 0, 0 }, { NV( FL_SEAGREEN ), 46, 139, 87, 0, 0 }, { NV( FL_SEASHELL ), 255, 245, 238, 0, 0 }, { NV( FL_SIENNA ), 160, 82, 45, 0, 0 }, { NV( FL_SILVER ), 192, 192, 192, 0, 0 }, { NV( FL_SKYBLUE ), 135, 206, 235, 0, 0 }, { NV( FL_SLATEGRAY ), 112, 128, 144, 0, 0 }, { NV( FL_SLATEGREY ), 112, 128, 144, 0, 0 }, { NV( FL_SNOW ), 255, 250, 250, 0, 0 }, { NV( FL_STEELBLUE ), 70, 130, 180, 0, 0 }, { NV( FL_TAN ), 210, 180, 140, 0, 0 }, { NV( FL_TEAL ), 0, 128, 128, 0, 0 }, { NV( FL_THISTLE ), 216, 191, 216, 0, 0 }, { NV( FL_TURQUOISE ), 64, 224, 208, 0, 0 }, { NV( FL_VIOLET ), 238, 130, 238, 0, 0 }, { NV( FL_WHITESMOKE ), 245, 245, 245, 0, 0 }, { NV( FL_YELLOWGREEN ), 154, 205, 50, 0, 0 } }; #define builtin ( sizeof fl_imap / sizeof *fl_imap ) /*************************************** * do gamma adjustment ***************************************/ void flps_apply_gamma( float gamma ) { FLI_IMAP *fm = fl_imap, *fs; float lastgamma = 1.0; if ( FL_abs(gamma) < 1.0e-3 ) { fprintf( stderr, "fd2ps: Bad Gamma value %.2f\n", gamma ); return; } for ( fs = fm + builtin; fm < fs; fm++ ) { if ( flps->verbose ) fprintf( stderr, "fm->r=%d\n", fm->r ); fm->r = 0.4 + 255 * ( pow( fm->r / 255.0, lastgamma / gamma ) ); fm->g = 0.4 + 255 * ( pow( fm->g / 255.0, lastgamma / gamma ) ); fm->b = 0.4 + 255 * ( pow( fm->b / 255.0, lastgamma / gamma ) ); if ( flps->verbose ) fprintf( stderr, "fm->r=%d\n", fm->r ); } } /*************************************** ***************************************/ static void flps_query_imap( FL_COLOR col, int * r, int * g, int * b ) { FLI_IMAP *flmap = fl_imap, *flmape = flmap + builtin; for ( ; flmap < flmape; flmap++ ) if ( col == flmap->index ) { *r = flmap->r; *g = flmap->g; *b = flmap->b; return; } } #define C2NC( c ) ( 1.0 / 255.0 * c ) #define rgb2gray( r, g, b ) ( 0.299 * ( r ) + 0.587 * ( g ) + 0.114 * ( b ) ) #ifndef FL_PACK #define FL_PACK( r, g, b ) ( ( b ) << 16 | ( g ) << 8 | ( r ) ) #define FL_UNPACK( p, r, g, b ) \ do { \ r = ( ( p ) ) & 0xff; \ g = ( ( p ) >> 8 ) &0xff; \ b = ( ( p ) >> 16 ) &0xff; \ } while ( 0 ) #endif /*************************************** ***************************************/ void flps_invalidate_color_cache( void ) { flps->cur_color = FL_NoColor; } /*************************************** ***************************************/ void flps_color( FL_COLOR color ) { int r = 0, g = 0, b = 0; if ( color == FL_NoColor ) return; if ( flps->isRGBColor ) FL_UNPACK( color, r, g, b ); else flps_query_imap( color, &r, &g, &b ); if ( ( FL_COLOR ) FL_PACK( r, g, b ) != flps->cur_color ) flps_rgbcolor( r, g, b ); } /*************************************** ***************************************/ void flps_rgbcolor( int r, int g, int b ) { unsigned int packed = FL_PACK( r, g, b ); if ( flps->cur_color == packed ) return; if ( flps->ps_color == FLPS_COLOR && ( r != g || r != b ) ) flps_output( "%.3g %.3g %.3g RGB ", C2NC( r ), C2NC( g ), C2NC( b ) ); else if ( flps->ps_color == FLPS_BW ) flps_output("%d G ", C2NC( rgb2gray( r, g, b ) ) > 0.62 ); else flps_output( "%.3g G ", C2NC( rgb2gray( r, g, b ) ) ); flps->cur_color = FL_PACK( r, g, b ); } /*************************************** ***************************************/ int flps_get_gray255( FL_COLOR color ) { int r = 0, g = 0, b = 0; if ( flps->isRGBColor ) FL_UNPACK( color, r, g, b ); else flps_query_imap( color, &r, &g, &b ); return rgb2gray( r, g, b ) + 0.1; } /*************************************** ***************************************/ FL_COLOR flps_get_namedcolor( const char * s ) { FLI_IMAP *flmap = fl_imap, *flmape = flmap + builtin; for ( ; s && flmap < flmape; flmap++ ) if ( strcmp( s, flmap->name ) == 0 ) return flmap->index; /* a wild shot */ return atoi( s ); } /************** Handle built-in symbols. ****************{*/ typedef void ( * PSdrawit )( int, int, int, int, int, FL_COLOR ); typedef struct { const char * name; const char * psname; const char * draw; int otherdef; PSdrawit fdrawit; int abs_coordinate; /* fdrawit uses abs coordinate system */ int defined; /* if def code emitted */ } PS_draw; /*************************************** ***************************************/ static void draw_dnline( int x FL_UNUSED_ARG, int y FL_UNUSED_ARG, int w, int h, int angle FL_UNUSED_ARG, FL_COLOR col FL_UNUSED_ARG ) { float t = 0.2, len; flps_output( "%.2f %.2f LW ", 3.5 / ( w + h ), 3.5 / ( w + h ) ); if ( w + h > 200 ) len = 0.99; else if ( w + h > 150 ) len = 0.98; else len = 0.93; flps_color( FL_RIGHT_BCOL ); flps_output( "-%.3f %.2f M %.3f %.2f LT S\n", len, t, len, t ); flps_color( FL_LEFT_BCOL ); flps_output( "-%.3f -%.2f M %.3f -%.2f LT S\n", len, t, len, t ); } /*************************************** ***************************************/ static void draw_upline( int x FL_UNUSED_ARG, int y FL_UNUSED_ARG, int w, int h, int angle FL_UNUSED_ARG, FL_COLOR col FL_UNUSED_ARG ) { float t = 0.033; flps_color( FL_LEFT_BCOL ); flps_output( "%.3f %.3f LW ", 3.7 / ( w + h ), 3.7 / ( w + h ) ); flps_output( "-0.9 %.3f M 0.9 %.3f LT S\n", t, t ); flps_color( FL_RIGHT_BCOL ); flps_output( "0.9 -%.3f M 0.9 %.3f LT S ", t, t ); flps_output( "-0.9 -%.3f M 0.9 -%.3f LT S\n", t, t ); } /* Due to pixel precision problems, we have to draw uparrow, downarrow and * ripple line in absolute unit with the origin at the center of the figure. */ /*************************************** ***************************************/ static void draw_uparrow( int x, int y, int w, int h, int angle, FL_COLOR col FL_UNUSED_ARG ) { float yc = y + h * 0.5; float xc = x + w * 0.5; float dx, dy; int d = 3 + ( w + h ) * 0.06; dx = w / 2 - d; dy = h / 2 - d; if ( angle == 90 ) { flps_line( xc, yc + dy, xc - dx, yc - dy, FL_LEFT_BCOL ); flps_line( xc - dx, yc - dy, xc + dx, yc - dy, FL_BOTTOM_BCOL ); flps_line( xc + dx, yc - dy, xc, yc + dy, FL_RIGHT_BCOL ); } else if ( angle == 180 ) { flps_line( xc - dx, yc, xc + dx, yc + dy, FL_TOP_BCOL ); flps_line( xc + dx, yc + dy, xc + dx, yc - dy, FL_RIGHT_BCOL ); flps_line( xc + dx, yc - dy, xc - dx, yc, FL_BOTTOM_BCOL ); } else if ( angle == 270 ) { flps_line( xc - dx, yc + dy, xc, yc - dy, FL_BOTTOM_BCOL ); flps_line( xc, yc - dy, xc + dx, yc + dy, FL_RIGHT_BCOL ); flps_line( xc + dx, yc + dy, xc - dx, yc + dy, FL_TOP_BCOL ); } else { flps_line( xc, yc - dy, xc + w, yc, FL_BOTTOM_BCOL ); flps_line( xc, yc + dy, xc + w, yc, FL_RIGHT_BCOL ); flps_line( xc, yc - dy, xc, yc + dy, FL_LEFT_BCOL ); } } /*************************************** ***************************************/ static void draw_dnarrow( int x, int y, int w, int h, int angle, FL_COLOR col FL_UNUSED_ARG ) { float yc = y + h * 0.5; float xc = x + w * 0.5; float dx, dy; int d = 3 + ( w + h ) * 0.06; dx = w / 2 - d; dy = h / 2 - d; if ( angle == 90 ) { flps_line( xc, yc + dy, xc - dx, yc - dy, FL_RIGHT_BCOL ); flps_line( xc - dx, yc - dy, xc + dx, yc - dy, FL_TOP_BCOL ); flps_line( xc + dx, yc - dy, xc, yc + dy, FL_TOP_BCOL ); } else if ( angle == 180 ) { flps_line( xc - dx, yc, xc + dx, yc + dy, FL_RIGHT_BCOL ); flps_line( xc + dx, yc + dy, xc + dx, yc - dy, FL_LEFT_BCOL ); flps_line( xc + dx, yc - dy, xc - dx, yc, FL_TOP_BCOL ); } else if ( angle == 270 ) { flps_line( xc - dx, yc + dy, xc, yc - dy, FL_RIGHT_BCOL ); flps_line( xc, yc - dy, xc + dx, yc + dy, FL_LEFT_BCOL ); flps_line( xc + dx, yc + dy, xc - dx, yc + dy, FL_BOTTOM_BCOL ); } else { flps_line( xc - dx, yc - dy, xc - dx, yc + dy, FL_RIGHT_BCOL ); flps_line( xc - dx, yc - dy, xc + dx, yc, FL_TOP_BCOL ); flps_line( xc - dx, yc + dy, xc + dx, yc, FL_BOTTOM_BCOL ); } } /*************************************** * need single pixel precision, draw in abs. coordiante system ***************************************/ static void draw_ripple_lines( int x, int y, int w, int h, int angle, FL_COLOR col FL_UNUSED_ARG ) { float ym = y + h / 2, ys; float xm = x + w / 2, xs; int i, mw = FL_BOUND_WIDTH; if ( h < 14 ) return; xs = xm + 5; ys = ym + 5; if ( angle == 90 || angle == 270 ) { for ( i = 0; i < 3; i++ ) { flps_line( xs, y + mw, xs, y + h - mw - 1, FL_RIGHT_BCOL ); xs -= 1; flps_line( xs, y + mw, xs, y + h - mw - 1, FL_LEFT_BCOL ); xs -= 3; } } else { for ( i = 0; i < 3; i++ ) { flps_line( x + mw, ys, x + w - mw - 1, ys, FL_LEFT_BCOL ); ys -= 1; flps_line( x + mw, ys, x + w - mw - 1, ys, FL_RIGHT_BCOL ); ys -= 3; } } } #define AddVertex( p, xp, yp) do { \ p->x = xp; \ p->y = yp; \ p++; \ } while ( 0 ) /*************************************** ***************************************/ static void draw_bararrowhead( int x, int y, int w, int h, int angle, FL_COLOR col ) { float xc = x + 0.5 * w, yc = y + 0.5 * h; int d = 3 + ( w + h ) * 0.06; float dx, dy, mar, dbar, xl; FL_POINT point[ 5 ], *p; x += d; y += d; w -= 2 * d; h -= 2 * d; dx = w / 2; dy = h / 2; dbar = dx * 0.4; mar = 0.2 * dx; flps_output( "gsave %.1f %.1f translate %d rotate\n", xc, yc, angle ); xl = -dx + 1.1 * mar; p = point; AddVertex( p, xl, -dy ); AddVertex( p, xl + dbar, -dy ); AddVertex( p, xl + dbar, dy ); AddVertex( p, xl, dy ); flps_poly( 1, point, 4, col ); flps_poly( 0, point, 4, FL_RIGHT_BCOL ); p = point; AddVertex( p, -mar, -dy ); AddVertex( p, -mar + dx, 0 ); AddVertex( p, -mar, dy ); flps_poly( 1, point, 3, col ); flps_poly( 0, point, 3, FL_RIGHT_BCOL ); flps_output( "grestore\n" ); } /* all PS drawings have a size of 2 pixels and centered at origin */ static PS_draw psdraw[ ] = { { "returnarrow", "symreturnarrow", "-0.8 0.0 -0.1 0.7 -0.1 0.05 0.6 0.05 0.6 0.7 0.7 0.7 0.7 -0.05\n" "-0.1 -0.05 -0.1 -0.7 9 P", 0, 0, 0, 0 }, { "->", "symrarrow", "-0.8 -0.4 -0.8 0.4 0 0.4 0 0.8 0.8 0 0 -0.8 0 -0.4 7 P", 0, 0, 0, 0 }, { "<-", "180 rotate", 0, -1, 0, 0, 0 }, { ">", "symrarrowh", "-0.2 0.7 M 0.5 0.0 LT -0.2 -0.7 LT C", 0, 0, 0, 0 }, { "<", "180 rotate", 0, -1, 0, 0, 0 }, { "<->", "symdarrow", "-0.25 0.4 0.25 0.4 0.25 0.8 0.85 0 0.25 -0.8 0.25 -0.4 -0.25 -0.4\n" "-0.25 -0.8 -0.85 0 -0.25 0.8 10 P", 0, 0, 0, 0 }, { "plus", "symplus", "-0.9 -0.13 -0.9 0.13 -0.13 0.13 -0.13 0.9 0.13 0.9 0.13 0.13 0.9 0.13\n" "0.9 -0.13 0.13 -0.13 0.13 -0.9 -0.13 -0.9 -0.13 -0.13 12 P", 0, 0, 0, 0 }, { ">>", "symdarrowh", "0.15 0.7 0.85 0 0.15 -0.7 0.15 -0.001 -0.55 -0.7 -0.55 0.7 0.15 0.001\n" "7 P", 0, 0, 0, 0 }, { "<<", "180 rotate", 0, -1, 0, 0, 0 }, { "arrow", "symthinarrow", "-0.9 0.02 M 0.65 0.02 LT 0.65 0.15 LT 0.9 0 LT 0.65 -0.15 LT\n" "0.65 -0.02 LT -0.9 -0.02 LT C", 0, 0, 0, 0 }, { "circle", "symcircle", "0 0 0.77 0 360 arc", 0, 0, 0, 0 }, { "square", "symsquare", "-0.77 -0.77 M -0.77 0.77 LT 0.77 0.77 LT 0.77 -0.77 LT C", 0, 0, 0, 0 }, { "line", "symline", "-0.97 0.01 M 0.97 0.01 LT 0.97 -0.01 LT -0.08 -0.01 LT C", 0, 0, 0, 0 }, { "->|", "symarrowbar", "-0.75 0.35 -0.1 0.35 -0.1 0.75 0.6 0.001 0.6 0.75 0.75 0.75\n" " 0.75 -0.75 0.6 -0.75 0.6 -0.001 -0.1 -0.75 -0.1 -0.35 -0.75 " "-0.35 12 P\n", 0, 0, 0, 0 }, { "|<-", "180 rotate", 0, -1, 0, 0, 0 }, { ">|", "symarrowheadbar", /* bar 0.25 */ "-0.60 0.7 0.22 0.001 0.22 0.7 0.47 0.7 0.47 -0.7 0.22 -0.7\n" " 0.22 -0.001 -0.60 -0.7 8 P", 0, 0, 0, 0 }, { "|<", "180 rotate", 0, -1, 0, 0, 0 }, { "|>", "symbararrowhead", 0, -1, draw_bararrowhead, 1, 0 }, { "DnLine", "symdnline", 0, -1, draw_dnline, 0, 0 }, { "dnline", "symdnline", 0, -1, draw_dnline, 0, 0 }, { "UpLine", "symupline", 0, -1, draw_upline, 0, 0 }, { "upline", "symupline", 0, -1, draw_upline, 0, 0 }, { "UpArrow", "symuparrow", 0, -1, draw_uparrow, 1, 0 }, { "DnArrow", "symdnarrow", 0, -1, draw_dnarrow, 1, 0 }, { "=", "symRippleLines", 0, -1, draw_ripple_lines, 1, 0 }, /* aliases */ { "RippleLines", "symRippleLines", 0, -1, draw_ripple_lines, 1, 0 }, { "+", "symplus", "-0.9 -0.13 -0.9 0.13 -0.13 0.13 -0.13 0.9 0.13 0.9 0.13 0.13 0.9 0.13\n" "0.9 -0.13 0.13 -0.13 0.13 -0.9 -0.13 -0.9 -0.13 -0.13 12 P", 0, 0, 0, 0 }, { "-->", "symthinarrow", "-0.9 0.02 M 0.65 0.02 LT 0.65 0.15 LT 0.9 0 LT 0.65 -0.15 LT\n" "0.65 -0.02 LT -0.9 -0.02 LT C", 0, 0, 0, 0 } }; /*************************************** ***************************************/ static void define_symbol( PS_draw * p ) { if ( ! p->defined && ! p->fdrawit ) { if ( p->otherdef ) define_symbol( p + p->otherdef ); else flps_output( "/%s {%s} BD\n", p->psname, p->draw ); p->defined = 1; } } /*************************************** * invalidate symbols cache ***************************************/ void flps_invalidate_symbol_cache( void ) { PS_draw *p = psdraw, *ps = psdraw + sizeof psdraw / sizeof *psdraw; for ( ; p < ps; p++ ) p->defined = 0; } /*************************************** ***************************************/ static PS_draw * find( const char * s ) { PS_draw *p = psdraw, *ps = psdraw + sizeof psdraw / sizeof *psdraw; for ( ; p < ps; p++ ) if ( strcmp( s, p->name ) == 0 ) { define_symbol( p ); return p; } return NULL; } #define swapit( t, a, b ) do { \ t t_; \ t_ = a; \ a = b; \ b = t_; \ } while ( 0 ) /*************************************** ***************************************/ int flps_draw_symbol( const char * label, int x, int y, int w, int h, FL_COLOR col ) { int pos, shift, equalscale = 0; short defr[ ] = { 0, 225, 270, 315, 180, 0, 0, 135, 90, 45 }; PS_draw *s; int rotated = 0; int sw = w, sh = h; int delta = 0; if ( ! label || *label != '@' ) return 0; if ( flps->verbose ) fprintf( flps->fp, "%%Symbol %s: %d %d %d %d\n", label + 1, x, y, w, h ); x += 1.2; y += 1.2; w -= 2.4; h -= 2.4; /* check special operators */ pos = 1; while ( ( label[ pos ] == '-' && isdigit( ( int ) label[ pos + 1 ] ) ) || ( label[ pos ] == '+' && isdigit( ( int ) label[ pos + 1 ] ) ) || label[pos] == '#' ) { switch ( label[ pos ] ) { case '+' : delta = '0' - label[ ++pos ]; break; case '-' : delta = label[ ++pos ] - '0'; break; case '#' : equalscale = 1; break; } pos++; } shift = pos; if ( label[ pos ] >= '1' && label[ pos ] <= '9' ) { rotated = defr[ label[ pos ] - '0' ]; shift = pos + 1; } else if ( label[ pos ] == '0' ) { rotated = 100 * ( label[ pos + 1 ] - '0' ) + 10 * ( label[ pos + 2 ] - '0' ) + 1 * ( label[ pos + 3 ] - '0' ); shift = pos + 4; } /* short hand with @4 etc */ if ( ! ( s = ( label[ shift ] ? find( label + shift ) : psdraw ) ) ) { fprintf( stderr, "Bad label %s\n", label + shift ); if ( flps->verbose ) fprintf( flps->fp, "%% unknown symbol %s. Not drawn\n", label ); return 0; } if ( equalscale ) sw = sh = FL_min( w, h ); if ( delta ) { if ( s->abs_coordinate ) { x += delta; y += delta; } sw -= 2 * delta; sh -= 2 * delta; } if ( sw <= 5 ) sw = 5; if ( sh <= 5 ) sw = 5; if ( ! s->abs_coordinate ) { flps_output( "gsave\n%.1f %.1f translate %.1f %.1f scale %d rotate ", x + 0.5 * w, y + 0.5 * h, 0.5 * sw, 0.5 * sh, rotated ); flps_output( "%.3f %.3f LW\n", 3.0 / ( sw + sh ), 3.0 / ( sh + sw ) ); } if ( s->fdrawit ) { s->fdrawit( x, y, w, h, rotated, col ); if ( ! s->abs_coordinate ) flps_output( "grestore\n" ); flps_invalidate_color_cache( ); return 1; } if ( s->otherdef ) { flps_output( "%s ", s->psname ); s = s + s->otherdef; } flps_color( col ); flps_output( "%s F ", s->psname ); flps_color( FL_BLACK ); flps_output( "%s S\n", s->psname ); flps_output( "grestore\n" ); flps_reset_cache( ); return 1; } /*************************************** ***************************************/ void flps_emit_prolog( void ) { /* basic graphics defines */ flps_output( "/BD {bind def} def\n" ); flps_output( "/M {moveto} BD /LT {lineto} BD\n" ); flps_output( "/RLT {rlineto} BD\n" ); flps_output( "/L {M LT} BD /C {closepath} BD\n" ); flps_output( "/LW {setlinewidth} BD\n" ); flps_output( "/S {stroke} BD /F {fill} BD\n" ); flps_output( "/G {setgray} BD /RGB {setrgbcolor} BD\n" ); /* x y x y N */ flps_output( "/P {3 1 roll M 2 exch 1 exch {pop LT} for C} BD\n" ); flps_output( "/lines {3 1 roll M 2 exch 1 exch {pop LT} for S} BD\n" ); flps_output( "/DTD {[5 4 1 4] 0 setdash} BD\n" ); /* dot-dash */ flps_output( "/DT {[1 3] 0 setdash} BD\n" ); /* dot */ flps_output( "/LD {[8 5] 0 setdash} BD\n" ); /* long dash */ flps_output( "/D {[4 4] 0 setdash} BD\n" ); /* dash */ flps_output( "/SL {[] 0 setdash} BD\n" ); /* solid */ flps_output( "/NP {newpath} BD\n" ); /* solid */ flps_output( "/SX %.2g def /SY %.2g def\n", flps->final_xscale, flps->final_yscale ); /* basic font support */ flps_output( "/point {SX SY add 2 div div} BD\n" ); flps_output( "/SetFont {findfont exch scalefont setfont} BD\n" ); flps_output( "/Lshow {show} BD\n" ); flps_output( "/Cshow {dup stringwidth pop -2 div 0 rmoveto show} BD\n" ); flps_output( "/Rshow {dup stringwidth pop neg 0 rmoveto show} BD\n" ); flps_output( "/CP {currentpoint} BD /SW {stringwidth} BD\n" ); } /*************************************** ***************************************/ void flps_emit_header( const char * title, int n, int xi, int yi, int xf, int yf ) { if ( flps->eps ) fprintf( flps->fp, "%%!PS-Adobe-3.0 EPSF-2.0\n" ); else fprintf( flps->fp, "%%!PS-Adobe-1.0\n" ); fprintf( flps->fp, "%%%%Title: %s\n", title ); fprintf( flps->fp, "%%%%For: %s\n", fl_whoami( ) ); fprintf( flps->fp, "%%%%CreateDate: %s\n", fl_now( ) ); fprintf( flps->fp, "%%%%Creator: xforms V%d.%d.%s " "Copyright (c) 1997-1999 T.C. Zhao and M. Overmars\n", FL_VERSION, FL_REVISION, FL_FIXLEVEL ); fprintf( flps->fp, "%%%%Pages: %d\n", n ); fprintf( flps->fp, "%%%%BoundingBox: %d %d %d %d\n", xi, yi, xf, yf ); fprintf( flps->fp, "%%%%Orientation: %s\n", flps->landscape ? "Landscape" : "Portrait" ); fprintf( flps->fp, "%%%%EndComments\n" ); fprintf( flps->fp, "%% PaperSize: %.1fx%.1fin\n", flps->paper_w, flps->paper_h ); } /*************************************** ***************************************/ void flps_set_clipping( int x, int y, int w, int h ) { #if 0 /* rectclip is a level 2 feature */ flps_output( "gsave NP %d %d %d %d rectclip\n", x, y, w, h ); #else flps_output( "gsave NP %d %d M %d 0 RLT 0 %d RLT %d neg 0 RLT CP clip NP\n", x, y, w, h, w ); #endif } /*************************************** ***************************************/ void flps_unset_clipping( void ) { flps_output( "grestore\n" ); flps_reset_cache( ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_pnm.c0000644000175000017500000002451512251675262013156 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1993, 1998-2002 By T.C. Zhao * All rights reserved. * * PNM support */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" #include #include #include typedef struct { float fnorm; int pgm, pbm; int maxval; int w, h; int raw; /* binary */ char s[ 4 ]; /* signature */ } SPEC; /*************************************** ***************************************/ static int PPM_identify( FILE * fp ) { char buf[ 2 ]; if ( fread( buf, 1, 2, fp ) != 2 ) return 0; rewind( fp ); return buf[ 0 ] == 'P' && ( buf[ 1 ] == '3' || buf[ 1 ] == '6' ); } /*************************************** ***************************************/ static int PGM_identify(FILE * fp) { char buf[ 2 ]; if ( fread(buf, 1, 2, fp) != 2 ) return 0; rewind(fp); return buf[ 0 ] == 'P' && ( buf[ 1 ] == '2' || buf[ 1 ] == '5' ); } /*************************************** ***************************************/ static int PBM_identify( FILE * fp ) { char buf[ 2 ]; if ( fread(buf, 1, 2, fp ) != 2 ) return 0; rewind(fp); return buf[ 0 ] == 'P' && ( buf[ 1 ] == '1' || buf[ 1 ] == '4' ); } /*************************************** ***************************************/ static void generate_header_info( FL_IMAGE *im ) { SPEC *sp = im->io_spec; if ( ! im->setup->header_info || ! ( im->info = fl_malloc( 128 ) ) ) return; sprintf( im->info,"Size=(%d x %d)\nMaxVal=%d\nRaw=%d\n", im->w, im->h, sp->maxval, sp->raw ); } /*************************************** ***************************************/ static int PNM_description( FL_IMAGE * im ) { SPEC *sp = fl_malloc( sizeof *sp ); char s[ 3 ]; if ( fread( s, 1, 2, im->fpin ) != 2 ) { flimage_error( im, "%s: error reading pnm file", im->infile ); fl_free( sp ); im->io_spec = 0; return -1; } im->io_spec = sp; s[ 2 ] = '\0'; if ( ( sp->w = fli_readpint( im->fpin ) ) <= 0 || ( sp->h = fli_readpint( im->fpin ) ) <= 0 ) { flimage_error( im, "%s: can't get image size", im->infile ); fl_free( sp ); im->io_spec = 0; return -1; } im->w = sp->w; im->h = sp->h; sp->raw = s[ 1 ] == '6' || s[ 1 ] == '5' || s[ 1 ] == '4'; sp->pgm = s[ 1 ] == '5' || s[ 1 ] == '2'; sp->pbm = s[ 1 ] == '4' || s[ 1 ] == '1'; if ( ! sp->pbm ) sp->maxval = fli_readpint( im->fpin ); else sp->maxval = 1; if ( sp->maxval > 255 && sp->raw ) { im->error_message( im, "can't handle 2byte raw ppm file" ); return -1; } im->type = FL_IMAGE_RGB; if ( sp->pgm ) im->type = sp->maxval > 256 ? FL_IMAGE_GRAY16 : FL_IMAGE_GRAY; if (sp->pbm) im->type = FL_IMAGE_MONO; sp->fnorm = ( FL_PCMAX + 0.001 ) / sp->maxval; im->gray_maxval = sp->maxval; if( im->setup->header_info ) generate_header_info( im ); return sp->maxval < 0 ? -1 : 1; } /*************************************** ***************************************/ static int PNM_read_pixels( FL_IMAGE * im ) { int i, npix = im->w * im->h; SPEC *sp = im->io_spec; if ( im->type == FL_IMAGE_RGB ) { unsigned char *r = im->red[ 0 ]; unsigned char *g = im->green[ 0 ]; unsigned char *b = im->blue[ 0 ]; if ( sp->raw ) { for ( i = 0; i < npix; i++ ) { *r++ = getc( im->fpin ); *g++ = getc( im->fpin ); *b++ = getc( im->fpin ); } } else { for ( i = 0; i < npix; i++ ) { *r++ = ( unsigned char ) ( fli_readpint( im->fpin ) * sp->fnorm ); *g++ = ( unsigned char ) ( fli_readpint( im->fpin ) * sp->fnorm ); *b++ = ( unsigned char ) ( fli_readpint( im->fpin ) * sp->fnorm ); } if ( sp->maxval != FL_PCMAX ) { r = im->red[ 0 ]; g = im->green[ 0 ]; b = im->blue[ 0 ]; for ( i = 0; i > npix; i++ ) { r[ i ] = ( unsigned char ) ( r[ i ] * sp->fnorm ); g[ i ] = ( unsigned char ) ( g[ i ] * sp->fnorm ); b[ i ] = ( unsigned char ) ( b[ i ] * sp->fnorm ); } } } } else if ( FL_IsGray( im->type ) ) { unsigned short *gray = im->gray[0]; if ( sp->raw ) for ( i = 0; i < npix; i++ ) gray[ i ] = getc( im->fpin ); else for ( i = 0; i < npix; i++ ) gray[ i ] = fli_readpint( im->fpin ); } else if ( im->type == FL_IMAGE_MONO ) { unsigned short *ci = im->ci[ 0 ], *cend = ci + npix; if ( sp->raw ) { for ( i = 0; i < im->h; i++ ) { int err, bit, k; cend = ( ci = im->ci[ i ] ) + im->w; for ( k = bit = err = 0; ! err && ci < cend; ci++, bit++ ) { if ( ! ( bit &= 7 ) ) k = getc( im->fpin ); err = k == EOF; *ci = ( k & 0x80 ) ? 1 : 0; k <<= 1; } } } else { for ( ; ci < cend; ci++ ) *ci = fli_readpint( im->fpin ) > 0; } } else im->error_message( im, "Unsupported PNM image" ); return 1; } /* write routine */ static int rawfmt = 1; /*************************************** ***************************************/ void flimage_pnm_output_options( int raw ) { rawfmt = raw != 0; } /*************************************** ***************************************/ static int PNM_write_image( FL_IMAGE * im ) { int i, j, n = im->w * im->h, is_gray16; int pgm, pbm, raw = rawfmt; FILE *fp = im->fpout; char *sig; if ( im->type == FL_IMAGE_PACKED || im->type == FL_IMAGE_CI ) flimage_convert( im, FL_IMAGE_RGB, 0 ); pgm = FL_IsGray( im->type ); is_gray16 = im->type == FL_IMAGE_GRAY16; pbm = im->type == FL_IMAGE_MONO; if ( is_gray16 ) raw = 0; sig = pgm ? ( raw ? "P5" : "P2" ) : ( pbm ? ( raw ? "P4" : "P1" ) : ( raw ? "P6" : "P3" ) ); fprintf( fp, "%s\n%d %d\n", sig, im->w, im->h ); if ( ! pbm ) fprintf( fp, "%d\n", is_gray16 ? im->gray_maxval : FL_PCMAX ); if ( im->type == FL_IMAGE_RGB ) { unsigned char *r = im->red[ 0 ], *g = im->green[ 0 ], *b = im->blue[ 0 ]; for ( i = 0; i < n; r++, g++, b++, i++ ) { if ( raw ) { putc( *r, fp ); putc( *g, fp ); putc( *b, fp ); } else { fprintf( fp, "%4d %4d %4d ", *r, *g, *b ); if ( ( i + 1 ) % 5 == 0 ) putc( '\n', fp ); } } } else if ( FL_IsGray( im->type ) ) { unsigned short *gray = im->gray[ 0 ]; int newline = is_gray16 ? 14 : 17; for ( i = 0; i < n; gray++, i++ ) { if ( raw ) putc( *gray, fp ); else { fprintf( fp, is_gray16 ? "%4d " : "%4d", *gray ); if ( i % newline == 0 ) putc( '\n', fp ); } } } else if ( im->type == FL_IMAGE_MONO ) { unsigned short *ci, *cend; int bit; for ( j = 0, i = 1; j < im->h; j++ ) { cend = ( ci = im->ci[ j ] ) + im->w; if ( !raw ) { for ( ; ci < cend; ci++, i++ ) { fputs( *ci ? "1 " : "0 ", fp ); if ( i % 34 == 0 ) putc( '\n', fp ); } } else { for ( bit = 0, i = 0; ci < cend; ci++ ) { i = ( i << 1 ) | *ci; if ( ++bit == 8 ) { putc( i, fp ); bit = i = 0; } } if ( bit ) { i <<= 8 - bit; putc( i, fp ); } } } } if ( ! raw ) putc( '\n', fp ); return 0; } /*************************************** ***************************************/ void flimage_enable_pnm( void ) { flimage_add_format( "Portable Pixmap", "ppm", "ppm", FL_IMAGE_RGB, PPM_identify, PNM_description, PNM_read_pixels, PNM_write_image); flimage_add_format( "Portable Graymap", "pgm", "pgm", FL_IMAGE_GRAY | FL_IMAGE_GRAY16, PGM_identify, PNM_description, PNM_read_pixels, PNM_write_image); flimage_add_format( "Portable Bitmap", "pbm", "pbm", FL_IMAGE_MONO, PBM_identify, PNM_description, PNM_read_pixels, PNM_write_image); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/ps_text.c0000644000175000017500000002651712251675174012716 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1997-2002 by T.C. Zhao * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/pflps.h" #include extern char *fl_ul_magic_char; /* * Text stuff. Default fonts follows the XFORM built-in */ static const char *fnts[ FL_MAXFONTS ] = { "Helvetica", "Helvetica-Bold", "Helvetica-Oblique", "Helvetica-BoldOblique", "Courier", "Courier-Bold", "Courier-Oblique", "Courier-BoldOblique", "Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic", /* xforms users charter */ "Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic", "Symbol" }; /*************************************** ***************************************/ void flps_invalidate_font_cache( void ) { flps->cur_style = flps->cur_size = -1; } /*************************************** ***************************************/ void flps_set_font( int style, int size ) { if ( style >= FL_SHADOW_STYLE ) style %= FL_SHADOW_STYLE; if ( style == flps->cur_style && size == flps->cur_size ) return; if ( flps->scale_text ) size = 0.5 * ( flps->final_xscale + flps->final_yscale ); flps_output( "%d point /%s SetFont\n", size, fnts[ style ] ); flps_output( "/H %d point def\n", size ); flps->cur_style = style; flps->cur_size = size; } #define has_desc( s ) ( strchr( s, 'g' ) \ || strchr( s, 'j' ) \ || strchr( s, 'q' ) \ || strchr( s, 'y' ) \ || strchr( s, 'p' ) ) #define is_desc( c ) ( c == 'g' \ || c == 'j' \ || c == 'q' \ || c == 'y' \ || c == 'p' ) /*************************************** ***************************************/ static void do_underline( const char * s, int n ) { flps_output( "/len (%s) SW pop def\n", s ); if ( n == -1 ) { flps_output( "/ty CP exch pop %d sub def ", 1 + has_desc( s ) * 2 ); flps_output( "/tx CP pop len sub def " ); flps_output( "tx ty M len tx add ty LT S\n" ); } else { char *t = fl_strdup( s ); t[ n ] = '\0'; flps_output( "/ul (%c) SW pop def\n", s[ n ] ); flps_output( "/ty CP exch pop %d sub def ", 1 + is_desc( s [ n ] ) * 2 ); flps_output( "/tx CP pop len sub (%s) SW pop add def\n", t ); flps_output( "tx ty M ul tx add ty LT S\n" ); fl_free( t ); } } #define Quote( c ) ( c == '(' || c == ')' || c == '%') /*************************************** ***************************************/ static char * ps_quote( char * str ) { static char buf[ 1024 ]; char *s, *q = buf; for ( s = str; *s; s++ ) { if ( Quote( *s ) ) *q++ = '\\'; *q++ = *s; } *q = '\0'; return buf; } /*************************************** * This routine is always called by other routines. Once we get here, * the text would always remain within the box specified by * {x,y,w,h}. ***************************************/ static void flps_drw_text( int align, float x, float y, float w, float h, FL_COLOR c, int style, int size, const char * sstr ) { int ulpos = -1, lnumb; int i; char *lines[ 512 ]; char *str; char newlabel[ 255 ], *p; float bw = 2; int halign, valign; int is_vert; flps_color( c ); flps_set_font( style, size ); str = fl_strdup( sstr ); lines[ 0 ] = str; if ( ( is_vert = align & FL_ALIGN_VERT ) ) { align &= ~ FL_ALIGN_VERT; flps_output( "gsave %.1f %.1f translate 90 rotate\n", x, y ); x = y = 0; } /* this is a hack to get arbitary rotation for image_postscript */ if ( flps->rotation ) { flps_output( "gsave %.1f %.1f translate %g rotate\n", x, y, flps->rotation * 0.1 ); x = y = 0; } /* split (multi-line)string into lines */ for ( i = 0, lnumb = 1; str[ i ] != '\0'; i++ ) { if ( str[ i ] == '\n') { str[ i ] = '\0'; lines[ lnumb ] = str + i + 1; lnumb++; } } fli_get_hv_align( align, &halign, &valign ); /* figure out where the starting point is */ switch ( halign ) { case FL_ALIGN_CENTER : flps_output( "/x %.1f def ", x + 0.5 * w ); break; case FL_ALIGN_LEFT : flps_output( "/x %.1f def ", bw + x ); break; case FL_ALIGN_RIGHT : flps_output( "/x %.1f def ", x + w - 1 - bw ); break; } switch ( valign ) { case FL_ALIGN_TOP : flps_output( "/y %.1f H sub def\n", y + h - bw ); break; case FL_ALIGN_BOTTOM : flps_output( "/y %.1f %.1f H mul add def\n", y + bw, lnumb - 0.9 ); break; case FL_ALIGN_CENTER : flps_output( "/y %.1f %.1f H mul add def\n", y + 0.5 * h, 0.5 * lnumb - 0.9 ); break; } for ( i = 0; i < lnumb; i++ ) { /* check if have underline request */ if ( ( p = strchr( lines[ i ], *fl_ul_magic_char ) ) ) { char *q; ulpos = p - lines[ i ]; q = newlabel; p = lines[ i ]; for ( ; *p; p++ ) if ( *p != *fl_ul_magic_char ) *q++ = *p; *q = 0; lines[ i ] = newlabel; } flps_output( "x y M " ); switch ( halign ) { case FL_ALIGN_CENTER : flps_output( "(%s) Cshow\n", ps_quote( lines[ i ] ) ); break; case FL_ALIGN_LEFT : flps_output( "(%s) Lshow\n", ps_quote( lines[ i ] ) ); break; case FL_ALIGN_RIGHT : flps_output( "(%s) Rshow\n", ps_quote( lines[ i ] ) ); break; } if ( ulpos >= 0 ) do_underline( lines[ i ], ulpos - 1 ); ulpos = -1; if ( i != lnumb - 1 ) flps_output( "/y y H sub def\n" ); } fl_free( str ); if ( is_vert || flps->rotation ) flps_output( "grestore\n" ); } #define D( x, y, c ) flps_drw_text( align, x, y, w, h, c, style, size, str ) /*************************************** ***************************************/ void flps_draw_text( int align, int x, int y, int w, int h, FL_COLOR col, int style, int size, const char * istr ) { int special = FL_INVALID_STYLE; const char *str = istr; if ( ! str || ! *str ) return; if ( *str == '@' && str[ 1 ] != '@' ) { if ( w < 3 || h < 3 ) { w = h = size + 4; x -= w / 2; y -= h / 2; } flps_draw_symbol( str, x, y, w, h, col ); return; } str += str[ 1 ] == '@'; if ( special_style( style ) ) { special = ( style / FL_SHADOW_STYLE ) * FL_SHADOW_STYLE; style %= FL_SHADOW_STYLE; } if ( special == FL_SHADOW_STYLE ) D( x + 2, y - 2, FL_BOTTOM_BCOL ); else if ( special == FL_ENGRAVED_STYLE ) { D( x - 1, y, FL_RIGHT_BCOL ); D( x, y + 1, FL_RIGHT_BCOL ); D( x - 1, y + 1, FL_RIGHT_BCOL ); D( x + 1, y, FL_LEFT_BCOL ); D( x, y - 1, FL_LEFT_BCOL ); D( x + 1, y - 1, FL_LEFT_BCOL ); } else if ( special == FL_EMBOSSED_STYLE ) { D( x - 1, y, FL_TOP_BCOL ); D( x, y + 1, FL_TOP_BCOL ); D( x - 1, y + 1, FL_TOP_BCOL ); D( x + 1, y, FL_RIGHT_BCOL ); D( x, y - 1, FL_RIGHT_BCOL ); D( x + 1, y - 1, FL_RIGHT_BCOL ); } flps_drw_text( align, x, y, w, h, col, style, size, str ); } /*************************************** ***************************************/ void flps_draw_text_beside( int align, int x, int y, int w, int h, FL_COLOR col, int style, int size, const char * str ) { if ( ! str || ! *str ) return; switch( fl_to_outside_lalign( align ) ) { case FL_ALIGN_LEFT : flps_draw_text( FL_ALIGN_RIGHT, x - h, y, h, h, col, style, size, str ); break; case FL_ALIGN_RIGHT : flps_draw_text( FL_ALIGN_LEFT, x + w, y, h, h, col, style, size, str ); break; case FL_ALIGN_TOP : flps_draw_text( FL_ALIGN_BOTTOM, x, y + h, w, h, col, style, size, str ); break; case FL_ALIGN_BOTTOM : flps_draw_text( FL_ALIGN_TOP, x, y - h, w, h, col, style, size, str ); break; case FL_ALIGN_LEFT_BOTTOM : flps_draw_text( FL_ALIGN_LEFT_TOP, x, y - h, w, h, col, style, size, str ); break; case FL_ALIGN_RIGHT_BOTTOM : flps_draw_text( FL_ALIGN_RIGHT_TOP, x, y - h, w, h, col, style, size, str ); break; case FL_ALIGN_LEFT_TOP : flps_draw_text( FL_ALIGN_LEFT_BOTTOM, x, y + h, w, h, col, style, size, str ); break; case FL_ALIGN_RIGHT_TOP : flps_draw_text( FL_ALIGN_RIGHT_BOTTOM, x, y + h, w, h, col, style, size, str ); break; case FL_ALIGN_CENTER : flps_draw_text( FL_ALIGN_CENTER, x, y, w, h, col, style, size, str ); break; default : flps_draw_text( FL_ALIGN_TOP, x, y - h, w, h, col, style, size, str ); break; } } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_convolve.c0000644000175000017500000003042112251675333014207 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1993, 1998-2002 T.C. Zhao * All rights reserved. * * General colvolution routines for RGB and gray (both 8bit and 16bit) * images. 3x3 and 5x5 kernels are manually unrolled. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" /*********************************************************************** * Convolution *******************************************************************{***/ #define VectorP3( k, b, i ) ( k[ 0 ] * b[ i - 1 ] \ + k[ 1 ] * b[ i ] \ + k[ 2 ] * b[ i + 1 ] ) #define VectorP5( k, b, i ) ( k[ 0 ] * b[ i - 2 ] \ + k[ 1 ] * b[ i - 1 ] \ + k[ 2 ] * b[ i ] \ + k[ 3 ] * b[ i + 1 ] \ + k[ 4 ] * b[ i + 2 ] ) #define conv3x3( cm, m, r, c ) ( VectorP3( cm[ 0 ], m[ r - 1 ], c ) \ + VectorP3( cm[ 1 ], m[ r + 0 ], c ) \ + VectorP3( cm[ 2 ], m[ r + 1 ], c ) ) #define conv5x5( kernel, pc, row, col ) \ ( VectorP5( kernel[ 0 ], pc[ row - 2 ], col ) \ + VectorP5( kernel[ 1 ], pc[ row - 1 ], col ) \ + VectorP5( kernel[ 2 ], pc[ row + 0 ], col ) \ + VectorP5( kernel[ 3 ], pc[ row + 1 ], col ) \ + VectorP5( kernel[ 4 ], pc[ row + 2 ], col ) ) /*************************************** ***************************************/ static int uc_conv5x5( int ** kernel, unsigned char ** pc, int r, int c ) { return conv5x5( kernel, pc, r, c ); } /*************************************** ***************************************/ static int us_conv5x5( int ** kernel, unsigned short ** s, int r, int c ) { return conv5x5( kernel, s, r, c ); } static void init_kernels(void); /* normalize with weight the clamp */ #define NormAndClamp( pc, w, max ) \ do { \ if ( pc < 0 ) \ pc = 0; \ else if ( ( pc /=w ) > ( max ) ) \ pc = ( max ); \ } while ( 0 ) /*************************************** ***************************************/ static void rgb_convolve( unsigned char ** red, unsigned char ** green, unsigned char ** blue, int h, int w, int ** kernel, int krow, int kcol, int weight, FL_IMAGE * im, const char * what ) { int newr, newg, newb, row, col; int k_halfh = krow / 2, k_halfw = kcol / 2; for ( h -= k_halfw, w -= k_halfw, row = 1; row < h; row++ ) { if ( krow == 3 && kcol == 3 ) { for ( col = k_halfw; col < w; col++ ) { newr = conv3x3( kernel, red, row, col ); newg = conv3x3( kernel, green, row, col ); newb = conv3x3( kernel, blue, row, col ); NormAndClamp( newr, weight, FL_PCMAX ); NormAndClamp( newg, weight, FL_PCMAX ); NormAndClamp( newb, weight, FL_PCMAX ); red[ row ][ col ] = newr; green[ row ][ col ] = newg; blue[ row ][ col ] = newb; } } else if ( krow == 5 && kcol == 5 ) { for ( col = k_halfw; col < w; col++ ) { newr = uc_conv5x5( kernel, red, row, col ); newg = uc_conv5x5( kernel, green, row, col ); newb = uc_conv5x5( kernel, blue, row, col ); NormAndClamp( newr, weight, FL_PCMAX ); NormAndClamp( newg, weight, FL_PCMAX ); NormAndClamp( newb, weight, FL_PCMAX ); red[ row ][ col ] = newr; green[ row ][ col ] = newg; blue[ row ][ col ] = newb; } } else { int i, j, ccol, ii, jj; for ( col = k_halfw; col < w; col++ ) { newr = newg = newb = 0; ccol = col - k_halfw; for ( i = 0; i < krow; i++ ) { ii = row - k_halfh + i; for ( jj = ccol, j = 0; j < kcol; jj++, j++ ) { newr += kernel[ i ][ j ] * red[ ii ][ jj ]; newg += kernel[ i ][ j ] * green[ ii ][ jj ]; newb += kernel[ i ][ j ] * blue[ ii ][ jj ]; } } NormAndClamp( newr, weight, FL_PCMAX ); NormAndClamp( newg, weight, FL_PCMAX ); NormAndClamp( newb, weight, FL_PCMAX ); red[ row ][ col ] = newr; green[ row ][ col ] = newg; blue[ row ][ col ] = newg; } } if ( ! ( ++im->completed & FLIMAGE_REPFREQ ) ) im->visual_cue( im, what ); } } /*************************************** ***************************************/ static void gray_convolve( unsigned short ** gray, int h, int w, int ** kernel, int krow, int kcol, int weight, FL_IMAGE * im, const char * what ) { int newr, row, col; int k_halfh = krow / 2, k_halfw = kcol / 2; for ( h -= k_halfw, w -= k_halfw, row = 1; row < h; row++ ) { if ( krow == 3 && kcol == 3 ) { for (col = k_halfw; col < w; col++ ) { newr = conv3x3( kernel, gray, row, col ); NormAndClamp( newr, weight, FL_PCMAX ); gray[ row ][ col ] = newr; } } else if ( krow == 5 && kcol == 5 ) { for ( col = k_halfw; col < w; col++ ) { newr = us_conv5x5( kernel, gray, row, col ); NormAndClamp( newr, weight, im->gray_maxval ); gray[ row ] [col ] = newr; } } else { int i, j, ccol, ii, jj; for ( col = k_halfw; col < w; col++ ) { ccol = col - k_halfw; for ( newr = 0, i = 0; i < krow; i++ ) { ii = row - k_halfh + i; for ( jj = ccol, j = 0; j < kcol; jj++, j++ ) newr += kernel[ i ][ j ] * gray[ ii ][ jj ]; } NormAndClamp( newr, weight, FL_PCMAX ); gray[ row ][ col ] = newr; } } if ( ! ( ++im->completed & FLIMAGE_REPFREQ ) ) im->visual_cue( im, what ); } } static int **sharpen_kernel; static int **smooth_kernel; /*************************************** ***************************************/ int flimage_convolve( FL_IMAGE * im, int ** kernel, int krow, int kcol ) { int weight = 0, i; const char * what = "convolving"; char buf[ 128 ]; SubImage *sub; if ( !im || im->w <= 0 || im->type == FL_IMAGE_NONE ) { M_err( "Convolve", "bad image" ); return -1; } /* Check subimage settings */ if ( im->subw && ( im->subw < kcol || im->subh < krow ) ) { im->error_message( im, "Convolve: subimage size less than kernel" ); return -1; } if ( ! sharpen_kernel ) init_kernels( ); if ( kernel == FL_SHARPEN ) { kernel = sharpen_kernel; krow = kcol = 3; what = "sharpening"; } else if ( kernel == FL_SMOOTH ) { kernel = smooth_kernel; krow = kcol = 3; what = "smoothing"; } if ( ! ( krow & 1 ) || ! ( kcol & 1 ) ) M_err( "Convolve", "even or zero kernel size (row = %d, col = %d)!", krow, kcol ); for ( i = 0; i < kcol * krow; i++ ) weight += kernel[ 0 ][ i ]; if ( weight <= 0 ) { im->error_message( im, "bad kernel weight" ); return -1; } /* Always convert to RGB or GRAY */ if ( ! FL_IsGray( im->type ) ) flimage_convert( im, FL_IMAGE_RGB, 0 ); if ( ! ( sub = flimage_get_subimage( im, 1 ) ) ) return -1; im->completed = 0; im->visual_cue( im, what ); if ( FL_IsGray( im->type ) ) gray_convolve( sub->mat[ 0 ], sub->h, sub->w, kernel, krow, kcol, weight, im, what ); else rgb_convolve( sub->mat[ 0 ], sub->mat[ 1 ], sub->mat[ 2 ], sub->h, sub->w, kernel, krow, kcol, weight, im, what ); im->completed = im->total; sprintf( buf, "%s done", what ); im->visual_cue( im, buf ); if (im->subw) { fl_free_matrix( sub->mat[ 0 ] ); fl_free_matrix( sub->mat[ 1 ] ); fl_free_matrix( sub->mat[ 2 ] ); } im->modified = 1; return 0; } /*************************************** * Almost the same as convolve except the kernel is a proper C array * kernel[krow][kcol] ***************************************/ int flimage_convolvea( FL_IMAGE * im, int * kernel, int krow, int kcol ) { int **kk, status; if ( ! ( krow & 1 ) || ! ( kcol & 1 ) ) M_err( "Convolve", "even or zero kernel size (row = %d, col = %d)!", krow, kcol ); kk = fl_make_matrix( krow, kcol, sizeof **kk, kernel ); status = flimage_convolve( im, kk, krow, kcol ); fl_free_matrix( kk ); return status; } /********************************************************************** * some built-in kernels **********************************************************************/ static void init_kernels( void ) { sharpen_kernel = fl_get_matrix( 3, 3, sizeof( **sharpen_kernel ) ); smooth_kernel = fl_get_matrix( 3, 3, sizeof( **smooth_kernel ) ); sharpen_kernel[ 0 ][ 0 ] = -1; sharpen_kernel[ 0 ][ 1 ] = -2; sharpen_kernel[ 0 ][ 2 ] = -1; sharpen_kernel[ 1 ][ 0 ] = -2; sharpen_kernel[ 1 ][ 1 ] = 28; sharpen_kernel[ 1 ][ 2 ] = -2; sharpen_kernel[ 2 ][ 0 ] = -1; sharpen_kernel[ 2 ][ 1 ] = -2; sharpen_kernel[ 2 ][ 2 ] = -1; /* smoothing a bit stronger than sharpening */ smooth_kernel[ 0 ][ 0 ] = 1; smooth_kernel[ 0 ][ 1 ] = 2; smooth_kernel[ 0 ][ 2 ] = 1; smooth_kernel[ 1 ][ 0 ] = 2; smooth_kernel[ 1 ][ 1 ] = 7; smooth_kernel[ 1 ][ 2 ] = 2; smooth_kernel[ 2 ][ 0 ] = 1; smooth_kernel[ 2 ][ 1 ] = 2; smooth_kernel[ 2 ][ 2 ] = 1; } /*}********************************************************************* */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_postscript.c0000664000175000017500000005505612353623325014600 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1993, 1998-2002 By T.C. Zhao * All rights reserved. * * PostScript support. * * Do we want to integrate the stuff from ps_core.c, ps_draw.c and * postscript.c to consolidate ps support ? * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "flimage.h" #include "flimage_int.h" #include "private/flsnprintf.h" #ifndef FLPS_H #include "flps.h" #endif #include "private/pflps.h" #include #include #include typedef FLPSInfo SPEC; /*************************************** ***************************************/ FLPS_CONTROL * flimage_ps_options( void ) { static SPEC *sp; if ( ! sp ) { sp = fl_calloc( 1, sizeof *sp ); sp->orientation = FLPS_AUTO; sp->paper_w = 8.5; sp->paper_h = 11.0; sp->auto_fit = 1; sp->xdpi = sp->ydpi = fl_dpi; sp->printer_dpi = 300; sp->vm = sp->hm = 0.3; sp->xscale = sp->yscale = 1.0; sp->tmpdir = "/tmp"; sp->gamma = 1.0; sp->verbose = 0; sp->comment = 0; sp->pack = 0; sp->lastr = -1; sp->ps_color = 1; /* cache */ sp->cur_color = FLIMAGE_BADCOLOR; sp->cur_style = sp->cur_size = sp->cur_lw = -1; } return ( FLPS_CONTROL * ) sp; } /*************************************** ***************************************/ static int PS_identify( FILE * fp ) { char buf[ 2 ]; size_t c; c = fread( buf, 1, 2, fp ); rewind( fp ); return c == 2 && buf[ 0 ] == '%' && buf[ 1 ] == '!'; } /*************************************** * this is a fake to get past the driver ***************************************/ static int PS_description( FL_IMAGE * im ) { im->extra_io_info = fl_malloc( sizeof( SPEC ) ); memcpy( im->extra_io_info, flimage_ps_options( ), sizeof( SPEC ) ); im->w = im->h = 1; im->type = FL_IMAGE_RGB; return 0; } #define GS_DEVICE "ppmraw" #define FL_FILE "ppm" #define GS_OPTION "-q -DNOPAUSE" /*************************************** * load a specific page ***************************************/ static int load_page( FL_IMAGE * im, int pageNo ) { char name[ 1024 ], tmpf[ 1024 ]; SPEC *sp = im->extra_io_info; FLIMAGE_IO *fileIO; int status, n; fli_snprintf( name, sizeof name, "%s/%s_%d", sp->tmpdir, sp->prefix, pageNo ); if ( sp->verbose ) M_err( "LoadPage", "loading %s", name ); if ( ! ( n = flimage_is_supported( name ) ) ) { M_err( "LoadPage", "internal error. %s unknown", name ); return -1; } fclose( im->fpin ); im->fpin = fopen( name, "rb" ); strcpy( tmpf, im->infile ); strcpy( im->infile, name ); im->completed = pageNo; im->visual_cue( im, "Loading PostScript" ); /* re-direct the io handling */ im->image_io = fileIO = &flimage_io[ n - 1 ]; im->type = fileIO->type; fileIO->identify( im->fpin ); if ( ( status = fileIO->read_description( im ) ) >= 0 ) status = flimage_getmem( im ); if ( status >= 0 ) status = fileIO->read_pixels( im ); strcpy( im->infile, tmpf ); return status; } /*************************************** * delete all temporary files ***************************************/ static void PS_cleanup( FL_IMAGE * im ) { int i, n = im->total_frames >= 1 ? im->total_frames : 1; SPEC *sp = im->extra_io_info; char name[ 1024 ]; if ( ! sp ) return; for ( i = 1; i <= n; i++ ) { fli_snprintf( name, sizeof name, "%s/%s_%d", sp->tmpdir, sp->prefix, i ); if ( sp->verbose ) M_err( "Cleanup", "deleting %s", name ); remove( name ); } fl_free( sp->prefix ); fl_free( sp ); im->extra_io_info = 0; } /*************************************** ***************************************/ static const char * file_tail( char *s ) { char *p = strrchr( s, '/' ); return p ? ( p + 1 ) : s; } /*************************************** ***************************************/ static int PS_read_pixels( FL_IMAGE * im ) { char cmd[ 1024 ]; int npages, status; SPEC *sp = im->extra_io_info; FL_Dirlist *dirlist; const FL_Dirlist *dls, *dl; char prefix[ 1024 ]; int old_sort; /* the tmp file pattern will be /tmp/gs_$InputFile_$pid_pageNO */ fli_snprintf( prefix, sizeof prefix, "gs_%s_%d", file_tail( im->infile ), ( int ) fli_getpid( ) ); sp->prefix = strdup( prefix ); if ( sp->verbose ) M_err( "LoadPS", "prefix=%s", sp->prefix ); fli_snprintf( cmd, sizeof cmd, "gs -sDEVICE=%s %s -r%dx%d -sOutputFile=%s/%s_%%d -- %s %s", GS_DEVICE, GS_OPTION, (int) sp->xdpi, ( int ) sp->ydpi, sp->tmpdir, sp->prefix, im->infile, sp->first_page_only ? "/showpage { systemdict begin showpage quit end} def" : "" ); if ( sp->verbose ) M_err( "LoadPS", "executing %s\n", cmd ); else strcat( cmd, " 2 > /dev/null" ); im->completed = -1; /* indicate infinite/unknown */ im->visual_cue( im, "Converting PS ..." ); if ( ( status = system( cmd ) ) ) { M_err( "ReadPS", " status=%d", status ); flimage_error( im, "ReadPS failed. Status=%d", status ); /* return -1; */ } im->completed = 1; im->visual_cue( im, "Loading PostScript" ); /* we really do not need the current image stuff */ flimage_freemem( im ); /* find out how many pages we have. Turn off sorting, much faster */ old_sort = fl_set_dirlist_sort( FL_NONE ); dl = fl_get_dirlist( sp->tmpdir, strcat( prefix, "*" ), &npages, 1 ); fl_set_dirlist_sort( old_sort ); if ( ! ( dirlist = ( FL_Dirlist * ) dl ) ) { PS_cleanup( im ); return -1; } /* remove directories from the list */ for ( dls = dl + npages; dl < dls; dl++ ) if ( dl->type == FT_DIR ) npages--; fl_free_dirlist( dirlist ); if ( sp->verbose ) M_err( "LoadPS", "Total %d pages", npages ); if ( npages <= 0 ) { PS_cleanup( im ); flimage_error( im, "LoadPS: no page written!" ); return -1; } im->total_frames = npages; if ( ! sp->first_page_only ) { im->more = npages > 1; im->random_frame = load_page; im->cleanup = PS_cleanup; } im->total = im->total_frames; /* construct the filename and load it */ status = load_page( im, 1 ); /* need to cleanup the file if single page. For multipage, the driver will cleanup */ if ( ! im->more || status < 0 ) PS_cleanup( im ); return status; } /*************************************************************************** * Output routine **************************************************************************/ /*************************************** ***************************************/ static void PS_push( void ) { flps_output( "gsave\n" ); } /*************************************** ***************************************/ static void PS_pop( void ) { flps_output( "grestore\n" ); } /*************************************** ***************************************/ static void PS_trailer( SPEC *sp ) { PS_pop( ); flps_output( 0 ); fputs( "%%Trailer\n", sp->fp ); } /*************************************** ***************************************/ static int auto_scale( float pagew, float pageh, float w, float h, int landscape ) { int i = 0; if ( ( ! landscape && ( pagew < w || pageh < h ) ) || ( landscape && ( pagew < h || pageh < w ) ) ) { float sx, sy; if ( ! landscape ) { sx = ( pagew - 2.0 ) / w; sy = ( pageh - 2.0 ) / h; } else { sx = ( pagew - 2.0 ) / h; sy = ( pageh - 2.0 ) / w; } i = 100.0 * FL_min( sx, sy ); } return i; } /*************************************** ***************************************/ static void PS_start_image( FL_IMAGE * im FL_UNUSED_ARG ) { PS_push( ); } /*************************************** ***************************************/ static void PS_end_image( FL_IMAGE * im FL_UNUSED_ARG ) { PS_pop( ); } #define LEFT '(' #define RIGHT ')' static void PS_annotation_init( FL_IMAGE * ); static void PS_annotation( FL_IMAGE * im ); /*************************************** ***************************************/ static void PS_write_header( FL_IMAGE * im ) { FILE *fp = im->fpout; SPEC *sp = im->extra_io_info; float pagew = sp->paper_w - 2.0 * sp->hm; float pageh = sp->paper_h - 2.0 * sp->vm; float hm = sp->hm, vm = sp->vm; float s2px, s2py; float xscale = sp->xscale, yscale = sp->yscale; int xo, yo; int w = im->w, h = im->h; int orientation; int rescale; sp->fp = fp; /* check the size and orientation */ pagew *= 72.0; pageh *= 72.0; hm *= 72.0; vm *= 72.0; sp->s2px = s2px = 72.0 / sp->xdpi; sp->s2py = s2py = 72.0 / sp->ydpi; w *= xscale * s2px; h *= yscale * s2py; if ( ( orientation = sp->orientation ) == FLPS_AUTO ) { /* pick the orientation so even margin results */ int plm, pbm, llm, lbm; plm = ( pagew - w ) / 2; pbm = ( pageh - h ) / 2; llm = ( pagew - h ) / 2; lbm = ( pageh - w ) / 2; orientation = ( FL_abs( lbm - llm ) < FL_abs( pbm - plm ) ) ? FLPS_LANDSCAPE : FLPS_PORTRAIT; } sp->landscape = orientation == FLPS_LANDSCAPE; /* always make the image fit on the page */ if ( ( rescale = auto_scale( pagew, pageh, w, h, sp->landscape ) ) && sp->auto_fit) { xscale *= rescale * 0.01; yscale *= rescale * 0.01; w *= rescale * 0.01; h *= rescale * 0.01; } /* update */ sp->final_xscale = xscale; sp->final_yscale = yscale; /* get the origin of the system. For BoundingBox only. Actual PS output computes these on the fly */ xo = hm + ( pagew - ( sp->landscape ? h : w ) ) * 0.5; yo = vm + ( pageh - ( sp->landscape ? w : h ) ) * 0.5; xo -= ( sp->landscape ? sp->miscb : sp->miscl ) * xscale * s2px; yo -= ( sp->landscape ? sp->miscl : sp->miscb ) * xscale * s2py; w += ( sp->miscr + sp->miscl ) * xscale * s2px; h += ( sp->misct + sp->miscb ) * yscale * s2py; /* write header */ flps_emit_header( file_tail( im->infile ), im->total_frames, xo - 1, yo - 1, xo + w + 1, yo + h + 1 ); /* Prolog. Basic defines. */ fputs( "/inch { 72 mul } def /D {def} def /BD {bind def} def\n", fp ); fputs( "% Beginning of modifiable parameters\n", fp ); fprintf( fp, "/pagew {%.2g inch} BD\t%% page width\n", sp->paper_w ); fprintf( fp, "/pageh {%.2g inch} BD \t%% page height\n", sp->paper_h ); fprintf( fp, "/lm {%.2g inch} BD \t%% Left margin\n", sp->hm ); fprintf( fp, "/bm {%.2g inch} BD \t%% Bottom margin\n", sp->vm ); fprintf( fp, "/xscale %g D /yscale %g D\t %% DPIScale %g SizeScale %g\n", s2px * xscale, s2py * yscale, (s2px + s2py) * 0.5, rescale * 0.01 ); fputs( "% End of modifiable parameters\n", fp ); fprintf( fp, "/pw { pagew lm 2 mul sub } BD \t%% writable width\n" ); fprintf( fp, "/ph { pageh bm 2 mul sub } BD \t%% writable height\n" ); /* instead of emitting numbers, the actual calculation is output so that * both scale and margin can be adjusted in PS */ flps_output( "/xo pw xscale div %d sub 2 div def\n", sp->landscape ? im->h : im->w ); flps_output( "/yo ph yscale div %d sub 2 div def\n", sp->landscape ? im->w : im->h ); PS_annotation_init( im ); flps_output( 0 ); fputs( "%%EndProlog\n", fp ); if ( sp->comment ) fprintf( sp->fp, "%%OverallStateSave{\n" ); PS_push( ); /* honor the margin request */ flps_output( "lm bm translate\n" ); } static const char *hexdigits = "0123456789abcdef"; #define OutPixel( c ) \ do { \ putc( hexdigits[ ( c ) >> 4 ], fp ); \ putc( hexdigits[ ( c ) & 15 ], fp ); \ } while ( 0 ) /*************************************** * pixel data only ***************************************/ static int PS_write_pixels( FL_IMAGE * im ) { FILE *fp = im->fpout; int ok = 1, j, k; im->total = im->h; im->completed = 0; if ( FL_IsRGB( im ) ) { unsigned char *pc, *ss; im->visual_cue( im, "Writing ColorPS" ); for ( j = 0, k = 1; ok && j < im->h; j++, im->completed++ ) { for ( pc = im->red[ j ], ss = pc + im->w; pc < ss; pc++, k++ ) { OutPixel( *pc ); if ( k % 37 == 0 ) putc( '\n', fp ); } for ( pc = im->green[ j ], ss = pc + im->w; pc < ss; pc++, k++ ) { OutPixel( *pc ); if ( k % 37 == 0 ) putc( '\n', fp ); } for ( pc = im->blue[ j ], ss = pc + im->w; pc < ss; pc++, k++ ) { OutPixel( *pc ); if ( k % 37 == 0 ) putc( '\n', fp ); } if ( ! ( im->completed & FLIMAGE_REPFREQ ) ) { im->visual_cue( im, "Writing PS" ); ok = ! ferror( fp ); } } } else { unsigned short *pc, *ss; unsigned char g; im->visual_cue( im, "Writing GrayPS" ); for ( j = 0, k = 1; ok && j < im->h; j++, im->completed++ ) { for ( pc = im->gray[ j ], ss = pc + im->w; pc < ss; pc++, k++ ) { g = *pc & 0xff; OutPixel( g ); if ( k % 37 == 0 ) putc( '\n', fp ); } if ( ! ( im->completed & FLIMAGE_REPFREQ ) ) { im->visual_cue( im, "Writing PS" ); ok = ! ferror( fp ); } } } putc( '\n', fp ); return ok ? 1 : -1; } /*************************************** ***************************************/ static void make_raster_command( FL_IMAGE * im, char pscmd[ ] ) { int rgb = FL_IsRGB( im ); sprintf( pscmd, "StartRaster" ); if ( ! rgb ) { flps_output( "/graystring %d string def\n", im->w ); flps_output( "/%s\n", pscmd ); flps_output( " {%d %d %d [ %d 0 0 -%d 0 %d]\n", im->w, im->h, FL_PCBITS, im->w, im->h, im->h ); flps_output( " {currentfile graystring readhexstring pop}\n" ); flps_output( " imag`e\n} bind def\n" ); } else { flps_output( "/redstring %d string def\n", im->w ); flps_output( "/grnstring %d string def\n", im->w ); flps_output( "/blustring %d string def\n", im->w ); flps_output( "/%s\n", pscmd ); flps_output( " {%d %d %d [ %d 0 0 -%d 0 %d]\n", im->w, im->h, FL_PCBITS, im->w, im->h, im->h ); flps_output( " {currentfile redstring readhexstring pop}\n" ); flps_output( " {currentfile grnstring readhexstring pop}\n" ); flps_output( " {currentfile blustring readhexstring pop}\n" ); flps_output( " true 3 colorimage\n} bind def\n"); } } /*************************************** ***************************************/ static int PS_write_image( FL_IMAGE * sim ) { SPEC *sp = sim->extra_io_info; char pscmd[ 512 ]; FL_IMAGE *im = sim; int err, npage; if ( ! sp ) { sp = sim->extra_io_info = fl_calloc( 1, sizeof *sp ); memcpy( sp, flimage_ps_options( ), sizeof *sp ); } sp->fp = sim->fpout; flps_switch_flps( sp ); PS_write_header( sim ); fprintf( sp->fp, sp->comment ? " %%StartOfMultiImage {\n" : "" ); PS_push( ); for ( err = 0, npage = 1, im = sim; !err && im; im = im->next, npage++ ) { im->fpout = sim->fpout; flps_output( 0 ); fprintf( im->fpout, "%%%%Page: %d %d\n", npage, sim->total_frames ); /* the origin of the image (xo,yo) and annotation */ flps_output( "xscale yscale scale xo yo translate\n" ); if ( sp->landscape ) { flps_output( "%d %d translate\n", sim->h, 0 ); flps_output( " 90 rotate\n" ); } PS_start_image( im ); make_raster_command( im, pscmd ); flps_output( "%d %d scale %s\n", im->w, im->h, pscmd ); flps_output( 0 ); err = PS_write_pixels( im ) < 0; PS_end_image( im ); PS_annotation( im ); flps_output( "showpage\n" ); } if ( sp->comment ) fprintf (sp->fp, " %%EndOfMultiImage}\n" ); PS_pop( ); PS_trailer( sp ); fflush( sim->fpout ); flps_reset_cache( ); flps_restore_flps( ); fl_free( sim->extra_io_info ); sim->extra_io_info = 0; return err ? -1 : 1; } void flimage_enable_ps( void ) { flimage_add_format( "PostScript", "ps", "ps", FL_IMAGE_RGB | FL_IMAGE_GRAY, PS_identify, PS_description, PS_read_pixels, PS_write_image ); } /*************************************** * Marker output * M-moveto LT-lineto L ***************************************/ #define MBUFLEN 10 static void PS_annotation_init( FL_IMAGE * im ) { const char *mbuf[ MBUFLEN ]; FLIMAGE_MARKER *m; if ( ! im->nmarkers && !im->ntext ) return; flps_output( "/M {moveto} BD /G {setgray} BD /RGB {setrgbcolor} BD\n" ); flps_output( "/LT {lineto} BD /L {M LT} BD /S {stroke} BD /F {fill} BD\n" ); flps_output( "/L {M LT} BD /S {stroke} BD /F {fill} BD\n" ); flps_output( "/LW {setlinewidth} BD /C {closepath} BD\n" ); memset( mbuf, 0, MBUFLEN ); if ( im->nmarkers ) { int i, k; flps_output( "%%marker defs: t w h angle xo yo\n" ); flps_output( 0 ); flps_output( "/DTD {[5 4 1 4] 0 setdash} BD\n" ); /* dot-dash */ flps_output( "/DT {[1 3] 0 setdash} BD\n" ); /* dot */ flps_output( "/LD {[8 5] 0 setdash} BD\n" ); /* long dash */ flps_output( "/DS {[4 4] 0 setdash} BD\n" ); /* dash */ flps_output( "/SL {[] 0 setdash} BD\n" ); /* solid */ flps_output( "/NP {newpath} BD\n" ); /* solid */ flps_output( "/BM {gsave} D /EM {grestore} D\n" ); flps_output( "/MK {newpath translate rotate scale LW} BD\n" ); /* define primitives (-1 to +1) */ for ( k = 0, m = im->marker, i = 0; i < im->nmarkers; i++, m++ ) { int j, out; for ( j = out = 0; ! out && j < MBUFLEN; j++ ) out = m->name == mbuf[ j ]; if ( ! out ) { mbuf[ k++ ] = m->name; flps_output( "/%s {%s %s} D\n", m->name, "MK", m->psdraw ); } } } if ( im->ntext ) { /* do we want to scale the font ? */ flps_output( "/point {xscale yscale add 2 div div} BD\n" ); flps_output( "/SetFont {findfont exch scalefont setfont} BD\n" ); flps_output( "/CP {currentpoint} BD /SW {stringwidth} BD\n" ); flps_output( "/Lshow {show} BD\n" ); flps_output( "/Cshow {dup SW pop -2 div 0 rmoveto show} BD\n" ); flps_output( "/Rshow {dup SW pop neg 0 rmoveto show} BD\n" ); } } /*************************************** ***************************************/ #if 0 static void switch_to_ISOLatin1( FILE * fp ) { /***** usage: newfontname oldfontname SwitchISO ******/ flps_output( 0 ); flps_output( "% Switch to ISOLatin1 to get special characters" ); flps_output( 0 ); flps_output( "/languagelevel where\n" ); flps_output( " {pop languagelevel} {1} ifelse\n" ); flps_output( " 2 lt {/BitEncoding /StandardEncoding load def}\n" ); flps_output( " {/BitEncoding /ISOLatin1Encoding load def}\n" ); flps_output( " ifelse\n" ); flps_output( "/SwitchToISO {\n" ); flps_output( " findfont dup length\n dict begin {1 index /FID ne {def} " "{pop pop} ifelse} forall\n" ); flps_output( " /Encoding BitEncoding def " ); flps_output( " currentdict end\n definefont pop\n} bind def\n" ); } #endif /*************************************** ***************************************/ static void PS_annotation( FL_IMAGE * im ) { FLIMAGE_MARKER *m = im->marker; FLIMAGE_TEXT *t = im->text; int r, g, b, i, thickness; SPEC *sp = im->extra_io_info; for ( i = 0; i < im->nmarkers; i++, m++ ) { thickness = m->thickness + (m->thickness == 0); FL_UNPACK( m->color, r, g, b ); flps_rgbcolor( r, g, b ); flps_linestyle( m->style ); flps_output( "BM %.3g %g %g %g %d %d %s", 2.0 * thickness / ( m->w + m->h ), 0.5 * m->w, 0.5 * m->h, m->angle * 0.1, m->x, im->h - m->y, m->name ); flps_output( " %c EM\n", "SF"[ m->fill ] ); } /* we make use of the ps_text.c */ sp->isRGBColor = 1; for ( i = 0; i < im->ntext; i++, t++ ) { sp->rotation = t->angle; flps_draw_text( t->align, t->x - 1, im->h - t->y - 1, 2, 2, t->color, t->style, t->size, t->str ); } sp->rotation = 0; sp->isRGBColor = 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/flimage.h0000664000175000017500000006215112353623325012627 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /* Image related routines */ #ifndef FL_IMAGE_H #define FL_IMAGE_H #if defined(__cplusplus) extern "C" { #endif #ifndef FL_EXPORT #define FL_EXPORT extern #endif #define FL_RGB2GRAY( r, g, b ) \ ( ( unsigned int )( ( 78 * ( r ) + 150 * ( g ) + 28 * ( b ) ) >> 8 ) ) enum { FL_IMAGE_NONE, FL_IMAGE_MONO = 1, /* b&w. 1bit. 0=white 1=black */ FL_IMAGE_GRAY = 2, /* 8 bit gray image */ FL_IMAGE_CI = 4, /* colormmaped image */ FL_IMAGE_RGB = 8, /* RGBA image. 8bit each */ FL_IMAGE_PACKED = 16, /* RGBA packed into an int */ FL_IMAGE_GRAY16 = 32, /* 12bit gray scale image */ FL_IMAGE_RGB16 = 64, /* 36bits color image */ FL_IMAGE_FLEX = 1023, /* all formats */ /* aliases */ FLIMAGE_NONE = FL_IMAGE_NONE, FLIMAGE_MONO = FL_IMAGE_MONO, FLIMAGE_GRAY = FL_IMAGE_GRAY, FLIMAGE_CI = FL_IMAGE_CI, FLIMAGE_RGB = FL_IMAGE_RGB, FLIMAGE_PACKED = FL_IMAGE_PACKED, FLIMAGE_GRAY16 = FL_IMAGE_GRAY16, FLIMAGE_RGB16 = FL_IMAGE_RGB16, FLIMAGE_FLEX = FL_IMAGE_FLEX }; #ifndef FL_PCBITS typedef unsigned char FL_PCTYPE; /* primary color type */ #define FL_PCBITS 8 /* primary color bits */ #define FL_PCMAX ( ( 1 << FL_PCBITS ) - 1 ) #define FL_PCCLAMP( a ) ( ( a ) > ( FL_PCMAX ) ? \ ( FL_PCMAX ) : ( ( a ) < 0 ? 0 : ( a ) ) ) typedef unsigned int FL_PACKED4; #define FL_PACKED FL_PACKED4 #define FL_RMASK 0x000000ff #define FL_RSHIFT 0 #define FL_GMASK 0x0000ff00 #define FL_GSHIFT 8 #define FL_BMASK 0x00ff0000 #define FL_BSHIFT 16 #define FL_AMASK 0xff000000 #define FL_ASHIFT 24 /* If PCBITS is not 8, we need to apply the RGBmask */ #define FL_GETR( packed ) ( ( packed ) & FL_RMASK ) #define FL_GETG( packed ) ( ( ( packed ) >> FL_GSHIFT ) & FL_PCMAX ) #define FL_GETB( packed ) ( ( ( packed ) >> FL_BSHIFT ) & FL_PCMAX ) #define FL_GETA( packed ) ( ( ( packed ) >> FL_ASHIFT ) & FL_PCMAX ) #define FL_PACK3( r, g, b ) \ ( ( ( r ) << FL_RSHIFT ) | ( ( g ) << FL_GSHIFT ) | ( ( b ) << FL_BSHIFT ) ) #define FL_PACK FL_PACK3 #define FL_PACK4( r, g, b, a) \ ( FL_PACK3( r, g, b ) | ( ( a ) << FL_ASHIFT ) ) #define FL_UNPACK( p, r, g, b ) \ do { r = FL_GETR( p ); \ g = FL_GETG( p ); \ b = FL_GETB( p ); \ } while ( 0 ) #define FL_UNPACK3 FL_UNPACK #define FL_UNPACK4( p, r, g, b, a ) \ do { FL_UNPACK3( p, r, g, b ); \ a = FL_GETA( p ); \ } while ( 0 ) #endif #define FL_LUTBITS 12 /* max colormap bits. 4096 entries */ #define FL_IsRGB( im ) ( ( im )->type == FL_IMAGE_RGB ) #define FL_IsPacked( im ) ( ( im )->type == FL_IMAGE_PACKED ) enum { FLIMAGE_AUTOCOLOR = 0x7fffffff, FLIMAGE_BADCOLOR = FLIMAGE_AUTOCOLOR }; typedef Window FL_WINDOW; /* unsigned long */ typedef struct flimage_text_ { char * str; /* the string itself */ int len; /* string length */ int x, /* starting location of text (wrt image) */ y; unsigned int color; /* color of the text */ unsigned int bcolor; /* background color of the text */ int nobk; /* no background */ int size, /* font size & style */ style; int angle; /* in 1/10th of a degrees */ int align; /* alignment wrt to (x,y) */ } FLIMAGE_TEXT; typedef struct flimage_marker_ { const char * name; /* marker name */ int w, /* size */ h ; int x, /* location */ y; unsigned int color; /* color of the marker */ unsigned int bcolor; /* aux. color of the marker */ int angle; /* in 1/10th of a degree */ int fill; int thickness; /* line thickness */ int style; /* line style */ /* the following is filled by the library */ void * display; void * gc; FL_WINDOW win; const char * psdraw; } FLIMAGE_MARKER; #define FLIMAGE_REPFREQ 0x1f /* report every 32 lines */ #ifndef FL_RGB2PIXEL typedef struct { unsigned int rshift, rmask, rbits; unsigned int gshift, gmask, gbits; unsigned int bshift, bmask, bbits; int bits_per_rgb; int colormap_size; } FL_RGB2PIXEL_; #define FL_RGB2PIXEL FL_RGB2PIXEL_ #endif typedef struct flimage_setup_ *FLIMAGESETUP; typedef struct flimage_ { int type; /* image type */ int w, h; /* image size */ void * app_data; /* for application at setup time */ void * u_vdata; /* for application */ long u_ldata; /* for application */ unsigned char ** red; unsigned char ** green; unsigned char ** blue; unsigned char ** alpha; unsigned char ** rgba[ 4 ]; /* alias */ unsigned short ** ci; unsigned short ** gray; FL_PACKED4 ** packed; unsigned short ** red16; /* not currently supported */ unsigned short ** green16; /* not currently supported */ unsigned short ** blue16; /* not currently supported */ unsigned short ** alpha16; /* not currently supported */ unsigned char ** ci8; /* not currently supported */ int * red_lut; /* red lookup tables */ int * green_lut; /* green lookup tables */ int * blue_lut; /* blue lookup tables */ int * alpha_lut; /* alpha lookup tables */ int * lut[ 4 ]; /* alias */ int map_len; /* lut length */ int colors; /* actual colors used in displaying */ int gray_maxval; /* indicate the range of gray16 */ int ci_maxval; /* max value of ci. not used, use map_len */ int rgb_maxval; /* max value for rgb16 image */ int level, wwidth; unsigned short * wlut; /* lut for window levelling */ int wlut_len; int app_background; /* transparent color: in RGB */ char * comments; int comments_len; int available_type; struct flimage_ * next; int sx, /* display subimage origin */ sy; int sw, /* display subimage width */ sh; int wx, /* display location relative to win */ wy; int modified; int ( * display )( struct flimage_ *, FL_WINDOW ); int double_buffer; int sxd, syd, swd, shd; int wxd, wyd; const char * fmt_name; /* format name (ppm,jpg etc) */ /* annotation stuff */ FLIMAGE_TEXT * text; int ntext, max_text; int dont_display_text; void ( * display_text )( struct flimage_ * ); void ( * free_text )( struct flimage_ * ); FLIMAGE_MARKER * marker; int nmarkers, max_markers; int dont_display_marker; void ( * display_markers )( struct flimage_ * ); void ( * free_markers )( struct flimage_ * ); /* physicalValue = poffset + pixelValue * pscale */ double pmin, /* physical data range */ pmax; double poffset; double pscale; /* pixel grid distance */ double xdist_offset; double xdist_scale; double ydist_offset; double ydist_scale; char * infile; char * outfile; long foffset; int original_type; /* hooks for application to have a chance to set some options. if pre_write returns -1, the output will be canceled */ int ( * pre_write )( struct flimage_ * ); int ( * post_write )( struct flimage_ * ); /* image processing stuff */ int subx, /* subimage origin */ suby; int subw, /* subimage size */ subh; int sub_shape; /* shape of the subimage */ unsigned int fill_color; /* fill color */ int force_convert; int * llut[ 3 ]; /* linear lut */ int llut_len; unsigned int * hist[ 4 ]; /* application handlers */ int total, completed; int ( * visual_cue )( struct flimage_*, const char * ); void ( * error_message )( struct flimage_*, const char * ); int error_code; /* not currently used */ int display_type; /* just before handing it to X */ unsigned short ** pixels; void * image_spec; /* additional image info */ void * xdisplay; /* the X connection */ int tran_rgb; /* RGB color that should be transparent */ int tran_index; /* index that should be transparent */ int matr, matc; /* multi-frame images */ int more; int current_frame; int total_frames; int ( * next_frame )( struct flimage_ * ); int ( * prev_frame )( struct flimage_ * ); int ( * random_frame )( struct flimage_ *, int ); int ( * rewind_frame )( struct flimage_ * ); void ( * cleanup )( struct flimage_ * ); int stop_looping; /* the following are for internal use */ FILE * fpin; FILE * fpout; void * image_io; void * io_spec; /* io operation helper */ int spec_size; int depth; /* the depth we actually use */ int vclass; void * visual; unsigned long xcolormap; FL_RGB2PIXEL rgb2p; void * ximage; FL_WINDOW win; void * gc; int sdepth; /* depth the server says */ void * textgc; void * markergc; void * extra_io_info; unsigned long pixmap; int pixmap_w, pixmap_h, pixmap_depth; int isPixmap; FLIMAGESETUP setup; char * info; } FL_IMAGE; /* some configuration stuff */ typedef struct flimage_setup_ { void * app_data; int ( * visual_cue )( FL_IMAGE *, const char *); void ( * error_message )( FL_IMAGE *, const char *); int ( * display )( FL_IMAGE *, unsigned long ); const char * rgbfile; int do_not_clear; void * xdisplay; int max_frames; int delay; int no_auto_extension; int report_frequency; int double_buffer; /* internal use */ unsigned long trailblazer; int header_info; } FLIMAGE_SETUP; FL_EXPORT void flimage_setup( FLIMAGE_SETUP * ); /* Possible errors from the library. Not currently (v0.89) used */ enum { FLIMAGE_ERR_NONE = 0, FLIMAGE_ERR_ALLOC = -50, /* allocation error */ FLIMAGE_ERR_INVALID, /* invalid image */ FLIMAGE_ERR_ARGUMENT, /* bad argument/request */ FLIMAGE_ERR_FILE, /* io error */ FLIMAGE_ERR_INTERNAL, /* bugs */ FLIMAGE_ERR_UNKNOWN }; typedef int ( * FLIMAGE_Identify )( FILE * ); typedef int ( * FLIMAGE_Description )( FL_IMAGE * ); typedef int ( * FLIMAGE_Read_Pixels )( FL_IMAGE * ); typedef int ( * FLIMAGE_Write_Image )( FL_IMAGE * ); /* Basic IO routines */ FL_EXPORT FL_IMAGE * flimage_load( const char * file ); FL_EXPORT FL_IMAGE * flimage_read( FL_IMAGE * im ); FL_EXPORT int flimage_dump( FL_IMAGE *, const char *, const char * ); FL_EXPORT int flimage_close( FL_IMAGE * ); FL_EXPORT FL_IMAGE * flimage_alloc( void ); FL_EXPORT int flimage_getmem( FL_IMAGE * ); FL_EXPORT int flimage_is_supported( const char * ); FL_EXPORT int flimage_description_via_filter( FL_IMAGE *, char *const *, const char *, int ); FL_EXPORT int flimage_write_via_filter( FL_IMAGE *, char * const *, char * const *, int ); FL_EXPORT FL_IMAGE * flimage_alloc( void ); FL_EXPORT void flimage_free( FL_IMAGE * ); FL_EXPORT int flimage_display( FL_IMAGE *, Window ); FL_EXPORT int flimage_sdisplay( FL_IMAGE *, Window ); FL_EXPORT int flimage_convert( FL_IMAGE *, int, int ); FL_EXPORT const char * flimage_type_name( int type ); FL_EXPORT int flimage_add_text( FL_IMAGE *, const char *, int, int, int, unsigned int, unsigned int, int, double, double, int ); FL_EXPORT int flimage_add_text_struct( FL_IMAGE *, const FLIMAGE_TEXT * ); FL_EXPORT void flimage_delete_all_text( FL_IMAGE * ); FL_EXPORT int flimage_add_marker( FL_IMAGE *, const char *, double, double, double, double, int, int, int, unsigned int, unsigned int ); FL_EXPORT int flimage_add_marker_struct( FL_IMAGE *, const FLIMAGE_MARKER * ); FL_EXPORT int flimage_define_marker( const char *, void ( * )( FLIMAGE_MARKER * ), const char * ); FL_EXPORT void flimage_delete_all_markers( FL_IMAGE * ); FL_EXPORT int flimage_render_annotation( FL_IMAGE *, FL_WINDOW ); FL_EXPORT void flimage_error( FL_IMAGE *, const char *, ... ); /* Built-in format supports */ FL_EXPORT void flimage_enable_pnm( void ); FL_EXPORT int flimage_set_fits_bits( int ); /* Output options */ typedef struct { int quality; int smoothing; } FLIMAGE_JPEG_OPTION; FL_EXPORT void flimage_jpeg_output_options( FLIMAGE_JPEG_OPTION * ); FL_EXPORT void flimage_pnm_output_options( int ); FL_EXPORT void flimage_gif_output_options( int ); FL_EXPORT FLPS_CONTROL * flimage_ps_options( void ); #define flimage_jpeg_options flimage_jpeg_output_options #define flimage_pnm_options flimage_pnm_output_options #define flimage_gif_options flimage_gif_output_options enum { FLIMAGE_WRITABLE = FL_WRITE, FLIMAGE_READABLE = FL_READ }; typedef struct { const char * formal_name; const char * short_name; const char * extension; int type; int read_write; int annotation; } FLIMAGE_FORMAT_INFO; FL_EXPORT int flimage_get_number_of_formats( void ); FL_EXPORT const FLIMAGE_FORMAT_INFO * flimage_get_format_info( int ); FL_EXPORT void * fl_get_matrix( int, int, unsigned int ); FL_EXPORT void * fl_make_matrix( int, int, unsigned int, void * ); FL_EXPORT void fl_free_matrix( void * ); /* This function is retained for compatibility reasons only. It returns 1 always. */ FL_EXPORT int fl_init_RGBdatabase( const char * ); FL_EXPORT int fl_lookup_RGBcolor( const char *, int *, int *, int * ); FL_EXPORT int flimage_add_format( const char *, const char *, const char *, int, FLIMAGE_Identify, FLIMAGE_Description, FLIMAGE_Read_Pixels, FLIMAGE_Write_Image ); FL_EXPORT void flimage_set_annotation_support( int, int ); FL_EXPORT int flimage_getcolormap( FL_IMAGE * ); FL_EXPORT void fl_select_mediancut_quantizer( void ); /* Simple image processing routines */ #define FLIMAGE_SHARPEN ( ( int** )( -1 ) ) #define FLIMAGE_SMOOTH ( ( int** )( -2 ) ) #define FL_SMOOTH FLIMAGE_SMOOTH #define FL_SHARPEN FLIMAGE_SHARPEN enum { FLIMAGE_NOSUBPIXEL = 0, /* scale with no subpixel sampling */ FLIMAGE_SUBPIXEL = 1, /* scale with subpixel sampling */ FLIMAGE_CENTER = 2, /* center warped image. default */ FLIMAGE_RIGHT = 8, /* flush right the warped image */ FLIMAGE_ASPECT = 32, /* fit the size */ FLIMAGE_NOCENTER = FL_ALIGN_LEFT_TOP }; FL_EXPORT int flimage_convolve( FL_IMAGE *, int **, int, int ); FL_EXPORT int flimage_convolvea( FL_IMAGE *, int *, int, int ); FL_EXPORT int flimage_tint( FL_IMAGE *, unsigned int, double ); FL_EXPORT int flimage_rotate( FL_IMAGE *, int, int ); FL_EXPORT int flimage_flip( FL_IMAGE *, int ); FL_EXPORT int flimage_scale( FL_IMAGE *, int, int, int ); FL_EXPORT int flimage_warp( FL_IMAGE *, float [ ][ 2 ], int, int, int ); FL_EXPORT int flimage_autocrop( FL_IMAGE *, unsigned int ); FL_EXPORT int flimage_get_autocrop( FL_IMAGE *, unsigned int, int *, int *, int *, int * ); FL_EXPORT int flimage_crop( FL_IMAGE *, int, int, int, int ); FL_EXPORT int flimage_replace_pixel( FL_IMAGE *, unsigned int, unsigned int ); FL_EXPORT int flimage_transform_pixels( FL_IMAGE *, int *, int *, int * ); FL_EXPORT int flimage_windowlevel( FL_IMAGE *, int, int ); FL_EXPORT int flimage_enhance( FL_IMAGE *, int ); FL_EXPORT int flimage_from_pixmap( FL_IMAGE *, Pixmap ); FL_EXPORT Pixmap flimage_to_pixmap( FL_IMAGE *, FL_WINDOW ); FL_EXPORT FL_IMAGE * flimage_dup( FL_IMAGE * ); /* Miscellaneous prototypes */ FL_EXPORT int fl_object_ps_dump( FL_OBJECT *, const char * ); FL_EXPORT void flimage_add_comments( FL_IMAGE *, const char *, int ); FL_EXPORT unsigned long flimage_color_to_pixel( FL_IMAGE *, int, int, int, int * ); FL_EXPORT FL_IMAGE * flimage_combine( FL_IMAGE *, FL_IMAGE *, double ); FL_EXPORT int flimage_define_marker( const char *, void ( * )( FLIMAGE_MARKER * ), const char * ); FL_EXPORT void flimage_display_markers( FL_IMAGE * ); FL_EXPORT FL_IMAGE *flimage_dup_( FL_IMAGE *, int ); FL_EXPORT void flimage_enable_bmp( void ); FL_EXPORT void flimage_enable_fits( void ); FL_EXPORT void flimage_enable_genesis( void ); FL_EXPORT void flimage_enable_gif( void ); FL_EXPORT void flimage_enable_gzip( void ); FL_EXPORT void flimage_enable_jpeg( void ); FL_EXPORT void flimage_enable_png( void ); FL_EXPORT void flimage_enable_ps( void ); FL_EXPORT void flimage_enable_sgi( void ); FL_EXPORT void flimage_enable_tiff( void ); FL_EXPORT void flimage_enable_xbm( void ); FL_EXPORT void flimage_enable_xpm( void ); FL_EXPORT void flimage_enable_xwd( void ); FL_EXPORT void flimage_free_ci( FL_IMAGE * ); FL_EXPORT void flimage_free_gray( FL_IMAGE * ); FL_EXPORT void flimage_free_linearlut( FL_IMAGE * ); FL_EXPORT void flimage_free_rgb( FL_IMAGE * ); FL_EXPORT void flimage_freemem( FL_IMAGE * ); FL_EXPORT int flimage_get_closest_color_from_map( FL_IMAGE *, unsigned int ); FL_EXPORT int flimage_get_linearlut( FL_IMAGE * ); FL_EXPORT void flimage_invalidate_pixels( FL_IMAGE * ); FL_EXPORT FL_IMAGE *flimage_open( const char * ); FL_EXPORT int flimage_read_annotation( FL_IMAGE * ); FL_EXPORT void flimage_replace_image( FL_IMAGE *, int, int, void *, void *, void * ); FL_EXPORT int flimage_swapbuffer( FL_IMAGE * ); FL_EXPORT int flimage_to_ximage( FL_IMAGE *, FL_WINDOW, XWindowAttributes * ); FL_EXPORT int flimage_write_annotation( FL_IMAGE * ); FL_EXPORT void flps_apply_gamma( float ); FL_EXPORT void flps_arc( int, int, int, int, int, int, FL_COLOR ); FL_EXPORT void flps_circ( int, int, int, int, FL_COLOR ); FL_EXPORT void flps_color( FL_COLOR col ); FL_EXPORT void flps_draw_box( int, int, int, int, int, FL_COLOR, int ); FL_EXPORT void flps_draw_checkbox( int, int, int, int, int, FL_COLOR, int ); FL_EXPORT void flps_draw_frame( int, int, int, int, int, FL_COLOR, int ); FL_EXPORT int flps_draw_symbol( const char *, int, int, int, int, FL_COLOR ); FL_EXPORT void flps_draw_tbox( int, int, int, int, int, FL_COLOR, int ); FL_EXPORT void flps_draw_text( int, int, int, int, int, FL_COLOR, int, int, const char * ); FL_EXPORT void flps_draw_text_beside( int, int, int, int, int, FL_COLOR, int, int, const char * ); FL_EXPORT void flps_emit_header( const char *, int, int, int, int, int ); FL_EXPORT void flps_emit_prolog( void ); FL_EXPORT int flps_get_gray255( FL_COLOR ); FL_EXPORT int flps_get_linestyle( void ); FL_EXPORT int flps_get_linewidth( void ); FL_EXPORT FL_COLOR flps_get_namedcolor( const char * ); FL_EXPORT FLPS_CONTROL * flps_init( void ); FL_EXPORT void flps_invalidate_color_cache( void ); FL_EXPORT void flps_invalidate_font_cache( void ); FL_EXPORT void flps_invalidate_linewidth_cache( void ); FL_EXPORT void flps_invalidate_symbol_cache( void ); FL_EXPORT void flps_line( int, int, int, int, FL_COLOR ); FL_EXPORT void flps_lines( FL_POINT *, int, FL_COLOR ); FL_EXPORT void flps_linestyle( int ); FL_EXPORT void flps_linewidth( int ); FL_EXPORT void flps_log( const char * ); FL_EXPORT void flps_output( const char *, ... ); FL_EXPORT void flps_oval( int, int, int, int, int, FL_COLOR ); FL_EXPORT void flps_pieslice( int, int, int, int, int, int, int, FL_COLOR ); FL_EXPORT void flps_poly( int, FL_POINT *, int, FL_COLOR ); FL_EXPORT void flps_rectangle( int, int, int, int, int, FL_COLOR ); FL_EXPORT void flps_reset_cache( void ); FL_EXPORT void flps_reset_linewidth( void ); FL_EXPORT void flps_restore_flps( void ); FL_EXPORT void flps_rgbcolor( int, int, int ); FL_EXPORT void flps_roundrectangle( int, int, int, int, int, FL_COLOR ); FL_EXPORT void flps_set_clipping( int, int, int, int ); FL_EXPORT void flps_set_font( int, int ); FL_EXPORT void flps_unset_clipping( void ); #ifdef MAKING_FORMS #include "flimage_int.h" #endif #if defined(__cplusplus) } #endif #endif /* ! defined FL_IMAGE_H */ xforms-1.2.4/image/image_xpm.c0000644000175000017500000002726112251675221013164 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1993, 1998-2002 By T.C. Zhao * All rights reserved. * * Read and write XPM3 files. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" #include #include #define XPM_DEBUG 0 typedef struct { int r, g, b, a; char key[ 4 ]; /* char keys. max 3 */ } XPMMap; #define NMAPS 4 /* don't handle SMAP */ enum { CMAP, GMAP, G4MAP, MMAP }; typedef struct { XPMMap map[ NMAPS ][ FLIMAGE_MAXLUT ]; /* only deal with c and g map */ int char_per_pix; int available_maps[ NMAPS ]; } SPEC; static char * get_xpm_pixel_name( char str[ ] ); /*************************************** ***************************************/ static int XPM_identify( FILE * fp ) { char buf[ 128 ]; int sig, i; /* demand the signature be present in the first 3 lines */ for ( i = sig = 0; i < 3 && ! sig && fgets( buf, 127, fp ); i++ ) { buf[ 127 ] = '\0'; sig = strstr( buf, "XPM" ) && strstr( buf, "/*" ); } return sig ? 1 : -1; } /*************************************** ***************************************/ static int XPM_description( FL_IMAGE * im ) { int c, ncol; SPEC *sp = fl_calloc( 1, sizeof *sp ); FILE *fp = im->fpin; im->io_spec = sp; while ( ( c = getc( fp ) ) && c != '"' ) /* empty */ ; if ( fscanf( fp, "%d %d %d %d", &im->w, &im->h, &ncol, &sp->char_per_pix ) != 4 ) { im->error_message( im, "Can't get xpm description" ); return -1; } if ( sp->char_per_pix <= 0 || ncol <= 0 ) { im->error_message( im, "bad xpm description" ); return -1; } if ( sp->char_per_pix > 3 || ncol > 256 ) { im->error_message( im, "can't handle this xpm" ); return -1; } while ( getc( fp ) != '\n' ) /* empty */ ; im->type = FL_IMAGE_CI; im->map_len = ncol; return 0; } /*************************************** ***************************************/ static int XPM_load( FL_IMAGE * im ) { SPEC *sp = im->io_spec; FILE *fp = im->fpin; char *buf, key[ 32 ], val[ 32 ], ckey[ 8 ], *head, *p; int i, done, icol, n, match, r, g, b, x, y, buflen, mapi, len; XPMMap *map; buflen = ( im->w + 5 ) * sp->char_per_pix; /* If comments longer than 256 chars on a single line, this may not work right */ if ( buflen < 256 ) buflen = 256; buf = fl_malloc( buflen ); /* Read the colormap */ for ( icol = 0; icol < im->map_len; icol++ ) { while ( fgets( buf, buflen, fp ) && strncmp( buf, "/*", 2 ) == 0 ) { while ( strstr( buf, "*/" ) == NULL ) if ( fgets( buf, buflen, fp ) == NULL ) { fl_free( buf ); flimage_error( im, "Failure to read xpm file" ); return -1; } } if ( ( head = strchr( buf, '"' ) ) == 0 ) { fl_free( buf ); flimage_error( im, "Bad ColorLine: %s", buf ); return -1; } head++; /* The colormap line is char [mapkey color]* */ strncpy( key, head, sp->char_per_pix ); key[ sp->char_per_pix ] = '\0'; head += sp->char_per_pix + 1; done = 0; while ( ! done ) { if ( ( done = ( sscanf( head, "%7s %31s %n", ckey, val, &n ) < 2 ) ) ) break; head += n; /* Find the color code. We do not handle s currently */ if ( ckey[ 0 ] == 'c' ) mapi = CMAP; else if ( ckey[ 0 ] == 'g' && ckey[ 1 ] == '\0' ) mapi = GMAP; else if ( ckey[ 0 ] == 'g' && ckey[ 1 ] == '4' ) mapi = G4MAP; else if ( ckey[ 0 ] == 'm' ) mapi = MMAP; else mapi = -1; /* Ignore the unhandled colormap types */ if ( mapi >= 0 ) { map = sp->map[ mapi ]; sp->available_maps[ mapi ] = 1; #if 1 for ( len = strlen( val ), p = val + len - 1; p > val && ( *p == ',' || *p == '"' ); p-- ) *p = '\0'; #endif strcpy( map[ icol ].key, key ); if ( fl_lookup_RGBcolor( val, &r, &g, &b ) != -1 ) { map[ icol ].r = r; map[ icol ].g = g; map[ icol ].b = b; } else map[ icol ].r = map[ icol ].g = map[ icol ].b = -1; } } } if ( sp->available_maps[ CMAP ] ) map = sp->map[ CMAP ]; else if ( sp->available_maps[ GMAP ] ) map = sp->map[ GMAP ]; else if ( sp->available_maps[ G4MAP ]) map = sp->map[ G4MAP ]; else if ( sp->available_maps[ MMAP ] ) map = sp->map[ MMAP ]; else { im->error_message( im, "Can't handle XPM colormap" ); fl_free( buf ); return -1; } /* Copy local colormap to FLIMAGE colormap */ for ( i = 0; i < im->map_len; i++ ) { if ( map[ i ].r < 0 || map[ i ].g < 0 ) { map[ i ].r = 1; map[ i ].g = 2; map[ i ].b = 3; map[ i ].a = 0; im->tran_index = i; im->tran_rgb = FL_PACK4( map[ i ].r, map[ i ].g, map[ i ].b, map[ i ].a ); } im->red_lut[ i ] = map[ i ].r; im->green_lut[ i ] = map[ i ].g; im->blue_lut[ i ] = map[ i ].b; } #if XPM_DEBUG fprintf( stderr, "MAP: %d entries\n", im->map_len ); for ( i = 0; i < im->map_len; i++ ) fprintf( stderr, "i=%d key=%s r=%3d g=%3d b=%3d\n", i, map[ i ].key, map[ i ].r, map[ i ].g, map[ i ].b ); #endif /* read pixels */ for ( y = 0; y < im->h; y++, im->completed++ ) { if ( ! ( im->completed & FLIMAGE_REPFREQ ) ) im->visual_cue( im, "xpm" ); while ( fgets( buf, buflen, fp ) && strncmp( buf, "/*", 2 ) == 0 ) /* empty */ ; if ( ! ( head = strchr( buf, '"' ) ) ) { fprintf( stderr, "something is wrong: %s\n", buf ); exit( 1 ); } for ( x = 0; x < im->w; x++ ) { for ( i = 0; i < sp->char_per_pix; i++ ) key[ i ] = *++head; key[ sp->char_per_pix ] = '\0'; for ( match = i = 0; ! match && i < im->map_len; i++ ) if ( ( match = ( key[ 0 ] == map[ i ].key[ 0 ] && key[ 1 ] == map[ i ].key[ 1 ] && strcmp( key, map[ i ].key ) == 0 ) ) ) im->ci[ y ][ x ] = i; if ( ! match ) { im->error_message( im, "Bad pixel" ); im->ci[ y ][ x ] = 0; } } } fl_free( buf ); return 0; } /* this is enough for about 2000 colors */ static char token[ ] = ".+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN$%&!"; /*************************************** * Only write colormaped images ***************************************/ static int XPM_dump( FL_IMAGE * im ) { int cpp, i, j, k, x, y, buflen; FILE *fp = im->fpout; int len = strlen( token ), packed, gray; char name[ 512 ], *p, *buf; XPMMap map[ 256 ]; unsigned short *ci; /* get a correct pixel name */ p = get_xpm_pixel_name( strcpy( name, im->outfile ) ); cpp = 1 + ( im->map_len > len ); fprintf( fp, "/* XPM */\nstatic char *%s[] = {\n", p ); fprintf( fp, "\"%d %d %d %d\",\n", im->w, im->h, im->map_len, cpp ); /* generate tokens on the fly (len*(len-1) possibilities */ for ( i = k = 0; k < im->map_len && i < len; i++ ) { for ( j = i + 1; k < im->map_len && j < len; j++, k++ ) { map[ k ].key[ 0] = token[ j ]; map[ k ].key[ 1] = token[ i ]; map[ k ].key[ cpp ] = '\0'; } } for ( i = 0; i < im->map_len; i++ ) { map[ i ].r = im->red_lut[ i ]; map[ i ].g = im->green_lut[ i ]; map[ i ].b = im->blue_lut[ i ]; packed = FL_PACK( map[ i ].r, map[ i ].g, map[ i ].b ); gray = 100 * FL_RGB2GRAY(map[ i ].r, map[ i ].g, map[ i ].g ) / 255.0 + 0.5; if ( packed == im->tran_rgb || i == im->tran_index ) { strcpy( map[ i ].key, cpp == 1 ? " " : " " ); fprintf( fp, "\"%s c None g None \", \n", map[ i ].key ); } else { fprintf( fp, "\"%s c #%02x%02x%02x g grey%d \",\n", map[ i ].key, map[ i ].r, map[ i ].g, map[ i ].b, gray ); } } /* now pixels */ buf = fl_malloc( cpp * ( im->w + 5 ) * sizeof *buf ); for ( buflen = y = 0; y < im->h; y++, im->completed++ ) { if ( ! ( im->completed & FLIMAGE_REPFREQ ) ) im->visual_cue( im, "writing xpm" ); buf[ 0 ] = '"'; buf[ buflen + 1 ] = '\0'; ci = im->ci[ y ]; /* we never write cpp > 2 */ if ( cpp == 1 ) { for ( x = 0; x < im->w; x++ ) buf[ buflen++ ] = map[ ci[ x ] ].key[ 0 ]; } else { for ( x = 0; x < im->w; x++ ) { buf[ buflen++ ] = map[ ci[ x ] ].key[ 0 ]; buf[ buflen++ ] = map[ ci[ x ] ].key[ 1 ]; } } buf[ buflen ] = '\0'; if ( i < im->h - 1 ) fprintf( fp, "%s\",\n", buf ); else fprintf( fp, "%s\"\n", buf ); } /* { */ fprintf( fp, "};\n" ); fl_free( buf ); return 0; } /*************************************** ***************************************/ static char * get_xpm_pixel_name( char * str ) { char *name, *q, *p; if ( ! ( name = strrchr( str, '/' ) ) ) name = str; /* get rid of extension */ if ( ( q = strchr( name, '.' ) ) ) *q = '\0'; /* make sure it's a legal C name */ if ( ! isalpha( ( unsigned char ) *name ) ) *name = 'A'; for ( p = name + 1; *p; p++ ) if ( ! isalnum( ( unsigned char ) *p ) && *p != '_' ) *p = '_'; return name; } /*************************************** ***************************************/ void flimage_enable_xpm( void ) { flimage_add_format( "XPM format", "xpm", "xpm", FL_IMAGE_CI, XPM_identify, XPM_description, XPM_load, XPM_dump ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_replace.c0000644000175000017500000000606412251675252013775 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1998-2002 T.C. Zhao * All rights reserved. * * replace a specific pixel */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" /*************************************** * replace all color target with color repl ***************************************/ int flimage_replace_pixel( FL_IMAGE * im, unsigned int target, unsigned int repl ) { int n, r1, g1, b1, r2, g2, b2; if ( ! im || im->w <= 0 ) return -1; FL_UNPACK( target, r1, g1, b1 ); FL_UNPACK( repl, r2, g2, b2 ); flimage_invalidate_pixels( im ); if ( im->type == FL_IMAGE_RGB ) { unsigned char *red = im->red[ 0 ]; unsigned char *green = im->green[ 0 ]; unsigned char *blue = im->blue[ 0 ]; for ( n = im->w * im->h; --n >= 0; ) { if ( ( int ) target == FL_PACK( red[ n ], green[ n ], blue[ n ] ) ) { red[ n ] = r2; green[ n ] = g2; blue[ n ] = b2; } } } else if ( im->type == FL_IMAGE_PACKED ) { unsigned int *packed = im->packed[ 0 ]; for ( n = im->w * im->h; --n >= 0; ) { if ( packed[ n ] == target ) packed[ n ] = repl; } } else if ( FL_IsGray( im->type ) ) { unsigned short *gray = im->gray[ 0 ]; unsigned short gray1 = FL_RGB2GRAY( r1, g1, b1 ); unsigned short gray2 = FL_RGB2GRAY( r2, g2, b2 ); for ( n = im->w * im->h; --n >= 0; ) if ( gray[n] == gray1 ) gray[ n ] = gray2; } else if ( FL_IsCI( im->type ) ) { unsigned short *ci = im->ci[ 0 ]; unsigned short c1 = flimage_get_closest_color_from_map( im, target ); unsigned short c2 = flimage_get_closest_color_from_map( im, repl ); for ( n = im->w * im->h; --n >= 0; ) if ( ci[ n ] == c1 ) ci[ n ] = c2; } else { M_err( "ReplaceColor", "InternalError: bad type %d", im->type ); return -1; } im->modified = 1; return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_scale.c0000644000175000017500000002003412251675243013442 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1993, 1998-2002 T.C. Zhao * All rights reserved. * * Scale an image with or without subpixel sampling. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" /*************************************** * Scale an image without subpixel sampling. Parameter im is strictly * for reporting purposes ***************************************/ static int image_zoom( void * om[ ], void * nm[ ], int h, int w, int nh, int nw, int comp, FL_IMAGE * im FL_UNUSED_ARG ) { int *lut = fl_malloc( ( nw + 1 ) * sizeof *lut ); unsigned short **ngray = nm[ 0 ], **ogray = om[ 0 ]; unsigned char **npc[ 3 ], **opc[ 3 ]; int i, j, iy, ix; if ( ! lut ) return -1; for ( i = 0; i < nw; i++ ) lut[ i ] = ( i * ( w - 1 ) ) / ( nw - 1 ); for ( i = 0; i < 3; i++ ) { npc[ i ] = nm[ i ]; opc[ i ] = om[ i ]; } for ( i = 0; i < nh; i++ ) { iy = ( i * ( h - 1 ) ) / ( nh - 1 ); if ( comp == 1 ) { for ( j = 0; j < nw; j++ ) ngray[ i ][ j ] = ogray[ iy ][ lut[ j ] ]; } else { for ( j = 0; j < nw; j++ ) { ix = lut[ j ]; npc[ 0 ][ i ][ j ] = opc[ 0 ][ iy ][ ix ]; npc[ 1 ][ i ][ j ] = opc[ 1 ][ iy ][ ix ]; npc[ 2 ][ i ][ j ] = opc[ 2 ][ iy ][ ix ]; } } } fl_free( lut ); return 0; } /*************************************** * Box averaging. parameter im is strictly for reporting ***************************************/ static int image_scale( void * om[ ], void * nm[ ], int h, int w, int nh, int nw, int comp, FL_IMAGE * im ) { float xt = ( float ) w / nw; float yt = ( float ) h / nh; float s[ 3 ], area, delta; float width, height; float x1, x2, y1, y2; int x, y, i, j; unsigned char **npc[ 3 ], **opc[ 3 ]; unsigned short **ogray = om[ 0 ], **ngray = nm[ 0 ]; for ( i = 0; i < 3; i++ ) { npc[ i ] = nm[ i ]; opc[ i ] = om[ i ]; } for ( y1 = 0.0f, j = 0; j < nh; j++, y1 += yt, im->completed++ ) { if ( ! ( im->completed & FLIMAGE_REPFREQ ) ) im->visual_cue( im, "Scaling " ); y2 = y1 + yt; if ( y2 > h ) y2 = h; for ( x1 = 0.0f, i = 0; i < nw; i++, x1 += xt ) { s[ 0 ] = s[ 1 ] = s[ 2 ] = area = 0.0; x2 = x1 + xt; if ( x2 > w ) x2 = w; for ( y = ( int ) y1; y < y2; y++ ) { if ( y < y1 ) height = y + 1.0 - y1; else if ( y + 1.0 > y2 ) height = y2 - y; else height = 1.0; for ( x = ( int ) x1; x < x2; x++) { if ( x < x1 ) width = x + 1.0 - x1; else if ( x + 1.0 > x2 ) width = x2 - x; else width = 1.0; area += ( delta = width * height ); if ( comp == 1 ) s[ 0 ] += delta * ogray[ y ][ x ]; else { s[ 0 ] += delta * opc[ 0 ][ y ][ x ]; s[ 1 ] += delta * opc[ 1 ][ y ][ x ]; s[ 2 ] += delta * opc[ 2 ][ y ][ x ]; } } } if ( comp == 1 ) ngray[ j ][ i ] = s[ 0 ] / area; else { npc[ 0 ][ j ][ i ] = s[ 0 ] / area; npc[ 1 ][ j ][ i ] = s[ 1 ] / area; npc[ 2 ][ j ][ i ] = s[ 2 ] / area; } } } return 0; } /*************************************** ***************************************/ int flimage_scale( FL_IMAGE * im, int nw, int nh, int option ) { void *om[ 3 ], *nm[ 3 ] = { 0, 0, 0 }; int err = 0, comp; if ( ! im || im->w <= 0 || im->type == FL_IMAGE_NONE ) return -1; /* Check if null op */ if ( im->w == nw && im->h == nh ) return 0; /* Convert to RGB only if subpixel and not gray */ if ( option & FLIMAGE_SUBPIXEL ) { if ( im->type == FL_IMAGE_CI ) err = flimage_convert( im, FL_IMAGE_RGB, 0 ) < 0; else if ( im->type == FL_IMAGE_MONO ) err = flimage_convert( im, FL_IMAGE_GRAY, 0 ) < 0; if ( err ) { im->error_message( im, "scale: conversion to RGB/Gray failed" ); return -1; } } /* Free all irrelevant pixels */ flimage_invalidate_pixels( im ); if ( im->type == FL_IMAGE_RGB ) { om[ 0 ] = im->red; om[ 1 ] = im->green; om[ 2 ] = im->blue; /* For size fitting, we don't need allocate pixels here */ if ( ! ( option & FLIMAGE_ASPECT ) ) { err = err || ! ( nm[ 0 ] = fl_get_matrix( nh, nw, sizeof **im->red ) ) || ! ( nm[ 1 ] = fl_get_matrix( nh, nw, sizeof **im->red ) ) || ! ( nm[ 2 ] = fl_get_matrix( nh, nw, sizeof **im->red ) ); } comp = 3; } else { om[ 0 ] = FL_IsGray( im->type ) ? im->gray : im->ci; err = err || ! ( nm[ 0 ] = fl_get_matrix( nh, nw, sizeof **im->gray ) ); om[ 1 ] = nm[ 1 ] = om[ 2 ] = nm[ 2 ] = 0; comp = 1; } if ( err ) { im->error_message( im, "Scale: malloc failed" ); fl_free_matrix( nm[ 0 ]); fl_free_matrix( nm[ 1 ]); fl_free_matrix( nm[ 2 ]); im->modified = 1; return -1; } im->completed = 0; im->visual_cue( im, "Scaling" ); if ( option & FLIMAGE_ASPECT ) { static float m[ 2 ][ 2 ]; m[ 0 ][ 0 ] = ( float ) nw / im->w; m[ 1 ][ 1 ] = ( float ) nh / im->h; m[ 0 ][ 0 ] = m[ 1 ][ 1 ] = FL_min( m[ 0 ][ 0 ], m[ 1 ][ 1 ] ); fl_free_matrix( nm[ 0 ] ); err = flimage_warp( im, m, nw, nh, option ); im->completed = im->h; im->visual_cue( im, "Scaling Done" ); return err; } else if ( option & FLIMAGE_SUBPIXEL ) err = image_scale( om, nm, im->h, im->w, nh, nw, comp, im ) < 0; else err = image_zoom( om, nm, im->h, im->w, nh, nw, comp, im ) < 0; if ( ! err ) { flimage_replace_image( im, nw, nh, nm[ 0 ], nm[ 1 ], nm[ 2 ] ); im->completed = im->h; im->visual_cue( im, "Scaling Done" ); } else { im->visual_cue( im, "Scaling failed" ); im->error_message( im, "Scaling failed" ); } return err ? -1 : 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_rotate.c0000644000175000017500000002337512251675246013667 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1993, 1998-2002 By T.C. Zhao * All rights reserved. * * Image rotation */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" #include #include #ifndef M_PI #define M_PI 3.1415926 #endif static void *rotate_matrix( void *, int, int, int, size_t ); /*************************************** * rotation angle is one-tenth of a degree ***************************************/ int flimage_rotate( FL_IMAGE * im, int deg, int subp ) { int nw, nh; float mat[ 2 ][ 2 ]; void *r, *g = 0, *b = 0; /* normalize the angle to within (0,360) */ while ( deg < 0 ) deg += 3600; while ( deg >= 3600 ) deg -= 3600; if ( deg == 0 || deg == 3600 ) return 0; /* handle special cases TODO */ if ( deg % 900 == 0 ) { deg /= 10; if ( im->type == FL_IMAGE_RGB ) { r = rotate_matrix( im->red, im->h, im->w, deg, sizeof **im->red ); g = rotate_matrix( im->green, im->h, im->w, deg, sizeof **im->green ); b = rotate_matrix( im->blue, im->h, im->w, deg, sizeof **im->blue ); } else if ( im->type == FL_IMAGE_GRAY ) r = rotate_matrix( im->gray, im->h, im->w, deg, sizeof **im->gray ); else if ( im->type == FL_IMAGE_CI ) r = rotate_matrix( im->ci, im->h, im->w, deg, sizeof **im->ci ); else { M_err( "flimage_rotate", "InternalError: unsupported image " "type\n" ); return -1; } if ( deg % 180 == 0 ) { nw = im->w; nh = im->h; } else { nw = im->h; nh = im->w; } if ( ! r ) return -1; flimage_replace_image( im, nw, nh, r, g, b ); return 0; } /* three shear is slightly faster , but with general transform, * we save a lot of code */ mat[ 0 ][ 0 ] = mat[ 1 ][ 1 ] = cos( deg * M_PI / 1800.0 ); mat[ 0 ][ 1 ] = sin( deg * M_PI / 1800.0 ); mat[ 1 ][ 0 ] = -mat[ 0 ][ 1 ]; nw = nh = 0; if ( flimage_warp(im, mat, nw, nh, subp) >= 0 ) { im->completed = im->h; im->visual_cue( im, "Rotation Done" ); return 0; } else return -1; } static int flip_matrix( void *, int, int, int, int ); /*************************************** ***************************************/ int flimage_flip( FL_IMAGE * im, int axis ) { int err = 0; if ( im->type == FL_IMAGE_RGB ) err = flip_matrix( im->red, im->h, im->w, 1, axis ) < 0 || flip_matrix( im->green, im->h, im->w, 1, axis ) < 0 || flip_matrix( im->blue, im->h, im->w, 1, axis ) < 0; else if (FL_IsGray(im->type)) err = flip_matrix( im->gray, im->h, im->w, 2, axis ) < 0; else err = flip_matrix( im->ci, im->h, im->w, 2, axis ) < 0; if ( ! err ) im->modified = 1; return err ? -1 : 0; } /* low level matrix stuff */ #define flip_col( type, matrix, rows, cols ) \ do { \ type **mm = matrix, \ *t, \ *h, \ tmp; \ int j; \ for ( j = 0; j < rows; j++ ) \ for( t = ( h = mm[ j ] ) + cols - 1; t > h; t--, h++ ) \ { \ tmp = *h; \ *h = *t; \ *t = tmp; \ } \ } while ( 0 ) /*************************************** * flip a matrix. Mirror about the x or y ***************************************/ static int flip_matrix( void * matrix, int rows, int cols, int esize, int what ) { if ( what == 'c' || what == 'x' ) /* flip columns */ { if ( esize == 2 ) flip_col( unsigned short, matrix, rows, cols ); else flip_col( unsigned char, matrix, rows, cols ); } else { int i, is = rows / 2; size_t size = esize * cols; unsigned char *tmp, **mm = matrix; if ( ! ( tmp = fl_malloc( size ) ) ) return -1; /* if we only flip the pointers, this will be faster, but then, the 1-d property is violated */ for ( i = 0; i < is; i++ ) { memcpy( tmp, mm[ i ], size ); memcpy( mm[ i ], mm[ rows - 1 - i ], size ); memcpy( mm[ rows - 1 - i ], tmp, size ); } fl_free( tmp ); } return 0; } /* special angles: +-90, +-180 */ /*************************************************************** * rotate a matrix by 90, or -90 or multiples of it * Rotate 180 can be implented as two 90 rotations, but current * code is faster. * * NOTE: input dimension is the diemsnion of the matrix to be * rotated. caller must take care of the rotated dimensions **************************************************************/ /* Rotate 90 degrees */ #define DO_M90( type, out, in ) \ do { \ type *p= ( ( type ** ) out )[ 0 ], \ **o= in; \ int i, \ j; \ for ( j = 0; j < col; j++ ) \ { \ for ( i = row - 1; i >= 0; i-- ) \ *p++ = o[ i ][ j ]; \ } \ } while ( 0 ) /* Rotate -90 degrees */ #define DO_90( type, out, in ) \ do { \ type *p= ( ( type ** ) out )[ 0 ], \ **o= in; \ int i, \ j; \ for ( j = col - 1; j >= 0; j-- ) \ { \ for ( i = 0; i < row; i++ ) \ *p++ = o[ i ][ j ]; \ } \ } while ( 0 ) #define DO_180( ty, out, in ) \ do { \ ty *p= ( ( ty ** ) out )[ 0 ], \ *o= ( ( ty ** ) in )[ 0 ]; \ ty *os; \ for ( os= o + col * row-1 ; os > o; *p++ = *os-- ) \ /* empty */ ; \ } while( 0 ) /*************************************** ***************************************/ static void * rotate_matrix( void * m, int row, int col, int deg, size_t e ) { int nrow = row, ncol = col; void *mm; /* Coerce angle to be +/- 360 */ deg %= 360; /* Now coerce it into +/- 180. */ if ( abs( deg ) > 180 ) { if ( deg < 0 ) deg += 360; else deg -= 360; } if ( deg == 90 || deg == -90 ) { nrow = col; ncol = row; } if ( ! ( mm = fl_get_matrix( nrow, ncol, e ) ) ) return 0; if ( deg == 90 ) { if ( e == 2 ) DO_90( unsigned short, mm, m ); else DO_90( unsigned char, mm, m ); } else if ( deg == -90 ) { if ( e == 2 ) DO_M90( unsigned short, mm, m ); else DO_M90( unsigned char, mm, m ); } else if ( deg == 180 || deg == -180 ) { if ( e == 2 ) DO_180( unsigned short, mm, m ); else DO_180( unsigned char, mm, m ); } else { M_err( "RotateMatrix", "InternalError: bad special angle\n" ); return 0; } return mm; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_jpeg.c0000644000175000017500000002770212251675273013314 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1993, 1998-2002 T.C. Zhao * All rights reserved. * * JFIF file IO support. * Based mostly on Independent JPEG Groups' example code. * * Except for a couple of output control parameters, there are no * static variables. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" /* jpeglib.h includes jconfig.h which has a old-style definition of * HAVE_STDLIB_H. This breaks compilation with compilers like IBM's * xlc. */ #ifdef HAVE_STDLIB_H #undef HAVE_STDLIB_H #endif #include "jpeglib.h" #include "jerror.h" #include /* For some reason, jpeg 6.1 does not work well */ #if JPEG_LIB_VERSION < 62 #error does not work well with jpeg lib v6.a #endif /* options supported by jpeg reader/writer */ static int do_quantization = 0; static int quality_factor = 75; static int smoothing_factor = 0; /*************************************** ***************************************/ void flimage_jpeg_output_options( FLIMAGE_JPEG_OPTION * op ) { quality_factor = op->quality; smoothing_factor = op->smoothing; } static unsigned int jpeg_getc( j_decompress_ptr cinfo ); /*************************************** ***************************************/ static int JPEG_identify( FILE * fp ) { unsigned char buf[ 129 ]; size_t i; i = fread( buf, 1, sizeof buf - 1, fp ); rewind( fp ); buf[ i ] = '\0'; /* Clive Stubbings. * Test for a JPEG SOI code (0xff, 0xd8) followed by the start of * APP0 segement (0xff). * A 'raw' JPEG will not have the JFIF (JPEG file interchange format) * header but is still readable */ if ( buf[ 0 ] == 0xff && buf[ 1 ] == 0xd8 && buf[ 2 ] == 0xff ) return 1; for ( i = 0; i < sizeof buf - 3 && buf[ i ] != 'J'; i++ ) /* empty */ ; return ! strncmp( ( char * ) buf + i, "JFIF", 4 ); } /* cinfo->client_data member only exists in V6B, have to stuff image into error handler. Yuck! */ typedef struct { struct jpeg_error_mgr pub; jmp_buf jmp_buffer; struct jpeg_decompress_struct dinfo; struct jpeg_compress_struct cinfo; FL_IMAGE *image; } SPEC; /*************************************** ***************************************/ static void error_exit( j_common_ptr cinfo ) { SPEC *spec = ( SPEC * ) cinfo->err; static char buf[ 1024 ]; cinfo->err->format_message( cinfo, buf ); spec->image->error_message( spec->image, buf ); longjmp( spec->jmp_buffer, 1 ); } /*************************************** ***************************************/ static boolean gather_comments( j_decompress_ptr cinfo ) { SPEC *spec = ( SPEC * ) cinfo->err; FL_IMAGE *image = spec->image; int length, ch; char *s; length = jpeg_getc( cinfo ) << 8; length += jpeg_getc( cinfo ) - 2; image->comments = fl_realloc( image->comments, length + 1 ); image->comments[ length ] = '\0'; image->comments_len = length; for ( s = image->comments; --length >= 0; ) { ch = jpeg_getc( cinfo ); *s++ = ch; } return FL_TRUE; } /*************************************** ***************************************/ static boolean gather_text( j_decompress_ptr cinfo ) { SPEC *spec = ( SPEC * ) cinfo->err; FL_IMAGE *image = spec->image; int length, ch; char *s; length = jpeg_getc( cinfo ) << 8; length += jpeg_getc( cinfo ) - 2; if ( image->comments ) image->comments = fl_realloc( image->comments, length + 1 ); else image->comments = fl_malloc( length + 1 ); image->comments[ length ] = '\0'; image->comments_len = length; for ( s = image->comments; --length >= 0; ) { ch = jpeg_getc( cinfo ); *s++ = ch; } if ( image->comments[ image->comments_len - 1 ] == '\n' ) image->comments[ image->comments_len - 1 ] = ' '; return FL_TRUE; } /*************************************** ***************************************/ static int JPEG_description( FL_IMAGE * im ) { SPEC *spec = fl_malloc( sizeof *spec ); struct jpeg_decompress_struct *cinfo; cinfo = &spec->dinfo; cinfo->err = jpeg_std_error( &spec->pub ); spec->pub.error_exit = error_exit; spec->image = im; im->io_spec = spec; jpeg_create_decompress( cinfo ); jpeg_set_marker_processor( cinfo, JPEG_COM, gather_comments ); jpeg_set_marker_processor( cinfo, JPEG_APP0 + 12, gather_text ); jpeg_stdio_src( cinfo, im->fpin ); jpeg_read_header( cinfo, FL_TRUE ); /* decompressison options such as quantization here */ if (do_quantization) { cinfo->desired_number_of_colors = 215; cinfo->quantize_colors = FL_TRUE; cinfo->enable_2pass_quant = FL_TRUE; cinfo->two_pass_quantize = FL_TRUE; cinfo->dither_mode = JDITHER_FS; } jpeg_start_decompress( cinfo ); im->w = cinfo->output_width; im->h = cinfo->output_height; im->map_len = cinfo->desired_number_of_colors; if ( cinfo->out_color_space == JCS_GRAYSCALE ) im->type = FL_IMAGE_GRAY; else if ( cinfo->out_color_space == JCS_RGB ) im->type = cinfo->output_components == 3 ? FL_IMAGE_RGB : FL_IMAGE_CI; else { im->error_message( im, "unhandled colorspace" ); return -1; } im->original_type = im->type; return 0; } /*************************************** ***************************************/ static int JPEG_read_pixels( FL_IMAGE * im ) { SPEC *spec = im->io_spec; struct jpeg_decompress_struct *cinfo = &spec->dinfo; int i, j, stride, err; JSAMPARRAY buf; unsigned short *gray, *ci; if ( setjmp( spec->jmp_buffer ) ) { jpeg_destroy_decompress( cinfo ); /* keep what we'be got */ return ( im->completed > im->w / 2 ) ? 1 : -1; } err = 0; stride = cinfo->output_width * cinfo->output_components; buf = cinfo->mem->alloc_sarray( ( j_common_ptr ) cinfo, JPOOL_IMAGE, stride, 1 /* cinfo->rec_outbuf_height */ ); while ( cinfo->output_scanline < cinfo->output_height && ! err ) { jpeg_read_scanlines( cinfo, buf, 1 /* cinfo->rec_out_height */ ); if ( ! ( cinfo->output_scanline & FLIMAGE_REPFREQ ) ) { im->completed = cinfo->output_scanline; im->visual_cue( im, "Reading JPEG" ); } if ( im->type == FL_IMAGE_RGB ) { for ( i = j = 0; i < ( int ) cinfo->output_width; i++, j += 3 ) { im->red[ cinfo->output_scanline - 1 ][ i ] = buf[ 0 ][ j ]; im->green[ cinfo->output_scanline - 1 ][ i ] = buf[ 0 ][ j + 1 ]; im->blue[ cinfo->output_scanline - 1 ][ i ] = buf[ 0 ][ j + 2 ]; } } else if ( im->type == FL_IMAGE_CI ) { im->map_len = cinfo->actual_number_of_colors; for ( i = 0; i < cinfo->actual_number_of_colors; i++ ) { im->red_lut[ i ] = cinfo->colormap[ 0 ][ i ]; im->green_lut[ i ] = cinfo->colormap[ 1 ][ i ]; im->blue_lut[ i ] = cinfo->colormap[ 2 ][ i ]; } ci = im->ci[ cinfo->output_scanline - 1 ]; for ( i = 0; i < ( int ) cinfo->output_width; i++ ) ci[ i ] = buf[ 0 ][ i ]; } else if ( im->type == FL_IMAGE_GRAY ) { gray = im->gray[ cinfo->output_scanline - 1 ]; for ( i = j = 0; i < im->w; i++ ) gray[ i ] = buf[ 0 ][ i ]; } else { flimage_error( im, "%s: unknown color space", im->infile ); err = 1; } } jpeg_finish_decompress( cinfo ); jpeg_destroy_decompress( cinfo ); return im->completed > im->h / 3 ? 1 : -1; } /*************************************** ***************************************/ static int JPEG_write( FL_IMAGE * im ) { SPEC *spec = fl_calloc( 1, sizeof *spec ); struct jpeg_compress_struct *cinfo; /* JSAMPROW rowptr[ 1 ]; */ JSAMPARRAY rowptr; unsigned char *buf; int i; cinfo = &spec->cinfo; cinfo->err = jpeg_std_error( &spec->pub ); spec->pub.error_exit = error_exit; if ( setjmp( spec->jmp_buffer ) ) { jpeg_destroy_compress( cinfo ); fl_free( spec ); return -1; } jpeg_create_compress( cinfo ); jpeg_stdio_dest( cinfo, im->fpout ); cinfo->image_width = im->w; cinfo->image_height = im->h; if ( im->type == FL_IMAGE_RGB ) { cinfo->input_components = 3; cinfo->in_color_space = JCS_RGB; } else if ( im->type == FL_IMAGE_GRAY ) { cinfo->input_components = 1; cinfo->in_color_space = JCS_GRAYSCALE; } jpeg_set_defaults( cinfo ); jpeg_set_quality( cinfo, quality_factor, FL_TRUE ); cinfo->smoothing_factor = smoothing_factor; jpeg_start_compress( cinfo, FL_TRUE ); if ( im->comments ) jpeg_write_marker( cinfo, JPEG_COM, (void *) im->comments, im->comments_len ); rowptr = cinfo->mem->alloc_sarray( ( j_common_ptr ) cinfo, JPOOL_IMAGE, cinfo->input_components * im->w, 1 ); while ( cinfo->next_scanline < cinfo->image_height ) { if ( ! ( cinfo->next_scanline & FLIMAGE_REPFREQ ) ) { im->completed = cinfo->next_scanline; im->visual_cue( im, "Writing JPEG " ); } for ( buf = rowptr[ 0 ], i = 0; i < im->w; i++ ) { if ( cinfo->input_components == 3 ) { *buf++ = im->red[ cinfo->next_scanline ][ i ]; *buf++ = im->green[ cinfo->next_scanline ][ i ]; *buf++ = im->blue[ cinfo->next_scanline ][ i ]; } else *buf++ = ( unsigned char ) im->gray[ cinfo->next_scanline ][ i ]; } jpeg_write_scanlines( cinfo, rowptr, 1 ); } jpeg_finish_compress( cinfo ); fflush( im->fpout ); jpeg_destroy_compress( cinfo ); fl_free( spec ); return 1; } /*************************************** ***************************************/ static unsigned int jpeg_getc( j_decompress_ptr cinfo ) { struct jpeg_source_mgr *datasrc = cinfo->src; if (datasrc->bytes_in_buffer == 0) { if (!datasrc->fill_input_buffer(cinfo)) ERREXIT(cinfo, JERR_CANT_SUSPEND); } datasrc->bytes_in_buffer--; return GETJOCTET(*datasrc->next_input_byte++); } /*************************************** ***************************************/ void flimage_enable_jpeg( void ) { flimage_add_format( "JPEG/JFIF format", "jpeg", "jpg", FL_IMAGE_RGB | FL_IMAGE_GRAY, JPEG_identify, JPEG_description, JPEG_read_pixels, JPEG_write ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_proc.c0000644000175000017500000003176712251675255013340 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1993, 1998-2002 By T.C. Zhao * All rights reserved. * * simple image processing routines */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flimage.h" #include "flimage_int.h" static void * get_submatrix( void *, int, int, int, int, int, int, unsigned int ); static void * make_submatrix( void *, int, int, int, int, int, int, unsigned int ); /******************************************************************** * general pixel transformation ********************************************************************/ int flimage_transform_pixels( FL_IMAGE * im, int * red, int * green, int * blue ) { int i, j; FL_PCTYPE *r, *g, *b; SubImage *sub; if ( ! im || im->w <= 0 ) return -1; flimage_convert( im, FL_IMAGE_RGB, 0 ); flimage_invalidate_pixels( im ); if ( ! ( sub = flimage_get_subimage( im, 1 ) ) ) return -1; im->total = sub->h; im->visual_cue( im,"Transforming" ); for ( i = 0; i < sub->h; i++ ) { r = ( ( FL_PCTYPE ** ) sub->mat[ 0 ] )[ i ]; g = ( ( FL_PCTYPE ** ) sub->mat[ 1 ] )[ i ]; b = ( ( FL_PCTYPE ** ) sub->mat[ 2 ] )[ i ]; if ( ! ( i & FLIMAGE_REPFREQ ) ) { im->completed = i; im->visual_cue( im,"Transforming" ); } for ( j = 0; j < sub->w; j++ ) { r[ j ] = red[ r[ j ] ]; g[ j ] = green[ g[ j ] ]; b[ j ] = blue[ b[ j ] ]; } } im->completed = sub->h; im->visual_cue( im,"Transforming" ); if ( im->subw ) { fl_free_matrix( sub->mat[ 0 ] ); fl_free_matrix( sub->mat[ 1 ] ); fl_free_matrix( sub->mat[ 2 ] ); } im->modified = 1; return 0; } /******************************************************************** * tint. ******************************************************************{*/ int flimage_tint( FL_IMAGE * im, unsigned int packed, double opacity ) { float r = FL_GETR( packed ) * opacity + 0.001; float g = FL_GETG( packed ) * opacity + 0.001; float b = FL_GETB( packed ) * opacity + 0.001; float trans = 1 - opacity, tmp; int i; if ( ! im || im->w <= 0 ) return -1; if ( flimage_get_linearlut( im ) < 0 ) return -1; for ( i = 0; i < im->map_len; i++ ) { tmp = i * trans; im->llut[ 0 ][ i ] = tmp + r; im->llut[ 1 ][ i ] = tmp + g; im->llut[ 2 ][ i ] = tmp + b; } return flimage_transform_pixels( im, im->llut[ 0 ], im->llut[ 1 ], im->llut[ 2 ]); } /* get a subimage of the image. if parameter make is true, we fake a matrix so processing is done in place */ #define MAX_RETBUF 6 /* hack to be limited re-entrent */ SubImage * flimage_get_subimage( FL_IMAGE * im, int make ) { static SubImage subimage[ MAX_RETBUF ]; static int buf; SubImage *sub = subimage + buf; void * ( * submat )( void *, int, int, int, int, int, int, unsigned int ); submat = make ? make_submatrix : get_submatrix; im->subx = FL_clamp( im->subx, 0, im->w - 1 ); im->suby = FL_clamp( im->suby, 0, im->h - 1 ); sub->comp = FL_IsGray( im->type) ? 1 : 3; sub->mat[ 0 ] = sub->mat[ 1 ] = sub->mat[ 2 ] = NULL; if ( im->subw < 0 || im->subh < 0 ) im->subw = im->subh = 0; if ( im->subx + im->subw > im->w ) im->subw = im->subh = 0; if ( im->suby + im->subh > im->h ) im->subw = im->subh = 0; if ( im->subw == 0 ) { sub->w = im->w; sub->h = im->h; if ( sub->comp == 1 ) sub->mat[ 0 ] = im->gray; else { sub->mat[ 0 ] = im->red; sub->mat[ 1 ] = im->green; sub->mat[ 2 ] = im->blue; } } else { int err; sub->w = im->subw; sub->h = im->subh; if ( sub->comp == 3 ) { err = ! ( sub->mat[ 0 ] = submat( im->red, im->h, im->w, im->suby, im->subx, im->subh, im->subw, sizeof **im->red ) ); err = err || ! ( sub->mat[ 1 ] = submat( im->green, im->h, im->w, im->suby, im->subx, im->subh, im->subw, sizeof **im->red ) ); err = err || ! ( sub->mat[ 2 ] = submat( im->blue, im->h, im->w, im->suby, im->subx, im->subh, im->subw, sizeof **im->blue ) ); } else err = ! ( sub->mat[ 0 ] = submat( im->gray, im->h, im->w, im->suby, im->subx, im->subh, im->subw, sizeof **im->gray ) ); if ( err ) { im->error_message( im, "Failed to get working memory" ); fl_free_matrix( sub->mat[ 0 ]); fl_free_matrix( sub->mat[ 1 ]); fl_free_matrix( sub->mat[ 2 ] ); return NULL; } } buf = ( buf + 1 ) % MAX_RETBUF; return sub; } /********************************************************************** * Simple matrix operations **********************************************************************/ /* grab a piece of a matrix without copying */ static void * make_submatrix( void * in, int rows, int cols, int r1, int c1, int rs, int cs, unsigned int esize ) { int i; unsigned int offset = c1 * esize; char **subm; char **mat = in; if (r1 < 0 || c1 < 0 || (r1 + rs - 1) >= rows || (c1 + cs - 1) >= cols) { M_err("make_submatrix", "Bad arguments"); return 0; } if ( mat[ -1 ] != ( char * ) FL_GET_MATRIX && mat[ -1 ] != ( char * ) FL_MAKE_MATRIX ) { M_err( "make_submatrix", "input is not a matrix" ); return NULL; } subm = fl_malloc( ( rs + 1 ) * sizeof(void *)); subm[ 0 ] = ( char * ) FL_MAKE_MATRIX; for ( i = 1; i <= rs; i++ ) subm[ i ] = mat[ r1 + i - 1 ] + offset; return subm + 1; } /* grab a piece of a matrix */ static void * get_submatrix( void * in, int rows, int cols, int r1, int c1, int rs, int cs, unsigned int esize ) { int i; unsigned int offset = c1 * esize, size = cs * esize; char **subm; char **mat = in; if ( r1 < 0 || c1 < 0 || r1 + rs - 1 >= rows || c1 + cs - 1 >= cols ) { M_err("get_submatrix", "Bad arguments"); return 0; } if ( mat[ -1 ] != ( char * ) FL_GET_MATRIX && mat[ -1 ] != ( char * ) FL_MAKE_MATRIX ) { M_err( "get_submatrix", "input is not a matrix" ); return NULL; } subm = fl_get_matrix( rows, cols, esize ); for ( i = 0; i < rs; i++ ) memcpy( subm[ i ], mat[ r1 + i ] + offset, size ); return subm; } /*********************************************************************** * Histogram equalization ***********************************************************************/ static int get_histogram(FL_IMAGE * im) { unsigned int *rhist, *ghist, *bhist, *grhist; unsigned int size = ( FL_PCMAX + 3 ) * sizeof **im->hist; if ( ! im->hist[ 0 ] ) { im->hist[ 0 ] = fl_malloc( size ); im->hist[ 1 ] = fl_malloc( size ); im->hist[ 2 ] = fl_malloc( size ); im->hist[ 3 ] = fl_malloc( size ); } memset( rhist = im->hist[ 0 ], 0, size ); memset( ghist = im->hist[ 1 ], 0, size ); memset( bhist = im->hist[ 2 ], 0, size ); memset( grhist = im->hist[ 3 ], 0, size ); if ( im->type == FL_IMAGE_RGB ) { int g, n; for ( n = im->w * im->h; --n >= 0; ) { if ( ++rhist[ im->red[ 0 ][ n ] ] == 0 ) rhist[ im->red[ 0 ][ n ] ]--; if ( ++ghist[ im->green[ 0 ][ n ] ] == 0 ) ghist[ im->green[ 0 ][ n ] ]--; if ( ++bhist[ im->blue[ 0 ][ n ] ] == 0 ) bhist[ im->blue[ 0 ][ n ] ]--; g = FL_RGB2GRAY( im->red[ 0 ][ n ], im->green[ 0 ][ n ], im->blue[ 0 ][ n ] ); if ( ++grhist[ g ] == 0 ) grhist[ g ]--; } } else if ( im->type == FL_IMAGE_GRAY ) { int n; for ( n = im->w * im->h; --n >= 0; ) { if ( ++grhist[ im->gray[ 0 ][ n ] ] == 0 ) grhist[ im->gray[ 0 ][ n ] ]--; } } else if ( im->type == FL_IMAGE_CI ) { unsigned short *ci = im->ci[ 0 ]; int g; for ( ci = im->ci[ 0 ] + im->w * im->h; --ci >= im->ci[ 0 ]; ) { if ( ++rhist[ im->red_lut[ *ci ] ] ) rhist[ im->red_lut[ *ci ] ]--; if ( ++ghist[ im->green_lut[ *ci ] ] ) ghist[ im->green_lut[ *ci ] ]--; if ( ++bhist[ im->blue_lut[ *ci ] ] ) bhist[ im->blue_lut[ *ci ] ]--; g = FL_RGB2GRAY( im->red_lut[ *ci ], im->green_lut[ *ci ], im->blue_lut[ *ci ] ); if ( ++grhist[ g ] == 0 ) grhist[ g ]--; } } else { im->error_message( im, "histogram: unhandled" ); return -1; } return 0; } int flimage_enhance( FL_IMAGE * im, int delta FL_UNUSED_ARG ) { long sum[ FL_PCMAX + 2 ]; int i, n; if (im->type == FL_IMAGE_CI) flimage_convert(im, FL_IMAGE_RGB, 0); else if (im->type == FL_IMAGE_MONO) flimage_convert(im, FL_IMAGE_GRAY, 0); get_histogram( im ); memset( sum, 0, sizeof sum ); sum[ 0 ] = im->hist[ 3 ][ 0 ]; for ( i = 1; i <= FL_PCMAX; i++ ) sum[ i ] = sum[ i - 1 ] + im->hist[ 3 ][ i ]; for ( i = 0; i <= FL_PCMAX; i++ ) sum[ i ] *= ( FL_PCMAX - 0.999f ) / ( im->w * im->h ); if (im->type == FL_IMAGE_RGB) for (n = im->w * im->h; --n >= 0;) { im->red[0][n] = sum[im->red[0][n]]; im->green[0][n] = sum[im->green[0][n]]; im->blue[0][n] = sum[im->blue[0][n]]; } else if (im->type == FL_IMAGE_GRAY) for (n = im->w * im->h; --n >= 0;) im->gray[0][n] = sum[im->gray[0][n]]; else fprintf(stderr, "image_enhance: unhandled"); im->modified = 1; return 0; } int flimage_get_closest_color_from_map( FL_IMAGE * im, unsigned int col ) { int r = FL_GETR( col ), g = FL_GETG( col ), b = FL_GETB( col ); int mindiff = 0x7fffffff, diff; int dr, dg, db, k, i; for ( k = i = 0; i < im->map_len; i++ ) { dr = r - im->red_lut[ i ]; dg = g - im->green_lut[ i ]; db = b - im->blue_lut[ i ]; diff = 3 * dr * dr + 4 * dg * dg + 2 * db * db; if (mindiff > diff) { mindiff = diff; k = i; } } return k; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/image_disp.c0000664000175000017500000014134212353623325013317 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1998-2002 T.C. Zhao * All rights reserved. * * Image display. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "flimage.h" #include "flimage_int.h" #define IMAGEDEBUG 0 #define TRACE 0 static int count_repeats_and_shared( unsigned long *, int ); static int fl_display_ci( FL_IMAGE * im, Window win ); static int fl_display_gray( FL_IMAGE * im, Window win ); static int fl_display_rgb( FL_IMAGE * im, Window win ); static int fl_display_packed( FL_IMAGE * im, Window win ); static int do_quantization( FL_IMAGE *, Colormap, int, unsigned short ** ); /*************************************** * Try to allocate all colors ***************************************/ static unsigned long * get_colors( Colormap colormap, int * red_lut, int * green_lut, int * blue_lut, int map_len, int * allocated ) { XColor xc; unsigned long *newpixels = 0; int npixels, i; *allocated = 0; if ( map_len <= 0 ) { M_err( "get_colors", "bad map length %d\n", map_len ); return 0; } if ( ! ( newpixels = fl_malloc( map_len * sizeof *newpixels ) ) ) { M_err( "get_colors", "malloc failed while getting colors" ); return 0; } xc.flags = DoRed | DoGreen | DoBlue; for ( npixels = i = 0; i < map_len; i++ ) { xc.red = ( red_lut[ i ] << 8 ) | 0xff; xc.green = ( green_lut[ i ] << 8 ) | 0xff; xc.blue = ( blue_lut[ i ] << 8 ) | 0xff; if ( XAllocColor( fl_display, colormap, &xc ) ) newpixels[ npixels++ ] = xc.pixel; } *allocated = npixels; return newpixels; } /*************************************** * Allocate colors. If not enough color, use substitutions ***************************************/ static void get_all_colors( FL_IMAGE * im, unsigned long newpix[ ], int * npix, XColor xc[ ] ) { int i, max_colors = 1 << im->depth, n; for ( i = n = *npix = 0; i < im->map_len; i++ ) { xc[ i ].flags = DoRed | DoGreen | DoBlue; xc[ i ].red = ( im->red_lut[ i ] << 8 ) | 0xff; xc[ i ].green = ( im->green_lut[ i ] << 8 ) | 0xff; xc[ i ].blue = ( im->blue_lut[ i ] << 8 ) | 0xff; if ( XAllocColor( im->xdisplay, im->xcolormap, xc + i ) ) newpix[ n++ ] = xc[ i ].pixel; else xc[ i ].pixel = FL_NoColor; /* bad pixel marker */ } *npix = n; if ( n < im->map_len ) { XColor *mapentry = fl_malloc( max_colors * sizeof *mapentry ); if ( ! mapentry ) { M_err( "get_all_colors", "malloc failure(%d entries)", max_colors ); return; } for ( i = 0; i < max_colors; i++ ) mapentry[ i ].pixel = i; XQueryColors( im->xdisplay, im->xcolormap, mapentry, max_colors ); for ( i = 0; i < im->map_len; i++ ) if ( xc[ i ].pixel == FL_NoColor ) fli_find_closest_color( xc[ i ].red >> 8, xc[ i ].green >> 8, xc[ i ].blue >> 8, mapentry, max_colors, &xc[ i ].pixel ); fl_free( mapentry ); } } #define RGB2PIXEL_8_OR_LESS( im, r, g, b, s, out ) \ do { \ unsigned int trr, tgg, tbb; \ trr = ( r ) >> ( 8 - ( s )->rbits ); \ tgg = ( g ) >> ( 8 - ( s )->gbits ); \ tbb = ( b ) >> ( 8 - ( s )->bbits ); \ out = ( ( trr << ( s )->rshift ) & ( s )->rmask ) \ | ( ( tgg << ( s )->gshift ) & ( s )->gmask ) \ | ( ( tbb << ( s )->bshift ) & ( s )->bmask ); \ if ( im->sdepth == 32 && im->depth == 24 ) \ out |= 0xff000000; \ } while ( 0 ) /*************************************** ***************************************/ static unsigned int rgb2pixel_8bits_or_less( FL_IMAGE * im, unsigned int r, unsigned int g, unsigned int b, FL_RGB2PIXEL * s ) { unsigned int ret; RGB2PIXEL_8_OR_LESS( im, r, g, b, s, ret ); return ret; } #define RGB2PIXEL_8_OR_MORE( im, r, g, b, s, out) \ do { \ unsigned int trr, tgg, tbb; \ trr = ( r ) << ( ( s )->rbits - 8 ); \ tgg = ( g ) << ( ( s )->gbits - 8 ); \ tbb= ( b ) << ( ( s )->bbits - 8 ); \ out = ( ( trr << ( s )->rshift ) & ( s )->rmask ) \ | ( ( tgg << ( s )->gshift ) & ( s )->gmask ) \ | ( ( tbb << ( s )->bshift ) & ( s )->bmask ); \ if ( im->sdepth == 32 && im->depth == 24 ) \ out |= 0xff000000; \ } while ( 0 ) /*************************************** ***************************************/ static unsigned int rgb2pixel_more_than_8bits( FL_IMAGE * im, unsigned int r, unsigned int g, unsigned int b, FL_RGB2PIXEL * s ) { unsigned int ret; RGB2PIXEL_8_OR_MORE( im, r, g, b, s, ret ); return ret; } static unsigned int ( * rgb2pixel )( FL_IMAGE *, unsigned int, unsigned int, unsigned int, FL_RGB2PIXEL * ) = rgb2pixel_8bits_or_less; /*************************************** ***************************************/ static int machine_endian( void ) { static unsigned short a = 0x1234; static unsigned char *c = ( unsigned char * ) &a; return c[ 0 ] == 0x12 ? MSBFirst : LSBFirst; } #define SWAP_CHAR( a, b ) \ do { \ unsigned char tmp_char = a; \ a = b; \ b = tmp_char; \ } while ( 0 ) /*************************************** * display colormapped image: always 8bit color LUT. * ASSUMPTIONS: sizeof(int) == 32bits ***************************************/ static int fl_display_ci( FL_IMAGE * im, Window win FL_UNUSED_ARG ) { Colormap xcolormap; unsigned long *xmapped = NULL; unsigned char *xpixels = NULL, *xpixtmp; unsigned short **ci, *ipixels; unsigned long newpixels[ FLIMAGE_MAXLUT ]; XColor xc[ FLIMAGE_MAXLUT ]; int npixels = 0; int i, j, pad, total = im->w * im->h; XImage *ximage = 0; ci = im->pixels ? im->pixels : im->ci; ipixels = ci[ 0 ]; xcolormap = im->xcolormap; pad = im->depth <= 8 ? 8 : ( im->depth <= 16 ? 16 : 32 ); ximage = XCreateImage( im->xdisplay, im->visual, im->sdepth, ZPixmap, 0, 0, im->w, im->h, pad, 0 ); if ( ximage ) { xpixels = fl_malloc( im->h * ximage->bytes_per_line * sizeof *xpixels ); if ( ! xpixels ) XFree( ximage ); } if ( ! ximage || ! xpixels ) { im->error_message( im, "fl_display_ci: Can't allocate memory" ); return -1; } ximage->data = ( char * ) xpixels; #if IMAGEDEBUG M_err( "fl_display_ci", "w=%d bytes_per_line=%d bits_per_pixel=%d", im->w, ximage->bytes_per_line, ximage->bits_per_pixel ); #endif if ( im->vclass == DirectColor || im->vclass == TrueColor ) { if ( ! ( xmapped = fl_malloc( im->map_len * sizeof *xmapped ) ) ) { XFree( ximage ); fl_free( xpixels ); M_err("fl_display_ci", "malloc failed"); return -1; } #if IMAGEDEBUG fprintf( stderr, "rbits: %d gbits: %d bbits: %d\n", im->rgb2p.rbits, im->rgb2p.gbits, im->rgb2p.bbits ); fprintf( stderr, "rshift: %d gshift: %d bshift: %d\n"a, im->rgb2p.rshift, im->rgb2p.gshift, im->rgb2p.bshift ); #endif for ( i = 0; i < im->map_len; i++ ) { xmapped[ i ] = rgb2pixel( im, im->red_lut[ i ], im->green_lut[ i ], im->blue_lut[ i ], &im->rgb2p ); if ( i == im->tran_index && im->depth == 24 && im->sdepth == 32 ) xmapped[ i ] &= ~ 0xff000000; } if ( machine_endian( ) != ximage->byte_order ) { unsigned char *rgba = ( unsigned char * ) xmapped; if ( ximage->bits_per_pixel == 32 ) { for ( i = 0; i < im->map_len; i++, rgba += 4 ) { SWAP_CHAR( rgba[ 0 ], rgba[ 3 ] ); SWAP_CHAR( rgba[ 1 ], rgba[ 2 ] ); } } else if ( ximage->bits_per_pixel == 16 ) for ( i = 0; i < im->map_len; i++, rgba += 2 ) SWAP_CHAR( rgba[ 0 ], rgba[ 1 ] ); } if ( ximage->bits_per_pixel == 32 ) { unsigned int *ltmp = ( unsigned int * ) xpixels; for ( i = 0; i < total; i++ ) *ltmp++ = xmapped[ ipixels[ i ] ]; } else if ( ximage->bits_per_pixel == 16) { unsigned short *stmp = ( unsigned short * ) xpixels; for ( i = 0; i < total; i++ ) *stmp++ = ( unsigned short ) xmapped[ ipixels[ i ] ]; } else if ( ximage->bits_per_pixel == 8 ) { unsigned char *ctmp = xpixels; for ( i = 0; i < total; i++ ) *ctmp++ = ( unsigned char ) xmapped[ ipixels[ i ] ]; } else if ( ximage->bits_per_pixel == 24 ) { unsigned char *tt = xpixels, *tmp3; unsigned int xcol; for ( j = 0; j < im->h; j++, tt += ximage->bytes_per_line ) for ( i = 0, tmp3 = tt; i < im->w; i++ ) { xcol = xmapped[ci[ j ][ i ] ]; if ( ximage->byte_order == MSBFirst ) { *tmp3++ = ( xcol >> 16 ) & 0xff; *tmp3++ = ( xcol >> 8 ) & 0xff; *tmp3++ = ( xcol ) & 0xff; } else { *tmp3++ = ( xcol ) & 0xff; *tmp3++ = ( xcol >> 8 ) & 0xff; *tmp3++ = ( xcol >> 16 ) & 0xff; } } } else { im->error_message( im, "fl_display_ci: unhandled non-byte-aligned " "pixel" ); return -1; } } else if ( im->vclass == GrayScale || im->vclass == StaticGray ) { int gray; npixels = 0; #if IMAGEDEBUG M_err( "fl_display_ci", "Grayscale: maplen=%d", im->map_len ); #endif for ( i = 0; i < im->map_len; i++ ) { xc[ i ].flags = DoRed | DoGreen | DoBlue; gray = FL_RGB2GRAY( im->red_lut[ i ], im->green_lut[ i ], im->blue_lut[ i ]); xc[ i ].red = xc[ i ].green = xc[ i ].blue = ( gray << 8 ) | 0xff; } get_all_colors( im, newpixels, &npixels, xc ); im->colors = npixels; #if TRACE M_err( "fl_display_ci", "Done colormap" ); #endif if ( ximage->bits_per_pixel == 1 ) { int bit, k; for ( i = 0; i < im->h; i++ ) { xpixtmp = xpixels + ( i * ximage->bytes_per_line ); for ( k = bit = j = 0; j < im->w; j++ ) { k = ( k << 1 ) | xc[ ci[ i ][ j ] ].pixel; if ( ++bit == 8 ) { *xpixtmp++ = k; k = bit = 0; } } if ( bit ) { k <<= ( 8 - bit ); *xpixtmp++ = k; } } } else if ( ximage->bits_per_pixel == 8 ) { #if TRACE M_err( "fl_display_ci", "Converting %d pixels", im->w * im->h ); #endif for ( i = 0, total = im->w * im->h; i < total; i++ ) xpixels[ i ] = ( unsigned char ) xc[ ipixels[ i ] ].pixel; } else M_err( "fl_display_ci", "unhandled bits_per_pixel=%d depth=%d", ximage->bits_per_pixel, im->depth ); } else if ( im->vclass == StaticColor || im->vclass == PseudoColor ) { /* Get all needed colors, use substituion if necessary */ get_all_colors( im, newpixels, &npixels, xc ); im->colors = npixels; if ( ximage->bits_per_pixel == 8 ) for ( i = 0; i < total; i++ ) xpixels[ i ] = ( unsigned char ) xc[ ipixels[ i ] ].pixel; else M_err( "fl_display_ci", "unhandled bits_per_pixel=%d depth=%d", ximage->bits_per_pixel, im->depth ); } else M_err( "fl_display_ci", "unhandled visual class" ); #if TRACE M_err( "fl_display_ci", "about to XPutImage" ); #endif if ( ximage && ximage->data ) im->ximage = ximage; else fprintf( stderr, "no image\n" ); if ( npixels ) XFreeColors( im->xdisplay, xcolormap, newpixels, npixels, 0 ); if ( xmapped ) fl_free( xmapped ); #if TRACE M_err( "fl_display_ci", "Leaving" ); #endif return 0; } /*************************************** * do window levelling ***************************************/ static void window_levelling( FL_IMAGE * im ) { int upper, lower, tmp, i; int npix = im->w * im->h; unsigned short *pix = im->pixels[ 0 ]; /* display image */ unsigned short *ci = im->gray[ 0 ]; /* original image */ unsigned short *wlut = im->wlut; float fact; lower = im->level - im->wwidth / 2; upper = im->level + im->wwidth / 2; if ( im->wwidth <= 0 ) { lower = 0; upper = im->gray_maxval; } if ( lower < 0 ) lower = 0; fact = ( im->map_len - 0.999f ) / ( upper - lower ); for ( i = 0; i <= im->gray_maxval; i++ ) { tmp = i < lower ? lower : ( i > upper ? upper : i ); wlut[ i ] = ( unsigned short ) ( ( tmp - lower ) * fact ); } for ( i = 0; i < npix; i++ ) pix[ i ] = wlut[ ci[ i ] ]; } /*************************************** ***************************************/ static int fl_display_gray( FL_IMAGE * im, Window win ) { int i, npix = im->w * im->h; float fact, scale; float graymax; /* what the display can display */ unsigned short *pix; unsigned short *ci = im->gray[ 0 ]; #if TRACE M_err( "DisplayGray", "Entering" ); #endif /* To avoid scaling of the original data, we create display type */ if ( ! ( im->pixels = fl_get_matrix( im->h, im->w, sizeof **im->pixels ) ) ) { M_err( "DisplayGray", "can't get memory" ); return -1; } pix = im->pixels[ 0 ]; im->display_type = FL_IMAGE_CI; /* graymax takes care of 12bit gray displays */ if ( im->vclass == DirectColor || im->vclass == TrueColor ) { if ( im->rgb2p.bbits > FL_PCBITS ) im->map_len = 1 << im->rgb2p.bbits; else im->map_len = 1 << FL_PCBITS; } else { im->map_len = 1 << im->depth; if ( im->map_len > 250 ) im->map_len -= 20; else if ( im->map_len == 0 ) im->map_len = FLIMAGE_MAXLUT; } flimage_getcolormap( im ); if ( im->rgb2p.bbits > FL_PCBITS ) graymax = ( float )( ( 1 << im->rgb2p.bbits ) - 1 ); else graymax = 255.0; /* (1 << FL_PCBITS) - 1; */ fact = ( graymax + 0.001 ) / ( im->map_len - 1 ); scale = ( im->map_len - 1 ) / ( graymax - 0.001 ); for ( i = 0; i < im->map_len; i++ ) im->red_lut[ i ] = im->green_lut[ i ] = im->blue_lut[ i ] = ( int )( i * fact ); if ( im->type == FL_IMAGE_GRAY16 ) window_levelling( im ); else { /* 8bit grayscale */ if ( im->map_len != 256 ) { unsigned short *wlut = im->wlut; for ( i = 0; i < 256; i++ ) wlut[ i ] = ( unsigned short ) ( i * scale ); for ( i = 0; i < npix; i++ ) pix[i] = wlut[ ci[ i ] ]; } else memcpy( pix, ci, npix * sizeof *ci ); } fl_display_ci( im, win ); #if TRACE M_err( "DisplayGray", "Leaving" ); #endif return 0; } #define RGBTOPIXEL( type ) \ do { \ type *ltmp = ( type * ) xpixels; \ if ( im->rgb2p.rbits > 8 ) \ for ( i = 0; i < total; ltmp++, i++ ) \ { \ RGB2PIXEL_8_OR_MORE( im, red[ i ],green[ i ],blue[ i ], \ &im->rgb2p, *ltmp ); \ if ( im->depth == 24 && im->sdepth == 32 \ && i == im->tran_index ) \ *ltmp &= ~ 0xff000000; \ } \ else \ for ( i = 0; i < total; ltmp++, i++ ) \ { \ RGB2PIXEL_8_OR_LESS( im, red[ i ],green[ i ],blue[ i ], \ &im->rgb2p, *ltmp ); \ if ( im->depth == 24 && im->sdepth == 32 \ && i == im->tran_index ) \ *ltmp &= ~ 0xff000000; \ } \ } while ( 0 ) /*************************************** ***************************************/ static int fl_display_rgb( FL_IMAGE * im, Window win FL_UNUSED_ARG ) { unsigned char *xpixels; int total = im->w * im->h; XImage *ximage = 0; unsigned char *red = im->red[ 0 ], *green = im->green[ 0 ], *blue = im->blue[ 0 ]; int w = im->w, h = im->h; if ( im->vclass == DirectColor || im->vclass == TrueColor ) { int i; /* Use minimum possible padding */ int pad = im->depth <= 8 ? 8 : ( im->depth <= 16 ? 16 : 32 ); ximage = XCreateImage( im->xdisplay, im->visual, im->sdepth, ZPixmap, 0, 0, w, h, pad, 0 ); if ( ximage->bits_per_pixel % 8 ) { im->error_message( im, "can't handle non-byte aligned pixel" ); return -1; } #if IMAGEDEBUG fprintf( stderr, "XBytesPerLine: %d BitsPerPixel=%d\n", ximage->bytes_per_line, ximage->bits_per_pixel ); #endif xpixels = fl_malloc( h * ximage->bytes_per_line * sizeof *xpixels ); if ( ! xpixels ) { flimage_error( im, "malloc() failed" ); return -1; } ximage->data = ( char * ) xpixels; if ( ximage->bits_per_pixel == 32 ) { RGBTOPIXEL( unsigned int ); if ( machine_endian( ) != ximage->byte_order ) { unsigned char *rgba = ( unsigned char * ) ximage->data; for ( i = 0; i < total; i++, rgba += 4 ) { SWAP_CHAR(rgba[ 0 ], rgba[ 3 ]); SWAP_CHAR(rgba[ 1 ], rgba[ 2 ]); } } } else if ( ximage->bits_per_pixel == 16 ) { RGBTOPIXEL( unsigned short ); if ( machine_endian( ) != ximage->byte_order ) { unsigned char *rgba = ( unsigned char * ) ximage->data; int i; for ( i = 0; i < total; i++, rgba += 2 ) SWAP_CHAR( rgba[ 0 ], rgba[ 1 ] ); } } else if ( ximage->bits_per_pixel == 8 ) { RGBTOPIXEL( unsigned char ); } else if ( ximage->bits_per_pixel == 24 ) { unsigned char *tt = ( unsigned char * ) xpixels, *tmp3; unsigned int xcol; int j; for ( j = 0; j < im->h; j++, tt += ximage->bytes_per_line ) { int i; if ( ximage->byte_order == MSBFirst ) for ( i = 0, tmp3 = tt; i < im->w; i++ ) { xcol = rgb2pixel( im, red[ i ], green[ i ], blue[ i ], &im->rgb2p ); *tmp3++ = ( xcol >> 16 ) & 0xff; *tmp3++ = ( xcol >> 8 ) & 0xff; *tmp3++ = ( xcol ) & 0xff; } else for ( i = 0, tmp3 = tt; i < im->w; i++ ) { xcol = rgb2pixel( im, red[ i ], green[ i ], blue[ i ], &im->rgb2p ); *tmp3++ = ( xcol ) & 0xff; *tmp3++ = ( xcol >> 8 ) & 0xff; *tmp3++ = ( xcol >> 16 ) & 0xff; } } } im->ximage = ximage; } else if ( im->vclass == GrayScale || im->vclass == StaticGray ) { M_err( "fl_display_rgb", "RGB with grayscale display" ); return -1; } else if ( im->vclass == PseudoColor || im->vclass == StaticColor ) { M_err( "fl_display_rgb", "Internal error" ); return -1; } else { fprintf( stderr, "ImageDisp: internal color\n" ); return -1; } return 0; } /*************************************** ***************************************/ static int fl_display_packed( FL_IMAGE * im, Window win ) { flimage_convert( im, FL_IMAGE_RGB, 0 ); return fl_display_rgb( im, win ); } /*************************************** * Here we already got the proper XImage. Actually it would be * much faster if we create a Pixmap from the XImage. TODO ***************************************/ static void displayXImage( FL_IMAGE * im ) { XImage *ximage = im->ximage; Colormap xcolormap = im->xcolormap; unsigned long newpixels[ FLIMAGE_MAXLUT ]; XColor xc[ FLIMAGE_MAXLUT ]; int npix = 0; if ( im->vclass != TrueColor && im->vclass != DirectColor ) get_all_colors( im, newpixels, &npix, xc ); XPutImage( im->xdisplay, im->win, im->gc, ximage, im->sxd, im->syd, im->wxd, im->wyd, im->swd, im->shd ); if ( npix ) XFreeColors( im->xdisplay, xcolormap, newpixels, npix, 0 ); } /*************************************** * Convert an RGB triple to a pixel ***************************************/ unsigned long flimage_color_to_pixel( FL_IMAGE * im, int r, int g, int b, int * newpix ) { XColor xc; static Colormap lastcolormap; static XColor *xcolor; unsigned long pixel = 0; *newpix = 0; if ( im->vclass == TrueColor || im->vclass == DirectColor ) return rgb2pixel( im, r, g, b, &im->rgb2p ); else { int max_col; xc.flags = DoRed | DoGreen | DoBlue; xc.red = ( r << 8 ) | 0xff; xc.green = ( g << 8 ) | 0xff; xc.blue = ( b << 8 ) | 0xff; if ( ( *newpix = XAllocColor( im->xdisplay, im->xcolormap, &xc ) ) ) return xc.pixel; /* Search for a closest match */ max_col = FL_min( 256, 1 << im->depth ); if ( ! xcolor ) xcolor = fl_malloc( 256 * sizeof *xcolor ); /* Not theoretically correct as colormap may have changed * since the last time we asked for colors. Take a chance for * performace. */ if ( lastcolormap != im->xcolormap ) { int i; for ( i = 0; i < max_col; i++ ) xcolor[ i ].pixel = i; XQueryColors( im->xdisplay, im->xcolormap, xcolor, max_col ); lastcolormap = im->xcolormap; } fli_find_closest_color( r, g, b, xcolor, max_col, &pixel ); } return pixel; } /*************************************** ***************************************/ int flimage_swapbuffer( FL_IMAGE * im ) { int sw = im->sw ? im->sw : im->w, sh = im->sh ? im->sh : im->h; XCopyArea(im->xdisplay, im->pixmap, im->win, im->gc, im->sx, im->sy, sw, sh, im->wx, im->wy); return 0; } /*************************************** ***************************************/ static void create_backbuffer( FL_IMAGE * im, FL_WINDOW win, int depth ) { if ( depth != im->pixmap_depth || im->w > im->pixmap_w || im->pixmap_w > 1200 || im->h > im->pixmap_h || im->pixmap_h > 1200 ) { if ( im->pixmap ) XFreePixmap( im->xdisplay, im->pixmap ); im->pixmap = XCreatePixmap( im->xdisplay, win, im->w, im->h, depth ); im->pixmap_w = im->w; im->pixmap_h = im->h; im->pixmap_depth = depth; im->modified = 1; } } /*************************************** * This function handles display caused by Expose event. If we * somehow can get hold of the Expose event, we may only need * to re-display part of the image ***************************************/ static void handle_redraw( FL_IMAGE * im, FL_WINDOW win ) { if ( im->double_buffer && im->pixmap ) { im->win = im->pixmap; im->display_markers( im ); im->display_text( im ); im->win = win; flimage_swapbuffer( im ); } else { im->win = win; displayXImage( im ); im->display_markers( im ); im->display_text( im ); } } /*************************************** ***************************************/ static void adapt_image_to_window( FL_IMAGE * im, XWindowAttributes * xwa ) { FL_RGB2PIXEL *rgb2p = &im->rgb2p; rgb2p->bits_per_rgb = xwa->visual->bits_per_rgb; rgb2p->colormap_size = xwa->visual->map_entries; #if IMAGEDEBUG fprintf( stderr, "bits_per_rgb=%d mapsize=%d\n", im->rgb2p.bits_per_rgb, im->rgb2p.colormap_size ); #endif rgb2p->rmask = xwa->visual->red_mask; rgb2p->gmask = xwa->visual->green_mask; rgb2p->bmask = xwa->visual->blue_mask; im->depth = im->sdepth = xwa->depth; im->vclass = xwa->visual->class; im->visual = xwa->visual; im->xcolormap = xwa->colormap; fli_rgbmask_to_shifts( rgb2p->rmask, &rgb2p->rshift, &rgb2p->rbits ); fli_rgbmask_to_shifts( rgb2p->gmask, &rgb2p->gshift, &rgb2p->gbits ); fli_rgbmask_to_shifts( rgb2p->bmask, &rgb2p->bshift, &rgb2p->bbits ); } #define Compatible( x, im ) \ ( ( x ).depth == im->depth \ && ( x ).visual->class == im->vclass \ && ( x ).visual->red_mask == im->rgb2p.rmask \ && ( x ).visual->green_mask == im->rgb2p.gmask ) /*************************************** * Convert an FL_IMAGE into an XImage. The converted ximage is * im->ximage if successful ***************************************/ int flimage_to_ximage( FL_IMAGE * im, FL_WINDOW win, XWindowAttributes * xwa ) { unsigned long bk = 0; int type, ret = 0; if ( im->display_type != FL_IMAGE_NONE && im->modified ) { if ( im->pixels ) { fl_free_matrix( im->pixels ); im->pixels = 0; } im->display_type = FL_IMAGE_NONE; } if ( ! xwa ) { static XWindowAttributes tmpxwa; XGetWindowAttributes( im->xdisplay, win, &tmpxwa ); xwa = &tmpxwa; } /* Handle transparency */ if ( im->tran_rgb >= 0 && im->app_background >= 0 ) { if ( im->app_background >= 0 ) bk = im->app_background; if ( FL_IsCI( im->type ) && im->tran_index >= 0 && im->tran_index < im->map_len ) { int ar, ag, ab, tc = im->tran_index; FL_UNPACK3( bk, ar, ag, ab ); im->red_lut[ tc ] = ar; im->green_lut[ tc ] = ag; im->blue_lut[ tc ] = ab; } else flimage_replace_pixel( im, im->tran_rgb, bk ); } if ( ! ( im->win == win || Compatible( * xwa, im ) ) ) { adapt_image_to_window( im, xwa ); if ( im->rgb2p.rbits > 8 || im->rgb2p.gbits > 8 ) rgb2pixel = rgb2pixel_more_than_8bits; else rgb2pixel = rgb2pixel_8bits_or_less; } im->win = win; if ( im->depth == 32 && im->rgb2p.rbits + im->rgb2p.gbits + im->rgb2p.bbits < 32 ) im->depth = im->rgb2p.rbits + im->rgb2p.gbits + im->rgb2p.bbits; /* Prepare the display image */ if ( im->depth == 1 && im->type != FL_IMAGE_MONO ) { unsigned short **ci; int otype = im->type; if ( im->type != FL_IMAGE_CI ) { flimage_convert( im, FL_IMAGE_MONO, 2 ); im->pixels = im->ci; im->ci = 0; } else { im->pixels = fl_get_matrix( im->h, im->w, sizeof **im->pixels ); memcpy( im->pixels[ 0 ], im->ci[ 0 ], sizeof **im->ci * im->w * im->h ); flimage_convert( im, FL_IMAGE_MONO, 2 ); ci = im->pixels; im->pixels = im->ci; im->ci = ci; } im->available_type &= ~ FL_IMAGE_MONO; im->type = otype; im->display_type = FL_IMAGE_MONO; im->available_type |= otype; } else if ( ( im->vclass == StaticGray || im->vclass == GrayScale ) && im->depth != 1 && ! FL_IsGray( im->type ) ) { int otype = im->type; flimage_convert( im, FL_IMAGE_GRAY, 2 ); im->type = otype; /* this gets reset by fl_display_gray */ im->display_type = FL_IMAGE_GRAY; } else if ( ( im->vclass == PseudoColor || im->vclass == StaticColor ) && im->type == FL_IMAGE_RGB ) { int max_colors = 1 << im->depth; unsigned short **ci = fl_get_matrix( im->h, im->w, sizeof **ci ); if ( max_colors > 250 ) max_colors -= 20; im->map_len = max_colors; flimage_getcolormap( im ); do_quantization( im, im->xcolormap, im->map_len, ci ); im->pixels = ci; im->display_type = FL_IMAGE_CI; } if ( ( type = im->display_type ) == FL_IMAGE_NONE ) type = im->type; switch ( type ) { case FL_IMAGE_GRAY: case FL_IMAGE_GRAY16: ret = fl_display_gray( im, win ); break; case FL_IMAGE_CI: case FL_IMAGE_MONO: ret = fl_display_ci( im, win ); break; case FL_IMAGE_RGB: ret = fl_display_rgb( im, win ); break; case FL_IMAGE_PACKED: ret = fl_display_packed( im, win ); break; default: ret = -1; } return ret; } /*************************************** * We always keep hi-res image whenever possible. For this reason, * the displayed image and the image in memory are not necessarily the * same type. When we quantize for display, we do not overwrite the * the image, rather we create a displayable image ***************************************/ int flimage_sdisplay( FL_IMAGE * im, Window win ) { XWindowAttributes xwa; int ret = 0; if ( win <= 0 || !im || im->w <= 0 || im->type == FL_IMAGE_NONE ) return -1; if ( sizeof( int ) != 4 ) { fprintf( stderr, "FatalError: Assumed sizeof(int)==4\n" ); exit( 1 ); } /* Check for consistent subimage */ im->sx = FL_clamp( im->sx, 0, im->w ); im->sy = FL_clamp( im->sy, 0, im->h ); im->sw = FL_clamp( im->sw, 0, im->w ); im->sh = FL_clamp( im->sh, 0, im->h ); if ( im->sx + im->sw > im->w ) im->sx = im->sw = 0; if ( im->sy + im->sh > im->h ) im->sy = im->sh = 0; if ( im->double_buffer ) { im->sxd = im->syd = 0; im->swd = im->w; im->shd = im->h; im->wxd = im->wyd = 0; } else { im->sxd = im->sx; im->syd = im->sy; im->wxd = im->wx; im->wyd = im->wy; im->swd = im->sw ? im->sw : im->w; im->shd = im->sh ? im->sh : im->h; } XGetWindowAttributes( im->xdisplay, win, &xwa ); if ( ! im->setup->do_not_clear ) { /* Only clear the minimum region we have to */ int sw = im->sw ? im->sw : im->w; int sh = im->sh ? im->sh : im->h; if ( im->wx > 0 ) XClearArea( im->xdisplay, win, 0, 0, im->wx, 0, 0 ); if ( im->wy > 0 ) XClearArea( im->xdisplay, win, 0, 0, 0, im->wy, 0 ); XClearArea( im->xdisplay, win, im->wx + sw, 0, 0, 0, 0 ); XClearArea( im->xdisplay, win, 0, im->wy + sh, 0, 0, 0 ); } if ( im->double_buffer ) create_backbuffer( im, win, xwa.depth ); /* Check if redraw. Possible optimization: obtain the dirty region and do subimage stuff */ if ( im->ximage && !im->modified && ( im->win == win || Compatible( xwa, im ) ) ) { handle_redraw( im, win ); return 0; } /* If we got here, we need to re-generate ximage */ if ( im->ximage ) { XDestroyImage( ( XImage * ) im->ximage ); im->ximage = None; } if ( ! Compatible( xwa, im ) ) { if ( im->gc ) XFreeGC( im->xdisplay, im->gc ); if ( im->textgc ) XFreeGC( im->xdisplay, im->textgc ); im->gc = im->textgc = None; } if ( ! im->gc ) im->gc = XCreateGC( im->xdisplay, win, 0, 0 ); ret = flimage_to_ximage( im, win, &xwa ); if ( ret >= 0 ) { im->win = im->double_buffer ? im->pixmap : win; XPutImage( im->xdisplay, im->win, im->gc, im->ximage, im->sxd, im->syd, im->wxd, im->wyd, im->swd, im->shd ); im->display_markers( im ); im->display_text( im ); im->win = win; if ( im->double_buffer ) flimage_swapbuffer( im ); im->modified = 0; } return ret; } /*************************************** * quantize a full color image ***************************************/ static int do_quantization( FL_IMAGE * im, Colormap colormap, int maxcol, unsigned short ** ci ) { int empty_slots, done, repeats; unsigned long *newpixels; int request = FL_max( maxcol - 4, 1 ); do { if ( im->type == FL_IMAGE_RGB ) flimage_quantize_rgb( im->red, im->green, im->blue, im->w, im->h, request, ci, &im->map_len, im->red_lut, im->green_lut, im->blue_lut, im ); else flimage_quantize_packed( im->packed, im->w, im->h, request, ci, &im->map_len, im->red_lut, im->green_lut, im->blue_lut, im); newpixels = get_colors( colormap, im->red_lut, im->green_lut, im->blue_lut, im->map_len, &empty_slots ); /* It's better to take a chance of finding similar colors in the colormap than reducing the number of colors too much */ done = empty_slots == im->map_len || empty_slots < 12 || empty_slots < maxcol / 4; if ( ! done ) { repeats = count_repeats_and_shared( newpixels, empty_slots ); XFreeColors( im->xdisplay, colormap, newpixels, empty_slots, 0 ); fl_free( newpixels ); im->map_len = 1; request = empty_slots - repeats; } } while ( ! done ); if ( empty_slots ) XFreeColors( im->xdisplay, colormap, newpixels, empty_slots, 0 ); fl_free( newpixels ); return newpixels ? 0 : -1; } /***************************************************************** * local functions ***************************************************************/ #define SSS 8 /*************************************** ***************************************/ static int count_repeats_and_shared( unsigned long * array, int len ) { int i, j, n; if ( len < 10 ) return 0; /* This does not really count the shared colors, but < 5 is a good guess */ for ( i = n = 0; i < len - 1; i++ ) for ( j = i + 1; j < len; j++ ) if ( array[ i ] == array[ j ] || array[ i ] < SSS ) n++; n += array[ len - 1 ] < SSS; return n > 4 ? 4 : n; } /*************************************** ***************************************/ int flimage_display( FL_IMAGE * in_image, Window win ) { int err = 0; FL_IMAGE *im = in_image; if ( ! im || im->w <= 0 || win == 0 ) return -1; for ( err = 0; err >= 0 && im; im = im->next ) { im->app_background = in_image->app_background; err = flimage_sdisplay( im, win ); XSync( in_image->xdisplay, 0 ); if ( in_image->setup->delay ) fl_msleep( in_image->setup->delay ); } return err; } /*************************************** * convert an XImage into flimage ***************************************/ static int convert_ximage( FL_IMAGE * im, XImage * ximage ) { unsigned int rshift, gshift, bshift, delta; unsigned int rbits, gbits, bbits; unsigned int *ui; unsigned short *us; unsigned char *uc; unsigned int rnorm, gnorm, bnorm, r, g, b; int x, y; #if 0 /* For some reason, red_mask is not always set on some systems. This problem makes this conversion unsafe as we're blindingly using the red_mask of some arbirary window! */ fli_rgbmask_to_shifts( ximage->red_mask, &rshift, &rbits ); fli_rgbmask_to_shifts( ximage->green_mask, &gshift, &gbits ); fli_rgbmask_to_shifts( ximage->blue_mask, &bshift, &bbits ); #else ximage->red_mask = im->rgb2p.rmask; ximage->green_mask = im->rgb2p.gmask; ximage->blue_mask = im->rgb2p.bmask; rshift = im->rgb2p.rshift; gshift = im->rgb2p.gshift; bshift = im->rgb2p.bshift; rbits = im->rgb2p.rbits; gbits = im->rgb2p.gbits; bbits = im->rgb2p.bbits; #endif rnorm = FL_PCBITS - rbits; gnorm = FL_PCBITS - gbits; bnorm = FL_PCBITS - bbits; if ( im->rgb2p.gbits > FL_PCBITS ) { rshift += rbits - FL_PCBITS; gshift += gbits - FL_PCBITS; bshift += gbits - FL_PCBITS; rnorm = gnorm = bnorm = 0; } if ( ximage->bits_per_pixel != 1 && ximage->bits_per_pixel % 8 ) { M_err( "ConvertImage", "unsupported bpp=%d", ximage->bits_per_pixel ); return -1; } if ( im->vclass == TrueColor || im->vclass == DirectColor ) im->type = FL_IMAGE_RGB; else { im->type = im->depth == 1 ? FL_IMAGE_MONO : FL_IMAGE_CI; im->map_len = 1 << im->depth; } im->w = ximage->width; im->h = ximage->height; flimage_invalidate_pixels( im ); if ( flimage_getmem( im ) < 0 ) { flimage_error( im, "ConvertXImage(%dX%d): out of memory", im->w, im->h ); return -1; } im->modified = 1; switch ( ximage->bits_per_pixel ) { case 32: ui = ( unsigned int * ) ximage->data; delta = ximage->bytes_per_line / 4; for ( y = 0; y < im->h; y++ ) { for ( x = 0; x < im->w; x++ ) { im->red[ y][ x ] = ( ui[ x ] & ximage->red_mask ) >> rshift; im->green[ y][ x ] = ( ui[ x ] & ximage->green_mask ) >> gshift; im->blue[ y][ x ] = ( ui[ x ] & ximage->blue_mask ) >> bshift; } ui += delta; } im->modified = 1; break; case 16: if ( im->vclass == GrayScale || im->vclass == StaticGray ) { /* Probably very rare */ M_err( "ConvertXImage", "16bpp grayscale not handled" ); return -1; } us = ( unsigned short * ) ximage->data; delta = ximage->bytes_per_line / 2; for ( y = 0; y < im->h; y++ ) { for ( x = 0; x < im->w; x++ ) { r = ( us[ x ] & ximage->red_mask ) >> rshift; g = ( us[ x ] & ximage->green_mask ) >> gshift; b = ( us[ x ] & ximage->blue_mask ) >> bshift; /* Normalize */ im->red[ y ][ x ] = ( ( r + 1 ) << rnorm ) - 1; im->green[ y ][ x ] = ( ( g + 1 ) << gnorm ) - 1; im->blue[ y ][ x ] = ( ( b + 1 ) << bnorm ) - 1; } us += delta; } im->modified = 1; break; case 8: uc = ( unsigned char * ) ximage->data; if ( im->type == FL_IMAGE_RGB ) { for ( y = 0; y < im->h; y++ ) { for ( x = 0; x < im->w; x++ ) { r = ( uc[ x ] & ximage->red_mask ) >> rshift; g = ( uc[ x ] & ximage->green_mask ) >> gshift; b = ( uc[ x ] & ximage->blue_mask ) >> bshift; /* normalize */ im->red[ y ][ x ] = ( ( r + 1 ) << rnorm ) - 1; im->green[ y ][ x ] = ( ( g + 1 ) << gnorm ) - 1; im->blue[ y ][ x ] = ( ( b + 1 ) << bnorm ) - 1; } uc += ximage->bytes_per_line; } } else { XColor xcolor[ 256 ], *xc, *xce; int max_colors = 1 << im->depth, pixel; for ( x = 0; x < max_colors; x++ ) xcolor[ x ].pixel = x; XQueryColors( im->xdisplay, im->xcolormap, xcolor, max_colors ); for ( xc = xcolor, xce = xc + max_colors; xc < xce; xc++ ) { pixel = xc->pixel; im->red_lut[ pixel ] = xc->red >> 8; im->green_lut[ pixel ] = xc->green >> 8; im->blue_lut[ pixel ] = xc->blue >> 8; } for ( y = 0; y < im->h; y++ ) { for ( x = 0; x < im->w; x++ ) im->ci[ y ][ x ] = uc[ x ]; uc += ximage->bytes_per_line; } } break; case 1: uc = ( unsigned char * ) ximage->data; for ( y = 0; y < im->h; y++ ) { unpack_bits( im->ci[ y ], uc, ximage->bytes_per_line ); uc += ximage->bytes_per_line; } break; default: M_err( "XImageConvert", "unsupported bpp %d", ximage->depth ); im->modified = 0; return -1; } return 0; } /*************************************** * Setup the pixel conversion using the window attributes ***************************************/ static int flimage_from_pixmap_( FL_IMAGE * im, Pixmap pixmap, int w, int h ) { XImage *ximage; int status; if ( w == 0 || h == 0 ) { unsigned int ww, hh, bjunk, djunk; int xx, yy; Window root; XGetGeometry( im->xdisplay, pixmap, &root, &xx, &yy, &ww, &hh, &bjunk, &djunk ); w = ww; h = hh; } /* Turn pixmap into an X image */ ximage = XGetImage( im->xdisplay, pixmap, 0, 0, w, h, AllPlanes, ZPixmap ); if ( ! ximage ) { flimage_error( im, "XGetImage() failed" ); return -1; } /* It's possible that im may contain nothing if w == h == 0 on input */ if ( im->rgb2p.rbits == 0 ) { XWindowAttributes xwa; XGetWindowAttributes( im->xdisplay, fl_root, &xwa ); adapt_image_to_window( im, &xwa ); } status = convert_ximage( im, ximage ); /* The old Ximage is now out of date */ if ( im->ximage ) XDestroyImage((XImage *) im->ximage); im->ximage = ximage; return status; } /*************************************** ***************************************/ int flimage_from_pixmap( FL_IMAGE * im, Pixmap pixmap ) { if ( ! im || !pixmap ) return -1; return flimage_from_pixmap_( im, pixmap, 0, 0 ); } /*************************************** ***************************************/ Pixmap flimage_to_pixmap( FL_IMAGE * im, FL_WINDOW win ) { Pixmap pixmap; XWindowAttributes xwa; if ( ! im || im->type == FLIMAGE_NONE || win == 0 ) return 0; XGetWindowAttributes( im->xdisplay, win, &xwa ); if ( ! im->gc ) im->gc = XCreateGC( im->xdisplay, win, 0, 0 ); pixmap = XCreatePixmap( im->xdisplay, win, im->w, im->h, xwa.depth ); if ( flimage_to_ximage( im, win, &xwa ) >= 0 ) XPutImage( im->xdisplay, pixmap, im->gc, im->ximage, 0, 0, 0, 0, im->w, im->h ); return pixmap; } /*************************************** * Render possible annotations into the the image ***************************************/ int flimage_render_annotation( FL_IMAGE * im, FL_WINDOW win ) { int status; XWindowAttributes xwa; if ( ! im || ! win ) return -1; if ( ! im->ntext && ! im->nmarkers ) return 0; XGetWindowAttributes( im->xdisplay, win, &xwa ); /* Create an offscreen pixmap to hold the image */ create_backbuffer(im, win, xwa.depth); if ( flimage_to_ximage( im, win, &xwa ) < 0 ) return -1; XPutImage( im->xdisplay, im->pixmap, im->gc, im->ximage, 0, 0, 0, 0, im->w, im->h ); im->win = im->pixmap; im->display_markers( im ); im->display_text( im ); im->win = win; status = flimage_from_pixmap_( im, im->pixmap, im->w, im->h ); im->free_text( im ); im->free_markers( im ); return status; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/image/Makefile.am0000664000175000017500000000157512353623325013111 00000000000000include $(top_srcdir)/config/common.am INCLUDES = -DMAKING_FORMS $(X_CFLAGS) include_HEADERS = flimage.h lib_LTLIBRARIES = libflimage.la libflimage_la_LDFLAGS = -no-undefined -version-info @SO_VERSION@ libflimage_la_LIBADD = ../lib/libforms.la $(JPEG_LIB) $(X_LIBS) -lX11 libflimage_la_SOURCES = \ flimage.h \ flimage_int.h \ image.c \ image_bmp.c \ image_combine.c \ image_convolve.c \ image_crop.c \ image_disp.c \ image_fits.c \ image_genesis.c \ image_gif.c \ image_gzip.c \ image_io_filter.c \ image_jpeg.c \ image_jquant.c \ image_marker.c \ image_png.c \ image_pnm.c \ image_postscript.c \ image_proc.c \ image_replace.c \ image_rotate.c \ image_scale.c \ image_sgi.c \ image_text.c \ image_tiff.c \ image_type.c \ image_warp.c \ image_xbm.c \ image_xpm.c \ image_xwd.c \ postscript.c \ ps_core.c \ ps_draw.c \ ps_text.c \ rgb_db.c \ matrix.c xforms-1.2.4/image/image_xwd.c0000644000175000017500000004704712251675216013172 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * This file is part of the XForms library package. * Copyright (c) 1993, 1998-2002 By T.C. Zhao * All rights reserved. * * XWD format support. Probably buggy as hell */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "ulib.h" #include "flimage.h" #include "flimage_int.h" #include #include typedef struct { XWDFileHeader header; char name[256]; int swap; unsigned int rbits, rshifts; unsigned int gbits, gshifts; unsigned int bbits, bshifts; } SPEC; #define XWDDEBUG 0 static unsigned int value_to_bits( unsigned int val ); /*************************************** ***************************************/ #if XWDDEBUG==1 static void dumpheader( const char * where, XWDFileHeader * h ) { fprintf( stderr, "%s\n", where ); fprintf( stderr, "file_version = %ld\n", ( long ) h->file_version ); fprintf( stderr, "header_size = %ld\n", ( long ) h->header_size ); fprintf( stderr, "visual_class = %ld\n", ( long ) h->visual_class ); fprintf( stderr, "pixmap_depth = %ld\n", ( long ) h->pixmap_depth ); fprintf( stderr, "bits_per_pixel = %ld\n", ( long ) h->bits_per_pixel ); fprintf( stderr, "pixmap_width = %ld\n", ( long ) h->pixmap_width ); fprintf( stderr, "pixmap_height = %ld\n", ( long ) h->pixmap_height ); fprintf( stderr, "ncolors = %ld\n", ( long ) h->ncolors ); fprintf( stderr, "red_mask = 0x%lx\n", ( long ) h->red_mask ); fprintf( stderr, "green_mask = 0x%lx\n", ( long ) h->green_mask ); fprintf( stderr, "blue_mask = 0x%lx\n", ( long ) h->blue_mask ); } #endif typedef union { CARD32 l; CARD16 s; CARD8 c[ sizeof( CARD32 ) ]; } tLong; /*************************************** ***************************************/ static CARD32 swap32( CARD32 in ) { tLong t; CARD8 c; t.l = in; c = t.c[ 0 ]; t.c[ 0 ] = t.c[ 3 ]; t.c[ 3 ] = c; c = t.c[ 1 ]; t.c[ 1 ] = t.c[ 2 ]; t.c[ 2 ] = c; return t.l; } #define swap16( a ) ( ( ( ( a ) &0xff ) <<8 ) | ( ( ( a ) >> 8 ) & 0xff ) ) /*************************************** ***************************************/ static void swap_header( XWDFileHeader * h ) { h->file_version = swap32( h->file_version ); h->header_size = swap32( h->header_size ); h->visual_class = swap32( h->visual_class ); h->pixmap_depth = swap32( h->pixmap_depth ); h->pixmap_format = swap32( h->pixmap_format ); h->bits_per_pixel = swap32( h->bits_per_pixel ); h->pixmap_width = swap32( h->pixmap_width ); h->pixmap_height = swap32( h->pixmap_height ); h->bytes_per_line = swap32( h->bytes_per_line ); h->byte_order = swap32( h->byte_order ); h->ncolors = swap32( h->ncolors ); h->red_mask = swap32( h->red_mask ); h->green_mask = swap32( h->green_mask ); h->blue_mask = swap32( h->blue_mask ); h->bitmap_unit = swap32( h->bitmap_unit ); h->bitmap_pad = swap32( h->bitmap_pad ); } static int need_swap; /*************************************** * XWD does not have a signature, we'll have to guess ***************************************/ static int XWD_identify( FILE * fp ) { XWDFileHeader h; if ( fread( &h, 1, sizeof h, fp ) != sizeof h ) return 0; rewind( fp ); need_swap = ( h.file_version != XWD_FILE_VERSION ); if ( need_swap ) swap_header( &h ); if ( h.file_version != XWD_FILE_VERSION ) return -1; #if XWDDEBUG==1 dumpheader( "Identify", &h ); #endif return h.file_version == XWD_FILE_VERSION && h.visual_class <= 5 && h.pixmap_depth > 0 && h.pixmap_depth <= 32 && h.pixmap_format <= ZPixmap; } /*************************************** ***************************************/ static void generate_header_info( FL_IMAGE * im, XWDFileHeader * h ) { char buf[ 128 ]; if ( ! ( im->info = fl_malloc( 1024 ) ) ) return; sprintf( im->info, "file_version=%ld\nheader_size=%ld\n", ( long ) h->file_version, ( long ) h->header_size ); sprintf( buf, "visual_class=%d\nbits_per_pixel=%d\nncolors=%d", ( int ) h->visual_class, ( int ) h->bits_per_pixel, ( int ) h->ncolors ); strcat( im->info, buf ); sprintf( buf, "PixmapDepth=%d\nPixmapWidth=%d\nPixmapHeight=%d", ( int ) h->bits_per_pixel, ( int ) h->pixmap_width, ( int ) h->pixmap_height ); strcat( im->info, buf ); sprintf( buf, "red_mask=0x%x\n green_mask=0x%x\n blue_mask=0x%x\n", ( int ) h->red_mask, ( int ) h->green_mask, ( int ) h->blue_mask ); strcat( im->info, buf ); } /*************************************** ***************************************/ static int XWD_description( FL_IMAGE * im ) { SPEC *sp = fl_malloc(sizeof *sp ); XWDFileHeader *header = &sp->header; FILE *fp = im->fpin; int k; im->io_spec = sp; im->spec_size = sizeof *sp; if ( fread( header, 1, sizeof *header, fp ) != sizeof *header ) M_err( "ImageXWD", "failure to read from file" ); if ( ( sp->swap = need_swap ) ) swap_header( header ); fli_rgbmask_to_shifts( header->red_mask, &sp->rshifts, &sp->rbits ); fli_rgbmask_to_shifts( header->green_mask, &sp->gshifts, &sp->gbits ); fli_rgbmask_to_shifts( header->blue_mask, &sp->bshifts, &sp->bbits ); if ( sp->gbits > ( unsigned int ) FL_PCBITS ) { sp->rshifts += sp->rbits - FL_PCBITS; sp->gshifts += sp->gbits - FL_PCBITS; sp->bshifts += sp->bbits - FL_PCBITS; } /* print header info */ if ( im->setup->header_info ) generate_header_info( im, header ); #if XWDDEBUG dumpheader( "Description", header ); #endif if ( ( k = header->header_size - sizeof *header ) > 0 ) k = fread( sp->name, 1, k, fp ); if ( k >= 0 ) sp->name[ k ] = '\0'; /* image type */ if ( header->visual_class == StaticGray || header->visual_class == GrayScale ) { im->type = header->pixmap_depth == 1 ? FL_IMAGE_MONO : FL_IMAGE_GRAY; if ( header->bits_per_pixel > 8 ) { im->type = FL_IMAGE_GRAY16; im->gray_maxval = ( 1 << header->bits_per_pixel ) - 1; } } else if ( header->visual_class == TrueColor || header->visual_class == DirectColor ) im->type = FL_IMAGE_RGB; else { im->type = FL_IMAGE_CI; if ( header->ncolors == 0 ) M_err( "ImageXWD", "no colormap ?" ); } im->w = header->pixmap_width; im->h = header->pixmap_height; im->map_len = header->ncolors; return 0; } /*************************************** ***************************************/ static int XWD_read_pixels( FL_IMAGE * im ) { SPEC *sp = im->io_spec; XWDFileHeader *h = &sp->header; FILE *fp = im->fpin; unsigned short us; unsigned int u32, n, r, g, b, rn, gn, bn; unsigned char *uc; int x, y, i, err; int ( * get32 )( FILE * ), ( * get16 )( FILE * ); fseek( fp, sp->header.header_size, SEEK_SET ); im->completed = 0; im->visual_cue( im, "Loading XWD" ); if ( sp->gbits < FL_PCBITS ) { rn = FL_PCBITS - sp->rbits; gn = FL_PCBITS - sp->gbits; bn = FL_PCBITS - sp->bbits; } else rn = gn = bn = 0; if ( h->byte_order == MSBFirst ) { get32 = fli_fget4MSBF; get16 = fli_fget2MSBF; } else { get32 = fli_fget4LSBF; get16 = fli_fget2LSBF; } /* read the colormap */ if ( h->ncolors > 0 ) { XWDColor *xwdcolor = fl_malloc( h->ncolors * sizeof *xwdcolor ); if ( fread( xwdcolor, sizeof *xwdcolor, h->ncolors, fp ) == h->ncolors && h->visual_class != TrueColor && h->visual_class != DirectColor ) { for ( i = 0; i < ( int ) h->ncolors; i++ ) { if ( sp->swap ) { im->red_lut[ i ] = swap16( xwdcolor[ i ].red ) >> 8; im->green_lut[ i ] = swap16( xwdcolor[ i ].green ) >> 8; im->blue_lut[ i ] = swap16( xwdcolor[ i ].blue ) >> 8; } else { im->red_lut[ i ] = ( xwdcolor[ i ].red ) >> 8; im->green_lut[ i ] = ( xwdcolor[ i ].green ) >> 8; im->blue_lut[ i ] = ( xwdcolor[ i ].blue ) >> 8; } } } fl_free( xwdcolor ); } if ( feof( fp ) || ferror( fp ) ) { im->error_message( im, "premature EOF ?" ); return -1; } /* reading the pixels */ y = err = 0; switch ( h->bits_per_pixel ) { case 32 : for ( y = 0; !err && y < im->h; y++ ) { for ( x = 0; x < im->w; x++ ) { u32 = get32( fp ); im->red[ y ][ x ] = ( u32 & h->red_mask ) >> sp->rshifts; im->green[ y ][ x ] = ( u32 & h->green_mask ) >> sp->gshifts; im->blue[ y ][ x ] = ( u32 & h->blue_mask ) >> sp->bshifts; } for ( n = im->w * 4; n < h->bytes_per_line; n++ ) getc( fp ); err = feof( fp ) || ferror( fp ); } break; case 8 : if ( h->visual_class == TrueColor || h->visual_class == DirectColor ) { for ( err = 0, y = 0; !err && y < im->h; y++ ) { for ( x = 0; x < im->w; x++ ) { us = getc( fp ); r = ( us & h->red_mask ) >> sp->rshifts; g = ( us & h->green_mask ) >> sp->gshifts; b = ( us & h->blue_mask ) >> sp->bshifts; /* normalize. */ im->red[ y ][ x ] = ( ( r + 1 ) << rn ) - 1; im->green[ y ][ x ] = ( ( g + 1 ) << gn ) - 1; im->blue[ y ][ x ] = ( ( b + 1 ) << bn ) - 1; } for ( ; x < ( int ) h->bytes_per_line; x++ ) getc( fp ); err = feof( fp ) || ferror( fp ); } } else { for ( y = 0; !err && y < im->h; y++ ) { for ( x = 0; x < im->w; x++ ) im->ci[ y ][ x ] = getc( fp ); for ( ; x < (int)h->bytes_per_line; x++ ) getc( fp ); err = feof( fp ) || ferror( fp ); } } break; case 16 : if ( h->visual_class == TrueColor || h->visual_class == DirectColor ) { for ( err = 0, y = 0; ! err && y < im->h; y++ ) { for ( x = 0; x < im->w; x++ ) { us = get16( fp ); r = ( us & h->red_mask ) >> sp->rshifts; g = ( us & h->green_mask ) >> sp->gshifts; b = ( us & h->blue_mask ) >> sp->bshifts; /* normalize. */ im->red[ y ][ x ] = ( ( r + 1 ) << rn ) - 1; im->green[ y ][ x ] = ( ( g + 1 ) << gn ) - 1; im->blue[ y ][ x ] = ( ( b + 1 ) << bn ) - 1; } for ( x = im->w * 2; x < ( int ) h->bytes_per_line; x++ ) getc( fp ); err = feof( fp ) || ferror( fp ); } } else { for ( y = 0; !err && y < im->h; y++ ) { for ( x = 0; x < im->w; x++ ) im->ci[ y ][ x ] = get16( fp ); for ( ; x < ( int ) h->bytes_per_line; x++ ) getc( fp ); err = feof( fp ) || ferror( fp ); } } break; case 1 : uc = fl_malloc( h->bytes_per_line ); for ( y = 0; y < im->h; y++ ) { if ( fread( uc, 1, h->bytes_per_line, fp ) != h->bytes_per_line ) { M_err( "LoadXWD", "failure to read from file" ); err = 1; break; } unpack_bits( im->ci[y], uc, h->bytes_per_line ); } fl_free( uc ); break; default: M_err( "LoadXWD", "%d bpp not implemented\n", h->bits_per_pixel ); err = 1; break; } if ( ! err ) { im->completed = im->total; im->visual_cue( im, "Done Loading XWD" ); } return err ? ( y < im->h / 2 ? -1 : y ) : 0; } /*********** output routines ************************************/ /*************************************** ***************************************/ static int detect_endian( void ) { short a = 0x1234; unsigned char *uc = ( unsigned char * ) &a; return ( uc[ 0 ] == 0x12 && uc[ 1 ] == 0x34 ) ? MSBFirst : LSBFirst; } /*************************************** ***************************************/ static int XWD_write_image( FL_IMAGE * im ) { XWDFileHeader header, *h; FILE *fp = im->fpout; int x, y, n; CARD32 *c32; int ( * write32 )( int, FILE * ), ( * write16 )( int, FILE * ); unsigned char *uc; static int machine_endian = -1; if ( machine_endian < 0 ) machine_endian = detect_endian( ); /* some programs expect MSBF always. Force it */ machine_endian = MSBFirst; /* make the header */ h = &header; memset( h, 0, sizeof *h ); h->header_size = sizeof *h + strlen( im->outfile ) + 1; h->file_version = XWD_FILE_VERSION; h->pixmap_format = im->type == FL_IMAGE_MONO ? XYBitmap : ZPixmap; h->pixmap_width = im->w; h->pixmap_height = im->h; h->byte_order = machine_endian; h->bitmap_bit_order = h->byte_order; h->red_mask = FL_RMASK; h->green_mask = FL_GMASK; h->blue_mask = FL_BMASK; h->colormap_entries = h->ncolors = im->map_len; h->window_width = h->pixmap_width; h->window_height = h->pixmap_height; h->window_x = h->window_y = h->window_bdrwidth = 0; /* type specific stuff */ if ( FL_IsRGB( im ) ) { h->pixmap_depth = 24; h->bits_per_pixel = 32; h->bitmap_unit = 32; h->bitmap_pad = 32; h->visual_class = TrueColor; } else if ( im->type == FL_IMAGE_CI || im->type == FL_IMAGE_GRAY ) { h->pixmap_depth = 8; h->bits_per_pixel = 8; h->bitmap_unit = 8; h->bitmap_pad = 8; h->visual_class = FL_IsGray( im->type ) ? GrayScale : PseudoColor; } else if ( im->type == FL_IMAGE_GRAY16 ) { h->pixmap_depth = value_to_bits( im->gray_maxval + 1 ); h->bits_per_pixel = 16; h->bitmap_unit = 16; h->bitmap_pad = 16; h->visual_class = GrayScale; } else if ( im->type == FL_IMAGE_MONO ) { h->pixmap_depth = 1; h->bits_per_pixel = 1; h->bitmap_unit = 8; h->bitmap_pad = 8; h->visual_class = StaticGray; } h->bits_per_rgb = h->pixmap_depth; h->bytes_per_line = ( im->w * h->bits_per_pixel + 7 ) / 8; if ( h->byte_order == MSBFirst ) { write32 = fli_fput4MSBF; write16 = fli_fput2MSBF; } else { write32 = fli_fput4LSBF; write16 = fli_fput2LSBF; } /* write the header */ c32 = ( CARD32 * ) h; for ( n = 0; ( size_t ) n < sizeof *h / sizeof h->file_version; n++, c32++ ) write32( *c32, fp ); fwrite( im->outfile, 1, strlen( im->outfile ) + 1, fp ); if ( h->ncolors ) { XWDColor xwdcolor; xwdcolor.flags = DoRed | DoGreen | DoBlue; for ( n = 0; n < ( int ) h->ncolors; n++ ) { int pad; xwdcolor.red = ( im->red_lut[ n ] << 8 ) | 0xff; xwdcolor.green = ( im->green_lut[ n ] << 8 ) | 0xff; xwdcolor.blue = ( im->blue_lut[ n ] << 8 ) | 0xff; xwdcolor.pixel = n; write32( xwdcolor.pixel, fp ); write16( xwdcolor.red, fp ); write16( xwdcolor.green, fp ); write16( xwdcolor.blue, fp ); putc( xwdcolor.flags, fp ); /* pad */ pad = sizeof xwdcolor - 11; for ( ; --pad >= 0; ) putc( 0, fp ); } } if ( im->type == FL_IMAGE_RGB ) { for ( y = 0; y < im->h; y++ ) { for ( x = 0; x < im->w; x++ ) write32( FL_PACK( im->red[ y ][ x ], im->green[ y ][ x ], im->blue[ y ][ x ] ), fp ); } } else if ( im->type == FL_IMAGE_CI || im->type == FL_IMAGE_GRAY ) { uc = fl_malloc( h->bytes_per_line ); for ( y = 0; y < im->h; y++ ) { for ( x = 0; x < im->w; x++ ) uc[ x ] = im->ci[ y ][ x ]; fwrite( uc, 1, h->bytes_per_line, fp ); } fl_free( uc ); } else if ( im->type == FL_IMAGE_GRAY16 ) { for ( y = 0; y < im->h; y++ ) for ( x = 0; x < im->w; x++ ) write16( im->gray[ y ][ x ], fp ); } else if ( im->type == FL_IMAGE_MONO ) { uc = fl_malloc( h->bytes_per_line ); for ( y = 0; y < im->h; y++ ) { pack_bits( uc, im->ci[ y ], im->w ); fwrite( uc, 1, h->bytes_per_line, fp ); } fl_free( uc ); } else { im->error_message( im, "Unknown type" ); return -1; } return 0; } /*************************************** ***************************************/ void flimage_enable_xwd( void ) { flimage_add_format( "X Window Dump", "xwd", "xwd", FL_IMAGE_FLEX & ~FL_IMAGE_PACKED, XWD_identify, XWD_description, XWD_read_pixels, XWD_write_image ); } /*************************************** ***************************************/ static unsigned int value_to_bits( unsigned int val ) { unsigned int i; for ( i = 1; ( 1u << i ) < val; i++ ) /* empty */ ; return i; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/0000775000175000017500000000000012353624653011157 500000000000000xforms-1.2.4/demos/fonts.c0000664000175000017500000001137012353623325012371 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Demo, showing the different fonts in different sizes. * M. Overmars and T.C. Zhao */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" typedef struct { FL_FORM * fontsform; void * vdata; char * cdata; long ldata; FL_OBJECT * fontobj; FL_OBJECT * sizeobj; FL_OBJECT * textobj; } FD_fontsform; extern FD_fontsform *create_form_fontsform( void ); FD_fontsform *ui; /*************************************** ***************************************/ void done_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { fl_finish( ); exit( 0 ); } /*************************************** ***************************************/ void style_cb( FL_OBJECT * obj, long arg FL_UNUSED_ARG ) { fl_set_object_lstyle( ui->textobj, fl_get_browser( obj ) - 1 ); } /*************************************** ***************************************/ void size_cb( FL_OBJECT * obj, long arg FL_UNUSED_ARG ) { int sizes[ ] = { 8, 10, 11, 12, 13, 14, 18, 24, 30 }; fl_set_object_lsize( ui->textobj, sizes[ fl_get_browser( obj ) - 1 ] ); } /*************************************** ***************************************/ void addit( const char * str ) { fl_add_browser_line( ui->fontobj, str ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_set_border_width( -3 ); fl_initialize( &argc, argv, "FormDemo", 0, 0 ); ui = create_form_fontsform( ); fl_scale_form( ui->fontsform, 1.1, 1.2 ); fl_set_object_dblbuffer( ui->textobj, 1 ); fl_set_object_bw( ui->textobj, 5 ); fl_enumerate_fonts( addit, 1 ); fl_select_browser_line( ui->fontobj, 1 ); fl_addto_browser( ui->sizeobj, "8 (tiny)" ); fl_addto_browser( ui->sizeobj, "10 (small)" ); fl_addto_browser( ui->sizeobj, "11 (scaled)" ); fl_addto_browser( ui->sizeobj, "12 (normal)" ); fl_addto_browser( ui->sizeobj, "13 (scaled)" ); fl_addto_browser( ui->sizeobj, "14 (medium)" ); fl_addto_browser( ui->sizeobj, "18 (large)" ); fl_addto_browser( ui->sizeobj, "24 (Huge)" ); fl_addto_browser( ui->sizeobj, "30 (scaled)" ); fl_select_browser_line( ui->sizeobj, 2 ); fl_set_object_lstyle( ui->textobj, FL_NORMAL_STYLE ); fl_call_object_callback( ui->fontobj ); fl_call_object_callback( ui->sizeobj ); fl_show_form( ui->fontsform, FL_PLACE_CENTER, FL_TRANSIENT, "Fonts" ); fl_do_forms( ); return 0; } /*************************************** ***************************************/ FD_fontsform * create_form_fontsform( void ) { FL_OBJECT *obj; FD_fontsform *fdui = fl_calloc( 1, sizeof *fdui ); fdui->fontsform = fl_bgn_form( FL_NO_BOX, 371, 296 ); obj = fl_add_box( FL_FLAT_BOX, 0, 0, 371, 296, "" ); fl_set_object_color( obj, FL_SLATEBLUE, FL_COL1 ); fdui->fontobj = obj = fl_add_browser( FL_HOLD_BROWSER, 10, 145, 195, 135, "" ); fl_set_object_lalign( obj, fl_to_inside_lalign( FL_ALIGN_BOTTOM ) ); fl_set_object_callback( obj, style_cb, 0 ); fdui->sizeobj = obj = fl_add_browser( FL_HOLD_BROWSER, 215, 145, 145, 135, "" ); fl_set_object_lalign( obj, fl_to_inside_lalign( FL_ALIGN_BOTTOM ) ); fl_set_object_callback( obj, size_cb, 0 ); fdui->textobj = obj = fl_add_text( FL_NORMAL_TEXT, 10, 5, 351, 125, "The quick brown\nfox jumps over\n" "the lazy dog." ); fl_set_object_boxtype( obj, FL_FRAME_BOX ); fl_set_object_lalign( obj, FL_ALIGN_CENTER ); obj = fl_add_button( FL_HIDDEN_BUTTON, 0, 0, 370, 140, "Button" ); fl_set_button_shortcut( obj, "^[qQ", 1 ); fl_set_object_callback( obj, done_cb, 0 ); fl_end_form( ); return fdui; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/iconvert.c0000644000175000017500000001032712251672320013064 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Convert an image file using the image support of Forms Library. * * Usage: iconvert [-version][-verbose][-help] inputimage outimage [fmt] * output image format is determined by the extension or * by fmt if present. * * Exit status: 0 (success) 1 (bad command line) 3 (conversion failed) * * T.C. Zhao (03/1999) * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" #include "image/flimage.h" static void initialize( void ); static void usage( const char *, int ); static int parse_command_line( int *, char ** ); /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_IMAGE *im; const char *fmt = 0; char *const *args; initialize( ); args = argv + parse_command_line( &argc, argv ); if ( argc < 3 || ! ( fmt = ( argc >= 4 ? args[ 3 ] : strrchr( args[ 2 ], '.' ) ) ) ) { usage( argv[ 0 ], argc >= 3 ); exit( 1 ); } fmt += fmt[ 0 ] == '.'; im = flimage_load( strdup( args[ 1 ] ) ); return flimage_dump( im, args[ 2 ], fmt ) < 0 ? 3 : 0; } /*************************************** ***************************************/ static void usage( const char * cmd, int more ) { const FLIMAGE_FORMAT_INFO *info; int n, i, k; fprintf( stderr, "Usage: %s [-verbose][-help] infile outfile [fmt]\n", cmd ); if ( ! more ) exit( 1 ); fputs( " The output format is determined by the file extension or fmt.\n" " fmt or extension must be one of the following:\n", stderr ); n = flimage_get_number_of_formats( ); for ( i = 1, k = 0; i <= n; i++ ) { info = flimage_get_format_info( i ); if ( info->read_write & FLIMAGE_WRITABLE ) { fprintf( stderr, "\t%s", info->extension ); if ( ++k % 6 == 0 ) fputc( '\n', stderr ); } } if ( k % 6 ) fputc( '\n', stderr ); exit( 1 ); } /* shut up visual_cue */ /*************************************** ***************************************/ static int noop( FL_IMAGE * im FL_UNUSED_ARG, const char * s FL_UNUSED_ARG ) { return 0; } /*************************************** ***************************************/ static int parse_command_line( int * argc, char * argv[ ] ) { int i; static FLIMAGE_SETUP setup; setup.visual_cue = noop; for ( i = 1; i < *argc && *argv[ i ] == '-'; ) { if ( strncmp( argv[ i ], "-verb", 5 ) == 0 ) { setup.visual_cue = 0; i++; } else if ( strncmp( argv[ i ], "-h", 2 ) == 0 ) { usage( argv[ 0 ], 1 ); i++; } else usage( argv[ 0 ], 0 ); } flimage_setup( &setup ); *argc -= i - 1; return i - 1; } /*************************************** ***************************************/ static void initialize( void ) { flimage_enable_xpm( ); flimage_enable_gif( ); flimage_enable_bmp( ); flimage_enable_sgi( ); flimage_enable_fits( ); flimage_enable_png( ); flimage_enable_xwd( ); flimage_enable_tiff( ); flimage_enable_ps( ); #ifndef NO_JPEG flimage_enable_jpeg( ); #endif } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/Makefile.in0000664000175000017500000024322512353624173013151 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/common.am noinst_PROGRAMS = arrowbutton$(EXEEXT) borderwidth$(EXEEXT) \ boxtype$(EXEEXT) browserall$(EXEEXT) browserop$(EXEEXT) \ buttonall$(EXEEXT) butttypes$(EXEEXT) canvas$(EXEEXT) \ chartall$(EXEEXT) chartstrip$(EXEEXT) choice$(EXEEXT) \ colbrowser$(EXEEXT) colsel$(EXEEXT) colsel1$(EXEEXT) \ counter$(EXEEXT) cursor$(EXEEXT) demo$(EXEEXT) demo05$(EXEEXT) \ demo06$(EXEEXT) demo27$(EXEEXT) demo33$(EXEEXT) \ demotest$(EXEEXT) demotest2$(EXEEXT) demotest3$(EXEEXT) \ dirlist$(EXEEXT) fbrowse$(EXEEXT) fbrowse1$(EXEEXT) \ fdial$(EXEEXT) flclock$(EXEEXT) folder$(EXEEXT) fonts$(EXEEXT) \ formbrowser$(EXEEXT) free1$(EXEEXT) freedraw$(EXEEXT) \ freedraw_leak$(EXEEXT) $(am__EXEEXT_1) goodies$(EXEEXT) \ grav$(EXEEXT) group$(EXEEXT) ibrowser$(EXEEXT) \ iconify$(EXEEXT) iconvert$(EXEEXT) inputall$(EXEEXT) \ invslider$(EXEEXT) itest$(EXEEXT) lalign$(EXEEXT) \ ldial$(EXEEXT) ll$(EXEEXT) longlabel$(EXEEXT) menu$(EXEEXT) \ minput$(EXEEXT) minput2$(EXEEXT) multilabel$(EXEEXT) \ ndial$(EXEEXT) newbutton$(EXEEXT) new_popup$(EXEEXT) \ nmenu$(EXEEXT) objinactive$(EXEEXT) objpos$(EXEEXT) \ objreturn$(EXEEXT) pmbrowse$(EXEEXT) popup$(EXEEXT) \ positioner$(EXEEXT) positioner_overlay$(EXEEXT) \ positionerXOR$(EXEEXT) preemptive$(EXEEXT) pup$(EXEEXT) \ pushbutton$(EXEEXT) pushme$(EXEEXT) rescale$(EXEEXT) \ scrollbar$(EXEEXT) secretinput$(EXEEXT) select$(EXEEXT) \ sld_alt$(EXEEXT) sld_radio$(EXEEXT) sldinactive$(EXEEXT) \ sldsize$(EXEEXT) sliderall$(EXEEXT) strange_button$(EXEEXT) \ strsize$(EXEEXT) symbols$(EXEEXT) thumbwheel$(EXEEXT) \ timer$(EXEEXT) timerprec$(EXEEXT) timeoutprec$(EXEEXT) \ touchbutton$(EXEEXT) xyplotactive$(EXEEXT) \ xyplotactivelog$(EXEEXT) xyplotall$(EXEEXT) \ xyplotover$(EXEEXT) yesno$(EXEEXT) yesno_cb$(EXEEXT) subdir = demos ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @BUILD_GL_TRUE@am__EXEEXT_1 = gl$(EXEEXT) glwin$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) am_arrowbutton_OBJECTS = arrowbutton.$(OBJEXT) arrowbutton_OBJECTS = $(am_arrowbutton_OBJECTS) arrowbutton_LDADD = $(LDADD) am_borderwidth_OBJECTS = borderwidth.$(OBJEXT) borderwidth_OBJECTS = $(am_borderwidth_OBJECTS) borderwidth_LDADD = $(LDADD) am_boxtype_OBJECTS = boxtype.$(OBJEXT) boxtype_OBJECTS = $(am_boxtype_OBJECTS) boxtype_LDADD = $(LDADD) am_browserall_OBJECTS = browserall.$(OBJEXT) browserall_OBJECTS = $(am_browserall_OBJECTS) browserall_LDADD = $(LDADD) am_browserop_OBJECTS = browserop.$(OBJEXT) browserop_OBJECTS = $(am_browserop_OBJECTS) browserop_LDADD = $(LDADD) am_buttonall_OBJECTS = buttonall.$(OBJEXT) nodist_buttonall_OBJECTS = buttons_gui.$(OBJEXT) buttonall_OBJECTS = $(am_buttonall_OBJECTS) \ $(nodist_buttonall_OBJECTS) buttonall_LDADD = $(LDADD) am_butttypes_OBJECTS = butttypes.$(OBJEXT) nodist_butttypes_OBJECTS = butttypes_gui.$(OBJEXT) butttypes_OBJECTS = $(am_butttypes_OBJECTS) \ $(nodist_butttypes_OBJECTS) butttypes_LDADD = $(LDADD) am_canvas_OBJECTS = canvas.$(OBJEXT) canvas_OBJECTS = $(am_canvas_OBJECTS) am__DEPENDENCIES_1 = canvas_DEPENDENCIES = ../lib/libforms.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_chartall_OBJECTS = chartall.$(OBJEXT) chartall_OBJECTS = $(am_chartall_OBJECTS) chartall_LDADD = $(LDADD) am_chartstrip_OBJECTS = chartstrip.$(OBJEXT) chartstrip_OBJECTS = $(am_chartstrip_OBJECTS) chartstrip_LDADD = $(LDADD) am_choice_OBJECTS = choice.$(OBJEXT) choice_OBJECTS = $(am_choice_OBJECTS) choice_LDADD = $(LDADD) am_colbrowser_OBJECTS = colbrowser.$(OBJEXT) colbrowser_OBJECTS = $(am_colbrowser_OBJECTS) colbrowser_LDADD = $(LDADD) am_colsel_OBJECTS = colsel.$(OBJEXT) colsel_OBJECTS = $(am_colsel_OBJECTS) colsel_LDADD = $(LDADD) am_colsel1_OBJECTS = colsel1.$(OBJEXT) colsel1_OBJECTS = $(am_colsel1_OBJECTS) colsel1_LDADD = $(LDADD) am_counter_OBJECTS = counter.$(OBJEXT) counter_OBJECTS = $(am_counter_OBJECTS) counter_LDADD = $(LDADD) am_cursor_OBJECTS = cursor.$(OBJEXT) cursor_OBJECTS = $(am_cursor_OBJECTS) cursor_LDADD = $(LDADD) am_demo_OBJECTS = demo.$(OBJEXT) demo_OBJECTS = $(am_demo_OBJECTS) demo_LDADD = $(LDADD) am_demo05_OBJECTS = demo05.$(OBJEXT) demo05_OBJECTS = $(am_demo05_OBJECTS) demo05_LDADD = $(LDADD) am_demo06_OBJECTS = demo06.$(OBJEXT) demo06_OBJECTS = $(am_demo06_OBJECTS) demo06_LDADD = $(LDADD) am_demo27_OBJECTS = demo27.$(OBJEXT) demo27_OBJECTS = $(am_demo27_OBJECTS) demo27_DEPENDENCIES = ../lib/libforms.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_demo33_OBJECTS = demo33.$(OBJEXT) demo33_OBJECTS = $(am_demo33_OBJECTS) demo33_LDADD = $(LDADD) am_demotest_OBJECTS = demotest.$(OBJEXT) nodist_demotest_OBJECTS = folder_gui.$(OBJEXT) demotest_OBJECTS = $(am_demotest_OBJECTS) $(nodist_demotest_OBJECTS) demotest_LDADD = $(LDADD) am_demotest2_OBJECTS = demotest2.$(OBJEXT) demotest2_OBJECTS = $(am_demotest2_OBJECTS) demotest2_LDADD = $(LDADD) am_demotest3_OBJECTS = demotest3.$(OBJEXT) demotest3_OBJECTS = $(am_demotest3_OBJECTS) demotest3_LDADD = $(LDADD) am_dirlist_OBJECTS = dirlist.$(OBJEXT) nodist_dirlist_OBJECTS = fbtest_gui.$(OBJEXT) dirlist_OBJECTS = $(am_dirlist_OBJECTS) $(nodist_dirlist_OBJECTS) dirlist_LDADD = $(LDADD) am_fbrowse_OBJECTS = fbrowse.$(OBJEXT) fbrowse_OBJECTS = $(am_fbrowse_OBJECTS) fbrowse_LDADD = $(LDADD) am_fbrowse1_OBJECTS = fbrowse1.$(OBJEXT) fbrowse1_OBJECTS = $(am_fbrowse1_OBJECTS) fbrowse1_LDADD = $(LDADD) am_fdial_OBJECTS = fdial.$(OBJEXT) fdial_OBJECTS = $(am_fdial_OBJECTS) fdial_LDADD = $(LDADD) am_flclock_OBJECTS = flclock.$(OBJEXT) flclock_OBJECTS = $(am_flclock_OBJECTS) flclock_LDADD = $(LDADD) am_folder_OBJECTS = folder.$(OBJEXT) nodist_folder_OBJECTS = folder_gui.$(OBJEXT) folder_OBJECTS = $(am_folder_OBJECTS) $(nodist_folder_OBJECTS) folder_LDADD = $(LDADD) am_fonts_OBJECTS = fonts.$(OBJEXT) fonts_OBJECTS = $(am_fonts_OBJECTS) fonts_LDADD = $(LDADD) am_formbrowser_OBJECTS = formbrowser.$(OBJEXT) nodist_formbrowser_OBJECTS = formbrowser_gui.$(OBJEXT) formbrowser_OBJECTS = $(am_formbrowser_OBJECTS) \ $(nodist_formbrowser_OBJECTS) formbrowser_LDADD = $(LDADD) am_free1_OBJECTS = free1.$(OBJEXT) free1_OBJECTS = $(am_free1_OBJECTS) free1_LDADD = $(LDADD) am_freedraw_OBJECTS = freedraw.$(OBJEXT) freedraw_OBJECTS = $(am_freedraw_OBJECTS) freedraw_DEPENDENCIES = ../lib/libforms.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_freedraw_leak_OBJECTS = freedraw_leak.$(OBJEXT) freedraw_leak_OBJECTS = $(am_freedraw_leak_OBJECTS) freedraw_leak_DEPENDENCIES = ../lib/libforms.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_gl_OBJECTS = gl.$(OBJEXT) gl_OBJECTS = $(am_gl_OBJECTS) gl_DEPENDENCIES = ../gl/libformsGL.la ../lib/libforms.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_glwin_OBJECTS = glwin.$(OBJEXT) glwin_OBJECTS = $(am_glwin_OBJECTS) glwin_DEPENDENCIES = ../gl/libformsGL.la ../lib/libforms.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_goodies_OBJECTS = goodies.$(OBJEXT) goodies_OBJECTS = $(am_goodies_OBJECTS) goodies_LDADD = $(LDADD) am_grav_OBJECTS = grav.$(OBJEXT) grav_OBJECTS = $(am_grav_OBJECTS) grav_LDADD = $(LDADD) am_group_OBJECTS = group.$(OBJEXT) group_OBJECTS = $(am_group_OBJECTS) group_LDADD = $(LDADD) am_ibrowser_OBJECTS = ibrowser.$(OBJEXT) ibrowser_OBJECTS = $(am_ibrowser_OBJECTS) ibrowser_DEPENDENCIES = ../image/libflimage.la ../lib/libforms.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_iconify_OBJECTS = iconify.$(OBJEXT) iconify_OBJECTS = $(am_iconify_OBJECTS) iconify_LDADD = $(LDADD) am_iconvert_OBJECTS = iconvert.$(OBJEXT) iconvert_OBJECTS = $(am_iconvert_OBJECTS) iconvert_DEPENDENCIES = ../image/libflimage.la ../lib/libforms.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_inputall_OBJECTS = inputall.$(OBJEXT) nodist_inputall_OBJECTS = inputall_gui.$(OBJEXT) inputall_OBJECTS = $(am_inputall_OBJECTS) $(nodist_inputall_OBJECTS) inputall_LDADD = $(LDADD) am_invslider_OBJECTS = invslider.$(OBJEXT) invslider_OBJECTS = $(am_invslider_OBJECTS) invslider_LDADD = $(LDADD) am_itest_OBJECTS = itest.$(OBJEXT) itest_OBJECTS = $(am_itest_OBJECTS) itest_DEPENDENCIES = ../image/libflimage.la ../lib/libforms.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_lalign_OBJECTS = lalign.$(OBJEXT) lalign_OBJECTS = $(am_lalign_OBJECTS) lalign_LDADD = $(LDADD) am_ldial_OBJECTS = ldial.$(OBJEXT) ldial_OBJECTS = $(am_ldial_OBJECTS) ldial_LDADD = $(LDADD) am_ll_OBJECTS = ll.$(OBJEXT) ll_OBJECTS = $(am_ll_OBJECTS) ll_DEPENDENCIES = ../image/libflimage.la ../lib/libforms.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_longlabel_OBJECTS = longlabel.$(OBJEXT) longlabel_OBJECTS = $(am_longlabel_OBJECTS) longlabel_LDADD = $(LDADD) am_menu_OBJECTS = menu.$(OBJEXT) menu_OBJECTS = $(am_menu_OBJECTS) menu_LDADD = $(LDADD) am_minput_OBJECTS = minput.$(OBJEXT) minput_OBJECTS = $(am_minput_OBJECTS) minput_LDADD = $(LDADD) am_minput2_OBJECTS = minput2.$(OBJEXT) minput2_OBJECTS = $(am_minput2_OBJECTS) minput2_LDADD = $(LDADD) am_multilabel_OBJECTS = multilabel.$(OBJEXT) multilabel_OBJECTS = $(am_multilabel_OBJECTS) multilabel_LDADD = $(LDADD) am_ndial_OBJECTS = ndial.$(OBJEXT) ndial_OBJECTS = $(am_ndial_OBJECTS) ndial_LDADD = $(LDADD) am_new_popup_OBJECTS = new_popup.$(OBJEXT) new_popup_OBJECTS = $(am_new_popup_OBJECTS) new_popup_LDADD = $(LDADD) am_newbutton_OBJECTS = newbutton.$(OBJEXT) crossbut.$(OBJEXT) newbutton_OBJECTS = $(am_newbutton_OBJECTS) newbutton_LDADD = $(LDADD) am_nmenu_OBJECTS = nmenu.$(OBJEXT) nmenu_OBJECTS = $(am_nmenu_OBJECTS) nmenu_LDADD = $(LDADD) am_objinactive_OBJECTS = objinactive.$(OBJEXT) objinactive_OBJECTS = $(am_objinactive_OBJECTS) objinactive_LDADD = $(LDADD) am_objpos_OBJECTS = objpos.$(OBJEXT) objpos_OBJECTS = $(am_objpos_OBJECTS) objpos_LDADD = $(LDADD) am_objreturn_OBJECTS = objreturn.$(OBJEXT) objreturn_OBJECTS = $(am_objreturn_OBJECTS) objreturn_LDADD = $(LDADD) am_pmbrowse_OBJECTS = pmbrowse.$(OBJEXT) nodist_pmbrowse_OBJECTS = pmbrowse_gui.$(OBJEXT) pmbrowse_OBJECTS = $(am_pmbrowse_OBJECTS) $(nodist_pmbrowse_OBJECTS) pmbrowse_LDADD = $(LDADD) am_popup_OBJECTS = popup.$(OBJEXT) popup_OBJECTS = $(am_popup_OBJECTS) popup_LDADD = $(LDADD) am_positioner_OBJECTS = positioner.$(OBJEXT) positioner_OBJECTS = $(am_positioner_OBJECTS) positioner_LDADD = $(LDADD) am_positionerXOR_OBJECTS = positionerXOR.$(OBJEXT) positionerXOR_OBJECTS = $(am_positionerXOR_OBJECTS) positionerXOR_LDADD = $(LDADD) am_positioner_overlay_OBJECTS = positioner_overlay.$(OBJEXT) positioner_overlay_OBJECTS = $(am_positioner_overlay_OBJECTS) positioner_overlay_LDADD = $(LDADD) am_preemptive_OBJECTS = preemptive.$(OBJEXT) preemptive_OBJECTS = $(am_preemptive_OBJECTS) preemptive_LDADD = $(LDADD) am_pup_OBJECTS = pup.$(OBJEXT) pup_OBJECTS = $(am_pup_OBJECTS) pup_LDADD = $(LDADD) am_pushbutton_OBJECTS = pushbutton.$(OBJEXT) pushbutton_OBJECTS = $(am_pushbutton_OBJECTS) pushbutton_LDADD = $(LDADD) am_pushme_OBJECTS = pushme.$(OBJEXT) pushme_OBJECTS = $(am_pushme_OBJECTS) pushme_LDADD = $(LDADD) am_rescale_OBJECTS = rescale.$(OBJEXT) rescale_OBJECTS = $(am_rescale_OBJECTS) rescale_LDADD = $(LDADD) am_scrollbar_OBJECTS = scrollbar.$(OBJEXT) nodist_scrollbar_OBJECTS = scrollbar_gui.$(OBJEXT) scrollbar_OBJECTS = $(am_scrollbar_OBJECTS) \ $(nodist_scrollbar_OBJECTS) scrollbar_LDADD = $(LDADD) am_secretinput_OBJECTS = secretinput.$(OBJEXT) secretinput_OBJECTS = $(am_secretinput_OBJECTS) secretinput_LDADD = $(LDADD) am_select_OBJECTS = select.$(OBJEXT) select_OBJECTS = $(am_select_OBJECTS) select_LDADD = $(LDADD) am_sld_alt_OBJECTS = sld_alt.$(OBJEXT) sld_alt_OBJECTS = $(am_sld_alt_OBJECTS) sld_alt_LDADD = $(LDADD) am_sld_radio_OBJECTS = sld_radio.$(OBJEXT) sld_radio_OBJECTS = $(am_sld_radio_OBJECTS) sld_radio_LDADD = $(LDADD) am_sldinactive_OBJECTS = sldinactive.$(OBJEXT) sldinactive_OBJECTS = $(am_sldinactive_OBJECTS) sldinactive_LDADD = $(LDADD) am_sldsize_OBJECTS = sldsize.$(OBJEXT) sldsize_OBJECTS = $(am_sldsize_OBJECTS) sldsize_LDADD = $(LDADD) am_sliderall_OBJECTS = sliderall.$(OBJEXT) sliderall_OBJECTS = $(am_sliderall_OBJECTS) sliderall_LDADD = $(LDADD) am_strange_button_OBJECTS = strange_button.$(OBJEXT) strange_button_OBJECTS = $(am_strange_button_OBJECTS) strange_button_LDADD = $(LDADD) am_strsize_OBJECTS = strsize.$(OBJEXT) strsize_OBJECTS = $(am_strsize_OBJECTS) strsize_LDADD = $(LDADD) am_symbols_OBJECTS = symbols.$(OBJEXT) symbols_OBJECTS = $(am_symbols_OBJECTS) symbols_LDADD = $(LDADD) am_thumbwheel_OBJECTS = thumbwheel.$(OBJEXT) nodist_thumbwheel_OBJECTS = twheel_gui.$(OBJEXT) thumbwheel_OBJECTS = $(am_thumbwheel_OBJECTS) \ $(nodist_thumbwheel_OBJECTS) thumbwheel_LDADD = $(LDADD) am_timeoutprec_OBJECTS = timeoutprec.$(OBJEXT) timeoutprec_OBJECTS = $(am_timeoutprec_OBJECTS) timeoutprec_LDADD = $(LDADD) am_timer_OBJECTS = timer.$(OBJEXT) timer_OBJECTS = $(am_timer_OBJECTS) timer_LDADD = $(LDADD) am_timerprec_OBJECTS = timerprec.$(OBJEXT) timerprec_OBJECTS = $(am_timerprec_OBJECTS) timerprec_LDADD = $(LDADD) am_touchbutton_OBJECTS = touchbutton.$(OBJEXT) touchbutton_OBJECTS = $(am_touchbutton_OBJECTS) touchbutton_LDADD = $(LDADD) am_xyplotactive_OBJECTS = xyplotactive.$(OBJEXT) xyplotactive_OBJECTS = $(am_xyplotactive_OBJECTS) xyplotactive_LDADD = $(LDADD) am_xyplotactivelog_OBJECTS = xyplotactivelog.$(OBJEXT) xyplotactivelog_OBJECTS = $(am_xyplotactivelog_OBJECTS) xyplotactivelog_LDADD = $(LDADD) am_xyplotall_OBJECTS = xyplotall.$(OBJEXT) xyplotall_OBJECTS = $(am_xyplotall_OBJECTS) xyplotall_LDADD = $(LDADD) am_xyplotover_OBJECTS = xyplotover.$(OBJEXT) xyplotover_OBJECTS = $(am_xyplotover_OBJECTS) xyplotover_DEPENDENCIES = ../image/libflimage.la ../lib/libforms.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_yesno_OBJECTS = yesno.$(OBJEXT) yesno_OBJECTS = $(am_yesno_OBJECTS) yesno_LDADD = $(LDADD) am_yesno_cb_OBJECTS = yesno_cb.$(OBJEXT) yesno_cb_OBJECTS = $(am_yesno_cb_OBJECTS) yesno_cb_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/lib depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(arrowbutton_SOURCES) $(borderwidth_SOURCES) \ $(boxtype_SOURCES) $(browserall_SOURCES) $(browserop_SOURCES) \ $(buttonall_SOURCES) $(nodist_buttonall_SOURCES) \ $(butttypes_SOURCES) $(nodist_butttypes_SOURCES) \ $(canvas_SOURCES) $(chartall_SOURCES) $(chartstrip_SOURCES) \ $(choice_SOURCES) $(colbrowser_SOURCES) $(colsel_SOURCES) \ $(colsel1_SOURCES) $(counter_SOURCES) $(cursor_SOURCES) \ $(demo_SOURCES) $(demo05_SOURCES) $(demo06_SOURCES) \ $(demo27_SOURCES) $(demo33_SOURCES) $(demotest_SOURCES) \ $(nodist_demotest_SOURCES) $(demotest2_SOURCES) \ $(demotest3_SOURCES) $(dirlist_SOURCES) \ $(nodist_dirlist_SOURCES) $(fbrowse_SOURCES) \ $(fbrowse1_SOURCES) $(fdial_SOURCES) $(flclock_SOURCES) \ $(folder_SOURCES) $(nodist_folder_SOURCES) $(fonts_SOURCES) \ $(formbrowser_SOURCES) $(nodist_formbrowser_SOURCES) \ $(free1_SOURCES) $(freedraw_SOURCES) $(freedraw_leak_SOURCES) \ $(gl_SOURCES) $(glwin_SOURCES) $(goodies_SOURCES) \ $(grav_SOURCES) $(group_SOURCES) $(ibrowser_SOURCES) \ $(iconify_SOURCES) $(iconvert_SOURCES) $(inputall_SOURCES) \ $(nodist_inputall_SOURCES) $(invslider_SOURCES) \ $(itest_SOURCES) $(lalign_SOURCES) $(ldial_SOURCES) \ $(ll_SOURCES) $(longlabel_SOURCES) $(menu_SOURCES) \ $(minput_SOURCES) $(minput2_SOURCES) $(multilabel_SOURCES) \ $(ndial_SOURCES) $(new_popup_SOURCES) $(newbutton_SOURCES) \ $(nmenu_SOURCES) $(objinactive_SOURCES) $(objpos_SOURCES) \ $(objreturn_SOURCES) $(pmbrowse_SOURCES) \ $(nodist_pmbrowse_SOURCES) $(popup_SOURCES) \ $(positioner_SOURCES) $(positionerXOR_SOURCES) \ $(positioner_overlay_SOURCES) $(preemptive_SOURCES) \ $(pup_SOURCES) $(pushbutton_SOURCES) $(pushme_SOURCES) \ $(rescale_SOURCES) $(scrollbar_SOURCES) \ $(nodist_scrollbar_SOURCES) $(secretinput_SOURCES) \ $(select_SOURCES) $(sld_alt_SOURCES) $(sld_radio_SOURCES) \ $(sldinactive_SOURCES) $(sldsize_SOURCES) $(sliderall_SOURCES) \ $(strange_button_SOURCES) $(strsize_SOURCES) \ $(symbols_SOURCES) $(thumbwheel_SOURCES) \ $(nodist_thumbwheel_SOURCES) $(timeoutprec_SOURCES) \ $(timer_SOURCES) $(timerprec_SOURCES) $(touchbutton_SOURCES) \ $(xyplotactive_SOURCES) $(xyplotactivelog_SOURCES) \ $(xyplotall_SOURCES) $(xyplotover_SOURCES) $(yesno_SOURCES) \ $(yesno_cb_SOURCES) DIST_SOURCES = $(arrowbutton_SOURCES) $(borderwidth_SOURCES) \ $(boxtype_SOURCES) $(browserall_SOURCES) $(browserop_SOURCES) \ $(buttonall_SOURCES) $(butttypes_SOURCES) $(canvas_SOURCES) \ $(chartall_SOURCES) $(chartstrip_SOURCES) $(choice_SOURCES) \ $(colbrowser_SOURCES) $(colsel_SOURCES) $(colsel1_SOURCES) \ $(counter_SOURCES) $(cursor_SOURCES) $(demo_SOURCES) \ $(demo05_SOURCES) $(demo06_SOURCES) $(demo27_SOURCES) \ $(demo33_SOURCES) $(demotest_SOURCES) $(demotest2_SOURCES) \ $(demotest3_SOURCES) $(dirlist_SOURCES) $(fbrowse_SOURCES) \ $(fbrowse1_SOURCES) $(fdial_SOURCES) $(flclock_SOURCES) \ $(folder_SOURCES) $(fonts_SOURCES) $(formbrowser_SOURCES) \ $(free1_SOURCES) $(freedraw_SOURCES) $(freedraw_leak_SOURCES) \ $(gl_SOURCES) $(glwin_SOURCES) $(goodies_SOURCES) \ $(grav_SOURCES) $(group_SOURCES) $(ibrowser_SOURCES) \ $(iconify_SOURCES) $(iconvert_SOURCES) $(inputall_SOURCES) \ $(invslider_SOURCES) $(itest_SOURCES) $(lalign_SOURCES) \ $(ldial_SOURCES) $(ll_SOURCES) $(longlabel_SOURCES) \ $(menu_SOURCES) $(minput_SOURCES) $(minput2_SOURCES) \ $(multilabel_SOURCES) $(ndial_SOURCES) $(new_popup_SOURCES) \ $(newbutton_SOURCES) $(nmenu_SOURCES) $(objinactive_SOURCES) \ $(objpos_SOURCES) $(objreturn_SOURCES) $(pmbrowse_SOURCES) \ $(popup_SOURCES) $(positioner_SOURCES) \ $(positionerXOR_SOURCES) $(positioner_overlay_SOURCES) \ $(preemptive_SOURCES) $(pup_SOURCES) $(pushbutton_SOURCES) \ $(pushme_SOURCES) $(rescale_SOURCES) $(scrollbar_SOURCES) \ $(secretinput_SOURCES) $(select_SOURCES) $(sld_alt_SOURCES) \ $(sld_radio_SOURCES) $(sldinactive_SOURCES) $(sldsize_SOURCES) \ $(sliderall_SOURCES) $(strange_button_SOURCES) \ $(strsize_SOURCES) $(symbols_SOURCES) $(thumbwheel_SOURCES) \ $(timeoutprec_SOURCES) $(timer_SOURCES) $(timerprec_SOURCES) \ $(touchbutton_SOURCES) $(xyplotactive_SOURCES) \ $(xyplotactivelog_SOURCES) $(xyplotall_SOURCES) \ $(xyplotover_SOURCES) $(yesno_SOURCES) $(yesno_cb_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FL_FIXLEVEL = @FL_FIXLEVEL@ FL_REVISION = @FL_REVISION@ FL_VERSION = @FL_VERSION@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIB = @JPEG_LIB@ LD = @LD@ # menubar # Most of these demos link against libforms only. For them this default is # sufficient: LDFLAGS = ../lib/libforms.la $(X_LIBS) $(X_PRE_LIBS) $(LIBS) $(X_EXTRA_LIBS) LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ TEXI2DVI = @TEXI2DVI@ TEXI2DVI_NEEDS_PDF = @TEXI2DVI_NEEDS_PDF@ TEXI2HTML = @TEXI2HTML@ VERSION = @VERSION@ XMKMF = @XMKMF@ XPM_LIB = @XPM_LIB@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign DISTCLEANFILES = *.orig *.rej *~ *.bak core makelog MAINTAINERCLEANFILES = $(srcdir)/Makefile.in makelog AM_INSTALL_DATA_FLAGS = $(INSTALL) -m 644 -D EXTRA_DIST = Readme iconvert.1 demo.menu crossbut.h \ bm1.xbm bm2.xbm newmail.xbm nomail.xbm picture.xbm srs.xbm \ crab45.xpm crab_tran.xpm crab.xpm porsche.xpm \ test.xpm xconq.xpm xterm.xpm colorwheel.xpm SUBDIRS = fd SUFFIXES = .fd .c INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/lib $(X_CFLAGS) @BUILD_GL_FALSE@GL = @BUILD_GL_TRUE@GL = gl glwin arrowbutton_SOURCES = arrowbutton.c borderwidth_SOURCES = borderwidth.c boxtype_SOURCES = boxtype.c browserall_SOURCES = browserall.c browserop_SOURCES = browserop.c buttonall_SOURCES = buttonall.c nodist_buttonall_SOURCES = fd/buttons_gui.c fd/buttons_gui.h butttypes_SOURCES = butttypes.c nodist_butttypes_SOURCES = fd/butttypes_gui.c fd/butttypes_gui.h canvas_SOURCES = canvas.c canvas_LDADD = ../lib/libforms.la \ $(X_LIBS) $(X_PRE_LIBS) -lX11 $(LIBS) $(X_EXTRA_LIBS) chartall_SOURCES = chartall.c chartstrip_SOURCES = chartstrip.c choice_SOURCES = choice.c colbrowser_SOURCES = colbrowser.c colsel_SOURCES = colsel.c colsel1_SOURCES = colsel1.c counter_SOURCES = counter.c cursor_SOURCES = cursor.c demo_SOURCES = demo.c demo05_SOURCES = demo05.c demo06_SOURCES = demo06.c demo27_SOURCES = demo27.c demo27_LDADD = ../lib/libforms.la \ $(X_LIBS) $(X_PRE_LIBS) -lX11 $(LIBS) $(X_EXTRA_LIBS) demo33_SOURCES = demo33.c demotest_SOURCES = demotest.c nodist_demotest_SOURCES = fd/folder_gui.c fd/folder_gui.h demotest2_SOURCES = demotest2.c demotest3_SOURCES = demotest3.c dirlist_SOURCES = dirlist.c nodist_dirlist_SOURCES = fd/fbtest_gui.c fd/fbtest_gui.h fbrowse_SOURCES = fbrowse.c fbrowse1_SOURCES = fbrowse1.c fdial_SOURCES = fdial.c flclock_SOURCES = flclock.c folder_SOURCES = folder.c nodist_folder_SOURCES = fd/folder_gui.c fd/folder_gui.h fonts_SOURCES = fonts.c formbrowser_SOURCES = formbrowser.c nodist_formbrowser_SOURCES = fd/formbrowser_gui.c fd/formbrowser_gui.h free1_SOURCES = free1.c freedraw_SOURCES = freedraw.c freedraw_LDADD = ../lib/libforms.la \ $(X_LIBS) $(X_PRE_LIBS) -lX11 $(LIBS) $(X_EXTRA_LIBS) freedraw_leak_SOURCES = freedraw_leak.c freedraw_leak_LDADD = ../lib/libforms.la \ $(X_LIBS) $(X_PRE_LIBS) -lX11 $(LIBS) $(X_EXTRA_LIBS) gl_SOURCES = gl.c gl_LDADD = ../gl/libformsGL.la ../lib/libforms.la \ $(X_LIBS) $(X_PRE_LIBS) -lGL -lX11 $(LIBS) $(X_EXTRA_LIBS) glwin_SOURCES = glwin.c glwin_LDADD = ../gl/libformsGL.la ../lib/libforms.la \ $(X_LIBS) $(X_PRE_LIBS) -lGL -lX11 $(LIBS) $(X_EXTRA_LIBS) goodies_SOURCES = goodies.c grav_SOURCES = grav.c group_SOURCES = group.c ibrowser_SOURCES = ibrowser.c ibrowser_LDADD = ../image/libflimage.la ../lib/libforms.la \ $(X_LIBS) $(X_PRE_LIBS) $(JPEG_LIB) $(XPM_LIB) -lX11 $(LIBS) \ $(X_EXTRA_LIBS) iconify_SOURCES = iconify.c iconvert_SOURCES = iconvert.c iconvert_LDADD = ../image/libflimage.la ../lib/libforms.la \ $(X_LIBS) $(X_PRE_LIBS) $(JPEG_LIB) $(XPM_LIB) -lX11 $(LIBS) \ $(X_EXTRA_LIBS) inputall_SOURCES = inputall.c nodist_inputall_SOURCES = fd/inputall_gui.c fd/inputall_gui.h invslider_SOURCES = invslider.c itest_SOURCES = itest.c itest_LDADD = ../image/libflimage.la ../lib/libforms.la \ $(X_LIBS) $(X_PRE_LIBS) $(JPEG_LIB) $(XPM_LIB) -lX11 $(LIBS) \ $(X_EXTRA_LIBS) lalign_SOURCES = lalign.c ldial_SOURCES = ldial.c ll_SOURCES = ll.c ll_LDADD = ../image/libflimage.la ../lib/libforms.la \ $(X_LIBS) $(X_PRE_LIBS) $(JPEG_LIB) $(XPM_LIB) -lX11 $(LIBS) \ $(X_EXTRA_LIBS) longlabel_SOURCES = longlabel.c menu_SOURCES = menu.c #menubar_SOURCES = menubar.c minput_SOURCES = minput.c minput2_SOURCES = minput2.c multilabel_SOURCES = multilabel.c ndial_SOURCES = ndial.c newbutton_SOURCES = newbutton.c crossbut.c new_popup_SOURCES = new_popup.c nmenu_SOURCES = nmenu.c objinactive_SOURCES = objinactive.c objpos_SOURCES = objpos.c objreturn_SOURCES = objreturn.c pmbrowse_SOURCES = pmbrowse.c nodist_pmbrowse_SOURCES = fd/pmbrowse_gui.c fd/pmbrowse_gui.h popup_SOURCES = popup.c positioner_SOURCES = positioner.c positioner_overlay_SOURCES = positioner_overlay.c positionerXOR_SOURCES = positionerXOR.c preemptive_SOURCES = preemptive.c pup_SOURCES = pup.c pushbutton_SOURCES = pushbutton.c pushme_SOURCES = pushme.c rescale_SOURCES = rescale.c scrollbar_SOURCES = scrollbar.c nodist_scrollbar_SOURCES = fd/scrollbar_gui.c fd/scrollbar_gui.h secretinput_SOURCES = secretinput.c select_SOURCES = select.c sld_alt_SOURCES = sld_alt.c sld_radio_SOURCES = sld_radio.c sldinactive_SOURCES = sldinactive.c sldsize_SOURCES = sldsize.c sliderall_SOURCES = sliderall.c strange_button_SOURCES = strange_button.c strsize_SOURCES = strsize.c symbols_SOURCES = symbols.c thumbwheel_SOURCES = thumbwheel.c nodist_thumbwheel_SOURCES = fd/twheel_gui.c fd/twheel_gui.h timer_SOURCES = timer.c timerprec_SOURCES = timerprec.c timeoutprec_SOURCES = timeoutprec.c touchbutton_SOURCES = touchbutton.c xyplotactive_SOURCES = xyplotactive.c xyplotactivelog_SOURCES = xyplotactivelog.c xyplotall_SOURCES = xyplotall.c xyplotover_SOURCES = xyplotover.c xyplotover_LDADD = ../image/libflimage.la ../lib/libforms.la \ $(X_LIBS) $(X_PRE_LIBS) $(JPEG_LIB) $(XPM_LIB) -lX11 $(LIBS) \ $(X_EXTRA_LIBS) yesno_SOURCES = yesno.c yesno_cb_SOURCES = yesno_cb.c all: all-recursive .SUFFIXES: .SUFFIXES: .fd .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/common.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/common.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list arrowbutton$(EXEEXT): $(arrowbutton_OBJECTS) $(arrowbutton_DEPENDENCIES) $(EXTRA_arrowbutton_DEPENDENCIES) @rm -f arrowbutton$(EXEEXT) $(LINK) $(arrowbutton_OBJECTS) $(arrowbutton_LDADD) $(LIBS) borderwidth$(EXEEXT): $(borderwidth_OBJECTS) $(borderwidth_DEPENDENCIES) $(EXTRA_borderwidth_DEPENDENCIES) @rm -f borderwidth$(EXEEXT) $(LINK) $(borderwidth_OBJECTS) $(borderwidth_LDADD) $(LIBS) boxtype$(EXEEXT): $(boxtype_OBJECTS) $(boxtype_DEPENDENCIES) $(EXTRA_boxtype_DEPENDENCIES) @rm -f boxtype$(EXEEXT) $(LINK) $(boxtype_OBJECTS) $(boxtype_LDADD) $(LIBS) browserall$(EXEEXT): $(browserall_OBJECTS) $(browserall_DEPENDENCIES) $(EXTRA_browserall_DEPENDENCIES) @rm -f browserall$(EXEEXT) $(LINK) $(browserall_OBJECTS) $(browserall_LDADD) $(LIBS) browserop$(EXEEXT): $(browserop_OBJECTS) $(browserop_DEPENDENCIES) $(EXTRA_browserop_DEPENDENCIES) @rm -f browserop$(EXEEXT) $(LINK) $(browserop_OBJECTS) $(browserop_LDADD) $(LIBS) buttonall$(EXEEXT): $(buttonall_OBJECTS) $(buttonall_DEPENDENCIES) $(EXTRA_buttonall_DEPENDENCIES) @rm -f buttonall$(EXEEXT) $(LINK) $(buttonall_OBJECTS) $(buttonall_LDADD) $(LIBS) butttypes$(EXEEXT): $(butttypes_OBJECTS) $(butttypes_DEPENDENCIES) $(EXTRA_butttypes_DEPENDENCIES) @rm -f butttypes$(EXEEXT) $(LINK) $(butttypes_OBJECTS) $(butttypes_LDADD) $(LIBS) canvas$(EXEEXT): $(canvas_OBJECTS) $(canvas_DEPENDENCIES) $(EXTRA_canvas_DEPENDENCIES) @rm -f canvas$(EXEEXT) $(LINK) $(canvas_OBJECTS) $(canvas_LDADD) $(LIBS) chartall$(EXEEXT): $(chartall_OBJECTS) $(chartall_DEPENDENCIES) $(EXTRA_chartall_DEPENDENCIES) @rm -f chartall$(EXEEXT) $(LINK) $(chartall_OBJECTS) $(chartall_LDADD) $(LIBS) chartstrip$(EXEEXT): $(chartstrip_OBJECTS) $(chartstrip_DEPENDENCIES) $(EXTRA_chartstrip_DEPENDENCIES) @rm -f chartstrip$(EXEEXT) $(LINK) $(chartstrip_OBJECTS) $(chartstrip_LDADD) $(LIBS) choice$(EXEEXT): $(choice_OBJECTS) $(choice_DEPENDENCIES) $(EXTRA_choice_DEPENDENCIES) @rm -f choice$(EXEEXT) $(LINK) $(choice_OBJECTS) $(choice_LDADD) $(LIBS) colbrowser$(EXEEXT): $(colbrowser_OBJECTS) $(colbrowser_DEPENDENCIES) $(EXTRA_colbrowser_DEPENDENCIES) @rm -f colbrowser$(EXEEXT) $(LINK) $(colbrowser_OBJECTS) $(colbrowser_LDADD) $(LIBS) colsel$(EXEEXT): $(colsel_OBJECTS) $(colsel_DEPENDENCIES) $(EXTRA_colsel_DEPENDENCIES) @rm -f colsel$(EXEEXT) $(LINK) $(colsel_OBJECTS) $(colsel_LDADD) $(LIBS) colsel1$(EXEEXT): $(colsel1_OBJECTS) $(colsel1_DEPENDENCIES) $(EXTRA_colsel1_DEPENDENCIES) @rm -f colsel1$(EXEEXT) $(LINK) $(colsel1_OBJECTS) $(colsel1_LDADD) $(LIBS) counter$(EXEEXT): $(counter_OBJECTS) $(counter_DEPENDENCIES) $(EXTRA_counter_DEPENDENCIES) @rm -f counter$(EXEEXT) $(LINK) $(counter_OBJECTS) $(counter_LDADD) $(LIBS) cursor$(EXEEXT): $(cursor_OBJECTS) $(cursor_DEPENDENCIES) $(EXTRA_cursor_DEPENDENCIES) @rm -f cursor$(EXEEXT) $(LINK) $(cursor_OBJECTS) $(cursor_LDADD) $(LIBS) demo$(EXEEXT): $(demo_OBJECTS) $(demo_DEPENDENCIES) $(EXTRA_demo_DEPENDENCIES) @rm -f demo$(EXEEXT) $(LINK) $(demo_OBJECTS) $(demo_LDADD) $(LIBS) demo05$(EXEEXT): $(demo05_OBJECTS) $(demo05_DEPENDENCIES) $(EXTRA_demo05_DEPENDENCIES) @rm -f demo05$(EXEEXT) $(LINK) $(demo05_OBJECTS) $(demo05_LDADD) $(LIBS) demo06$(EXEEXT): $(demo06_OBJECTS) $(demo06_DEPENDENCIES) $(EXTRA_demo06_DEPENDENCIES) @rm -f demo06$(EXEEXT) $(LINK) $(demo06_OBJECTS) $(demo06_LDADD) $(LIBS) demo27$(EXEEXT): $(demo27_OBJECTS) $(demo27_DEPENDENCIES) $(EXTRA_demo27_DEPENDENCIES) @rm -f demo27$(EXEEXT) $(LINK) $(demo27_OBJECTS) $(demo27_LDADD) $(LIBS) demo33$(EXEEXT): $(demo33_OBJECTS) $(demo33_DEPENDENCIES) $(EXTRA_demo33_DEPENDENCIES) @rm -f demo33$(EXEEXT) $(LINK) $(demo33_OBJECTS) $(demo33_LDADD) $(LIBS) demotest$(EXEEXT): $(demotest_OBJECTS) $(demotest_DEPENDENCIES) $(EXTRA_demotest_DEPENDENCIES) @rm -f demotest$(EXEEXT) $(LINK) $(demotest_OBJECTS) $(demotest_LDADD) $(LIBS) demotest2$(EXEEXT): $(demotest2_OBJECTS) $(demotest2_DEPENDENCIES) $(EXTRA_demotest2_DEPENDENCIES) @rm -f demotest2$(EXEEXT) $(LINK) $(demotest2_OBJECTS) $(demotest2_LDADD) $(LIBS) demotest3$(EXEEXT): $(demotest3_OBJECTS) $(demotest3_DEPENDENCIES) $(EXTRA_demotest3_DEPENDENCIES) @rm -f demotest3$(EXEEXT) $(LINK) $(demotest3_OBJECTS) $(demotest3_LDADD) $(LIBS) dirlist$(EXEEXT): $(dirlist_OBJECTS) $(dirlist_DEPENDENCIES) $(EXTRA_dirlist_DEPENDENCIES) @rm -f dirlist$(EXEEXT) $(LINK) $(dirlist_OBJECTS) $(dirlist_LDADD) $(LIBS) fbrowse$(EXEEXT): $(fbrowse_OBJECTS) $(fbrowse_DEPENDENCIES) $(EXTRA_fbrowse_DEPENDENCIES) @rm -f fbrowse$(EXEEXT) $(LINK) $(fbrowse_OBJECTS) $(fbrowse_LDADD) $(LIBS) fbrowse1$(EXEEXT): $(fbrowse1_OBJECTS) $(fbrowse1_DEPENDENCIES) $(EXTRA_fbrowse1_DEPENDENCIES) @rm -f fbrowse1$(EXEEXT) $(LINK) $(fbrowse1_OBJECTS) $(fbrowse1_LDADD) $(LIBS) fdial$(EXEEXT): $(fdial_OBJECTS) $(fdial_DEPENDENCIES) $(EXTRA_fdial_DEPENDENCIES) @rm -f fdial$(EXEEXT) $(LINK) $(fdial_OBJECTS) $(fdial_LDADD) $(LIBS) flclock$(EXEEXT): $(flclock_OBJECTS) $(flclock_DEPENDENCIES) $(EXTRA_flclock_DEPENDENCIES) @rm -f flclock$(EXEEXT) $(LINK) $(flclock_OBJECTS) $(flclock_LDADD) $(LIBS) folder$(EXEEXT): $(folder_OBJECTS) $(folder_DEPENDENCIES) $(EXTRA_folder_DEPENDENCIES) @rm -f folder$(EXEEXT) $(LINK) $(folder_OBJECTS) $(folder_LDADD) $(LIBS) fonts$(EXEEXT): $(fonts_OBJECTS) $(fonts_DEPENDENCIES) $(EXTRA_fonts_DEPENDENCIES) @rm -f fonts$(EXEEXT) $(LINK) $(fonts_OBJECTS) $(fonts_LDADD) $(LIBS) formbrowser$(EXEEXT): $(formbrowser_OBJECTS) $(formbrowser_DEPENDENCIES) $(EXTRA_formbrowser_DEPENDENCIES) @rm -f formbrowser$(EXEEXT) $(LINK) $(formbrowser_OBJECTS) $(formbrowser_LDADD) $(LIBS) free1$(EXEEXT): $(free1_OBJECTS) $(free1_DEPENDENCIES) $(EXTRA_free1_DEPENDENCIES) @rm -f free1$(EXEEXT) $(LINK) $(free1_OBJECTS) $(free1_LDADD) $(LIBS) freedraw$(EXEEXT): $(freedraw_OBJECTS) $(freedraw_DEPENDENCIES) $(EXTRA_freedraw_DEPENDENCIES) @rm -f freedraw$(EXEEXT) $(LINK) $(freedraw_OBJECTS) $(freedraw_LDADD) $(LIBS) freedraw_leak$(EXEEXT): $(freedraw_leak_OBJECTS) $(freedraw_leak_DEPENDENCIES) $(EXTRA_freedraw_leak_DEPENDENCIES) @rm -f freedraw_leak$(EXEEXT) $(LINK) $(freedraw_leak_OBJECTS) $(freedraw_leak_LDADD) $(LIBS) gl$(EXEEXT): $(gl_OBJECTS) $(gl_DEPENDENCIES) $(EXTRA_gl_DEPENDENCIES) @rm -f gl$(EXEEXT) $(LINK) $(gl_OBJECTS) $(gl_LDADD) $(LIBS) glwin$(EXEEXT): $(glwin_OBJECTS) $(glwin_DEPENDENCIES) $(EXTRA_glwin_DEPENDENCIES) @rm -f glwin$(EXEEXT) $(LINK) $(glwin_OBJECTS) $(glwin_LDADD) $(LIBS) goodies$(EXEEXT): $(goodies_OBJECTS) $(goodies_DEPENDENCIES) $(EXTRA_goodies_DEPENDENCIES) @rm -f goodies$(EXEEXT) $(LINK) $(goodies_OBJECTS) $(goodies_LDADD) $(LIBS) grav$(EXEEXT): $(grav_OBJECTS) $(grav_DEPENDENCIES) $(EXTRA_grav_DEPENDENCIES) @rm -f grav$(EXEEXT) $(LINK) $(grav_OBJECTS) $(grav_LDADD) $(LIBS) group$(EXEEXT): $(group_OBJECTS) $(group_DEPENDENCIES) $(EXTRA_group_DEPENDENCIES) @rm -f group$(EXEEXT) $(LINK) $(group_OBJECTS) $(group_LDADD) $(LIBS) ibrowser$(EXEEXT): $(ibrowser_OBJECTS) $(ibrowser_DEPENDENCIES) $(EXTRA_ibrowser_DEPENDENCIES) @rm -f ibrowser$(EXEEXT) $(LINK) $(ibrowser_OBJECTS) $(ibrowser_LDADD) $(LIBS) iconify$(EXEEXT): $(iconify_OBJECTS) $(iconify_DEPENDENCIES) $(EXTRA_iconify_DEPENDENCIES) @rm -f iconify$(EXEEXT) $(LINK) $(iconify_OBJECTS) $(iconify_LDADD) $(LIBS) iconvert$(EXEEXT): $(iconvert_OBJECTS) $(iconvert_DEPENDENCIES) $(EXTRA_iconvert_DEPENDENCIES) @rm -f iconvert$(EXEEXT) $(LINK) $(iconvert_OBJECTS) $(iconvert_LDADD) $(LIBS) inputall$(EXEEXT): $(inputall_OBJECTS) $(inputall_DEPENDENCIES) $(EXTRA_inputall_DEPENDENCIES) @rm -f inputall$(EXEEXT) $(LINK) $(inputall_OBJECTS) $(inputall_LDADD) $(LIBS) invslider$(EXEEXT): $(invslider_OBJECTS) $(invslider_DEPENDENCIES) $(EXTRA_invslider_DEPENDENCIES) @rm -f invslider$(EXEEXT) $(LINK) $(invslider_OBJECTS) $(invslider_LDADD) $(LIBS) itest$(EXEEXT): $(itest_OBJECTS) $(itest_DEPENDENCIES) $(EXTRA_itest_DEPENDENCIES) @rm -f itest$(EXEEXT) $(LINK) $(itest_OBJECTS) $(itest_LDADD) $(LIBS) lalign$(EXEEXT): $(lalign_OBJECTS) $(lalign_DEPENDENCIES) $(EXTRA_lalign_DEPENDENCIES) @rm -f lalign$(EXEEXT) $(LINK) $(lalign_OBJECTS) $(lalign_LDADD) $(LIBS) ldial$(EXEEXT): $(ldial_OBJECTS) $(ldial_DEPENDENCIES) $(EXTRA_ldial_DEPENDENCIES) @rm -f ldial$(EXEEXT) $(LINK) $(ldial_OBJECTS) $(ldial_LDADD) $(LIBS) ll$(EXEEXT): $(ll_OBJECTS) $(ll_DEPENDENCIES) $(EXTRA_ll_DEPENDENCIES) @rm -f ll$(EXEEXT) $(LINK) $(ll_OBJECTS) $(ll_LDADD) $(LIBS) longlabel$(EXEEXT): $(longlabel_OBJECTS) $(longlabel_DEPENDENCIES) $(EXTRA_longlabel_DEPENDENCIES) @rm -f longlabel$(EXEEXT) $(LINK) $(longlabel_OBJECTS) $(longlabel_LDADD) $(LIBS) menu$(EXEEXT): $(menu_OBJECTS) $(menu_DEPENDENCIES) $(EXTRA_menu_DEPENDENCIES) @rm -f menu$(EXEEXT) $(LINK) $(menu_OBJECTS) $(menu_LDADD) $(LIBS) minput$(EXEEXT): $(minput_OBJECTS) $(minput_DEPENDENCIES) $(EXTRA_minput_DEPENDENCIES) @rm -f minput$(EXEEXT) $(LINK) $(minput_OBJECTS) $(minput_LDADD) $(LIBS) minput2$(EXEEXT): $(minput2_OBJECTS) $(minput2_DEPENDENCIES) $(EXTRA_minput2_DEPENDENCIES) @rm -f minput2$(EXEEXT) $(LINK) $(minput2_OBJECTS) $(minput2_LDADD) $(LIBS) multilabel$(EXEEXT): $(multilabel_OBJECTS) $(multilabel_DEPENDENCIES) $(EXTRA_multilabel_DEPENDENCIES) @rm -f multilabel$(EXEEXT) $(LINK) $(multilabel_OBJECTS) $(multilabel_LDADD) $(LIBS) ndial$(EXEEXT): $(ndial_OBJECTS) $(ndial_DEPENDENCIES) $(EXTRA_ndial_DEPENDENCIES) @rm -f ndial$(EXEEXT) $(LINK) $(ndial_OBJECTS) $(ndial_LDADD) $(LIBS) new_popup$(EXEEXT): $(new_popup_OBJECTS) $(new_popup_DEPENDENCIES) $(EXTRA_new_popup_DEPENDENCIES) @rm -f new_popup$(EXEEXT) $(LINK) $(new_popup_OBJECTS) $(new_popup_LDADD) $(LIBS) newbutton$(EXEEXT): $(newbutton_OBJECTS) $(newbutton_DEPENDENCIES) $(EXTRA_newbutton_DEPENDENCIES) @rm -f newbutton$(EXEEXT) $(LINK) $(newbutton_OBJECTS) $(newbutton_LDADD) $(LIBS) nmenu$(EXEEXT): $(nmenu_OBJECTS) $(nmenu_DEPENDENCIES) $(EXTRA_nmenu_DEPENDENCIES) @rm -f nmenu$(EXEEXT) $(LINK) $(nmenu_OBJECTS) $(nmenu_LDADD) $(LIBS) objinactive$(EXEEXT): $(objinactive_OBJECTS) $(objinactive_DEPENDENCIES) $(EXTRA_objinactive_DEPENDENCIES) @rm -f objinactive$(EXEEXT) $(LINK) $(objinactive_OBJECTS) $(objinactive_LDADD) $(LIBS) objpos$(EXEEXT): $(objpos_OBJECTS) $(objpos_DEPENDENCIES) $(EXTRA_objpos_DEPENDENCIES) @rm -f objpos$(EXEEXT) $(LINK) $(objpos_OBJECTS) $(objpos_LDADD) $(LIBS) objreturn$(EXEEXT): $(objreturn_OBJECTS) $(objreturn_DEPENDENCIES) $(EXTRA_objreturn_DEPENDENCIES) @rm -f objreturn$(EXEEXT) $(LINK) $(objreturn_OBJECTS) $(objreturn_LDADD) $(LIBS) pmbrowse$(EXEEXT): $(pmbrowse_OBJECTS) $(pmbrowse_DEPENDENCIES) $(EXTRA_pmbrowse_DEPENDENCIES) @rm -f pmbrowse$(EXEEXT) $(LINK) $(pmbrowse_OBJECTS) $(pmbrowse_LDADD) $(LIBS) popup$(EXEEXT): $(popup_OBJECTS) $(popup_DEPENDENCIES) $(EXTRA_popup_DEPENDENCIES) @rm -f popup$(EXEEXT) $(LINK) $(popup_OBJECTS) $(popup_LDADD) $(LIBS) positioner$(EXEEXT): $(positioner_OBJECTS) $(positioner_DEPENDENCIES) $(EXTRA_positioner_DEPENDENCIES) @rm -f positioner$(EXEEXT) $(LINK) $(positioner_OBJECTS) $(positioner_LDADD) $(LIBS) positionerXOR$(EXEEXT): $(positionerXOR_OBJECTS) $(positionerXOR_DEPENDENCIES) $(EXTRA_positionerXOR_DEPENDENCIES) @rm -f positionerXOR$(EXEEXT) $(LINK) $(positionerXOR_OBJECTS) $(positionerXOR_LDADD) $(LIBS) positioner_overlay$(EXEEXT): $(positioner_overlay_OBJECTS) $(positioner_overlay_DEPENDENCIES) $(EXTRA_positioner_overlay_DEPENDENCIES) @rm -f positioner_overlay$(EXEEXT) $(LINK) $(positioner_overlay_OBJECTS) $(positioner_overlay_LDADD) $(LIBS) preemptive$(EXEEXT): $(preemptive_OBJECTS) $(preemptive_DEPENDENCIES) $(EXTRA_preemptive_DEPENDENCIES) @rm -f preemptive$(EXEEXT) $(LINK) $(preemptive_OBJECTS) $(preemptive_LDADD) $(LIBS) pup$(EXEEXT): $(pup_OBJECTS) $(pup_DEPENDENCIES) $(EXTRA_pup_DEPENDENCIES) @rm -f pup$(EXEEXT) $(LINK) $(pup_OBJECTS) $(pup_LDADD) $(LIBS) pushbutton$(EXEEXT): $(pushbutton_OBJECTS) $(pushbutton_DEPENDENCIES) $(EXTRA_pushbutton_DEPENDENCIES) @rm -f pushbutton$(EXEEXT) $(LINK) $(pushbutton_OBJECTS) $(pushbutton_LDADD) $(LIBS) pushme$(EXEEXT): $(pushme_OBJECTS) $(pushme_DEPENDENCIES) $(EXTRA_pushme_DEPENDENCIES) @rm -f pushme$(EXEEXT) $(LINK) $(pushme_OBJECTS) $(pushme_LDADD) $(LIBS) rescale$(EXEEXT): $(rescale_OBJECTS) $(rescale_DEPENDENCIES) $(EXTRA_rescale_DEPENDENCIES) @rm -f rescale$(EXEEXT) $(LINK) $(rescale_OBJECTS) $(rescale_LDADD) $(LIBS) scrollbar$(EXEEXT): $(scrollbar_OBJECTS) $(scrollbar_DEPENDENCIES) $(EXTRA_scrollbar_DEPENDENCIES) @rm -f scrollbar$(EXEEXT) $(LINK) $(scrollbar_OBJECTS) $(scrollbar_LDADD) $(LIBS) secretinput$(EXEEXT): $(secretinput_OBJECTS) $(secretinput_DEPENDENCIES) $(EXTRA_secretinput_DEPENDENCIES) @rm -f secretinput$(EXEEXT) $(LINK) $(secretinput_OBJECTS) $(secretinput_LDADD) $(LIBS) select$(EXEEXT): $(select_OBJECTS) $(select_DEPENDENCIES) $(EXTRA_select_DEPENDENCIES) @rm -f select$(EXEEXT) $(LINK) $(select_OBJECTS) $(select_LDADD) $(LIBS) sld_alt$(EXEEXT): $(sld_alt_OBJECTS) $(sld_alt_DEPENDENCIES) $(EXTRA_sld_alt_DEPENDENCIES) @rm -f sld_alt$(EXEEXT) $(LINK) $(sld_alt_OBJECTS) $(sld_alt_LDADD) $(LIBS) sld_radio$(EXEEXT): $(sld_radio_OBJECTS) $(sld_radio_DEPENDENCIES) $(EXTRA_sld_radio_DEPENDENCIES) @rm -f sld_radio$(EXEEXT) $(LINK) $(sld_radio_OBJECTS) $(sld_radio_LDADD) $(LIBS) sldinactive$(EXEEXT): $(sldinactive_OBJECTS) $(sldinactive_DEPENDENCIES) $(EXTRA_sldinactive_DEPENDENCIES) @rm -f sldinactive$(EXEEXT) $(LINK) $(sldinactive_OBJECTS) $(sldinactive_LDADD) $(LIBS) sldsize$(EXEEXT): $(sldsize_OBJECTS) $(sldsize_DEPENDENCIES) $(EXTRA_sldsize_DEPENDENCIES) @rm -f sldsize$(EXEEXT) $(LINK) $(sldsize_OBJECTS) $(sldsize_LDADD) $(LIBS) sliderall$(EXEEXT): $(sliderall_OBJECTS) $(sliderall_DEPENDENCIES) $(EXTRA_sliderall_DEPENDENCIES) @rm -f sliderall$(EXEEXT) $(LINK) $(sliderall_OBJECTS) $(sliderall_LDADD) $(LIBS) strange_button$(EXEEXT): $(strange_button_OBJECTS) $(strange_button_DEPENDENCIES) $(EXTRA_strange_button_DEPENDENCIES) @rm -f strange_button$(EXEEXT) $(LINK) $(strange_button_OBJECTS) $(strange_button_LDADD) $(LIBS) strsize$(EXEEXT): $(strsize_OBJECTS) $(strsize_DEPENDENCIES) $(EXTRA_strsize_DEPENDENCIES) @rm -f strsize$(EXEEXT) $(LINK) $(strsize_OBJECTS) $(strsize_LDADD) $(LIBS) symbols$(EXEEXT): $(symbols_OBJECTS) $(symbols_DEPENDENCIES) $(EXTRA_symbols_DEPENDENCIES) @rm -f symbols$(EXEEXT) $(LINK) $(symbols_OBJECTS) $(symbols_LDADD) $(LIBS) thumbwheel$(EXEEXT): $(thumbwheel_OBJECTS) $(thumbwheel_DEPENDENCIES) $(EXTRA_thumbwheel_DEPENDENCIES) @rm -f thumbwheel$(EXEEXT) $(LINK) $(thumbwheel_OBJECTS) $(thumbwheel_LDADD) $(LIBS) timeoutprec$(EXEEXT): $(timeoutprec_OBJECTS) $(timeoutprec_DEPENDENCIES) $(EXTRA_timeoutprec_DEPENDENCIES) @rm -f timeoutprec$(EXEEXT) $(LINK) $(timeoutprec_OBJECTS) $(timeoutprec_LDADD) $(LIBS) timer$(EXEEXT): $(timer_OBJECTS) $(timer_DEPENDENCIES) $(EXTRA_timer_DEPENDENCIES) @rm -f timer$(EXEEXT) $(LINK) $(timer_OBJECTS) $(timer_LDADD) $(LIBS) timerprec$(EXEEXT): $(timerprec_OBJECTS) $(timerprec_DEPENDENCIES) $(EXTRA_timerprec_DEPENDENCIES) @rm -f timerprec$(EXEEXT) $(LINK) $(timerprec_OBJECTS) $(timerprec_LDADD) $(LIBS) touchbutton$(EXEEXT): $(touchbutton_OBJECTS) $(touchbutton_DEPENDENCIES) $(EXTRA_touchbutton_DEPENDENCIES) @rm -f touchbutton$(EXEEXT) $(LINK) $(touchbutton_OBJECTS) $(touchbutton_LDADD) $(LIBS) xyplotactive$(EXEEXT): $(xyplotactive_OBJECTS) $(xyplotactive_DEPENDENCIES) $(EXTRA_xyplotactive_DEPENDENCIES) @rm -f xyplotactive$(EXEEXT) $(LINK) $(xyplotactive_OBJECTS) $(xyplotactive_LDADD) $(LIBS) xyplotactivelog$(EXEEXT): $(xyplotactivelog_OBJECTS) $(xyplotactivelog_DEPENDENCIES) $(EXTRA_xyplotactivelog_DEPENDENCIES) @rm -f xyplotactivelog$(EXEEXT) $(LINK) $(xyplotactivelog_OBJECTS) $(xyplotactivelog_LDADD) $(LIBS) xyplotall$(EXEEXT): $(xyplotall_OBJECTS) $(xyplotall_DEPENDENCIES) $(EXTRA_xyplotall_DEPENDENCIES) @rm -f xyplotall$(EXEEXT) $(LINK) $(xyplotall_OBJECTS) $(xyplotall_LDADD) $(LIBS) xyplotover$(EXEEXT): $(xyplotover_OBJECTS) $(xyplotover_DEPENDENCIES) $(EXTRA_xyplotover_DEPENDENCIES) @rm -f xyplotover$(EXEEXT) $(LINK) $(xyplotover_OBJECTS) $(xyplotover_LDADD) $(LIBS) yesno$(EXEEXT): $(yesno_OBJECTS) $(yesno_DEPENDENCIES) $(EXTRA_yesno_DEPENDENCIES) @rm -f yesno$(EXEEXT) $(LINK) $(yesno_OBJECTS) $(yesno_LDADD) $(LIBS) yesno_cb$(EXEEXT): $(yesno_cb_OBJECTS) $(yesno_cb_DEPENDENCIES) $(EXTRA_yesno_cb_DEPENDENCIES) @rm -f yesno_cb$(EXEEXT) $(LINK) $(yesno_cb_OBJECTS) $(yesno_cb_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arrowbutton.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/borderwidth.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/boxtype.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/browserall.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/browserop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buttonall.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buttons_gui.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/butttypes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/butttypes_gui.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/canvas.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chartall.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chartstrip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/choice.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colbrowser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colsel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colsel1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/counter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crossbut.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cursor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo05.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo06.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo27.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo33.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demotest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demotest2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demotest3.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirlist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fbrowse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fbrowse1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fbtest_gui.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdial.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flclock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/folder.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/folder_gui.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fonts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/formbrowser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/formbrowser_gui.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/free1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freedraw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freedraw_leak.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glwin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goodies.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grav.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/group.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ibrowser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconify.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconvert.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inputall.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inputall_gui.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/invslider.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/itest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lalign.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldial.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/longlabel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/menu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minput2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multilabel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ndial.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/new_popup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newbutton.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmenu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objinactive.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objpos.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objreturn.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmbrowse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmbrowse_gui.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/popup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/positioner.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/positionerXOR.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/positioner_overlay.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preemptive.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pushbutton.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pushme.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rescale.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scrollbar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scrollbar_gui.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secretinput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sld_alt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sld_radio.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sldinactive.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sldsize.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sliderall.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strange_button.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strsize.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symbols.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thumbwheel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timeoutprec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timerprec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/touchbutton.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twheel_gui.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xyplotactive.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xyplotactivelog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xyplotall.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xyplotover.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yesno.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yesno_cb.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< buttons_gui.o: fd/buttons_gui.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT buttons_gui.o -MD -MP -MF $(DEPDIR)/buttons_gui.Tpo -c -o buttons_gui.o `test -f 'fd/buttons_gui.c' || echo '$(srcdir)/'`fd/buttons_gui.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/buttons_gui.Tpo $(DEPDIR)/buttons_gui.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fd/buttons_gui.c' object='buttons_gui.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o buttons_gui.o `test -f 'fd/buttons_gui.c' || echo '$(srcdir)/'`fd/buttons_gui.c buttons_gui.obj: fd/buttons_gui.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT buttons_gui.obj -MD -MP -MF $(DEPDIR)/buttons_gui.Tpo -c -o buttons_gui.obj `if test -f 'fd/buttons_gui.c'; then $(CYGPATH_W) 'fd/buttons_gui.c'; else $(CYGPATH_W) '$(srcdir)/fd/buttons_gui.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/buttons_gui.Tpo $(DEPDIR)/buttons_gui.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fd/buttons_gui.c' object='buttons_gui.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o buttons_gui.obj `if test -f 'fd/buttons_gui.c'; then $(CYGPATH_W) 'fd/buttons_gui.c'; else $(CYGPATH_W) '$(srcdir)/fd/buttons_gui.c'; fi` butttypes_gui.o: fd/butttypes_gui.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT butttypes_gui.o -MD -MP -MF $(DEPDIR)/butttypes_gui.Tpo -c -o butttypes_gui.o `test -f 'fd/butttypes_gui.c' || echo '$(srcdir)/'`fd/butttypes_gui.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/butttypes_gui.Tpo $(DEPDIR)/butttypes_gui.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fd/butttypes_gui.c' object='butttypes_gui.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o butttypes_gui.o `test -f 'fd/butttypes_gui.c' || echo '$(srcdir)/'`fd/butttypes_gui.c butttypes_gui.obj: fd/butttypes_gui.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT butttypes_gui.obj -MD -MP -MF $(DEPDIR)/butttypes_gui.Tpo -c -o butttypes_gui.obj `if test -f 'fd/butttypes_gui.c'; then $(CYGPATH_W) 'fd/butttypes_gui.c'; else $(CYGPATH_W) '$(srcdir)/fd/butttypes_gui.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/butttypes_gui.Tpo $(DEPDIR)/butttypes_gui.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fd/butttypes_gui.c' object='butttypes_gui.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o butttypes_gui.obj `if test -f 'fd/butttypes_gui.c'; then $(CYGPATH_W) 'fd/butttypes_gui.c'; else $(CYGPATH_W) '$(srcdir)/fd/butttypes_gui.c'; fi` folder_gui.o: fd/folder_gui.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT folder_gui.o -MD -MP -MF $(DEPDIR)/folder_gui.Tpo -c -o folder_gui.o `test -f 'fd/folder_gui.c' || echo '$(srcdir)/'`fd/folder_gui.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/folder_gui.Tpo $(DEPDIR)/folder_gui.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fd/folder_gui.c' object='folder_gui.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o folder_gui.o `test -f 'fd/folder_gui.c' || echo '$(srcdir)/'`fd/folder_gui.c folder_gui.obj: fd/folder_gui.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT folder_gui.obj -MD -MP -MF $(DEPDIR)/folder_gui.Tpo -c -o folder_gui.obj `if test -f 'fd/folder_gui.c'; then $(CYGPATH_W) 'fd/folder_gui.c'; else $(CYGPATH_W) '$(srcdir)/fd/folder_gui.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/folder_gui.Tpo $(DEPDIR)/folder_gui.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fd/folder_gui.c' object='folder_gui.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o folder_gui.obj `if test -f 'fd/folder_gui.c'; then $(CYGPATH_W) 'fd/folder_gui.c'; else $(CYGPATH_W) '$(srcdir)/fd/folder_gui.c'; fi` fbtest_gui.o: fd/fbtest_gui.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fbtest_gui.o -MD -MP -MF $(DEPDIR)/fbtest_gui.Tpo -c -o fbtest_gui.o `test -f 'fd/fbtest_gui.c' || echo '$(srcdir)/'`fd/fbtest_gui.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/fbtest_gui.Tpo $(DEPDIR)/fbtest_gui.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fd/fbtest_gui.c' object='fbtest_gui.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fbtest_gui.o `test -f 'fd/fbtest_gui.c' || echo '$(srcdir)/'`fd/fbtest_gui.c fbtest_gui.obj: fd/fbtest_gui.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fbtest_gui.obj -MD -MP -MF $(DEPDIR)/fbtest_gui.Tpo -c -o fbtest_gui.obj `if test -f 'fd/fbtest_gui.c'; then $(CYGPATH_W) 'fd/fbtest_gui.c'; else $(CYGPATH_W) '$(srcdir)/fd/fbtest_gui.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/fbtest_gui.Tpo $(DEPDIR)/fbtest_gui.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fd/fbtest_gui.c' object='fbtest_gui.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fbtest_gui.obj `if test -f 'fd/fbtest_gui.c'; then $(CYGPATH_W) 'fd/fbtest_gui.c'; else $(CYGPATH_W) '$(srcdir)/fd/fbtest_gui.c'; fi` formbrowser_gui.o: fd/formbrowser_gui.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT formbrowser_gui.o -MD -MP -MF $(DEPDIR)/formbrowser_gui.Tpo -c -o formbrowser_gui.o `test -f 'fd/formbrowser_gui.c' || echo '$(srcdir)/'`fd/formbrowser_gui.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/formbrowser_gui.Tpo $(DEPDIR)/formbrowser_gui.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fd/formbrowser_gui.c' object='formbrowser_gui.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o formbrowser_gui.o `test -f 'fd/formbrowser_gui.c' || echo '$(srcdir)/'`fd/formbrowser_gui.c formbrowser_gui.obj: fd/formbrowser_gui.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT formbrowser_gui.obj -MD -MP -MF $(DEPDIR)/formbrowser_gui.Tpo -c -o formbrowser_gui.obj `if test -f 'fd/formbrowser_gui.c'; then $(CYGPATH_W) 'fd/formbrowser_gui.c'; else $(CYGPATH_W) '$(srcdir)/fd/formbrowser_gui.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/formbrowser_gui.Tpo $(DEPDIR)/formbrowser_gui.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fd/formbrowser_gui.c' object='formbrowser_gui.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o formbrowser_gui.obj `if test -f 'fd/formbrowser_gui.c'; then $(CYGPATH_W) 'fd/formbrowser_gui.c'; else $(CYGPATH_W) '$(srcdir)/fd/formbrowser_gui.c'; fi` inputall_gui.o: fd/inputall_gui.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT inputall_gui.o -MD -MP -MF $(DEPDIR)/inputall_gui.Tpo -c -o inputall_gui.o `test -f 'fd/inputall_gui.c' || echo '$(srcdir)/'`fd/inputall_gui.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/inputall_gui.Tpo $(DEPDIR)/inputall_gui.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fd/inputall_gui.c' object='inputall_gui.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o inputall_gui.o `test -f 'fd/inputall_gui.c' || echo '$(srcdir)/'`fd/inputall_gui.c inputall_gui.obj: fd/inputall_gui.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT inputall_gui.obj -MD -MP -MF $(DEPDIR)/inputall_gui.Tpo -c -o inputall_gui.obj `if test -f 'fd/inputall_gui.c'; then $(CYGPATH_W) 'fd/inputall_gui.c'; else $(CYGPATH_W) '$(srcdir)/fd/inputall_gui.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/inputall_gui.Tpo $(DEPDIR)/inputall_gui.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fd/inputall_gui.c' object='inputall_gui.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o inputall_gui.obj `if test -f 'fd/inputall_gui.c'; then $(CYGPATH_W) 'fd/inputall_gui.c'; else $(CYGPATH_W) '$(srcdir)/fd/inputall_gui.c'; fi` pmbrowse_gui.o: fd/pmbrowse_gui.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pmbrowse_gui.o -MD -MP -MF $(DEPDIR)/pmbrowse_gui.Tpo -c -o pmbrowse_gui.o `test -f 'fd/pmbrowse_gui.c' || echo '$(srcdir)/'`fd/pmbrowse_gui.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/pmbrowse_gui.Tpo $(DEPDIR)/pmbrowse_gui.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fd/pmbrowse_gui.c' object='pmbrowse_gui.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pmbrowse_gui.o `test -f 'fd/pmbrowse_gui.c' || echo '$(srcdir)/'`fd/pmbrowse_gui.c pmbrowse_gui.obj: fd/pmbrowse_gui.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pmbrowse_gui.obj -MD -MP -MF $(DEPDIR)/pmbrowse_gui.Tpo -c -o pmbrowse_gui.obj `if test -f 'fd/pmbrowse_gui.c'; then $(CYGPATH_W) 'fd/pmbrowse_gui.c'; else $(CYGPATH_W) '$(srcdir)/fd/pmbrowse_gui.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/pmbrowse_gui.Tpo $(DEPDIR)/pmbrowse_gui.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fd/pmbrowse_gui.c' object='pmbrowse_gui.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pmbrowse_gui.obj `if test -f 'fd/pmbrowse_gui.c'; then $(CYGPATH_W) 'fd/pmbrowse_gui.c'; else $(CYGPATH_W) '$(srcdir)/fd/pmbrowse_gui.c'; fi` scrollbar_gui.o: fd/scrollbar_gui.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT scrollbar_gui.o -MD -MP -MF $(DEPDIR)/scrollbar_gui.Tpo -c -o scrollbar_gui.o `test -f 'fd/scrollbar_gui.c' || echo '$(srcdir)/'`fd/scrollbar_gui.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/scrollbar_gui.Tpo $(DEPDIR)/scrollbar_gui.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fd/scrollbar_gui.c' object='scrollbar_gui.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o scrollbar_gui.o `test -f 'fd/scrollbar_gui.c' || echo '$(srcdir)/'`fd/scrollbar_gui.c scrollbar_gui.obj: fd/scrollbar_gui.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT scrollbar_gui.obj -MD -MP -MF $(DEPDIR)/scrollbar_gui.Tpo -c -o scrollbar_gui.obj `if test -f 'fd/scrollbar_gui.c'; then $(CYGPATH_W) 'fd/scrollbar_gui.c'; else $(CYGPATH_W) '$(srcdir)/fd/scrollbar_gui.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/scrollbar_gui.Tpo $(DEPDIR)/scrollbar_gui.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fd/scrollbar_gui.c' object='scrollbar_gui.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o scrollbar_gui.obj `if test -f 'fd/scrollbar_gui.c'; then $(CYGPATH_W) 'fd/scrollbar_gui.c'; else $(CYGPATH_W) '$(srcdir)/fd/scrollbar_gui.c'; fi` twheel_gui.o: fd/twheel_gui.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT twheel_gui.o -MD -MP -MF $(DEPDIR)/twheel_gui.Tpo -c -o twheel_gui.o `test -f 'fd/twheel_gui.c' || echo '$(srcdir)/'`fd/twheel_gui.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/twheel_gui.Tpo $(DEPDIR)/twheel_gui.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fd/twheel_gui.c' object='twheel_gui.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o twheel_gui.o `test -f 'fd/twheel_gui.c' || echo '$(srcdir)/'`fd/twheel_gui.c twheel_gui.obj: fd/twheel_gui.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT twheel_gui.obj -MD -MP -MF $(DEPDIR)/twheel_gui.Tpo -c -o twheel_gui.obj `if test -f 'fd/twheel_gui.c'; then $(CYGPATH_W) 'fd/twheel_gui.c'; else $(CYGPATH_W) '$(srcdir)/fd/twheel_gui.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/twheel_gui.Tpo $(DEPDIR)/twheel_gui.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fd/twheel_gui.c' object='twheel_gui.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o twheel_gui.obj `if test -f 'fd/twheel_gui.c'; then $(CYGPATH_W) 'fd/twheel_gui.c'; else $(CYGPATH_W) '$(srcdir)/fd/twheel_gui.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ clean-noinstPROGRAMS ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am buttonall.$(OBJEXT): fd/buttons_gui.c butttypes.$(OBJEXT): fd/butttypes_gui.c demotest.$(OBJEXT): fd/folder_gui.c dirlist.$(OBJEXT): fd/fbtest_gui.c folder.$(OBJEXT): fd/folder_gui.c formbrowser.$(OBJEXT): fd/formbrowser_gui.c ibrowser.$(OBJEXT): fd/ibrowser_gui.c inputall.$(OBJEXT): fd/inputall_gui.c itest.$(OBJEXT): fd/is_gui.c pmbrowse.$(OBJEXT): fd/pmbrowse_gui.c scrollbar.$(OBJEXT): fd/scrollbar_gui.c thumbwheel.$(OBJEXT): fd/twheel_gui.c .fd.c: ../fdesign/fdesign ../fdesign/fdesign -convert -dir $(top_srcdir)/demos/fd -I \"include/forms.h\" $< # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xforms-1.2.4/demos/newmail.xbm0000644000175000017500000000534511665175604013252 00000000000000#define /home/zhao/xforms/DEMOS/newmail_width 64 #define /home/zhao/xforms/DEMOS/newmail_height 64 static char /home/zhao/xforms/DEMOS/newmail_bits[] = { 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00, 0x00,0x80,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x00,0x00,0x00, 0x00,0x00,0x00,0x80,0x01,0x00,0x00,0x80,0x07,0x00,0x00,0x80,0x01,0x00, 0x00,0x70,0x38,0x00,0x00,0x80,0x01,0x00,0x00,0x0e,0xc0,0x00,0x00,0x80, 0x01,0x00,0xc0,0x01,0x00,0x01,0x00,0x80,0x01,0x00,0x38,0x00,0x20,0x02, 0x00,0x80,0x01,0x00,0x06,0x00,0x38,0x04,0x00,0x80,0x01,0xc0,0x1f,0x00, 0x3e,0x04,0x00,0x80,0x01,0x30,0x60,0x80,0x3f,0x08,0x00,0x80,0x01,0x08, 0x80,0x80,0x3f,0x08,0x00,0x80,0x01,0x04,0x07,0x81,0x3f,0x10,0x00,0x80, 0x01,0x82,0x0f,0x82,0x3f,0x10,0x00,0x80,0x01,0x82,0x0f,0x82,0x1f,0x10, 0x00,0x80,0x01,0x01,0x07,0x84,0x07,0x20,0x00,0x80,0x01,0x01,0x00,0x84, 0x01,0x20,0x00,0x80,0x81,0x00,0x00,0x88,0x00,0x20,0x00,0x80,0x81,0x40, 0x00,0x88,0x00,0x20,0x00,0x80,0x81,0xa0,0x00,0x88,0x00,0x20,0x00,0x80, 0x81,0x12,0xa3,0x88,0x00,0x20,0x00,0x80,0x41,0x4e,0xa6,0x90,0x00,0x20, 0x00,0x80,0x41,0xa6,0xac,0x90,0x01,0x20,0x00,0x80,0x41,0x42,0xa9,0x90, 0x01,0x20,0x00,0x80,0x41,0x81,0xb0,0x10,0x00,0x20,0x00,0x80,0xc1,0x00, 0xa0,0x17,0x00,0x20,0x00,0x80,0x41,0x01,0x40,0x10,0x00,0x20,0x00,0x80, 0x41,0x02,0x82,0x10,0x00,0x20,0x00,0x80,0x41,0x06,0x05,0x17,0x00,0x20, 0x00,0x80,0x41,0x88,0x0a,0x12,0x00,0x30,0x00,0x80,0x41,0xfe,0xff,0x17, 0x00,0x3c,0x0e,0x80,0x41,0x00,0x00,0x10,0x00,0x0f,0x11,0x80,0x41,0x00, 0x00,0x10,0xc0,0x1b,0x11,0x80,0x41,0x00,0x00,0x10,0xf0,0xe4,0x10,0x80, 0x41,0x00,0x00,0x10,0x3c,0x84,0x08,0x80,0x41,0x00,0x00,0x10,0x0f,0x88, 0x3c,0x80,0x41,0x00,0x00,0xd0,0x03,0xf0,0x43,0x80,0x41,0x00,0x00,0xf0, 0x01,0x8c,0x43,0x80,0xc1,0xff,0xff,0x3f,0x01,0x82,0x24,0x80,0xc1,0xff, 0xff,0x1f,0x01,0x82,0x18,0x80,0x01,0x00,0x02,0x02,0x01,0xfc,0x08,0x80, 0x01,0x00,0x02,0x02,0x01,0x20,0x09,0x80,0x01,0x00,0x02,0x02,0x01,0x10, 0x06,0x80,0x01,0x00,0x02,0x02,0x01,0x10,0x00,0x80,0x01,0x00,0x02,0x02, 0x01,0x08,0x00,0x80,0x01,0x00,0x02,0x02,0x01,0x08,0x00,0x80,0x01,0x00, 0x02,0x02,0x01,0xb4,0x3f,0x80,0x01,0x00,0x02,0x02,0x01,0x0e,0x28,0x80, 0x01,0x00,0x02,0x02,0x01,0x03,0x16,0x80,0x01,0x00,0x02,0x02,0x81,0xc0, 0x11,0x80,0x01,0x00,0x02,0x02,0x41,0x38,0x08,0x80,0x01,0x00,0x02,0x02, 0x21,0x04,0x04,0x80,0x01,0x00,0x02,0x02,0x11,0x03,0x02,0x80,0x01,0x00, 0x02,0x02,0xc9,0x80,0x01,0x80,0x01,0x00,0x02,0x02,0x25,0x60,0x00,0x80, 0x01,0x00,0x02,0x02,0x13,0x18,0x00,0x80,0x01,0x00,0x02,0x02,0x01,0x07, 0x00,0x80,0x01,0x00,0x02,0xc2,0xfe,0x00,0x00,0x80,0x01,0x00,0x02,0x32, 0x00,0x00,0x00,0x80,0x01,0x00,0x02,0x0e,0x00,0x00,0x00,0x80,0x01,0x00, 0xfe,0x03,0x00,0x00,0x00,0x80,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x80, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; xforms-1.2.4/demos/crab_tran.xpm0000644000175000017500000000376511665175600013567 00000000000000/* XPM */ static char * crab[] = { /* crab pixmap * width height ncolors chars_per_pixel */ "28 28 6 2 ", ". c None m white s None ", "x c orange m black s s_orange ", "* c #ff72c2 m black s s_#ff72c2 ", "+ c red m white s s_SteelBlue ", "G c black m black s s_black ", "a c LightGrey m white s s_LightGrey ", /* pixels */ ". . . . . . * * * * . . . . . . . . . * * * * . . . . . ", ". . . . + * x x * . . . . . . . . . . + * x x * . . . . ", ". . . + * x x * . . . . . . . . . . . . + * x x * . . . ", ". . + * x * . . . * . . . . . . . . . * . . + * x * . . ", ". . + * x * . . + * . . . . . . . . + * . . + * x * . . ", ". . + * x * . + * * . . . . . . . . + * * . + * x * . . ", ". . + * x * + * * . . . . . . . . . . + * * + * x * . . ", ". . + * x * * * . . . . . . . . . . . . + * * x x * . . ", ". . . + * x * . . + * . . . . . . + * . . + * x * . . . ", ". . . + * x . . + * . + * * . * * . + * . . + x * . . . ", ". . . . + x . . + * . + * * . * * . + * . . + x . . . . ", ". . . . + x . . . + * + * * * * * + * . . . + x . . . . ", ". . . . + * x . . + * * * * * * * * * . . + x * . . . . ", ". . . . . + * x * * * * x x x x x * * * * x * . . . . . ", ". . . . + + + * * x x x x x x x x x x x x * . . . . . . ", ". . + + * x x x x x x x x x x x x x x x x x x * x . . . ", ". + * x x a + * * x x x x x x x x x x x * * a G * x * . ", "+ * x . . . + * * x x x x x x x x x x x * * G . . . x * ", ". . . . . . + * * x x x x x x x x x x x * * . . . . . . ", ". . . . . + * * x x x x x x x x x x x x x * * . . . . . ", ". . . + * x x x * x x x x x x x x x x x * x x x * . . . ", ". . + * x a a + * * x x x x x x x x x * * a a a x * . . ", ". + * x G G G + * * x x x x x x x x x * * a G G G x * . ", ". + * G . . . + * x * x x x x x x x * x * a G . . . * . ", ". . . . . . + * x a * * * x x x * * * a x * G . . . . . ", ". . . . . + * x a G a a * * * * * a a G a x * G . . . . ", ". . . . . + x a G . G G a a a a a G G . G G x a G . . . ", ". . . . . + x a G . . . G G G G G . . . . . x a G . . . " } ; xforms-1.2.4/demos/fdial.c0000664000175000017500000000733012353623325012320 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* This is an example of the use of filled dials, dial range * and dial direction. * * T.C. Zhao and M. Overmars */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" FL_FORM *form; FL_OBJECT *button, *red, *green, *blue, *redtext, *greentext, *bluetext, *result; /*************************************** ***************************************/ void makeform( void ) { form = fl_bgn_form( FL_UP_BOX, 300, 330 ); button = fl_add_button( FL_NORMAL_BUTTON, 45, 15, 210, 45, "A Color Editor" ); fl_set_object_lsize( button, FL_LARGE_SIZE ); red = fl_add_dial( FL_FILL_DIAL, 30, 240, 60, 60, "Red" ); fl_set_dial_bounds( red, 0.0, 255.0 ); fl_set_dial_value( red, 128.0 ); fl_set_object_color( red, FL_DIAL_COL1, FL_RED ); fl_set_object_return( red, FL_RETURN_CHANGED ); redtext = fl_add_box( FL_DOWN_BOX, 105, 255, 50, 25, "" ); green = fl_add_dial( FL_FILL_DIAL, 30, 155, 60, 60, "Green" ); fl_set_dial_bounds( green, 0.0, 255.0 ); fl_set_dial_value( green, 128.0 ); fl_set_dial_angles( green, 45.0, 360 - 45.0 ); fl_set_object_color( green, FL_DIAL_COL1, FL_GREEN ); fl_set_object_return( green, FL_RETURN_CHANGED ); greentext = fl_add_box( FL_DOWN_BOX, 105, 170, 50, 25,"" ); blue = fl_add_dial( FL_FILL_DIAL, 30, 70, 60, 60, "Blue" ); fl_set_dial_bounds( blue, 0.0, 255.0 ); fl_set_dial_value( blue, 128.0 ); fl_set_object_color( blue, FL_DIAL_COL1, FL_BLUE ); fl_set_dial_direction( blue, FL_DIAL_CCW ); fl_set_object_return( blue, FL_RETURN_CHANGED ); bluetext = fl_add_box( FL_DOWN_BOX, 105, 90, 50, 25, "" ); result = fl_add_box( FL_DOWN_BOX, 180, 70, 90, 245, "" ); fl_set_object_color( result, FL_FREE_COL1, FL_FREE_COL1 ); fl_set_object_dblbuffer( result, 1 ); fl_end_form( ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_OBJECT *ret; int r, g, b; char str[ 100 ]; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); makeform( ); fl_show_form( form, FL_PLACE_MOUSE, FL_TRANSIENT, "A Form" ); do { r = fl_get_dial_value( red ) + 0.001; g = fl_get_dial_value( green ) + 0.001; b = fl_get_dial_value( blue ) + 0.001; fl_freeze_form( form ); fl_mapcolor( FL_FREE_COL1, r, g, b ); sprintf( str, "%d", r ); fl_set_object_label( redtext, str ); sprintf( str, "%d", g ); fl_set_object_label( greentext, str ); sprintf( str, "%d", b ); fl_set_object_label( bluetext, str ); fl_unfreeze_form( form ); ret = fl_do_forms( ); } while ( ret != button ); fl_hide_form( form ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/group.c0000644000175000017500000002404012251643717012374 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Demo showing the use of groups * * T.C. Zhao and M. Overmars */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "porsche.xpm" #include "nomail.xbm" #include "bm1.xbm" extern void show_group( FL_OBJECT *, long ); /**** Forms and Objects ****/ #define NGROUP 4 typedef struct { FL_FORM * objsform; void * vdata; char * cdata; long ldata; FL_OBJECT * bitbutton; FL_OBJECT * pixbutton; FL_OBJECT * bit; FL_OBJECT * pix; FL_OBJECT * chart; FL_OBJECT * quit; FL_OBJECT * menu; FL_OBJECT * choice; FL_OBJECT * browser; FL_OBJECT * xyplot; FL_OBJECT * button[ 5 ]; FL_OBJECT * group[ 5 ]; } FD_objsform; extern FD_objsform *create_form_objsform( void ); FD_objsform *fd_objsform; /* callbacks for form objsform */ /*************************************** ***************************************/ void show_group( FL_OBJECT * ob FL_UNUSED_ARG, long data ) { int i; for ( i = 0; i <= NGROUP;i++) ( i == data ? fl_show_object : fl_hide_object )( fd_objsform->group[ i ] ); } /*************************************** ***************************************/ void init_gui( FD_objsform *fd ) { float x[ ] = { 0, 1, 2, 3, 4, 5 }; float y[ ] = { 5.5, 4, 4.5, 3.8, 4, 5}; char *label[ ] = { "Mon", "Tue", "Wed", "Thur", "Fri", "Sat" }; size_t i; fl_addto_menu( fd->menu, "One\tF1|Two\tF2|Three\tF3|Four\tF4" ); fl_addto_choice( fd->choice, "Option1|Option2|Option3" ); fl_set_pixmapbutton_data( fd->pixbutton, porsche ); fl_set_pixmap_data( fd->pix, porsche ); fl_set_bitmapbutton_data( fd->bitbutton, bm1_width, bm1_height, bm1_bits ); fl_set_bitmap_data( fd->bit, nomail_width, nomail_height, nomail_bits ); fl_set_browser_fontsize( fd->browser, FL_NORMAL_SIZE ); fl_addto_browser( fd->browser, "browser line 1\nbrowser line 2" ); fl_addto_browser( fd->browser, "browser line 3\nbrowser line 4" ); fl_addto_browser( fd->browser, "browser line 5\nbrowser line 6" ); fl_addto_browser( fd->browser, "browser line 7\nbrowser line 8" ); fl_addto_browser( fd->browser, "browser line 9\nbrowser line 10" ); fl_addto_browser( fd->browser, "browser line 11\nbrowser line 12" ); fl_addto_browser( fd->browser, "browser line 13\nbrowser line 14" ); fl_addto_browser( fd->browser, "browser line 15\nbrowser line 16" ); fl_addto_browser( fd->browser, "browser line 17\nbrowser line 18" ); for ( i = 0; i < sizeof y / sizeof *y; i++ ) fl_add_chart_value( fd->chart, y[ i ], label[ i ], i + 1 ); fl_set_xyplot_data( fd->xyplot, x, y, 6, "", "","" ); fl_add_xyplot_overlay( fd->xyplot, 1, x, y, 6, FL_RED ); fl_add_xyplot_text( fd->xyplot, 2.5, 5.2, "Weekly Summary", FL_ALIGN_CENTER, FL_BLUE ); fl_add_xyplot_text( fd->xyplot, 3, 3.85, "@-22->", FL_ALIGN_TOP, FL_RED ); fl_set_xyplot_overlay_type( fd->xyplot, 1, FL_NORMAL_XYPLOT ); fl_set_xyplot_alphaxtics( fd->xyplot, "Mon|Tue|Wed|Thu|Fri|Sat", 0 ); fl_set_xyplot_ytics( fd->xyplot, -1, -1 ); fl_set_xyplot_linewidth( fd->xyplot, 0, 3 ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_initialize( &argc, argv, 0, 0, 0 ); fd_objsform = create_form_objsform( ); init_gui( fd_objsform ); /* fill-in form initialization code */ fl_set_button( fd_objsform->button[ 0 ], 1 ); show_group( 0, 0 ); /* show the first form */ fl_show_form( fd_objsform->objsform, FL_PLACE_CENTER, FL_FULLBORDER, "objsform" ); while ( fl_do_forms( ) != fd_objsform->quit ) /* empty */ ; fl_finish( ); return 0; } /* Form definition file generated with fdesign. */ #include /*************************************** ***************************************/ FD_objsform * create_form_objsform( void ) { FL_OBJECT *obj; FD_objsform *fdui = fl_calloc( 1, sizeof *fdui ); fdui->objsform = fl_bgn_form( FL_NO_BOX, 456, 361 ); fl_add_box( FL_FLAT_BOX, 0, 0, 456, 361, "" ); fl_add_box( FL_UP_BOX, 0, 0, 455, 360, "" ); fl_add_box( FL_UP_BOX, 0, 0, 456, 70, "" ); fdui->button[ 0 ] = obj = fl_add_button( FL_RADIO_BUTTON, 15, 20, 75, 30, "Static" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE); fl_set_object_lstyle( obj, FL_TIMESBOLD_STYLE ); fl_set_object_callback( obj, show_group, 0 ); fdui->button[ 1 ] = obj = fl_add_button( FL_RADIO_BUTTON, 90, 20, 75, 30, "Button" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lstyle( obj, FL_TIMESBOLD_STYLE ); fl_set_object_callback( obj, show_group, 1 ); fdui->button[ 2 ] = obj = fl_add_button( FL_RADIO_BUTTON, 165, 20, 70, 30, "Valuator" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lstyle( obj, FL_TIMESBOLD_STYLE ); fl_set_object_callback( obj, show_group, 2 ); fdui->button[ 3 ] = obj = fl_add_button( FL_RADIO_BUTTON, 235, 20, 70, 30, "Input" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lstyle( obj, FL_TIMESBOLD_STYLE ); fl_set_object_callback( obj, show_group, 3 ); fdui->button[ 4 ] = obj = fl_add_button( FL_RADIO_BUTTON, 305, 20, 70, 30, "Other" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lstyle( obj, FL_TIMESBOLD_STYLE ); fl_set_object_callback( obj, show_group, 4 ); fl_add_box( FL_UP_BOX, 0, 70, 456, 291, "" ); fl_add_box( FL_DOWN_BOX, 9, 90, 435, 260, "" ); fdui->group[ 2 ] = fl_bgn_group( ); obj = fl_add_text( FL_NORMAL_TEXT, 260, 140, 80, 30, "Text" ); fl_set_object_lalign( obj, fl_to_inside_lalign( FL_ALIGN_LEFT ) ); fl_add_slider( FL_HOR_BROWSER_SLIDER, 60, 120, 170, 25, "" ); obj = fl_add_slider( FL_HOR_FILL_SLIDER, 60, 160, 170, 30, "" ); fl_set_slider_value( obj, 0.54 ); obj = fl_add_slider( FL_VERT_SLIDER, 390, 110, 30, 170, "" ); fl_set_slider_value( obj, 0.48 ); fl_add_valslider( FL_VERT_SLIDER, 350, 110, 30, 170, "" ); obj = fl_add_dial( FL_FILL_DIAL, 50, 220, 90, 70, "" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_add_positioner( FL_NORMAL_POSITIONER, 150, 210,120, 100, "" ); fl_add_counter( FL_NORMAL_COUNTER, 300, 300, 130, 30, "" ); fl_end_group( ); fdui->group[ 1 ] = fl_bgn_group( ); fdui->bitbutton = fl_add_bitmapbutton( FL_NORMAL_BUTTON, 60, 250, 50, 40, "" ); fdui->pixbutton = fl_add_pixmapbutton( FL_NORMAL_BUTTON, 85, 120, 80, 80, "" ); fl_add_button( FL_NORMAL_BUTTON, 290, 270, 90, 35, "Button" ); obj = fl_add_round3dbutton( FL_PUSH_BUTTON, 260, 95, 60, 40, "Round3DButton" ); fl_set_object_color( obj, FL_COL1, FL_MAGENTA ); fl_add_roundbutton( FL_PUSH_BUTTON, 220, 140, 60, 40, "RoundButton" ); obj = fl_add_checkbutton( FL_PUSH_BUTTON, 190, 230, 50, 40, "CheckButton" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_add_lightbutton( FL_PUSH_BUTTON, 290, 200, 100, 30, "LightButton" ); obj = fl_add_button( FL_PUSH_BUTTON, 120, 290, 100, 35 ,"Button"); fl_set_object_boxtype( obj, FL_ROUNDED3D_UPBOX ); fl_end_group( ); fdui->group[ 0 ] = fl_bgn_group( ); obj = fl_add_box( FL_UP_BOX, 40, 120, 70, 70, "A Box" ); fl_set_object_lsize( obj,FL_NORMAL_SIZE ); fl_set_object_lstyle( obj, FL_TIMESBOLD_STYLE ); fdui->bit = fl_add_bitmap( FL_NORMAL_BITMAP, 30, 220, 80, 70, "bitmap" ); fl_add_clock( FL_ANALOG_CLOCK, 330, 240, 90, 80, "" ); obj = fl_add_frame( FL_ENGRAVED_FRAME, 130, 120, 80, 70, "A Frame" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lstyle( obj, FL_TIMESBOLD_STYLE ); fdui->pix = fl_add_pixmap( FL_NORMAL_PIXMAP, 340, 110, 90, 70, "pixmap" ); fdui->chart = fl_add_chart( FL_PIE_CHART, 160, 210, 130, 110, "chart" ); obj = fl_add_text( FL_NORMAL_TEXT, 240, 130, 100, 30, "Text stuff\nand more stuff" ); fl_set_object_lalign( obj,FL_ALIGN_CENTER ); fl_end_group( ); fdui->group[ 3 ] = fl_bgn_group( ); fl_add_input( FL_NORMAL_INPUT, 140, 120, 150, 30, "Input" ); fl_add_input( FL_MULTILINE_INPUT, 60, 170, 320, 130, "" ); fl_end_group( ); fdui->quit = fl_add_button( FL_NORMAL_BUTTON, 385, 20, 60, 30, "Quit" ); fdui->group[ 4 ] = fl_bgn_group( ); fdui->menu = obj = fl_add_menu( FL_PULLDOWN_MENU, 190, 110, 40, 19, "Menu" ); fl_set_object_boxtype( obj, FL_FLAT_BOX ); fdui->choice = fl_add_choice( FL_NORMAL_CHOICE, 290, 110, 120, 30, "" ); fdui->browser = fl_add_browser( FL_NORMAL_BROWSER, 30, 140, 140, 150, "" ); fdui->xyplot = obj = fl_add_xyplot( FL_IMPULSE_XYPLOT, 190, 150, 240, 180, "" ); fl_set_object_lsize( obj, FL_DEFAULT_SIZE ); fl_end_group( ); fl_end_form( ); fdui->objsform->fdui = fdui; return fdui; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/xyplotall.c0000644000175000017500000001414312251643237013270 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* test screen/world conversion in addition to showing the xyplot styles */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include typedef struct { int type; const char * name; FL_COLOR color; } XYType; #define VN( a, c ) { a, #a, c } static XYType xytype[ ] = { VN( FL_NORMAL_XYPLOT, FL_BLACK ), VN( FL_SQUARE_XYPLOT, FL_BLACK ), VN( FL_CIRCLE_XYPLOT, FL_BLACK ), VN( FL_FILL_XYPLOT, FL_BLACK ), VN( FL_POINTS_XYPLOT, FL_BLACK ), VN( FL_LINEPOINTS_XYPLOT, FL_BLACK ), VN( FL_DASHED_XYPLOT, FL_BLACK ), VN( FL_DOTTED_XYPLOT, FL_BLACK ), VN( FL_DOTDASHED_XYPLOT, FL_BLACK ), VN( FL_IMPULSE_XYPLOT, FL_BLACK ), VN( FL_ACTIVE_XYPLOT, FL_BLACK ), VN( FL_EMPTY_XYPLOT, FL_BLACK ), VN( -1, 0 ), }; #define N ( sizeof xytype / sizeof *xytype - 1 ) static FL_OBJECT *xyplot[ N ]; static void create_form_xyplot( void ); static FL_FORM *fxyplot; static float x[ N ][ 21 ], y[ N ][ 21 ]; /*************************************** ***************************************/ static void done_xyplot( FL_OBJECT * ob, long q FL_UNUSED_ARG ) { fl_hide_form( ob->form ); fl_finish( ); exit( 0 ); } #include /*************************************** ***************************************/ static int post( FL_OBJECT * ob, int ev, FL_Coord mx, FL_Coord my, int key, void * xev FL_UNUSED_ARG ) { if ( ev == FL_PUSH || ev == FL_MOTION ) { float wx, wy; char buf[ 64 ]; fl_xyplot_s2w( ob, mx, my, &wx, &wy ); sprintf( buf, "x=%d y=%d wx=%.1f wy=%.1f", mx, my, wx, wy ); fl_show_oneliner( buf, ob->x + ob->form->x + 5, ob->y + ob->form->y ); /* fl_object_ps_dump( ob,"test.ps" ); */ ob->wantkey = FL_KEY_ALL; ob->input = 1; } else if ( ev == FL_RELEASE ) { fl_hide_oneliner( ); } else if( ev == FL_KEYPRESS ) { fprintf( stderr,"key=%d\n",key ); } return 0; } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { size_t i, j; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); create_form_xyplot( ); /* Make sure double buffer also works */ // for ( i = 0; i < 3; i++ ) for ( i = 0; i < N; i++ ) { fl_set_object_dblbuffer( xyplot[ i ], 1 ); for( j = 0; j < 21; j++ ) { x[ i ][ j ] = j * 3.1415 / 10 + 0.2; y[ i ][ j ] = sin( 2 * x[ i ][ j ] ) + cos( x[ i ][ j ] ); } fl_set_xyplot_data( xyplot[ i ], x[ i ], y[ i ], 21, "TestTitle", "X-axis", "Y|axis"); if ( i == 0 ) fl_add_xyplot_text( xyplot[ i ], x[ i ][ 15 ], 0.1, "@2->", FL_ALIGN_TOP, FL_BLUE ); else fl_add_xyplot_text( xyplot[ i ], x[ i ][ 8 ], 1.4, "Text Inset", FL_ALIGN_CENTER, FL_BLUE ); if ( i == 3 ) { fl_set_xyplot_xgrid( xyplot[ i ], FL_GRID_MAJOR ); fl_set_xyplot_xgrid( xyplot[ i ], FL_GRID_MINOR ); } else if ( i == 0 ) { fl_set_xyplot_xtics( xyplot[ i ], 7, 2 ); fl_set_xyplot_xbounds( xyplot[ i ], 6, 0 ); } else if ( i == 1 ) { fl_set_xyplot_ytics( xyplot[ i ], 5, 2 ); fl_set_xyplot_ybounds( xyplot[ i ], 2.4, -2.4 ); } fl_set_object_posthandler( xyplot[ i ], post ); } fl_show_form( fxyplot, FL_PLACE_MOUSE | FL_FREE_SIZE, FL_TRANSIENT, "XYplot" ); while ( fl_do_forms( ) ) /* empty */; return 0; } /*************************************** ***************************************/ static void create_form_xyplot( void ) { FL_OBJECT *obj; XYType *xy = xytype; int dx = 180, dy = 160; int i = 0, j = N / 3 + ( ( N % 3 ) ? 1 : 0 ); if ( fxyplot ) return; fxyplot = fl_bgn_form( FL_NO_BOX, 3 * ( dx + 20 ) + 20, j * ( dy + 30 ) + 120 ); fl_add_box( FL_UP_BOX, 0, 0, 3 * ( dx + 20 ) + 20, j * ( dy + 30 ) + 120, "" ); for ( j = 0; xy->type != -1; j++ ) for ( i = 0; i < 3 && xy->type != -1; i++ ) { xyplot[ 3 * j + i ] = obj = fl_add_xyplot( xy->type, i * ( dx + 20 ) + 20 , j * ( dy + 30 ) + 60, dx, dy, xy->name ); fl_set_object_lsize( obj, FL_TINY_SIZE ); fl_set_object_color( obj, FL_COL1, xy->color ); xy++; } obj = fl_add_button( FL_NORMAL_BUTTON, ( 3 * ( dx + 20 ) + 20 ) / 2 - 50, j * ( dy + 30 ) + 60, 100, 30, "Exit" ); fl_set_object_callback( obj, done_xyplot, 0 ); obj = fl_add_text( FL_NORMAL_TEXT, ( 3 * ( dx + 20 ) + 20 ) / 2 - 90, 15, 240, 30, "FL_XYPLOT" ); fl_set_object_lcolor( obj, FL_SLATEBLUE ); fl_set_object_lsize( obj, FL_HUGE_SIZE ); fl_set_object_lstyle( obj, FL_BOLD_STYLE|FL_EMBOSSED_STYLE ); fl_set_object_boxtype( obj, FL_FLAT_BOX ); fl_end_form( ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/pushme.c0000644000175000017500000000262412251643455012544 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM *simpleform; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); simpleform = fl_bgn_form( FL_UP_BOX, 230, 160 ); fl_add_button( FL_NORMAL_BUTTON, 40, 50, 150, 60, "Push Me" ); fl_end_form( ); fl_show_form( simpleform, FL_PLACE_MOUSE, FL_NOBORDER, "PushMe" ); fl_do_forms( ); fl_hide_form( simpleform ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/porsche.xpm0000644000175000017500000001101511665175602013264 00000000000000/* XPM */ static char * porsche[] = { /* porsche pixmap * width height ncolors chars_per_pixel */ "64 64 4 1 ", " c None m None s s_slateblue ", ". c yellow m white s s_yellow ", "r c red m white s s_red ", "b c black m black s s_black ", /* pixels */ " ", " ", " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb............................................bb ", " bb..bbbb..bbbb..bbbb..bbbb..bbbb..b..b..bbbb..bb ", " bb..b..b..b..b..b..b..b..b..b..b..b..b..b.....bb ", " bb..b..b..b..b..b..b..b.....b.....b..b..b.....bb ", " bb..bbbb..b..b..bbb...bbbb..b.....bbbb..bbbb..bb ", " bb..b.....b..b..b..b.....b..b.....b..b..b.....bb ", " bb..b.....b..b..b..b..b..b..b..b..b..b..b.....bb ", " bb..b.....bbbb..b..b..bbbb..bbbb..b..b..bbbb..bb ", " bb............................................bb ", " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb.....................bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb......b...b...bb.....bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb.....b...b...b....b..bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb....bb..bb.bbbbbbb...bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb...bbbbbbbb......bb..bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb..bbbb...............bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb.bbb.................bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb..........b..b.......bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb.....b...b..b........bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb....b...b..b..bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb....b.bbbbbbbbb..............bbbbbbbbbbbbbbbbb ", " bb...bbbb.......bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb..bbb.........b..............bbbbbbbbbbbbbbbbb ", " bb.bbb..........b...bbb........bbbbbbbbbbbbbbbbb ", " bb.........b..b.b..bbbbb.......bbbbbbbbbbbbbbbbb ", " bb.....b..b..b..b..b.bbb.....b.brrrrrrrrrrrrrrbb ", " bb....b..b..b..bb....bbb....bb.brrrrrrrrrrrrrrbb ", " bb...bb.bbbbbbb.b....bbb....bb.brrrrrrrrrrrrrrbb ", " bb..bbbbb......bb...bbbbb...b..brrrrrrrrrrrrrrbb ", " bb.bbb..........b.bbbbbbbbbbb..brrrrrrrrrrrrrrbb ", " bb..............b.b.bbbbbbbbb..brrrrrrrrrrrrrrbb ", " bbbbbbbbbbbbbbbbb.b.b....bbbb..bbbbbbbbbbbbbbbbb ", " bbbbbbbbbbbbbbbbb...b.....b.b..b..............bb ", " bbbbbbbbbbbbbbbbb........bb.bb.b...b..b.......bb ", " bbbbbbbbbbbbbbbb........b..b..b..b..b...b...bb ", " bbbbbbbbbbbbbbbb.......b..b...b.b..b...b....bb ", " bbbbbbbbbbbbbbbbb............b.bbbbbbbbbb...bb ", " bbrrrrrrrrrrrrrrb..........bbbb........bb.bb ", " bbrrrrrrrrrrrrrrrb........bbbb............bb ", " bbrrrrrrrrrrrrrrrbbbbbbbb.......b..b....bb ", " bbrrrrrrrrrrrrrrrrrrbb.....b...b..b..b..bb ", " bbrrrrrrrrrrrrrrrrrbb....b...b..b..b..bb ", " bbrrrrrrrrrrrrrrrrrbb...bb.bbbbbbbb...bb ", " bbbbbbbbbbbbbbbbbbbb...bbbb......bb.bb ", " bbbbbbbbbbbbbbbbbbb..bbb...........b ", " bbbbbbbbbbbbbbbbbbb.bbb...........bb ", " bbbbbbbbbbbbbbbbbb..............bb ", " bbbbbbbbbbbbbbbbb...b.b.b.....bb ", " bbbbbbbbbbbbbbbb..b.b.b..b..bb ", " bbrrrrrrrrrrrbb..bbbbbbb..bb ", " bbrrrrrrrrrrbb.bbb....b.bb ", " bbrrrrrrrrrbb.bb......bb ", " bbbrrrrrrrbb.......bbb ", " bbbbrrrrrbb.....bbbb ", " bbbbrrrbb...bbbb ", " bbbbrbb.bbbb ", " bbbbbbbb ", " bbbb ", " bb ", " " } ; xforms-1.2.4/demos/yesno_cb.c0000644000175000017500000000441712251643211013034 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * same functionality as yesno.c, but with callbacks. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" /*************************************** ***************************************/ void yes_push( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fprintf( stderr, "Yes is pushed\n" ); fl_finish( ); exit( 0 ); } /*************************************** ***************************************/ void no_push( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fprintf( stderr, "No is pushed\n" ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM *form; FL_OBJECT *obj; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); form = fl_bgn_form( FL_UP_BOX, 320, 120 ); fl_add_box( FL_NO_BOX, 80, 20, 160, 40, "Do you want to quit?" ); obj = fl_add_button( FL_NORMAL_BUTTON, 40, 70, 80, 30, "Yes" ); fl_set_object_callback( obj, yes_push, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 200, 70, 80, 30, "No" ); fl_set_object_callback( obj, no_push, 0 ); fl_end_form( ); fl_show_form( form,FL_PLACE_MOUSE, FL_TRANSIENT, "Question" ); fl_do_forms( ); /* We'll never get here since all objects have callback functions and thus fl_do_forms() never returns */ return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/itest.c0000664000175000017500000004452712353623325012402 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * image support test program * * This file is part of xforms package * T.C. Zhao (Nov., 1999) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include "include/forms.h" #include "image/flimage.h" #include "fd/is_gui.h" typedef struct { FL_IMAGE * image; FD_is_mainform * fd_mainform; FD_viewform * fd_viewform; FD_processform * fd_processform; FD_saveAs_form * fd_saveAs_form; const char * outformat; int double_buffer; int rgb[ 4 ]; /* current fill color */ } App; static App app; static int testicon = 1; /*************************************** ***************************************/ int visual_cue( FL_IMAGE * im, const char * s ) { fl_set_object_label( app.fd_mainform->status, s ); if ( im->completed < 0 ) fl_set_slider_value( app.fd_mainform->progressbar, 0 ); else fl_set_slider_value( app.fd_mainform->progressbar, ( double ) im->completed / im->total ); return 0; } /*************************************** * only show image file in file selector ***************************************/ static int image_file_filter( const char * name, int type ) { return type == FT_FILE && flimage_is_supported( name ); } /*************************************** * application initialization. Enable all formats and setup visual_cue * and error reporting functions. ***************************************/ static void app_init( void ) { FLIMAGE_SETUP setup; memset( &setup, 0, sizeof setup ); flimage_enable_bmp( ); flimage_enable_gif( ); flimage_enable_ps( ); flimage_enable_fits( ); flimage_enable_xpm( ); flimage_enable_xbm( ); flimage_enable_jpeg( ); flimage_enable_tiff( ); /* Setup visual cue and status reporting */ setup.visual_cue = visual_cue; setup.header_info = 1; setup.app_data = &app; flimage_setup( &setup ); fl_set_dirlist_filter( image_file_filter ); } /*************************************** ***************************************/ void doublebuffer_callback( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { app.double_buffer = fl_get_button( ob ); if ( app.image ) app.image->double_buffer = app.double_buffer; } /*************************************** ***************************************/ void windowlevel_callback( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { if ( ! app.image ) return; flimage_windowlevel( app.image, fl_get_slider_value( app.fd_viewform->level ), fl_get_slider_value( app.fd_viewform->window ) ); app.image->display( app.image, app.image->win ); } /*** callbacks and freeobj handles for form is_mainform ***/ /*************************************** ***************************************/ void vscroll_callback( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { if ( app.image ) { app.image->wy = ( 0.5 - fl_get_scrollbar_value( ob ) ) * app.image->h; app.image->display( app.image, app.image->win ); } } /*************************************** ***************************************/ void hscroll_callback( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { if ( app.image ) { app.image->wx = ( 0.5 - fl_get_scrollbar_value( ob ) ) * app.image->w; app.image->display( app.image, app.image->win ); } } /*************************************** ***************************************/ void outformat_callback( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { app.outformat = fl_get_choice_text( ob ); } /*** Image Processing callbacks ***/ /*************************************** ***************************************/ void colorchange_callback( FL_OBJECT * ob, long data ) { app.rgb[ data ] = fl_get_slider_value( ob ) + 0.1; fl_mapcolor( FL_FREE_COL1, app.rgb[ 0 ], app.rgb[ 1 ], app.rgb[ 2 ] ); fl_redraw_object( app.fd_processform->colorobj ); } /*************************************** ***************************************/ void autocrop_callback( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { if ( ! app.image ) return; flimage_autocrop( app.image, FLIMAGE_AUTOCOLOR ); app.image->display( app.image, app.image->win ); } /*************************************** ***************************************/ void convolve_callback( FL_OBJECT * ob FL_UNUSED_ARG, long data) { #if 1 if ( app.image ) { flimage_convolve( app.image, ( int ** ) data, 0, 0 ); app.image->display( app.image, app.image->win ); } #else /* pixtran test */ int red[ 256 ], green[ 256 ], blue[ 256 ], i; for ( i = 0; i < 256; i++ ) { red[ i ] = i * ( log10( 1.0 + 5 * i / 255.0 ) / log10( 1.0 + 5 ) ); green[ i ] = i * ( log10( 1.0 + 5 * i / 255.0 ) / log10( 1.0 + 5 ) ); blue[ i ] = i * ( log10( 1.0 + 5 * i / 255.0 ) / log10( 1.0 + 5 ) ); } flimage_transform_pixel( app.image, red, green, blue ); app.image->display( app.image, app.image->win ); #endif } /*************************************** ***************************************/ void scaling_callback( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { FD_processform *processform = app.fd_processform; int neww, newh, options; float sw, sh; if ( ! app.image ) return; sw = fl_get_counter_value( processform->width ); sh = fl_get_counter_value( processform->height ); if ( fl_get_button( processform->pixel ) ) { neww = sw + 0.1; newh = sh + 0.1; } else { neww = sw * app.image->w + 0.1; newh = sh * app.image->h + 0.1; } if ( ! strcmp( fl_get_choice_text( processform->subpixel ), "subpixel" ) ) options = FLIMAGE_SUBPIXEL; else options = FLIMAGE_NOSUBPIXEL; if ( ! strcmp( fl_get_choice_text( processform->aspect ), "aspect" ) ) options |= FLIMAGE_ASPECT; if ( ! strcmp( fl_get_choice_text( processform->align ), "center" ) ) options |= FLIMAGE_CENTER; else options |= FLIMAGE_NOCENTER; app.image->fill_color = FL_PACK(app.rgb[ 0 ], app.rgb[ 1 ], app.rgb[ 2 ] ); if ( flimage_scale( app.image, neww, newh, options) < 0 ) fprintf( stderr, "scaling failed\n" ); app.image->display( app.image, app.image->win ); } /*************************************** ***************************************/ void switchtopixel_callback( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_processform *processform = app.fd_processform; float w, h; FL_IMAGE *im = app.image; if ( ! app.image ) return; /* this function may be called in two ways: real callback when switch to pixel button is pressed or when called directly by the application when a new image is loaded */ if ( fl_get_button( processform->pixel ) ) { w = ob == 0 ? 1.0 : fl_get_counter_value( processform->width ); h = ob == 0 ? 1.0 : fl_get_counter_value( processform->height ); } else { w = ob == 0 ? im->w : fl_get_counter_value( processform->width ); h = ob == 0 ? im->h : fl_get_counter_value( processform->height ); } fl_freeze_form( processform->processform ); if ( fl_get_button( processform->pixel ) ) { fl_set_counter_bounds( processform->width, 0.1 * im->w, 10.0 * im->w ); fl_set_counter_bounds( processform->height, 0.1 * im->h, 10.0 * im->h ); fl_set_counter_value( processform->width, w * im->w ); fl_set_counter_value( processform->height, h * im->h ); fl_set_counter_precision( processform->width, 0 ); fl_set_counter_precision( processform->height, 0 ); fl_set_counter_step( processform->width, 1, 10 ); fl_set_counter_step( processform->height, 1, 10 ); } else { fl_set_counter_bounds( processform->width, 0.1, 10.0 ); fl_set_counter_bounds( processform->height, 0.1, 10.0 ); fl_set_counter_value( processform->width, w / im->w ); fl_set_counter_value( processform->height, h / im->h ); fl_set_counter_precision( processform->width, 1 ); fl_set_counter_precision( processform->height, 1 ); fl_set_counter_step( processform->width, 0.1, 1 ); fl_set_counter_step( processform->height, 0.1, 1 ); } fl_unfreeze_form( processform->processform ); } /*************************************** * when a new image is loaded, update the GUI ***************************************/ void update_process_form( void ) { switchtopixel_callback( 0, 0 ); } /******************** END OF PROCESS CALLBACKS ****************************/ /*************************************** ***************************************/ void reset_scrollbar( FL_IMAGE * im ) { FD_is_mainform *fdui = im->u_vdata; fl_set_scrollbar_value( fdui->hscroll, 0.5 ); fl_set_scrollbar_value( fdui->vscroll, 0.5 ); } /*************************************** ***************************************/ static void test_icon( void ) { Pixmap pixmap; FL_IMAGE *im; if( ! testicon || app.image == 0 ) return; im = flimage_dup( app.image ); if( app.image->w > 64 || app.image->h > 64 ) flimage_scale( im, 64, 64, FLIMAGE_ASPECT ); pixmap = flimage_to_pixmap( im, FL_ObjWin( app.fd_viewform->pixmap ) ); fl_free_pixmap_pixmap( app.fd_viewform->pixmap ); fl_set_pixmap_pixmap( app.fd_viewform->pixmap, pixmap, 0 ); flimage_free( im ); } /*************************************** ***************************************/ static int load_and_show( const char * file, void * data ) { FD_is_mainform *fdui = data; FL_IMAGE *image; FD_viewform *fd_viewform = app.fd_viewform; struct stat buff; if ( ! file || ! *file ) { fprintf( stderr, "Missing file name\n" ); return 0; } if ( ! stat( file, &buff ) && S_ISDIR( buff.st_mode ) ) { fl_set_directory( file ); return 0; } if ( ! ( image = flimage_load( file ) ) ) return 0; image->u_vdata = data; reset_scrollbar( image ); image->display( image, FL_ObjWin( fdui->canvas ) ); if ( app.image ) flimage_free( app.image ); app.image = image; app.image->double_buffer = app.double_buffer; app.outformat = image->fmt_name; /* update image info */ fl_freeze_form( fd_viewform->viewform ); fl_set_choice_text( app.fd_saveAs_form->outformat, app.outformat ); fl_clear_browser( fd_viewform->headerinfo ); if ( app.image->info ) fl_addto_browser( fd_viewform->headerinfo, app.image->info ); if ( app.image->type == FL_IMAGE_GRAY16 ) { fl_activate_object( fd_viewform->level ); fl_activate_object( fd_viewform->window ); fl_set_slider_bounds( fd_viewform->level, 0, image->gray_maxval ); fl_set_slider_bounds( fd_viewform->window, 0, image->gray_maxval ); } else { fl_deactivate_object( fd_viewform->level ); fl_deactivate_object( fd_viewform->window ); } test_icon( ); fl_unfreeze_form( fd_viewform->viewform ); update_process_form( ); return 0; } static int save_file( const char *, void * ); /*************************************** ***************************************/ void filemenu_callback( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { int n = fl_get_menu( ob ); switch ( n ) { case 2: /* Open */ fl_use_fselector( 0 ); fl_set_fselector_placement( FL_PLACE_MOUSE ); fl_set_fselector_callback( load_and_show, ob->form->fdui ); fl_show_fselector( "Load an Image", 0, "*", 0 ); break; case 3: /* Save */ if( app.image ) { const char *f; fl_use_fselector( 1 ); if ( ( f = fl_show_fselector( "OutputName", 0, "*", app.image->infile ) ) ) save_file( f, 0 ); } break; case 4: /* Save As */ if( app.image ) fl_show_form( app.fd_saveAs_form->saveAs_form, FL_PLACE_CENTERFREE, FL_TRANSIENT, "OutputForm"); break; case 5: fl_finish( ); exit( 0 ); } } /*************************************** ***************************************/ void progressbar( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { } /*************************************** ***************************************/ static int expose_handle( FL_OBJECT * ob FL_UNUSED_ARG, Window win, int w FL_UNUSED_ARG, int h FL_UNUSED_ARG, XEvent * xev FL_UNUSED_ARG, void * data FL_UNUSED_ARG) { if ( app.image ) app.image->display( app.image, win ); return 0; } /********************************************************************** * The Save As dialog *********************************************************************/ /*************************************** * SaveAs file selector callback ***************************************/ static int save_file( const char * file, void * data FL_UNUSED_ARG ) { if ( ! file || ! *file ) return -1; return flimage_dump( app.image, file, app.outformat ); } /*************************************** ***************************************/ static void hide_it( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { char file[ 256 ]; const char *d, *f; /* get the selected file */ fl_use_fselector( 2 ); if ( ( d = fl_get_directory( ) ) && ( f = fl_get_filename( ) ) ) { sprintf( file,"%s/%s", d, f ); save_file( f, 0 ); } fl_hide_form( app.fd_saveAs_form->saveAs_form ); } /*************************************** ***************************************/ static void init_save_as_form( void ) { static FD_saveAs_form *fd_saveAs_form; const FLIMAGE_FORMAT_INFO *fmtinfo; int i, n; FD_FSELECTOR *fd_fselect; fd_saveAs_form = create_form_saveAs_form( ); app.fd_saveAs_form = fd_saveAs_form; fl_use_fselector( 2 ); fd_fselect = fl_get_fselector_fdstruct( ); /* fl_set_fselector_callback( save_file, 0 ); */ fl_set_object_callback( fd_fselect->ready, hide_it, 0 ); fl_show_object( fd_fselect->ready ); fl_set_form_atclose( app.fd_saveAs_form->saveAs_form, fl_goodies_atclose, fd_fselect->ready ); /* Put fselector into the formbrowser as a way of reparenting */ fl_addto_formbrowser( app.fd_saveAs_form->formcontainer, fd_fselect->fselect ); /* Fill the output format choice */ for ( n = flimage_get_number_of_formats( ), i = 1; i <= n; i++ ) { fmtinfo = flimage_get_format_info( i ); if ( fmtinfo->read_write & FLIMAGE_WRITABLE ) fl_addto_choice( app.fd_saveAs_form->outformat, fmtinfo->short_name ); } app.outformat = fl_get_choice_text( app.fd_saveAs_form->outformat ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FD_is_mainform *fd_is_mainform; FD_viewform *fd_viewform; FD_processform *fd_processform; FD_annotationform *fd_annotationform; fl_set_border_width( -2 ); fl_initialize( &argc, argv, 0, 0, 0 ); fd_is_mainform = create_form_is_mainform( ); fd_viewform = create_form_viewform( ); fd_processform = create_form_processform( ); fd_annotationform = create_form_annotationform( ); /* initialize app GUI */ app.fd_mainform = fd_is_mainform; app.fd_viewform = fd_viewform; app.fd_processform = fd_processform; /* image related initializations */ app_init( ); /* fill-in form initialization code */ fl_set_browser_fontstyle( fd_viewform->headerinfo, FL_FIXED_STYLE ); fl_addto_tabfolder( fd_is_mainform->tabfolder, " View ", fd_viewform->viewform); fl_addto_tabfolder( fd_is_mainform->tabfolder, "Processing", fd_processform->processform ); fl_addto_tabfolder( fd_is_mainform->tabfolder, "Annotation", fd_annotationform->annotationform); fl_add_canvas_handler( fd_is_mainform->canvas, Expose, expose_handle, 0 ); app.rgb[ 0 ] = fl_get_slider_value( fd_processform->red ) + 0.1; app.rgb[ 1 ] = fl_get_slider_value( fd_processform->green ) + 0.1; colorchange_callback( fd_processform->blue, 2 ); init_save_as_form( ); /* show the main form */ fl_show_form( fd_is_mainform->is_mainform, FL_PLACE_CENTERFREE, FL_FULLBORDER, "is_mainform" ); while ( fl_do_forms( ) ) /* empty */ ; return 0; } #include "fd/is_gui.c" /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/freedraw.c0000664000175000017500000003054612353623325013045 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Demo showing the use of a free obejct * * This file is part of xforms package * T.C. Zhao and M. Overmars * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" /**** Forms and Objects ****/ typedef struct { FL_FORM * drawfree; void * vdata; char * cdata; long ldata; FL_OBJECT * freeobj; FL_OBJECT * figgrp; FL_OBJECT * colgrp; FL_OBJECT * colorobj; FL_OBJECT * rsli; FL_OBJECT * gsli; FL_OBJECT * bsli; FL_OBJECT * miscgrp; FL_OBJECT * sizegrp; FL_OBJECT * hsli; FL_OBJECT * wsli; FL_OBJECT * drobj[ 3 ]; } FD_drawfree; extern FD_drawfree * create_form_drawfree( void ); static FD_drawfree * drawui; extern void draw_initialize( FD_drawfree * ); static int max_w = 150, max_h = 150; static Display *dpy; /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { dpy = fl_initialize( &argc, argv, "FormDemo", 0, 0 ); drawui = create_form_drawfree( ); fl_set_object_color( drawui->colorobj, FL_FREE_COL1, FL_FREE_COL1 ); draw_initialize( drawui ); fl_show_form( drawui->drawfree, FL_PLACE_CENTER | FL_FREE_SIZE, FL_FULLBORDER, "FreeObject" ); fl_do_forms( ); fl_free( drawui ); fl_finish( ); return 0; } /* Structure mantainace */ typedef void ( *DrawFunc )( int, int, int, int, int, unsigned long ); /*************************************** ***************************************/ void draw_triangle( int fill, int x, int y, int w, int h, unsigned long col ) { XPoint xpoint[ 4 ]; GC gc = fl_state[ fl_vmode ].gc[ 0 ]; Window win = fl_winget( ); xpoint[ 0 ].x = x; xpoint[ 1 ].x = x + w / 2; xpoint[ 2 ].x = x + w - 1; xpoint[ 0 ].y = y + h - 1; xpoint[ 1 ].y = y; xpoint[ 2 ].y = y + h - 1; XSetForeground( dpy, gc, fl_get_pixel( col ) ); if ( fill ) XFillPolygon( dpy, win, gc, xpoint, 3, Nonconvex, Unsorted ); else { xpoint[ 3 ].x = xpoint[ 0 ].x; xpoint[ 3 ].y = xpoint[ 0 ].y; XDrawLines( dpy, win, gc, xpoint, 4, CoordModeOrigin ); } } static DrawFunc drawfunc[ ] = { fl_oval, fl_rectangle, draw_triangle }; typedef struct { DrawFunc drawit; int x, y, w, h, fill, c[ 3 ]; int newfig; FL_COLOR col; } DrawFigure; static DrawFigure saved_figure[ 800 ], *cur_fig; /*************************************** ***************************************/ void draw_initialize( FD_drawfree * ui ) { fl_set_form_minsize( ui->drawfree, 530, 490); fl_set_object_gravity( ui->colgrp, WestGravity, WestGravity ); fl_set_object_gravity( ui->sizegrp, SouthWestGravity, SouthWestGravity ); fl_set_object_gravity( ui->figgrp, NorthWestGravity, NorthWestGravity ); fl_set_object_gravity( ui->miscgrp, SouthGravity, SouthGravity ); fl_set_object_resize( ui->miscgrp, FL_RESIZE_NONE ); cur_fig = saved_figure; cur_fig->c[ 0 ] = cur_fig->c[ 1 ] = cur_fig->c[ 2 ] = 127, cur_fig->w = cur_fig->h = 30; cur_fig->drawit = fl_oval; cur_fig->fill = 1; cur_fig->col = FL_FREE_COL1 + 1; fl_mapcolor( FL_FREE_COL1, cur_fig->c[ 0 ], cur_fig->c[ 1 ], cur_fig->c[ 2 ] ); fl_mapcolor( cur_fig->col, cur_fig->c[ 0 ], cur_fig->c[ 1 ], cur_fig->c[ 2 ] ); fl_set_slider_bounds( ui->wsli, 1, max_w ); fl_set_slider_bounds( ui->hsli, 1, max_h ); fl_set_slider_precision( ui->wsli, 0 ); fl_set_slider_precision( ui->hsli, 0 ); fl_set_slider_value( ui->wsli, cur_fig->w ); fl_set_slider_value( ui->hsli, cur_fig->h ); /* color sliders */ fl_set_slider_bounds( ui->rsli, 1.0, 0 ); fl_set_slider_bounds( ui->gsli, 1.0, 0 ); fl_set_slider_bounds( ui->bsli, 1.0, 0 ); /* intial drawing function */ fl_set_button( ui->drobj[ 0 ], 1 ); /* Setup the color slider so we can find out colorobject from the callback funtions. This is not necessary as drawui is static, this is done to show how to access other objects from an object callback function */ ui->rsli->u_vdata = ui; ui->gsli->u_vdata = ui; ui->bsli->u_vdata = ui; } /*************************************** ***************************************/ void switch_object( FL_OBJECT * ob FL_UNUSED_ARG, long which ) { cur_fig->drawit = drawfunc[ which ]; } /*************************************** ***************************************/ void change_color( FL_OBJECT * ob, long which ) { cur_fig->c[ which ] = fl_get_slider_value(ob) * 255.01; fl_mapcolor( cur_fig->col, cur_fig->c[ 0 ], cur_fig->c[ 1 ], cur_fig->c[ 2 ] ); fl_mapcolor( FL_FREE_COL1, cur_fig->c[ 0 ], cur_fig->c[ 1 ], cur_fig->c[ 2 ] ); fl_redraw_object( ( ( FD_drawfree * ) ob->u_vdata )->colorobj ); } /*************************************** ***************************************/ void fill_cb( FL_OBJECT * ob, long notused FL_UNUSED_ARG ) { cur_fig->fill = !fl_get_button( ob ); } /*************************************** ***************************************/ void change_size( FL_OBJECT * ob, long which ) { if ( which == 0 ) cur_fig->w = fl_get_slider_value( ob ); else cur_fig->h = fl_get_slider_value( ob ); } /*************************************** ***************************************/ void refresh_cb( FL_OBJECT * ob FL_UNUSED_ARG, long which FL_UNUSED_ARG ) { fl_redraw_object( drawui->freeobj ); } /*************************************** ***************************************/ void clear_cb( FL_OBJECT * ob FL_UNUSED_ARG, long notused FL_UNUSED_ARG ) { saved_figure[ 0 ] = *cur_fig; cur_fig = saved_figure; fl_redraw_object( drawui->freeobj ); } /*************************************** * The routine that does drawing ***************************************/ int freeobject_handler( FL_OBJECT * ob, int event, FL_Coord mx, FL_Coord my, int key, void * xev FL_UNUSED_ARG ) { DrawFigure *dr; switch ( event ) { case FL_DRAW: if ( cur_fig->newfig == 1 ) { cur_fig->drawit( cur_fig->fill, cur_fig->x + ob->x, cur_fig->y + ob->y, cur_fig->w, cur_fig->h, cur_fig->col ); } else { fl_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); for ( dr = saved_figure; dr < cur_fig; dr++ ) { dr->drawit( dr->fill, dr->x + ob->x, dr->y + ob->y, dr->w, dr->h, dr->col); } } cur_fig->newfig = 0; break; case FL_PUSH: if ( key != 2 ) { cur_fig->x = mx - cur_fig->w / 2; cur_fig->y = my - cur_fig->h / 2; /* convert position to relative to the free object */ cur_fig->x -= ob->x; cur_fig->y -= ob->y; cur_fig->newfig = 1; fl_redraw_object( ob ); *(cur_fig+1) = *cur_fig; fl_mapcolor( cur_fig->col + 1, cur_fig->c[ 0 ], cur_fig->c[ 1 ], cur_fig->c[ 2 ] ); cur_fig++; cur_fig->col++; } break; } return 0; } /*************************************** ***************************************/ FD_drawfree * create_form_drawfree( void ) { FL_OBJECT *obj; FD_drawfree *fdui = fl_calloc(1, sizeof *fdui ); fdui->drawfree = fl_bgn_form( FL_NO_BOX, 530, 490 ); fl_add_box( FL_UP_BOX, 0, 0, 530, 490, "" ); obj = fl_add_frame( FL_DOWN_FRAME, 145, 30, 370, 405, "" ); fl_set_object_gravity( obj, FL_NorthWest, FL_SouthEast ); fdui->freeobj = obj = fl_add_free( FL_NORMAL_FREE, 145, 30, 370, 405,"", freeobject_handler ); fl_set_object_gravity( obj, FL_NorthWest, FL_SouthEast ); obj = fl_add_checkbutton( FL_PUSH_BUTTON, 15, 25, 100, 35, "Outline" ); fl_set_object_color( obj, FL_MCOL,FL_BLUE ); fl_set_object_gravity( obj, FL_NorthWest, FL_NorthWest ); fl_set_object_callback( obj, fill_cb, 0 ); fdui->figgrp = fl_bgn_group( ); fdui->drobj[ 0 ] = obj = fl_add_button( FL_RADIO_BUTTON, 10, 60, 40, 40, "@#circle" ); fl_set_object_lcolor( obj, FL_YELLOW ); fl_set_object_callback( obj, switch_object, 0 ); fdui->drobj[ 1 ] = obj = fl_add_button( FL_RADIO_BUTTON, 50, 60, 40, 40, "@#square" ); fl_set_object_lcolor( obj, FL_YELLOW ); fl_set_object_callback( obj, switch_object, 1 ); fdui->drobj[ 2 ] = obj = fl_add_button( FL_RADIO_BUTTON, 90, 60, 40, 40, "@#8>" ); fl_set_object_lcolor( obj, FL_YELLOW ); fl_set_object_callback( obj, switch_object, 2 ); fl_end_group( ); fdui->colgrp = fl_bgn_group(); fdui->colorobj = fl_add_box( FL_BORDER_BOX, 25, 140, 90, 25, "" ); fdui->rsli = obj = fl_add_slider( FL_VERT_FILL_SLIDER, 25, 170, 30, 125, "" ); fl_set_object_color( obj, FL_COL1, FL_RED ); fl_set_object_callback( obj, change_color, 0 ); fl_set_slider_return( obj, FL_RETURN_CHANGED ); fdui->gsli = obj = fl_add_slider( FL_VERT_FILL_SLIDER, 55, 170, 30, 125, "" ); fl_set_object_color( obj, FL_COL1, FL_GREEN ); fl_set_object_callback( obj, change_color, 1 ); fl_set_slider_return( obj, FL_RETURN_CHANGED ); fdui->bsli = obj = fl_add_slider( FL_VERT_FILL_SLIDER, 85, 170, 30, 125, "" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_object_callback( obj, change_color, 2 ); fl_set_slider_return( obj, FL_RETURN_CHANGED ); fl_end_group( ); fdui->miscgrp = fl_bgn_group( ); obj = fl_add_button( FL_NORMAL_BUTTON, 420, 455, 105, 30, "Quit"); fl_set_button_shortcut( obj,"Qq#q", 1 ); obj = fl_add_button( FL_NORMAL_BUTTON, 280, 445, 105, 30, "Refresh" ); fl_set_object_callback( obj, refresh_cb, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 165, 445, 105, 30, "Clear" ); fl_set_object_callback( obj, clear_cb, 0 ); fl_end_group( ); fdui->sizegrp = fl_bgn_group( ); fdui->hsli = obj = fl_add_valslider( FL_HOR_SLIDER, 15, 410, 120, 25, "Height" ); fl_set_object_lalign( obj, FL_ALIGN_TOP ); fl_set_object_callback( obj, change_size, 1 ); fl_set_slider_return( obj, FL_RETURN_CHANGED ); fdui->wsli = obj = fl_add_valslider( FL_HOR_SLIDER, 15, 370, 120, 25, "Width" ); fl_set_object_lalign( obj, FL_ALIGN_TOP ); fl_set_object_callback( obj, change_size, 0 ); fl_set_slider_return( obj, FL_RETURN_CHANGED ); fl_end_group( ); fl_end_form( ); return fdui; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/demotest3.c0000644000175000017500000000477012251644076013156 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" /**** Forms and Objects ****/ typedef struct { FL_FORM *S; void *vdata; char *cdata; long ldata; } FD_S; FD_S *S; /*************************************** ***************************************/ void timeoutCB( int tid FL_UNUSED_ARG, void * stuff FL_UNUSED_ARG ) { fl_show_alert( "Standby", "This may abort", "with SEGV", 1 ); } /*************************************** ***************************************/ void pressedCB( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { int tid = fl_add_timeout( 300L, timeoutCB, NULL ); fprintf( stderr, "tid=%d\n", tid ); } /*************************************** ***************************************/ FD_S * create_form_S( void ) { FL_OBJECT *obj; FD_S *fdui = fl_calloc( 1, sizeof *fdui ); int old_unit = fl_get_coordunit( ); fl_set_coordunit( FL_COORD_centiMM ); fdui->S = fl_bgn_form( FL_NO_BOX, 10837, 8467 ); fl_add_box( FL_UP_BOX, 0, 0, 10837, 8467, "" ); obj = fl_add_button( FL_NORMAL_BUTTON, 1693, 1693, 7451, 4403, "Press Me" ); fl_set_object_callback( obj, pressedCB, 0 ); fl_end_form( ); fdui->S->fdui = fdui; fl_set_coordunit( old_unit ); return fdui; } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_initialize( &argc, argv, "S", 0, 0 ); S = create_form_S( ); fl_show_form( S->S, FL_PLACE_CENTER, FL_FULLBORDER, "Crash Test" ); while ( 1 ) fl_do_forms( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/goodies.c0000644000175000017500000000563412251643732012676 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* This demo program uses the routines in the * goodies section, that help you create easy * forms in an even easier way. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "include/forms.h" /*************************************** ***************************************/ void timeout_remove_alert( int id FL_UNUSED_ARG, void * data FL_UNUSED_ARG ) { fl_hide_alert( ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { int choice; char str1[ 100 ], str2[ 100 ]; const char *s; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); #if 0 fl_set_resource( FLOKLabel, "Go" ); #endif if( fl_show_question( "Do you want bold font ?",1 ) ) fl_set_goodies_font( FL_BOLD_STYLE, FL_NORMAL_SIZE ); fl_show_messages( "This is a test program for the goodies of the " "forms library" ); fl_add_timeout( 5000, timeout_remove_alert, 0 ); fl_show_alert( "Alert", "Alert form can be used to inform", "about recoverable errors", 0 ); if ( fl_show_question( "Do you want to quit?", 0 ) ) exit( 0 ); strcpy( str1, ( s = fl_show_input( "Enter a string:","" ) ) ? s : "" ); fl_show_message( "You typed:", "", str1 ); choice = fl_show_choices( "Pick a choice", 3, "One", "Two", "Three", 2 ); switch ( choice ) { case 1: fl_show_message( "You typed: One", "", "" ); break; case 2: fl_show_message( "You typed: Two", "", "" ); break; case 3: fl_show_message( "You typed: Three", "", "" ); break; default: fl_show_message( "An error occured!", "", "" ); break; } strcpy( str2, ( s = fl_show_input( "Enter another string:", str1 ) ) ? s : "" ); fl_show_message( "You typed:", "", str2 ); fl_show_messages( "Good Bye" ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/colorwheel.xpm0000664000175000017500000024744612340166201013773 00000000000000/* XPM */ static char *colorwheel[] = { /* columns rows colors chars-per-pixel */ "201 201 255 2 ", " c #FF0707", ". c #FF1808", "X c #FF0818", "o c #FF1818", "O c #FF3808", "+ c #FF2D12", "@ c #FF0838", "# c #FF122D", "$ c #FF3030", "% c #FF5708", "& c #FF4C12", "* c #FF700F", "= c #FF4F2F", "- c #FF6F2F", "; c #FF0857", ": c #FF124C", "> c #FF2F4F", ", c #FF0F70", "< c #FF2F6F", "1 c #FF5747", "2 c #FF4757", "3 c #FF4F4F", "4 c #FF704F", "5 c #FF4F70", "6 c #FF7878", "7 c #FF6D6D", "8 c #0FFF0F", "9 c #2FFF0F", "0 c #0FFF30", "q c #30FF30", "w c #50FF0F", "e c #70FF0F", "r c #50FF2F", "t c #6FFF2F", "y c #0FFF4F", "u c #2FFF50", "i c #0FFF6F", "p c #2FFF6F", "a c #4FFF4F", "s c #6FFF4F", "d c #4FFF6F", "f c #78FF78", "g c #6DFF6D", "h c #FF900F", "j c #FFB00F", "k c #FF902F", "l c #FFAF2F", "z c #90FF0F", "x c #AFFF0F", "c c #90FF2F", "v c #AFFF2F", "b c #FFCF0F", "n c #D0FF0F", "m c #FBFC08", "M c #FBFB19", "N c #F4F30F", "B c #FFCF2F", "V c #CFFF2F", "C c #FBFB27", "Z c #FBFB37", "A c #F3F330", "S c #FF8F4F", "D c #FFAF4F", "F c #FF9070", "G c #FFAF70", "H c #8FFF4F", "J c #AFFF4F", "K c #90FF70", "L c #B8FF78", "P c #ACFF6D", "I c #FFCF4F", "U c #D0FF4F", "Y c #FBFB48", "T c #FBFB58", "R c #F3F34F", "E c #FFCF70", "W c #CFFF70", "Q c #FBFB68", "! c #E8FF77", "~ c #FBFB78", "^ c #F8EF6D", "/ c #0F0FFF", "( c #2F0FFF", ") c #0F30FF", "_ c #3030FF", "` c #4F0FFF", "' c #700FFF", "] c #502FFF", "[ c #6F2FFF", "{ c #0F4FFF", "} c #2F50FF", "| c #0F6FFF", " . c #2F6FFF", ".. c #4F4FFF", "X. c #6F4FFF", "o. c #4F6FFF", "O. c #7878FF", "+. c #6D6DFF", "@. c #FF0F90", "#. c #FF2F90", "$. c #FF0FB0", "%. c #FF2FAF", "&. c #FF4F8F", "*. c #FF7090", "=. c #FF4FAF", "-. c #FF70AF", ";. c #900FFF", ":. c #AF0FFF", ">. c #902FFF", ",. c #AF2FFF", "<. c #FF0FCF", "1. c #FF2FCF", "2. c #D00FFF", "3. c #FB08FC", "4. c #FB19FB", "5. c #F40FF3", "6. c #CF2FFF", "7. c #FB27FB", "8. c #FB37FB", "9. c #F330F3", "0. c #8F4FFF", "q. c #AF4FFF", "w. c #9070FF", "e. c #B878FF", "r. c #AC6DFF", "t. c #FF4FCF", "y. c #FF70CF", "u. c #D04FFF", "i. c #FB48FB", "p. c #FB58FB", "a. c #F34FF3", "s. c #CF70FF", "d. c #FB68FB", "f. c #E877FF", "g. c #FB78FB", "h. c #F86DEF", "j. c #08FF98", "k. c #12FF8C", "l. c #2FFF8F", "z. c #10FFB0", "x. c #2FFFAF", "c. c #4FFF8F", "v. c #70FF90", "b. c #4FFFB0", "n. c #78FFA8", "m. c #6DFFB3", "M. c #0898FF", "N. c #128CFF", "B. c #2F8FFF", "V. c #10B0FF", "C. c #2FAFFF", "Z. c #4F8FFF", "A. c #7090FF", "S. c #4FB0FF", "D. c #78A8FF", "F. c #6DB3FF", "G. c #08FFC8", "H. c #08FFD8", "J. c #18FFCF", "K. c #2FFFCF", "L. c #08C8FF", "P. c #08D8FF", "I. c #18CFFF", "U. c #2FCFFF", "Y. c #08FFE8", "T. c #08E8FF", "R. c #07FCFC", "E. c #19FBFB", "W. c #18F3F3", "Q. c #27FBFB", "!. c #37FBFB", "~. c #2FF3F3", "^. c #47FFC8", "/. c #52FFD3", "(. c #78FFD8", "). c #6DFFCC", "_. c #47C8FF", "`. c #52D3FF", "'. c #78D8FF", "]. c #6DCCFF", "[. c #47FFE8", "{. c #47E8FF", "}. c #48FBFB", "|. c #58FBFB", " X c #58F3F3", ".X c #68FBFB", "XX c #78FBFB", "oX c #6FF3F3", "OX c #FF9090", "+X c #FFB090", "@X c #FF90B0", "#X c #FFB8B8", "$X c #FFADAD", "%X c #90FF90", "&X c #AFFF90", "*X c #90FFB0", "=X c #B7FFB7", "-X c #ADFFAD", ";X c #FFD090", ":X c #CFFF90", ">X c #FBFB88", ",X c #FBFB98", "X! ! ! ~ ~ ~ ~ Q ~ Q ~ Q ^ Q ^ ^ ^ ^ I T I ^ ^ I I I I ^ I I I I I I l I I I l I B B D l l D l l l l k k l l k h h k h h h h h * h h * * h * IXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXk.k.j.i k.j.i k.k.i k.k.l.k.k.p k.l.l.l.p l.l.l.l.l.l.c.c.p c.l.d c.p c.d c.d c.d c.d v.g d c.v.g d v.g g f v.g g f g f f f f f f K K v.%XK K %X%XP %XK P &X&XK P &XL :X&XL L :X&X:X:X:XW :XW :X:X! :X! :X! ! >X! >X! ! ~ >X! ! ~ ~ ~ ~ ~ ^ Q ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ I ^ I ^ I I I I I I I I I I l D B l D D l l l l l l l l j l h k j j k h k h h * h h h * h h * * IXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXk.k.k.k.k.k.k.k.i k.l.k.l.k.p k.l.l.p l.p l.l.l.p p l.l.d l.c.l.c.c.c.l.d c.c.c.d c.d c.g d v.c.g c.v.g v.v.f g g v.g f f f f K f K v.%XK K %XP %XP %XK &X%XP &X&X&X&X&X&X&XL :X&X&XW L :X:X! :X:X:X:X>X:X>X:X! ! :X>X! >X>X! ~ ~ ~ ~ ~ ~ ~ ~ ~ ^ ~ ^ ^ ^ ^ E T I I ^ I ^ I ^ ^ I I I I I D I I D B D B D l l D D l l l k l k k l l k k h h h h h h h h * h * * * h * IXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXk.k.k.k.k.k.k.k.k.k.k.k.k.k.k.l.l.k.l.k.l.l.l.l.l.c.l.c.l.d l.c.d l.c.c.d d c.c.g c.v.c.c.v.c.f c.v.g c.g c.f v.v.v.f v.f f f f v.f K K v.K %X%XK %X&X&X%X&X&X&X&X&X&X&XL :X&X:X:X:X:X:X:X:X:X:X:X! :X:X:X:X! >X:X! >XX>X~ >X~ ~ ~ ~ ~ ~ ~ ^ ^ ^ ~ ^ ^ E ^ ^ E ^ I I I E I I I I I I I D I I D D l I l l l l D l l k l l k h j k k k h k h h * h * * h h * * * IXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXj.j.k.j.j.k.k.k.k.k.k.l.k.k.l.l.j.l.l.l.l.l.l.c.l.l.l.c.l.c.c.c.l.c.c.c.c.c.c.v.c.c.c.c.v.c.v.v.c.f d v.v.v.f v.v.f f v.f f v.K f %Xf K %X%XK %X%X%X%X&XP &X&X&X&X&X&X&X&X:X&X:X&X:X:X:X:X:X:X:X:XX! :X>X! X>X~ ~ >X~ ~ ~ >X~ ^ ^ ^ >X^ E ^ ^ ^ E ^ E I ^ E I I E I I I I D I D I D D B D D l D l k l l k l k k k l k h k k h * h * h * h * * * h * * * IXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXj.j.j.j.k.j.j.j.k.k.j.l.k.l.k.l.l.l.l.l.l.l.l.l.c.l.l.l.c.l.l.c.c.c.c.c.c.c.c.c.v.c.v.c.c.v.g c.c.v.v.v.f v.v.f v.v.v.f %Xv.K v.v.K K v.%XK %X%XK &X%XP %X&X&X&X&X&X&X:X&X&X:X&X:X:X&X:X:X:X:XX:XX>X>X>X>X>X>X~ ~ >X^ >X>X^ ~ E ^ ^ ^ E ^ ^ E ^ E I E ^ E I I E I I E I I D l I D D l D l S D D l l k l l k k h h k k h k h - h h - h h * * * * * IXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXj.j.j.k.j.k.j.k.k.k.j.l.j.k.k.l.l.j.l.l.x.l.x.l.l.l.l.l.c.l.c.l.c.l.c.c.c.c.c.v.c.c.c.v.c.c.c.v.v.v.v.v.v.v.v.v.v.v.K v.f v.f v.K v.v.v.K v.K %XK %X%X%X%X&X&X&X&X&X&X&X&X:X&X&X&X:X&X4X:X4X:X:X:XX:X>XX>X>X! >X~ >X~ ~ ^ ^ X:XX>X>X>X>X>X>X>X>XX>X>X>X>X>X>X~ >X^ X>X,X>X>X>X~ >X>X;XX,X,X,X>X>X>X>X>X>XX~ ^ ;XX,XXX,X>XXX^ X;X;XX;X = $ $ $ $ + $ $ + o $ o o o o . . . . ", "R.R.R.R.R.R.E.R.E.E.E.E.Q.Q.E.Q.Q.Q.Q.~.!.!.!.!.}.!.[.}.}.|.}.|.}.|.|.|..X.X.X.X.X.X.X.X.XXXXXXXXXXXzXXXzXzXzXzXxXxXxXxXxXvXxXvXvXvXvXbXbXvXvXbXbXbXbXDXbXDXDXDXGXGXGXFXFXFXFXKXKXKXKXKXHXKXKXLXLXLXLXLXLXLXLXLXHXLXHXPXJXLXPXJXHXmXmXmXmXBXmXmXmXmXmX#X#XmX#X#X#X#X#X#X$X$X+X$X$XOXOX$X+XOXOXOXOXOXOXOXOXF *.F F 6 6 7 7 7 7 7 7 4 7 4 4 3 1 3 3 1 3 1 3 $ = > 3 $ $ > $ $ $ $ $ $ $ o o o o o . . o o . ", "R.R.R.R.R.E.R.E.E.E.E.E.E.Q.Q.Q.Q.Q.Q.!.!.!.!.!.!.}.}.}.}.}.}.}.|.}.|.|.|.|.|..X.X.X.XXXXX.XXXXXXXzXXXzXXXzXzXzXzXzXxXzXxXxXxXvXvXvXvXvXvXbXbXbXbXbXbXDXbXDXDXDXDXDXFXFXFXFXFXFXFXKXKXKXKXKXLXKXKXLXLXLXLXLXLXLXJXHXJXHXHXmXmXHXSXHXmXPXmXVXmXmXmX1X1XmXmX2XrX2X#X#X$X#X$X2X$X$X$X$X$XOXOX$XOXOXOXOXF OXOX*.F *.6 6 6 6 7 7 7 7 4 7 3 7 4 5 7 3 3 3 3 1 3 3 3 3 > = = $ $ = $ $ $ o $ o $ + o o o o . ", "R.R.R.R.R.R.E.R.E.E.E.E.E.Q.Q.Q.Q.!.Q.!.!.!.!.}.!.!.}.}.}.}.}.}.|.|.|.|.|.|.|..X.X.XXX.XXXXXXXXXXXzXXXzXzXzXzXzXzXxXxXxXxXxXxXvXvXvXvXvXbXbXbXbXbXbXDXbXbXDXDXDXDXFXFXDXFXFXFXKXKXKXKXKXKXKXLXLXLXLXLXLXLXLXLXLXLXJXHXJXAXBXmXJXmXHXmXmXmXmXmXmX#XmX#XmX#X#X#X#X#X#X$X$X$X$X$X$X+X@XOX@XOX+X+XOXOXOXOXF *.F *.F F 6 6 6 7 7 7 7 5 3 7 3 4 3 3 3 3 3 3 3 = > 3 $ = 3 $ $ $ $ $ $ $ $ o $ o o o o . X o ", "R.R.R.R.R.E.R.E.R.E.E.E.E.E.Q.Q.Q.Q.!.Q.!.!.!.!.}.}.!.}.}.}.}.|.}.|.|.|..X|..X.X.X.X.X.XXX.XXXXXXXXXXXzXzXzXzXzXzXxXxXxXxXxXvXxXxXvXvXbXvXvXbXvXbXbXbXDXDXDXDXDXFXDXFXFXFXFXFXKXFXKXKXKXKXLXLXKXLXLXLXLXLXLXLXLXLXHXJXHXHXJXHXHXJXmXPXmXmXPXmXmXmXmXmXmXmX#XmX#X#X#X#X$X$X$X$X@XOX$X$XOX@XOXOXOXOXOX*.OXF *.F *.*.6 6 7 6 6 7 7 7 7 5 7 5 3 7 2 3 3 3 2 1 > $ 3 > $ 3 $ $ > $ $ $ o $ o o $ $ o o o o ", "R.R.R.R.R.R.E.E.E.E.E.Q.Q.Q.Q.Q.Q.!.Q.!.Q.!.!.!.!.}.!.{.}.}.}.|.{.|.|.|.|.|..X.X.X.X.X.X.X.XXXXXXXzXzXXXzXzXzXzXzXxXxXxXxXxXvXvXvXvXvXvXnXbXvXbXbXDXbXDXDXbXDXDXDXDXDXFXFXFXFXKXFXKXKXKXKXKXKXLXLXKXLXLXLXLXLXLXLXJXJXHXAXHXAXmXmXmXmXmXmXmXmXmXmXmXrX#XmXrX#XtX#X#X#X$X$X$X$X$X$X$XOX$XOX@XOX@XOXOXOX*.*.F *.F 6 6 7 6 7 7 7 5 7 5 7 3 3 7 7 3 3 2 3 3 2 3 3 > 3 $ $ $ $ $ # $ $ $ o # o o # o o X . X X ", "R.R.T.R.R.E.R.R.W.E.W.E.E.E.E.Q.Q.Q.!.Q.!.!.!.!.}.!.}.}.}.}.}.|.|. X|.|.|..X|.|..X.X.XXXXXXXXXXXXXXXXXzXzXzXzXzXcXzXxXxXxXvXxXvXvXvXvXvXvXnXbXbXbXbXbXbXDXDXDXDXDXFXDXFXFXFXFXFXKXFXKXKXKXLXKXKXLXLXLXJXLXLXLXLXJXJXHXAXHXAXHXJXJXJXHXSXAXmXmXAXmXrXmXmX#X#XmX#X#XtX#XtX$X$X$X$X$X@X$XOX$XOXOXOXOXOXOXOXOXOX*.*.6 *.*.6 7 *.7 7 7 7 7 7 7 5 2 2 7 3 3 2 3 3 $ 3 > 3 $ > $ $ $ $ $ # $ $ $ # o o o o X X X X ", "R.R.R.R.R.E.T.E.E.E.E.E.W.~.W.~.Q.~.~.~.~.!.~.!.!.}.}.}.{.}.}.{.|.{.|. X.X X X'..X.X.XoXoXXXXXXXXX'.XXzX'.zXzXzXcXcXcXcXcXnXxXvXvXvXnXvXnXnXnXnXbXGXnXbXGXGXDXDXGXGXFXGXFXGXFXKXGXKXKXKXJXKXKXJXKXKXLXJXLXLXLXLXJXLXJXJXHXJXAXmXHXmXmXAXmXSXmXmXmXmXmXtXmXmX#XtX#XtX#X#X$X$X$X@X$X@X$X$XOX@X@XOXOXOX*.OXOX*.OX6 *.F 6 6 7 *.7 7 7 5 7 7 5 2 5 3 5 3 3 3 3 2 3 $ 3 $ $ > $ $ $ > # $ $ # # $ $ o X o X X X ", "T.T.R.T.T.R.E.T.E.T.W.W.W.~.~.W.~.~.Q.~.{.Q.{.~.!.{.}.{.}.{.}.|. X|.|. X.X X X.XoX|.'.oXoXoXoXXXXXzXXXzXzXzXcXcXcXcXcXcXcXvXvXkXcXvXvXnXnXnXnXnXnXbXnXGXnXnXlXDXDXGXGXDXGXFXFXCXPXKXCXKXKXKXKXJXLXJXJXKXJXLXLXJXLXJXJXJXJXJXHXSXAXSXPXmXSXmXSXmXmXrXmXrX#XrXmX#X#XtX#XtX$XtX$XtX$X$X@XOX$X$XOXOX@XOXOXOX*.OX*.OX6 *.6 *.6 *.5 6 7 7 5 7 5 7 2 7 3 3 3 5 2 2 > 3 3 > > 3 > $ $ $ $ $ # $ # o # o # o o X X X X X ", "T.R.T.T.T.E.T.W.W.E.W.~.~.W.U.~.~.~.Q.Q.Q.~.~.{.{.{.!.!.{.|.{.{.|.{. X|.`. X X.X X'..XoX'.XX'.XX'.zX'.zXzXzXzXkXcXcXxXcXvXcXxXxXnXvXnXvXnXnXnXnXDXbXbXDXCXGXlXGXGXDXDXCXGXGXFXKXPXGXKXKXCXKXPXKXJXKXKXJXJXJXLXJXJXLXJXJXJXmXJXmXAXmXmXJXmXSXmXSXmXmXrXmXmXtXtX#XtX#XtX#XtXtX@X@X$X@X$X@X@XOXOX@X@X@X-.OX*.OX*.OX*.*.*.6 7 7 6 7 5 5 7 5 7 5 7 2 3 5 3 5 2 3 > > > > = $ > $ > $ $ : $ $ $ $ # # # o X # X X X X ", "T.T.T.R.T.T.W.W.T.I.W.W.W.W.E.W.E.U.U.~.~.{.{.~.~.{.{.{.{.{.{.|.|.`. X|.|..X'. X X.X.X'.oXoXoXoXXXXX'.zX'.cXXXzXkXcXxXkXxXkXxXlXkXvXlXxXlXnXbXlXlXnXnXlXbXDXDXDXGXCXGXGXPXGXFXCXGXKXCXKXKXJXPXCXKXJXKXJXKXJXJXJXJXJXJXJXJXJXJXJXAXJXAXmXAXmXSXmXrXSXmXrXtXmXrXrX#XtX#XtX$X$X$X$X$X@X@X@X$X@X@XOXOXOX*.OXOX*.OX*.OX*.6 *.*.*.7 *.7 7 5 7 5 2 7 5 5 3 5 2 2 2 2 3 3 > > > $ > > $ $ > # # # # # o # # o X X X X X X ", "T.T.T.T.T.T.W.T.W.W.W.W.W.U.W.~.~.~.U.Q.U.~.{.{.~.{.{.{.}.{.{.{.{. X.X`..X|.`.oX'..XoX'.'..X'.XX'.XXzX'.zXkXkXzXxXcXxXcXcXkXxXxXkXvXcXnXvXvXnXnXnXnXnXDXbXCXCXDXGXDXDXCXCXCXFXGXCXFXKXCXGXJXGXJXCXJXJXJXKXJXJXJXJXJXJXJXJXAXmXJXmXmXAXSXmXSXmXmXmXrXmXrXmXmXtXtXtX#XtX#X$XtX@X$X@X$X@X@XOX@X@X@X@XOX-.OX*.OX*.OX6 *.6 6 *.7 7 5 *.5 7 5 7 7 5 5 5 2 5 2 2 2 2 2 3 > 3 > > > > $ $ > # $ # # # # # o X X # X X X X ", "R.T.T.T.T.T.T.W.W.I.W.U.W.W.Q.U.U.Q.U.~.~.{.~.~.U.{.~.{.{.{.{. X{. X`. X`.`..X.X X`.'..X XoXoX'.'.'.XX'.zXXXzXzXkXcXkXcXcXxXlXcXvXvXlXvXnXlXnXlXlXGXCXnXGXnXbXbXlXCXGXGXGXGXFXCXPXKXCXPXCXGXAXKXGXJXKXJXJXJXKXJXJXJXAXJXJXAXAXJXJXAXAXmXSXSXSXrXmXSXrXmXrXtX#XrXtXtX#XtXtX$XtXtX$X@X@X$X$X@XOX@X@X*.OX@XOX*.-.OX*.*.*.*.7 *.*.7 7 7 5 7 5 5 5 2 5 2 2 2 2 2 > > > > > > > $ $ > $ : $ : > $ # $ # # # X X X X X X ", "T.T.T.T.T.T.T.T.T.T.W.W.U.I.~.W.U.~.Q.U.Q.~.{.~.{.{.{.{.{.{.{.{. X`.`. X X X.X`. X'. X'..X'.oX'.XX'.zXXX'.kXzXkXcXcXkXcXlXxXlXvXlXxXxXlXnXvXlXvXlXbXlXDXlXbXGXCXGXCXCXDXCXGXCXKXFXCXCXPXPXCXJXCXAXKXAXJXCXJXJXJXJXJXAXJXAXJXAXSXSXAXAXmXSXmXrXSXZXrXrXrXrXrXrXrXtX#XtX$X$XeXtX@XtX@X$X@X@X@X@X@X@X@X*.*.@XOX*.*.*.*.*.6 *.5 *.&.&.7 7 &.5 7 5 5 5 2 5 2 2 2 2 2 2 > > $ > : > > > $ : # # $ # # # # X @ # @ X X X ", "IXT.T.P.T.T.T.I.I.W.I.W.W.W.W.U.W.W.U.~.U.~.U.{.U.~.{.{.{.{.{.`.{.`..X`. X`.`.oX`. X'. X'.oX'..X'.XX'.kXkXXXkXXXkXcXcXkXcXkXcXkXnXkXlXcXlXlXnXlXnXlXbXlXnXCXlXDXlXDXGXCXGXGXCXCXCXFXCXGXCXJXCXGXCXJXPXCXJXJXJXAXJXJXJXAXAXAXAXAXAXSXSXAXZXmXSXmXSXrXrXmXrXrXmXtXtXtXtXtXtXtX$XtX@X@XtX@X@X@X@X@X@XOX@XOX*.-.OX*.OX*.*.*.*.*.*.7 *.5 5 7 5 5 5 7 5 5 2 5 2 < > 2 2 > 3 > > > > $ # > $ $ : # # # # # # X X X X X IX", "IXT.P.T.T.P.P.W.W.I.P.~.U.W.U.W.U.~.U.~.U.~.U.{.~.{.{.{.{.{.`.{. X`. X X X`. X'.`.`..X'.'.'.oX'.'.XXXX'.XXkXkXXXkXcXcXcXcXkXkXcXkXlXxXlXlXvXlXlXnXlXnXlXCXDXCXlXnXCXGXGXCXGXCXGXCXCXCXKXCXJXCXAXCXAXPXJXPXSXJXJXAXJXAXJXAXAXAXAXmXSXSXSXmXZXrXZXrXrXrXrXrXrXrXrXrXtXtXtXtXtXtX$XeX@X@X$X@X@X@X@X-.@X-.OXOX-.*.OX*.*.*.*.*.*.5 *.7 5 7 &.7 5 5 7 5 5 2 < 2 < 2 2 > 2 > > > > > : $ $ : $ # : # @ # # # @ X X @ X IX", "IXT.P.P.P.T.P.T.T.I.W.I.W.I.W.U.W.U.~.U.~.U.{.U.{.U.U.{.U.{.{.`.`.{.`.`.{.'.`.oXoX'. X'. X'.'.'.'.'.'.kXkXXX'.kXzXkXkXkXkXkXvXlXlXxXcXlXcXlXlXvXnXlXlXGXnXlXlXDXCXGXlXCXCXCXGXCXCXGXCXCXFXCXPXCXKXJXCXCXCXPXSXAXAXAXAXAXAXAXAXAXAXAXSXSXSXSXZXmXrXSXrXZXrXrXrXrXtXtXtXeXeX$XeX$X@XtXeX@X@X@X@X@XOX@XOX-.-.OX-.*.*.*.*.*.*.*.*.6 &.*.&.7 &.5 5 5 5 5 5 5 5 2 5 > < 2 > > > > > > > : $ : > # $ # # @ X X @ @ X X IX", "IXP.P.T.T.I.T.I.I.P.W.I.I.U.U.W.U.W.I.U.U.~.~.U.U.{.U.{.{.{.{.`. X`.`.{.`.].`.`.'.`.].`.'.oX'. X'.'.'.XX'.'.zXkXkXkXcXkXcXkXlXcXvXkXkXlXvXlXnXlXlXlXlXlXlXnXCXnXCXlXCXGXnXCXCXCXCXCXCXPXAXCXCXPXCXAXAXJXAXAXAXJXAXAXAXAXAXAXAXZXSXSXSXmXSXrXZXrXZXSXrXrXrXrXrXrXrXtXtXtXtX@XtXeXeX@X@X$X@X@X@X-.@X@X@XOXOX-.@X*.*.*.*.*.*.&.6 &.&.7 7 &.7 5 &.5 5 5 5 2 5 < < 2 2 > < > > > > : # > : # $ @ : # @ # # # @ X X X IX", "IXP.T.P.P.P.P.P.T.I.T.I.I.W.I.~.U.U.U.~.{.U.U.{.{.U.{._.U._.{.`.`.{.`.`.`. X X].`.oX`.'.`.].'.'.'.'.'.'.'.kX'.kXkX'.kXcXkXlXkXcXkXlXkXvXlXkXlXnXlXnXlXnXCXlXCXlXnXCXlXlXCXCXlXGXCXCXCXCXCXCXCXCXSXCXCXPXCXAXCXJXAXAXAXZXAXAXAXZXZXZXZXZXSXZXrXZXrXrXrXrXrXrXrXrXrXtXeXtXtXtXeX$X$XtX@XeX@XeX@X@X@X-.-.@X*.@X*.-.OX-.*.*.*.*.&.*.*.&.*.5 &.5 5 5 5 5 < 5 2 2 2 < < 2 > 2 2 > > > > : > > : : $ @ # @ @ @ X @ @ X IX", "IXP.P.P.P.P.P.P.I.I.W.I.I.~.I.I.W.U.U.U.~.U.U.U.U.{.{.U.`.`.`.{.{.`.`.`.`.'.`.].'. X`.'.'.`.'.'.'.'.'.'.kX'.kX'.zXkXkXkXkXcXlXkXkXlXlXlXkXnXlXlXlXlXlXlXlXlXGXlXCXlXCXCXCXlXlXCXCXCXCXCXCXCXCXSXCXCXAXSXAXSXAXAXAXAXSXAXAXAXZXAXZXSXZXSXrXZXZXrXZXrXrXgXgXrXrXdXrXtXeXrXtXtX@XtXeX@X@X@XeX@X@X@X@X@X-.@X@X*.-.*.-.-.*.*.*.&.*.*.5 *.*.5 &.5 7 5 5 5 < 5 < 2 5 > < > > > > > > > > > # > : # : $ @ : # @ @ X @ @ IX", "IXP.P.P.P.P.P.I.T.I.I.I.I.I.I.U.U.I.U.W.U.U.{.U._.U.U.{.U.{._._.`.`.`.`.`.`.`.`.`.].'.`.'.'.].'.'.'.'.'.'.].'.kX'.kXkXkXkXkXkXkXlXkXkXcXkXlXkXlXnXlXlXlXlXlXlXCXlXCXlXCXCXCXCXCXCXCXCXCXCXCXCXSXCXJXAXCXCXSXCXAXSXSXSXSXZXAXZXZXZXZXZXZXZXZXZXrXfXrXgXrXrXrXtXtXrXeXrXeXeXeXtXeXtXeXeX@XeX@X@X@X@X-.@X*.-.*.*.@X*.*.*.*.-.*.*.&.*.&.&.7 7 &.&.5 &.5 5 5 5 < 5 < 2 < < > > < : > > : > : > : # : @ # @ # X @ @ X IX", "IXIXP.P.P.L.I.P.P.I.I.I.I.I.I.I.I.U.U.U.I.U.{.U.U.U._._._.{.{._.`.`.`.`.`.`.].`.`.`.`.'.`.'.'.].].'.'.'.'.kX'.kX'.kX'.kXkXkXkXkXkXlXkXlXlXkXlXlXlXlXlXlXlXlXlXlXlXlXCXqXlXCXCXCXCXCXCXCXCXCXSXCXSXCXCXAXSXSXSXCXSXSXSXSXZXZXZXZXZXZXZXrXrXrXZXZXrXfXgXrXrXdXrXpXtXtXtXtXtXeXtX@XeXtX@XeX@X@X@X-.@X@X-.@X-.@X-.*.*.-.-.*.*.&.*.*.&.5 *.&.&.5 &.5 5 < < 5 2 5 < 2 < 2 > > < > > : : > : : : # > @ @ @ @ @ @ @ @ IXIX", "IXIXP.L.L.P.P.P.I.P.I.I.I.U.I.U.U.I.U.U.U.U.U.U.U.{.{.U._.U._._.`.`.`.`.`.`.`.`.].].].].].].`.'.].'.].'.kX].'.'.kX'.kXkXkXkXkXkXkXkXlXkXkXlXlXkXkXlXlXlXlXlXCXlXCXlXlXlXCXlXqXlXlXCXqXCXCXCXCXaXCXSXCXCXCXSXSXSXSXZXSXSXZXZXZXZXZXZXfXZXZXfXfXrXfXrXrXrXdXrXrXrXdXrXeXtXeXtXeXtX@XeXeX@XeX@XeX@X-.-.@X-.@X*.-.-.-.*.-.*.*.*.&.&.*.&.&.5 &.5 5 &.&.5 5 5 < < 5 < > < < < < > < > > : > : # : : @ : @ @ @ @ X @ IXIX", "IXIXP.L.L.P.L.L.I.I.I.I.I.I.U.I.I.U.U.I.U.U.U.U._.U._.U._.U._.`._.`.`.`.`.`._.].`.`.].].].].`.].].'.].].kXkX].kXkXkX'.0X'.kXkXkXkXqXkXlXkXlXkXlXlXlXlXlXlXlXlXlXlXlXqXCXlXCXCXCXCXCXqXCXCXaXaXCXCXSXZXCXZXaXSXSXSXSXZXSXfXZXZXZXZXZXZXZXfXfXfXfXrXfXgXrXrXdXtXdXrXeXtXtXeXtXtXeXeXeXeXeXeX@X-.eX@X-.@X-.-.-.-.-.*.-.*.*.=.*.&.-.&.*.&.&.&.5 5 &.5 < < 5 < 5 < < 2 < < > < > > : : > : > : > : : # : @ @ @ @ @ IXIX", "IXIXL.L.P.L.P.L.L.I.I.L.I.I.I.I.I.I.U.C.U.U.U.U._.U.U._._._._._._.`.S.`.`.`.].`.].F.`.`.F.].].].].].kXF.].].].kX].0XkXkXkXkX0XkXkXkXkXkXkX0XlXlX0XlXqXlXwXlXlXqXqXlXlXqXqXqXqXqXqXqXaXCXCXCXCXaXaXCXCXSXCXSXaXSXaXSXZXSXZXSXZXfXZXfXfXfXZXZXrXrXrXgXgXrXdXtXdXtXiXrXdXeXtXeXeXeX@XeX@X@Xy.eX@X@Xy.@X-.@X@X-.OX-.-.&.-.*.-.&.*.&.&.&.*.5 &.&.&.5 5 &.5 &.5 < < 5 < < > < < < > , > < : : : # : @ : @ : @ @ @ @ IXIX", "IXIXL.L.L.L.L.L.I.L.L.I.I.I.I.I.U.C.U.U.C.U.C.U.U.U.C._.U._._._._._.S.`.S.`._.`.`.F.`.].`.].].].F.].F.].kX].F.kXkXkXkXkX0X'.kXkXkX0XwXkXlX0XlX0XlXlX0XkXqXlXqXlXlXqXqXlXlXCXqXCXqXqXqXCXCXaXaXCXCXCXaXCXSXaXZXCXZXZXSXfXaXZXfXZXfXfXZXfXfXfXgXgXfXgXrXdXrXdXtXeXtXeXtXdXeXeXeXeXeXeX@XeX@XeXeX-.@Xy.@X-.-.-.-.-.-.-.*.-.*.*.&.*.*.&.&.*.&.5 5 &.&.< &.< &.< < 5 < 2 > < > < > > , > > : : : : : @ @ @ @ @ @ @ IXIX", "IXIXIXL.L.L.L.L.L.I.V.I.V.U.C.I.I.I.I.C.U.U.U.U.U._._.U._._.U._._._.`._.`.F.`.F.`.`.F.`.].F.].F.'.].kX].F.].kXF.].F.kXF.kX0X0XkX0XkXkXkX0XlXkXqXkXqXlXqXlX0XlXqXqXqXlXqXqXqXqXqXqXCXaXqXCXaXCXaXSXaXZXaXaXSXaXZXaXZXaXZXZXfXZXfXZXfXfXfXfXgXfXgXgXgXdXrXiXrXiXrXiXtXeXeXeXdXeXtXeXeXeXeXy.@X@XeX-.@X-.-.@X-.-.-.-.*.-.&.&.-.-.&.*.&.&.&.&.&.&.&.&.5 < 5 < 5 < < < < < < < : : < > : : : > : : : : : @ @ @ @ IXIXIX", "IXIXIXL.L.L.L.L.V.I.L.I.I.I.V.I.U.I.U.C.I.U.C.U.C.U.U._._.C._._._._._._.S.`.S.`.F.F.`.F.`.F.].].F.].kXF.].F.kXF.F.kX0XkXkX0XkX0XkX0XkXwX0XkXwXkXlX0XqXkX0XwXlXwXlXwXqXwXqXqXqXqXqXqXaXqXaXCXaXCXCXaXaXZXCXaXSXaXZXaXZXZXZXfXfXfXfXfXfXfXfXfXfXgXdXdXdXrXrXtXeXdXdXeXtXtXtXpXeXeXeXeXeX@XeX-.eX-.y.@X@X-.-.-.-.-.*.-.-.-.*.=.*.&.&.*.&.&.&.&.5 < &.5 &.5 < 5 < < < < < > < < < : , < : : : : : : : @ @ @ @ ; IXIXIX", "IXIXIXL.L.L.L.V.L.I.L.V.V.I.C.I.V.C.U.I.C.U.U.C.U._.C.C.U._.S._._._.S._._.S.]._.S.`.F.`.F.`.F.].].].F.].F.kXkXF.kX].].0XF.kXF.kX0XkX0XkXlX0XkXwX0XlX0XwXwXlXlXwXwXlXqXlXqXqXqXqXqXCXqXaXqXCXqXaXaXaXCXaXaXZXaXZXaXZXfXaXaXZXaXfXfXfXfXfXdXfXgXgXdXrXdXiXiXdXtXdXpXrXeXpXeXeXeXeXeXeXeXeXeX@Xy.@X@X-.y.y.-.-.-.-.-.-.&.-.=.*.=.-.&.&.=.&.&.&.&.&.#.&.< #.&.< #.< < < < < < : < > > ; < : , : : : @ ; ; @ @ @ IXIXIX", "IXIXIXL.L.V.L.V.L.V.I.V.L.V.I.C.I.V.C.I.I.C.C.U.C._.U._._.C.C._._.S.S._.S.`.`.F.S.]._.F.].F.S.].F.F.].F.0X].F.F.F.0XkXF.kX0XkX0XkX0XkX0XwXkX0XlXwXkX0XlXqX0X0XwXqXwXqXqXwXqXqXqXqXqXqXaXqXaXaXaXaXaXCXaXaXZXaXfXZXaXfXaXfXfXfXfXfXfXfXdXdXfXdXdXgXrXdXtXrXgXpXtXiXeXpXeXpXeXeXeXeXy.eXy.@Xy.eX@Xy.-.@X-.-.-.-.-.-.=.=.-.-.&.*.&.&.&.&.&.&.&.&.&.5 &.5 < #.< 5 < < < < < < : > , , > : ; : : : : ; : @ ; @ @ IXIXIX", "IXIXIXIXV.L.V.L.L.V.V.L.L.C.I.V.C.C.I.C.C.U.C.C.U.C.C._.C._.C._._.S._.S._.S.S.S.`.S._.F.S.].F.F.F.].F.F.].F.F.kXkXF.D.0X].0X0X0X0X0XkX0X0XkX0X0X0XwXwXwXkXqX0XqXwXwXwXwXwXwXqXqXqXaXqXqXaXqXaXCXaXaXaXaXaXaXaXaXaXfXaXfXaXfXgXfXfXdXfXfXfXdXgXdXdXdXdXdXiXeXdXiXtXpXtXdXeXeXeXeXeXeXeXeXy.eXy.y.-.eX-.y.-.-.-.-.-.*.-.-.&.-.=.&.-.=.*.&.&.&.&.< &.#.&.#.5 5 #.< < < , < < < < , > , < : : ; ; ; @ ; ; @ ; IXIXIXIX", "IXIXIXIXV.L.V.V.L.V.V.L.V.I.V.C.I.C.V.I.C.I.I.C.C.C._.C.C._.C._.S._.S._.S.S.S._._.F.S.`.F.F.].F.F.`.F.F.F.F.0XD.F.kX0XF.kX0XF.kXD.0X0X0X0XkX0XwX0X0XwX0X0XwXwXwXwX0XwXwXwXwXwXqXqXqXsXsXqXsXaXaXqXaXaXaXaXaXaXaXgXaXgXgXaXgXgXfXgXgXdXfXdXdXdXdXdXdXdXpXeXdXdXrXpXeXpXeXeXeXeXeXy.eXy.eXy.eXy.eXeX-.y.-.-.-.-.-.-.-.=.-.&.=.-.&.*.=.=.&.&.&.&.&.5 &.#.#.5 < < #.< < < < < < , < : , , : : : : ; ; ; @ ; @ IXIXIXIX", "IXIXIXIXL.V.L.V.L.V.L.V.V.V.V.L.V.U.C.C.C.C.C.C.U.C.U.C._.C.S.C.C.S.C._.S._.S.S.F.S.S.F.F.S.S.F.F.F.F.F.F.F.].F.F.D.D.].0XD.0X0X0X0X0X0X0X0X0X0X0XwX0XwXwX0X0XwXwXwXwX8XwXwXwXqXwXsXqXsXqXsXsXsXaXaXaXaXaXgXgXaXaXgXaXdXgXgXgXgXgXgXgXdXdXdXdXdXdXdXiXrXdXiXeXpXeXiXeXdXpXeXuXeXeXeXeXeXeXy.y.-.-.y.-.y.-.y.y.-.=.-.-.=.-.=.&.=.=.&.&.&.&.&.#.&.#.&.< &.< #.5 #.< < < < , > > , < : , > , : : ; ; @ ; @ ; IXIXIXIX", "IXIXIXIXIXV.V.V.V.V.L.V.V.V.C.L.C.V.V.C.C.C.I.C.C.C.C.S.C.S.C.S._.S.C.S.S.S.S.F.S.S.S.S.S.S.F.F.S.F.F.F.F.F.F.D.0XD.0X0X0XF.D.0X0X0X0X0X0X0X0X0X0XwX0XwXwXwX0XwXwX8XwXwXwXwXwXsXsXwXwXsXsXsXsXqXaXsXsXaXaXsXaXgXgXaXgXaXsXgXgXgXgXdXgXdXdXdXdXdXdXdXdXiXeXdXeXiXiXeXeXpXpXeXeXeXh.y.eXy.eX-.eXy.y.-.y.-.-.y.-.=.-.-.=.-.=.*.*.=.&.=.&.&.&.&.&.&.&.#.5 #.#.#.< < < #.#., , < < , , : , : : , ; ; ; ; ; ; IXIXIXIXIX", "IXIXIXIXIXL.V.V.V.V.V.V.V.V.C.V.V.V.C.C.V.C.C.C.C.C.C.C.C.S.C.C.C.S.S.S.S._.S.S.S.S.F.F.S.F.S.F.F.F.F.F.D.F.F.F.F.F.F.D.F.0XD.D.D.0XD.0X0X0X0X0X0X0X0X0X8X0XwXwX0XwXwXwXwX9XwXwXwXwXsXsXsXqXsXsXsXaXsXsXsXgXsXaXaXgXaXdXdXdXaXgXgXdXdXdXdXdXdXdXiXdXiXiXdXiXdXiXpXpXiXeXeXuXeXpXeXeXy.eXy.eXy.y.y.-.y.-.y.-.-.-.=.=.-.&.-.=.=.=.=.&.&.=.%.&.&.#.&.#.#.&.&.< #.< < < < < < < , < , < : , : : , ; ; ; @ @ IXIXIXIXIX", "IXIXIXIXIXV.V.V.V.V.M.V.V.V.V.C.V.V.C.V.V.C.C.C.C.C.C.C.C.S.C.S.S.C.S.S.S.S.S.S.S.S.F.S.F.S.Z.F.S.F.F.S.A.F.F.A.D.F.D.D.0XD.D.0X0X0XD.0X0X0X0X0X8X0XwX0X0X9XwX8X9X0X9X0X9XwX9XwXwXsX9XwXsXqXsXsXsXsXsXaXsXaXdXsXaXaXgXaXaXdXpXgXgXdXdXdXdXiXdXdXiXdXiXdXeXiXpXeXeXiXpXpXeXeXeXy.eXeXeXeXeXy.eXy.y.-.y.y.-.=.y.=.-.=.-.=.-.=.=.&.=.&.=.&.&.&.&.#.&.#.&.< #.#.#.< #.< < < , < < , , , : , , ; ; ; ; ; ; ; IXIXIXIXIX", "IXIXIXIXIXIXV.V.V.V.V.V.V.V.V.V.C.V.V.C.C.C.V.C.C.C.C.C.C.C.C.S.C.Z.C.C.C.S.S.S.S.S.Z.S.Z.S.F.F.S.F.F.D.F.D.F.F.D.D.D.D.D.D.D.D.D.8X0XD.D.8XD.8X0X8X8X0X8X0X8X0X8XwX8XwXwXwX9XwXwXsXqXsXwXsX9XsXsXsXyXsXsXsXsXsXsXgXyXiXiXaXiXaXdXdXyXdXdXdXiXiXiXiXiXiXpXiXpXpXeXpXeXpXpXh.pXeXh.h.y.h.y.y.y.y.y.y.y.-.y.y.-.-.=.y.=.-.=.=.-.&.=.=.&.%.&.%.%.&.#.&.#.#.< #.< #.< @., #.#., , < < < , ; , : , ; ; ; ; IXIXIXIXIXIX", "IXIXIXIXIXIXV.V.V.V.V.V.V.V.V.V.V.C.B.V.V.C.B.V.C.C.C.C.B.C.C.C.S.C.S.S.S.S.S.Z.S.S.Z.F.S.F.S.S.A.S.F.S.F.A.F.D.A.F.D.D.0XD.0XD.0XD.0XD.8X0X8X0X8X0X8X8X0X8XwX9XwX8XwX9X9XwXwXwXwX9XwX9XyXqXqXsXsXsXyXsXpXsXpXgXiXsXdXsXiXsXaXiXsXiXdXdXiXiXiXdXdXiXiXiXiXiXpXpXiXpXeXpXeXpXeXh.eXy.eXy.y.y.y.y.y.-.-.y.-.y.=.y.-.=.-.=.-.=.=.=.=.&.&.&.&.=.&.&.#.#.#.#.#.#.#.< #.< < < < , @., ; , < ; ; , ; ; ; ; ; IXIXIXIXIXIX", "IXIXIXIXIXIXM.V.V.M.M.V.V.N.V.V.N.V.V.C.V.B.C.C.C.V.C.B.C.S.B.S.C.Z.B.S.C.Z.C.S.Z.S.S.S.Z.S.A.S.S.A.A.F.A.S.F.A.F.D.D.D.A.D.A.D.A.0XA.8X0XA.0X8X0X8X8X0X8X8X8X0XwX8X8XwX8XwX9X9XwX9XsXsXwXyXyXsXsXsXsXsXsXsXsXsXsXdXsXiXsXdXsXpXdXdXyXiXdXiXiXiXiXiXiXpXpXpXeXiXpXpXuXy.uXy.h.eXh.eXy.y.eXeXy.y.y.y.y.y.-.t.y.-.t.-.=.=.=.=.=.=.=.=.=.&.%.&.%.#.&.#.&.&.#.#.#.< < @.#., , < < , < , , , , ; ; , , ; ; IXIXIXIXIXIX", "IXIXIXIXIXIXIXV.M.V.M.V.V.V.V.M.V.C.M.V.C.B.B.V.V.C.B.C.B.C.C.B.C.Z.C.S.C.S.Z.C.S.Z.S.S.Z.S.A.F.S.A.S.A.F.A.F.A.A.F.F.A.D.D.D.A.A.0XA.0XD.8X8X0XD.8X0X8X8X8X8X8X8X9X0X9X8XwX9XwX9X9XwX9XsX9XsXwXyXsXyXsXsXpXaXyXyXsXdXsXiXaXpXpXdXpXsXiXiXiXiXiXiXiXiXiXpXpXpXpXeXuXh.eXeXh.eXy.eXh.y.h.eXy.y.y.y.y.y.y.-.t.y.=.-.=.=.-.=.=.=.=.=.=.#.=.&.#.=.=.#.#.#.#.#.#.#.#.< #.#.< < , , < , , , , : ; , ; ; ; IXIXIXIXIXIXIX", "IXIXIXIXIXIXIXM.V.M.V.M.M.M.V.V.M.C.V.B.B.V.C.V.B.B.C.C.C.C.Z.C.Z.C.S.B.Z.S.S.Z.Z.S.Z.Z.S.F.S.Z.F.S.A.S.Z.S.A.F.A.A.A.D.A.D.A.D.D.8XA.8X8XA.A.0X8X8X8X8X8X8X8X8X8X8X8X8XwX9X9XwXwX9X9XsX9XwXsXyXwXyXsXsXyXsXyXaXsXiXyXsXyXdXiXsXyXdXiXiXdXpXpXiXiXiXuXiXpXuXuXpXuXpXpXuXuXpXh.uXuXy.y.eXy.y.y.y.y.t.y.=.-.y.=.y.t.y.=.=.=.=.=.=.=.&.=.&.=.%.#.#.&.#.&.#.#.#.< @.@.< @., @.< @., , , , , , , , ; ; ; IXIXIXIXIXIXIX", "IXIXIXIXIXIXIXM.M.V.M.V.M.V.M.N.V.N.V.B.V.N.C.B.C.B.C.B.B.C.B.S.C.Z.B.S.S.B.Z.S.Z.S.S.Z.Z.Z.S.A.Z.A.A.A.A.F.A.A.A.F.A.A.A.D.A.8XD.A.A.8XD.8XA.8X8XA.A.8X8X8X8X8X8X8XwX8X9X9XwX9X9X9XwX9XwXyXyXsXsXyXsXyXsXyXsXyXyXyXsXpXsXyXyXdXdXiXdXpXyXiXpXiXuXiXuXuXuXuXuXuXg.pXeXuXh.eXpXy.y.eXy.h.y.h.h.y.y.y.y.y.t.-.t.=.=.y.=.t.=.=.=.=.=.=.%.=.%.&.%.&.=.#.%.#.#.#.< #.#.< , #.< @.< , , , , , , ; ; , ; , IXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXM.M.M.M.M.N.V.M.N.V.N.V.N.C.N.C.C.N.B.C.B.B.C.B.B.C.B.B.B.S.B.Z.Z.Z.S.Z.S.Z.Z.S.S.Z.S.Z.A.Z.S.A.Z.D.A.A.A.A.D.A.8XA.A.A.A.8X8XA.8X8X8X8X8X8X8X8X8X8X8X9X8X8X9X9XwX9XsX9XyX9XwX9XwXyXsXyXyXsXyXsXyXdXpXsXpXdXyXpXyXpXyXpXiXpXpXiXuXuXuXuXuXuXuXuXpXh.h.uXuXh.h.eXh.h.h.y.y.y.y.y.y.y.t.t.y.t.=.y.t.=.=.y.=.=.=.%.%.=.=.#.&.%.&.%.#.#.#.#.#.#.#.@.#.@.#., #., @., , , , , , , , ; ; IXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXM.M.M.M.M.M.N.M.V.M.N.B.N.B.B.V.N.N.C.B.B.C.B.C.Z.B.B.S.B.Z.S.B.Z.S.Z.Z.Z.S.Z.Z.Z.Z.A.S.A.Z.A.A.A.A.Z.A.A.A.A.A.A.A.8X8X8XA.A.8XA.8X8XA.8X8Xw.8X9X8X9X8X9X8X8X9X9X9X9XwXyX9X9XsXyXsX9XyXyXyXsXyXyXsXdXyXyXdXyXpXpXpXyXpXpXpXpXuXuXiXuXuXuXuXuXuXuXuXy.uXpXy.uXh.h.y.y.h.h.y.y.y.y.t.y.y.y.y.y.t.=.t.=.=.=.=.t.=.=.=.=.#.=.%.=.#.%.#.%.#.#.#.#.#.#., #., , #., , , , , , , ; , , , IXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXM.M.M.M.V.V.N.B.M.N.V.N.V.N.B.C.B.B.B.N.C.B.B.B.C.B.S.B.Z.Z.B.Z.B.S.Z.Z.Z.Z.Z.Z.A.A.Z.Z.A.A.Z.Z.A.A.A.A.A.A.A.A.A.A.A.A.O.8XA.A.8XA.w.O.8XA.8X8X8X8X8X9X9X9X9X9X9X9X9X9X9XyX9X9XyXsXyXsXyXyXyXyXyXyXyXpXyXpXyXpXyXpXpXyXpXpXuXuXuXuXuXuXg.g.uXh.uXuXh.h.h.y.h.h.h.h.y.y.h.h.y.y.t.t.y.t.t.=.=.t.-.=.t.=.t.=.=.=.%.%.=.=.#.#.%.=.#.#.#.#.#.#.@.@.#.@.#.#., @., , @., , , , , ; IXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXM.M.M.M.M.M.N.N.M.B.V.V.B.V.B.B.N.N.C.B.B.B.B.B.B.B.B.B.C.Z.Z.Z.Z.B.Z.Z.Z.Z.Z.Z.Z.Z.Z.A.Z.Z.A.A.Z.A.A.A.A.A.A.A.O.A.8XA.O.O.8XA.w.8XO.O.8Xw.8Xw.9X8X9X8X8X9X9X9X9X9X9X9X9XyXsX9XyX9XyXyXyXsXyXyXpXdXyXpXyXyXpXyXuXyXpXuXuXyXuXuXuXuXuXuXuXuXuXg.uXh.uXh.pXuXh.y.h.h.y.y.h.t.y.y.y.y.t.t.-.t.y.t.=.t.=.=.%.t.%.=.%.=.#.%.%.%.#.#.%.#.#.#.%.#.#.@.< , #., @.@., @., , , , , , , IXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXN.M.M.M.N.M.N.M.N.N.N.N.N.B.N.B.N.B.B.B.B.B.B.Z.B.Z.Z.B.Z.B.B.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.A.Z.Z.A.A.Z.A.A.Z.+.A.A.A.A.A.O.A.O.A.A.O.8XA.A.w.8XO.8X8X8X8Xw.8Xw.9X9X8X8X9X9X9X9XyX9X9XyX9XyXyXyXyXyXyXyXyXyXyXyXyXpXyXuXyXuXuXyXpXuXuXuXuXuXg.uXg.g.g.uXg.g.y.h.g.y.h.h.y.h.y.h.y.h.t.t.y.t.y.t.t.t.=.y.t.=.t.t.=.=.=.%.=.%.=.=.#.&.%.%.#.#.%.#.@.@.#.#.@.#.@.@., @., @., , , , , , IXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXM.M.N.N.N.M.N.N.N.N.N.N.N.N.B.N.B.B.B.N.B. .B.B.B.Z.B.B.B.Z.B.Z.Z.B.Z.Z.Z.Z.Z.o.Z.Z.+.Z.A.Z.A.Z.Z.A.A.A.A.O.A.A.+.A.A.O.O.A.O.A.w.O.A.w.8XO.8X8Xw.8Xw.8Xr.8X9X9X9X9Xe.9X9XyX9XyX9XyXyXyXyXyXyXyXyXpXyXyXyXpXyXuXuXuXyXuXuXf.uXf.uXg.uXg.uXg.g.h.g.h.h.h.h.h.h.h.y.y.h.t.t.y.h.t.y.t.t.y.t.t.t.=.t.=.1.=.%.=.=.%.=.%.%.%.%.#.%.%.#.%.#.@.#.@.@.@.#.@.@., @., @., , , , , , IXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXM.N.N.N.M.N.N.N.N.N.N.N.B.N.B.N.B.B.B.B.B.B.B.B. .Z.Z. .B.o.Z.B.Z. .Z.Z.o.Z.A.+.Z.Z.Z.Z.+.o.A.+.A.+.Z.Z.+.+.A.A.+.O.O.O.A.O.O.w.A.w.A.w.8Xw.w.8X8X9X9X8X9X9X8Xr.9X9X9X9X9X9X9XyX9XyX9XyXs.s.yXyXyXyXf.f.yXyXf.yXuXf.uXyXuXuXg.f.uXg.g.g.g.g.g.g.h.g.h.h.h.h.h.h.h.y.h.h.t.y.t.t.y.t.t.t.t.t.=.=.t.t.=.t.=.%.=.%.=.%.=.%.%.#.#.%.#.%.%.#.#.#.@.#.@.@., , @.@., @., , , IXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXM.N.M.N.M.N.M.N.M.N.N.N.N.B.| | B.B.B. .B.B. .Z.B. .B.B.Z.B.Z.Z.o.Z.Z.Z.Z.Z.Z.Z.Z.A.o.+.Z.A.Z.A.Z.+.O.O.A.A.+.+.A.+.O.+.O.O.O.O.O.O.w.8Xw.8Xw.8Xr.w.8X8X9Xw.9X9X9X9Xe.9Xe.yXyXe.yXe.yXyXyXyXyXyXyXyXf.yXpXyXyXuXf.f.yXf.f.f.uXf.g.g.g.g.g.g.g.h.g.g.h.h.h.h.t.t.h.a.y.t.h.t.h.t.t.t.y.t.t.t.t.1.=.%.=.=.%.%.t.%.%.=.#.%.#.%.@.%.@.@.#.#.@.#.@.@., @.@.@., , @., , @., IXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXN.| N.| N.| N.| N.| N.B.N.N.B.N.| B.N.B.B.B.B. .B.B.o.B.B. .B.o.B.o.B.o.o.o.Z.o.Z.o.Z.Z.o.+.o.+.Z.Z.O.o.O.o.A.+.A.+.A.+.O.O.O.O.O.w.O.A.8Xw.8Xw.w.9Xr.8Xw.9Xr.9Xe.9X9X9X9X9XyXe.yX9XyXe.yXyXs.yXf.yXyXf.f.f.f.yXf.f.uXg.f.uXg.g.g.g.g.g.g.h.g.d.h.h.g.y.h.d.h.y.y.a.h.t.h.t.t.t.t.t.t.t.t.t.=.t.t.1.1.=.=.%.=.%.%.%.%.%.%.%.#.%.#.$.$.#.@.#.@.@.@., @.@.@., , @., IXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIX| N.N.M.| N.M.| N.N.| N.N. .N.B.N. .B.B. .B. .B.o.B. .B.o.B.o.B.Z.o.B.Z.o.Z.Z.o.Z.o.Z.+.Z.+.o.Z.+.Z.+.+.Z.+.+.A.o.A.+.+.+.O.+.O.w.O.w.w.w.w.w.8X8Xr.8Xr.9X9Xw.9X9Xe.9Xe.9Xe.yXe.e.yXe.yXyXs.yXs.yXyXf.yXyXf.f.uXuXf.uXf.g.g.f.g.g.g.g.g.d.g.h.d.d.h.d.h.h.h.t.h.t.h.p.t.t.a.h.t.t.t.t.t.=.1.t.t.t.t.%.t.1.=.1.%.%.%.%.%.%.$.#.$.$.#.@.@.@.@.@.@.@.@., @.@., , @., IXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXN.| | N.N.| N.| N. .N.N. . .N.| B.| . .B.B. .B. .B.o.B.o.B.o. .Z.o.o.Z.o.o.Z.o.o.o.o.o.Z.+.+.o.+.+.Z.+.+.+.+.+.+.+.+.+.+.O.w.O.O.O.w.w.8Xw.w.w.w.r.8Xw.e.9Xe.r.9Xe.9Xe.9Xe.yXyXe.yXs.yXs.s.yXf.s.f.yXf.yXs.f.f.f.f.f.f.f.f.g.f.d.g.d.g.d.g.d.d.h.d.h.p.d.h.a.d.h.t.y.h.t.t.t.t.t.t.t.t.t.t.%.%.%.t.%.%.%.%.%.%.%.%.%.#.%.%.#.#.%.%.@.$.#.@.@.@.@.@.@., @.@., IXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXN.N.N.| N.| N.N.N.N.| N.N. .N.B. . .N. .B. . . .B. .B.B. . .o.B.o. .Z.o.Z.o.o.Z.o.o.Z.o.o.o.+.Z.+.o.+.o.+.+.+.+.+.+.+.+.O.+.+.w.O.O.O.8Xw.8Xw.w.9Xw.8Xr.8Xw.e.9Xe.e.e.e.yXe.e.e.yXe.e.e.yXyXs.s.yXf.s.f.f.yXf.f.f.f.f.f.g.f.f.g.d.f.d.d.d.d.d.h.h.d.h.h.t.a.h.t.p.t.a.t.t.a.t.t.t.t.t.1.t.t.=.t.%.t.%.=.1.=.%.%.%.%.%.$.#.%.@.%.@.$.#.@.#.$.@.@.@.@.@.@., @., IXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIX| N.N.| N.| | | N.| | | N.| B.| B.| N. . .N.B. . . .o. .Z. .o. .o.o. .o.o.o.o.o.o.o.o.+.o.o.+.o.+.o.+.o.+.o.+.+.X.+.+.+.w.+.+.w.w.w.w.w.w.w.w.8Xr.r.w.r.9Xw.w.r.9X9Xe.e.9Xe.e.s.e.yXyXs.s.yXs.s.yXs.s.s.s.f.s.f.f.f.f.f.d.d.f.d.d.p.d.d.d.d.d.p.d.a.h.a.h.p.t.h.a.h.t.a.t.t.a.1.t.t.t.t.1.1.t.1.1.=.1.%.%.1.%.$.%.%.%.%.$.%.@.%.@.@.@.@.@.@.@.@.@., @.@.@.IXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXN.| | N.| | M.| | | | | | N.| .| . .| B. . .B. . . . .o.o. .o.o. .o. . .o.o.o.o.o.o.o.+.o.o.o.+.o.o...+.o.X.o.+.+.+.+.+.+.w.+.+.w.O.w.O.w.w.w.w.r.8Xr.r.r.r.9X9Xr.e.e.e.e.e.e.s.s.e.e.s.s.s.s.yXf.yXf.s.f.s.f.f.p.f.f.f.p.f.d.d.f.d.d.d.d.p.d.p.p.h.h.a.h.t.h.a.t.p.t.a.t.t.t.t.t.1.t.1.t.1.t.%.%.%.%.%.1.%.%.$.%.%.%.@.$.#.$.@.$.$.@.@.@.@.@.@.@.@., @.IXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIX| | | | N.| | | N.| N.| . .| N. . . .| . . . . . . . . . . . .o. .o.o.o.o.o.o. .o.o...o.o.+.o...+.o.+.+...+.o.X.+.+.0.+.+.+.w.O.+.w.w.w.w.w.8Xw.r.w.w.9Xr.w.r.r.r.9Xe.e.e.s.e.e.s.yXs.yXs.s.s.s.f.s.s.f.f.d.f.f.s.d.d.f.d.d.d.d.d.d.d.d.d.d.d.p.a.a.p.t.a.a.t.a.t.a.a.t.9.t.9.t.t.1.t.1.=.1.1.1.%.1.%.1.%.%.$.%.$.%.$.%.%.@.%.@.@.@.$.@.@.@.@.@.@.@.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX| | | | | | | | N. .| | | .| .| . . .| . . . . . . .o.o. . .o.o. .o.o.} o.o.o.o.o.o.o.o.+.....+.+...+.X.+.+.+.X.+.+.+.0.X.w.w.w.w.w.w.w.w.r.w.r.r.r.r.r.e.9Xe.r.e.e.e.e.e.e.e.s.e.s.s.s.s.s.f.s.s.f.f.s.s.f.f.d.f.a.d.f.p.f.d.d.p.d.d.p.p.p.a.p.a.a.t.a.a.t.a.t.t.t.t.t.9.t.1.t.1.1.1.1.1.%.1.1.%.%.1.$.1.%.%.$.%.%.$.$.@.$.$.@.@.@.@.@.@.@.@.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXN.| | | | | | | | | | | | .| | .| | . . . . .o. . . . . . .o.} ... .o.o...o.o.o...o.....o.+.+...o.+...+.o.X.+.+.X.w.+.+.w.+.w.+.0.w.w.w.w.w.w.r.w.w.w.e.r.r.r.e.r.e.e.s.r.s.e.e.s.s.s.s.s.s.s.s.s.f.s.s.p.f.s.u.f.f.p.s.d.p.p.d.p.p.p.p.p.p.p.a.h.a.a.a.a.i.t.a.1.i.9.t.t.t.t.1.t.1.=.1.1.1.1.%.1.%.%.%.%.$.%.$.$.$.@.%.$.@.$.@.$.@.$.@.@.@.@.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX| | | | | | | | | | | | | | .| .| . . . . . .} . . . . . .o. .o.} .o...o...o...o.o.....+.o.........+...+.X.X.+.+.X.w.+.w.w.w.w.+.w.w.w.w.r.w.r.r.r.r.r.r.r.r.e.r.s.r.s.e.s.s.s.s.s.s.s.s.u.s.p.s.s.f.s.p.p.f.a.s.p.d.a.d.p.d.p.d.p.p.p.p.a.h.p.a.a.t.a.t.i.t.i.1.t.a.1.1.1.t.1.t.1.1.%.1.1.1.%.1.1.1.$.%.$.%.$.$.$.$.@.$.@.@.@.@.@.@.@.@.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX{ | | | { | | | | | | { | . .| } .| } | } . . .} } o.} } ...} o... .o.} o.o.} o...o.o.....+.X.o.....+.X.X.+.+.X.+.+.0.+.+.X.w.0.w.0.w.r.w.w.r.w.w.w.r.r.r.e.r.r.r.e.r.s.s.e.e.s.s.q.s.s.s.f.s.s.f.u.s.p.d.u.f.p.s.p.f.p.p.p.p.p.p.p.p.p.a.a.a.a.a.a.i.t.a.i.t.a.t.1.a.1.1.1.1.t.1.1.1.1.<.%.1.%.$.%.1.$.$.%.$.%.@.$.$.@.$.$.@.$.$.@.@.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX| | | | | | { { | | .| { | { | } | .{ .} .} . .} . .o.} . ...o...} o.} o.......o.............X.o.+...+...X.+.+.0.+.+.0.+.w.w.0.w.0.w.w.0.w.r.r.r.r.r.r.r.r.e.s.e.s.r.r.s.e.e.s.s.s.s.u.s.u.f.u.f.u.f.s.f.p.s.a.d.d.d.p.p.p.p.p.i.p.p.p.a.a.a.a.a.9.a.9.1.a.1.8.1.1.t.1.1.1.1.1.1.1.1.%.1.%.<.<.%.$.%.%.$.%.$.$.$.$.$.$.@.$.@.@.@.@.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX| { | { | | | | { | { | } { .| | } .{ .} .} } .} } } o.} .. .} o.} ..} ..o.} ..........o.....X...X...X.+.X.X.X.+.0.0.+.0.X.w.w.w.0.w.r.w.0.r.w.0.r.w.r.r.q.r.q.r.q.e.s.q.s.u.s.q.s.u.s.s.s.u.f.u.f.u.p.u.u.d.p.u.u.p.u.d.p.p.p.p.p.i.i.i.i.a.i.a.t.i.t.i.9.t.1.a.i.1.a.1.1.1.1.1.1.1.<.1.1.<.%.%.<.$.$.$.$.$.$.$.$.@.$.$.@.$.$.@.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX| | { | | { | { { | | { | } | } | .{ .} | } } .} } } .} o.} } ..} } o.....} ..} ................X...X.+.X.+.X.X.+.+.w.X.w.0.w.0.w.0.r.0.w.r.0.r.q.r.q.r.q.r.q.r.e.q.q.s.s.e.s.r.q.s.u.s.u.s.f.u.u.s.u.p.u.a.u.f.p.a.p.a.p.a.i.p.i.p.i.i.i.i.a.9.9.a.a.8.i.1.t.9.1.9.1.9.9.1.1.<.1.1.%.1.1.<.%.$.<.%.$.$.<.$.$.$.@.$.$.$.@.$.@.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX{ | { { | { | | { { | | { } { } { { } } . .} .} .} } } } } ..} } ....} ..} ........................X...X.X.+.X.0.X.+.0.X.w.X.w.0.w.0.w.r.0.q.w.w.r.r.r.r.r.r.e.q.s.s.r.q.u.u.u.s.s.s.f.u.u.u.f.u.p.f.u.f.f.a.p.u.p.u.a.a.a.p.p.i.i.i.i.a.a.i.a.a.8.1.t.9.i.9.t.9.1.1.1.1.1.1.1.1.1.1.<.<.%.<.%.<.$.$.$.$.$.$.$.$.$.$.@.$.@.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX{ { | | { | { { { | { { .{ .| } } | } { { } { } } } } } } } ..} ..} } } ....} ..} ......] ..X.X...X.X...X.X.+.0.X.+.0.w.X.0.w.0.w.0.0.w.r.0.w.0.r.q.0.r.r.q.q.s.q.r.q.s.q.s.q.s.s.u.u.u.u.f.u.s.f.u.u.p.p.u.a.u.a.u.p.a.a.a.i.i.i.i.i.i.9.a.9.a.a.t.i.8.8.1.1.8.1.9.9.1.1.1.1.1.1.<.1.<.1.1.$.1.$.1.$.<.$.$.$.$.$.$.$.@.@.$.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX| { { { { { | { { { { { { { } { { } { } } } } } } } } } ..} } } } } } ..} ..] ..} ] _ ............X.X.X.+...X.X.X.X.X.X.0.+.X.X.w.0.0.w.0.w.0.r.q.w.r.q.r.q.r.q.r.u.r.q.s.q.s.q.q.u.u.s.u.s.u.u.u.u.u.u.u.p.u.p.a.a.a.a.a.a.a.i.i.i.i.i.i.8.i.i.9.9.t.9.t.9.8.1.9.1.9.1.1.9.1.<.1.<.$.1.$.<.1.$.<.$.$.<.$.$.$.$.$.$.$.$.$.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX{ | { { { { { { { { { } { { } { } } { } } { } { } } } } } _ } } ..} ....} } } ] ......] ............X.X.X...X.X.X.X.X.X.0.0.0.0.0.0.0.0.q.0.r.0.r.0.0.r.q.r.q.r.r.q.q.s.q.u.s.q.s.u.u.u.s.u.u.s.a.u.u.p.u.a.u.a.u.u.a.a.i.i.i.i.i.i.i.8.i.8.1.i.i.8.1.8.9.1.9.1.1.1.1.7.1.1.<.1.1.1.<.<.1.<.<.$.<.<.$.$.<.$.$.$.$.$.$.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX{ { | { { { { { { { { { { { { { { } } { } } _ } } } } } _ } _ } _ } _ ] } ] .._ _ ........X.] X.X...X...X.X.X.X.X.0.+.0.X.w.0.w.w.0.w.0.0.0.r.q.q.r.r.q.q.q.q.q.u.r.q.u.r.u.u.u.s.q.u.u.u.a.u.u.p.u.p.u.u.i.a.a.a.a.i.u.u.8.8.i.8.i.i.8.i.i.8.8.8.9.9.9.9.9.9.9.9.1.1.<.1.5.1.<.<.1.$.<.<.$.1.$.$.<.$.$.$.$.$.$.$.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX{ { { { { { { { { { { { } { } } { { } { } } } } } _ } } _ } } } _ _ } } ] _ ..] ......] ..[ ....X...X.X.X.X.X.0.X.0.+.X.0.X.0.0.0.0.0.0.r.q.0.0.r.0.q.q.r.r.q.q.s.r.u.u.q.q.u.s.u.u.u.u.u.u.u.u.a.u.u.a.u.a.u.u.a.a.9.8.a.i.i.i.8.8.8.8.8.8.8.8.8.1.8.9.1.7.1.9.<.7.1.<.1.1.<.1.<.$.<.<.<.<.$.$.$.$.<.$.$.<.$.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX{ { { { { { { ) { { { ) { { { ) } ) } ) ) } ) } } _ } _ _ } .._ } ] _ } _ _ } ] ] ] ..] ....] X.[ X.X.X.[ X.X.X.X.X.0.X.0.0.w.0.0.0.0.0.0.0.q.q.0.q.q.q.q.q.q.q.q.q.q.q.u.u.q.q.u.u.u.u.u.u.u.u.u.a.u.a.6.a.8.8.u.a.a.i.8.8.8.i.8.8.8.8.8.7.8.1.9.8.7.1.9.7.1.1.7.<.1.9.<.<.1.<.1.<.<.$.<.<.<.<.$.$.$.<.$.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX{ { { ) ) { { { { ) { { ) { ) } { _ } _ { } { _ _ } ) } } _ _ _ } _ _ _ ] } ..] } ..] ..] X...X.] X.X.[ [ X.X.X.X.0.X.0.0.0.0.0.0.0.q.0.0.q.0.q.0.q.q.q.q.q.q.q.u.q.u.q.u.q.u.u.u.u.u.u.6.u.u.a.u.u.u.8.u.8.u.8.u.8.i.9.a.9.8.8.8.8.8.8.8.8.9.9.9.1.7.7.7.1.4.1.5.7.<.1.5.1.<.<.<.1.<.<.<.$.<.<.$.$.$.$.$.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX{ ) { { { ) { { { ) { { ) { ) ) { ) { _ ) _ } ) _ _ _ _ _ _ } _ _ _ } _ ] _ ] ] ] ..] ..] ] [ ..X...X.X.X.X.0.X.[ 0.X.X.0.X.0.0.0.0.0.q.0.q.0.q.0.q.q.q.q.q.q.q.q.q.u.q.u.q.u.u.q.u.u.u.u.6.u.u.9.u.u.9.u.u.9.9.8.9.a.9.8.8.8.8.8.8.8.8.7.9.9.7.7.7.1.1.5.1.9.1.<.4.<.1.<.<.<.<.<.<.$.$.<.<.$.$.<.<.$.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX{ ) { { ) { ) ) ) { { ) } ) } ) { _ _ ) ) } } ) _ } _ _ _ _ _ _ _ _ _ ] _ ..} ] ] ] ......[ [ ..[ X.X...X.[ X.0.X.>.0.X.[ 0.0.>.0.0.0.q.0.0.q.q.q.0.0.q.q.q.q.u.q.q.6.q.u.u.q.u.q.u.6.u.a.u.u.u.9.i.6.a.8.9.u.u.9.8.a.9.8.8.7.8.8.7.8.8.7.9.7.7.7.1.7.5.7.<.1.<.<.<.<.<.<.<.<.<.<.<.<.$.<.$.<.$.$.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX{ ) ) { ) ) { ) { ) { ) { ) ) _ ) { _ ) _ _ ) _ ) ) _ _ _ _ _ _ _ _ _ _ ] ] ] ] ..] ] ] ....[ X.] [ X.X.X.X.[ X.>.X.0.0.0.0.0.0.0.0.0.0.q.0.q.q.q.q.q.q.q.,.q.u.q.q.u.q.6.u.6.6.u.6.u.6.u.6.9.6.u.a.6.6.a.9.8.9.u.9.9.9.9.8.8.7.8.7.7.7.9.7.1.4.7.4.1.1.5.4.7.9.<.7.<.<.<.<.<.<.<.<.<.<.<.$.<.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX) { ) ) ) { ) ) ) ) ) ) { ) ) _ ) ) ) _ ) _ ) _ _ _ _ _ _ _ _ ] _ _ ] _ ] } ] ] ] ] ] ] X.] X.] X.[ [ X.[ X.[ 0.X.>.0.[ [ 0.0.0.q.>.q.0.0.q.>.0.q.q.,.q.q.q.q.6.,.u.q.6.q.u.u.,.u.u.9.u.6.u.6.u.6.9.u.9.u.9.u.9.9.9.7.7.8.9.8.7.7.7.7.7.7.9.7.7.7.1.5.1.5.<.5.<.5.<.5.<.<.<.<.<.<.<.<.$.<.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX) ) { ) { { ) ) ) ) ) ) ) ) ) _ ) _ ) _ ) _ ) ) _ ) / _ _ _ _ _ ] _ ] ] ] ] ] ..] [ ....[ [ ..[ X.[ [ X.>.[ X.0.[ >.0.0.0.0.>.0.0.>.>.q.>.q.,.0.,.q.q.q.,.q.q.q.q.u.q.6.6.6.u.u.6.6.u.u.6.6.9.u.u.9.6.9.8.9.9.6.9.6.9.9.7.7.7.7.7.7.9.5.4.4.<.4.5.4.1.<.4.<.5.<.<.5.<.5.<.<.<.<.<.<.<.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) ) ) ( ) _ _ ( ) ( _ _ _ _ ] _ _ ] ] ] ] ..] ] [ ] [ [ [ X.X.X.[ X.>.0.[ 0.X.>.0.>.>.0.0.>.0.q.0.q.0.,.q.,.q.,.,.q.,.q.q.6.,.u.6.q.,.u.6.6.6.u.u.u.u.9.6.9.6.9.9.6.6.9.8.9.9.7.7.7.7.7.7.7.7.4.4.7.7.<.4.<.7.5.4.<.5.<.3.<.<.5.<.<.<.<.<.<.<.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX) ) ) ) ) ) ) ) ) ) ) ) _ ) ) / ) _ _ ) ( ) ( ) _ ( _ ( ] _ _ _ ] _ ] ] ] ] ] ] ..[ ..[ ] ] [ [ X.[ X.[ X.>.>.X.[ 0.0.>.>.0.0.>.>.q.>.q.>.q.q.,.q.,.q.,.,.u.,.,.q.6.u.6.,.u.6.6.6.6.6.6.6.9.u.6.9.6.9.9.6.9.9.9.9.7.7.7.7.7.4.7.7.4.7.4.4.7.<.5.5.4.<.5.<.<.<.<.<.<.<.<.<.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX) ) ) ) ) ) ) ) ) / ) ) ) / ( ) ) / ) ( ) ( ) ( _ _ _ ( _ ] _ ] _ ] ] ] ] ] ] ] [ ] [ ] [ [ [ [ [ [ >.>.[ [ >.[ 0.>.0.0.>.>.,.0.,.0.,.q.0.,.q.,.q.,.,.q.,.,.,.u.q.6.6.6.,.6.u.6.6.9.6.6.6.9.6.9.6.9.6.7.9.7.9.7.9.4.4.7.4.7.4.4.7.4.4.5.<.4.4.5.<.<.5.<.5.<.5.3.<.<.<.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX) ) / ) / ) / ) ) ) / ) ) ) ) / _ / ) ( ) ( ) ( ( _ ( _ ( _ _ ` _ ] _ ] ] ] ] ] [ ] [ X.[ X.[ X.X.[ X.X.0.X.>.>.>.>.>.0.>.0.0.>.,.0.>.,.,.,.,.q.q.,.,.,.u.,.,.6.q.6.u.6.6.6.6.6.6.6.6.9.6.9.6.9.6.9.7.2.6.7.9.7.4.9.4.7.4.4.4.4.4.4.4.5.4.<.5.5.3.<.5.<.5.<.<.<.<.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX) / ) ) / ) / ) / ) / / ) ( / ( ) / ) ( ( ( _ ( _ _ _ _ ] _ ] ] ] ] ] ] ` ] [ ] [ [ [ ] [ [ [ [ [ [ >.[ >.0.[ 0.[ >.>.>.>.>.,.>.,.,.>.>.,.>.,.q.,.q.,.u.,.,.,.6.,.6.,.6.6.6.6.6.6.6.4.9.6.4.6.6.4.9.7.4.4.7.7.2.7.4.4.4.4.4.4.5.4.5.5.5.5.5.<.<.3.5.<.<.<.<.<.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX) ) / ) ) / / ) / ) / / / ) / ) / ( / ) ) ( ( _ ( ( ( ] ( ( ` _ ` ] ] ] ] ] ` [ ] ] [ [ [ [ [ [ [ >.[ [ >.[ >.>.X.>.>.0.>.>.,.0.>.,.q.,.q.,.,.,.,.,.,.,.6.6.,.6.6.6.,.6.6.6.6.6.6.6.2.6.4.6.6.4.6.2.4.6.4.2.7.5.9.4.4.4.4.4.4.5.5.5.5.5.5.3.5.3.<.5.<.5.3.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX) ) / / / / ) / ) / ) / / / / / / ( ) ( _ _ ( _ ] ( _ ] ( ] ] ] ] ] ] ] ' ] ] [ ] [ [ [ [ [ [ [ >.>.>.[ [ >.>.>.0.>.>.>.,.>.>.,.,.,.,.>.,.,.,.,.,.6.,.,.6.,.6.6.6.6.6.6.2.6.6.6.6.6.4.6.2.9.7.9.6.7.4.6.4.4.4.2.4.3.4.4.4.3.3.5.5.<.3.<.3.5.3.<.3.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX/ ) / ) / / / / / / / / / / / ( / ( / / ( ( ( ( _ ` _ ] ] ( ` ] ` ] ] ] [ [ ] [ [ [ ] [ [ >.[ [ [ [ >.>.>.>.>.>.>.>.,.,.>.>.,.>.>.,.,.,.,.,.,.,.,.,.6.,.6.,.,.,.6.6.,.6.6.6.2.6.4.6.9.9.2.2.9.4.2.4.4.4.4.4.4.4.4.3.3.5.3.5.3.3.3.3.<.3.<.<.5.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX/ / / / / / / / / / / / / / / ) / _ ( ) _ ( ( ( _ ( ( ] ] _ ` ] ] ` ` ` ] [ [ ] [ [ [ [ [ ' >.[ [ >.[ >.>.[ >.>.>.>.>.,.>.>.,.>.,.,.,.,.,.,.:.,.,.,.:.6.:.6.6.6.2.6.2.6.6.6.2.6.4.2.2.2.7.2.5.2.7.5.2.4.4.5.4.3.3.3.3.3.3.3.3.5.5.3.3.3.5.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX/ / / / / / / / / / / / / ( ( / ( ( ( ( _ ( ` _ ` ( ` ] ] ` ` ] ] [ [ ` ` [ ' ] ' [ [ [ [ [ [ >.>.[ ;.>.>.>.>.>.>.>.>.,.>.,.>.:.,.,.,.,.,.,.6.,.2.,.6.,.6.,.6.2.6.2.2.6.6.2.2.6.6.4.2.7.2.4.2.4.4.5.5.5.3.4.4.4.3.3.3.3.3.3.<.3.<.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX/ / / / / / / / / / / / / ( ( / / ( ( ( ( _ ( _ ` ` ( ` ] ` ] ' ] ] ' [ ` [ [ ' ' [ [ [ [ >.>.[ ;.>.>.>.>.>.>.>.>.>.>.,.>.,.:.>.,.,.>.,.,.:.2.,.,.2.6.6.:.6.2.2.6.2.6.2.6.6.4.2.6.2.5.7.2.4.5.2.4.5.5.5.3.3.3.3.3.3.3.3.3.3.3.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX/ / / / / / / / / / ( / / ( ( ( ( ( ` ( ` ( ` ] ( ( ` ] ` ] ] ` ] ] [ ` [ [ [ [ ' ' >.' [ [ >.>.' >.;.>.;.>.:.>.:.;.,.>.,.,.:.,.:.:.,.,.,.,.2.,.,.,.6.:.6.2.2.6.2.6.2.2.2.4.2.4.2.2.5.2.5.5.5.5.5.3.3.5.3.3.3.3.3.3.3.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX/ / / / / / / / / ( / ( ( / ( ( ( ( ( ( _ ( ` ` ] ` ] ` ` ` ] ' ' ` [ [ [ [ ' [ ' [ ' >.;.>.>.>.;.>.>.>.;.>.>.>.>.,.;.,.>.,.:.,.:.,.:.,.:.,.:.2.2.:.,.2.,.2.2.6.2.2.6.2.2.2.2.5.4.2.5.5.3.2.5.5.3.3.3.3.3.3.3.3.3.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX/ / / / / / / / / ( / ( ( / ( ( ( ( ( ` ( ] ( ` ` ` ] ` ` ` ` [ ` ' ' ` [ ' [ ' [ ' [ ' ' >.>.' ;.>.;.>.;.,.:.>.,.;.:.:.>.:.,.:.,.:.,.2.6.:.:.6.2.:.6.2.2.6.2.2.2.4.2.2.5.2.2.5.5.2.3.3.3.2.2.3.3.3.3.3.3.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX/ / / / / / / ( ( / ( ( ( ( ( ( ( ` ` ( ` ` ` ` ` ] ` [ ` [ ] ' ` ' [ ' ' [ ' >.' >.;.>.' >.' >.>.;.>.;.,.;.>.:.>.>.:.,.,.:.,.,.:.,.2.,.2.:.2.6.2.2.2.:.2.6.2.2.2.3.2.2.2.3.3.2.2.3.3.2.3.2.3.3.3.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX/ / ( / / / / ( / ( ( ( ( ( ( ( ( ` ] ( ` ` ` ` ` ` ` ` ' ` [ ' ] ' ' [ ' [ ' ' [ ' >.;.;.;.;.>.;.>.;.>.:.>.:.:.;.:.:.:.:.:.:.:.:.:.,.2.2.:.:.2.2.2.2.2.5.2.2.2.2.3.2.2.2.3.2.3.2.3.3.3.3.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX/ / / ( / ( ( ( ( ( ( ( ( ` ` ( ( ` ( ` ` ` ` [ ` ' ] ' ` ' ' ' ' ' ' ' >.' ' >.;.;.>.' ;.;.;.>.;.>.;.:.;.,.,.;.:.>.,.:.,.2.:.2.2.:.:.2.:.2.2.2.2.2.2.2.2.2.2.2.3.2.3.2.2.3.3.3.3.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX/ / ( / / ( ( ( ( ( ( ( ( ( ` ( ` ` ` ` ` ` ` ` ' ` ' [ ` ' [ ' ' [ ' ;.;.' [ [ ;.;.>.;.;.;.;.:.>.:.;.:.;.:.:.:.:.:.:.:.,.:.:.2.:.:.2.2.:.2.2.2.2.2.2.3.2.2.3.2.2.2.3.2.3.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX/ ( ( ( / ( ( ( ( ( ` ( ` ` ( ( ` ` ` ` ` ' ` ' ` ' ' ' ' ' ' ' ' ' ' ;.;.' ;.;.;.;.;.;.;.>.;.:.;.:.;.:.:.:.:.:.:.:.:.:.2.:.2.2.2.:.2.:.2.2.2.2.2.2.2.2.3.2.2.2.3.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX/ ( ( ( ( ( ( ( ( ` ( ` ` ` ` ` ` ` ` ` ` ` ' ` ` ' ` ' ' ' ' ;.;.' ' ;.;.' ;.;.;.;.;.;.;.;.:.;.:.;.:.;.:.;.:.:.:.:.:.:.:.:.:.2.2.:.:.2.2.2.2.2.2.2.2.2.3.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX( ( ( ( ( ( ( ( ( ( ` ` ` ` ` ` ' ` ' ' ' ' ` ' ' ' ' ' ' ' ' ' ;.;.;.' ;.;.;.;.;.;.:.;.:.;.:.;.;.:.:.:.:.:.:.2.:.:.2.:.2.2.2.2.:.2.2.2.2.3.2.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX( ( ( ` ` ( ` ` ( ` ` ` ` ` ` ` ` ` ' ' ' ' ` ' ' ' ;.' ' ;.' ' ;.;.' ;.;.;.;.;.;.:.;.:.:.:.:.:.:.:.:.:.:.:.:.:.2.:.:.2.2.2.2.2.2.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX( ( ` ( ( ( ` ` ` ` ` ` ' ` ' ` ' ' ` ' ' ' ' ' ;.' ;.' ;.' ;.;.;.;.;.;.;.:.;.:.;.;.:.:.;.:.:.:.:.:.2.:.2.:.2.2.2.2.2.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX` ` ` ` ` ` ` ` ` ` ` ` ' ` ' ' ' ' ' ' ' ' ' ;.;.' ;.;.' ;.;.;.;.;.;.;.;.;.:.:.;.:.:.:.:.:.:.:.:.:.2.:.:.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX` ` ` ` ` ' ' ' ` ' ` ' ' ' ' ' ' ' ;.' ;.' ;.' ;.;.;.;.;.;.:.;.:.:.;.:.:.:.:.:.:.:.:.:.:.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX` ` ` ' ` ` ' ` ' ' ' ;.' ' ' ' ;.' ;.' ;.;.;.;.;.;.;.;.;.;.;.;.:.;.:.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX", "IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX' ' ' ' ' ' ' ' ;.' ;.;.' ;.;.;.;.;.;.;.;.IXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX" }; xforms-1.2.4/demos/cursor.c0000644000175000017500000001102312251644130012540 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Cursor routines demo. * * This file is part of xforms package * T.C. Zhao and M. Overmars (1997) * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" #include "bm1.xbm" #include "bm2.xbm" static int animated = 0; typedef struct { FL_FORM * cursor; void * vdata; char * cdata; long ldata; } FD_cursor; extern FD_cursor * create_form_cursor( void ); /* callbacks for form cursor */ /*************************************** ***************************************/ void setcursor_cb( FL_OBJECT * ob, long data ) { fl_set_cursor( FL_ObjWin( ob ), data ); } /*************************************** ***************************************/ void setbitmapcursor_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { static int bitmapcur; if ( ! bitmapcur ) bitmapcur = fl_create_bitmap_cursor( ( char * ) bm1_bits, ( char * ) bm2_bits, bm1_width, bm1_height, bm1_width / 2, bm1_height / 2 ); fl_set_cursor( FL_ObjWin( ob ), bitmapcur ); } /*************************************** ***************************************/ void setanimatedcursor_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_set_cursor( FL_ObjWin(ob), animated ); } /*************************************** ***************************************/ void done_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_free( ob->form->fdui ); fl_finish( ); exit( 0 ); } int curs[ ] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -1 }; /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FD_cursor *fd_cursor; fl_set_border_width( -2 ); fl_initialize( &argc, argv, "FormDemo", 0, 0 ); fd_cursor = create_form_cursor( ); /* fill-in form initialization code */ fl_set_cursor_color( XC_watch, FL_BLACK, FL_RED ); animated = fl_create_animated_cursor( curs, 100 ); fl_show_form( fd_cursor->cursor, FL_PLACE_CENTER, FL_FULLBORDER, "cursor" ); fl_do_forms( ); return 0; } /*************************************** ***************************************/ FD_cursor * create_form_cursor( void ) { FL_OBJECT *obj; FD_cursor *fdui = fl_calloc(1, sizeof *fdui ); fdui->cursor = fl_bgn_form( FL_NO_BOX, 325, 175 ); fl_add_box( FL_UP_BOX, 0 ,0, 325, 175, "" ); fl_add_frame( FL_EMBOSSED_FRAME, 10, 10, 305, 120, "" ); obj = fl_add_button( FL_NORMAL_BUTTON, 20, 20, 50, 25, "Hand" ); fl_set_object_callback( obj, setcursor_cb, XC_hand2 ); obj = fl_add_button( FL_NORMAL_BUTTON, 70, 20, 50, 25, "Watch" ); fl_set_object_callback( obj, setcursor_cb, XC_watch ); obj = fl_add_button( FL_NORMAL_BUTTON, 120, 20, 60, 25, "Invisible" ); fl_set_object_callback( obj, setcursor_cb, FL_INVISIBLE_CURSOR ); obj = fl_add_button( FL_NORMAL_BUTTON, 180, 20, 62, 25, "Animated" ); fl_set_object_callback( obj, setanimatedcursor_cb, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 242, 20, 62, 25, "BitmapCur" ); fl_set_object_callback( obj, setbitmapcursor_cb, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 90, 70, 140, 50, "DefaultCursor" ); fl_set_button_shortcut( obj, "Dd#d", 1); fl_set_object_callback( obj, setcursor_cb, FL_DEFAULT_CURSOR ); obj = fl_add_button( FL_NORMAL_BUTTON, 250, 140, 60, 25, "Done" ); fl_set_object_callback( obj, done_cb, 0 ); fl_end_form( ); fl_adjust_form_size( fdui->cursor ); return fdui; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/objinactive.c0000644000175000017500000001131512251643542013532 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* Demo showing activating and deactivating objects */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "include/forms.h" FL_FORM *form; FL_OBJECT *button1, *button2, *button3, *button4, *group, *firstbut; /*************************************** ***************************************/ void exit_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { fl_finish( ); exit( 0 ); } /*************************************** ***************************************/ void setit( FL_OBJECT * obj, int val ) { if ( val ) { fl_set_object_lcolor( obj, FL_BLACK ); fl_activate_object( obj ); } else { fl_set_object_lcolor( obj, FL_INACTIVE ); fl_deactivate_object( obj ); } } /*************************************** ***************************************/ void doit( int b1, int b2, int b3, int b4 ) { setit( button1, b1 ); setit( button2, b2 ); setit( button3, b3 ); setit( button4, b4 ); } /*************************************** ***************************************/ void set_active( FL_OBJECT * obj FL_UNUSED_ARG, long arg) { switch ( arg ) { case 0 : doit( 1, 1, 1, 1 ); break; case 1 : doit( 0, 0, 0, 0 ); break; case 2 : doit( 0, 1, 0, 1 ); break; case 3 : doit( 1, 0, 1, 0 ); break; } } /*************************************** ***************************************/ void create_form( void ) { FL_OBJECT *obj; form = fl_bgn_form( FL_NO_BOX, 420, 230 ); obj = fl_add_box( FL_UP_BOX, 0, 0, 420, 230, "" ); fl_set_object_color( obj, FL_SLATEBLUE, FL_COL1 ); button1 = obj = fl_add_button( FL_NORMAL_BUTTON, 20, 170, 150, 40, "Button 1" ); fl_set_object_lsize( obj ,FL_LARGE_SIZE ); fl_set_button_shortcut( obj, "1", 1 ); button2 = obj = fl_add_button( FL_NORMAL_BUTTON, 20, 120, 150, 40, "Button 2" ); fl_set_object_lsize( obj, FL_LARGE_SIZE ); fl_set_button_shortcut( obj, "2", 1 ); button3 = obj = fl_add_button( FL_NORMAL_BUTTON, 20, 70, 150, 40, "Button 3" ); fl_set_object_lsize( obj, FL_LARGE_SIZE ); fl_set_button_shortcut( obj, "3", 1 ); button4 = obj = fl_add_button( FL_NORMAL_BUTTON, 20, 20, 150, 40, "Button 4" ); fl_set_button_shortcut( obj, "4", 1 ); fl_set_object_lsize( obj,FL_LARGE_SIZE ); group = fl_bgn_group( ); firstbut = obj = fl_add_lightbutton( FL_RADIO_BUTTON, 260, 180, 140, 30, "All active" ); fl_set_object_callback( obj, set_active, 0 ); obj = fl_add_lightbutton( FL_RADIO_BUTTON, 260, 150, 140, 30, "Non active" ); fl_set_object_callback( obj, set_active, 1 ); obj = fl_add_lightbutton( FL_RADIO_BUTTON, 260, 120, 140 ,30, "Even active" ); fl_set_object_callback(obj, set_active, 2 ); obj = fl_add_lightbutton( FL_RADIO_BUTTON, 260, 90, 140, 30, "Odd active" ); fl_set_object_callback( obj, set_active, 3 ); fl_end_group( ); obj = fl_add_button( FL_NORMAL_BUTTON, 270, 20, 130, 30, "Quit" ); fl_set_object_callback( obj, exit_cb, 0 ); fl_end_form( ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_initialize( &argc, argv, "FormDemo", 0, 0 ); create_form( ); fl_set_button( firstbut, 1 ); fl_show_form( form, FL_PLACE_CENTER, FL_NOBORDER, NULL ); while ( fl_do_forms( ) ) /* empty */ ; return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/formbrowser.c0000644000175000017500000001005112251644015013574 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include #include "fd/formbrowser_gui.h" /*************************************** ***************************************/ void done_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_finish( ); exit( 0 ); } /*************************************** ***************************************/ void hide_show_cb( FL_OBJECT * ob, long data ) { FD_mainform *fdui = ob->form->fdui; ( data ? fl_show_object : fl_hide_object )( fdui->formbrowser ); } /*************************************** ***************************************/ void reshow_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_hide_form( ob->form ); fl_show_form( ob->form, FL_PLACE_POSITION, FL_FULLBORDER, "formbrowser" ); } /*************************************** ***************************************/ void scroll_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { static int n; FD_mainform *fdui = ob->form->fdui; fl_set_object_label( ob, n ? "Jump" : "Smooth" ); fl_set_formbrowser_scroll( fdui->formbrowser, n ^= 1 ); } /*************************************** ***************************************/ void deactivate_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_mainform *fdui = ob->form->fdui; if ( fl_object_is_active( fdui->formbrowser ) ) { fl_set_object_label( ob, "Activate" ); fl_deactivate_object( fdui->formbrowser ); } else { fl_set_object_label( ob,"Deactivate" ); fl_activate_object( fdui->formbrowser ); } } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FD_buttonform *fd_buttonform; FD_staticform *fd_staticform; FD_mainform *fd_mainform; FD_valuatorform *fd_valuatorform; FD_choiceform *fd_choiceform; FD_big *fd_big; fl_set_border_width( -2 ); fl_initialize( &argc, argv, 0, 0, 0 ); fd_buttonform = create_form_buttonform( ); fd_staticform = create_form_staticform( ); fd_mainform = create_form_mainform( ); fd_valuatorform = create_form_valuatorform( ); fd_choiceform = create_form_choiceform( ); create_form_inputform( ); fd_big = create_form_big( ); { float xx[ 5 ] = { 1, 2, 3, 4, 5 }; float yy[ 5 ] = { 1, 2, 3, 4, 5 }; fl_set_xyplot_data( fd_big->xyplot, xx, yy, 5, "title", "x", "y" ); } /* fl_set_object_boxtype( fd_mainform->formbrowser, FL_SHADOW_BOX ); */ fl_addto_formbrowser( fd_mainform->formbrowser, fd_buttonform->buttonform ); fl_addto_formbrowser( fd_mainform->formbrowser, fd_valuatorform->valuatorform); fl_addto_formbrowser( fd_mainform->formbrowser, fd_big->big); fl_addto_formbrowser( fd_mainform->formbrowser, fd_choiceform->choiceform ); fl_addto_formbrowser( fd_mainform->formbrowser, fd_staticform->staticform ); /* show the first form */ fl_show_form( fd_mainform->mainform, FL_PLACE_CENTERFREE, FL_FULLBORDER, "buttonform" ); fl_do_forms( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/ll.c0000644000175000017500000001306412251643653011652 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include #include /**** Forms and Objects ****/ typedef struct { FL_FORM * axypform; void * vdata; long ldata; FL_OBJECT * xyplot; FL_OBJECT * status; } FD_axypform; extern FD_axypform * create_form_axypform( void ); #define LOG FD_axypform *xypui; /* callbacks for form axypform */ /*************************************** ***************************************/ void xyplot_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { float x, y; int i; char buf[ 64 ]; fl_get_xyplot( ob, &x, &y, &i ); fl_object_ps_dump( ob, "test.ps" ); if ( i < 0 ) return ; sprintf( buf, "X=%g Y=%g", x, y ); fl_set_object_label( xypui->status, buf ); } /*************************************** ***************************************/ void alwaysreturn_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_set_xyplot_return( xypui->xyplot, fl_get_button( ob ) ); } /*************************************** ***************************************/ void interpolate_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { #ifdef LOG fl_set_xyplot_interpolate( xypui->xyplot, 0, fl_get_button(ob) ? 2 : 0, 20000 ); #else fl_set_xyplot_interpolate( xypui->xyplot, 0, fl_get_button( ob ) ? 2 : 0, 0.2 ); #endif } /*************************************** ***************************************/ void inspect_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_set_xyplot_inspect( xypui->xyplot, fl_get_button( ob ) ); } /*************************************** ***************************************/ void notic_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { int notic = fl_get_button( ob ); if ( notic ) { fl_set_xyplot_xtics( xypui->xyplot, -1, -1 ); fl_set_xyplot_ytics( xypui->xyplot, -1, -1 ); } else { fl_set_xyplot_xtics( xypui->xyplot, 0, 0 ); fl_set_xyplot_ytics( xypui->xyplot, 0, 0 ); } } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { float x[ 25 ], y[ 25 ]; int i; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); xypui = create_form_axypform( ); fl_set_object_dblbuffer( xypui->status, 1 ); for ( i = 0; i <= 10; i++ ) #ifdef LOG x[ i ] = y[ i ] = pow( 10, i - 12 ); #else x[ i ] = y[ i ] = i; #endif fl_set_xyplot_data( xypui->xyplot, x, y, 11, "", "", "" ); #ifdef LOG fl_set_xyplot_xscale( xypui->xyplot, FL_LOG, 5 ); fl_set_xyplot_yscale( xypui->xyplot, FL_LOG, 5 ); fl_set_xyplot_xbounds( xypui->xyplot, 0.01, 10 ); fl_set_xyplot_ytics( xypui->xyplot, 3, 5 ); fl_set_xyplot_xgrid( xypui->xyplot, FL_GRID_MINOR ); /* fl_set_xyplot_ygrid( xypui->xyplot, 2 ); */ #endif fl_show_form( xypui->axypform, FL_PLACE_MOUSE, FL_TRANSIENT, "axypform" ); fl_do_forms( ); fl_finish( ); return 0; } /*************************************** ***************************************/ FD_axypform * create_form_axypform( void ) { FL_OBJECT *obj; FD_axypform *fdui = fl_calloc( 1, sizeof *fdui ); fdui->axypform = fl_bgn_form( FL_NO_BOX, 431, 301 ); fl_add_box( FL_UP_BOX, 0, 0, 431, 301, "" ); fdui->xyplot = obj = fl_add_xyplot( FL_ACTIVE_XYPLOT, 20, 50, 285, 235, "" ); fl_set_object_boxtype( obj, FL_DOWN_BOX ); fl_set_object_color( obj, FL_BLACK, FL_GREEN ); fl_set_object_lalign( obj, fl_to_inside_lalign( FL_ALIGN_BOTTOM ) ); fl_set_object_callback( obj, xyplot_cb, 0 ); obj = fl_add_checkbutton( FL_PUSH_BUTTON, 315, 40, 80, 25, "AlwaysReturn" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_object_callback( obj, alwaysreturn_cb, 0 ); obj = fl_add_checkbutton( FL_PUSH_BUTTON, 315, 65, 80, 25, "Interpolate" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_object_callback( obj, interpolate_cb, 0 ); obj = fl_add_checkbutton( FL_PUSH_BUTTON, 315, 90, 85, 25, "InspectOnly" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_object_callback( obj, inspect_cb, 0 ); fdui->status = obj = fl_add_text( FL_NORMAL_TEXT, 45, 15, 170, 25, "" ); fl_set_object_boxtype( obj, FL_DOWN_BOX ); fl_add_button( FL_NORMAL_BUTTON, 325, 250, 90, 30, "Done" ); obj = fl_add_checkbutton( FL_PUSH_BUTTON, 315, 120, 85, 25, "NoTics" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_object_callback( obj, notic_cb, 0 ); fl_end_form( ); return fdui; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/sldinactive.c0000644000175000017500000000350512251643374013547 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* This demo shows the use of a slider that is not active */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM *form; FL_OBJECT *sl1, *sl2, *but, *obj; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); form = fl_bgn_form( FL_UP_BOX, 150 ,300 ); sl1 = fl_add_slider( FL_VERT_SLIDER, 20, 20, 40, 180, "X" ); sl2 = fl_add_slider( FL_VERT_SLIDER, 90, 20, 40, 180, "1-X" ); fl_deactivate_object( sl2 ); but = fl_add_button( FL_NORMAL_BUTTON, 40, 250, 70, 30, "Exit" ); fl_end_form( ); fl_show_form( form, FL_PLACE_CENTER, FL_NOBORDER, "Inactive Slider" ); do { obj = fl_do_forms( ); fl_set_slider_value( sl2, 1.0 - fl_get_slider_value( sl1 ) ); } while ( obj != but ); fl_hide_form( form ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/arrowbutton.c0000644000175000017500000000506312251644253013626 00000000000000 /* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * This demo shows the use of special symbol labels * * This file is part of xforms packge * M. Overmars and T.C. Zhao (1997) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM *form; FL_OBJECT *obj; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); form = fl_bgn_form( FL_FLAT_BOX, 400, 400 ); obj = fl_add_button( FL_NORMAL_BUTTON, 50, 250, 100, 100, "@1" ); fl_set_object_lcolor( obj, FL_BLUE ); obj = fl_add_button( FL_NORMAL_BUTTON, 150, 250, 100, 100, "@2" ); fl_set_object_lcolor( obj, FL_BLUE ); obj = fl_add_button( FL_NORMAL_BUTTON, 250, 250, 100, 100, "@3" ); fl_set_object_lcolor( obj, FL_BLUE ); obj = fl_add_button( FL_NORMAL_BUTTON, 50, 150, 100, 100, "@4" ); fl_set_object_lcolor( obj, FL_BLUE ); obj = fl_add_button( FL_NORMAL_BUTTON, 250, 150, 100, 100, "@6" ); fl_set_object_lcolor( obj, FL_BLUE ); obj = fl_add_button( FL_NORMAL_BUTTON, 50, 50, 100, 100, "@7" ); fl_set_object_lcolor( obj, FL_BLUE ); obj = fl_add_button( FL_NORMAL_BUTTON, 150, 50, 100, 100, "@8" ); fl_set_object_lcolor( obj, FL_BLUE ); obj = fl_add_button( FL_NORMAL_BUTTON, 250, 50, 100, 100, "@9" ); fl_set_object_lcolor( obj, FL_BLUE ); obj = fl_add_button( FL_NORMAL_BUTTON, 150, 150, 100, 100, "@square" ); fl_set_object_lcolor( obj, FL_GREEN ); fl_set_object_color( obj, FL_MAGENTA, FL_RED ); fl_end_form( ); fl_show_form( form, FL_PLACE_ASPECT, FL_TRANSIENT, "Buttons" ); while ( fl_do_forms( ) != obj ) /* empty */ ; fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/preemptive.c0000644000175000017500000001662012251643467013427 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Demo showing the use of preemptive and post-object handler, * and one possible way of implementing a "tool tip" * * This file is part of xforms package * T.C. Zhao and M. Overmars (1997) * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include typedef struct { FL_FORM * form0; void * vdata; char * cdata; long ldata; FL_OBJECT * butt; FL_OBJECT * enter; FL_OBJECT * leave; FL_OBJECT * push; FL_OBJECT * release; FL_OBJECT * peek; FL_OBJECT * override; FL_OBJECT * event; FL_OBJECT * done; } FD_form0; extern FD_form0 *create_form_form0( void ); FD_form0 *fd_form0; /*************************************** * Which event to take over is better kept in a state varible * even though query of the status via fl_get_button is cheap ***************************************/ int preemptive_handler( FL_OBJECT * ob FL_UNUSED_ARG, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * xev FL_UNUSED_ARG ) { int override = fl_get_button( fd_form0->override ); char buf[ 128 ]; char *what = override ? "preempted" : "detected"; switch( event ) { case FL_ENTER: if ( fl_get_button(fd_form0->enter ) ) { sprintf( buf,"%s %s", "FL_ENTER", what ); fl_set_object_label( fd_form0->event, buf ); return override ? FL_PREEMPT : 0; } break; case FL_LEAVE: if ( fl_get_button( fd_form0->leave ) ) { sprintf( buf,"%s %s", "FL_LEAVE", what); fl_set_object_label( fd_form0->event, buf ); return override ? FL_PREEMPT : 0; } break; case FL_PUSH: case FL_MOTION: /* one of the quirks of the button class */ if ( fl_get_button( fd_form0->push ) ) { sprintf( buf,"%s %s", "FL_PUSH", what ); fl_set_object_label( fd_form0->event, buf ); return override ? FL_PREEMPT : 0; } break; case FL_RELEASE: if ( fl_get_button( fd_form0->release ) ) { sprintf( buf,"%s %s", "FL_RELEASE", what ); fl_set_object_label( fd_form0->event, buf ); return override ? FL_PREEMPT : 0; } break; } return 0; } #define INTERVAL 800 /* wait this long before showing tip */ static int timeoutID; /* we can also use ob->u_ldata to hold it */ /*************************************** ***************************************/ static void do_tips( int id FL_UNUSED_ARG, void * p ) { FL_OBJECT *ob = p; fl_show_oneliner( ob->u_vdata, ob->form->x + ob->x, ob->form->y + ob->y + ob->h + 1 ); timeoutID = fl_add_timeout( INTERVAL, do_tips, ob ); } /*************************************** * Use the post handler as a tipper ***************************************/ int post_handler( FL_OBJECT * ob, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * xev FL_UNUSED_ARG ) { if ( ! ob->u_vdata ) return 0; if ( event == FL_ENTER ) timeoutID = fl_add_timeout( INTERVAL,do_tips, ob ); else if ( event == FL_LEAVE || event == FL_PUSH ) { fl_hide_oneliner( ); if( timeoutID ) { fl_remove_timeout( timeoutID ); timeoutID = 0; } } return 0; } /*************************************** ***************************************/ void set_tip( FL_OBJECT * ob, char * s ) { ob->u_vdata = s; fl_set_object_posthandler( ob, post_handler ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_initialize( &argc, argv, "FormDemo", 0, 0 ); fd_form0 = create_form_form0( ); /* Fill-in form initialization code */ fl_set_button( fd_form0->peek, 1 ); fl_set_button( fd_form0->enter, 1 ); fl_set_button( fd_form0->leave, 1 ); fl_set_button( fd_form0->push, 1 ); fl_set_button( fd_form0->release, 1 ); fl_set_object_prehandler( fd_form0->butt, preemptive_handler ); set_tip( fd_form0->done, "Want to quit ?\nPress me" ); set_tip( fd_form0->peek, "Turn preempting off" ); set_tip( fd_form0->override, "Turn preempting on" ); /* Show the first form */ fl_show_form( fd_form0->form0, FL_PLACE_CENTER, FL_TRANSIENT, "Preemptive" ); while ( fl_do_forms( ) != fd_form0->done ) /* empty */ ; return 0; } /*************************************** ***************************************/ FD_form0 * create_form_form0( void ) { FL_OBJECT *obj; FD_form0 *fdui = fl_calloc(1, sizeof *fdui ); fdui->form0 = fl_bgn_form(FL_NO_BOX, 320, 250); fl_add_box( FL_UP_BOX, 0, 0, 320, 250, "" ); fl_add_frame( FL_ENGRAVED_FRAME, 200, 70, 95, 100, "" ); fdui->butt = fl_add_button( FL_NORMAL_BUTTON, 20, 70, 170, 100, "A Button" ); fdui->enter = fl_add_checkbutton( FL_PUSH_BUTTON, 210, 70, 45, 30, "Enter" ); fdui->leave = fl_add_checkbutton( FL_PUSH_BUTTON, 210, 95, 40, 30, "Leave" ); fdui->push = fl_add_checkbutton( FL_PUSH_BUTTON, 210, 120, 50, 30, "Push" ); fdui->release = fl_add_checkbutton( FL_PUSH_BUTTON, 210, 140, 60, 30, "Release" ); obj = fl_add_text( FL_NORMAL_TEXT, 55, 15, 220, 30, "Pre-emptive Handler" ); fl_set_object_lsize( obj, FL_MEDIUM_SIZE ); fl_set_object_lalign( obj, FL_ALIGN_CENTER ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); fdui->peek = obj = fl_add_checkbutton( FL_RADIO_BUTTON, 150, 40, 35, 30, "Peek" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fdui->override = obj = fl_add_checkbutton( FL_RADIO_BUTTON, 210, 40, 35, 30, "Override" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fdui->event = fl_add_box( FL_FLAT_BOX, 40, 180, 245, 25, "" ); fdui->done = fl_add_button( FL_NORMAL_BUTTON, 170, 210, 100, 30, "Done" ); fl_end_form( ); return fdui; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/chartall.c0000644000175000017500000000753112251644217013034 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Showing all different charts * * This file is part of xforms package * M. Overmars and T.C. Zhao (1997) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" FL_FORM *form; FL_OBJECT *barchart, *linechart, *filledchart, *piechart, *specialpiechart, *exitbut, *horbarchart, *spikechart; void create_form_form( void ); /*************************************** ***************************************/ void fill_in( FL_OBJECT * ob ) { int c = FL_BLACK; fl_add_chart_value( ob, 15.0, "item 1", ++c ); fl_add_chart_value( ob, 5.0, "item 2", ++c ); fl_add_chart_value( ob, 0.0, "item 3", ++c ); fl_add_chart_value( ob, -10., "item 4", ++c ); fl_add_chart_value( ob, 25.0, "item 5", ++c ); fl_add_chart_value( ob, 12.0, "item 6", ++c ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_initialize( &argc, argv, "FormDemo", 0, 0 ); create_form_form( ); fill_in( barchart ); fill_in( horbarchart ); fill_in( linechart ); fl_set_object_helper( linechart, "A LineChart" ); fill_in( filledchart ); fill_in( spikechart ); fill_in( piechart ); fill_in( specialpiechart ); fl_show_form( form, FL_PLACE_CENTER, FL_TRANSIENT, "Charts" ); fl_do_forms( ); fl_finish( ); return 0; } /*************************************** ***************************************/ void create_form_form( void ) { FL_OBJECT *obj; form = fl_bgn_form( FL_NO_BOX, 940, 360 ); fl_add_box( FL_UP_BOX, 0, 0, 940, 360, "" ); barchart = obj = fl_add_chart( FL_BAR_CHART, 20, 20, 210, 140, "BAR_CHART" ); fl_set_object_boxtype( obj, FL_RSHADOW_BOX ); linechart = obj = fl_add_chart( FL_LINE_CHART, 250, 20, 210, 140, "LINE_CHART" ); fl_set_object_boxtype( obj, FL_RSHADOW_BOX ); filledchart = obj = fl_add_chart( FL_FILLED_CHART, 250, 190, 210, 140, "FILLED_CHART" ); fl_set_object_boxtype( obj ,FL_RSHADOW_BOX ); piechart = obj = fl_add_chart( FL_PIE_CHART, 480, 190, 210, 140, "PIE_CHART" ); fl_set_object_boxtype( obj, FL_RSHADOW_BOX ); specialpiechart = obj = fl_add_chart( FL_SPECIALPIE_CHART, 710, 20, 210, 140, "SPECIALPIE_CHART" ); fl_set_object_boxtype( obj, FL_RSHADOW_BOX ); horbarchart = obj = fl_add_chart( FL_HORBAR_CHART, 20, 190, 210, 140, "HORBAR_CHART" ); fl_set_object_boxtype( obj, FL_RSHADOW_BOX ); spikechart = obj = fl_add_chart( FL_SPIKE_CHART, 480, 20, 210, 140, "SPIKE_CHART" ); fl_set_object_boxtype( obj, FL_RSHADOW_BOX ); exitbut = fl_add_button( FL_NORMAL_BUTTON, 750, 260, 140, 30, "Exit" ); fl_end_form( ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/fbrowse1.c0000644000175000017500000000554112251644056012772 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* This demo shows the use of a browser and fl_call_object_callback. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" FL_FORM *form; FL_OBJECT *br, *but; /*************************************** ***************************************/ void load_file( FL_OBJECT * ob FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { if ( ! fl_load_browser( br, fl_show_input( "Filename to load", "" ) ) ) fl_add_browser_line( br, "NO SUCH FILE!" ); } /*************************************** ***************************************/ void set_size( FL_OBJECT * ob FL_UNUSED_ARG, long arg ) { fl_set_browser_fontsize( br, arg ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_OBJECT *obj; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); form = fl_bgn_form( FL_UP_BOX, 130, 100 ); br = fl_add_browser( FL_NORMAL_BROWSER, 5, 5, 95, 90, "" ); but = fl_add_button( FL_NORMAL_BUTTON, 105, 5, 20, 8, "Exit" ); obj = fl_add_button( FL_NORMAL_BUTTON, 105, 75, 20, 8, "Load" ); fl_set_object_callback( obj, load_file, 0 ); obj = fl_add_lightbutton( FL_RADIO_BUTTON, 105, 60, 20, 8, "Small" ); fl_set_object_callback( obj, set_size, FL_SMALL_SIZE ); fl_call_object_callback( obj ); fl_set_button( obj, 1 ); obj = fl_add_lightbutton( FL_RADIO_BUTTON, 105, 50, 20, 8, "Normal" ); fl_set_object_callback( obj, set_size, FL_NORMAL_SIZE ); obj = fl_add_lightbutton( FL_RADIO_BUTTON, 105, 40, 20, 8, "Large" ); fl_set_object_callback( obj, set_size, FL_LARGE_SIZE ); fl_end_form( ); fl_scale_form( form, 4.0, 4.0 ); fl_adjust_form_size( form ); fl_clear_browser( br ); fl_add_browser_line( br,"LOAD A FILE." ); fl_show_form( form,FL_PLACE_FREE, FL_FULLBORDER, "Browser" ); do obj = fl_do_forms( ); while ( obj != but ); fl_hide_form( form ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/demo33.c0000644000175000017500000000326512251644111012325 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* Testing bitmaps Class. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "srs.xbm" /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM *form; FL_OBJECT *obj; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); form = fl_bgn_form( FL_UP_BOX, 200, 200 ); obj = fl_add_bitmap( FL_NORMAL_BITMAP, 50, 50, 100, 100, "A bitmap" ); fl_set_object_lcolor( obj, FL_BLUE ); fl_add_button( FL_HIDDEN_BUTTON, 50, 50, 100, 100, "" ); fl_end_form( ); fl_set_bitmap_data( obj, sorceress_width, sorceress_height, sorceress_bits ); fl_show_form( form, FL_PLACE_MOUSE, FL_NOBORDER, "X Bitmap" ); fl_do_forms( ) ; fl_hide_form( form ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/strange_button.c0000664000175000017500000001134712251643354014303 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. * * Author: Jens Thoms Toerring */ /* This demo program is called "strange button" since the important button used here doesn't really look like one. The program is meant to demonstrate how one could use the ability to determine on which character of the label of an object the mouse is on can be used. Within the callback for the object this functionality is used to modify the label in a useful way. (Mis-) Using a button is necessary since a kind of object is needed that receives events and thus can have callbacks (in principle also a box or frame might do but they are static objects and thus can't have callbacks). */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" typedef struct { FL_FORM * x; void * vdata; char * cdata; long ldata; FL_OBJECT * c; } FD_x; /*************************************** ***************************************/ static void ccb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { unsigned int button = fl_mouse_button( ); int idx = fl_get_label_char_at_mouse( ob ); char digit; const char * label = fl_get_object_label( ob ); char * str; /* If the mouse isn't over one of the digits return */ if ( idx == -1 ) return; /* Get the digit it's on */ digit = label[ idx ]; /* Left button or sroll up increment the value of the digit (with wrap around if we would get beyond '9') and right button and scroll down reduce its value (again with wrap around if it would drop below '1') */ if ( button == FL_LEFT_MOUSE || button == FL_SCROLLUP_MOUSE ) { if ( digit == '9' ) digit = '0'; else ++digit; } else if ( button == FL_RIGHT_MOUSE || button == FL_SCROLLDOWN_MOUSE) { if ( digit == '0' ) digit = '9'; else --digit; } /* Make a copy of the label and replace the digit we want to change */ str = fl_strdup( label ); str[ idx ] = digit; /* Set this as the new label and get rid of the memory we allocated */ fl_set_object_label( ob, str ); fl_free( str ); } /*************************************** ***************************************/ static FD_x * create_form_x( void ) { FL_OBJECT *obj; FD_x *fdui = ( FD_x * ) fl_malloc( sizeof *fdui ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->x = fl_bgn_form( FL_FLAT_BOX, 170, 175 ); obj = fl_add_text( FL_NORMAL_TEXT, 20, 10, 150, 50, "Click on the digits...\n(left or right button)" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); /* Create a button that rather looks like an embossed box (but boxes don't get events, so we need some object like a button that does. */ fdui->c = obj = fl_add_button( FL_TOUCH_BUTTON, 25, 65, 120, 40, "012345" ); fl_set_object_boxtype( obj, FL_EMBOSSED_BOX ); fl_set_object_color( obj, FL_YELLOW, FL_YELLOW ); fl_set_object_lstyle( obj, FL_FIXED_STYLE | FL_EMBOSSED_STYLE ); fl_set_object_lsize( obj, FL_LARGE_SIZE ); fl_set_object_callback( obj, ccb, 0 ); fl_set_button_mouse_buttons( obj, 1 | 4 | 8 | 16 ); fl_set_object_helper( obj, "May not look like a button but it's one...\n" "(Also try the scroll wheel if you have.)" ); obj = fl_add_button( FL_RETURN_BUTTON, 50, 130, 70, 30, "Exit" ); fl_set_button_mouse_buttons( obj, 1 ); fl_end_form( ); /* Just to make sure the label fits completely into the button */ fl_adjust_form_size( fdui->x ); fdui->x->fdui = fdui; return fdui; } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FD_x *fd_x; fl_initialize( &argc, argv, 0, 0, 0 ); fd_x = create_form_x( ); fl_show_form( fd_x->x, FL_PLACE_CENTERFREE, FL_FULLBORDER, "strange button" ); fl_do_forms( ); if ( fl_form_is_visible( fd_x->x ) ) fl_hide_form( fd_x->x ); fl_free( fd_x ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/ldial.c0000664000175000017500000000624012353623325012325 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* This is an example of the use of dials. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" FL_FORM *form; FL_OBJECT *dial[ 3 ], *text[ 3 ], *result; enum { RED, GREEN, BLUE }; /*************************************** ***************************************/ static void dial_callback( FL_OBJECT * obj FL_UNUSED_ARG, long arg ) { int clr[ 3 ]; size_t i; char str[ 60 ]; for ( i = RED; i <= BLUE; i++ ) clr[ i ] = fl_get_dial_value( dial[ i ] ); sprintf( str, "%d", clr[ arg ] ); fl_set_object_label( text[ arg ], str ); fl_mapcolor( FL_FREE_COL1, clr[ 0 ], clr[ 1 ], clr[ 2 ] ); fl_redraw_object( result ); } /*************************************** ***************************************/ static void makeform( void ) { FL_OBJECT *quit; size_t i; const char *txt[ ] = { "Red", "Green", "Blue" }; FL_COLOR clr[ ] = { FL_RED, FL_GREEN, FL_BLUE }; form = fl_bgn_form( FL_UP_BOX, 300, 330 ); quit = fl_add_button( FL_NORMAL_BUTTON, 45, 15, 210, 45, "A Color Editor" ); fl_set_object_lsize( quit, FL_LARGE_SIZE ); for ( i = RED; i <= BLUE; i++ ) { dial[ i ] = fl_add_dial( FL_LINE_DIAL, 30, 240 - i * 85, 60, 60, txt[ i ] ); fl_set_dial_bounds( dial[ i ], 0.0, 255.0 ); fl_set_dial_angles( dial[ i ], 15.0, 345.0 ); fl_set_dial_value( dial[ i ], 128.0 ); fl_set_object_color( dial[ i ], clr[ i ], FL_DIAL_COL2 ); fl_set_object_return( dial[ i ], FL_RETURN_CHANGED ); fl_set_object_callback( dial[ i ], dial_callback, i ); text[ i ] = fl_add_box( FL_DOWN_BOX, 105, 255 - i * 85, 50, 25, "128" ); } result = fl_add_box( FL_DOWN_BOX, 180, 70, 90, 245, "" ); fl_mapcolor( FL_FREE_COL1, 128, 128, 128 ); fl_set_object_color( result, FL_FREE_COL1, FL_FREE_COL1 ); fl_set_object_dblbuffer( result, 1 ); fl_end_form( ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_initialize( &argc, argv, "ColorEditor", 0, 0 ); makeform( ); fl_show_form( form, FL_PLACE_MOUSE, FL_TRANSIENT, "Color Editor" ); fl_do_forms( ); fl_finish(); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/demotest.c0000644000175000017500000001162612251644065013067 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Tabbed folder demo and tester * * This file is part of xforms package * T.C. Zhao and M. Overmars * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "fd/folder_gui.h" #include static void make_folder( FL_OBJECT * ); /* callback routines */ /*************************************** ***************************************/ void hide_show_cb( FL_OBJECT * ob, long data ) { FD_mainform *fdui = ob->form->fdui; ( data ? fl_show_object : fl_hide_object )( fdui->folder ); } /*************************************** ***************************************/ void reshow_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_hide_form( ob->form ); fl_show_form( ob->form, FL_PLACE_CENTER, FL_FULLBORDER, "TabFolder" ); } /*************************************** ***************************************/ void set_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_mainform *fdui = ob->form->fdui; int n = fl_get_active_folder_number( fdui->folder ); fl_set_folder_bynumber( fdui->folder, n % 5 + 1 ); } /*************************************** ***************************************/ void deactivate_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_mainform *fdui = ob->form->fdui; if ( fl_object_is_active( fdui->folder ) ) { fl_set_object_label( ob, "Activate" ); fl_deactivate_object( fdui->folder ); } else { fl_set_object_label( ob, "Deactivate" ); fl_activate_object( fdui->folder ); } } /*************************************** ***************************************/ void done_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_finish( ); exit( 0 ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FD_mainform *fd_mainform; fl_set_border_width( -2 ); fl_initialize( &argc, argv, 0, 0, 0 ); fd_mainform = create_form_mainform( ); make_folder( fd_mainform->folder ); /* show the first form */ fl_show_form( fd_mainform->mainform, FL_PLACE_CENTER, FL_FULLBORDER, "TabFolder" ); while ( fl_do_forms( ) ) /* empty */ ; return 0; } /*************************************** ***************************************/ static void make_folder( FL_OBJECT * folder FL_UNUSED_ARG ) { FD_buttonform *fd_buttonform; FD_staticform *fd_staticform; FD_valuatorform *fd_valuatorform; FD_choiceform *fd_choiceform; FD_inputform *fd_inputform; float y[ 6 ] = { 5.5, 4, 4.5, 3.8, 4, 5 }; char *label[ ] = { "Mon", "Tue", "Wed", "Thur", "Fri", "Sat" }; size_t i; int xx, yy, ww, hh; fd_buttonform = create_form_buttonform( ); fd_staticform = create_form_staticform( ); fd_valuatorform = create_form_valuatorform( ); fd_choiceform = create_form_choiceform( ); fd_inputform = create_form_inputform( ); /* form initialization code */ for ( i = 0; i < sizeof y / sizeof *y; i++ ) fl_add_chart_value( fd_staticform->chart, y[ i ], label[ i ], i + 1 ); fl_addto_menu( fd_choiceform->pulldown, "MenuEntry1|MenuEntry2|MenuEntry3|MenuEntry4" ); fl_addto_menu( fd_choiceform->pushmenu, "MenuEntry1|MenuEntry2|MenuEntry3" ); fl_addto_choice( fd_choiceform->choice, "Choice1|Choice2|Choice3|Choice4|Choice5|Choice6" ); fl_load_browser( fd_choiceform->browser, "01Readme" ); fl_get_folder_area( folder, &xx, &yy, &ww, &hh ); fl_addto_tabfolder( folder, "ButtonObj", fd_buttonform->buttonform ); fl_addto_tabfolder( folder, "StaticObj", fd_staticform->staticform ); fl_addto_tabfolder( folder, "ValuatorObj", fd_valuatorform->valuatorform ); fl_addto_tabfolder( folder, "ChoiceObj", fd_choiceform->choiceform ); fl_addto_tabfolder( folder, "InputObj", fd_inputform->inputform ); fl_get_folder_area( folder, &xx, &yy, &ww, &hh ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/gl.c0000644000175000017500000002324112251672116011637 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * OpenGL/mesa canvas demo * * On most platforms, the mesa/OpenGL support is not compiled into * the shared library (It it in the static library). You can compile * ../FORMS/gl.c and put it in the shared library if you have mesa/OpenGL * * Also you might want to make a link libGL.a to libMesaGL.a * * T.C. Zhao and M. Overmars */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "include/forms.h" #include "gl/glcanvas.h" typedef struct { FL_FORM * form; void * vdata; char * cdata; long ldata; FL_OBJECT * canvas; FL_OBJECT * done; FL_OBJECT * menu; FL_OBJECT * butgrp; } FD_form; extern FD_form * create_form_form(void); FD_form *ui; static int prim = GL_POLYGON ; #define v3f glVertex3f /*************************************** ***************************************/ static void draw_cube( void ) { glColor3f( 1.0, 0.0, 0.0 ); glBegin( prim ); v3f( 1.0, 1.0, 1.0 ); v3f( 1.0, -1.0, 1.0 ); v3f( 1.0, -1.0, -1.0 ); v3f( 1.0, 1.0, -1.0 ); glEnd( ); glBegin( prim ); v3f( -1.0, 1.0, 1.0 ); v3f( -1.0, 1.0, -1.0 ); v3f( -1.0, -1.0, -1.0 ); v3f( -1.0, -1.0, 1.0 ); glEnd( ); glColor3f( 0.0, 1.0, 0.0 ); glBegin( prim ); v3f( 1.0, 1.0, 1.0 ); v3f( 1.0, 1.0, -1.0 ); v3f( -1.0, 1.0, -1.0 ); v3f( -1.0, 1.0, 1.0 ); glEnd( ); glBegin( prim ); v3f( 1.0, -1.0, 1.0 ); v3f( -1.0, -1.0, 1.0 ); v3f( -1.0, -1.0, -1.0 ); v3f( 1.0, -1.0, -1.0 ); glEnd( ); glColor3f( 0.0, 0.0, 1.0 ); glBegin( prim ); v3f( 1.0, 1.0, 1.0 ); v3f( -1.0, 1.0, 1.0 ); v3f( -1.0, -1.0, 1.0 ); v3f( 1.0, -1.0, 1.0 ); glEnd( ); glBegin( prim ); v3f( 1.0, 1.0, -1.0 ); v3f( 1.0, -1.0, -1.0 ); v3f( -1.0, -1.0, -1.0 ); v3f( -1.0, 1.0, -1.0 ); glEnd( ); } /*************************************** ***************************************/ int idle_cb( XEvent * ev, void * data FL_UNUSED_ARG ) { static GLfloat xrot, yrot, zrot; if ( ! fl_form_is_visible( ui->form ) || ! fl_object_is_visible( ui->canvas ) ) return 0; fl_activate_glcanvas( ui->canvas ); glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); glPushMatrix( ); glRotatef( xrot, 1.0, 0.0, 0.0 ); glRotatef( yrot, 0.0, 1.0, 0.0 ); glRotatef( zrot, 0.0, 0.0, 1.0 ); glTranslatef( -1.0,1.2,-0.5 ); draw_cube( ); glPopMatrix( ); glFinish( ); if ( ev ) { xrot += 10.0; yrot += 7.0; zrot -= 3.0; } glXSwapBuffers( fl_display, fl_get_canvas_id( ui->canvas ) ); return 0; } /*************************************** ***************************************/ int canvas_expose( FL_OBJECT * ob FL_UNUSED_ARG, Window win FL_UNUSED_ARG, int w, int h, XEvent * xev FL_UNUSED_ARG, void * ud FL_UNUSED_ARG ) { glViewport( 0, 0, ( GLint ) w, ( GLint ) h ); glClearColor( 0.0, 0.0, 0.0, 0.0 ); glMatrixMode( GL_PROJECTION ); glLoadIdentity( ); glFrustum( -1.0, 1.0, -1.0, 1.0, 1.0, 10.0 ); glTranslatef( 0.0, 0.0, -5.0 ); glMatrixMode( GL_MODELVIEW ); glLoadIdentity( ); glCullFace( GL_BACK ); glEnable( GL_CULL_FACE ); glShadeModel( GL_FLAT ); /* refresh */ idle_cb( 0, 0 ); return 0; } /*************************************** ***************************************/ int buttonpress_cb( FL_OBJECT * ob FL_UNUSED_ARG, Window win FL_UNUSED_ARG, int w FL_UNUSED_ARG, int h FL_UNUSED_ARG, XEvent * xev FL_UNUSED_ARG, void * ud FL_UNUSED_ARG ) { static int suspended = 0; suspended ^= 1; fl_set_idle_callback( suspended ? 0 : idle_cb, 0 ); return 0; } /*************************************** ***************************************/ void switch_primitive( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { static int primitive[ ] = { GL_POLYGON, GL_LINE_LOOP }; static int i ; prim = primitive[ ++i % 2 ]; } /* switch single/dblbuffer */ static int sbuf[ ]= { GLX_RGBA,GLX_DEPTH_SIZE, 1, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, None }; static int dbuf[ ]= { GLX_RGBA, GLX_DEPTH_SIZE, 1, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, /* GLX_DOUBLEBUFFER, */ None}; /*************************************** ***************************************/ void buffer_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { static int is_double = 1; FD_form *fdui = ob->form->fdui; is_double = ! is_double; fl_set_object_label( ob,is_double ? "Single":"Double" ); fl_set_glcanvas_attributes( fdui->canvas, is_double ? dbuf : sbuf ); } /*************************************** ***************************************/ void menu_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_initialize( &argc, argv, "FormDemo", 0, 0 ); ui = create_form_form( ); /* fill-in form initialization code */ fl_set_object_gravity( ui->butgrp, NorthEastGravity, NorthEastGravity ); fl_addto_menu( ui->menu,"Item1|Item2|Item3|Item4" ); fl_add_canvas_handler( ui->canvas, Expose, canvas_expose, 0 ); fl_add_canvas_handler( ui->canvas, ButtonPress, buttonpress_cb, 0 ); fl_set_idle_callback( idle_cb, 0 ); /* geometry stuff */ // fl_set_form_minsize( ui->form, 340, 280 ); fl_show_form( ui->form, FL_PLACE_CENTER | FL_FREE_SIZE, FL_FULLBORDER, "OpenGL Canvas"); while ( fl_do_forms( ) != ui->done ) /* empty */ ; fl_finish( ); return 0; } /*************************************** ***************************************/ static void hide_it( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { if ( fl_object_is_visible( ui->canvas ) ) { fl_hide_object( ui->canvas ); fl_set_object_label( ob,"Show" ); } else { fl_show_object( ui->canvas ); fl_set_object_label( ob, "Hide" ); } } /*************************************** ***************************************/ static void reshow( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_hide_form( ob->form ); fl_show_form( ui->form, FL_PLACE_CENTER | FL_FREE_SIZE, FL_FULLBORDER, "OpenGL Canvas" ); } /*************************************** ***************************************/ FD_form * create_form_form( void ) { FL_OBJECT *obj; FD_form *fdui = fl_calloc( 1, sizeof *fdui); fdui->form = fl_bgn_form( FL_NO_BOX, 340, 280 ); fl_add_box( FL_UP_BOX, 0, 0, 340, 280, "" ); fdui->canvas = obj = fl_add_glcanvas( FL_NORMAL_CANVAS, 20, 45, 225, 215, "" ); fl_set_object_gravity( obj, FL_NorthWest, FL_SouthEast ); fdui->done = obj = fl_add_button( FL_NORMAL_BUTTON, 255, 230, 70, 30, "Done"); fl_set_button_shortcut( obj, "Dd#d", 1 ); fl_set_object_gravity( obj, FL_SouthEast, FL_SouthEast ); fdui->menu = obj = fl_add_menu( FL_PULLDOWN_MENU, 20, 15, 54, 20, "Canvas" ); fl_set_object_shortcut( obj, "#CcC", 1 ); fl_set_object_boxtype( obj, FL_FLAT_BOX ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); fl_set_object_gravity( obj, FL_NorthWest, FL_NorthWest ); fl_set_object_callback( obj, menu_cb, 0 ); fdui->butgrp = fl_bgn_group( ); obj = fl_add_button( FL_NORMAL_BUTTON, 255, 45, 70, 30, "Poly/Line" ); fl_set_object_gravity( obj, FL_NorthEast, FL_NorthEast ); fl_set_object_callback( obj, switch_primitive, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 255, 75, 70, 30, "Hide" ); fl_set_button_shortcut( obj, "#HhH", 1 ); fl_set_object_callback( obj,hide_it, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 255, 105, 70, 30, "ReShow" ); fl_set_button_shortcut( obj, "#RRr", 1 ); fl_set_object_callback( obj, reshow, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 255, 135, 70, 30, "Single" ); fl_set_object_callback( obj, buffer_cb, 0 ); fl_end_group( ); fl_end_form( ); fdui->form->fdui = fdui; return fdui; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/chartstrip.c0000644000175000017500000001320712262246172013422 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * A demo of a moving chart * * This file is part of xforms package * M. Overmars and T.C. Zhao (1997) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" static long func = 1; static double x = 0.0; static double step = 0.15; static FL_FORM * form; static FL_OBJECT * chartobj, * sinobj, * exitbut, * stepobj, * timerobj; static void create_form_form(void); /*************************************** ***************************************/ static void set_function( FL_OBJECT * obj FL_UNUSED_ARG, long arg ) { func = arg; fl_clear_chart( chartobj ); x = 0.0; } /*************************************** ***************************************/ static void set_step( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { step = fl_get_slider_value( stepobj ); } /*************************************** ***************************************/ static double next_step( void ) { double res = 0.0; switch ( func) { case 1: res = sin( x ); break; case 2: res = sin( 2 * x ) * cos( x ); break; case 3: res = sin( 2 * x ) + cos( x ); break; case 4: res = sin( 3 * x ) + cos( x ); break; case 5: res = sin( x ) * sin( x ) + cos( x ); break; case 6: res = sin( x ) * sin( x ) * sin( x ); break; } x += step; return res; } /*************************************** ***************************************/ static void timer_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { fl_insert_chart_value( chartobj, 1, next_step( ), "", 1 ); fl_set_timer( obj, 0.05 ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_flip_yorigin( ); fl_initialize( &argc, argv, "FormDemo", 0, 0 ); create_form_form( ); fl_set_chart_bounds( chartobj, -1.5, 1.5 ); fl_set_chart_maxnumb( chartobj, 80 ); fl_set_chart_autosize( chartobj, 0 ); fl_set_button( sinobj, 1 ); fl_set_slider_value( stepobj, 0.5 ); fl_set_slider_bounds( stepobj, 0.0, 1.0 ); fl_show_form( form,FL_PLACE_CENTER | FL_FREE_SIZE, FL_TRANSIENT, "StripChart" ); fl_set_timer( timerobj, 0.05 ); while ( fl_do_forms( ) != exitbut ) /* empty */ ; fl_finish( ); return 0; } /*************************************** ***************************************/ static void create_form_form( void ) { FL_OBJECT *obj; form = fl_bgn_form( FL_NO_BOX, 490, 320 ); fl_add_box( FL_BORDER_BOX, 0, 0, 490, 320, "" ); chartobj = obj = fl_add_chart( FL_LINE_CHART, 20, 160, 390, 140, "" ); fl_set_object_color( obj, FL_BLACK, FL_INACTIVE ); fl_set_object_dblbuffer( obj, 1 ); fl_bgn_group( ); sinobj = obj = fl_add_lightbutton( FL_RADIO_BUTTON, 30, 120, 170, 30, "sin(x)" ); fl_set_object_boxtype( obj, FL_BORDER_BOX ); fl_set_object_callback( obj, set_function, 1 ); obj = fl_add_lightbutton( FL_RADIO_BUTTON, 30, 90, 170, 30, "sin(2x)*cos(x)" ); fl_set_object_boxtype( obj, FL_BORDER_BOX ); fl_set_object_callback( obj, set_function, 2 ); obj = fl_add_lightbutton( FL_RADIO_BUTTON, 30, 60, 170, 30, "sin(2x)+cos(x)" ); fl_set_object_boxtype( obj, FL_BORDER_BOX ); fl_set_object_callback( obj, set_function, 3 ); obj = fl_add_lightbutton( FL_RADIO_BUTTON, 240, 120, 160, 30, "sin(3x)+cos(x)" ); fl_set_object_boxtype( obj, FL_BORDER_BOX ); fl_set_object_callback( obj, set_function, 4 ); obj = fl_add_lightbutton( FL_RADIO_BUTTON, 240, 90, 160, 30, "sin(x)^2 + cos(x)" ); fl_set_object_boxtype( obj, FL_BORDER_BOX ); fl_set_object_callback( obj, set_function, 5 ); obj = fl_add_lightbutton( FL_RADIO_BUTTON, 240, 60, 160, 30, "sin(x)^3" ); fl_set_object_boxtype( obj, FL_BORDER_BOX ); fl_set_object_callback( obj, set_function, 6 ); fl_end_group( ); exitbut = obj = fl_add_button( FL_NORMAL_BUTTON, 150, 20, 140, 30, "Exit" ); fl_set_object_boxtype( obj, FL_BORDER_BOX ); stepobj = obj = fl_add_valslider( FL_VERT_SLIDER, 430, 20, 40, 280, "" ); fl_set_object_return( obj, FL_RETURN_END_CHANGED ); fl_set_object_boxtype( obj, FL_BORDER_BOX ); fl_set_object_callback( obj, set_step, 0 ); timerobj = obj = fl_add_timer( FL_HIDDEN_TIMER, 0, 0, 0, 0, "" ); fl_set_object_callback( obj, timer_cb, 0 ); fl_end_form( ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/demo27.c0000644000175000017500000002054512251644116012335 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /** * \file demo27.c * * This demo shows the use of event callbacks and form callbacks. * purposesly mixed form callback, object callback and event callback * to show the flexibility of Forms Library's event handling (and * test if they actually work together). * * This file is part of xforms package * T.C. Zhao and M. Overmars */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "include/forms.h" Window main_win; /*------------ Color Part --------------------*/ FL_FORM *colorform; FL_OBJECT *redsl, *greensl, *bluesl, *colorobj; int r = 128, g = 128, b = 128; /*************************************** * color form callback routine ***************************************/ void color_callback( FL_OBJECT * obj FL_UNUSED_ARG, void * d FL_UNUSED_ARG ) { r = 255 * fl_get_slider_value( redsl ); g = 255 * fl_get_slider_value( greensl ); b = 255 * fl_get_slider_value( bluesl ); fl_mapcolor( FL_FREE_COL1, r, g, b ); fl_redraw_object( colorobj ); } /*************************************** ***************************************/ void create_colorform( void ) { FL_OBJECT *obj; if ( colorform ) return; colorform = fl_bgn_form( FL_NO_BOX, 315, 190 ); fl_add_box( FL_UP_BOX, 0, 0, 315, 190, "" ); bluesl = obj = fl_add_slider( FL_HOR_SLIDER, 20, 25, 220, 35, "" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); redsl = obj = fl_add_slider( FL_HOR_SLIDER, 20, 135, 220, 35, "" ); fl_set_object_color( obj, FL_COL1, FL_RED ); greensl = obj = fl_add_slider( FL_HOR_SLIDER, 20, 80, 220, 35, "" ); fl_set_object_color( obj, FL_COL1, FL_GREEN ); colorobj = obj = fl_add_box( FL_BORDER_BOX, 250, 25, 50, 145, "" ); fl_set_object_color( obj, FL_FREE_COL1, FL_FREE_COL1 ); fl_end_form( ); } /*************************************** * initializes the color part ***************************************/ void init_colorpart( void ) { create_colorform( ); fl_set_form_callback( colorform, color_callback, 0 ); fl_set_form_position( colorform, 20, -300 - colorform->h ); fl_show_form( colorform, FL_PLACE_GEOMETRY, FL_TRANSIENT, "Color" ); fl_mapcolor( FL_FREE_COL1,r,g,b ); fl_redraw_object( colorobj ); } /*--------------- Control Part -------------------*/ FL_FORM * controlform; FL_OBJECT * squareobj, * exitobj, * sizeobj; int curobj = 1, cursize = 20; /*************************************** ***************************************/ void select_object( FL_OBJECT * ob FL_UNUSED_ARG, long which ) { curobj = which; } void clearit( FL_OBJECT *, long ); /*************************************** * control form callback routine ***************************************/ void control_callback( FL_OBJECT * obj, void * d FL_UNUSED_ARG ) { if ( obj == sizeobj ) cursize = 40 * fl_get_slider_value( sizeobj ); else if ( obj == exitobj ) { fl_finish( ); exit( 0 ); } } /*************************************** ***************************************/ void create_controlform( void ) { FL_OBJECT *obj; controlform = fl_bgn_form( FL_UP_BOX, 260, 230 ); fl_bgn_group( ); squareobj = obj = fl_add_button( FL_RADIO_BUTTON, 20, 150, 60, 60, "@square" ); fl_set_object_lcolor( obj, FL_YELLOW ); fl_set_object_callback( obj, select_object, 1 ); obj = fl_add_button( FL_RADIO_BUTTON, 20, 90, 60, 60, "@circle" ); fl_set_object_lcolor( obj, FL_YELLOW ); fl_set_object_callback( obj, select_object, 2 ); obj = fl_add_button( FL_RADIO_BUTTON, 20, 30, 60, 60, "@8>" ); fl_set_object_lcolor( obj, FL_YELLOW ); fl_set_object_callback( obj, select_object, 3 ); fl_end_group( ); exitobj = fl_add_button( FL_NORMAL_BUTTON, 160, 30, 80, 30, "Exit" ); obj = fl_add_button( FL_NORMAL_BUTTON, 160, 180, 80, 30, "Clear" ); fl_set_object_callback( obj, clearit, 0 ); sizeobj = fl_add_slider( FL_VERT_SLIDER, 100, 30, 40, 180, "size" ); fl_set_slider_bounds( sizeobj, 0.025, 1.0 ); fl_end_form( ); } /*************************************** * initializes the control part ***************************************/ void init_controlpart( void ) { create_controlform( ); fl_set_form_callback( controlform, control_callback, 0 ); fl_set_button( squareobj, 1 ); fl_set_form_geometry( controlform, 20, -controlform->h - 40, controlform->w, controlform->h ); fl_show_form( controlform, FL_PLACE_SIZE, FL_TRANSIENT, "Control" ); } /*--------------- Main part -------------------*/ typedef struct{ int type, r, g, b, x, y, size; } OBJ; OBJ ob[ 10000 ]; int onumb = 0; /*************************************** ***************************************/ void drawit( OBJ * obj ) { fl_winset( main_win ); fl_mapcolor( FL_FREE_COL1, obj->r, obj->g, obj->b ); if ( obj->type == 1 ) fl_rectf( obj->x - obj->size, obj->y - obj->size, 2 * obj->size, 2 * obj->size, FL_FREE_COL1 ); else if ( obj->type == 2 ) fl_circf( obj->x, obj->y, obj->size, FL_FREE_COL1 ); else if ( obj->type == 3 ) { FL_POINT point[ 3 ]; point[ 0 ].x = obj->x - obj->size; point[ 0 ].y = obj->y + obj->size; point[ 1 ].x = obj->x + obj->size; point[ 1 ].y = obj->y + obj->size; point[ 2 ].x = obj->x; point[ 2 ].y = obj->y - obj->size; fl_polyf( point, 3, FL_FREE_COL1 ); } } /*************************************** * draws a particular object ***************************************/ void drawobject( void ) { FL_Coord x0, y0; unsigned int km; OBJ *cur_obj = ob + onumb; fl_get_win_mouse( main_win, &x0, &y0, &km ); cur_obj->x = x0 ; cur_obj->y = y0 ; cur_obj->r = r; cur_obj->g = g; cur_obj->b = b; cur_obj->type = curobj; cur_obj->size = cursize; drawit( cur_obj ); onumb++; } /*************************************** ***************************************/ void redrawit( void ) { int i; XClearWindow( fl_display, main_win ); for ( i = 0; i < onumb; i++ ) drawit( ob + i ); } /*************************************** ***************************************/ void clearit( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { onumb = 0; redrawit( ); } /*************************************** * Event callback routine ***************************************/ int main_callback( XEvent * xev, void * p FL_UNUSED_ARG ) { fl_winset( main_win ); if ( xev->type == Expose ) redrawit( ); else if ( xev->type == ButtonPress ) drawobject( ); return 0; } /*************************************** ***************************************/ void init_mainpart( void ) { fl_pref_wingeometry( 400, 300, 400, 400 ); fl_pref_winsize( 400, 400 ); fl_winbackground( 0, fl_get_flcolor( FL_COL1 ) ); main_win = fl_winopen( "Drawing" ); fl_set_event_callback( main_callback, 0 ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_initialize( &argc, argv, "FormDemo", 0, 0 ); init_colorpart( ); init_controlpart( ); init_mainpart( ); color_callback( colorobj, 0 ); while ( fl_do_forms( ) ) /* empty */ ; return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/test.xpm0000644000175000017500000000212611665175603012604 00000000000000/* XPM */ char * test_xpm[] = { "30 30 2 1", " c #CF3CC71BC71B", ". c #51445144FFFF", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " . . ", " .... .. ... .... ", " . . . . . . ", " . .... .. . ", " . . .. . ", " . .. . . . . ", " .. ... ... .. ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}; xforms-1.2.4/demos/buttonall.c0000644000175000017500000000515712251644232013245 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * All button classes * * This file is part of xforms package * T.C. Zhao and M. Overmars (1997) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "fd/buttons_gui.h" /* from fd/ directory */ #include /* callbacks for form buttform */ /*************************************** ***************************************/ void done_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_free( ob->form->fdui ); fl_finish( ); exit( 0 ); } /*************************************** ***************************************/ void bw_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { int bws[ ] = { -4, -3, -2, -1, 1, 2, 3, 4 }; int n = fl_get_choice( ob ) - 1; FD_buttform *fdui = ob->form->fdui; fl_freeze_form( ob->form ); fl_set_object_bw( fdui->backface, bws[ n ] ); fl_set_object_bw( fdui->objsgroup, bws[ n ] ); fl_set_object_bw( fdui->done, bws[ n ] ); fl_unfreeze_form( ob->form ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FD_buttform *fd_buttform; fl_initialize( &argc, argv, 0, 0, 0 ); fd_buttform = create_form_buttform( ); /* fill-in form initialization code */ fl_set_pixmapbutton_file( fd_buttform->pbutt,"crab45.xpm" ); fl_set_bitmapbutton_file( fd_buttform->bbutt,"bm1.xbm" ); fl_addto_choice( fd_buttform->bw_obj, " -4 | -3 | -2 | -1 | 1| 2| 3| 4" ); fl_set_choice( fd_buttform->bw_obj, 5 ); /* show the first form */ fl_show_form( fd_buttform->buttform, FL_PLACE_CENTER, FL_FULLBORDER, "buttform" ); while ( fl_do_forms( ) ) /* empty */ ; return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/browserop.c0000644000175000017500000001010412251644237013254 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * This demo shows the basic browsers browsers * * This file is part of xforms package * M. Overmars and T.C. Zhao (1997) * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" FL_FORM *form; FL_OBJECT *browserobj, *inputobj, *exitobj; /*************************************** ***************************************/ void addit( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { /* append and show the last line. Don't use this if you just want * to add some lines. use fl_add_browser_line */ fl_addto_browser( browserobj, fl_get_input( inputobj ) ); } /*************************************** ***************************************/ void insertit( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { fl_insert_browser_line( browserobj, fl_get_browser( browserobj ), fl_get_input( inputobj ) ); } /*************************************** ***************************************/ void replaceit( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { int n; if ( ( n = fl_get_browser( browserobj ) ) ) fl_replace_browser_line( browserobj, n, fl_get_input( inputobj ) ); } /*************************************** ***************************************/ void deleteit( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { int n; if ( ( n = fl_get_browser( browserobj ) ) ) fl_delete_browser_line( browserobj, n ); } /*************************************** ***************************************/ void clearit( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { fl_clear_browser( browserobj ); } /*************************************** ***************************************/ void create_form( void ) { FL_OBJECT *obj; form = fl_bgn_form( FL_UP_BOX, 390, 420 ); browserobj = fl_add_browser( FL_HOLD_BROWSER, 20, 20, 210, 330, "" ); fl_set_object_dblbuffer( browserobj, 1 ); inputobj = fl_add_input( FL_NORMAL_INPUT, 20, 370, 210, 30, "" ); fl_set_object_return( inputobj, FL_RETURN_CHANGED ); obj = fl_add_button( FL_NORMAL_BUTTON, 250, 20, 120, 30, "Add" ); fl_set_object_callback( obj, addit, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 250, 60, 120, 30, "Insert" ); fl_set_object_callback( obj, insertit, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 250, 100, 120, 30, "Replace" ); fl_set_object_callback( obj, replaceit, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 250, 160, 120, 30, "Delete" ); fl_set_object_callback( obj, deleteit, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 250, 200, 120, 30, "Clear" ); fl_set_object_callback( obj, clearit, 0 ); exitobj = fl_add_button( FL_NORMAL_BUTTON, 250, 370, 120, 30, "Exit" ); fl_end_form( ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_initialize( &argc, argv, "FormDemo", 0, 0 ); create_form( ); fl_show_form( form, FL_PLACE_CENTER, FL_TRANSIENT, "Browser Op" ); while ( fl_do_forms( ) != exitobj ) /* empty */ ; fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/thumbwheel.c0000644000175000017500000000454012251643324013401 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "fd/twheel_gui.h" /* callbacks and freeobj handles for form twheelform */ /*************************************** ***************************************/ void valchange_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_twheelform *fdui = ( FD_twheelform * ) ob->form->fdui; char buf[ 128 ]; sprintf( buf, "%.3f", fl_get_thumbwheel_value( ob ) ); fl_set_object_label( fdui->report, buf ); } /*************************************** ***************************************/ void returnchange_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_twheelform *fdui = ( FD_twheelform * ) ob->form->fdui; int n = fl_get_choice( ob ); if ( n == 1 ) n = FL_RETURN_END_CHANGED; else if ( n == 2 ) n = FL_RETURN_CHANGED; else if ( n == 3 ) n = FL_RETURN_END; else n = FL_RETURN_ALWAYS; fl_set_thumbwheel_return( fdui->vert, n ); fl_set_thumbwheel_return( fdui->hor, n ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FD_twheelform *fd_twheelform; fl_initialize( &argc, argv, 0, 0, 0 ); fd_twheelform = create_form_twheelform( ); /* show the first form */ fl_show_form( fd_twheelform->twheelform, FL_PLACE_CENTERFREE, FL_FULLBORDER, "twheelform" ); fl_do_forms( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/objreturn.c0000644000175000017500000001212512251643533013247 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* demo showing the choices when to return object. Note this program, * strictly speaking, is illegal in the usage of user data parameter * in the callback function. * * T.C. Zhao and M. Overmars */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include /**** Forms and Objects ****/ typedef struct { FL_FORM * form0; void * vdata; long ldata; FL_OBJECT * obj[ 4 ]; FL_OBJECT * br; FL_OBJECT * when; } FD_form0; extern FD_form0 *create_form_form0( void ); static FD_form0 *fd_form0; /* callbacks for form form0 */ /*************************************** ***************************************/ const char *mess[ ] = { "slider returned", "counter returned", "input 1 returned", "input 2 returned" }; void return_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data ) { fl_addto_browser( fd_form0->br, mess[ data ] ); } /*************************************** ***************************************/ void set_when( int n ) { fl_set_object_return( fd_form0->obj[ 0 ], n ); fl_set_object_return( fd_form0->obj[ 1 ], n ); fl_set_object_return( fd_form0->obj[ 2 ], n ); fl_set_object_return( fd_form0->obj[ 3 ], n ); } /*************************************** ***************************************/ void when_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { set_when( fl_get_select_item( ob )->val ); } /*************************************** ***************************************/ void resetlog_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_clear_browser( fd_form0->br ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_set_border_width( -2 ); fl_initialize( &argc, argv, "FormDemo", 0, 0 ); fd_form0 = create_form_form0( ); /* fill-in form initialization code */ set_when( 0 ); fl_set_object_dblbuffer( fd_form0->br, 1); fl_add_select_items( fd_form0->when, "RETURN_NONE%x|RETURN_CHANGED%x|" "RETURN_END%x|RETURN_END_CHANGED%x|RETURN_ALWAYS%x", FL_RETURN_NONE, FL_RETURN_CHANGED, FL_RETURN_END, FL_RETURN_END_CHANGED, FL_RETURN_ALWAYS ); /* show the first form */ fl_show_form( fd_form0->form0, FL_PLACE_CENTER, FL_FULLBORDER, "form0" ); fl_do_forms( ); return 0; } /*************************************** ***************************************/ FD_form0 * create_form_form0( void ) { FL_OBJECT *obj; FD_form0 *fdui = fl_calloc( 1, sizeof *fdui ); fdui->form0 = fl_bgn_form( FL_NO_BOX, 321, 276 ); fl_add_box( FL_UP_BOX, 0, 0, 321, 276, "" ); fdui->obj[ 0 ] = obj = fl_add_valslider( FL_HOR_SLIDER, 12, 55, 138, 22, "" ); fl_set_object_lalign( obj, fl_to_inside_lalign( FL_ALIGN_BOTTOM ) ); fl_set_object_callback( obj, return_cb, 0 ); fl_set_slider_return( obj, FL_RETURN_CHANGED ); fdui->obj[ 1 ] = obj = fl_add_counter( FL_NORMAL_COUNTER, 12, 85, 138, 22, "" ); fl_set_object_lalign( obj, fl_to_inside_lalign( FL_ALIGN_BOTTOM ) ); fl_set_object_callback( obj, return_cb, 1 ); fdui->obj[ 2 ] = obj = fl_add_input( FL_NORMAL_INPUT, 12, 150, 138, 25, "" ); fl_set_object_callback( obj, return_cb, 2 ); fdui->br = obj = fl_add_browser( FL_NORMAL_BROWSER, 170, 55, 140, 160, "" ); fdui->obj[ 3 ] = obj = fl_add_input( FL_INT_INPUT, 12, 187, 138, 25, "" ); fl_set_object_lalign( obj, fl_to_inside_lalign( FL_ALIGN_LEFT ) ); fl_set_object_callback( obj, return_cb, 3 ); fdui->when = obj = fl_add_select( FL_NORMAL_SELECT, 40, 12, 240, 27, "" ); fl_set_object_callback( obj, when_cb, 0 ); fl_add_button( FL_NORMAL_BUTTON, 170, 239, 80, 25, "Done" ); obj = fl_add_button( FL_NORMAL_BUTTON, 70, 239, 80, 25, "ResetLog" ); fl_set_object_callback( obj, resetlog_cb, 0 ); fl_end_form( ); return fdui; } /*---------------------------------------*/ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/longlabel.c0000644000175000017500000000612512251643645013203 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* Demo of the Use of a very long label */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" const char *label1 = "This demo shows the use of some very\n" "long labels. The dynamic storage allocation\n" "for such long labels should guarantee that\n" "all of this works without any problem."; const char *label2 = "This is the second string that should again\n" "be a bit larger such that a new, larger amount\n" "of storage has to be allocated for the label.\n" "This is of course no problem. By the way,\n" "dynamic allocation of storage saves a lot\n" "of memory because for most objects the label\n" "is much shorter than the 64 bytes that were\n" "allocated for it in the previous version of\n" "the Forms Library"; const char *label3 = "And now back to the first one:\n\n" "This demo shows the use of some very\n" "long labels. The dynamic storage allocation\n" "for such long labels should guarantee that\n" "all of this works without any problem."; /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM *form; FL_OBJECT *strobj, *but; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); form = fl_bgn_form( FL_UP_BOX, 400, 300 ); strobj = fl_add_box( FL_DOWN_BOX, 10, 10, 380, 240, "Press Next" ); fl_set_object_lsize( strobj, FL_NORMAL_SIZE ); but = fl_add_button( FL_NORMAL_BUTTON, 160, 260, 80, 30, "Next" ); fl_end_form( ); fl_set_form_hotobject( form, but ); fl_show_form( form, FL_PLACE_HOTSPOT, FL_TRANSIENT, "longlabel" ); fl_do_forms( ); fl_set_object_label( strobj, label1 ); fl_do_forms( ); fl_set_object_label( strobj, label2 ); fl_do_forms( ); fl_set_object_label( strobj, "Now we turn to a short label" ); fl_do_forms( ); fl_set_object_label( strobj, label3 ); fl_set_object_label( but, "Quit" ); fl_do_forms( ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/xyplotactive.c0000644000175000017500000002067212332247467014004 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include #include "time.h" /**** Forms and Objects ****/ typedef struct { FL_FORM * axypform; void * vdata; long ldata; FL_OBJECT * xyplot; FL_OBJECT * xmin; FL_OBJECT * xmax; FL_OBJECT * ymin; FL_OBJECT * ymax; FL_OBJECT * status; } FD_axypform; FD_axypform *create_form_axypform( void ); FD_axypform *xypui; /* callbacks for form axypform */ /*************************************** ***************************************/ void xyplot_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { float x, y; int i; char buf[ 64 ]; fl_get_xyplot( ob, &x, &y, &i ); if ( i < 0 ) return; sprintf( buf, "X=%.3f Y=%.3f", x, y ); fl_set_object_label( xypui->status, buf ); } /*************************************** ***************************************/ void alwaysreturn_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_set_object_return( xypui->xyplot, fl_get_button( ob ) ? FL_RETURN_CHANGED : FL_RETURN_END_CHANGED ); } /*************************************** ***************************************/ void interpolate_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_set_xyplot_interpolate( xypui->xyplot, 0, fl_get_button( ob ) ? 3 : 0, 0.2 ); } /*************************************** ***************************************/ void inspect_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_set_xyplot_inspect( xypui->xyplot, fl_get_button( ob ) ); } /*************************************** ***************************************/ void notic_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { if ( fl_get_button( obj ) ) { fl_set_xyplot_xtics( xypui->xyplot, -1, -1 ); fl_set_xyplot_ytics( xypui->xyplot, -1, -1 ); } else { fl_set_xyplot_xtics( xypui->xyplot, 0, 0 ); fl_set_xyplot_ytics( xypui->xyplot, 0, 0 ); } } /*************************************** ***************************************/ void bounds_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data ) { char buf[ 50 ]; if ( ! data ) { float xmin = strtod( fl_get_input( xypui->xmin ), NULL ); float xmax = strtod( fl_get_input( xypui->xmax ), NULL ); fl_set_xyplot_xbounds( xypui->xyplot, xmin, xmax ); fl_get_xyplot_xbounds( xypui->xyplot, &xmin, &xmax ); sprintf( buf, "%g", xmin ); fl_set_input( xypui->xmin, buf ); sprintf( buf, "%g", xmax ); fl_set_input( xypui->xmax, buf ); } else { float ymin = strtod( fl_get_input( xypui->ymin ), NULL ); float ymax = strtod( fl_get_input( xypui->ymax ), NULL ); fl_set_xyplot_ybounds( xypui->xyplot, ymin, ymax ); fl_get_xyplot_ybounds( xypui->xyplot, &ymin, &ymax ); sprintf( buf, "%g", ymin ); fl_set_input( xypui->ymin, buf ); sprintf( buf, "%g", ymax ); fl_set_input( xypui->ymax, buf ); } } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { float x[ 11 ], y[ 11 ]; int i; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); xypui = create_form_axypform( ); /* Fill-in form initialization code */ fl_set_xyplot_ybounds( xypui->xyplot, 0.0, 10.0 ); for ( i = 0; i <= 10; i++ ) x[ i ] = y[ i ] = i; fl_add_xyplot_overlay( xypui->xyplot, 1, x, y, 11, FL_YELLOW ); fl_set_xyplot_overlay_type( xypui->xyplot, 1, FL_LINEPOINTS_XYPLOT ); fl_set_xyplot_interpolate( xypui->xyplot, 1, 2, 0.1 ); srand( time( NULL ) ); for ( i = 0; i <= 10; i++ ) y[ i ] += ( double ) rand( ) / RAND_MAX - 0.5; fl_set_xyplot_data( xypui->xyplot, x, y, 11, "Active xyplot with overlay", "x-axis", "y-axis" ); fl_set_xyplot_linewidth( xypui->xyplot, 0, 2 ); fl_set_xyplot_xgrid( xypui->xyplot, FL_GRID_MINOR ); /* Show the first form */ fl_show_form( xypui->axypform, FL_PLACE_MOUSE | FL_FREE_SIZE, FL_FULLBORDER, "xyplotactive" ); fl_do_forms( ); return 0; } /*************************************** ***************************************/ FD_axypform * create_form_axypform( void ) { FL_OBJECT *obj; FD_axypform *fdui = fl_calloc( 1, sizeof *fdui ); fdui->axypform = fl_bgn_form( FL_NO_BOX, 431, 301 ); fl_add_box( FL_UP_BOX, 0, 0, 431, 301, "" ); fdui->xyplot = obj = fl_add_xyplot( FL_ACTIVE_XYPLOT, 20, 50, 285, 235, "" ); fl_set_object_boxtype( obj, FL_DOWN_BOX ); fl_set_object_color( obj, FL_BLACK, FL_GREEN ); fl_set_object_lalign( obj, fl_to_inside_lalign( FL_ALIGN_BOTTOM ) ); fl_set_object_callback( obj, xyplot_cb, 0 ); fl_set_object_gravity( obj, FL_NorthWest, FL_SouthEast ); obj = fl_add_checkbutton( FL_PUSH_BUTTON, 315, 40, 80, 25, "AlwaysReturn" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_object_callback( obj, alwaysreturn_cb, 0 ); fl_set_object_gravity( obj, FL_NorthEast, FL_NorthEast ); obj = fl_add_checkbutton( FL_PUSH_BUTTON, 315, 65, 80, 25, "Interpolate" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_object_callback( obj, interpolate_cb, 0 ); fl_set_object_gravity( obj, FL_NorthEast, FL_NorthEast ); obj = fl_add_checkbutton( FL_PUSH_BUTTON, 315, 90, 85, 25, "InspectOnly" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_object_callback( obj, inspect_cb, 0 ); fl_set_object_gravity( obj, FL_NorthEast, FL_NorthEast ); obj = fl_add_checkbutton( FL_PUSH_BUTTON, 315, 120, 85, 25, "NoTics" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_object_callback( obj, notic_cb, 0 ); fl_set_object_gravity( obj, FL_NorthEast, FL_NorthEast ); fdui->xmin = obj = fl_add_input( FL_FLOAT_INPUT, 315, 150, 50, 20, " x_min" ); fl_set_input( obj, "0.0" ); fl_set_object_lalign( obj, FL_ALIGN_RIGHT ); fl_set_object_callback( obj, bounds_cb, 0 ); fl_set_object_gravity( obj, FL_NorthEast, FL_NorthEast ); fdui->xmax = obj = fl_add_input( FL_FLOAT_INPUT, 315, 170, 50, 20, " x_max" ); fl_set_input( obj, "10.0" ); fl_set_object_lalign( obj, FL_ALIGN_RIGHT ); fl_set_object_callback( obj, bounds_cb, 0 ); fl_set_object_gravity( obj, FL_NorthEast, FL_NorthEast ); fdui->ymin = obj = fl_add_input( FL_FLOAT_INPUT, 315, 200, 50, 20, " y_min" ); fl_set_input( obj, "0.0" ); fl_set_object_lalign( obj, FL_ALIGN_RIGHT ); fl_set_object_callback( obj, bounds_cb, 1 ); fl_set_object_gravity( obj, FL_NorthEast, FL_NorthEast ); fdui->ymax = obj = fl_add_input( FL_FLOAT_INPUT, 315, 220, 50, 20, " y_max" ); fl_set_input( obj, "10.0" ); fl_set_object_lalign( obj, FL_ALIGN_RIGHT ); fl_set_object_callback( obj, bounds_cb, 1 ); fl_set_object_gravity( obj, FL_NorthEast, FL_NorthEast ); fdui->status = obj = fl_add_box( FL_BORDER_BOX, 20, 15, 285, 25, "" ); fl_set_object_boxtype( obj, FL_DOWN_BOX ); fl_set_object_gravity( obj, FL_NorthWest, FL_NorthEast ); fl_set_object_lalign( obj, FL_ALIGN_CENTER ); obj = fl_add_button( FL_NORMAL_BUTTON, 325, 250, 90, 30, "Done" ); fl_set_object_gravity( obj, FL_SouthEast, FL_SouthEast ); fl_end_form( ); return fdui; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/timer.c0000644000175000017500000001167012251643311012353 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * timer routine tester * * This file is part of xforms package * T.C. Zhao and M. Overmars (1997) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include /**** Callback routines ****/ extern void expired( FL_OBJECT *, long ); extern void suspend_resume( FL_OBJECT *, long ); extern void reset( FL_OBJECT *, long ); extern void timer_direction( FL_OBJECT *, long ); /**** Forms and Objects ****/ typedef struct { FL_FORM * timerform; void * vdata; long ldata; FL_OBJECT * timer; FL_OBJECT * down; } FD_timerform; extern FD_timerform * create_form_timerform( void ); #define T 20 FD_timerform *fd_timerform; /*************************************** * callbacks for form timer form ***************************************/ void suspend_resume( FL_OBJECT * ob FL_UNUSED_ARG, long data ) { if ( data ) fl_resume_timer( fd_timerform->timer ); else fl_suspend_timer( fd_timerform->timer ); } /*************************************** ***************************************/ void reset( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_set_timer( fd_timerform->timer, T ); } /*************************************** ***************************************/ void timer_direction( FL_OBJECT * ob FL_UNUSED_ARG, long data ) { fl_set_timer_countup( fd_timerform->timer, data ); } /*************************************** ***************************************/ void expired( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { if ( fl_show_question( "Expired!\n\nQuit?", 0 ) == 1 ) { fl_finish( ); exit( 0 ); } else fl_set_timer( fd_timerform->timer, T ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_set_border_width( -2 ); fl_initialize( &argc, argv, 0, 0, 0 ); fd_timerform = create_form_timerform( ); /* fill-in form initialization code */ fl_set_timer( fd_timerform->timer, T ); fl_set_button( fd_timerform->down, 1 ); /* show the first form */ fl_show_form( fd_timerform->timerform, FL_PLACE_CENTER, FL_FULLBORDER, "timerform" ); fl_do_forms( ); return 0; } /*************************************** * Form definition file generated with fdesign ***************************************/ FD_timerform * create_form_timerform( void ) { FL_OBJECT *obj; FD_timerform *fdui = fl_calloc(1, sizeof *fdui ); fdui->timerform = fl_bgn_form( FL_NO_BOX, 290, 210 ); fl_add_box( FL_UP_BOX, 0, 0, 290, 210, "" ); fl_add_frame( FL_UP_FRAME, 0, 0, 290, 94, "" ); fl_add_frame( FL_UP_FRAME, 0, 100, 330, 190, "" ); fl_add_button( FL_NORMAL_BUTTON, 100, 170, 80, 30, "Done" ); fdui->timer = obj = fl_add_timer( FL_VALUE_TIMER, 20, 30, 180, 40, "Timer" ); fl_set_object_boxtype( obj, FL_UP_BOX ); fl_set_object_lsize( obj, FL_MEDIUM_SIZE ); fl_set_object_lalign( obj, FL_ALIGN_TOP ); fl_set_object_lstyle( obj, FL_TIMES_STYLE ); fl_set_object_callback( obj, expired, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 20, 120, 80, 30, "Suspend" ); fl_set_object_callback( obj, suspend_resume, 0); obj = fl_add_button( FL_NORMAL_BUTTON, 100, 120, 80, 30, "Resume" ); fl_set_object_callback( obj, suspend_resume, 1 ); obj = fl_add_button( FL_NORMAL_BUTTON, 180, 120, 80, 30, "Reset" ); fl_set_object_callback( obj, reset, 0 ); obj = fdui->down = fl_add_checkbutton( FL_RADIO_BUTTON, 210, 20, 70, 30, "Down" ); fl_set_object_shortcut( obj, "D#D", 1 ); fl_set_object_callback( obj, timer_direction, 0 ); obj = fl_add_checkbutton( FL_RADIO_BUTTON, 210, 50, 70, 30, "Up" ); fl_set_object_shortcut( obj, "U#U", 1 ); fl_set_object_callback( obj, timer_direction, 1 ); fl_end_form( ); return fdui; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/bm2.xbm0000644000175000017500000000043111665175610012262 00000000000000#define bm2_width 16 #define bm2_height 16 static unsigned char bm2_bits[] = { 0x00, 0x00, 0x00, 0x57, 0x7c, 0x72, 0xfc, 0x52, 0xfc, 0x00, 0x7c, 0x01, 0x7c, 0x1f, 0xfc, 0x22, 0x40, 0x42, 0x40, 0x44, 0x40, 0x43, 0xc0, 0x40, 0x70, 0x40, 0x8c, 0x20, 0x00, 0x1f, 0x00, 0x00}; xforms-1.2.4/demos/xconq.xpm0000644000175000017500000000254611665175603012763 00000000000000/* XPM */ static char * xconq [] = { "32 32 5 1", " s grey90 c grey90 g4 grey90", ". m black c black g4 black", "X m white c SkyBlue g4 grey80", "o m white c LightGray g4 grey50", "O m white c OliveDrab g4 grey40", " ", " . ", " ..X.. ", " ..XXXXX.. ", " ..XXXXXXXXX.. ", " ..XXXXXXXXXXXXX.. ", " ..XXXXXXXXXXXXXXXXX.. ", " ..XXXXXXXXXXXXXXXXXXXXX.. ", " ..XXXXXXXXXXXXXXXXX.XXXXXXX.. ", " .XXXXXXXXXXXXXXXXXXX.XXXXXXXX. ", " .XXXXXXXXXXXXXXXXX.X.XXXXXXXX. ", " .XXXXXXXXXXXXXXXXX.X.XXXXXXXX. ", " .XXXXXXXXXXXXXXXXX.X.XXXXXXXX. ", " .XXXXXXXXXXXX..........XXXXXX. ", " .XXXXXXXXXX...oooooooo.XXXXXX. ", " .X..........ooooooooo..XXXXXX. ", " .XXXXXXXXXX.................X. ", " .XXXXXXX...............oooo.X. ", " .XXXXXX..oooooooooooooooooo.X. ", " .XXXXXX....................XX. ", " .XXXXXXX..o.o.o.o.o.o.oo..XXX. ", " .XXXXXXXX................XXXX. ", " .............................. ", " .OOOOOOOOOOOOOOOOOOOOOOOOOOOO. ", " ..OO.O.O.O.O.O.O.O.O.O.O.O.OO. ", " ..O.O.O.O.O.O.O.O.O.O.O.O.. ", " ..OO.O.O.O.O.O.O.O.OO.. ", " ..O.O.O.O.O.O.O.O.. ", " ..OO.O.O.O.OO.. ", " ..O.O.O.O.. ", " ..OOO.. ", " ... "}; xforms-1.2.4/demos/timerprec.c0000644000175000017500000001032212251643261013222 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Test the accuracy of timer * * This file is part of xforms package * T.C. Zhao and M. Overmars (1997) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "include/forms.h" typedef struct { FL_FORM * form0; void * vdata; long ldata; FL_OBJECT * timer; FL_OBJECT * restart; FL_OBJECT * report; } FD_form0; typedef struct { long sec, usec; } Start_Time; static FD_form0 * create_form_form0( void ); /*************************************** ***************************************/ static void exit_cb( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_finish( ); exit( 0 ); } /*************************************** * Callback for timer expiry, 'data' is set to requested delay (in ms) ***************************************/ static void timer_cb( FL_OBJECT * obj, long data ) { double df; FD_form0 *fd = obj->form->fdui; Start_Time *start_time = fd->vdata; long end_sec, end_usec; fl_gettime( &end_sec, &end_usec ); df = end_sec - start_time->sec + 1.0e-6 * ( end_usec - start_time->usec ); fl_set_object_label_f( fd->report, "Timeout: %.3f s, Actual: %.3f s, Delta: %d ms", 0.001 * data, df, FL_nint( 1000 * df - data ) ); } /*************************************** ***************************************/ static void start_timer( FL_OBJECT * obj, long data ) { FD_form0 *fd = obj->form->fdui; Start_Time *start_time = fd->vdata; static long delay = 3000; if ( data > 0 ) delay = data; else delay += 200; fl_set_object_label_f( fd->report, "Timer accuracy testing %.3f sec ...", 0.001 * delay ); fl_gettime( &start_time->sec, &start_time->usec ); fl_set_object_callback( fd->timer, timer_cb, delay ); fl_set_timer( fd->timer, 0.001 * delay ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FD_form0 *fd_form0; Start_Time start_time; fl_initialize( &argc, argv, 0, 0, 0 ); fd_form0 = create_form_form0( ); fd_form0->vdata = &start_time; start_timer( fd_form0->timer, 3000 ); fl_show_form( fd_form0->form0, FL_PLACE_CENTER, FL_FULLBORDER, "Timer object precision" ); fl_do_forms( ); return 0; } /*************************************** ***************************************/ static FD_form0 * create_form_form0( void ) { FL_OBJECT *obj; FD_form0 *fdui = fl_calloc( 1, sizeof *fdui ); fdui->form0 = fl_bgn_form( FL_NO_BOX, 350, 130 ); fl_add_box( FL_UP_BOX, 0, 0, 350, 130, "" ); fdui->timer = fl_add_timer( FL_HIDDEN_TIMER, 0, 0, 0, 0, "" ); fdui->report = obj = fl_add_text( FL_NORMAL_TEXT, 20, 20, 310, 50,"" ); fl_set_object_align( obj, FL_ALIGN_CENTER ); fl_set_object_boxtype( obj, FL_DOWN_BOX ); fdui->restart = obj = fl_add_button( FL_NORMAL_BUTTON, 140, 80, 90, 35, "Restart" ); fl_set_object_callback( obj, start_timer, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 240, 80, 90, 35, "Done" ); fl_set_object_callback( obj, exit_cb, 0 ); fl_end_form( ); fdui->form0->fdui = fdui; return fdui; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/crab45.xpm0000644000175000017500000000371011665175604012706 00000000000000/* XPM */ static char * crab45[] = { /* crab45 pixmap * width height ncolors chars_per_pixel */ "28 28 6 2 ", ". c None s s_SkyBlue ", "x c orange s s_orange ", "* c #ff72c2 s s_#ff72c2 ", "+ c SteelBlue s s_SteelBlue ", "G c black s s_black ", "a c LightGrey s s_LightGrey ", /* pixels */ ". . . . . . . . . . * * * * * * * . . . . . . . . . . . ", ". . . . . . . . * x x x x x x x * . . . . . . . . . . . ", ". . . . . . . * * * * * * * x x * . . . . . . . . . . . ", ". . . . . . . . . . . . . * x x x * . . . . . . . . . . ", ". . . . . . . . . . * x x x x * x x . . . . . . . . . . ", ". . . . . . . . + + * * * * * * * x x . . . . . . . . . ", ". . . . . . . . . . . . . . . . . * x x . . . . . * . . ", ". . * . . . . . . . . . . . . . . . * x . . * * x x . . ", ". * * . . + . . . . . . + + x x + * * x * * x x x + . . ", ". x * . . + . . . . . . . . + x + * x x x x x + + . . . ", "* x * . * * . . . . . . + . + x * * x x x * * . . . . . ", "* x * . x * . . . . . + x + + x x x x x x * * . . * * * ", "* x * . x * . . + . + x x x x x x x x x x * * * * x x x ", "* x * * x * . . + . . + x x x x x x x x x * * x x x G G ", "* x x x x * . . x + + + x x x x x x x x x x x * * G G . ", "* x x x * * . . x x x x x x x x x x x x x x x * * G G . ", "* * * x . * . . + + * x x x x x x x x x x x x * * G G . ", ". . . * . x * . * * * x x x x x x x x x x x x x * * * * ", ". . . . . x x * * x x x x x x x x x x x x x x * x x x x ", ". . . . . . x x x x x x x x x x x x x x x x * * G G G x ", ". . . . . . . . * x x x x x x x x x x x x x * * G G + . ", ". . . . . . . . * x * * * * x x x x x x x * * * G G . . ", ". . . . . . . * x x * * * * x x x x x * * * * * * G G . ", ". . . . . . . * x + . . * x * * * x * * * * * G G G G . ", ". . . . . . . x x + . . * x * * * * x G G G * G G G . . ", ". . . . . . * x + . . * x x G G G * x G G G G G . . . . ", ". . . . . . . . . . . * x G G G G * x G + . G G . . . . ", ". . . . . . . . . . . * x G . . . * x x . . . . . . . . " } ; xforms-1.2.4/demos/butttypes.c0000644000175000017500000000414712251644231013301 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * All button types * * This file is part of xforms package * T.C. Zhao and M. Overmars (1997) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "fd/butttypes_gui.h" #include /* callbacks for form form0 */ /*************************************** ***************************************/ void button_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_form0 *ui = ( FD_form0 * ) ob->form->fdui; char buf[ 128 ]; if ( ob->type == FL_HIDDEN_BUTTON ) { if ( fl_show_question( "Want to Quit ?", 1 ) == 1 ) { fl_free( ob->form->fdui ); fl_finish( ); exit( 0 ); } } else { sprintf( buf, "%s callback called: %d", ob->label, fl_get_button( ob ) ); fl_addto_browser( ui->br, buf ); } } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FD_form0 *fd_form0; fl_initialize( &argc, argv, 0, 0, 0 ); fd_form0 = create_form_form0( ); /* fill-in form initialization code */ /* show the first form */ fl_show_form( fd_form0->form0, FL_PLACE_CENTER, FL_FULLBORDER, "form0" ); fl_do_forms( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/strsize.c0000644000175000017500000000547512251643350012747 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include typedef struct { FL_FORM * form0; void * vdata; long ldata; FL_OBJECT * text; } FD_form0; static FD_form0 * fd_form0; /*************************************** ***************************************/ static void exit_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_finish( ); exit( 0 ); } /*************************************** ***************************************/ static void input_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { const char * s = fl_get_input( ob ); int w = fl_get_string_width( ob->lstyle, ob->lsize, s, strlen( s ) ); int h = fl_get_string_height( ob->lstyle, ob->lsize, s, strlen( s ), 0, 0 ); char buf[ 50 ]; sprintf( buf, "w = %d, h = %d", w, h ); fl_set_object_label( fd_form0->text, buf ); } /*************************************** ***************************************/ static FD_form0 * create_form_form0( void ) { FL_OBJECT * obj; FD_form0 * fdui = fl_calloc( 1, sizeof *fdui ); fdui->form0 = fl_bgn_form( FL_FLAT_BOX, 311, 181 ); obj = fl_add_input( FL_NORMAL_INPUT, 20, 30, 280, 30, "" ); fl_set_object_callback( obj, input_cb, 0 ); fl_set_object_return( obj, FL_RETURN_ALWAYS ); fdui->text = obj = fl_add_text( FL_NORMAL_TEXT, 60, 90, 130, 30, "Text" ); fl_set_object_lalign( obj, fl_to_inside_lalign( FL_ALIGN_LEFT ) ); obj = fl_add_button( FL_NORMAL_BUTTON, 220, 130, 80, 30, "Done" ); fl_set_object_callback( obj, exit_cb, 0 ); fl_end_form( ); return fdui; } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_initialize( &argc, argv, 0, 0, 0 ); fd_form0 = create_form_form0( ); fl_show_form( fd_form0->form0, FL_PLACE_CENTER, FL_FULLBORDER, "form0" ); fl_do_forms( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/pup.c0000664000175000017500000002447312340166201012043 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* Demo: complete pop-ups. * test font/cursor change * test attaching pup to menu */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include static FL_FORM * pup; static FL_OBJECT * done, * pret, * b1, * b2, * b3, * menu; static void create_form_pup( void ); static void init_menu( void ); static int post( FL_OBJECT *, int, FL_Coord, FL_Coord, int, void * ); /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_IOPT aa; unsigned int mask = FL_PDVisual; aa.vclass = FL_DefaultVisual; fl_set_defaults( mask, &aa ); fl_initialize( &argc, argv, "FormDemo", 0, 0 ); create_form_pup( ); /* Initialize */ fl_set_object_posthandler( b1, post ); fl_set_object_posthandler( b2, post ); fl_set_object_posthandler( b3, post ); fl_show_form( pup, FL_PLACE_MOUSE, FL_TRANSIENT, "PupDemo" ); init_menu( ); fl_do_forms( ); /* never returns */ return 0; } /*************************************** * post-handler ***************************************/ static int post( FL_OBJECT * ob, int ev, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * xev FL_UNUSED_ARG ) { static int n1 = -1, n2 = -1; if ( n1 == -1 ) { n1 = fl_defpup( FL_ObjWin( ob ), "line1|line2" ); fl_setpup_shadow( n1, 0 ); fl_setpup_bw( n1, 0 ); fl_setpup_pad( n1, 3, 0 ); n2 = fl_defpup( FL_ObjWin( ob ), "button1|button2" ); fl_setpup_shadow( n2, 0 ); fl_setpup_bw( n2, -1 ); fl_setpup_pad( n2, 3, 0 ); } if ( ev == FL_ENTER ) { if ( ob == b3 ) fl_show_oneliner( "button3", ob->form->x + ob->x + 5, ob->form->y + ob->y + ob->h + 5 ); else { fl_setpup_position( ob->form->x+ob->x, ob->form->y + ob->y + ob->h + 5 ); fl_showpup( ob == b1 ? n1 : n2 ); } } else if ( ev == FL_LEAVE ) { if ( ob == b3 ) fl_hide_oneliner( ); else fl_hidepup( ob == b1 ? n1 : n2 ); } return 0; } /*************************************** ***************************************/ static int style_cb( FL_POPUP_RETURN *r ) { int style, size, mod; fl_popup_entry_get_font( r->user_data, &style, &size ); mod = style & ( FL_SHADOW_STYLE | FL_ENGRAVED_STYLE | FL_EMBOSSED_STYLE ); fl_popup_entry_set_font( r->user_data, r->val | mod, size ); return FL_IGNORE; } /*************************************** ***************************************/ static int size_cb( FL_POPUP_RETURN *r ) { int style; fl_popup_entry_get_font( r->user_data, &style, NULL ); fl_popup_entry_set_font( r->user_data, style, r->val ); fl_popup_get_title_font( r->user_data, &style, NULL ); fl_popup_set_title_font( r->user_data, style, r->val ); return FL_IGNORE; } /*************************************** ***************************************/ static int mod_cb( FL_POPUP_RETURN *r ) { int style, size; fl_popup_entry_get_font( r->user_data, &style, &size ); style &= ~ ( FL_SHADOW_STYLE | FL_ENGRAVED_STYLE | FL_EMBOSSED_STYLE ); fl_popup_entry_set_font( r->user_data, style | r->val, size ); return FL_IGNORE; } /*************************************** ***************************************/ static int pol_cb( FL_POPUP_RETURN *r ) { FL_POPUP_ENTRY *e; for ( e = r->popup->entries; e != NULL; e = e->next ) if ( e != r->entry ) fl_popup_entry_clear_state( e, FL_POPUP_CHECKED ); fl_popup_set_policy( r->user_data, r->val ); return FL_IGNORE; } /*************************************** ***************************************/ static void do_pup( FL_OBJECT * ob, long q FL_UNUSED_ARG ) { static FL_POPUP *m = NULL, *sm1, *sm2, *sm3, *sm4; if ( m == NULL ) { m = fl_popup_add( FL_ObjWin( ob ), "Popup" ); sm1 = fl_popup_add( FL_ObjWin( ob ), NULL ); sm2 = fl_popup_add( FL_ObjWin( ob ), NULL ); sm3 = fl_popup_add( FL_ObjWin( ob ), NULL ); sm4 = fl_popup_add( FL_ObjWin( ob ), NULL ); fl_popup_add_entries( sm4, "FL_POPUP_NORMAL_SELECT%T%x%u%f", FL_POPUP_NORMAL_SELECT, m, pol_cb ); fl_popup_add_entries( sm4, "FL_POPUP_DRAG_SELECT%t%x%u%f", FL_POPUP_DRAG_SELECT, m, pol_cb ); fl_popup_add_entries( sm3, "None%x%R%u%f", 0, 1, m, mod_cb ); fl_popup_add_entries( sm3, "FL_SHADOW_STYLE%x%r%u%f", FL_SHADOW_STYLE, 1, m, mod_cb ); fl_popup_add_entries( sm3, "FL_ENGRAVED_STYLE%x%r%u%f", FL_ENGRAVED_STYLE, 1, m, mod_cb ); fl_popup_add_entries( sm3, "FL_EMBOSSED_STYLE%x%r%u%f", FL_EMBOSSED_STYLE, 1, m, mod_cb ); fl_popup_add_entries( sm1, "FL_NORMAL_STYLE%Sn%x%R%u%f%s", FL_NORMAL_STYLE, 1, m, style_cb, "n" ); fl_popup_add_entries( sm1, "FL_BOLD_STYLE%Sb%x%r%u%f%s", FL_BOLD_STYLE, 1, m, style_cb, "b" ); fl_popup_add_entries( sm1, "FL_ITALIC_STYLE%Si%x%r%u%f%s", FL_ITALIC_STYLE, 1, m, style_cb, "i" ); fl_popup_add_entries( sm1, "FL_BOLDITALIC_STYLE%SI%x%r%u%f%s", FL_BOLDITALIC_STYLE, 1, m, style_cb, "I" ); fl_popup_add_entries( sm1, "%l|Font modifier%Sm%m%s", sm3, "m" ); fl_popup_add_entries( sm2, "FL_TINY_SIZE%x%r%u%f", FL_TINY_SIZE, 1, m, size_cb ); fl_popup_add_entries( sm2, "FL_SMALL_SIZE%x%r%u%f", FL_SMALL_SIZE, 1, m, size_cb ); fl_popup_add_entries( sm2, "FL_NORMAL_SIZE%x%R%u%f", FL_NORMAL_SIZE, 1, m, size_cb ); fl_popup_add_entries( sm2, "FL_MEDIUM_SIZE%x%r%u%f", FL_MEDIUM_SIZE, 1, m, size_cb ); fl_popup_add_entries( sm2, "FL_LARGE_SIZE%x%r%u%f", FL_LARGE_SIZE, 1, m, size_cb ); fl_popup_add_entries( sm2, "FL_HUGE_SIZE%x%r%u%f", FL_HUGE_SIZE, 1, m, size_cb ); fl_popup_add_entries( m, "Font style%m", sm1 ); fl_popup_add_entries( m, "Font size%m", sm2 ); fl_popup_add_entries( m, "Policy%m", sm4 ); fl_popup_set_min_width( m, 100 ); } if ( fl_get_button_numb( ob ) >= FL_SHORTCUT ) fl_popup_set_position( m, ob->form->x + ob->x, ob->form->y + ob->y + ob->h ); fl_popup_do( m ); } /*************************************** ***************************************/ static void init_menu( void ) { FL_POPUP *mm, *smm; mm = fl_popup_add( fl_default_win( ), NULL ); smm = fl_popup_add( fl_default_win( ), NULL ); fl_popup_add_entries( smm, "SubItem1%x|SubItem2%x|SubItem3%x", 11, 12, 13 ); fl_popup_add_entries( mm, "MenuItem1|MenuItem2%m|MenuItem3", smm ); fl_set_nmenu_popup( menu, mm ); } /*************************************** ***************************************/ static void do_menu( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { char buf[ 128 ]; FL_POPUP_RETURN *ret = fl_get_nmenu_item( ob ); if ( ret->val >= 0 ) sprintf( buf, "%ld (%s)", ret->val, ret->text ); else sprintf( buf, "%ld", ret->val ); fl_set_object_label( pret, buf ); } /*************************************** ***************************************/ static void done_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_finish( ); exit( 0 ); } /*************************************** ***************************************/ static void do_nothing( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { } /*************************************** ***************************************/ static void create_form_pup( void ) { FL_OBJECT *obj; if ( pup ) return; pup = fl_bgn_form( FL_UP_BOX, 260, 210 ); fl_add_box( FL_UP_BOX, 0, 0, 260, 210, "" ); done = obj = fl_add_button( FL_NORMAL_BUTTON, 150, 150, 90, 35, "Done" ); fl_set_object_callback( obj, done_cb, 0 ); obj = fl_add_button( FL_MENU_BUTTON, 30, 90, 100, 30, "PopUp" ); fl_set_button_shortcut( obj, "Pp#p", 1 ); fl_set_object_callback( obj, do_pup, 0 ); menu = obj = fl_add_nmenu( FL_NORMAL_NMENU, 160, 95, 60, 25, "Menu" ); fl_set_button_shortcut( obj, "Mm#m", 1 ); fl_set_object_callback( obj, do_menu, 0 ); pret = obj = fl_add_text( FL_NORMAL_TEXT, 20, 60, 220, 30, "" ); fl_set_object_lalign( obj, FL_ALIGN_CENTER ); b1 = fl_add_button( FL_NORMAL_BUTTON, 20, 10, 60, 30, "Button1" ); fl_set_object_callback( b1, do_nothing, 0 ); b2 = fl_add_button( FL_NORMAL_BUTTON, 90, 10, 60, 30, "Button2" ); fl_set_object_callback( b2, do_nothing, 0 ); b3 = fl_add_button( FL_NORMAL_BUTTON, 160, 10, 60, 30, "Button3" ); fl_set_object_callback( b3, do_nothing, 0 ); fl_end_form( ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/iconify.c0000644000175000017500000000413012251643710012667 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Test iconification * * T.C. Zhao and M. Overmars */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "crab.xpm" FL_FORM * create_form_form(void); /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM *form; Pixmap p, mask; unsigned int w, h; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); form = create_form_form( ); p = fl_read_pixmapfile( fl_root, "crab.xpm", &w, &h, &mask, 0, 0, 0 ); fl_set_form_icon( form, p, mask ); fl_show_form( form, FL_PLACE_CENTER, FL_FULLBORDER, "IconTest" ); fl_do_forms( ); fl_finish( ); return 0; } /*************************************** ***************************************/ FL_FORM * create_form_form( void ) { FL_OBJECT *obj; FL_FORM *form = fl_bgn_form( FL_NO_BOX, 151, 111 ); obj = fl_add_pixmapbutton( FL_NORMAL_BUTTON, 0, 0, 151, 111, "Iconify Me\nvia Window Manager" ); fl_set_object_lalign( obj, fl_to_inside_lalign( FL_ALIGN_BOTTOM ) ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); fl_set_pixmapbutton_data( obj, crab ); fl_end_form( ); return form; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/newbutton.c0000644000175000017500000000653112251643561013267 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Demo showing the use of user defined object class: CROSSBUTTON * * Form definition file generated with fdesign. * changed stub button to crossbutton */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "crossbut.h" #include /**** Forms and Objects ****/ typedef struct { FL_FORM * newbut; void * vdata; FL_OBJECT * bexit; } FD_newbut; extern FD_newbut *create_form_newbut(void); /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FD_newbut *cbform ; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); cbform = create_form_newbut( ); fl_show_form( cbform->newbut, FL_PLACE_CENTER, FL_TRANSIENT, "newbutton" ); while( fl_do_forms( ) != cbform->bexit ) /* empty */; fl_finish( ); return 0; } /*************************************** ***************************************/ FD_newbut * create_form_newbut( void ) { FL_OBJECT *obj; FD_newbut *fdui = fl_malloc( sizeof *fdui ); int oldbw = fl_get_border_width( ); fl_set_border_width( -2 ); fdui->newbut = fl_bgn_form( FL_NO_BOX, 310, 190 ); fl_add_box( FL_UP_BOX, 0, 0, 310, 190, "" ); obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 40, 45, 100, 120, "CrossA" ); fl_set_object_boxtype( obj, FL_FLAT_BOX ); fl_set_object_lstyle( obj ,FL_BOLD_STYLE ); obj = fl_add_crossbutton( FL_RADIO_BUTTON, 50, 115, 80, 30, "Button" ); fl_set_object_color( obj, FL_COL1, FL_RED ); obj = fl_add_crossbutton( FL_RADIO_BUTTON, 50, 85, 80, 30, "Button" ); fl_set_object_color( obj, FL_COL1, FL_GREEN ); obj = fl_add_crossbutton( FL_RADIO_BUTTON, 50, 55, 80, 30, "Button" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 180, 45, 100, 120, "CrossB" ); fl_set_object_boxtype( obj, FL_FLAT_BOX ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); obj = fl_add_crossbutton( FL_PUSH_BUTTON, 190, 115, 80, 30, "Button" ); fl_set_object_color( obj, FL_COL1, FL_RED ); obj = fl_add_crossbutton( FL_PUSH_BUTTON, 190, 85, 90, 30, "Button" ); fl_set_object_color( obj, FL_COL1, FL_GREEN ); obj = fl_add_crossbutton( FL_PUSH_BUTTON, 190, 55, 80, 30, "Button" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fdui->bexit = fl_add_button( FL_NORMAL_BUTTON, 125, 10, 65, 25, "Exit" ); fl_end_form( ); fl_set_border_width( oldbw ); return fdui; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/nomail.xbm0000644000175000017500000000640711665175602013073 00000000000000#define nomail_width 64 #define nomail_height 64 static unsigned char nomail_bits[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x70, 0x38, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x0e, 0xc0, 0x00, 0x00, 0x80, 0x01, 0x00, 0xc0, 0x01, 0x00, 0x01, 0x00, 0x80, 0x01, 0x00, 0x38, 0x00, 0x00, 0x02, 0x00, 0x80, 0x01, 0x00, 0x06, 0x00, 0x00, 0x04, 0x00, 0x80, 0x01, 0xc0, 0x1f, 0x00, 0x00, 0x04, 0x00, 0x80, 0x01, 0x30, 0x60, 0x00, 0x00, 0x08, 0x00, 0x80, 0x01, 0x08, 0x80, 0x00, 0x00, 0x08, 0x00, 0x80, 0x01, 0x04, 0x07, 0x01, 0x00, 0x10, 0x00, 0x80, 0x01, 0x82, 0x0f, 0x02, 0x00, 0x10, 0x00, 0x80, 0x01, 0x82, 0x0f, 0x02, 0x00, 0x10, 0x00, 0x80, 0x01, 0x01, 0x07, 0x04, 0x00, 0x20, 0x00, 0x80, 0x01, 0x01, 0x00, 0x04, 0x00, 0x20, 0x00, 0x80, 0x81, 0x00, 0x00, 0x08, 0x00, 0x26, 0x00, 0x80, 0x81, 0x00, 0x00, 0x08, 0x80, 0x27, 0x00, 0x80, 0x81, 0x00, 0x00, 0x08, 0xe0, 0x27, 0x00, 0x80, 0x81, 0x22, 0xa2, 0x08, 0xd8, 0x27, 0x00, 0x80, 0x41, 0x36, 0xa5, 0x10, 0xc6, 0x27, 0x00, 0x80, 0x41, 0xaa, 0xa8, 0x90, 0xc1, 0x27, 0x00, 0x80, 0x41, 0xaa, 0xaf, 0x90, 0xc1, 0x27, 0x00, 0x80, 0x41, 0xa2, 0xa8, 0x10, 0xc0, 0x27, 0x00, 0x80, 0x41, 0xa2, 0xa8, 0x17, 0xc0, 0x21, 0x00, 0x80, 0x41, 0x00, 0x00, 0x10, 0x40, 0x20, 0x00, 0x80, 0x41, 0x00, 0x00, 0x10, 0x00, 0x20, 0x00, 0x80, 0x41, 0xfe, 0xff, 0x17, 0x00, 0x20, 0x00, 0x80, 0x41, 0x00, 0x00, 0x10, 0x00, 0x30, 0x00, 0x80, 0x41, 0xfe, 0xff, 0x17, 0x00, 0x3c, 0x0e, 0x80, 0x41, 0x00, 0x00, 0x10, 0x00, 0x0f, 0x11, 0x80, 0x41, 0x00, 0x00, 0x10, 0xc0, 0x1b, 0x11, 0x80, 0x41, 0x00, 0x00, 0x10, 0xf0, 0xe4, 0x10, 0x80, 0x41, 0x00, 0x00, 0x10, 0x3c, 0x84, 0x08, 0x80, 0x41, 0x00, 0x00, 0x10, 0x0f, 0x88, 0x3c, 0x80, 0x41, 0x00, 0x00, 0xd0, 0x03, 0xf0, 0x43, 0x80, 0x41, 0x00, 0x00, 0xf0, 0x01, 0x8c, 0x43, 0x80, 0xc1, 0xff, 0xff, 0x3f, 0x01, 0x82, 0x24, 0x80, 0xc1, 0xff, 0xff, 0x1f, 0x01, 0x82, 0x18, 0x80, 0x01, 0x00, 0x02, 0x02, 0x01, 0xfc, 0x08, 0x80, 0x01, 0x00, 0x02, 0x02, 0x01, 0x20, 0x09, 0x80, 0x01, 0x00, 0x02, 0x02, 0x01, 0x10, 0x06, 0x80, 0x01, 0x00, 0x02, 0x02, 0x01, 0x10, 0x00, 0x80, 0x01, 0x00, 0x02, 0x02, 0x01, 0x08, 0x00, 0x80, 0x01, 0x00, 0x02, 0x02, 0x01, 0x08, 0x00, 0x80, 0x01, 0x00, 0x02, 0x02, 0x01, 0xb4, 0x3f, 0x80, 0x01, 0x00, 0x02, 0x02, 0x01, 0x0e, 0x28, 0x80, 0x01, 0x00, 0x02, 0x02, 0x01, 0x03, 0x16, 0x80, 0x01, 0x00, 0x02, 0x02, 0x81, 0xc0, 0x11, 0x80, 0x01, 0x00, 0x02, 0x02, 0x41, 0x38, 0x08, 0x80, 0x01, 0x00, 0x02, 0x02, 0x21, 0x04, 0x04, 0x80, 0x01, 0x00, 0x02, 0x02, 0x11, 0x03, 0x02, 0x80, 0x01, 0x00, 0x02, 0x02, 0xc9, 0x80, 0x01, 0x80, 0x01, 0x00, 0x02, 0x02, 0x25, 0x60, 0x00, 0x80, 0x01, 0x00, 0x02, 0x02, 0x13, 0x18, 0x00, 0x80, 0x01, 0x00, 0x02, 0x02, 0x01, 0x07, 0x00, 0x80, 0x01, 0x00, 0x02, 0xc2, 0xfe, 0x00, 0x00, 0x80, 0x01, 0x00, 0x02, 0x32, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x02, 0x0e, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xfe, 0x03, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; xforms-1.2.4/demos/canvas.c0000644000175000017500000002262212251644223012510 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Demo showing the interaction with a canvas object. * * This file is part of xforms package * T.C. Zhao and M. Overmars (1997) * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include /**** Forms and Objects ****/ typedef struct { FL_FORM * canvasform; void * vdata; char * cdata; long ldata; FL_OBJECT * canvas; FL_OBJECT * br; FL_OBJECT * keyboard; FL_OBJECT * mouse; FL_OBJECT * move; FL_OBJECT * misc; } FD_canvasform; FD_canvasform *fd_canvasform; static GC canvasGC; /*************************************** ***************************************/ static int canvas_expose( FL_OBJECT * ob FL_UNUSED_ARG, Window win, int w, int h, XEvent * ev FL_UNUSED_ARG, void * d ) { FD_canvasform *ui = d; XFillRectangle( fl_get_display( ), win, canvasGC, 0, 0, w, h ); fl_addto_browser( ui->br, "Expose" ); return 0; } /*************************************** ***************************************/ static int canvas_key( FL_OBJECT * ob FL_UNUSED_ARG, Window win FL_UNUSED_ARG, int w FL_UNUSED_ARG, int h FL_UNUSED_ARG, XEvent * ev, void * d ) { FD_canvasform *ui = d; char buf[ 128 ]; KeySym *keysymT; int dummy; keysymT = XGetKeyboardMapping( fl_display, ev->xkey.keycode, 1, &dummy); sprintf( buf, "KeyPress: keysym=%ld", ( long ) keysymT[ 0 ] ); XFree( keysymT ); fl_addto_browser( ui->br, buf ); return 0; } /*************************************** ***************************************/ static int canvas_but( FL_OBJECT * ob FL_UNUSED_ARG, Window win FL_UNUSED_ARG, int w FL_UNUSED_ARG, int h FL_UNUSED_ARG, XEvent * ev, void * d ) { FD_canvasform *ui = d; char buf[ 128 ]; sprintf( buf, "Button%s: %d", ev->type == ButtonPress? "Press" : "Release", ev->xbutton.button ); fl_addto_browser( ui->br, buf ); return 0; } /*************************************** ***************************************/ static int canvas_move( FL_OBJECT * ob FL_UNUSED_ARG, Window win FL_UNUSED_ARG, int w FL_UNUSED_ARG, int h FL_UNUSED_ARG, XEvent * ev, void * d ) { FD_canvasform *ui = d; char buf[ 128 ]; sprintf( buf, "Position: %d %d", ev->xmotion.x, ev->xmotion.y ); fl_addto_browser( ui->br, buf ); return 0; } /*************************************** ***************************************/ static int canvas_misc( FL_OBJECT * ob FL_UNUSED_ARG, Window win FL_UNUSED_ARG, int w FL_UNUSED_ARG, int h FL_UNUSED_ARG, XEvent * ev, void * d ) { FD_canvasform *ui = d; fl_addto_browser( ui->br, ev->xcrossing.type == EnterNotify ? "Enter canvas" : "Leave canvas" ); return 0; } /*************************************** ***************************************/ static void init_canvas( FD_canvasform * fdui ) { fl_add_canvas_handler( fdui->canvas, Expose, canvas_expose, fdui ); fl_add_canvas_handler( fdui->canvas, KeyPress, canvas_key, fdui ); fl_add_canvas_handler( fdui->canvas, ButtonPress, canvas_but, fdui ); fl_add_canvas_handler( fdui->canvas, ButtonRelease, canvas_but, fdui ); fl_set_button( fdui->mouse, 1 ); fl_set_button( fdui->keyboard, 1 ); canvasGC = XCreateGC( fl_get_display( ),fl_state[ fl_vmode ].trailblazer, 0, 0 ); XSetForeground( fl_get_display( ), canvasGC, fl_get_flcolor( FL_BLACK ) ); } /* callbacks */ /*************************************** ***************************************/ static void sensitive_setting( FL_OBJECT * ob, long event ) { FL_HANDLE_CANVAS hc; int count = 1; int events[ 2 ] = { event, 0 }; switch ( event ) { case KeyPress: hc = canvas_key; break; case ButtonPress: hc = canvas_but; events[ 1 ] = ButtonRelease; count = 2; break; case EnterNotify: hc = canvas_misc; events[ 1 ] = LeaveNotify; count = 2; break; case MotionNotify: hc = canvas_move; break; default: return; } if ( fl_get_button( ob ) ) while ( count > 0 ) fl_add_canvas_handler( fd_canvasform->canvas, events[ --count ], hc, fd_canvasform ); else while ( count > 0 ) fl_remove_canvas_handler( fd_canvasform->canvas, events[ --count ], hc ); } /*************************************** ***************************************/ static void disable_it( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { if ( fl_get_button( ob ) ) fl_deactivate_object( fd_canvasform->canvas ); else fl_activate_object( fd_canvasform->canvas ); } /*************************************** ***************************************/ static void hide_it( FL_OBJECT * ob, long all FL_UNUSED_ARG ) { if ( fl_object_is_visible( fd_canvasform->canvas ) ) { fl_hide_object( fd_canvasform->canvas ); fl_set_object_label( ob, "ShowCanvas" ); } else { fl_show_object( fd_canvasform->canvas ); fl_set_object_label( ob, "HideCanvas" ); } } /*************************************** ***************************************/ static void clear_list( FL_OBJECT * ob FL_UNUSED_ARG, long what FL_UNUSED_ARG ) { fl_clear_browser( fd_canvasform->br ); } /*************************************** ***************************************/ static FD_canvasform * create_form_canvasform( void ) { FL_OBJECT *obj; FD_canvasform *fdui = fl_calloc( 1, sizeof *fdui ); fdui->canvasform = fl_bgn_form( FL_NO_BOX, 450, 280 ); fl_add_box( FL_UP_BOX, 0, 0, 450, 280, "" ); fdui->canvas = fl_add_canvas( FL_NORMAL_CANVAS, 20, 40, 155, 187, "" ); fdui->br = fl_add_browser( FL_NORMAL_BROWSER, 188, 40, 152, 187, "" ); obj = fl_add_text( FL_NORMAL_TEXT, 103, 10, 150, 20, "Canvas Events" ); fl_set_object_lsize( obj, FL_MEDIUM_SIZE ); fl_set_object_lalign( obj, FL_ALIGN_CENTER ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); fdui->keyboard = obj = fl_add_checkbutton( FL_PUSH_BUTTON, 345, 40, 76, 26, "Keyboard" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_object_callback( obj, sensitive_setting, KeyPress ); fdui->mouse = obj = fl_add_checkbutton( FL_PUSH_BUTTON, 345, 70, 76, 26, "Buttons" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_object_callback( obj, sensitive_setting, ButtonPress ); fdui->move = obj = fl_add_checkbutton( FL_PUSH_BUTTON, 345, 100, 74, 26, "Movements" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_object_callback( obj, sensitive_setting, MotionNotify ); fdui->misc = obj = fl_add_checkbutton( FL_PUSH_BUTTON, 345, 130, 74, 26, "Enter\nLeave" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_object_callback( obj, sensitive_setting, EnterNotify ); obj = fl_add_button( FL_PUSH_BUTTON, 30, 240, 90, 27, "Deactivate" ); fl_set_object_callback( obj, disable_it, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 130, 240, 90, 27, "Hide canvas" ); fl_set_object_callback( obj, hide_it, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 230, 240, 90, 27, "Clear" ); fl_set_object_callback( obj, clear_list, 0 ); fl_add_button( FL_NORMAL_BUTTON, 330, 240, 90, 27, "Done" ); fl_end_form( ); return fdui; } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_initialize( &argc, argv, "FormDemo", 0, 0 ); fd_canvasform = create_form_canvasform( ); init_canvas( fd_canvasform ); fl_show_form( fd_canvasform->canvasform, FL_PLACE_FREE, FL_FULLBORDER, "canvasform" ); fl_do_forms(); fl_finish( ); fl_free( fd_canvasform ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/objpos.c0000644000175000017500000000462312251643537012541 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * This is a crazy demo showing the "use" of changing * fields in objects. * * T.C. Zhao and M. Overmars */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" /*************************************** ***************************************/ void move_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data ) { static FL_Coord dx = 8, dy = 8; FL_OBJECT *but = ( FL_OBJECT * ) data; FL_Coord x, y, w, h; fl_get_object_geometry( but, &x, &y, &w, &h ); if ( x + dx < 0 || x + w + dx >= but->form->w ) dx = -dx; if ( y + dy < 0 || y + h + dy >= but->form->h ) dy = -dy; x += dx; y += dy; fl_set_object_position( but, x, y ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM *form; FL_OBJECT *but, *obj; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); form = fl_bgn_form( FL_DOWN_BOX, 400, 200 ); but = fl_add_button( FL_NORMAL_BUTTON, 140, 160, 70, 35, "Exit" ); fl_set_object_resize( but, FL_RESIZE_NONE ); obj = fl_add_button( FL_TOUCH_BUTTON, 330, 150, 50, 30, "Move" ); fl_set_object_resize( obj, FL_RESIZE_NONE ); fl_set_object_gravity( obj, FL_SouthEast, FL_SouthEast ); fl_set_object_callback( obj,move_cb,( long ) but ); fl_end_form( ); fl_show_form( form, FL_PLACE_MOUSE | FL_FREE_SIZE, FL_FULLBORDER, "ObjPos" ); fl_do_forms( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/borderwidth.c0000644000175000017500000001237512251712025013552 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * demo showing the effect of different border widths * * This file is part of xforms packge * T.C. Zhao and M. Overmars (1997) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include /**** Forms and Objects ****/ typedef struct { FL_FORM * bwform; void * vdata; char * cdata; long ldata; FL_OBJECT * done; FL_OBJECT * bw_select; FL_OBJECT * bwgroup; FL_OBJECT * pmobj; } FD_bwform; static FD_bwform * fd_bwform; static FD_bwform * create_form_bwform( void ); static void done_callback( FL_OBJECT *, long ); static void bw_callback( FL_OBJECT *, long ); /* Callbacks for form bwform */ /*************************************** ***************************************/ static void done_callback( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_finish( ); fl_free( fd_bwform ); exit( 0 ); } /*************************************** ***************************************/ static void bw_callback( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { static int bws[ ] = { -5, -4, -3, -2, -1, 1, 2, 3, 4, 5 }; FL_POPUP_RETURN *r = fl_get_select_item( ob ); int bw = bws[ r->val ]; fl_set_object_bw( fd_bwform->bwgroup, bw ); fl_set_object_bw( fd_bwform->done, bw ); fl_popup_set_bw( ( FL_POPUP * ) r->popup, bw ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { int bw; char txt[ 9 ]; /* Application default. Can be overriden by the command line options */ fl_set_border_width( 1 ); fl_initialize( &argc, argv, "FormDemo", 0, 0 ); fd_bwform = create_form_bwform( ); /* Form initialization code */ fl_set_pixmapbutton_file( fd_bwform->pmobj, "crab.xpm" ); fl_add_select_items( fd_bwform->bw_select, "-5 Pixel|-4 Pixel|-3 Pixel|-2 Pixel|-1 Pixel|" " 1 Pixel| 2 Pixel| 3 Pixel| 4 Pixel| 5 Pixel" ); bw = fl_get_border_width( ); if ( bw < -5 || bw == 0 || bw > 5 ) fl_set_border_width( bw = -2 ); sprintf( txt, "%2d Pixel", bw ); fl_set_select_item( fd_bwform->bw_select, fl_get_select_item_by_label( fd_bwform->bw_select, txt ) ); /* show the form */ fl_show_form( fd_bwform->bwform, FL_PLACE_CENTER, FL_TRANSIENT, "bwform" ); while ( fl_do_forms( ) ) /* empty */ ; return 0; } /*************************************** * Form definition file generated with fdesign. ***************************************/ static FD_bwform * create_form_bwform( void ) { FL_OBJECT *obj; FD_bwform *fdui = fl_calloc( 1, sizeof *fdui ); fdui->bwform = fl_bgn_form( FL_NO_BOX, 380, 340 ); fdui->bwgroup = fl_bgn_group(); fl_add_box( FL_UP_BOX, 0, 0, 380, 340, "" ); fl_add_frame( FL_EMBOSSED_FRAME, 220, 60, 135, 145, "" ); fl_add_frame( FL_ENGRAVED_FRAME, 15, 60, 185, 145, "" ); fl_add_slider( FL_HOR_SLIDER, 25, 70, 160, 20, "" ); fl_add_valslider( FL_HOR_BROWSER_SLIDER, 25, 105, 160, 20, "" ); obj = fl_add_scrollbar( FL_HOR_THIN_SCROLLBAR, 25, 140, 160, 20, "" ); fl_set_scrollbar_size( obj, 0.2 ); fl_add_counter( FL_NORMAL_COUNTER, 25, 175, 160, 20, "" ); fdui->pmobj = fl_add_pixmapbutton( FL_NORMAL_BUTTON, 305, 145, 40, 35, "" ); fl_add_positioner( FL_NORMAL_POSITIONER, 30, 225, 100, 80, "" ); fl_add_button( FL_NORMAL_BUTTON, 230, 65, 100, 28, "Button" ); fl_add_lightbutton( FL_PUSH_BUTTON, 230, 98, 100, 28, "LightButton" ); fl_add_roundbutton( FL_PUSH_BUTTON, 230, 128, 80, 32, "Button" ); obj = fl_add_round3dbutton( FL_PUSH_BUTTON, 230, 152, 80, 32, "Button" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_add_checkbutton( FL_PUSH_BUTTON, 230, 175, 80, 32, "Button" ); fl_add_input( FL_NORMAL_INPUT, 195, 240, 160, 28, "Input" ); fdui->bw_select = obj = fl_add_select( FL_MENU_SELECT, 105, 20, 100, 28, "Border Width" ); fl_set_object_callback( obj, bw_callback, 0 ); fl_end_group( ); fdui->done = obj = fl_add_button( FL_NORMAL_BUTTON, 270, 290, 75, 30, "Done" ); fl_set_object_callback( obj, done_callback, 0 ); fl_end_form( ); fdui->bwform->fdui = fdui; return fdui; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/positioner.c0000664000175000017500000000455512340166201013431 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* This demo shows the use of a positioner. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "include/forms.h" static FL_OBJECT * xval, * yval; /*************************************** * Callback routine ***************************************/ static void positioner_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { fl_set_object_label_f( xval, "%f", fl_get_positioner_xvalue( obj ) ); fl_set_object_label_f( yval, "%f", fl_get_positioner_yvalue( obj ) ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM * form; FL_OBJECT * pos; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); form = fl_bgn_form( FL_UP_BOX, 400, 280 ); pos = fl_add_positioner( FL_NORMAL_POSITIONER, 40, 40, 200, 200, "" ); fl_set_positioner_xbounds( pos, 0, 1 ); fl_set_positioner_ybounds( pos, 0, 1 ); fl_set_object_callback( pos, positioner_cb, 0 ); xval = fl_add_box( FL_DOWN_BOX, 270, 40, 100, 30, "" ); fl_set_object_color( xval, FL_COL1, FL_COL1 ); yval = fl_add_box( FL_DOWN_BOX, 270, 90, 100, 30, "" ); fl_set_object_color( yval, FL_COL1, FL_COL1 ); fl_add_button( FL_NORMAL_BUTTON, 270, 210, 100, 30, "Exit" ); fl_end_form( ); fl_show_form( form, FL_PLACE_CENTER, FL_NOBORDER, "positioner" ); positioner_cb( pos, 0 ); fl_do_forms( ); fl_hide_form( form ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/invslider.c0000644000175000017500000000623712251643673013250 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Inverted slider * * T.C. Zhao and M. Overmars */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include typedef struct { FL_FORM * inv; void * vdata; char * cdata; long ldata; FL_OBJECT * sl[ 3 ]; FL_OBJECT * done; } FD_inv; FD_inv *ui; static FD_inv *create_form_inv( void ); /*************************************** ***************************************/ static void invert_it( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { if ( fl_get_button( ob ) ) { fl_set_slider_bounds( ui->sl[ 0 ], 1.0, 0.0 ); fl_set_slider_bounds( ui->sl[ 1 ], 1.0, 0.0 ); fl_set_slider_bounds( ui->sl[ 2 ], 1.0, 0.0 ); } else { fl_set_slider_bounds( ui->sl[ 0 ], 0.0, 1.0 ); fl_set_slider_bounds( ui->sl[ 1 ], 0.0, 1.0 ); fl_set_slider_bounds( ui->sl[ 2 ], 0.0, 1.0 ); } } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_initialize( &argc, argv, "FormDemo", 0, 0 ); ui = create_form_inv( ); fl_show_form( ui->inv, FL_PLACE_CENTER | FL_FREE_SIZE, FL_TRANSIENT, "inv" ); while ( fl_do_forms( ) != ui->done ) /* empty */ ; fl_finish( ); fl_free( ui ); return 0; } /*************************************** ***************************************/ static FD_inv * create_form_inv( void ) { FL_OBJECT *obj; FD_inv *fdui = fl_calloc( 1, sizeof *fdui ); fdui->inv = fl_bgn_form(FL_NO_BOX, 245, 280); fl_add_box(FL_UP_BOX,0,0,245,280,""); fdui->sl[ 0 ] = fl_add_valslider( FL_VERT_SLIDER, 20, 30, 35, 230, "" ); fdui->sl[ 1 ] = fl_add_valslider( FL_VERT_FILL_SLIDER, 65, 30, 35, 230, "" ); fdui->sl[ 2 ] = obj = fl_add_valslider( FL_VERT_NICE_SLIDER, 115, 30, 35, 230, "" ); fl_set_object_boxtype( obj, FL_FLAT_BOX ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fdui->done = fl_add_button( FL_RETURN_BUTTON, 160, 235, 75, 30, "Exit" ); obj = fl_add_checkbutton( FL_PUSH_BUTTON, 165, 30, 75, 35, "Invert" ); fl_set_object_callback( obj, invert_it, 0 ); fl_end_form( ); return fdui; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/pushbutton.c0000644000175000017500000000454412251643460013455 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* A demo that shows the use of push buttons. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" FL_FORM *form; FL_OBJECT *abox[ 8 ]; /*************************************** ***************************************/ static void push_cb( FL_OBJECT * ob, long n ) { if ( fl_get_button( ob ) ) fl_show_object( abox[ n ] ); else fl_hide_object( abox[ n ] ); } /*************************************** ***************************************/ static void makeform( void ) { int i; FL_OBJECT *obj; form = fl_bgn_form( FL_UP_BOX, 400, 400 ); for ( i = 0; i < 8; i++ ) { obj = fl_add_button( FL_PUSH_BUTTON, 40, 310 - 40 * i, 80, 30, "" ); fl_set_object_color( obj, FL_BLACK + i + 1, FL_BLACK + i + 1 ); fl_set_object_callback( obj, push_cb, i ); abox[ i ] = fl_add_box( FL_DOWN_BOX, 150 + 30 * i, 40, 25, 320, "" ); fl_set_object_color( abox[ i ], FL_BLACK + i + 1, FL_BLACK + i + 1 ); fl_hide_object( abox[ i ] ); } fl_add_button( FL_NORMAL_BUTTON, 40, 350, 80, 30, "Exit" ); fl_end_form( ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_initialize( &argc, argv, "FormDemo", 0, 0 ); makeform( ); fl_show_form( form, FL_PLACE_CENTER, FL_NOBORDER, "Push Buttons" ); /* fl_do_forms will return only when Exit is pressed */ fl_do_forms( ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/free1.c0000644000175000017500000000660412251644010012233 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* This demo is meant to demonstrate the use of a free object in a form. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include int on = 1, dcol = 1; FL_COLOR cole; /*************************************** * The call back routine ***************************************/ int handle_free1( FL_OBJECT * obj, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { static int dcol = 1; switch ( event ) { case FL_DRAW: fl_rectf( obj->x, obj->y, obj->w, obj->h, obj->u_ldata ); break; case FL_RELEASE: on = ! on; break; case FL_STEP: if ( on ) { if ( ( FL_COLOR ) obj->u_ldata >= cole ) dcol = -1; if ( obj->u_ldata <= FL_FREE_COL1 ) dcol = 1; obj->u_ldata += dcol; fl_redraw_object( obj ); } break; } return 0; } /*************************************** ***************************************/ void done( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_finish( ); exit( 0 ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM *form; FL_OBJECT *obj; FL_COLOR i; int j, depth, col; fl_initialize(&argc, argv, "FormDemo", 0, 0); form = fl_bgn_form( FL_UP_BOX, 400, 400 ); obj = fl_add_button( FL_NORMAL_BUTTON, 320, 20, 40, 30, "Exit" ); fl_set_object_callback( obj, done, 0 ); obj = fl_add_free( FL_CONTINUOUS_FREE, 40, 80, 320, 280, "", handle_free1 ); fl_end_form( ); /* Can't do it if less than 4 bit deep... */ depth = fl_get_visual_depth( ); if ( depth < 4 ) { fprintf( stderr,"This Demo requires a depth of at least 4 bits\n" ); fl_finish( ); exit( 1 ); } /* ...but too large a depth also won't do */ if ( depth > 7 ) depth = 7; cole = ( 1 << depth ) - 1; if ( cole > 64 ) cole = 64; obj->u_ldata = col = FL_FREE_COL1; cole += col; for ( i = col; i <= cole; i++ ) { j = 255 * ( i - col ) / ( double ) ( cole - col ); fl_mapcolor( i, j, j, j ); } fl_show_form( form,FL_PLACE_CENTER, FL_NOBORDER, "Free Object" ); fl_do_forms( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/menu.c0000644000175000017500000001263212330764243012204 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* This demo shows the use of menu's. * The first two are PUSH_MENUs (pop-up). * The third one is PULLDOWN_MENU * and the last one is TOUCH_MENU * * a confusing demo, but a good testing program .. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include extern FL_FORM *create_form(void); FL_OBJECT *menu[ 4 ], *abox[ 4 ]; int set[ 4 ]; /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM *form; int i, j; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); form = create_form( ); /* fl_setpup_color( FL_SLATEBLUE, FL_BLACK ); */ for ( i = 0; i < 4; i++ ) { fl_show_menu_symbol( menu[ i ], 1 ); fl_set_menu( menu[ i ], "Red%r1|Green%r1|Yellow%r1|Blue%r1|Purple%r1|" "Cyran%r1|White%r1"); fl_set_menu_item_shortcut( menu[ i ], 1, "Rr#R#r" ); fl_set_menu_item_shortcut( menu[ i ], 2, "Gg#G#g" ); fl_set_menu_item_shortcut( menu[ i ], 3, "Yy#Y#y" ); fl_set_menu_item_shortcut( menu[ i ], 4, "Bb#B#b" ); fl_set_menu_item_shortcut( menu[ i ], 5, "Pp#P#p" ); fl_set_menu_item_shortcut( menu[ i ], 6, "Cc#C#c" ); fl_set_menu_item_shortcut( menu[ i ], 7, "Ww#W#w" ); /* Initially the last three entries are enabled */ for ( j = 5; j <= 7; j++ ) fl_set_menu_item_mode( menu[ i ], j, FL_PUP_RADIO ); /* The first four are disabled except the item (i+1) */ for ( j = 1; j <= 4; j++ ) fl_set_menu_item_mode( menu[ i ], j, FL_PUP_GREY | FL_PUP_RADIO ); set[ i ] = i + 1; fl_set_object_color( abox[ i ], FL_BLACK + set[ i ], FL_BLACK ); fl_set_menu_item_mode( menu[ i ], set[ i ], FL_PUP_CHECK | FL_PUP_RADIO ); } fl_show_form( form, FL_PLACE_CENTER, FL_TRANSIENT, "Menu" ); fl_do_forms( ); fl_hide_form( form ); return 0; } /*************************************** * m is the menu index 0 - 3 ***************************************/ static void menu_cb( FL_OBJECT * obj, long m ) { int i, item = fl_get_menu( obj ); if ( item <= 0 || set[ m ] == item ) return; for ( i = 0; i < 4; i++) { if ( i != m ) { /* enable the old selected color for other menus*/ fl_set_menu_item_mode( menu[ i ], set[ m ], FL_PUP_RADIO ); /* disable the currently selected color for other menus */ fl_set_menu_item_mode( menu[ i ], item, FL_PUP_GRAY | FL_PUP_RADIO ); } } set[ m ] = item; fl_set_object_color( abox[ m ], FL_BLACK + item, FL_BLACK ); } /*************************************** ***************************************/ static void done_cb( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_finish( ); exit( 0 ); } /*************************************** ***************************************/ FL_FORM * create_form( void ) { FL_FORM *form; FL_OBJECT *obj; form = fl_bgn_form( FL_NO_BOX, 440, 380 ); obj = fl_add_box( FL_BORDER_BOX, 0, 0, 440, 380, "" ); fl_set_object_color( obj, FL_SLATEBLUE, FL_COL1 ); menu[ 0 ] = obj = fl_add_menu( FL_PUSH_MENU, 0, 0, 110, 30, "Color 1" ); fl_set_menu_notitle( obj, 1 ); fl_set_object_shortcut( obj, "1#1", 1 ); fl_set_object_callback( obj, menu_cb, 0 ); menu[ 1 ] = obj = fl_add_menu( FL_PUSH_MENU, 110, 0, 110, 30, "Color 2" ); fl_set_object_shortcut( obj, "2#2", 1 ); fl_set_object_callback( obj, menu_cb, 1 ); menu[ 2 ] = obj = fl_add_menu( FL_PULLDOWN_MENU, 220, 0, 110, 30, "Color 3" ); fl_set_object_shortcut( obj, "3#3", 1 ); fl_set_object_callback( obj, menu_cb, 2 ); menu[ 3 ] = obj = fl_add_menu( FL_TOUCH_MENU, 330, 0, 110, 30, "Color 4" ); fl_set_object_shortcut( obj, "4#4", 1 ); fl_set_object_callback( obj, menu_cb, 3 ); abox[ 0 ] = obj = fl_add_box( FL_SHADOW_BOX, 20, 80, 70, 230, "" ); abox[ 1 ] = obj = fl_add_box( FL_SHADOW_BOX, 130, 80, 70, 230, "" ); abox[ 2 ] = obj = fl_add_box( FL_SHADOW_BOX, 240, 80, 70, 230, "" ); abox[ 3 ] = obj = fl_add_box( FL_SHADOW_BOX, 350, 80, 70, 230, "" ); obj = fl_add_button( FL_NORMAL_BUTTON, 310, 330, 110, 30, "Quit" ); fl_set_object_shortcut( obj, "Q#Q", 1 ); fl_set_object_callback( obj, done_cb, 0 ); fl_end_form( ); fl_scale_form( form, 0.9, 0.9 ); fl_adjust_form_size( form ); return form; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/boxtype.c0000644000175000017500000001645712251644245012744 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * This demo show the different boxtypes. Note that some * boxtypes are not appropriate for some objects * * This file is part of xforms package. * M. Overmars and T.C. Zhao (1997) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" static int border = FL_TRANSIENT; typedef struct { int val; char * name; } VN_struct; #define VN( a ) { a, #a } static VN_struct btypes[ ]= { { FL_NO_BOX, "No box" }, { FL_UP_BOX, "Up box" }, { FL_DOWN_BOX, "Down box" }, { FL_BORDER_BOX, "Border box" }, { FL_SHADOW_BOX, "Shadow box" }, { FL_FLAT_BOX, "Flat box" }, { FL_FRAME_BOX, "Frame box" }, { FL_EMBOSSED_BOX, "Embossed box" }, { FL_ROUNDED_BOX, "Rounded box" }, { FL_RFLAT_BOX, "Rflat box" }, { FL_RSHADOW_BOX, "Rshadow box" }, { FL_OVAL_BOX, "Oval box" }, { FL_ROUNDED3D_UPBOX, "Rounded 3D up box" }, { FL_ROUNDED3D_DOWNBOX, "Rounded 3D down box" }, { FL_OVAL3D_UPBOX, "Oval 3D up box" }, { FL_OVAL3D_DOWNBOX, "Oval 3D down box" }, /* sentinel */ { -1, NULL } }; #include "srs.xbm" /*************** Callback **********************/ FL_FORM *form; FL_OBJECT *tobj[ 18 ], *exitob, *btypeob; /*************************************** ***************************************/ static void boxtype_cb( FL_OBJECT * ob, long arg FL_UNUSED_ARG ) { int req_bt = fl_get_select_item( ob )->val; static int lastbt = -1; if ( lastbt != req_bt ) { size_t i; fl_freeze_form( form ); for ( i = 0; i < sizeof tobj / sizeof *tobj; i++ ) fl_set_object_boxtype( tobj[ i ], btypes[ req_bt ].val ); fl_unfreeze_form ( form ); lastbt = req_bt; } } /*************************************** ***************************************/ static void create_form( void ) { FL_OBJECT *obj; form = fl_bgn_form( FL_NO_BOX, 720, 520 ); obj = fl_add_box( FL_UP_BOX, 0, 0, 720, 520, "" ); fl_set_object_color( obj, FL_BLUE, FL_COL1 ); obj = fl_add_box( FL_DOWN_BOX, 10, 90, 700, 420, "" ); fl_set_object_color( obj, FL_COL1, FL_COL1 ); obj = fl_add_box( FL_DOWN_BOX, 10, 10, 700, 70, "" ); fl_set_object_color( obj, FL_SLATEBLUE, FL_COL1 ); tobj[ 0 ] = fl_add_box( FL_UP_BOX, 30, 110, 110, 110, "Box" ); tobj[ 1 ] = fl_add_text( FL_NORMAL_TEXT, 30, 240, 110, 30, "Text" ); tobj[ 2 ] = fl_add_bitmap( FL_NORMAL_BITMAP, 40, 280, 90, 80, "Bitmap" ); fl_set_object_lcolor( tobj[ 2 ], FL_BLUE ); tobj[ 3 ] = fl_add_chart(FL_BAR_CHART, 160, 110, 160, 110, "Chart"); tobj[ 4 ] = fl_add_clock( FL_ANALOG_CLOCK, 40, 390, 90, 90, "Clock" ); fl_set_object_dblbuffer( tobj[ 4 ], 1 ); tobj[ 5 ] = fl_add_button( FL_NORMAL_BUTTON, 340, 110, 120, 30, "Button" ); tobj[ 6 ] = fl_add_lightbutton( FL_PUSH_BUTTON, 340, 150, 120, 30, "Lightbutton" ); tobj[ 7 ] = fl_add_roundbutton( FL_PUSH_BUTTON, 340, 190, 120, 30, "Roundbutton" ); tobj[ 8 ] = fl_add_slider( FL_VERT_SLIDER, 160, 250, 40, 230, "Slider" ); tobj[ 9 ] = fl_add_valslider( FL_VERT_SLIDER, 220, 250, 40, 230, "Valslider" ); tobj[ 10 ] = fl_add_dial( FL_LINE_DIAL, 280, 250, 100, 100, "Dial" ); tobj[ 11 ] = fl_add_positioner( FL_NORMAL_POSITIONER, 280, 380, 150, 100, "Positioner" ); tobj[ 12 ] = fl_add_counter( FL_NORMAL_COUNTER, 480, 110, 210, 30, "Counter" ); tobj[ 13 ] = fl_add_input( FL_NORMAL_INPUT, 520, 170, 170, 30, "Input" ); tobj[ 14 ] = fl_add_menu( FL_PUSH_MENU, 400, 240, 100, 30, "Menu" ); tobj[ 15 ] = fl_add_select( FL_NORMAL_SELECT, 580, 250, 110, 30, "Select" ); tobj[ 16 ] = fl_add_timer( FL_VALUE_TIMER, 580, 210, 110, 30, "Timer" ); fl_set_object_dblbuffer( tobj[ 16 ], 1 ); tobj[ 17 ] = fl_add_browser( FL_NORMAL_BROWSER, 450, 300, 240, 180, "Browser" ); exitob = fl_add_button( FL_NORMAL_BUTTON, 590, 30, 100, 30, "Exit" ); btypeob = fl_add_select( FL_NORMAL_SELECT, 110, 30, 130, 30, "Boxtype" ); fl_set_object_callback( btypeob, boxtype_cb, 0 ); fl_popup_set_title( fl_get_select_popup( btypeob ), "Boxtype" ); fl_end_form ( ); } /*************** Main Routine ***********************/ static char * browserlines[ ] = { "@C1@c@l@bObjects Demo", "This demo shows you many of", "the objects that currently", "exist in the Forms Library.", "", "You can change the boxtype", "of the different objects", "using the buttons at the", "top of the form. Note that", "some combinations might not", "look too good. Also realize", "that for all object classes", "many different types are", "available with different", "behaviour.", NULL }; /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_COLOR c = FL_BLACK; char **p; VN_struct *vn; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); create_form( ); fl_set_bitmap_data( tobj[ 2 ], sorceress_width, sorceress_height, sorceress_bits ); fl_add_chart_value( tobj[ 3 ], 15, "Item 1", c++ ); fl_add_chart_value( tobj[ 3 ], 5, "Item 2", c++ ); fl_add_chart_value( tobj[ 3 ], -10, "Item 3", c++ ); fl_add_chart_value( tobj[ 3 ], 25, "Item 4", c++ ); fl_set_menu( tobj[ 14 ], "Item 1|Item 2|Item 3|Item 4|item 5" ); fl_add_select_items( tobj[ 15 ], "Item 1" ); fl_add_select_items( tobj[ 15 ], "Item 2" ); fl_add_select_items( tobj[ 15 ], "Item 3" ); fl_add_select_items( tobj[ 15 ], "Item 4" ); fl_add_select_items( tobj[ 15 ], "Item 5" ); fl_set_timer( tobj[ 16 ], 1000.0 ); for ( p = browserlines; *p; p++ ) fl_add_browser_line( tobj[ 17 ], *p ); for ( vn = btypes; vn->val >= 0; vn++ ) fl_add_select_items( btypeob, vn->name ); fl_set_select_item( btypeob, fl_get_select_item_by_value( btypeob, 1 ) ); boxtype_cb( btypeob, 0 ); fl_show_form ( form, FL_PLACE_MOUSE, border, "Box types" ); while ( fl_do_forms ( ) != exitob ) /* empty */; fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/sld_alt.c0000644000175000017500000000653312251643377012673 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" static FL_OBJECT *sl, *but1, *but2, *but3; /*************************************** ***************************************/ static void slider_callback( FL_OBJECT * a, long b FL_UNUSED_ARG ) { double val = fl_get_slider_value( a ); fl_set_button( but1, 0 ); fl_set_button( but2, 0 ); fl_set_button( but3, 0 ); if ( val <= 0.01 ) fl_set_button( but1, 1 ); else if ( val >= 0.49 && val <= 0.51 ) fl_set_button( but2, 1 ); else if ( val >= 0.99 ) fl_set_button( but3, 1 ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM *form; FL_OBJECT *but, *obj; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); form = fl_bgn_form( FL_UP_BOX, 300, 300 ); sl = fl_add_slider( FL_VERT_SLIDER, 40, 40, 60, 220, "X" ); fl_set_slider_value( sl, 0.5 ); fl_set_object_callback( sl, slider_callback, 0 ); but1 = fl_add_lightbutton( FL_PUSH_BUTTON, 140, 220, 120, 40, "0.0" ); but2 = fl_add_lightbutton( FL_PUSH_BUTTON, 140, 160, 120, 40, "0.5" ); fl_set_button( but2, 1 ); but3 = fl_add_lightbutton( FL_PUSH_BUTTON, 140, 100, 120, 40, "1.0" ); but = fl_add_button( FL_NORMAL_BUTTON, 140, 40, 120, 40, "Exit" ); fl_end_form(); fl_show_form( form, FL_PLACE_CENTER, FL_NOBORDER, "slRadio" ); while ( ( obj = fl_do_forms( ) ) != but ) if ( obj == but1 ) { if ( fl_get_button( but1 ) ) { fl_set_slider_value( sl, 0.0 ); fl_set_button( but2, 0 ); fl_set_button( but3, 0 ); } else fl_set_button( but1, 1 ); } else if ( obj == but2 ) { if ( fl_get_button( but2 ) ) { fl_set_slider_value( sl, 0.5 ); fl_set_button( but1, 0 ); fl_set_button( but3, 0 ); } else fl_set_button( but2, 1 ); } else if ( obj == but3 ) { if ( fl_get_button( but3 ) ) { fl_set_slider_value( sl, 1.0 ); fl_set_button( but1, 0 ); fl_set_button( but2, 0 ); } else fl_set_button( but3, 1 ); } fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/positioner_overlay.c0000664000175000017500000000743612351104611015172 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* This demo shows the use of a overlay positioner with a position validator */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "include/forms.h" #include "colorwheel.xpm" static FL_OBJECT * xval, * yval; /*************************************** * Validator function for positioner, makes sure that it's restricted to a circle ***************************************/ static int validator( FL_OBJECT * obj FL_UNUSED_ARG, double x, double y, double * x_repl, double * y_repl ) { double angle; /* If the new position is within the circle (with radius 1) it's fine, tell the positioner to use it as is */ if ( x * x + y * y <= 1 ) return FL_POSITIONER_VALID; /* Otherwise replace the new position by one at the circle's border in the direction from the center to the new coordinates */ angle = atan2( y, x ); *x_repl = cos( angle ); *y_repl = sin( angle ); /* Tell the positioner to use the values in x_repl and y_repl */ return FL_POSITIONER_REPLACED; } /*************************************** * Callback routine for new position ***************************************/ static void positioner_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { double x = fl_get_positioner_xvalue( obj ), y = fl_get_positioner_yvalue( obj ); double angle = 45 * atan2( y, x ) / atan( 1 ); if ( angle < 0 ) angle += 360; fl_set_object_label_f( xval, "%f", angle ); fl_set_object_label_f( yval, "%f", sqrt( x * x + y * y ) ); } /*************************************** * Creates the form and then does the interaction ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM * form; FL_OBJECT * pm; FL_OBJECT * pos; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); form = fl_bgn_form( FL_UP_BOX, 400, 280 ); pm = fl_add_pixmap( FL_NORMAL_PIXMAP, 40, 40, 203, 203, "" ); fl_set_pixmap_data( pm, colorwheel ); pos = fl_add_positioner( FL_OVERLAY_POSITIONER, 40, 40, 203, 203, "" ); fl_set_positioner_xbounds( pos, -1, 1 ); fl_set_positioner_ybounds( pos, -1, 1 ); fl_set_object_callback( pos, positioner_cb, 0 ); fl_set_positioner_xvalue( pos, 0.0 ); fl_set_positioner_yvalue( pos, 0.0 ); fl_set_positioner_validator( pos, validator ); fl_set_object_color( pos, FL_COL1, FL_BLACK ); xval = fl_add_box( FL_DOWN_BOX, 270, 40, 100, 30, "" ); fl_set_object_color( xval, FL_COL1, FL_COL1 ); yval = fl_add_box( FL_DOWN_BOX, 270, 90, 100, 30, "" ); fl_set_object_color( yval, FL_COL1, FL_COL1 ); fl_add_button( FL_NORMAL_BUTTON, 270, 210, 100, 30, "Exit" ); fl_end_form( ); fl_show_form( form, FL_PLACE_CENTER, FL_FULLBORDER, "positioner_v" ); positioner_cb( pos, 0 ); fl_do_forms( ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/xyplotactivelog.c0000644000175000017500000002203512251643245014473 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include #include "time.h" /**** Forms and Objects ****/ typedef struct { FL_FORM * axypform; void * vdata; long ldata; FL_OBJECT * xyplot; FL_OBJECT * xmin; FL_OBJECT * xmax; FL_OBJECT * ymin; FL_OBJECT * ymax; FL_OBJECT * status; } FD_axypform; FD_axypform *create_form_axypform( void ); FD_axypform *xypui; /* callbacks for form axypform */ /*************************************** ***************************************/ void xyplot_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { float x, y; int i; char buf[ 64 ]; fl_get_xyplot( ob, &x, &y, &i ); if ( i < 0 ) return; sprintf( buf, "X=%.3f Y=%.3f", x, y ); fl_set_object_label( xypui->status, buf ); } /*************************************** ***************************************/ void alwaysreturn_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_set_object_return( xypui->xyplot, fl_get_button( ob ) ? FL_RETURN_CHANGED : FL_RETURN_END_CHANGED ); } /*************************************** ***************************************/ void interpolate_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_set_xyplot_interpolate( xypui->xyplot, 0, fl_get_button( ob ) ? 3 : 0, 0.2 ); } /*************************************** ***************************************/ void inspect_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_set_xyplot_inspect( xypui->xyplot, fl_get_button( ob ) ); } /*************************************** ***************************************/ void notic_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { if ( fl_get_button( obj ) ) { fl_set_xyplot_xtics( xypui->xyplot, -1, -1 ); fl_set_xyplot_ytics( xypui->xyplot, -1, -1 ); } else { fl_set_xyplot_xtics( xypui->xyplot, 0, 0 ); fl_set_xyplot_ytics( xypui->xyplot, 0, 0 ); } } /*************************************** ***************************************/ void bounds_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data ) { char buf[ 50 ]; if ( ! data ) { float xmin = strtod( fl_get_input( xypui->xmin ), NULL ); float xmax = strtod( fl_get_input( xypui->xmax ), NULL ); if ( xmin <= 0.0 ) { xmin = 1.0; fl_set_input( xypui->xmin, "1.0" ); } if ( xmax <= 0.0 ) { xmax = 10.0; fl_set_input( xypui->xmax, "10.0" ); } fl_set_xyplot_xbounds( xypui->xyplot, xmin, xmax ); fl_get_xyplot_xbounds( xypui->xyplot, &xmin, &xmax ); sprintf( buf, "%g", xmin ); fl_set_input( xypui->xmin, buf ); sprintf( buf, "%g", xmax ); fl_set_input( xypui->xmax, buf ); } else { float ymin = strtod( fl_get_input( xypui->ymin ), NULL ); float ymax = strtod( fl_get_input( xypui->ymax ), NULL ); if ( ymin <= 0.0 ) { ymin = 1.0; fl_set_input( xypui->ymin, "1.0" ); } if ( ymax <= 0.0 ) { ymax = 10.0; fl_set_input( xypui->ymax, "10.0" ); } fl_set_xyplot_ybounds( xypui->xyplot, ymin, ymax ); fl_get_xyplot_ybounds( xypui->xyplot, &ymin, &ymax ); sprintf( buf, "%g", ymin ); fl_set_input( xypui->ymin, buf ); sprintf( buf, "%g", ymax ); fl_set_input( xypui->ymax, buf ); } } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { float x[ 11 ], y[ 11 ]; int i; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); xypui = create_form_axypform( ); /* Fill-in form initialization code */ fl_set_xyplot_ybounds( xypui->xyplot, 1.0, 10.0 ); for ( i = 0; i < 10; i++ ) x[ i ] = y[ i ] = i + 1; fl_add_xyplot_overlay( xypui->xyplot, 1, x, y, 10, FL_YELLOW ); fl_set_xyplot_overlay_type( xypui->xyplot, 1, FL_LINEPOINTS_XYPLOT ); fl_set_xyplot_interpolate( xypui->xyplot, 1, 2, 0.1 ); srand( time( NULL ) ); for ( i = 0; i < 10; i++ ) y[ i ] += ( double ) rand( ) / RAND_MAX - 0.5; fl_set_xyplot_data( xypui->xyplot, x, y, 10, "Active (log) xyplot with overlay", "x-axis", "y-axis" ); fl_set_xyplot_linewidth( xypui->xyplot, 0, 2 ); fl_set_xyplot_xgrid( xypui->xyplot, FL_GRID_MINOR ); /* Show the first form */ fl_show_form( xypui->axypform, FL_PLACE_MOUSE | FL_FREE_SIZE, FL_FULLBORDER, "xyplotactivelog" ); fl_do_forms( ); return 0; } /*************************************** ***************************************/ FD_axypform * create_form_axypform( void ) { FL_OBJECT *obj; FD_axypform *fdui = fl_calloc( 1, sizeof *fdui ); fdui->axypform = fl_bgn_form( FL_NO_BOX, 431, 301 ); fl_add_box( FL_UP_BOX, 0, 0, 431, 301, "" ); fdui->xyplot = obj = fl_add_xyplot( FL_ACTIVE_XYPLOT, 20, 50, 285, 235, "" ); fl_set_xyplot_xscale( obj, FL_LOG, 2.0 ); fl_set_xyplot_yscale( obj, FL_LOG, 2.0 ); fl_set_object_boxtype( obj, FL_DOWN_BOX ); fl_set_object_color( obj, FL_BLACK, FL_GREEN ); fl_set_object_lalign( obj, fl_to_inside_lalign( FL_ALIGN_BOTTOM ) ); fl_set_object_callback( obj, xyplot_cb, 0 ); fl_set_object_gravity( obj, FL_NorthWest, FL_SouthEast ); obj = fl_add_checkbutton( FL_PUSH_BUTTON, 315, 40, 80, 25, "AlwaysReturn" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_object_callback( obj, alwaysreturn_cb, 0 ); fl_set_object_gravity( obj, FL_NorthEast, FL_NorthEast ); obj = fl_add_checkbutton( FL_PUSH_BUTTON, 315, 65, 80, 25, "Interpolate" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_object_callback( obj, interpolate_cb, 0 ); fl_set_object_gravity( obj, FL_NorthEast, FL_NorthEast ); obj = fl_add_checkbutton( FL_PUSH_BUTTON, 315, 90, 85, 25, "InspectOnly" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_object_callback( obj, inspect_cb, 0 ); fl_set_object_gravity( obj, FL_NorthEast, FL_NorthEast ); obj = fl_add_checkbutton( FL_PUSH_BUTTON, 315, 120, 85, 25, "NoTics" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_object_callback( obj, notic_cb, 0 ); fl_set_object_gravity( obj, FL_NorthEast, FL_NorthEast ); fdui->xmin = obj = fl_add_input( FL_FLOAT_INPUT, 315, 150, 50, 20, " x_min" ); fl_set_input( obj, "1.0" ); fl_set_object_lalign( obj, FL_ALIGN_RIGHT ); fl_set_object_callback( obj, bounds_cb, 0 ); fl_set_object_gravity( obj, FL_NorthEast, FL_NorthEast ); fdui->xmax = obj = fl_add_input( FL_FLOAT_INPUT, 315, 170, 50, 20, " x_max" ); fl_set_input( obj, "10.0" ); fl_set_object_lalign( obj, FL_ALIGN_RIGHT ); fl_set_object_callback( obj, bounds_cb, 0 ); fl_set_object_gravity( obj, FL_NorthEast, FL_NorthEast ); fdui->ymin = obj = fl_add_input( FL_FLOAT_INPUT, 315, 200, 50, 20, " y_min" ); fl_set_input( obj, "1.0" ); fl_set_object_lalign( obj, FL_ALIGN_RIGHT ); fl_set_object_callback( obj, bounds_cb, 1 ); fl_set_object_gravity( obj, FL_NorthEast, FL_NorthEast ); fdui->ymax = obj = fl_add_input( FL_FLOAT_INPUT, 315, 220, 50, 20, " y_max" ); fl_set_input( obj, "10.0" ); fl_set_object_lalign( obj, FL_ALIGN_RIGHT ); fl_set_object_callback( obj, bounds_cb, 1 ); fl_set_object_gravity( obj, FL_NorthEast, FL_NorthEast ); fdui->status = obj = fl_add_box( FL_BORDER_BOX, 20, 15, 285, 25, "" ); fl_set_object_boxtype( obj, FL_DOWN_BOX ); fl_set_object_gravity( obj, FL_NorthWest, FL_NorthEast ); fl_set_object_lalign( obj, FL_ALIGN_CENTER ); obj = fl_add_button( FL_NORMAL_BUTTON, 325, 250, 90, 30, "Done" ); fl_set_object_gravity( obj, FL_SouthEast, FL_SouthEast ); fl_end_form( ); return fdui; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/select.c0000644000175000017500000000637012251643403012515 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" FL_FORM *form; FL_OBJECT *readyobj; /*************************************** ***************************************/ static int cb( FL_POPUP_RETURN *r ) { fprintf( stderr, "CallBack: %s\n", r->label ); return 0; } /*************************************** ***************************************/ void create_form( void ) { FL_OBJECT *sexobj, *childobj, *licenceobj, *marriedobj; FL_POPUP_ITEM items[ ] = { { "Male%SM", cb, "M", 0, 0 }, { "Female%SF", cb, "F", 0, 0 }, { NULL, NULL, NULL, 0, 0 } }; form = fl_bgn_form( FL_NO_BOX, 420, 360 ); fl_add_box( FL_UP_BOX, 0, 0, 420, 360, "" ); fl_add_input( FL_NORMAL_INPUT, 70, 300, 320, 30, "Name" ); fl_add_input( FL_NORMAL_INPUT, 70, 260, 320, 30, "Address" ); fl_add_input( FL_NORMAL_INPUT, 70, 220, 320, 30, "City" ); fl_add_input( FL_NORMAL_INPUT, 70, 180, 320, 30, "Country" ); sexobj = fl_add_select( FL_NORMAL_SELECT, 70, 130, 110, 30, "Sex"); fl_set_select_items( sexobj, items ); fl_set_object_shortcut( sexobj, "S", 1 ); childobj = fl_add_select( FL_MENU_SELECT, 280, 130, 110, 30, "Children" ); fl_add_select_items( childobj, "Zero|One|Two|Three|Four|Many" ); fl_set_object_shortcut( childobj, "C", 1 ); fl_popup_set_title( fl_get_select_popup( childobj ), "Kids" ); licenceobj = fl_add_select( FL_NORMAL_SELECT, 280, 80, 110, 30, "Licence" ); fl_add_select_items( licenceobj, "Yes|No" ); fl_set_select_policy( licenceobj, FL_POPUP_DRAG_SELECT ); marriedobj = fl_add_select( FL_DROPLIST_SELECT, 70, 80, 110, 27, "Married" ); fl_add_select_items( marriedobj, "Yes|No" ); readyobj = fl_add_button( FL_NORMAL_BUTTON, 150, 20, 140, 30, "Quit" ); fl_end_form( ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_flip_yorigin( ); fl_initialize( &argc, argv, "FormDemo", 0, 0 ); create_form( ); fl_show_form( form, FL_PLACE_CENTER | FL_FREE_SIZE, FL_TRANSIENT, "Select Object Demo" ); while ( fl_do_forms( ) != readyobj ) /* empty */ ; fl_hide_form( form ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/colbrowser.c0000664000175000017500000002550312353623325013424 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Test browser/slider and color handling. Select a colorname, * the program will show the color. Change the sliders, the * program will pick a colorname that has the closest color. * * This file is part of xforms package. * T.C. Zhao and M. Overmars (1997) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include #include #define MAX_RGB 3000 static FL_FORM *cl; static FL_OBJECT *rescol, *dbobj, *colbr, *rs, *gs, *bs; char dbname[ FL_PATH_MAX ] ; static void create_form_cl( void ); static int load_browser( const char * ); /* the RGB data file does not have a standard location on unix. */ #ifdef __VMS static char *rgbfile = "SYS$MANAGER:DECW$RGB.DAT"; #else #ifdef __EMX__ /* OS2 */ static char *rgbfile = "/XFree86/lib/X11/rgb.txt"; #else #include static char *rgbfile = "/usr/lib/X11/rgb.txt"; static char *rgbfile_2 = "/usr/share/X11/rgb.txt"; #endif #endif typedef struct { int r, g, b; } RGBdb; static RGBdb rgbdb[ MAX_RGB ]; /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_initialize( &argc, argv, "FormDemo", 0, 0 ); create_form_cl( ); strcpy( dbname, rgbfile ); #if ! defined __EMX__ && ! defined __VMS { struct stat buf; if ( stat( rgbfile, &buf ) == -1 ) strcpy( dbname, rgbfile_2 ); } #endif if ( load_browser( dbname ) ) fl_set_object_label( dbobj, dbname ); else fl_set_object_label( dbobj, "None" ); fl_set_form_minsize( cl, cl->w , cl->h ); fl_set_form_maxsize( cl, 2 * cl->w , 2 * cl->h ); fl_show_form( cl, FL_PLACE_FREE, FL_TRANSIENT, "RGB Browser" ); fl_do_forms( ); return 0; } /*************************************** ***************************************/ static void set_entry( int i ) { RGBdb *db = rgbdb + i; fl_freeze_form( cl ); fl_mapcolor( FL_FREE_COL4 + i, db->r, db->g, db->b ); fl_mapcolor( FL_FREE_COL4, db->r, db->g, db->b ); fl_set_slider_value( rs, db->r ); fl_set_slider_value( gs, db->g ); fl_set_slider_value( bs, db->b ); fl_unfreeze_form( cl ); } /*************************************** ***************************************/ static void br_cb( FL_OBJECT * ob, long q FL_UNUSED_ARG ) { int r = fl_get_browser( ob ); if ( r > 0 ) set_entry( r - 1 ); } /*************************************** ***************************************/ static int read_entry( FILE * fp, int * r, int * g, int * b, char * name ) { int n; char buf[ 512 ], *p; if ( ! fgets( buf, sizeof buf, fp ) ) return 0; if ( *buf == '!' ) if ( ! fgets( buf, sizeof buf, fp ) ) return 0; if ( sscanf( buf, " %d %d %d %n", r, g, b, &n ) != 3 ) return 0; p = buf + n; /* Remove all spaces */ while ( *p ) { if ( * p != ' ' && *p != '\n' ) *name++ = *p; p++; } *name = '\0'; return ! ( feof( fp ) || ferror( fp ) ); } /*************************************** ***************************************/ static int load_browser( const char * fname ) { FILE *fp; RGBdb *db = rgbdb, *dbs = db + MAX_RGB; int r, g, b, lr = -1, lg = -1, lb = -1; char name[ 256 ], buf[ 256 ]; #ifdef __EMX__ extern char *__XOS2RedirRoot( const char * ); if ( ! ( fp = fopen( __XOS2RedirRoot( fname ), "r" ) ) ) #else if ( ! ( fp = fopen( fname, "r" ) ) ) #endif { fl_show_alert( "Load", fname, "Can't open database file", 0 ); return 0; } /* read the items */ fl_freeze_form( cl ); while ( db < dbs && read_entry( fp, &r, &g, &b, name ) ) { db->r = r; db->g = g; db->b = b; /* unique the entries on the fly */ if ( lr != r || lg != g || lb != b ) { db++; lr = r; lg = g; lb = b; sprintf( buf, "(%3d %3d %3d) %s", r, g, b, name ); fl_addto_browser( colbr, buf ); } } fclose( fp ); if ( db < dbs ) db->r = 1000; /* sentinel */ else { db--; db->r = 1000; } fl_set_browser_topline( colbr, 1 ); fl_select_browser_line( colbr, 1 ); set_entry( 0 ); fl_unfreeze_form( cl ); return 1; } /*************************************** ***************************************/ static int search_entry( int r, int g, int b ) { RGBdb *db = rgbdb; int i, j; unsigned int mindiff = UINT_MAX; for ( i = j = 0; db->r < 256; db++, i++ ) { int diffr = r - db->r; int diffg = g - db->g; int diffb = b - db->b; #ifdef FL_LINEAR unsigned int diff = ( int ) ( 3.0 * FL_abs( diffr ) + 5.9 * FL_abs( diffg ) + 1.1 * FL_abs( diffb ) ); #else unsigned int diff = ( int ) ( 3.0 * ( diffr * diffr ) + 5.9 * ( diffg * diffg ) + 1.1 * ( diffb * diffb ) ); #endif if ( mindiff > diff ) { mindiff = diff; j = i; } } return j; } /*************************************** ***************************************/ static void search_rgb( FL_OBJECT * ob FL_UNUSED_ARG, long q FL_UNUSED_ARG ) { int r, g, b, i; int top = fl_get_browser_topline( colbr ); r = ( int ) fl_get_slider_value( rs ); g = ( int ) fl_get_slider_value( gs ); b = ( int ) fl_get_slider_value( bs ); fl_freeze_form( cl ); fl_mapcolor( FL_FREE_COL4, r, g, b ); i = search_entry( r, g, b ); /* Change topline only if necessary */ if ( i < top || i > top + 15 ) fl_set_browser_topline( colbr, i - 8 ); fl_select_browser_line( colbr, i + 1 ); fl_unfreeze_form( cl ); } /*************************************** * change database ***************************************/ static void db_cb( FL_OBJECT * ob, long q FL_UNUSED_ARG ) { const char *p = fl_show_input( "Enter new database name", dbname ); char buf[ 512 ]; if ( ! p || ! strcmp( p, dbname ) ) return; strcpy( buf, p ); if ( load_browser( buf ) ) { strcpy( dbname, buf ); fl_set_object_label( ob, dbname ); } } /*************************************** ***************************************/ static void done_cb( FL_OBJECT * ob FL_UNUSED_ARG, long q FL_UNUSED_ARG ) { fl_finish( ); exit( 0 ); } /*************************************** ***************************************/ static void create_form_cl( void ) { FL_OBJECT *obj; cl = fl_bgn_form( FL_NO_BOX, 330, 385 ); obj = fl_add_box( FL_UP_BOX, 0, 0, 330, 385, "" ); fl_set_object_color( obj, FL_COL1, FL_COL1 ); obj = fl_add_box( FL_NO_BOX, 40, 10, 250, 30, "Color Browser" ); fl_set_object_lcolor( obj, FL_RED ); fl_set_object_lsize( obj, FL_HUGE_SIZE ); fl_set_object_lstyle( obj, FL_BOLD_STYLE + FL_SHADOW_STYLE ); fl_set_object_gravity( obj, FL_North, FL_North ); fl_set_object_resize( obj, FL_RESIZE_NONE ); dbobj = obj = fl_add_button( FL_NORMAL_BUTTON, 40, 50, 250, 25, "" ); fl_set_object_boxtype( obj, FL_BORDER_BOX ); fl_set_object_color( obj, fl_get_visual_depth( )==1 ? FL_WHITE: FL_COL1, FL_COL1 ); fl_set_object_callback( obj, db_cb, 0 ); fl_set_object_gravity( obj, FL_North, FL_North ); fl_set_object_resize( obj, FL_RESIZE_X ); rescol = obj = fl_add_box( FL_FLAT_BOX, 225, 90, 90, 35, "" ); fl_set_object_color( obj, FL_FREE_COL4, FL_FREE_COL4 ); fl_set_object_boxtype( obj, FL_BORDER_BOX ); fl_set_object_resize( obj, FL_RESIZE_NONE ); fl_set_object_gravity( obj, FL_NorthEast, FL_East ); rs = obj = fl_add_valslider( FL_VERT_FILL_SLIDER, 225, 130, 30, 200, "" ); fl_set_object_color( obj, FL_COL1, FL_RED ); fl_set_slider_bounds( obj, 0, 255 ); fl_set_slider_precision( obj, 0 ); fl_set_object_callback( obj, search_rgb, 0 ); fl_set_slider_return( obj, 0 ); fl_set_object_resize( obj, FL_RESIZE_Y ); fl_set_object_gravity( obj, FL_NorthEast, FL_SouthEast ); fl_set_object_return( obj, FL_RETURN_CHANGED ); gs = obj = fl_add_valslider( FL_VERT_FILL_SLIDER, 255, 130, 30, 200, "" ); fl_set_object_color( obj, FL_COL1, FL_GREEN ); fl_set_slider_bounds( obj, 0, 255 ); fl_set_slider_precision( obj, 0 ); fl_set_object_callback( obj, search_rgb, 1 ); fl_set_slider_return( obj, 0 ); fl_set_object_resize( obj, FL_RESIZE_Y ); fl_set_object_gravity( obj, FL_NorthEast, FL_SouthEast ); fl_set_object_return( obj, FL_RETURN_CHANGED ); bs = obj = fl_add_valslider( FL_VERT_FILL_SLIDER, 285, 130, 30, 200, "" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_slider_bounds( obj, 0, 255 ); fl_set_slider_precision( obj, 0 ); fl_set_object_callback( obj, search_rgb, 2 ); fl_set_slider_return( obj, 0 ); fl_set_object_resize( obj, FL_RESIZE_Y ); fl_set_object_gravity( obj, FL_NorthEast, FL_SouthEast ); fl_set_object_return( obj, FL_RETURN_CHANGED ); colbr = obj = fl_add_browser( FL_HOLD_BROWSER, 10, 90, 205, 240, "" ); fl_set_browser_fontstyle( obj, FL_FIXED_STYLE ); fl_set_object_callback( obj, br_cb, 0 ); fl_set_object_gravity( obj, FL_NorthWest, FL_SouthEast ); obj = fl_add_button( FL_NORMAL_BUTTON, 135, 345, 80, 30, "Done" ); fl_set_object_callback( obj, done_cb, 0 ); fl_set_object_gravity( obj, FL_South, FL_South ); fl_set_object_resize( obj, FL_RESIZE_NONE ); fl_end_form( ); fl_scale_form( cl, 1.1, 1.0 ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/crossbut.c0000664000175000017500000000725512353623325013113 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Routines implementing the "crossbutton" class * * ob->col1 is the color of the box. ob->col2 is the color of cross * * This file is part of xforms package * T.C. Zhao and M. Overmars */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "crossbut.h" /*************************************** * How to draw it ***************************************/ static void draw_crossbutton( FL_OBJECT * ob ) { FL_Coord xx, yy, ww, hh; FL_BUTTON_STRUCT *sp = ob->spec; /* if redraw is demanded by FL_ENTER, ignore it */ if ( sp->event == FL_ENTER ) return; /* Draw the bounding box first */ fl_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); /* Draw the box that contains the cross */ ww = hh = 0.5 * FL_min( ob->w, ob->h ) - 1; xx = ob->x + FL_BOUND_WIDTH; yy = ob->y + ( ob->h - hh ) / 2; /* If pushed, draw a down box with the cross */ if ( sp->val ) { fl_draw_box( FL_DOWN_BOX, xx, yy, ww, hh, ob->col1, ob->bw ); fl_draw_text( FL_ALIGN_CENTER, xx - 2, yy - 2, ww + 4, hh + 4, ob->col2, 0, 0, "@9plus"); } else fl_draw_box( FL_UP_BOX, xx, yy, ww, hh, ob->col1, ob->bw ); /* label */ if ( fl_is_center_lalign( ob->align ) ) fl_draw_text( FL_ALIGN_LEFT, xx + ww + 3, ob->y, 0, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); else fl_draw_object_label_outside( ob ); if ( ob->type == FL_RETURN_BUTTON ) fl_draw_text( FL_ALIGN_CENTER, ob->x + ob->w - 0.8 * ob->h, ob->y + 0.2 * ob->h, 0.6 * ob->h, 0.6 * ob->h, ob->lcol, 0, 0, "@returnarrow" ); } /*************************************** * creation ***************************************/ FL_OBJECT * fl_create_crossbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob; fl_add_button_class( FL_CROSSBUTTON, draw_crossbutton, 0 ); ob = fl_create_generic_button( FL_CROSSBUTTON, type, x, y,w, h, label ); ob->boxtype = FL_NO_BOX; ob->col2 = FL_BLACK; /* cross color */ return ob; } /*************************************** ***************************************/ FL_OBJECT * fl_add_crossbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob = fl_create_crossbutton( type, x, y, w, h, label ); fl_add_object( fl_current_form, ob ); return ob; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/flclock.c0000644000175000017500000000467712251644033012663 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Built-in xforms clock * T.C. Zhao and M. Overmars */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include FL_FORM *fclock; /*************************************** ***************************************/ void exit_cb( FL_OBJECT * ob FL_UNUSED_ARG, long q FL_UNUSED_ARG ) { fl_finish( ); exit( 0 ); } /*************************************** ***************************************/ void create_form_clock( void ) { FL_OBJECT *obj; fclock = fl_bgn_form( FL_NO_BOX, 500, 350 ); fl_add_box( FL_UP_BOX, 0, 0, 500, 350, "" ); obj = fl_add_clock( FL_DIGITAL_CLOCK, 185, 20, 150, 35, "" ); fl_set_object_boxtype( obj, FL_ROUNDED_BOX ); fl_set_object_color( obj, FL_COL1,FL_BLACK ); fl_set_object_lsize( obj, FL_MEDIUM_SIZE ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); obj = fl_add_clock( FL_ANALOG_CLOCK, 30, 70, 220, 200, "" ); fl_set_object_boxtype( obj, FL_UP_BOX ); obj = fl_add_clock( FL_ANALOG_CLOCK, 260, 70, 220, 200, "" ); fl_set_object_boxtype( obj, FL_OVAL3D_UPBOX ); obj = fl_add_button( FL_NORMAL_BUTTON, 375, 300, 110, 35, "Exit" ); fl_set_object_callback( obj, exit_cb, 0 ); fl_end_form( ); fl_scale_form( fclock, 0.7, 0.7 ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_initialize( &argc, argv, "FormDemo", 0, 0 ); create_form_clock( ); fl_show_form( fclock, FL_PLACE_CENTER, FL_TRANSIENT,"clocks" ); fl_do_forms( ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/ibrowser.c0000664000175000017500000004163212353623325013100 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * image support test. See also iconvert program * * T.C. Zhao (1999.03.01) * * The GUI (fdui) is placed in image->app_data; */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" #include "image/flimage.h" #include "fd/ibrowser_gui.h" /* from fd/ directory */ static FL_IMAGE *curr_image; /*************************************** ***************************************/ static void show_image_info( FL_IMAGE * im ) { FD_ibcanvas *fdui; char buf[ 128 ], wl[ 128 ]; if ( ! im ) return; if ( im->type == FL_IMAGE_GRAY16 ) sprintf( wl, "(l=%d w=%d)", im->level, im->wwidth ); else wl[ 0 ] = '\0'; sprintf( buf, "%s(%s): (%dX%d) t=%s ot=%s dt=%s cols=%d used=%d %s", im->infile,im->fmt_name, im->w,im->h, flimage_type_name( im->type ) + 9, flimage_type_name( im->original_type ) + 9, flimage_type_name( im->display_type ) + 9, im->map_len, im->colors, wl ); fdui = im->app_data; fl_set_object_label( fdui->text, buf ); if ( im->comments ) { fl_activate_object( fdui->comments ); fl_set_object_lcolor( fdui->comments, FL_BLACK ); } else { fl_deactivate_object( fdui->comments ); fl_set_object_lcolor( fdui->comments, FL_INACTIVE_COL ); } } /*************************************** ***************************************/ void show_comments( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { if ( curr_image && curr_image->comments ) fprintf( stderr,"%s\n", curr_image->comments ); } /*************************************** ***************************************/ static int load_and_show( const char * filename, void * data ) { FD_ibcanvas *fdui = data; FL_IMAGE *image; int r, g, b; image = flimage_load( filename ); if ( image ) { show_image_info( image ); fl_get_icm_color( fdui->canvas->col1, &r, &g, &b ); image->app_background = FL_PACK3( r, g, b ); #if 0 image->sh = image->h / 2; image->sw = image->w / 2; #endif flimage_display( image, FL_ObjWin( fdui->canvas ) ); show_image_info( image ); flimage_free( curr_image ); curr_image = image; #if 0 fl_update_display( 1 ); sleep( 5 ); image->wx = image->wy = 90; image->sx = image->sy = 80; image->sh = image->h - 90; image->sw = image->w - 90; flimage_display( image, FL_ObjWin( fdui->canvas ) ); #endif /* Re-adjust the window level stuff */ if ( image->type == FL_IMAGE_GRAY16) { fl_set_slider_bounds( fdui->level, 0, image->gray_maxval ); fl_set_slider_bounds( fdui->width, 0, image->gray_maxval ); } } else fprintf( stderr, "can't load %s\n", filename ); return 0; } /*************************************** ***************************************/ void scale_image( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_ibcanvas *fdui = ob->form->fdui; float xs = fl_get_slider_value( fdui->xfloat ); float ys = fl_get_slider_value( fdui->yfloat ); int aa = fl_get_button( fdui->anti_aliasing ); if ( ! curr_image ) return; flimage_scale( curr_image, xs * curr_image->w, ys * curr_image->h, aa ? FLIMAGE_SUBPIXEL : FLIMAGE_NOSUBPIXEL ); flimage_display( curr_image, FL_ObjWin( fdui->canvas ) ); show_image_info( curr_image ); } /*************************************** ***************************************/ void annotate_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_ibcanvas *fdui = ob->form->fdui; char buf[ 128 ]; static int cnt; static int tx = -1, ty; static int r, g, b; int mw = 35, mh = 35, delta = 450, i, j; FLIMAGE_TEXT text; if ( ! curr_image ) return; if ( tx < 0 ) { tx = curr_image->w / 2; ty = curr_image->h / 2; } sprintf( buf, "Text at[%d %d]\nWith Centered display", tx, ty ); if ( ++cnt % 3 == 0 ) { r = 255; g = 0; b = 0; } else if ( cnt % 3 == 1 ) { r = 0; g = 255; b = 0; } else if ( cnt % 3 == 2 ) { r = 0; g = 0; b = 255; } /* positioning check */ flimage_add_text( curr_image, "@arrow", 6, 0, 20, FL_PACK(r,g,b), 0, 1, 30, 30, 0 ); flimage_add_text( curr_image, "X", 1, 0, 20, FL_PACK(r,g,b), 0, 1, 30, 30, 0 ); flimage_add_marker( curr_image, "oval", 30,30, mw - 15, mh - 15, FL_SOLID, 0, 0, FL_PACK( r, g, b ), 0 ); flimage_add_text( curr_image, buf, strlen( buf ), FL_TIMESBOLD_STYLE, 20, FL_PACK( r, g, b ), FL_PACK( 255, 0, 255 ), 0, tx, ty, 0 ); memset( &text, 0, sizeof text ); text.align = FL_ALIGN_LEFT; text.str = ( char * ) "qXXd\nqXXd"; text.len = strlen( text.str ); text.style = FL_TIMESBOLD_STYLE; text.size = 12; text.x = curr_image->w; text.y = curr_image->h; text.color = FL_PACK( r, g, b ); text.bcolor = FL_PACK( r, 0, b ); text.nobk = 1; flimage_add_text_struct( curr_image, &text ); tx += 5; ty += 5; for ( j = 0; j < 8; j++ ) { const char *ss[ ] = { "oval", "delta", "rect", "cross", "arrow", "thinarrow", "line", "star" }; for ( i = 0; i < 9; i++ ) { flimage_add_marker( curr_image, ss[ j ], curr_image->w - i * mw, curr_image->h- j * mh, mw - 15, mh - 15, FL_SOLID, i % 2, i * delta, FL_PACK( r, g, b ), 0 ); } } flimage_display( curr_image, FL_ObjWin( fdui->canvas ) ); } /*************************************** ***************************************/ void render_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_ibcanvas *fdui = ob->form->fdui; if ( curr_image ) { flimage_render_annotation( curr_image, FL_ObjWin( fdui->canvas ) ); show_image_info( curr_image ); } } /*************************************** ***************************************/ void flip_image( FL_OBJECT * ob, long data ) { FD_ibcanvas *fdui = ob->form->fdui; if ( ! curr_image ) return; flimage_flip( curr_image, data ); flimage_display( curr_image, FL_ObjWin( fdui->canvas ) ); } /*************************************** ***************************************/ void rotate_image( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_ibcanvas *fdui = ob->form->fdui; int angle = fl_get_counter_value( fdui->angle ); int subpix = fl_get_button( fdui->anti_aliasing ); unsigned int fill = 0; if ( ! curr_image ) return; curr_image->fill_color = fill; flimage_rotate( curr_image, angle * 10, subpix ? FLIMAGE_SUBPIXEL : 0 ); flimage_display( curr_image, FL_ObjWin( fdui->canvas ) ); show_image_info( curr_image ); } /*************************************** ***************************************/ void write_image( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_ibcanvas *fdui = ob->form->fdui; const char *f; if ( ! curr_image ) return; fl_use_fselector( 1 ); fl_set_fselector_placement( FL_PLACE_MOUSE ); if ( ! ( f = fl_show_fselector( "Save Image", NULL, "*", NULL ) ) ) return; flimage_dump( curr_image, f, fl_get_choice_text( fdui->format ) ); } /*************************************** ***************************************/ static int expose_handle( FL_OBJECT * ob FL_UNUSED_ARG, Window win, int w FL_UNUSED_ARG, int h FL_UNUSED_ARG, XEvent * xev FL_UNUSED_ARG, void * data FL_UNUSED_ARG ) { if ( curr_image ) flimage_display( curr_image, win ); return 0; } /*************************************** ***************************************/ static int motion_handle( FL_OBJECT * ob FL_UNUSED_ARG, Window win FL_UNUSED_ARG, int w FL_UNUSED_ARG, int h FL_UNUSED_ARG, XEvent * xev FL_UNUSED_ARG, void * data FL_UNUSED_ARG) { if ( ! curr_image ) return 0; if ( 1 ) { /* fprintf( stderr, "X=%d Y=%d\n", xev->xmotion.x, xev->xmotion.y ); */ } return 0; } /*************************************** ***************************************/ void convolve_it( FL_OBJECT * ob, long data ) { FD_ibcanvas *fdui = ob->form->fdui; int subimage = fl_get_button( fdui->subimage ); if ( ! curr_image ) return; if ( subimage ) { curr_image->subw = curr_image->w / 2; curr_image->subh = curr_image->h / 2; curr_image->subx = curr_image->w / 4; curr_image->suby = curr_image->h / 4; } else curr_image->subw = 0; flimage_convolve( curr_image, ( int ** )data, 0, 0 ); flimage_display( curr_image, FL_ObjWin( fdui->canvas ) ); show_image_info( curr_image ); } /*************************************** ***************************************/ void tint_it( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_ibcanvas *fdui = ob->form->fdui; int subimage = fl_get_button( fdui->subimage ); if ( ! curr_image ) return; if ( subimage ) { curr_image->subw = curr_image->w / 2; curr_image->subh = curr_image->h / 2; curr_image->subx = curr_image->w / 4; curr_image->suby = curr_image->h / 4; } else curr_image->subw = 0; flimage_tint( curr_image, FL_PACK( 0, 0, 200 ), 0.3 ); flimage_display( curr_image, FL_ObjWin( fdui->canvas ) ); show_image_info( curr_image ); } /*************************************** ***************************************/ void window_level( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_ibcanvas *fdui = ob->form->fdui; if ( ! curr_image || curr_image->type != FL_IMAGE_GRAY16 ) return; flimage_windowlevel( curr_image, fl_get_slider_value( fdui->level ), fl_get_slider_value( fdui->width ) ); flimage_display( curr_image, FL_ObjWin( fdui->canvas ) ); show_image_info( curr_image ); } /*************************************** ***************************************/ void warp_it( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { static float m[ 2 ][ 2 ] = { { 0.5, 0.5 }, { -1, 0.7 } }; FD_ibcanvas *fdui = ob->form->fdui; int aa = fl_get_button( fdui->anti_aliasing ); if ( ! curr_image ) return ; curr_image->fill_color = FL_PACK(255,255,0); #if 0 flimage_warp( curr_image, border, curr_image->w + 2, curr_image->h + 2, ( aa ? FLIMAGE_SUBPIXEL : FLIMAGE_NOSUBPIXEL ) | FLIMAGE_CENTER ); #else flimage_warp( curr_image, m, 0,0, aa ? FLIMAGE_SUBPIXEL : FLIMAGE_NOSUBPIXEL ); #endif flimage_display( curr_image, FL_ObjWin( fdui->canvas ) ); show_image_info( curr_image ); } /*************************************** ***************************************/ void enhance_it( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_ibcanvas *fdui = ob->form->fdui; if ( curr_image ) { flimage_enhance( curr_image, 0 ); flimage_display( curr_image, FL_ObjWin( fdui->canvas ) ); show_image_info( curr_image ); } } /*************************************** ***************************************/ void crop_it( FL_OBJECT * ob, long data ) { FD_ibcanvas *fdui = ob->form->fdui; if ( ! curr_image ) return; if ( data == 0 ) flimage_autocrop( curr_image, FLIMAGE_AUTOCOLOR ); else { curr_image->fill_color = FL_PACK( 255, 255, 0 ); flimage_crop( curr_image, -1, -1, -1, -1 ); } flimage_display( curr_image, FL_ObjWin( fdui->canvas ) ); show_image_info( curr_image ); } /*************************************** ***************************************/ void convert_type( FL_OBJECT * ob, long type ) { FD_ibcanvas *fdui = ob->form->fdui; if ( curr_image ) { flimage_convert( curr_image, type, 0 ); flimage_display( curr_image, FL_ObjWin( fdui->canvas ) ); show_image_info( curr_image ); } } /*************************************** ***************************************/ void browse_file( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_use_fselector( 0 ); fl_set_fselector_placement( FL_PLACE_MOUSE ); fl_set_fselector_callback( load_and_show, ob->form->fdui ); fl_show_fselector( "Load an Image", 0, "*", 0 ); } /*************************************** ***************************************/ void quit_callback( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { flimage_free( curr_image ); fl_finish( ); exit( 0 ); } /*************************************** ***************************************/ static int supported_image_filter( const char * name, int type ) { return type == FT_DIR || ( type == FT_FILE && flimage_is_supported( name ) > 0 ); } /*************************************** ***************************************/ static void error_report( FL_IMAGE * im, const char * s ) { FD_ibcanvas *fdui = im->app_data; if ( ! s ) s = " "; fl_set_object_label( fdui->error, s ); } /*************************************** ***************************************/ static int status_report( FL_IMAGE * im, const char * s ) { FD_ibcanvas *fdui = im->app_data; char buf[ 512 ]; if ( im->completed < 0 ) strcpy( buf, s ); else if ( im->completed >= 0 && im->completed < im->total ) { sprintf( buf,"%s %3.0f%% (%4d of %4d)", s, ( im->completed * 100.0 ) / im->total, im->completed, im->h ); } else strcpy( buf, s ); fl_set_object_label( fdui->status, buf ); fl_update_display( 0 ); return 0; } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FD_ibcanvas *fd_ibcanvas; int n; static FLIMAGE_SETUP setup; fl_set_border_width( -2 ); fl_initialize( &argc, argv, 0, 0, 0 ); fd_ibcanvas = create_form_ibcanvas( ); fl_set_object_color( fd_ibcanvas->canvas, FL_COL1, FL_COL1 ); setup.visual_cue = status_report; setup.error_message = error_report; setup.app_data = fd_ibcanvas; setup.delay = 70; flimage_setup( &setup ); flimage_enable_png( ); flimage_enable_xwd( ); flimage_enable_bmp( ); flimage_enable_xbm( ); flimage_enable_gif( ); flimage_enable_sgi( ); flimage_enable_fits( ); flimage_enable_xpm( ); flimage_enable_tiff( ); flimage_enable_ps( ); #ifndef NO_JPEG flimage_enable_jpeg( ); #endif for ( n = flimage_get_number_of_formats(); n; n-- ) fl_addto_choice( fd_ibcanvas->format, ( flimage_get_format_info( n ) )->short_name ); fl_set_dirlist_filter( supported_image_filter ); fl_add_canvas_handler( fd_ibcanvas->canvas, Expose, expose_handle, 0 ); fl_add_canvas_handler( fd_ibcanvas->canvas, MotionNotify, motion_handle, 0 ); /* Show the first form */ fl_show_form( fd_ibcanvas->ibcanvas, FL_PLACE_CENTERFREE, FL_FULLBORDER, "ibcanvas" ); while ( fl_do_forms( ) ) /* empty */ ; return 0; } #include "fd/ibrowser_gui.c" /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/browserall.c0000644000175000017500000002016312251644242013410 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * This is a demo that shows the different types of browsers. * * This file is part of xforms package * M. Overmars and T.C. Zhao (1997) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "include/forms.h" FL_FORM * form; FL_OBJECT * br[ 4 ], * exitobj, * readout; static void create_form( void ); static void fill_browsers( void ); /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_initialize( &argc, argv, "FormDemo", 0, 0 ); create_form( ); fill_browsers( ); fl_show_form( form,FL_PLACE_CENTER | FL_FREE_SIZE, FL_TRANSIENT, "All Browsers" ); fl_do_forms( ); fl_finish( ); return 0; } static const char *bnames[ ] = { "NORMAL_BROWSER", "SELECT_BROWSER", "HOLD_BROWSER", "MULTI_BROWSER" }; /*************************************** ***************************************/ static void deselect( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { int i; for ( i = 2; i < 4; i++ ) fl_deselect_browser( br[ i ] ); } /*************************************** ***************************************/ static void set_size( FL_OBJECT * obj FL_UNUSED_ARG, long arg ) { int i; for ( i = 0; i < 4; i++ ) fl_set_browser_fontsize( br[ i ], arg ); } /*************************************** ***************************************/ static void set_style( FL_OBJECT * obj FL_UNUSED_ARG, long arg ) { int i; for ( i = 0; i < 4; i++ ) fl_set_browser_fontstyle( br[ i ], arg ); } /*************************************** ***************************************/ static void br_callback( FL_OBJECT * ob, long arg ) { char buf[ 1024 ]; const char * mb[ ] = { "left", "middle", "right", "scroll-up", "scroll-down" }; int i; if ( ( i = fl_mouse_button( ) ) >= FL_LEFT_MOUSE && i <= FL_SCROLLDOWN_MOUSE ) sprintf( buf, "In %s [%s]: ", bnames[ arg ], mb[ i - FL_LEFT_MOUSE ] ); else sprintf( buf, "In %s: ", bnames[ arg ] ); if ( ( i = fl_get_browser( ob ) ) ) { strcat( buf, fl_get_browser_line( ob, i > 0 ? i : -i ) ); strcat( buf, i > 0 ? " was selected" : " was deselected." ); } fl_set_object_label( readout, buf ); } /*************************************** ***************************************/ static void vcallback( FL_OBJECT * ob FL_UNUSED_ARG, int topline FL_UNUSED_ARG, void * data FL_UNUSED_ARG ) { int i; int yoffset = fl_get_browser_yoffset( br[ 0 ] ); for ( i = 1; i < 4; i++ ) fl_set_browser_yoffset( br[ i ], yoffset ); } /*************************************** ***************************************/ static void link_browsers( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { int sync = fl_get_button( ob ); int i; fl_set_object_label( ob, sync ? "Unlink": "Link" ); if ( sync ) { int yoffset = fl_get_browser_yoffset( br[ 0 ] ); for ( i = 1; i < 4; i++ ) { fl_set_browser_vscrollbar( br[ i ], FL_OFF ); fl_set_browser_yoffset( br[ i ], yoffset ); } fl_set_browser_vscroll_callback( br[ 0 ], vcallback, 0 ); } else { for ( i = 1; i < 4; i++ ) fl_set_browser_vscrollbar( br[ i ], FL_ON ); fl_set_browser_vscroll_callback( br[ 0 ], NULL, 0 ); } } /*************************************** ***************************************/ static void create_form( void ) { FL_OBJECT * obj; form = fl_bgn_form( FL_FLAT_BOX, 700, 570 ); readout = fl_add_text( FL_NORMAL_TEXT, 50, 30, 600, 50, "" ); fl_set_object_lsize( readout, FL_NORMAL_SIZE ); fl_set_object_lalign( readout, FL_ALIGN_CENTER ); fl_set_object_lstyle( readout, FL_BOLD_STYLE ); fl_set_object_boxtype( readout, FL_UP_BOX ); fl_set_object_color( readout, FL_MAGENTA, FL_MAGENTA ); br[ 0 ] = obj = fl_add_browser( FL_NORMAL_BROWSER, 20, 120, 150, 290, bnames[ 0 ] ); fl_set_object_callback( obj, br_callback, 0 ); br[ 1 ] = obj = fl_add_browser( FL_SELECT_BROWSER, 190, 120, 150, 290, bnames[ 1 ] ); fl_set_object_callback( obj, br_callback, 1 ); br[ 2 ] = obj = fl_add_browser( FL_HOLD_BROWSER, 360, 120, 150, 290, bnames[ 2 ] ); fl_set_object_color( obj, FL_WHITE, FL_GREEN ); fl_set_object_callback( obj, br_callback, 2 ); br[ 3 ] = obj = fl_add_browser( FL_MULTI_BROWSER, 530, 120, 150, 290, bnames[ 3 ] ); fl_set_object_color( obj,FL_WHITE, FL_CYAN ); fl_set_object_callback( obj, br_callback, 3 ); exitobj = fl_add_button( FL_NORMAL_BUTTON, 560, 510, 120, 30, "Exit" ); obj = fl_add_button( FL_NORMAL_BUTTON, 560, 460, 120, 30, "Deselect" ); fl_set_object_callback( obj, deselect, 0 ); fl_bgn_group( ); obj = fl_add_lightbutton( FL_RADIO_BUTTON, 20, 500, 100, 30, "Tiny" ); fl_set_object_callback( obj, set_size, FL_TINY_SIZE ); obj = fl_add_lightbutton( FL_RADIO_BUTTON, 130, 500, 100, 30, "Small" ); fl_set_object_callback( obj, set_size, FL_SMALL_SIZE ); fl_set_button( obj, 1 ); obj = fl_add_lightbutton( FL_RADIO_BUTTON, 240, 500, 100, 30, "Normal" ); fl_set_object_callback( obj, set_size, FL_NORMAL_SIZE ); obj = fl_add_lightbutton( FL_RADIO_BUTTON, 350, 500, 100, 30, "Large" ); fl_set_object_callback( obj, set_size, FL_LARGE_SIZE ); obj = fl_add_button( FL_BUTTON, 470, 510, 45,30, "Link" ); fl_set_object_callback( obj, link_browsers, 0 ); fl_end_group( ); fl_bgn_group( ); obj = fl_add_lightbutton( FL_RADIO_BUTTON, 20, 450, 100, 30, "Normal" ); fl_set_object_callback( obj, set_style, FL_NORMAL_STYLE ); fl_set_button( obj, 1 ); obj = fl_add_lightbutton( FL_RADIO_BUTTON, 120, 450, 100, 30, "Bold" ); fl_set_object_callback( obj, set_style, FL_BOLD_STYLE ); obj = fl_add_lightbutton( FL_RADIO_BUTTON, 220, 450, 100, 30, "Italic" ); fl_set_object_callback( obj, set_style, FL_ITALIC_STYLE ); obj = fl_add_lightbutton( FL_RADIO_BUTTON, 320, 450, 100, 30, "BoldItalic" ); fl_set_object_callback( obj, set_style, FL_BOLDITALIC_STYLE ); obj = fl_add_lightbutton( FL_RADIO_BUTTON, 420, 450, 100, 30, "Fixed" ); fl_set_object_callback( obj, set_style, FL_FIXED_STYLE ); fl_end_group( ); fl_end_form( ); } /*************************************** ***************************************/ static void fill_browsers( void ) { int i, j; char buf[ 128 ]; for ( i = 0; i < 4; i++ ) for ( j = 1; j <= 100; j++ ) { if ( j == 5 || j == 6 ) sprintf( buf, "@NLine with qb %3d", j ); else if ( j == 10 ) strcpy( buf, "@-trailing text should be ignored" ); else if ( j == 40 ) sprintf( buf, "@mLine with qb %3d", j ); else sprintf( buf, "Line with qb %3d",j ); fl_add_browser_line( br[ i ], buf ); } } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/dirlist.c0000644000175000017500000000570512251644063012714 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * test of fl_get_dirlist() and its kin. * * This file is part of xforms package * T.C. Zhao and M. Overmars (1997) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include #include #include "fd/fbtest_gui.h" /*************************************** ***************************************/ static void fill_browser( FL_OBJECT * ob ) { FD_fbform *fdui = ( FD_fbform * ) ob->form->fdui; int nfiles = 0; const FL_Dirlist *dl = fl_get_dirlist( ".", "*", &nfiles, 0 ); const FL_Dirlist *ds; const FL_Dirlist *dlend = dl + nfiles; char buf[ 2048 ]; fl_freeze_form( ob->form ); sprintf( buf,"Total %d files", nfiles ); fl_set_object_label( fdui->total, buf ); fl_clear_browser( fdui->browser ); for ( ds = dl; dl < dlend; dl++ ) { sprintf( buf, "%-10s\t\t%5ldK\t%s", dl->name, dl->dl_size >> 10, ctime( &dl->dl_mtime ) + 3 ); fl_addto_browser_chars( fdui->browser, buf ); } fl_unfreeze_form( ob->form ); fl_free_dirlist( ( FL_Dirlist * ) ds ); } /* callbacks and freeobj handles for form fbform */ /*************************************** ***************************************/ void sort_method_cb( FL_OBJECT * ob, long data ) { fl_set_dirlist_sort( data ); fill_browser( ob ); } /*************************************** ***************************************/ void done_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_finish( ); exit( 0 ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FD_fbform *fd_fbform; fl_initialize( &argc, argv, 0, 0, 0 ); fd_fbform = create_form_fbform( ); fl_set_browser_fontstyle( fd_fbform->browser, FL_FIXED_STYLE ); /* fill-in form initialization code */ fill_browser( fd_fbform->browser ); /* show the first form */ fl_show_form( fd_fbform->fbform, FL_PLACE_CENTERFREE, FL_FULLBORDER, "fbform" ); fl_do_forms( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/lalign.c0000644000175000017500000001301112251643663012502 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Different label alignments * * This file is part of xforms package * T.C. Zhao and M. Overmars */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include /**** Forms and Objects ****/ #undef TEST_PIXMAP_ALIGN typedef struct { FL_FORM * form0; void * vdata; long ldata; FL_OBJECT * box; FL_OBJECT * inside; FL_OBJECT * center; } FD_form0; static FD_form0 * create_form_form0( void ); FD_form0 *fd_form0; /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { int align; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); fd_form0 = create_form_form0( ); /* Fill-in form initialization code */ fl_set_form_dblbuffer( fd_form0->form0, 1 ); align = fd_form0->box->align | FL_ALIGN_INSIDE; if ( align != fd_form0->box->align ) fl_set_button( fd_form0->inside, 1 ); /* Show the first form */ fl_show_form( fd_form0->form0, FL_PLACE_FREE, FL_FULLBORDER,"form0" ); fl_do_forms( ); return 0; } /*************************************** ***************************************/ static void align_cb( FL_OBJECT * ob FL_UNUSED_ARG, long n ) { if ( fl_get_button( fd_form0->inside ) ) n = fl_to_inside_lalign( n ); if ( n == FL_ALIGN_CENTER ) fl_set_button( fd_form0->inside, 1 ); #ifndef TEST_PIXMAP_ALIGN fl_set_object_lalign( fd_form0->box, n ); #else fl_set_pixmap_align( fd_form0->box, n, 3, 3 ); #endif } /*************************************** ***************************************/ static void inside_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { int align = fl_get_object_lalign( fd_form0->box ); if ( fl_get_button( ob ) ) fl_set_object_lalign( fd_form0->box, fl_to_inside_lalign( align ) ); else fl_set_object_lalign( fd_form0->box, fl_to_outside_lalign( align ) ); #ifdef TEST_PIXMAP_ALIGN fl_set_pixmap_align( fd_form0->box, fd_form0->box->align, 3, 3 ); #else fl_redraw_form( fd_form0->form0 ); #endif } /*************************************** ***************************************/ static FD_form0 * create_form_form0( void ) { FL_OBJECT *obj; FD_form0 *fdui = fl_calloc( 1, sizeof *fdui ); fdui->form0 = fl_bgn_form( FL_NO_BOX, 351, 180 ); fl_add_box( FL_UP_BOX, 0, 0, 351, 180, "" ); #ifndef TEST_PIXMAP_ALIGN fdui->box = obj = fl_add_box( FL_UP_BOX, 190, 40, 90, 55, "This is\na label" ); #else fdui->box = obj = fl_add_pixmap( FL_NORMAL_PIXMAP, 190, 35, 90, 60, "" ); fl_set_pixmap_file( obj, "crab.xpm" ); fl_set_object_boxtype( obj,FL_UP_BOX ); #endif fdui->inside = obj = fl_add_lightbutton( FL_PUSH_BUTTON, 20, 125, 90, 30, "Inside" ); fl_set_button( obj, 1 ); fl_set_object_callback( obj, inside_cb, 0 ); fl_bgn_group(); obj = fl_add_button( FL_RADIO_BUTTON, 20, 20, 30, 30, "@#7->" ); fl_set_object_lcolor( obj, FL_BLUE ); fl_set_object_callback( obj, align_cb, FL_ALIGN_LEFT_TOP ); obj = fl_add_button( FL_RADIO_BUTTON, 50, 20, 30, 30, "@#8->" ); fl_set_object_lcolor( obj, FL_BLUE ); fl_set_object_callback( obj, align_cb, FL_ALIGN_TOP ); obj = fl_add_button( FL_RADIO_BUTTON, 80, 20, 30, 30, "@#9->" ); fl_set_object_lcolor( obj, FL_BLUE ); fl_set_object_callback( obj, align_cb, FL_ALIGN_RIGHT_TOP ); obj = fl_add_button( FL_RADIO_BUTTON, 80, 50, 30, 30, "@#->" ); fl_set_object_lcolor( obj, FL_BLUE ); fl_set_object_callback( obj, align_cb, FL_ALIGN_RIGHT ); fdui->center = obj = fl_add_button( FL_RADIO_BUTTON, 50, 50, 30, 30, "@circle" ); fl_set_object_lcolor( obj, FL_RED ); fl_set_object_callback( obj, align_cb, FL_ALIGN_CENTER ); obj = fl_add_button( FL_RADIO_BUTTON, 20, 50, 30, 30, "@#<-" ); fl_set_object_lcolor( obj, FL_BLUE ); fl_set_object_callback( obj, align_cb, FL_ALIGN_LEFT ); obj = fl_add_button( FL_RADIO_BUTTON, 20, 80, 30, 30, "@#1->" ); fl_set_object_lcolor( obj, FL_BLUE ); fl_set_object_callback( obj, align_cb, FL_ALIGN_LEFT_BOTTOM ); obj = fl_add_button( FL_RADIO_BUTTON, 50, 80, 30, 30, "@#2->" ); fl_set_object_lcolor( obj, FL_BLUE ); fl_set_object_callback( obj, align_cb, FL_ALIGN_BOTTOM ); obj = fl_add_button( FL_RADIO_BUTTON, 80, 80, 30, 30, "@#3->" ); fl_set_object_lcolor( obj, FL_BLUE ); fl_set_object_callback( obj, align_cb, FL_ALIGN_RIGHT_BOTTOM ); fl_end_group( ); fl_add_button( FL_NORMAL_BUTTON, 200, 135, 70, 30, "Done" ); fl_end_form( ); return fdui; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/demo05.c0000664000175000017500000000437412353623325012337 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* This demo shows the use of a slider. Every time the slider changes position it is returned by do_forms() and the text field showing its value is adapted. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" /*************************************** ***************************************/ void slider_cb( FL_OBJECT * ob, long data ) { char str[ 30 ]; sprintf( str, "%f", fl_get_slider_value( ob ) ); fl_set_object_label( ( FL_OBJECT * ) data, str ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM *form; FL_OBJECT *slider, *value; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); form = fl_bgn_form( FL_UP_BOX, 240, 400 ); value = fl_add_box( FL_DOWN_BOX, 120, 180, 100, 30, "" ); fl_set_object_lalign( value, FL_ALIGN_CENTER ); slider = fl_add_slider( FL_VERT_SLIDER, 40, 40, 60, 320, "" ); fl_set_slider_bounds( slider, -1, 1 ); fl_set_slider_value( slider, 0 ); fl_set_object_color( slider, FL_SLIDER_COL1, FL_GREEN ); fl_set_object_callback( slider, slider_cb, ( long ) value ); fl_add_button( FL_RETURN_BUTTON, 120, 290, 100, 30, "Exit" ); fl_end_form( ); fl_show_form( form, FL_PLACE_CENTER, FL_NOBORDER, "Slider" ); fl_do_forms( ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/colsel1.c0000644000175000017500000000515012251644176012603 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /************ * Show the use of setting object colors and call-back routines. ************/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" FL_FORM *form; FL_OBJECT *topbox; /*************************************** ***************************************/ void change_color( FL_OBJECT * obj FL_UNUSED_ARG, long col ) { fl_set_object_color( topbox, col, col ); } /*************************************** ***************************************/ void makeform( void ) { FL_OBJECT *obj; int i, j; char str[ 32 ]; form = fl_bgn_form( FL_UP_BOX, 100, 100 ); for ( i = 0; i < 8; i++ ) for ( j = 0; j < 8; j++ ) { sprintf( str, "%d", 8 * j + i ); obj = fl_add_button( FL_RADIO_BUTTON, 11 + 10 * i, 15 + 10 * j, 8, 6, str ); fl_set_object_color( obj, 8 * j + i, 8 * j + i ); fl_set_object_lalign( obj, FL_ALIGN_BOTTOM ); fl_set_object_callback( obj, change_color, ( long ) ( 8 * j + i ) ); } topbox = fl_add_button( FL_NORMAL_BUTTON, 30, 5, 40, 8, "The Color Map" ); fl_set_object_lsize( topbox, FL_LARGE_SIZE ); fl_set_object_lstyle( topbox, FL_BOLD_STYLE ); fl_end_form( ); fl_adjust_form_size( form ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_OBJECT *ret; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); makeform( ); fl_scale_form( form, 4.0, 4.0 ); fl_show_form( form, FL_PLACE_FREE, FL_TRANSIENT, "colsel" ); do ret = fl_do_forms( ); while ( ret != topbox ); fl_hide_form( form ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/folder.c0000644000175000017500000001226412251644031012506 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Tabbed folder demo and tester * * This file is part of xforms package * T.C. Zhao and M. Overmars * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "fd/folder_gui.h" #include /* callback routines */ /*************************************** ***************************************/ void hide_show_cb( FL_OBJECT * ob, long data) { FD_mainform *fdui = ob->form->fdui; ( data ? fl_show_object : fl_hide_object )( fdui->folder ); } /*************************************** ***************************************/ void reshow_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_hide_form( ob->form ); fl_show_form( ob->form, FL_PLACE_POSITION, FL_FULLBORDER, "TabFolder" ); } /*************************************** ***************************************/ void set_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_mainform *fdui = ob->form->fdui; int n = fl_get_active_folder_number( fdui->folder ); fl_set_folder_bynumber( fdui->folder, n % 5 + 1 ); } /*************************************** ***************************************/ void deactivate_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_mainform *fdui = ob->form->fdui; if ( fl_object_is_active( fdui->folder ) ) { fl_set_object_label( ob, "Activate" ); fl_deactivate_object( fdui->folder ); } else { fl_set_object_label( ob, "Deactivate" ); fl_activate_object( fdui->folder ); } } /*************************************** ***************************************/ void done_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { #if 0 fl_hide_form( ob->form ); fl_free_form( ob->form ); if ( fl_show_question( "Do you want to quit ?", 0 ) ) exit( 0 ); fprintf( stderr, "will quit after 5 seconds\n" ); fl_msleep( 5000 ); #endif fl_finish( ); exit( 0 ); } /*************************************** ***************************************/ static void make_folder( FL_OBJECT * folder ) { FL_OBJECT *x; FD_buttonform *fd_buttonform; FD_staticform *fd_staticform; FD_valuatorform *fd_valuatorform; FD_choiceform *fd_choiceform; FD_inputform *fd_inputform; float y[ ] = { 5.5, 4, 4.5, 3.8, 4, 5 }; const char *label[ ] = { "Mon", "Tue", "Wed", "Thur", "Fri", "Sat" }; size_t i; fd_buttonform = create_form_buttonform( ); fd_staticform = create_form_staticform( ); fd_valuatorform = create_form_valuatorform( ); fd_choiceform = create_form_choiceform( ); fd_inputform = create_form_inputform( ); for ( i = 0; i < sizeof y / sizeof *y; i++) fl_add_chart_value( fd_staticform->chart, y[ i ],label[ i ], i + 1 ); fl_addto_menu( fd_choiceform->pulldown, "MenuEntry1|MenuEntry2|MenuEntry3|MenuEntry4" ); fl_addto_menu( fd_choiceform->pushmenu, "MenEntry1|MenuEntry2|MenuEntry3" ); fl_addto_choice( fd_choiceform->choice, "Choice1|Choice2|Choice3|Choice4|Choice5|Choice6" ); fl_load_browser( fd_choiceform->browser, "01Readme" ); x = fl_addto_tabfolder( folder,"ButtonObj", fd_buttonform->buttonform ); fl_set_object_lcolor( x, FL_GREEN ); // fl_set_object_lstyle( x, FL_EMBOSSED_STYLE | FL_BOLD_STYLE ); x =fl_addto_tabfolder( folder,"StaticObj", fd_staticform->staticform ); fl_set_object_lcolor( x, FL_RED ); fl_addto_tabfolder( folder,"ValuatorObj", fd_valuatorform->valuatorform ); fl_addto_tabfolder( folder,"ChoiceObj", fd_choiceform->choiceform ); fl_addto_tabfolder( folder,"InputObj", fd_inputform->inputform ); fl_set_object_lcolor( folder, FL_WHITE ); fl_set_object_lstyle( folder, FL_EMBOSSED_STYLE | FL_BOLD_STYLE ); } /*************************************** ***************************************/ int main( int argc, char *argv[ ] ) { FD_mainform *fd_mainform; fl_set_border_width( -2 ); fl_initialize( &argc, argv, 0, 0, 0 ); fd_mainform = create_form_mainform( ); fl_set_object_return( fd_mainform->folder, FL_RETURN_NONE ); make_folder( fd_mainform->folder ); fl_show_form( fd_mainform->mainform, FL_PLACE_ASPECT, FL_FULLBORDER, "TabFolder"); fl_do_forms( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/xterm.xpm0000644000175000017500000000261611665175604012771 00000000000000/* XPM */ static char * xterm [] = { /* xterm pixmap * width height ncolors chars_per_pixel */ "32 32 4 1", /* pixels */ " s grey90 c grey90 g4 grey90", ". m black c black g4 black", "X m white c papayawhip g4 grey80", "o m white c gray50 g4 grey50", " ", " .................... ", " .XXXXXXXXXXXXXXXXXXXX.. ", " .XXX..............XXX.X. ", " .XX.oooooooooooooo.XX.XX. ", " .X.oooooooooooooooo.X.XX. ", " .X.oooooooooooooooo.X.XX. ", " .X.oooooooooooooooo.X.XX. ", " .X.oooooooooooooooo.X.XX. ", " .X.oooooooooooooooo.X.XX. ", " .X.oooooooooooooooo.X.XX. ", " .X.oooooooooooooooo.X.XX. ", " .X.oooooooooooooooo.X.X. ", " .X.oooooooooooooooo.X.X. ", " ..XX.oooooooooooooo.XX.. ", " .. .XXX..............XXX.. ", " . .XXXXXXXXXXXXXXXXXXXX. ", " . .................... ", " . .XXXXXX. ", " . .XXXXXX. ", " . .......XXXXXXXX.......... ", " . .XXXXXXXXXXXXXXXXXXXXXXXX. ", " . ......................... ", " . ", " . ........................... ", " ..XXXXXXXXXXXXXXXXXXXXXXXXX. ", " .XX.X.X..X.X..X.X.X.X..XX. ", " .XXXXXXXXXXXXXXXXXXXXXXXX. ", " .X..X..X..............XXX. ", " .XXXXXXXXXXXXXXXXXXXXXXXX. ", " .......................... ", " "}; xforms-1.2.4/demos/crab.xpm0000644000175000017500000000400011665175601012523 00000000000000/* XPM */ static char * crab[] = { /* crab pixmap * width height ncolors chars_per_pixel */ "28 28 6 2 ", ". c None m white s s_SkyBlue ", "x c orange m black s s_orange ", "* c #ff72c2 m black s s_#ff72c2 ", "+ c SteelBlue m white s s_SteelBlue ", "G c black m black s s_black ", "a c LightGrey m white s s_LightGrey ", /* pixels */ ". . . . . . * * * * . . . . . . . . . * * * * . . . . . ", ". . . . + * x x * . . . . . . . . . . + * x x * . . . . ", ". . . + * x x * . . . . . . . . . . . . + * x x * . . . ", ". . + * x * . . . * . . . . . . . . . * . . + * x * . . ", ". . + * x * . . + * . . . . . . . . + * . . + * x * . . ", ". . + * x * . + * * . . . . . . . . + * * . + * x * . . ", ". . + * x * + * * . . . . . . . . . . + * * + * x * . . ", ". . + * x * * * . . . . . . . . . . . . + * * x x * . . ", ". . . + * x * . . + * . . . . . . + * . . + * x * . . . ", ". . . + * x . . + * . + * * . * * . + * . . + x * . . . ", ". . . . + x . . + * . + * * . * * . + * . . + x . . . . ", ". . . . + x . . . + * + * * * * * + * . . . + x . . . . ", ". . . . + * x . . + * * * * * * * * * . . + x * . . . . ", ". . . . . + * x * * * * x x x x x * * * * x * . . . . . ", ". . . . + + + * * x x x x x x x x x x x x * . . . . . . ", ". . + + * x x x x x x x x x x x x x x x x x x * x . . . ", ". + * x x a + * * x x x x x x x x x x x * * a G * x * . ", "+ * x . . . + * * x x x x x x x x x x x * * G . . . x * ", ". . . . . . + * * x x x x x x x x x x x * * . . . . . . ", ". . . . . + * * x x x x x x x x x x x x x * * . . . . . ", ". . . + * x x x * x x x x x x x x x x x * x x x * . . . ", ". . + * x a a + * * x x x x x x x x x * * a a a x * . . ", ". + * x G G G + * * x x x x x x x x x * * a G G G x * . ", ". + * G . . . + * x * x x x x x x x * x * a G . . . * . ", ". . . . . . + * x a * * * x x x * * * a x * G . . . . . ", ". . . . . + * x a G a a * * * * * a a G a x * G . . . . ", ". . . . . + x a G . G G a a a a a G G . G G x a G . . . ", ". . . . . + x a G . . . G G G G G . . . . . x a G . . . " } ; xforms-1.2.4/demos/symbols.c0000644000175000017500000000737712251643334012741 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Show the built-in symbols * * This file is part of xforms package * T.C. Zhao and M. Overmars (1997) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include const char * symbols[ ] = { "@>", "@<-", "@9->", "@DnLine", "@8>", "@circle", "@->|", "@>>", "@square", "@4->|", "@8->|", "@<->", "@UpArrow", "@9+", "@->", "@<", "@DnArrow", "@+", "@-->", "@line", "@3->", "@UpLine", "@>|", "@2-->", "@4>|", "@8>|", "@=", "@menu", "@8=", "@|>", "@2|>", "@-32|>", "@+32|>", "@-2circle", NULL }; #define N ( sizeof symbols / sizeof * symbols - 1 ) /*************************************** ***************************************/ static void done_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { exit( 0 ); } /*************************************** ***************************************/ FL_FORM * make_symbols( void ) { const char **p; char buf[ 32 ]; int x0 = 10, y0 = 10, dx = 35, dy = 35, ty = 17, n = 7; int xsep = 15, ysep = 5; int x, y, i, w, h; FL_OBJECT *obj; FL_FORM *form; form = fl_bgn_form( FL_FLAT_BOX, w = 2 * x0 + n * dx + ( n - 1 ) * xsep, h = 2 * y0 + ( 1 + N / n - ! ( N % n ) ) * ( dy + ty + ysep ) ); obj = fl_add_button( FL_HIDDEN_BUTTON, 0, 0, w, h, "" ); fl_set_object_callback( obj, done_cb, 0 ); for ( x = x0, y = y0, i = 1, p = symbols; *p; p++, i++ ) { int txt_x, txt_y, txt_w, txt_h; obj = fl_add_box( FL_UP_BOX, x, y, dx, dy, *p ); fl_set_object_lcolor( obj, FL_BOTTOM_BCOL ); strcat( strcpy( buf, "@" ) , *p ); obj = fl_add_box( FL_FLAT_BOX, x, y + dy, dx, ty, buf ); fl_get_object_geometry( obj, &txt_x, &txt_y, &txt_w, &txt_h ); w = fl_get_string_width( fl_get_object_lstyle( obj ), fl_get_object_lsize( obj ), *p, strlen( *p ) ) + 2 * fl_get_object_bw( obj ); fl_set_object_geometry( obj, txt_x + ( txt_w - w ) / 2, txt_y, w, txt_h ); if ( i % n == 0 ) { static int j = 1; x = x0; y = y0 + j * ( dy + ty + ysep + 1); j++; } else x += dx + xsep; } fl_end_form( ); return form; } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM *form; fl_initialize( &argc, argv , 0, 0, 0 ); form = make_symbols( ); fl_show_form( form, FL_PLACE_FREE, FL_FULLBORDER, "test" ); while ( fl_do_forms( ) ) /* empty */; return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/crossbut.h0000644000175000017500000000223511665175611013114 00000000000000/* * * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. * */ /* * Class Crossbutton header file */ #ifndef CROSSBUT_H #define CROSSBUT_H #define FL_CROSSBUTTON (FL_USER_CLASS_START + 1) #define FL_CROSSBUTTON_BW 2 extern FL_OBJECT *fl_add_crossbutton(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char *); extern FL_OBJECT *fl_create_crossbutton(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char *); #endif xforms-1.2.4/demos/new_popup.c0000644000175000017500000001470212251643555013260 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include /*************************************** ***************************************/ void done_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_finish( ); exit( 0 ); } /*************************************** ***************************************/ int style_cb( FL_POPUP_RETURN *r ) { int style, size, mod; fl_popup_entry_get_font( r->user_data, &style, &size ); mod = style & ( FL_SHADOW_STYLE | FL_ENGRAVED_STYLE | FL_EMBOSSED_STYLE ); fl_popup_entry_set_font( r->user_data, r->val | mod, size ); return FL_IGNORE; } /*************************************** ***************************************/ int size_cb( FL_POPUP_RETURN *r ) { int style; fl_popup_entry_get_font( r->user_data, &style, NULL ); fl_popup_entry_set_font( r->user_data, style, r->val ); fl_popup_get_title_font( r->user_data, &style, NULL ); fl_popup_set_title_font( r->user_data, style, r->val ); return FL_IGNORE; } /*************************************** ***************************************/ int mod_cb( FL_POPUP_RETURN *r ) { int style, size; fl_popup_entry_get_font( r->user_data, &style, &size ); style &= ~ ( FL_SHADOW_STYLE | FL_ENGRAVED_STYLE | FL_EMBOSSED_STYLE ); fl_popup_entry_set_font( r->user_data, style | r->val, size ); return FL_IGNORE; } /*************************************** ***************************************/ int pol_cb( FL_POPUP_RETURN *r ) { FL_POPUP_ENTRY *e; for ( e = r->popup->entries; e != NULL; e = e->next ) if ( e != r->entry ) fl_popup_entry_clear_state( e, FL_POPUP_CHECKED ); fl_popup_set_policy( r->user_data, r->val ); return FL_IGNORE; } /*************************************** ***************************************/ void do_pup( FL_OBJECT * obj, long q FL_UNUSED_ARG ) { static FL_POPUP *m = NULL, *sm1, *sm2, *sm3, *sm4; if ( m == NULL ) { m = fl_popup_add( FL_ObjWin( obj ), "Popup" ); sm1 = fl_popup_add( FL_ObjWin( obj ), NULL ); sm2 = fl_popup_add( FL_ObjWin( obj ), NULL ); sm3 = fl_popup_add( FL_ObjWin( obj ), NULL ); sm4 = fl_popup_add( FL_ObjWin( obj ), NULL ); fl_popup_add_entries( sm4, "FL_POPUP_NORMAL_SELECT%T%x%u%f", FL_POPUP_NORMAL_SELECT, m, pol_cb ); fl_popup_add_entries( sm4, "FL_POPUP_DRAG_SELECT%t%x%u%f", FL_POPUP_DRAG_SELECT, m, pol_cb ); fl_popup_add_entries( sm3, "None%x%R%u%f", 0, 1, m, mod_cb ); fl_popup_add_entries( sm3, "FL_SHADOW_STYLE%x%r%u%f", FL_SHADOW_STYLE, 1, m, mod_cb ); fl_popup_add_entries( sm3, "FL_ENGRAVED_STYLE%x%r%u%f", FL_ENGRAVED_STYLE, 1, m, mod_cb ); fl_popup_add_entries( sm3, "FL_EMBOSSED_STYLE%x%r%u%f", FL_EMBOSSED_STYLE, 1, m, mod_cb ); fl_popup_add_entries( sm1, "FL_NORMAL_STYLE%Sn%x%R%u%f%s", FL_NORMAL_STYLE, 1, m, style_cb, "n" ); fl_popup_add_entries( sm1, "FL_BOLD_STYLE%Sb%x%r%u%f%s", FL_BOLD_STYLE, 1, m, style_cb, "b" ); fl_popup_add_entries( sm1, "FL_ITALIC_STYLE%Si%x%r%u%f%s", FL_ITALIC_STYLE, 1, m, style_cb, "i" ); fl_popup_add_entries( sm1, "FL_BOLDITALIC_STYLE%SI%x%r%u%f%s", FL_BOLDITALIC_STYLE, 1, m, style_cb, "I" ); fl_popup_add_entries( sm1, "%l|Font modifier%SCtrl-M%m%s", sm3, "^m" ); fl_popup_add_entries( sm2, "FL_TINY_SIZE%x%r%u%f", FL_TINY_SIZE, 1, m, size_cb ); fl_popup_add_entries( sm2, "FL_SMALL_SIZE%x%r%u%f", FL_SMALL_SIZE, 1, m, size_cb ); fl_popup_add_entries( sm2, "FL_NORMAL_SIZE%x%R%u%f", FL_NORMAL_SIZE, 1, m, size_cb ); fl_popup_add_entries( sm2, "FL_MEDIUM_SIZE%x%r%u%f", FL_MEDIUM_SIZE, 1, m, size_cb ); fl_popup_add_entries( sm2, "FL_LARGE_SIZE%x%r%u%f", FL_LARGE_SIZE, 1, m, size_cb ); fl_popup_add_entries( sm2, "FL_HUGE_SIZE%x%r%u%f", FL_HUGE_SIZE, 1, m, size_cb ); fl_popup_add_entries( m, "Font style%m", sm1 ); fl_popup_add_entries( m, "Font size%m", sm2 ); fl_popup_add_entries( m, "Policy%m", sm4 ); fl_popup_set_min_width( m, 100 ); } if ( fl_get_button_numb( obj ) >= FL_SHORTCUT ) fl_popup_set_position( m, obj->form->x + obj->x, obj->form->y + obj->y + obj->h ); fl_popup_do( m ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM *form; FL_OBJECT *obj; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); form = fl_bgn_form( FL_UP_BOX, 260, 210 ); fl_add_box( FL_UP_BOX, 0, 0, 260, 210, "" ); obj = fl_add_button( FL_NORMAL_BUTTON, 150, 150, 90, 35, "Done" ); fl_set_object_callback( obj, done_cb, 0 ); obj = fl_add_button( FL_MENU_BUTTON, 30, 90, 100, 30, "Popup" ); fl_set_button_shortcut( obj, "Pp#p", 1 ); fl_set_object_callback( obj, do_pup, 0 ); fl_end_form( ); /* initialize */ fl_show_form( form, FL_PLACE_MOUSE, FL_TRANSIENT, "New Popup Demo" ); fl_do_forms( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/yesno.c0000644000175000017500000000354112251643217012373 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* A box with two buttons and a string. Simple boxes like this are very usefull for asking questions */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM *form; FL_OBJECT *yes; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); form = fl_bgn_form( FL_UP_BOX, 320, 120 ); fl_add_box( FL_NO_BOX, 0, 10, 320, 40, "Do you want to quit?" ); yes = fl_add_button( FL_NORMAL_BUTTON, 40, 70, 80, 30," Yes" ); fl_add_button( FL_NORMAL_BUTTON, 200, 70, 80, 30, "No" ); fl_end_form( ); fl_show_form( form, FL_PLACE_MOUSE, FL_TRANSIENT, "Question" ); while ( 1 ) { if ( fl_do_forms( ) == yes ) { fprintf( stderr, "\"Yes\" has been pushed\n" ); break; } else fprintf( stderr, "No is pushed\n" ); } fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/grav.c0000664000175000017500000003274312251675524012213 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. * * Author: Jens Thoms Toerring */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" typedef struct { FL_FORM * grav; FL_OBJECT * box; FL_OBJECT * rx; FL_OBJECT * ry; } FD_gravity_form; typedef struct { FL_OBJECT * box; FL_OBJECT * rx; FL_OBJECT * ry; unsigned int grav; } FD_grav_data; typedef struct { FL_FORM * help; int is_shown; } FD_help_form; static FD_grav_data gd[ 9 ]; static unsigned int g[ ] = { FL_NorthWest, FL_North, FL_NorthEast, FL_West, FL_NoGravity, FL_East, FL_SouthWest, FL_South, FL_SouthEast }; static int w = 500, h = 400; static int bw = 200, bh = 200; #define ULC_POS_LEFT_FIXED( obj ) \ ( ( obj )->nwgravity == FL_NorthWest \ || ( obj )->nwgravity == FL_West \ || ( obj )->nwgravity == FL_SouthWest ) #define ULC_POS_RIGHT_FIXED( obj ) \ ( ( obj )->nwgravity == FL_NorthEast \ || ( obj )->nwgravity == FL_East \ || ( obj )->nwgravity == FL_SouthEast ) #define LRC_POS_LEFT_FIXED( obj ) \ ( ( obj )->segravity == FL_NorthWest \ || ( obj )->segravity == FL_West \ || ( obj )->segravity == FL_SouthWest ) #define LRC_POS_RIGHT_FIXED( obj ) \ ( ( obj )->segravity == FL_NorthEast \ || ( obj )->segravity == FL_East \ || ( obj )->segravity == FL_SouthEast ) #define HAS_FIXED_HORI_ULC_POS( obj ) \ ( ULC_POS_LEFT_FIXED( obj ) || ULC_POS_RIGHT_FIXED( obj ) ) #define HAS_FIXED_HORI_LRC_POS( obj ) \ ( LRC_POS_LEFT_FIXED( obj ) || LRC_POS_RIGHT_FIXED( obj ) ) #define HAS_FIXED_WIDTH( obj ) \ ( HAS_FIXED_HORI_ULC_POS( obj ) && HAS_FIXED_HORI_LRC_POS( obj ) ) #define ULC_POS_TOP_FIXED( obj ) \ ( ( obj )->nwgravity == FL_NorthWest \ || ( obj )->nwgravity == FL_North \ || ( obj )->nwgravity == FL_NorthEast ) #define ULC_POS_BOTTOM_FIXED( obj ) \ ( ( obj )->nwgravity == FL_SouthWest \ || ( obj )->nwgravity == FL_South \ || ( obj )->nwgravity == FL_SouthEast ) #define LRC_POS_TOP_FIXED( obj ) \ ( ( obj )->segravity == FL_NorthWest \ || ( obj )->segravity == FL_North \ || ( obj )->segravity == FL_NorthEast ) #define LRC_POS_BOTTOM_FIXED( obj ) \ ( ( obj )->segravity == FL_SouthWest \ || ( obj )->segravity == FL_South \ || ( obj )->segravity == FL_SouthEast ) #define HAS_FIXED_VERT_ULC_POS( obj ) \ ( ULC_POS_TOP_FIXED( obj ) || ULC_POS_BOTTOM_FIXED( obj ) ) #define HAS_FIXED_VERT_LRC_POS( obj ) \ ( LRC_POS_TOP_FIXED( obj ) || LRC_POS_BOTTOM_FIXED( obj ) ) #define HAS_FIXED_HEIGHT( obj ) \ ( HAS_FIXED_VERT_ULC_POS( obj ) && HAS_FIXED_VERT_LRC_POS( obj ) ) /*************************************** ***************************************/ static void check_resize( FD_grav_data * g ) { fl_set_button( g->rx, g->box->resize & FL_RESIZE_X ); fl_set_button( g->ry, g->box->resize & FL_RESIZE_Y ); if ( HAS_FIXED_WIDTH( g->box ) ) fl_set_object_lcolor( g->rx, FL_INACTIVE_COL ); else fl_set_object_lcolor( g->rx, FL_BLACK ); if ( HAS_FIXED_HEIGHT( g->box ) ) fl_set_object_lcolor( g->ry, FL_INACTIVE_COL ); else fl_set_object_lcolor( g->ry, FL_BLACK ); } /*************************************** ***************************************/ static void nw_callback( FL_OBJECT * obj FL_UNUSED_ARG, long data ) { FD_grav_data * g = ( FD_grav_data * ) data; fl_set_object_gravity( g->box, g->grav, g->box->segravity ); check_resize( g ); } /*************************************** ***************************************/ static void se_callback( FL_OBJECT * obj FL_UNUSED_ARG, long data ) { FD_grav_data * g = ( FD_grav_data * ) data; fl_set_object_gravity( g->box, g->box->nwgravity, g->grav ); check_resize( g ); } /*************************************** ***************************************/ static void rx_callback( FL_OBJECT * obj FL_UNUSED_ARG, long data ) { FD_grav_data * g = ( FD_grav_data * ) data; unsigned int r = g->box->resize; if ( r & FL_RESIZE_X ) r &= ~ FL_RESIZE_X; else r |= FL_RESIZE_X; fl_set_object_resize( g->box, r ); } /*************************************** ***************************************/ static void ry_callback( FL_OBJECT * obj FL_UNUSED_ARG, long data ) { FD_grav_data * g = ( FD_grav_data * ) data; unsigned int r = g->box->resize; if ( r & FL_RESIZE_Y ) r &= ~ FL_RESIZE_Y; else r |= FL_RESIZE_Y; fl_set_object_resize( g->box, r ); } /*************************************** ***************************************/ static void reset_callback( FL_OBJECT * obj FL_UNUSED_ARG, long data ) { FD_grav_data * g = ( FD_grav_data * ) data; fl_set_form_size( g->box->form, w, h ); fl_set_object_geometry( g->box, ( w - bw ) / 2, ( h - bh ) / 2, bw, bh ); } /*************************************** ***************************************/ static void help_callback( FL_OBJECT * obj FL_UNUSED_ARG, long data ) { FD_help_form * h = ( FD_help_form * ) data; if ( ! h->is_shown ) { fl_show_form( h->help, FL_PLACE_CENTER | FL_FREE_SIZE, FL_FULLBORDER, "Gravity Demo Help" ); h->is_shown = 1; } } /*************************************** ***************************************/ static void close_callback( FL_OBJECT * obj FL_UNUSED_ARG, long data ) { FD_help_form * h = ( FD_help_form * ) data; fl_hide_form( h->help ); h->is_shown = 0; } /*************************************** ***************************************/ static FD_gravity_form * create_form_gravity( FD_help_form * help ) { FL_OBJECT * obj; FD_gravity_form * fdui = fl_malloc( sizeof *fdui ); const char * label[ ] = { "NW", "N", "NE", "W", "-", "E", "SW", "S", "SE" }; int i; int s = 25; int m = 5; fdui->grav = fl_bgn_form( FL_FLAT_BOX, 500, 400 ); fl_set_form_background_color( fdui->grav, FL_DARKER_COL1 ); fdui->box = obj = fl_add_box( FL_FRAME_BOX, ( w - bw ) / 2, ( h - bh ) / 2, bw, bh, "" ); fl_set_object_color( obj, FL_GREEN, FL_GREEN ); fl_bgn_group( ); for ( i = 0; i < 9; i++ ) { obj = fl_add_button( FL_RADIO_BUTTON, s * ( i % 3 ) + m, s * ( i / 3 ) + m, s, s, label[ i ] ); fl_set_object_bw( obj, -1 ); fl_set_object_resize( obj, FL_RESIZE_NONE ); fl_set_object_gravity( obj, FL_NorthWest, FL_NorthWest ); fl_set_object_callback( obj, nw_callback, ( long ) ( gd + i ) ); fl_set_object_color( obj, FL_COL1, FL_MCOL ); fl_set_button( obj, fdui->box->nwgravity == g[ i ] ); fl_set_button_mouse_buttons( obj, 1 ); } fl_end_group( ); fl_bgn_group( ); for ( i = 0; i < 9; i++ ) { obj = fl_add_button( FL_RADIO_BUTTON, s * ( i % 3 ) + w - 3 * s - m, s * ( i / 3 ) + h - 3 * s - m, s, s, label[ i ] ); fl_set_object_bw( obj, -1 ); fl_set_object_resize( obj, FL_RESIZE_NONE ); fl_set_object_gravity( obj, FL_SouthEast, FL_SouthEast ); fl_set_object_callback( obj, se_callback, ( long ) ( gd + i ) ); fl_set_object_color( obj, FL_COL1, FL_MCOL ); fl_set_button( obj, fdui->box->segravity == g[ i ] ); fl_set_button_mouse_buttons( obj, 1 ); } fl_end_group( ); fdui->rx = obj = fl_add_button( FL_PUSH_BUTTON, m, h - s - m, 80, s, "X Resize" ); fl_set_object_bw( obj, -1 ); fl_set_object_resize( obj, FL_RESIZE_NONE ); fl_set_object_gravity( obj, FL_SouthWest, FL_SouthWest ); fl_set_object_callback( obj, rx_callback, ( long ) gd ); fl_set_object_color( obj, FL_COL1, FL_MCOL ); fl_set_button( obj, fdui->box->resize & FL_RESIZE_X ); fl_set_button_mouse_buttons( obj, 1 ); fdui->ry = obj = fl_add_button( FL_PUSH_BUTTON, 2 * m + 80, h - s - m, 80, s, "Y Resize" ); fl_set_object_bw( obj, -1 ); fl_set_object_resize( obj, FL_RESIZE_NONE ); fl_set_object_gravity( obj, FL_SouthWest, FL_SouthWest ); fl_set_object_callback( obj, ry_callback, ( long ) gd ); fl_set_object_color( obj, FL_COL1, FL_MCOL ); fl_set_button( obj, fdui->box->resize & FL_RESIZE_Y ); fl_set_button_mouse_buttons( obj, 1 ); obj = fl_add_button( FL_NORMAL_BUTTON, w - 85, 5, 80, s, "Help" ); fl_set_object_bw( obj, -1 ); fl_set_object_gravity( obj, FL_NorthEast, FL_NorthEast ); fl_set_object_callback( obj, help_callback, ( long ) help ); fl_set_button_mouse_buttons( obj, 1 ); obj = fl_add_button( FL_NORMAL_BUTTON, 200, h - s - m, 80, s, "Reset" ); fl_set_object_bw( obj, -1 ); fl_set_object_resize( obj, FL_RESIZE_NONE ); fl_set_object_gravity( obj, FL_South, FL_South ); fl_set_object_callback( obj, reset_callback, ( long ) gd ); fl_set_button_mouse_buttons( obj, 1 ); obj = fl_add_button( FL_NORMAL_BUTTON, m + 280, h - s - m, 80, s, "Quit" ); fl_set_object_bw( obj, -1 ); fl_set_object_resize( obj, FL_RESIZE_NONE ); fl_set_object_gravity( obj, FL_South, FL_South ); fl_set_button_mouse_buttons( obj, 1 ); fl_end_form(); return fdui; } /*************************************** ***************************************/ static FD_help_form * create_form_help( void ) { FL_OBJECT * obj; FD_help_form * fdui = fl_malloc( sizeof *fdui ); const char * text = "Gravity and resize settings demonstration\n" "\n" "The interaction between gravity and resize settings\n" "can sometimes be difficult to understand This pro-\n" "gram allows you to test some of the effects.\n" "\n" "With the sets of buttons in the upper left hand and\n" "lower right hand corner you can set the gravity for\n" "the corresponding corners of the green rectangle.\n" "\n" "With the buttons labeled 'X Resize' and 'Y Resize'\n" "you can set if the rectangle may be scaled in x-\n" "and/or y-direction. Please note that for several\n" "combinations of gravity settings the resizing\n" "settings are not taken into account by XForms. In\n" "these cases the corresponding buttons are grayed\n" "out (but not deactivated)."; fdui->help = fl_bgn_form( FL_FLAT_BOX, 345, 325 ); fdui->is_shown = 0; obj = fl_add_browser( FL_NORMAL_BROWSER, 5, 5, 335, 285, "" ); fl_set_object_bw( obj, -1 ); fl_set_object_color( obj, FL_WHITE, FL_WHITE ); fl_set_object_gravity( obj, FL_NorthWest, FL_SouthEast ); fl_add_browser_line( obj, text ); obj = fl_add_button( FL_NORMAL_BUTTON, 133, 295, 80, 25, "Close" ); fl_set_object_bw( obj, -1 ); fl_set_object_gravity( obj, FL_South, FL_South ); fl_set_object_resize( obj, FL_RESIZE_NONE ); fl_set_object_callback( obj, close_callback, ( long ) fdui ); fl_set_button_mouse_buttons( obj, 1 ); fl_end_form(); return fdui; } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FD_gravity_form * grav; FD_help_form * help; int i; fl_initialize( &argc, argv, "Gravity Demo", 0, 0 ); help = create_form_help( ); grav = create_form_gravity( help ); fl_set_app_mainform( grav->grav ); for ( i = 0; i < 9; i++ ) { gd[ i ].box = grav->box; gd[ i ].grav = g[ i ]; gd[ i ].rx = grav->rx; gd[ i ].ry = grav->ry; } fl_show_form( grav->grav, FL_PLACE_CENTER | FL_FREE_SIZE, FL_FULLBORDER, "Gravity Demo" ); fl_do_forms( ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/iconvert.10000644000175000017500000000257611665175605013025 00000000000000.\" .\" $Id: iconvert.1,v 1.2 2003/09/09 00:28:25 leeming Exp $ .\" .\" Use the following command to generate viewable man page .\" tbl fdesign.1 | {nt}roff -man .\" .\" ul | more -fsk to view .\" .\" .TH ICONVERT 1L "March 1999" "Version 0.11" "Forms Library" .SH NAME iconvert \- Forms Library Image Support demo .\" .\" setup .de Cr .ie n (c) .el \(co .. .SH SYNOPSIS .if n iconvert .if t \{ .B iconvert \} [-options] input output [fmt] .SH DESCRIPTION .I iconvert is a demo program based on .BR "Forms Library" 's image support. The program can be used to convert image formats. The input image file, if is in one of the supported format, is automatically recognized and read, then the output file is written into a format specified by the extension of the output file name or by the parameter fmt if present. .SH OPTIONS .I iconvert accepts the following command line options .TP 6 .B \-help Prints a brief summary of all command line options. .TP .B \-version Prints the current version of .I iconvert and exits. .TP .B \-verbose Specifies verbose mode where each phase of the conversion is printed to stderr. .SH EXIT STATUS The command exits with status 0 if the conversion is successful; 1 if the command line is bad, and 3 if conversion failed. .SH SEE ALSO xforms(5), fdesign(1L) .SH AUTHOR Copyright .Cr 1999 T.C. Zhao (tc_zhao@yahoo.com) .SH HOME PAGE http://bragg.phys.uwm.edu/xforms xforms-1.2.4/demos/demo.c0000644000175000017500000003306312251644104012160 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /** * \file demo.c * * Driver for the demo/test suite * * This file is part of xforms package * M. Overmars and T.C. Zhao * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "include/forms.h" FL_FORM *form; static void create_the_forms( void ); static int load_the_menu( const char * ); static void push_menu( const char * ); /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { char buf[ 1024 ], *p; int version, revision; /* Make sure the distribution is consistent wrt version numbers */ if ( FL_INCLUDE_VERSION != fl_library_version( &version, &revision ) ) { fprintf( stderr, "header/library version mismatch\n" ); fprintf( stderr, " Header: %d.%d.%s\n", FL_VERSION, FL_REVISION, FL_FIXLEVEL ); fprintf( stderr, " Library: %d.%d\n", version, revision ); exit( 1 ); } /* to cut down the "bug" reports of "can't run the demos", put . on path */ #ifndef __VMS if ( ( p = getenv( "PATH" ) )) putenv( strcat( strcat( strcpy( buf, "PATH=" ), p ), ":." ) ); #else printf( " -------->WARNING<-----------" ); printf( " The subdemos will not run unless DCL$PATH has been defined\n" ); printf( " to include the directory where they live\n" ); #endif fl_set_border_width( 1 ); fl_initialize( &argc, argv, "FormDemo", 0, 0 ); fl_clear_command_log( ); create_the_forms( ); if ( ! load_the_menu( "demo.menu" ) ) exit( -1 ); push_menu( "@main" ); fl_show_form( form, FL_PLACE_CENTER, FL_TRANSIENT, "Demo" ); fl_do_forms( ); return 0; } FL_OBJECT *but[ 9 ]; /* Maintaining and building up the menus. */ typedef struct { char name[ 64 ]; int numb; char iname[ 9 ][ 64 ]; char icommand[ 9 ][ 64 ]; } MENU; #define MAXMENU 32 MENU menus[ MAXMENU ]; int mennumb = 0; /*************************************** * Returns the number of a given menu name. ***************************************/ int find_menu( const char * nnn ) { int i; for ( i = 0; i < mennumb; i++ ) if ( strcmp( menus[ i ].name, nnn ) == 0 ) return i; return -1; } /*************************************** * Creates a new menu with name nnn ***************************************/ static void create_menu( char nnn[ ] ) { if ( mennumb == MAXMENU - 1 ) return; strcpy( menus[ mennumb ].name, nnn ); menus[ mennumb ].numb = 0; mennumb++; } /*************************************** * Adds an item to a menu ***************************************/ static void addto_menu( char men[ ], char item[ ], char comm[ ] ) { int n = find_menu( men ); if ( n < 0 ) { create_menu( men ); n = find_menu( men ); } if ( menus[ n ].numb == 9 ) return; strcpy( menus[ n ].iname[ menus[ n ].numb ], item ); strcpy( menus[ n ].icommand[ menus[ n ].numb ], comm ); menus[ n ].numb++; } /* Button to Item conversion and back. */ int b2n[ ][ 9 ] = { { -1, -1, -1, -1, 0, -1, -1, -1, -1 }, { -1, -1, -1, 0, -1, 1, -1, -1, -1 }, { 0, -1, -1, -1, 1, -1, -1, -1, 2 }, { 0, -1, 1, -1, -1, -1, 2, -1, 3 }, { 0, -1, 1, -1, 2, -1, 3, -1, 4 }, { 0, -1, 1, 2, -1, 3, 4, -1, 5 }, { 0, -1, 1, 2, 3, 4, 5, -1, 6 }, { 0, 1, 2, 3, -1, 4, 5, 6, 7 }, { 0, 1, 2, 3, 4, 5, 6, 7, 8 } }; int n2b[ ][ 9 ] = { { 4, -1, -1, -1, -1, -1, -1, -1, -1 }, { 3, 5, -1, -1, -1, -1, -1, -1, -1 }, { 0, 4, 8, -1, -1, -1, -1, -1, -1 }, { 0, 2, 6, 8, -1, -1, -1, -1, -1 }, { 0, 2, 4, 6, 8, -1, -1, -1, -1 }, { 0, 2, 3, 5, 6, 8, -1, -1, -1 }, { 0, 2, 3, 4, 5, 6, 8, -1, -1 }, { 0, 1, 2, 3, 5, 6, 7, 8, -1 }, { 0, 1, 2, 3, 4, 5, 6, 7, 8 } }; /*************************************** * Transforms a button number to an item number when there are * maxnumb items in total. -1 if the button should not exist. ***************************************/ static int but2numb( int bnumb, int maxnumb ) { return b2n[ maxnumb ][ bnumb ]; } /*************************************** * Transforms an item number to a button number when there are * maxnumb items in total. -1 if the item should not exist. ***************************************/ static int numb2but( int inumb, int maxnumb ) { return n2b[ maxnumb ][ inumb ]; } /* Pushing and Popping menus */ char stack[ 64 ][ 32 ]; int stsize = 0; /*************************************** * Pushes a menu to be visible ***************************************/ static void push_menu( const char * nnn ) { int n, i, bn; int men = find_menu( nnn ); /* make exceptions for B&W */ FL_COLOR bc_more = fl_get_visual_depth( ) == 1 ? FL_COL1 : FL_INDIANRED; FL_COLOR bc_term = fl_get_visual_depth( ) == 1 ? FL_COL1 : FL_SLATEBLUE; if ( men < 0 ) return; n = menus[ men ].numb; fl_freeze_form( form ); for ( i = 0; i < 9; i++ ) fl_hide_object( but[ i ] ); for ( i = 0; i < n; i++ ) { bn = numb2but( i, n - 1 ); fl_show_object( but[ bn ] ); fl_set_object_label( but[ bn ], menus[ men ].iname[ i ] ); if ( menus[ men ].icommand[ i ][ 0 ] == '@' ) fl_set_object_color( but[ bn ], bc_more, FL_RED ); else fl_set_object_color( but[ bn], bc_term, FL_BLUE ); } fl_unfreeze_form( form ); strcpy( stack[ stsize ], nnn ); stsize++; } /*************************************** * Pops a menu ***************************************/ static void pop_menu( void ) { if ( stsize <= 1 ) return; stsize -= 2; push_menu( stack[ stsize ] ); } /*************************************** * The callback Routines ***************************************/ #if defined __cplusplus extern "C" #endif /*************************************** * handles a button push ***************************************/ void dobut( FL_OBJECT * obj FL_UNUSED_ARG, long arg ) { int men = find_menu( stack[ stsize - 1 ] ); int n = menus[ men ].numb; int bn = but2numb( ( int ) arg, n - 1 ); if ( menus[ men ].icommand[ bn ][ 0 ] == '@' ) push_menu( menus[ men ].icommand[ bn ] ); else { char cmd[ 1024 ]; char **vv; int c, i; vv = fl_get_cmdline_args( &c ); strcpy( cmd, menus[ men ].icommand[ bn ] ); for ( i = 1; i < c; i++ ) strcat( strcat( cmd, " " ), vv[ i ] ); fl_addto_command_log( "running " ); fl_addto_command_log( cmd ); fl_addto_command_log( "\n" ); fl_deactivate_all_forms( ); fl_exe_command( cmd, 1 ); fl_activate_all_forms( ); } } /*************************************** * Go up a level in the menu tree ***************************************/ void doback( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { pop_menu( ); } /*************************************** * Exit the program ***************************************/ void doexit( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { fl_finish( ); exit( 0 ); } /*************************************** ***************************************/ void showlog( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { fl_show_command_log( FL_TRANSIENT ); } /*************************************** * Loads the menu file. Returns whether successful. ***************************************/ static int load_the_menu( const char * fname ) { FILE *fin; char line[ 256 ], mname[ 64 ], iname[ 64 ], cname[ 64 ]; int i, j; fin = fopen( fname, "r" ); if ( fin == NULL ) { fl_show_message( "ERROR", "", "Cannot read the menu description file." ); return 0; } while ( 1 ) { if ( fgets( line, 256, fin ) == NULL) break; j = 0; i = 0; while ( line[ i ] == ' ' || line[ i ] == '\t' ) i++; if ( line[ i ] == '\n' ) continue; if ( line[ i ] == '#' ) continue; while ( line[ i ] != ':' && line[ i ] != '\n' ) mname[ j++ ] = line[ i++ ]; mname[ j ] = '\0'; if ( line[ i ] == ':' ) i++; j = 0; while ( line[ i ] != ':' && line[ i ] != '\n' ) { if ( line[ i ] == '\\' && line[ i + 1 ] == 'n' ) { iname[ j++ ] = '\n'; i += 2; } else iname[ j++ ] = line[ i++ ]; } iname[ j ] = '\0'; if ( line[ i ] == ':' ) i++; j = 0; while ( line[ i ] != ':' && line[ i ] != '\n' ) cname[ j++ ] = line[ i++ ]; cname[ j ] = '\0'; addto_menu( mname, iname, cname ); } fclose( fin ); return 1; } /*************************************** ***************************************/ void create_form_form( void ) { FL_OBJECT *obj; form = fl_bgn_form( FL_NO_BOX, 370, 450 ); obj = fl_add_box( FL_UP_BOX, 0, 0, 370, 450, "" ); fl_set_object_color( obj, FL_SLATEBLUE, FL_COL1 ); obj = fl_add_box( FL_FRAME_BOX, 20, 20, 330, 40, "Forms Demonstration" ); fl_set_object_color( obj, FL_INDIANRED, FL_COL1 ); fl_set_object_lsize( obj, FL_HUGE_SIZE ); fl_set_object_lstyle( obj, FL_ENGRAVED_STYLE + FL_BOLD_STYLE ); fl_set_object_lcolor( obj, FL_INDIANRED ); obj = fl_add_box( FL_FRAME_BOX, 20, 70, 330, 330, "" ); fl_set_object_color( obj, FL_INDIANRED, FL_COL1 ); obj = fl_add_button( FL_NORMAL_BUTTON, 190, 410, 110, 30, "Exit" ); fl_set_object_callback( obj, doexit, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 80, 410, 110, 30, "Show Log" ); fl_set_object_callback( obj, showlog, 0 ); obj = fl_add_button( FL_HIDDEN_BUTTON, 20, 20, 330, 380, "Button" ); fl_set_object_callback( obj, doback, 0 ); but[ 0 ] = obj = fl_add_button( FL_NORMAL_BUTTON, 40, 90, 90, 90, "Button" ); fl_set_object_color( obj, FL_SLATEBLUE, FL_COL1 ); fl_set_object_callback( obj, dobut, 0 ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); but[ 1 ] = obj = fl_add_button( FL_NORMAL_BUTTON, 140, 90, 90, 90, "Button" ); fl_set_object_color( obj, FL_SLATEBLUE, FL_COL1 ); fl_set_object_callback( obj, dobut, 1 ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); but[ 2 ] = obj = fl_add_button( FL_NORMAL_BUTTON, 240, 90, 90, 90, "Button" ); fl_set_object_color( obj, FL_SLATEBLUE, FL_COL1 ); fl_set_object_callback( obj, dobut, 2 ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); but[ 5 ] = obj = fl_add_button( FL_NORMAL_BUTTON, 240, 190, 90, 90, "Button" ); fl_set_object_color( obj, FL_SLATEBLUE, FL_COL1 ); fl_set_object_callback( obj, dobut, 5 ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); but[ 4 ] = obj = fl_add_button( FL_NORMAL_BUTTON, 140, 190, 90, 90, "Button" ); fl_set_object_color( obj, FL_SLATEBLUE, FL_COL1 ); fl_set_object_callback( obj, dobut, 4 ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); but[ 3 ] = obj = fl_add_button( FL_NORMAL_BUTTON, 40, 190, 90, 90, "Button" ); fl_set_object_color( obj, FL_SLATEBLUE, FL_COL1 ); fl_set_object_callback( obj, dobut, 3 ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); but[ 6 ] = obj = fl_add_button( FL_NORMAL_BUTTON, 40, 290, 90, 90, "Button" ); fl_set_object_color( obj, FL_SLATEBLUE, FL_COL1 ); fl_set_object_callback( obj, dobut, 6 ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); but[ 7 ] = obj = fl_add_button( FL_NORMAL_BUTTON, 140, 290, 90, 90, "Button" ); fl_set_object_color( obj, FL_SLATEBLUE, FL_COL1 ); fl_set_object_callback( obj, dobut, 7 ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); but[ 8 ] = obj = fl_add_button( FL_NORMAL_BUTTON, 240, 290, 90, 90, "Button" ); fl_set_object_color( obj, FL_SLATEBLUE, FL_COL1 ); fl_set_object_callback( obj, dobut, 8 ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); fl_end_form( ); fl_adjust_form_size( form ); } /*************************************** ***************************************/ static void create_the_forms( void ) { create_form_form( ); fl_set_form_dblbuffer( form, 1 ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/demotest2.c0000644000175000017500000000563212251644103013142 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* This demo program uses the routines in the goodies section, that help you create easy forms in an even easier way. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "include/forms.h" /*************************************** ***************************************/ void timeout_remove_alert( int id FL_UNUSED_ARG, void * data FL_UNUSED_ARG ) { fl_hide_alert(); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { int choice; char str1[ 100 ], str2[ 100 ]; const char *s; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); #if 0 fl_set_resource( FLOKLabel, "Go" ); #endif if ( fl_show_question( "Do you want bold font ?", 1 ) ) fl_set_goodies_font( FL_BOLD_STYLE, FL_NORMAL_SIZE ); fl_show_messages( "This is a test program for the goodies of the" "forms library" ); fl_add_timeout( 5000, timeout_remove_alert, 0 ); fl_show_alert( "Alert", "Alert form can be used to inform", "recoverable errors", 0 ); if ( fl_show_question( "Do you want to quit?", 0 ) ) { fl_finish( ); exit( 0 ); } strcpy(str1, ( s = fl_show_input( "Give a string:", "" ) ) ? s: "" ); fl_show_message( "You typed:", "", str1 ); choice = fl_show_choices( "Pick a choice", 2, "One", "Two", "Three", 2 ); switch ( choice ) { case 1 : fl_show_message( "You typed: One", "", "" ); break; case 2 : fl_show_message( "You typed: Two", "", "" ); break; case 3 : fl_show_message( "You typed: Three", "", "" ); break; default : fl_show_message( "An error occured!", "", "" ); break; } strcpy( str2, ( s = fl_show_input( "Give another string:", str1 ) ) ? s : "" ); fl_show_message( "You typed:", "", str2 ); fl_show_messages( "Good Bye" ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/freedraw_leak.c0000664000175000017500000002340712353623325014037 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Demo showing the use of FREE Object with color leakage * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include typedef struct { FL_FORM * drawfree; void * vdata; char * cdata; long ldata; FL_OBJECT * freeobj; FL_OBJECT * colorobj; FL_OBJECT * hsli; FL_OBJECT * wsli; FL_OBJECT * rsli; FL_OBJECT * gsli; FL_OBJECT * bsli; FL_OBJECT * drobj[ 3 ]; } FD_drawfree; extern FD_drawfree *create_form_drawfree( void ); static FD_drawfree *drawui; extern void draw_initialize( FD_drawfree * ); static int max_w = 150, max_h = 150; static Display *dpy; /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { dpy = fl_initialize( &argc, argv, "FormDemo", 0, 0 ); drawui = create_form_drawfree( ); fl_set_color_leak( 1 ); draw_initialize( drawui ); fl_show_form( drawui->drawfree, FL_PLACE_CENTER, FL_TRANSIENT, "FreeObject" ); fl_do_forms( ); fl_free( drawui ); fl_finish( ); return 0; } /* Structure mantainace */ typedef void ( * DrawFunc )( int, int, int, int, int, unsigned long ); /*************************************** ***************************************/ void draw_triangle( int fill, int x, int y, int w, int h, unsigned long col) { XPoint xpoint[ 5 ]; GC gc = fl_state[ fl_vmode ].gc[ 0 ]; Window win = fl_winget( ); xpoint[ 0 ].x = x; xpoint[ 0 ].y = y + h - 1; xpoint[ 1 ].x = x + w/2; xpoint[ 1 ].y = y; xpoint[ 2 ].x = x + w - 1; xpoint[ 2 ].y = y + h - 1; XSetForeground( dpy, gc, fl_get_flcolor( col ) ); if ( fill ) XFillPolygon ( dpy, win, gc, xpoint, 3, Nonconvex, Unsorted ); else { xpoint[ 3 ].x = xpoint[ 0 ].x; xpoint[ 3 ].y = xpoint[ 0 ].y; XDrawLines( dpy, win, gc, xpoint, 4, CoordModeOrigin ); } } /*************************************** ***************************************/ static DrawFunc drawfunc[ ] = { fl_oval, fl_rectangle, draw_triangle }; typedef struct { DrawFunc drawit; int x, y, w, h, fill, c[ 3 ]; int newfig; } DrawFigure; static DrawFigure saved_figure[ 800 ], *cur_fig; /*************************************** ***************************************/ void draw_initialize( FD_drawfree * ui ) { cur_fig = saved_figure; cur_fig->c[ 0 ] = cur_fig->c[ 1 ] = cur_fig->c[ 2 ] = 127, cur_fig->w = cur_fig->h = 30; cur_fig->drawit = fl_oval; cur_fig->fill = 1; fl_mapcolor( FL_FREE_COL1, cur_fig->c[ 0 ], cur_fig->c[ 1 ], cur_fig->c[ 2 ] ); fl_set_slider_bounds( ui->wsli, 1, max_w ); fl_set_slider_bounds( ui->hsli, 1, max_h ); fl_set_slider_precision( ui->wsli, 0 ); fl_set_slider_precision( ui->hsli, 0 ); fl_set_slider_value( ui->wsli, cur_fig->w ); fl_set_slider_value( ui->hsli, cur_fig->h ); /* Intial drawing function */ fl_set_button( ui->drobj[ 0 ], 1 ); /* Setup the color slider so we can find out colorobject from the callback funtions. This is not necessary as drawui is static, this is done to show how to access other objects from an object callback function */ ui->rsli->u_vdata = ui; ui->gsli->u_vdata = ui; ui->bsli->u_vdata = ui; } /*************************************** ***************************************/ void switch_object( FL_OBJECT * ob FL_UNUSED_ARG, long which ) { cur_fig->drawit = drawfunc[ which ]; } /*************************************** ***************************************/ void change_color( FL_OBJECT * ob, long which ) { cur_fig->c[ which ] = 255 * fl_get_slider_value( ob ); fl_mapcolor( FL_FREE_COL1, cur_fig->c[ 0 ], cur_fig->c[ 1 ], cur_fig->c[ 2 ] ); fl_redraw_object( ( ( FD_drawfree * ) ob->u_vdata )->colorobj ); } /*************************************** ***************************************/ void fill_cb( FL_OBJECT * ob, long notused FL_UNUSED_ARG ) { cur_fig->fill = ! fl_get_button( ob ); } /*************************************** ***************************************/ void change_size( FL_OBJECT * ob, long which ) { if ( which == 0 ) cur_fig->w = fl_get_slider_value( ob ); else cur_fig->h = fl_get_slider_value( ob ); } /*************************************** ***************************************/ void refresh_cb( FL_OBJECT * ob FL_UNUSED_ARG, long which FL_UNUSED_ARG ) { fl_redraw_object( drawui->freeobj ); } /*************************************** ***************************************/ void clear_cb( FL_OBJECT * ob FL_UNUSED_ARG, long notused FL_UNUSED_ARG ) { saved_figure[ 0 ] = *cur_fig; cur_fig = saved_figure; fl_redraw_object( drawui->freeobj ); } /*************************************** The routine that does drawing ***************************************/ int freeobject_handler( FL_OBJECT * ob, int event, FL_Coord mx, FL_Coord my, int key, void * xev FL_UNUSED_ARG ) { DrawFigure *dr; switch ( event ) { case FL_DRAW: if ( cur_fig->newfig == 1 ) cur_fig->drawit( cur_fig->fill, cur_fig->x + ob->x, cur_fig->y + ob->y, cur_fig->w, cur_fig->h, FL_FREE_COL1 ); else { fl_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, FL_BOUND_WIDTH ); for ( dr = saved_figure; dr < cur_fig; dr++ ) { fl_mapcolor( FL_FREE_COL1, dr->c[ 0 ], dr->c[ 1 ], dr->c[ 2 ] ); dr->drawit( dr->fill, dr->x + ob->x, dr->y + ob->y, dr->w, dr->h, FL_FREE_COL1 ); } } cur_fig->newfig = 0; break; case FL_PUSH: if ( key != 2 ) { cur_fig->x = mx - cur_fig->w / 2; cur_fig->y = my - cur_fig->h / 2; /* Convert position to relative to the free object */ cur_fig->x -= ob->x; cur_fig->y -= ob->y; cur_fig->newfig = 1; fl_redraw_object( ob ); *( cur_fig + 1 ) = *cur_fig; cur_fig++; cur_fig->newfig = 0; } break; } return 0; } /*************************************** ***************************************/ FD_drawfree * create_form_drawfree( void ) { FL_OBJECT *obj; FD_drawfree *fdui = fl_calloc( 1, sizeof *fdui ); fdui->drawfree = fl_bgn_form( FL_NO_BOX, 530, 490 ); fl_add_box( FL_UP_BOX, 0, 0, 530, 490, "" ); fl_add_frame( FL_DOWN_FRAME, 145, 55, 370, 405, "" ); fdui->freeobj = obj = fl_add_free( FL_NORMAL_FREE, 145, 55, 370, 405, "", freeobject_handler ); fl_set_object_boxtype( obj, FL_FLAT_BOX ); fdui->colorobj = obj = fl_add_box( FL_BORDER_BOX, 25, 325, 90, 25, ""); fl_set_object_color( obj, FL_FREE_COL1, FL_COL1 ); fdui->hsli = obj = fl_add_valslider( FL_HOR_SLIDER, 15, 55, 120, 25, "Height" ); fl_set_object_lalign( obj, FL_ALIGN_TOP ); fl_set_object_callback( obj, change_size, 1 ); obj = fl_add_button( FL_NORMAL_BUTTON, 395, 15, 105, 30, "Quit" ); fl_set_object_shortcut( obj, "Qq#q", 1 ); obj = fl_add_checkbutton( FL_PUSH_BUTTON, 15, 430, 100, 35, "Outline" ); fl_set_object_color( obj, FL_MCOL, FL_BLUE ); fl_set_object_callback( obj, fill_cb, 0 ); fdui->wsli = obj = fl_add_valslider( FL_HOR_SLIDER, 15, 95, 120, 25, "Width" ); fl_set_object_lalign( obj, FL_ALIGN_TOP ); fl_set_object_callback( obj, change_size, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 280, 15, 105, 30, "Refresh" ); fl_set_object_callback( obj, refresh_cb, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 165, 15, 105, 30, "Clear" ); fl_set_object_callback( obj, clear_cb, 0 ); fl_bgn_group( ); fdui->drobj[ 0 ] = obj = fl_add_button( FL_RADIO_BUTTON, 10, 390, 40, 40, "@#circle" ); fl_set_object_lcolor( obj, FL_YELLOW ); fl_set_object_callback( obj, switch_object, 0 ); fdui->drobj[ 1 ] = obj = fl_add_button( FL_RADIO_BUTTON, 50, 390, 40, 40, "@#square" ); fl_set_object_lcolor( obj, FL_YELLOW ); fl_set_object_callback( obj, switch_object, 1 ); fdui->drobj[ 2 ] = obj = fl_add_button( FL_RADIO_BUTTON, 90, 390, 40, 40, "@#8>" ); fl_set_object_lcolor( obj, FL_YELLOW ); fl_set_object_callback( obj, switch_object, 2 ); fl_end_group(); fdui->rsli = obj = fl_add_slider( FL_VERT_FILL_SLIDER, 25, 195, 30, 125, "" ); fl_set_object_color( obj, FL_COL1, FL_RED ); fl_set_object_callback( obj, change_color, 0 ); fdui->gsli = obj = fl_add_slider( FL_VERT_FILL_SLIDER, 55, 195, 30, 125, "" ); fl_set_object_color( obj, FL_COL1, FL_GREEN ); fl_set_object_callback( obj, change_color, 1 ); fdui->bsli = obj = fl_add_slider( FL_VERT_FILL_SLIDER, 85, 195, 30, 125, "" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_object_callback( obj, change_color, 2 ); fl_end_form( ); return fdui; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/inputall.c0000644000175000017500000000562712251643676013106 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Show all the input field types * * This file is part of xforms package. * T.C. Zhao and M. Overmars, 1997 */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "fd/inputall_gui.h" #include /* callbacks for form input */ /*************************************** ***************************************/ void done_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_finish( ); exit( 0 ); } /*************************************** ***************************************/ void input_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { int cx, cy; char buf[ 128 ]; fl_get_input_cursorpos( ob, &cx, &cy ); sprintf( buf,"x = %d y = %d", cx, cy ); fl_set_object_label( ( ( FD_input * ) ob->form->fdui )->report, buf ); } /*************************************** ***************************************/ void hide_show_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_input *fd = ob->form->fdui; if ( fl_object_is_visible( fd->multiinput ) ) fl_hide_object( fd->multiinput ); else fl_show_object( fd->multiinput ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FD_input *fd_input; fl_initialize( &argc, argv, 0, 0, 0 ); fd_input = create_form_input( ); fl_set_object_dblbuffer( fd_input->report, 1 ); fl_set_object_return( fd_input->norminput, FL_RETURN_ALWAYS ); fl_set_object_return( fd_input->intinput, FL_RETURN_ALWAYS ); fl_set_object_return( fd_input->floatinput, FL_RETURN_ALWAYS ); fl_set_object_return( fd_input->dateinput, FL_RETURN_ALWAYS ); fl_set_object_return( fd_input->secretinput, FL_RETURN_ALWAYS ); fl_set_object_return( fd_input->multiinput, FL_RETURN_ALWAYS ); /* Show the form */ fl_show_form( fd_input->input, FL_PLACE_CENTERFREE, FL_FULLBORDER, "input" ); while ( fl_do_forms( ) ) /* empty */ ; return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/scrollbar.c0000644000175000017500000000537712251643442013232 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * scrollbar functionality check-out */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include #include "fd/scrollbar_gui.h" /* from fd/ directory */ /*************************************** ***************************************/ void hide_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_scb *fdui = ob->form->fdui; if ( fl_object_is_visible( fdui->hor_thin ) ) { fl_set_object_label( fdui->hide,"Show" ); fl_hide_object( fdui->hor_thin ); } else { fl_set_object_label( fdui->hide,"Hide" ); fl_show_object( fdui->hor_thin ); } } /*************************************** ***************************************/ void deactivate_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_scb *fdui = ob->form->fdui; if ( fl_object_is_active( fdui->hor_thin ) ) { fl_set_object_label( fdui->deactivate,"Activate" ); fl_deactivate_object( fdui->hor_thin ); } else { fl_set_object_label( fdui->deactivate,"Deactivate" ); fl_activate_object( fdui->hor_thin ); } } /*************************************** ***************************************/ void done_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_finish( ); exit( 0 ); } /*************************************** ***************************************/ void noop_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FD_scb *fd_scb; fl_initialize( &argc, argv, 0, 0, 0 ); fd_scb = create_form_scb( ); fl_show_form( fd_scb->scb, FL_PLACE_CENTERFREE, FL_FULLBORDER, "form0" ); fl_do_forms( ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/sldsize.c0000644000175000017500000000352512251643364012720 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* This demo shows the use of a setting slider sizes */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM *form; FL_OBJECT *sl1, *sl2, *but, *obj; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); form = fl_bgn_form( FL_UP_BOX, 150, 300 ); sl1 = fl_add_slider( FL_VERT_SLIDER, 20, 20, 40, 180, "X" ); sl2 = fl_add_slider( FL_VERT_SLIDER, 90, 20, 40, 180, "Y" ); but = fl_add_button( FL_NORMAL_BUTTON, 40, 250, 70, 30, "Exit" ); fl_end_form( ); fl_show_form( form, FL_PLACE_CENTER, FL_NOBORDER, "Slider Size" ); do { fl_set_slider_size( sl2, fl_get_slider_value( sl1 ) ); fl_set_slider_size( sl1, fl_get_slider_value( sl2 ) ); obj = fl_do_forms( ); } while ( obj != but ); fl_hide_form( form ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/glwin.c0000644000175000017500000001473712251672136012371 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * OpenGL rendering in its own window * * T.C. Zhao and M. Overmars */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "include/forms.h" #include "gl/glcanvas.h" extern Window fl_glwincreate( int *, GLXContext *, int, int ); /* Forms and Objects */ typedef struct { FL_FORM * glcontrol; void * vdata; char * cdata; long ldata; FL_OBJECT * polybutt; } FD_glcontrol; extern FD_glcontrol *create_form_glcontrol( void ); extern int handle_expose( XEvent *, void * ); int prim = GL_POLYGON; /* GL primitive to draw */ Window glwin; /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FD_glcontrol *fd_glcontrol; GLXContext context; int config[ ] = { GLX_RGBA, GLX_DEPTH_SIZE, 16, GLX_DOUBLEBUFFER, None }; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); fd_glcontrol = create_form_glcontrol( ); if ( ! ( glwin = fl_glwincreate( config, &context, 250, 250 ) ) ) { fprintf( stderr, "GLWin: Can't create OpenGL window\n" ); exit( 0 ); } fl_add_event_callback( glwin, Expose, handle_expose, 0 ); fl_winshow( glwin ); /* show the first form */ fl_set_button( fd_glcontrol->polybutt, 1 ); fl_show_form( fd_glcontrol->glcontrol, FL_PLACE_CENTER, FL_FULLBORDER, "glcontrol" ); fl_do_forms( ); return 0; } /*************************************** ***************************************/ static void draw_cube( void ) { glColor3f( 1.0, 0.0, 0.0 ); glBegin( prim ); glVertex3f( 1.0, 1.0, 1.0 ); glVertex3f( 1.0, -1.0, 1.0 ); glVertex3f( 1.0, -1.0, -1.0 ); glVertex3f( 1.0, 1.0, -1.0 ); glEnd( ); glBegin( prim ); glVertex3f( -1.0, 1.0, 1.0 ); glVertex3f( -1.0, 1.0, -1.0 ); glVertex3f( -1.0, -1.0, -1.0 ); glVertex3f( -1.0, -1.0, 1.0 ); glEnd( ); /* Y faces */ glColor3f( 0.0, 1.0, 0.0 ); glBegin( prim ); glVertex3f( 1.0, 1.0, 1.0 ); glVertex3f( 1.0, 1.0, -1.0 ); glVertex3f( -1.0, 1.0, -1.0 ); glVertex3f( -1.0, 1.0, 1.0 ); glEnd( ); glBegin( prim ); glVertex3f( 1.0, -1.0, 1.0 ); glVertex3f( -1.0, -1.0, 1.0 ); glVertex3f( -1.0, -1.0, -1.0 ); glVertex3f( 1.0, -1.0, -1.0 ); glEnd( ); /* Z faces */ glColor3f( 0.0, 0.0, 1.0 ); glBegin( prim ); glVertex3f( 1.0, 1.0, 1.0 ); glVertex3f( -1.0, 1.0, 1.0 ); glVertex3f( -1.0, -1.0, 1.0 ); glVertex3f( 1.0, -1.0, 1.0 ); glEnd( ); glBegin( prim ); glVertex3f( 1.0, 1.0, -1.0 ); glVertex3f( 1.0,-1.0, -1.0 ); glVertex3f( -1.0,-1.0, -1.0 ); glVertex3f( -1.0, 1.0, -1.0 ); glEnd( ); } /*************************************** ***************************************/ int animate( XEvent * ev, void * data FL_UNUSED_ARG ) { static GLfloat xrot, yrot, zrot; glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glPushMatrix( ); glRotatef( xrot, 1.0, 0.0, 0.0 ); glRotatef( yrot, 0.0, 1.0, 0.0 ); glRotatef( zrot, 0.0, 0.0, 1.0 ); glTranslatef( -1.0,1.2,-0.5 ); draw_cube( ); glPopMatrix( ); glFinish( ); if ( ev->type != Expose ) { xrot += 10.0; yrot += 7.0; zrot -= 3.0; } glXSwapBuffers( fl_display, glwin ); return 0; } /*************************************** * Initialization and expose handler ***************************************/ int handle_expose( XEvent * xev, void * data FL_UNUSED_ARG ) { FL_Coord w ,h ; fl_get_winsize( glwin, &w, &h ); glViewport( 0,0, w, h ); glClearColor( 0.0,0.0,0.0,0.0 ); glMatrixMode( GL_PROJECTION ); glLoadIdentity( ); glFrustum( -1.0, 1.0, -1.0, 1.0, 1.0, 10.0 ); glTranslatef( 0.0, 0.0, -5.0 ); glMatrixMode( GL_MODELVIEW ); glLoadIdentity( ); glCullFace( GL_BACK ); glEnable( GL_CULL_FACE ); glShadeModel( GL_FLAT ); animate( xev, 0 ); return 0; } /* Form definition generated by fdesign */ /* callback functions */ /*************************************** ***************************************/ void change_primitive( FL_OBJECT * ob FL_UNUSED_ARG, long data ) { prim = data; } /*************************************** ***************************************/ void animate_callback( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_set_idle_callback( fl_get_button( ob ) ? animate:0, 0 ); } /*************************************** ***************************************/ FD_glcontrol * create_form_glcontrol( void ) { FL_OBJECT *obj; FD_glcontrol *fdui = fl_calloc( 1, sizeof *fdui ); fdui->glcontrol = fl_bgn_form( FL_NO_BOX, 241, 121 ); fl_add_box( FL_UP_BOX, 0, 0, 241, 121, "" ); fl_add_frame( FL_ENGRAVED_FRAME, 20, 26, 90, 70, "" ); fdui->polybutt = obj = fl_add_checkbutton( FL_RADIO_BUTTON, 30, 61, 70, 30, "Polygon" ); fl_set_object_callback( obj, change_primitive, GL_POLYGON ); obj = fl_add_checkbutton( FL_RADIO_BUTTON, 30, 31, 70, 30, "Line" ); fl_set_object_callback( obj, change_primitive, GL_LINE_LOOP ); obj = fl_add_button( FL_NORMAL_BUTTON, 150, 21, 80, 30, "Done" ); fl_set_button_shortcut( obj, "Dd", 1 ); obj = fl_add_roundbutton( FL_PUSH_BUTTON, 150, 71, 80, 30, "Animate" ); fl_set_object_callback( obj, animate_callback, 0 ); fl_end_form( ); return fdui; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/minput.c0000644000175000017500000000372312251643577012565 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" /*************************************** ***************************************/ void input_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { int x, y; fl_get_input_cursorpos( ob, &x , &y ); fprintf( stderr," x = %d y = %d\n", x, y ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM *form; FL_OBJECT *but, *obj; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); form = fl_bgn_form( FL_UP_BOX, 400, 450 ); fl_add_input( FL_MULTILINE_INPUT, 30, 270, 340, 150, "" ); obj = fl_add_input( FL_MULTILINE_INPUT, 30, 90, 340, 150, "" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, input_cb, 0 ); but = fl_add_button( FL_NORMAL_BUTTON, 160, 30, 80, 30, "Exit" ); fl_end_form( ); fl_show_form( form, FL_PLACE_CENTERFREE, FL_FULLBORDER, "MultiLineInput" ); do obj = fl_do_forms( ); while ( obj != but ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/positionerXOR.c0000644000175000017500000000541312337666504014033 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * This demo shows the use of a positioner with XOR drawmode, most * useful for overlaying positioner on top of other object * * This file is part of xforms package * T.C. Zhao and M. Overmars 1997 */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" FL_OBJECT * xval, * yval; /*************************************** * Callback routine ***************************************/ void positioner_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { char str[ 30 ]; sprintf( str, "%f", fl_get_positioner_xvalue( obj ) ); fl_set_object_label( xval, str ); sprintf( str, "%f", fl_get_positioner_yvalue( obj ) ); fl_set_object_label( yval, str ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM * form; FL_OBJECT * pos, * obj; fl_set_border_width( -2 ); fl_initialize( &argc, argv, "FormDemo", 0, 0 ); form = fl_bgn_form( FL_UP_BOX, 350, 250 ); obj = fl_add_pixmap( FL_NORMAL_PIXMAP, 60, 70, 100, 100, "" ); fl_set_object_boxtype( obj, FL_DOWN_BOX ); fl_set_pixmap_file( obj, "porsche.xpm" ); pos = fl_add_positioner( FL_OVERLAY_POSITIONER, 60, 70, 100, 100, "" ); fl_set_positioner_xbounds( pos, 0, 1 ); fl_set_positioner_ybounds( pos, 0, 1 ); fl_set_object_callback( pos, positioner_cb, 0 ); xval = fl_add_box( FL_DOWN_BOX, 230, 40, 100, 30, "" ); fl_set_object_color( xval, FL_COL1, FL_COL1 ); yval = fl_add_box( FL_DOWN_BOX, 230, 90, 100, 30, "" ); fl_set_object_color( yval, FL_COL1, FL_COL1 ); fl_add_button( FL_NORMAL_BUTTON, 230, 200, 100, 30, "Exit" ); fl_end_form( ); fl_show_form( form, FL_PLACE_CENTER, FL_TRANSIENT, "XOR Positioner" ); positioner_cb( pos, 0 ); fl_do_forms( ); fl_hide_form( form ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/demo06.c0000644000175000017500000000602712251644122012326 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* A demo of the forms library using light buttons for radio buttons and input fields. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" FL_FORM *form; FL_OBJECT *but; /*************************************** ***************************************/ void make_form1( void ) { FL_OBJECT *obj; form = fl_bgn_form( FL_UP_BOX, 500, 400 ); fl_bgn_group( ); obj = fl_add_box( FL_UP_BOX, 150, 295, 300, 65, "Children " ); fl_set_object_lalign( obj, FL_ALIGN_LEFT); fl_add_lightbutton( FL_RADIO_BUTTON, 175, 310, 50, 35, "1" ); fl_add_lightbutton( FL_RADIO_BUTTON, 241, 310, 50, 35, "2" ); fl_add_lightbutton( FL_RADIO_BUTTON, 308, 310, 50, 35, "3" ); fl_add_lightbutton( FL_RADIO_BUTTON, 375, 310, 50, 35, "4" ); fl_end_group( ); fl_bgn_group( ); obj = fl_add_box( FL_UP_BOX, 150, 230, 300, 65, "Married " ); fl_set_object_lalign( obj, FL_ALIGN_LEFT ); fl_add_lightbutton( FL_RADIO_BUTTON, 175, 245, 100, 35, "Yes" ); fl_add_lightbutton( FL_RADIO_BUTTON, 325, 245, 100, 35, "No" ); fl_end_group( ); fl_bgn_group( ); obj = fl_add_box( FL_UP_BOX, 150, 165, 300, 65, "Sex " ); fl_set_object_lalign( obj, FL_ALIGN_LEFT ); fl_add_lightbutton( FL_RADIO_BUTTON, 175, 180, 100, 35, "Male" ); fl_add_lightbutton( FL_RADIO_BUTTON, 325, 180, 100, 35, "Female" ); fl_end_group( ); fl_add_input( FL_NORMAL_INPUT, 150, 30, 300, 30, "Name " ); fl_add_input( FL_NORMAL_INPUT, 150, 75, 300, 30, "Address " ); fl_add_input( FL_NORMAL_INPUT, 150, 120, 300, 30, "City " ); but = fl_add_button( FL_NORMAL_BUTTON, 25, 360, 75, 30, "OK" ); fl_end_form( ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_OBJECT *obj; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); make_form1( ); fl_show_form( form, FL_PLACE_CENTER, FL_NOBORDER, "Demo06" ); while ( 1 ) { do obj = fl_do_forms( ); while ( obj != but ); if ( fl_show_question( "Do you really want to Quit?", 0 )) break; } fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/srs.xbm0000644000175000017500000001116411665175611012417 00000000000000#define sorceress_width 75 #define sorceress_height 75 static unsigned char sorceress_bits[] = { 0xfc, 0x7e, 0x40, 0x20, 0x90, 0x00, 0x07, 0x80, 0x23, 0x00, 0x00, 0xc6, 0xc1, 0x41, 0x98, 0xb8, 0x01, 0x07, 0x66, 0x00, 0x15, 0x9f, 0x03, 0x47, 0x8c, 0xc6, 0xdc, 0x7b, 0xcc, 0x00, 0xb0, 0x71, 0x0e, 0x4d, 0x06, 0x66, 0x73, 0x8e, 0x8f, 0x01, 0x18, 0xc4, 0x39, 0x4b, 0x02, 0x23, 0x0c, 0x04, 0x1e, 0x03, 0x0c, 0x08, 0xc7, 0xef, 0x08, 0x30, 0x06, 0x07, 0x1c, 0x02, 0x06, 0x30, 0x18, 0xae, 0xc8, 0x98, 0x3f, 0x78, 0x20, 0x06, 0x02, 0x20, 0x60, 0xa0, 0xc4, 0x1d, 0xc0, 0xff, 0x41, 0x04, 0xfa, 0x63, 0x80, 0xa1, 0xa4, 0x3d, 0x00, 0x84, 0xbf, 0x04, 0x0f, 0x06, 0xfc, 0xa1, 0x34, 0x6b, 0x01, 0x1c, 0xc9, 0x05, 0x06, 0xc7, 0x06, 0xbe, 0x11, 0x1e, 0x43, 0x30, 0x91, 0x05, 0xc3, 0x61, 0x02, 0x30, 0x1b, 0x30, 0xcc, 0x20, 0x11, 0x00, 0xc1, 0x3c, 0x03, 0x20, 0x0a, 0x00, 0xe8, 0x60, 0x21, 0x00, 0x61, 0x1b, 0xc1, 0x63, 0x08, 0xf0, 0xc6, 0xc7, 0x21, 0x03, 0xf8, 0x08, 0xe1, 0xcf, 0x0a, 0xfc, 0x4d, 0x99, 0x43, 0x07, 0x3c, 0x0c, 0xf1, 0x9f, 0x0b, 0xfc, 0x5b, 0x81, 0x47, 0x02, 0x16, 0x04, 0x31, 0x1c, 0x0b, 0x1f, 0x17, 0x89, 0x4d, 0x06, 0x1a, 0x04, 0x31, 0x38, 0x02, 0x07, 0x56, 0x89, 0x49, 0x04, 0x0b, 0x04, 0xb1, 0x72, 0x82, 0xa1, 0x54, 0x9a, 0x49, 0x04, 0x1d, 0x66, 0x50, 0xe7, 0xc2, 0xf0, 0x54, 0x9a, 0x58, 0x04, 0x0d, 0x62, 0xc1, 0x1f, 0x44, 0xfc, 0x51, 0x90, 0x90, 0x04, 0x86, 0x63, 0xe0, 0x74, 0x04, 0xef, 0x31, 0x1a, 0x91, 0x00, 0x02, 0xe2, 0xc1, 0xfd, 0x84, 0xf9, 0x30, 0x0a, 0x91, 0x00, 0x82, 0xa9, 0xc0, 0xb9, 0x84, 0xf9, 0x31, 0x16, 0x81, 0x00, 0x42, 0xa9, 0xdb, 0x7f, 0x0c, 0xff, 0x1c, 0x16, 0x11, 0x00, 0x02, 0x28, 0x0b, 0x07, 0x08, 0x60, 0x1c, 0x02, 0x91, 0x00, 0x46, 0x29, 0x0e, 0x00, 0x00, 0x00, 0x10, 0x16, 0x11, 0x02, 0x06, 0x29, 0x04, 0x00, 0x00, 0x00, 0x10, 0x16, 0x91, 0x06, 0xa6, 0x2a, 0x04, 0x00, 0x00, 0x00, 0x18, 0x24, 0x91, 0x04, 0x86, 0x2a, 0x04, 0x00, 0x00, 0x00, 0x18, 0x27, 0x93, 0x04, 0x96, 0x4a, 0x04, 0x00, 0x00, 0x00, 0x04, 0x02, 0x91, 0x04, 0x86, 0x4a, 0x0c, 0x00, 0x00, 0x00, 0x1e, 0x23, 0x93, 0x04, 0x56, 0x88, 0x08, 0x00, 0x00, 0x00, 0x90, 0x21, 0x93, 0x04, 0x52, 0x0a, 0x09, 0x80, 0x01, 0x00, 0xd0, 0x21, 0x95, 0x04, 0x57, 0x0a, 0x0f, 0x80, 0x27, 0x00, 0xd8, 0x20, 0x9d, 0x04, 0x5d, 0x08, 0x1c, 0x80, 0x67, 0x00, 0xe4, 0x01, 0x85, 0x04, 0x79, 0x8a, 0x3f, 0x00, 0x00, 0x00, 0xf4, 0x11, 0x85, 0x06, 0x39, 0x08, 0x7d, 0x00, 0x00, 0x18, 0xb7, 0x10, 0x81, 0x03, 0x29, 0x12, 0xcb, 0x00, 0x7e, 0x30, 0x28, 0x00, 0x85, 0x03, 0x29, 0x10, 0xbe, 0x81, 0xff, 0x27, 0x0c, 0x10, 0x85, 0x03, 0x29, 0x32, 0xfa, 0xc1, 0xff, 0x27, 0x94, 0x11, 0x85, 0x03, 0x28, 0x20, 0x6c, 0xe1, 0xff, 0x07, 0x0c, 0x01, 0x85, 0x01, 0x28, 0x62, 0x5c, 0xe3, 0x8f, 0x03, 0x4e, 0x91, 0x80, 0x05, 0x39, 0x40, 0xf4, 0xc2, 0xff, 0x00, 0x9f, 0x91, 0x84, 0x05, 0x31, 0xc6, 0xe8, 0x07, 0x7f, 0x80, 0xcd, 0x00, 0xc4, 0x04, 0x31, 0x06, 0xc9, 0x0e, 0x00, 0xc0, 0x48, 0x88, 0xe0, 0x04, 0x79, 0x04, 0xdb, 0x12, 0x00, 0x30, 0x0c, 0xc8, 0xe4, 0x04, 0x6d, 0x06, 0xb6, 0x23, 0x00, 0x18, 0x1c, 0xc0, 0x84, 0x04, 0x25, 0x0c, 0xff, 0xc2, 0x00, 0x4e, 0x06, 0xb0, 0x80, 0x04, 0x3f, 0x8a, 0xb3, 0x83, 0xff, 0xc3, 0x03, 0x91, 0x84, 0x04, 0x2e, 0xd8, 0x0f, 0x3f, 0x00, 0x00, 0x5f, 0x83, 0x84, 0x04, 0x2a, 0x70, 0xfd, 0x7f, 0x00, 0x00, 0xc8, 0xc0, 0x84, 0x04, 0x4b, 0xe2, 0x2f, 0x01, 0x00, 0x08, 0x58, 0x60, 0x80, 0x04, 0x5b, 0x82, 0xff, 0x01, 0x00, 0x08, 0xd0, 0xa0, 0x84, 0x04, 0x72, 0x80, 0xe5, 0x00, 0x00, 0x08, 0xd2, 0x20, 0x44, 0x04, 0xca, 0x02, 0xff, 0x00, 0x00, 0x08, 0xde, 0xa0, 0x44, 0x04, 0x82, 0x02, 0x6d, 0x00, 0x00, 0x08, 0xf6, 0xb0, 0x40, 0x02, 0x82, 0x07, 0x3f, 0x00, 0x00, 0x08, 0x44, 0x58, 0x44, 0x02, 0x93, 0x3f, 0x1f, 0x00, 0x00, 0x30, 0x88, 0x4f, 0x44, 0x03, 0x83, 0x23, 0x3e, 0x00, 0x00, 0x00, 0x18, 0x60, 0xe0, 0x07, 0xe3, 0x0f, 0xfe, 0x00, 0x00, 0x00, 0x70, 0x70, 0xe4, 0x07, 0xc7, 0x1b, 0xfe, 0x01, 0x00, 0x00, 0xe0, 0x3c, 0xe4, 0x07, 0xc7, 0xe3, 0xfe, 0x1f, 0x00, 0x00, 0xff, 0x1f, 0xfc, 0x07, 0xc7, 0x03, 0xf8, 0x33, 0x00, 0xc0, 0xf0, 0x07, 0xff, 0x07, 0x87, 0x02, 0xfc, 0x43, 0x00, 0x60, 0xf0, 0xff, 0xff, 0x07, 0x8f, 0x06, 0xbe, 0x87, 0x00, 0x30, 0xf8, 0xff, 0xff, 0x07, 0x8f, 0x14, 0x9c, 0x8f, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x07, 0x9f, 0x8d, 0x8a, 0x0f, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x07, 0xbf, 0x0b, 0x80, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xff, 0x07, 0x7f, 0x3a, 0x80, 0x3f, 0x00, 0x80, 0xff, 0xff, 0xff, 0x07, 0xff, 0x20, 0xc0, 0x3f, 0x00, 0x80, 0xff, 0xff, 0xff, 0x07, 0xff, 0x01, 0xe0, 0x7f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x07, 0xff, 0x0f, 0xf8, 0xff, 0x40, 0xe0, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff, 0x40, 0xf0, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff, 0x41, 0xf0, 0xff, 0xff, 0xff, 0x07}; xforms-1.2.4/demos/rescale.c0000644000175000017500000000634312251643445012662 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* Demo for scaling forms. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "include/forms.h" typedef struct { FL_FORM * form; FL_OBJECT *smallerobj, *largerobj, *scaleobj, *cell00, *exitobj; } FD_form; /*************************************** ***************************************/ FD_form * create_form_form(void) { FL_OBJECT *obj; FD_form *fdui = calloc( 1, sizeof *fdui ); fdui->form = fl_bgn_form( FL_NO_BOX, 470, 370 ); fl_add_box( FL_UP_BOX, 0, 0, 470, 370, "" ); obj = fl_add_box( FL_SHADOW_BOX, 30, 30, 410, 70, "Scaling Forms" ); fl_set_object_color( obj, 9, 47 ); fl_set_object_lsize( obj, 16 ); fdui->smallerobj = fl_add_button( FL_NORMAL_BUTTON, 30, 220, 130, 40, "Smaller" ); fdui->largerobj = fl_add_button( FL_NORMAL_BUTTON, 310, 220, 130, 40, "Larger" ); fdui->scaleobj = obj = fl_add_input( FL_FLOAT_INPUT, 170, 140, 270, 40, "Scale:" ); fdui->exitobj = obj = fl_add_button( FL_NORMAL_BUTTON, 310, 300, 130, 40, "Exit" ); fl_end_form( ); return fdui; } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { float sc = 1, oldsc; FL_OBJECT *obj; FD_form *ui; char str[ 32 ]; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); ui = create_form_form( ); sprintf( str, "%.2f", sc ); fl_set_input( ui->scaleobj, str ); fl_show_form( ui->form, FL_PLACE_CENTER | FL_FREE_SIZE, FL_FULLBORDER, "Scaling" ); while ( 1 ) { oldsc = sc; obj = fl_do_forms( ); if ( obj == ui->exitobj ) exit( 0 ); if ( obj == ui->smallerobj ) sc = sc * 0.8; if ( obj == ui->largerobj ) sc = sc / 0.8; if ( obj == ui->scaleobj ) sc = atof( fl_get_input( ui->scaleobj ) ); if ( sc < 0.50 ) sc = 0.50; if ( sc > 3 ) sc = 3; if ( sc != oldsc ) { fl_scale_form( ui->form, sc / oldsc, sc / oldsc ); sprintf( str, "%.2f", sc ); fl_set_input( ui->scaleobj, str ); } } } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/nmenu.c0000644000175000017500000001176612251643552012372 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* This demo shows the use of all four types of nmenu's. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include extern FL_FORM *create_form( void ); FL_OBJECT *menu[ 4 ], *abox[ 4 ]; int set[ 4 ]; /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM *form; int i; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); form = create_form( ); for ( i = 0; i < 4; i++ ) { fl_add_nmenu_items( menu[ i ], "Red%SR%r%s%d|Green%SG%r%s%d|Yellow%SY%r%s%d|" "Blue%SB%r%s%d|Purple%SP%r%s|Cyan%SC%r%s|" "White%SW%r%s", 1, "Rr#R#r", 1, "Gg#G#g", 1, "Yy#Y#y", 1, "Bb#B#b", 1, "Pp#P#p", 1, "Cc#C#c", 1, "Ww#W#w" ); fl_popup_entry_set_state( fl_get_nmenu_item_by_value( menu[ i ], i ), FL_POPUP_CHECKED ); set[ i ] = i; fl_set_object_color( abox[ i ], FL_RED + set[ i ], FL_BLACK ); } fl_show_form( form, FL_PLACE_CENTER, FL_TRANSIENT, "Nmenu" ); fl_do_forms( ); fl_hide_form( form ); fl_finish( ); return 0; } /*************************************** * m is the menu index 0 - 3 ***************************************/ static void menu_cb( FL_OBJECT * obj, long m ) { FL_POPUP_RETURN *r = fl_get_nmenu_item( obj ); int i; if ( set[ m ] == r->val ) return; for ( i = 0; i < 4; i++) { if ( i != m ) { /* enable the old selected color for other menus*/ fl_popup_entry_set_state( fl_get_nmenu_item_by_value( menu[ i ], set[ m ] ), 0 ); /* disable the currently selected color for other menus */ fl_popup_entry_set_state( fl_get_nmenu_item_by_value( menu[ i ], r->val ), FL_POPUP_DISABLED ); } } set[ m ] = r->val; fl_set_object_color( abox[ m ], FL_RED + r->val, FL_BLACK ); } /*************************************** ***************************************/ static void done_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_finish( ); exit( 0 ); } /*************************************** ***************************************/ FL_FORM * create_form( void ) { FL_FORM *form; FL_OBJECT *obj; form = fl_bgn_form( FL_NO_BOX, 444, 380 ); obj = fl_add_box( FL_BORDER_BOX, 0, 0, 444, 380, "" ); fl_set_object_color( obj, FL_SLATEBLUE, FL_COL1 ); obj = fl_add_box( FL_UP_BOX, 0, 0, 444, 29, "" ); fl_set_object_color( obj, FL_COL1, FL_COL1 ); menu[ 0 ] = obj = fl_add_nmenu( FL_NORMAL_NMENU, 2, 2, 110, 25, "Color 1" ); fl_set_object_shortcut( obj, "1#1", 1 ); fl_set_object_callback( obj, menu_cb, 0 ); menu[ 1 ] = obj = fl_add_nmenu( FL_NORMAL_TOUCH_NMENU, 112, 2, 110, 25, "Color 2" ); fl_set_object_shortcut( obj, "2#2", 1 ); fl_set_object_callback( obj, menu_cb, 1 ); menu[ 2 ] = obj = fl_add_nmenu( FL_BUTTON_NMENU, 222, 2, 110, 25, "Color 3" ); fl_set_object_shortcut( obj, "3#3", 1 ); fl_set_object_callback( obj, menu_cb, 2 ); menu[ 3 ] = obj = fl_add_nmenu( FL_BUTTON_TOUCH_NMENU, 332, 2, 110, 25, "Color 4" ); fl_set_object_shortcut( obj, "4#4", 1 ); fl_set_object_callback( obj, menu_cb, 3 ); abox[ 0 ] = obj = fl_add_box( FL_SHADOW_BOX, 20, 80, 70, 230, "" ); abox[ 1 ] = obj = fl_add_box( FL_SHADOW_BOX, 130, 80, 70, 230, "" ); abox[ 2 ] = obj = fl_add_box( FL_SHADOW_BOX, 240, 80, 70, 230, "" ); abox[ 3 ] = obj = fl_add_box( FL_SHADOW_BOX, 350, 80, 70, 230, "" ); obj = fl_add_button( FL_NORMAL_BUTTON, 310, 330, 110, 30, "Quit" ); fl_set_object_shortcut( obj, "Q#Q", 1 ); fl_set_object_callback( obj, done_cb, 0 ); fl_end_form( ); return form; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/multilabel.c0000644000175000017500000000576512251643571013405 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* Multiline labels. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" FL_FORM *form; FL_OBJECT *readyobj; /*************************************** ***************************************/ void create_form_0( void ) { FL_OBJECT *obj; form = fl_bgn_form( FL_NO_BOX, 400, 470 ); obj = fl_add_box( FL_UP_BOX, 0, 0, 400, 470, "" ); fl_set_object_color( obj, FL_SLATEBLUE, FL_COL1 ); obj = fl_add_text( FL_NORMAL_TEXT, 140, 40, 120, 120, "This is\na multi-line\nlabelT" ); fl_set_object_boxtype( obj, FL_BORDER_BOX ); fl_set_object_lalign( obj, FL_ALIGN_TOP ); obj = fl_add_text( FL_NORMAL_TEXT, 140, 160, 120, 120, "This is\na multi-line\nlabelC" ); fl_set_object_boxtype( obj, FL_BORDER_BOX ); fl_set_object_color( obj, FL_PALEGREEN, FL_COL1 ); fl_set_object_lsize( obj, FL_LARGE_SIZE ); fl_set_object_lalign( obj, FL_ALIGN_CENTER ); readyobj = obj = fl_add_button( FL_NORMAL_BUTTON, 280, 400, 100, 50, "I am sure\nthat I am\nReady" ); fl_set_object_lsize( obj, FL_SMALL_SIZE ); obj = fl_add_text( FL_NORMAL_TEXT, 260, 160, 120, 120, "This is\na multi-line\nlabelR" ); fl_set_object_boxtype( obj, FL_BORDER_BOX ); fl_set_object_lalign( obj, FL_ALIGN_RIGHT ); obj = fl_add_text( FL_NORMAL_TEXT, 140, 280, 120, 120, "This is\na multi-line\nlabelB" ); fl_set_object_boxtype( obj, FL_BORDER_BOX ); fl_set_object_lalign( obj, FL_ALIGN_BOTTOM ); obj = fl_add_text( FL_NORMAL_TEXT, 20, 160, 120, 120, "This is\na multi-line\nlabelL" ); fl_set_object_boxtype( obj, FL_BORDER_BOX ); fl_end_form( ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_OBJECT *obj; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); create_form_0( ); fl_show_form( form,FL_PLACE_CENTER, FL_NOBORDER, "Labels" ); do obj = fl_do_forms( ); while ( obj != readyobj ); fl_hide_form( form ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/pmbrowse.c0000644000175000017500000000726112251643526013102 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Showing the use of non-modal file selector * * T.C. Zhao and M. Overmars */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "fd/pmbrowse_gui.h" #include #include #include #include FD_ttt *fd_ttt; static int load_file( const char *, void * ); /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_initialize( &argc, argv, "FormDemo", 0, 0 ); fd_ttt = create_form_ttt( ); fl_show_form( fd_ttt->ttt, FL_PLACE_CENTER, FL_TRANSIENT, "PixmapBrowser" ); fl_set_fselector_placement( FL_PLACE_FREE ); fl_set_fselector_callback( load_file, 0 ); fl_show_fselector( "Load a Pixmap file", NULL, "*.x?m", NULL ); fl_do_forms( ); return 0; } /*************************************** ***************************************/ static int load_file( const char * fname, void * data FL_UNUSED_ARG ) { char *p; struct stat buff; if ( ! fname || ! *fname ) { fprintf( stderr, "Missing file name\n" ); return 0; } if ( ! stat( fname, &buff ) ) { if ( ! S_ISDIR( buff.st_mode ) ) { if ( ( p = strrchr( fname, '.' ) ) ) { if ( ! strcmp( p + 1, "xpm" ) ) { fl_hide_object( fd_ttt->bm ); fl_free_pixmap_pixmap( fd_ttt->pm ); fl_set_pixmap_file( fd_ttt->pm, fname ); fl_show_object( fd_ttt->pm ); } else if ( ! strcmp( p + 1, "xbm" ) ) { fl_hide_object( fd_ttt->pm ); fl_set_bitmap_file( fd_ttt->bm, fname ); fl_show_object( fd_ttt->bm ); } else { fprintf( stderr, "Invalid file extension: %s\n", p + 1 ); return 0; } } else { fprintf( stderr, "Neither .xpm nor .xbm file\n" ); return 0; } } } else { fprintf( stderr, "Can't stat() file %s\n", fname ); return 0; } return 1; } /*************************************** ***************************************/ void done( FL_OBJECT * ob FL_UNUSED_ARG, long q FL_UNUSED_ARG ) { fl_finish( ); exit( 0 ); } /*************************************** ***************************************/ void reload( FL_OBJECT * ob FL_UNUSED_ARG, long q FL_UNUSED_ARG ) { fl_set_fselector_placement( FL_PLACE_MOUSE ); fl_set_fselector_callback( load_file, 0 ); fl_show_fselector( "Load a Pix/bitMap file", NULL, NULL, NULL ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/sliderall.c0000664000175000017500000001062412337325620013213 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* This demo shows the different types of sliders */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" FL_FORM *form; FL_OBJECT *exitobj; /*************************************** ***************************************/ void create_form_form( void ) { FL_OBJECT *obj; form = fl_bgn_form( FL_NO_BOX, 780, 320 ); obj = fl_add_box( FL_UP_BOX, 0, 0, 780, 320, "" ); fl_set_object_color( obj, FL_PALEGREEN, FL_COL1 ); obj = fl_add_box( FL_SHADOW_BOX, 20, 30, 360, 270, "SLIDER" ); fl_set_object_color( obj, FL_SLATEBLUE, 47 ); fl_set_object_lalign( obj, FL_ALIGN_TOP ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); obj = fl_add_box( FL_SHADOW_BOX, 390, 30, 370, 270, "VALSLIDER" ); fl_set_object_color( obj, FL_SLATEBLUE, FL_COL1 ); fl_set_object_lalign( obj, FL_ALIGN_TOP ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); obj = fl_add_slider( FL_VERT_SLIDER, 30, 50, 40, 220, "vert" ); fl_set_object_color( obj, FL_INDIANRED, FL_PALEGREEN ); fl_set_slider_mouse_buttons( obj, 7 ); obj = fl_add_slider( FL_VERT_FILL_SLIDER, 80, 50, 40, 220, "vert_fill" ); fl_set_object_color( obj, FL_INDIANRED, FL_PALEGREEN ); obj = fl_add_slider( FL_HOR_SLIDER, 180, 50, 195, 40, "hor" ); fl_set_object_color( obj, FL_INDIANRED, FL_PALEGREEN ); obj = fl_add_slider( FL_HOR_FILL_SLIDER, 180, 110, 190, 40, "hor_fill" ); fl_set_object_color( obj, FL_INDIANRED, FL_PALEGREEN ); obj = fl_add_valslider( FL_VERT_NICE_SLIDER, 610, 50, 30, 220, "vert_nice" ); fl_set_object_boxtype( obj, FL_FLAT_BOX ); fl_set_object_color( obj, FL_SLATEBLUE, FL_INDIANRED ); obj = fl_add_valslider( FL_VERT_FILL_SLIDER, 660, 50, 40, 220, "vert_fill" ); fl_set_object_color( obj, FL_INDIANRED, FL_PALEGREEN ); obj = fl_add_valslider( FL_HOR_SLIDER, 400, 50, 190, 40, "hor" ); fl_set_object_color( obj, FL_INDIANRED, FL_PALEGREEN ); obj = fl_add_valslider( FL_HOR_FILL_SLIDER, 400, 110, 190, 40, "hor_fill" ); fl_set_object_color( obj, FL_INDIANRED, FL_PALEGREEN ); fl_add_valslider( FL_HOR_BROWSER_SLIDER, 400, 220, 190, 25, "hor_browser" ); exitobj = obj = fl_add_button( FL_NORMAL_BUTTON, 450, 260, 100, 30, "Exit" ); fl_set_object_color( obj, FL_INDIANRED, FL_RED ); obj = fl_add_slider( FL_VERT_NICE_SLIDER, 130, 50, 30, 220, "vert_nice" ); fl_set_object_boxtype( obj, FL_FLAT_BOX ); fl_set_object_color( obj, FL_SLATEBLUE, FL_INDIANRED ); obj = fl_add_slider( FL_HOR_NICE_SLIDER, 180, 170, 190, 30, "hor_nice" ); fl_set_object_boxtype( obj, FL_FLAT_BOX ); fl_set_object_color( obj, FL_SLATEBLUE, FL_INDIANRED ); fl_add_slider( FL_HOR_BROWSER_SLIDER, 180, 220, 190, 25, "hor_browser" ); obj = fl_add_valslider( FL_HOR_NICE_SLIDER, 400, 170, 190, 30, "hor_nice" ); fl_set_object_boxtype( obj, FL_FLAT_BOX ); fl_set_object_color( obj, FL_SLATEBLUE, FL_INDIANRED ); obj = fl_add_valslider( FL_VERT_SLIDER, 710, 50, 40, 220, "vert" ); fl_set_object_color( obj, FL_INDIANRED, FL_PALEGREEN ); fl_end_form( ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_OBJECT *obj; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); create_form_form( ); fl_show_form( form, FL_PLACE_CENTER | FL_FREE_SIZE, FL_FULLBORDER, "All Sliders" ); do obj = fl_do_forms( ); while ( obj != exitobj ); fl_hide_form( form ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/colsel.c0000644000175000017500000000255112251644165012522 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* default color chooser from the internal/built-in colormap */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { int old_col = 1, new_col = 0; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); while ( old_col != new_col ) { old_col = new_col; new_col = fl_show_colormap( old_col ); } fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/touchbutton.c0000644000175000017500000000574712251643254013627 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* This demo shows the use of a touch buttons. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" static void show_val( FL_OBJECT *, long ); FL_OBJECT *valobj; /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM *form; FL_OBJECT *obj; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); form = fl_bgn_form( FL_UP_BOX, 360, 140); obj = fl_add_button( FL_TOUCH_BUTTON, 50, 30, 40, 30, "@<<" ); fl_set_object_boxtype( obj, FL_FRAME_BOX ); fl_set_object_color( obj, FL_COL1, FL_INDIANRED ); fl_set_object_callback( obj, show_val, -5 ); fl_set_button_shortcut( obj, "1", 0 ); obj = fl_add_button( FL_TOUCH_BUTTON, 90, 30, 40, 30, "@<" ); fl_set_object_boxtype( obj, FL_FRAME_BOX ); fl_set_object_color( obj, FL_COL1, FL_INDIANRED ); fl_set_object_callback( obj, show_val, -1 ); fl_set_button_shortcut( obj, "2", 0 ); valobj = obj = fl_add_box( FL_BORDER_BOX, 130, 30, 100, 30, "" ); fl_set_object_color( obj, FL_LEFT_BCOL, FL_LEFT_BCOL ); obj = fl_add_button( FL_TOUCH_BUTTON, 230, 30, 40, 30, "@>" ); fl_set_object_boxtype( obj, FL_FRAME_BOX ); fl_set_object_color( obj, FL_COL1, FL_INDIANRED ); fl_set_object_callback( obj, show_val, 1 ); fl_set_button_shortcut( obj, "3", 0 ); obj = fl_add_button( FL_TOUCH_BUTTON, 270, 30, 40, 30, "@>>" ); fl_set_object_boxtype( obj, FL_FRAME_BOX ); fl_set_object_callback( obj, show_val, 5 ); fl_set_object_color( obj, FL_COL1, FL_INDIANRED ); fl_set_button_shortcut( obj, "4", 0 ); fl_add_button( FL_NORMAL_BUTTON, 220, 90, 100, 30, "Exit" ); fl_end_form( ); fl_show_form( form, FL_PLACE_CENTER, FL_NOBORDER, "Touch Buttons" ); fl_do_forms( ); fl_finish( ); return 0; } /*************************************** ***************************************/ static void show_val( FL_OBJECT * ob FL_UNUSED_ARG, long delta ) { static int val = 0; char str[ 32 ]; val += delta; sprintf( str,"%d", val ); fl_set_object_label( valobj, str ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/xyplotover.c0000644000175000017500000000744612251643223013476 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Demo showing the use of xyplot overlay, plot key and * PostScript output. * * This file is part of xforms package * T.C. Zhao and M. Overmars */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include #include /**** Forms and Objects ****/ typedef struct { FL_FORM * fff; void * vdata; long ldata; FL_OBJECT * xyplot; } FD_fff; extern FD_fff * create_form_fff( void ); extern void init_xyplot( FD_fff * ); /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FD_fff *fd_fff; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); fd_fff = create_form_fff( ); /* Fill-in form initialization code */ init_xyplot( fd_fff ); /* Show the first form */ fl_show_form( fd_fff->fff, FL_PLACE_MOUSE | FL_FREE_SIZE, FL_TRANSIENT, "XYPlot Overlay" ); fl_do_forms( ); if ( fl_object_ps_dump( fd_fff->xyplot, "test.ps" ) >= 0 ) fprintf( stderr, "PostScript output test.ps written\n" ); return 0; } /*************************************** ***************************************/ void init_xyplot( FD_fff * fd_fff ) { int i; float xx[ 20 ], yy[ 20 ]; for ( i = 0; i <= 10; i++ ) { xx[ i ] = i; yy[ i ] = exp( - 0.125 * ( i - 5 ) * ( i - 5 ) ); } fl_set_xyplot_data( fd_fff->xyplot, xx, yy, 8, "Plot Title", "X-Axis", "Y|Axis"); fl_set_xyplot_ybounds( fd_fff->xyplot, 0, 1.1 ); fl_set_xyplot_xbounds( fd_fff->xyplot, 0, 10 ); fl_add_xyplot_overlay( fd_fff->xyplot, 1, xx, yy, 11, FL_YELLOW ); fl_set_xyplot_overlay_type( fd_fff->xyplot, 1, FL_LINEPOINTS_XYPLOT ); fl_set_xyplot_interpolate( fd_fff->xyplot, 1, 2, 0.1 ); fl_add_xyplot_text( fd_fff->xyplot, 0.5, 1.0, "Gaussian\nDistribution", FL_ALIGN_RIGHT, FL_WHITE ); fl_set_xyplot_key( fd_fff->xyplot, 0, "Original" ); fl_set_xyplot_key( fd_fff->xyplot, 1, "Overlay" ); fl_set_xyplot_key_position( fd_fff->xyplot, 9.8, 1.08, FL_ALIGN_LEFT_BOTTOM ); } /*************************************** ***************************************/ FD_fff * create_form_fff( void ) { FL_OBJECT *obj; FD_fff *fdui = fl_calloc( 1, sizeof *fdui ); fdui->fff = fl_bgn_form( FL_NO_BOX, 370, 310 ); fl_add_box( FL_UP_BOX, 0, 0, 370, 310, "" ); fdui->xyplot = obj = fl_add_xyplot( FL_IMPULSE_XYPLOT, 10, 20, 350, 260, "An XYPlot with overlay" ); fl_set_object_lalign( obj, fl_to_inside_lalign( FL_ALIGN_BOTTOM ) ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_boxtype( obj, FL_DOWN_BOX ); fl_set_object_color( obj, FL_BLACK, FL_GREEN ); obj = fl_add_button( FL_HIDDEN_BUTTON, 10, 10, 350, 290, "" ); fl_set_button_shortcut( obj,"qQ", 0 ); fl_end_form( ); return fdui; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/sld_radio.c0000644000175000017500000000416012251643367013202 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* This demo shows the use of a slider as radio object */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM *form; FL_OBJECT *sl, *but1, *but2, *but3, *but, *obj; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); form = fl_bgn_form( FL_UP_BOX, 300, 300 ); sl = fl_add_slider( FL_VERT_SLIDER, 40, 40, 60, 220, "X" ); sl->radio = 1; but1 = fl_add_lightbutton( FL_RADIO_BUTTON, 140, 220, 120, 40, "0.0" ); but2 = fl_add_lightbutton( FL_RADIO_BUTTON, 140, 160, 120, 40, "0.5" ); but3 = fl_add_lightbutton( FL_RADIO_BUTTON, 140, 100, 120, 40, "1.0" ); but = fl_add_button( FL_NORMAL_BUTTON, 140, 40, 120, 40, "Exit" ); fl_end_form( ); fl_show_form( form, FL_PLACE_CENTER, FL_NOBORDER, "slRadio" ); do { obj = fl_do_forms( ); if ( obj == but1 ) fl_set_slider_value( sl, 0.0 ); if ( obj == but2 ) fl_set_slider_value( sl, 0.5 ); if ( obj == but3 ) fl_set_slider_value( sl, 1.0 ); } while ( obj != but ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/fbrowse.c0000664000175000017500000001130312353623325012703 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * This demo shows the use of a browser and a file selector. * Good browser/scrollbar test * * This file is part of xforms package * T.C. Zhao and M. Overmars * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "include/forms.h" typedef struct { FL_FORM * form; void * vdata; char * cdata; long ldata; FL_OBJECT * br; } FD_form; /*************************************** ***************************************/ void load_file( FL_OBJECT * ob, long arg FL_UNUSED_ARG ) { const char *fname; FD_form *fdui = ob->form->fdui; if ( ( fname = fl_show_file_selector( "File To Load", "", "*", "" ) ) ) { if ( ! fl_load_browser( fdui->br, fname ) ) fl_add_browser_line( fdui->br,"NO SUCH FILE!" ); } } /*************************************** ***************************************/ void set_size( FL_OBJECT * ob, long arg) { FD_form *fdui = ob->form->fdui; fl_set_browser_fontsize( fdui->br, arg ); } /*************************************** ***************************************/ void exit_program( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_finish( ); exit( 0 ); } /*************************************** ***************************************/ void hide_show( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_form *fdui = ob->form->fdui; if ( fl_object_is_visible( fdui->br ) ) fl_hide_object( fdui->br ); else fl_show_object( fdui->br ); } /*************************************** ***************************************/ FD_form * create_form( void ) { FL_OBJECT *obj; FL_Coord x = 20, dx = 80, dy = 28; FD_form *fdui = fl_calloc( 1, sizeof *fdui ); fdui->form = fl_bgn_form( FL_NO_BOX, 590, 610 ); fl_add_box( FL_UP_BOX, 0, 0, 590, 610, "" ); fdui->br = obj = fl_add_browser( FL_NORMAL_BROWSER, 20, 20, 550, 530, "" ); obj = fl_add_button( FL_NORMAL_BUTTON, x, 565, dx-5, dy, "Load" ); fl_set_object_callback( obj, load_file, 0 ); x += dx ; obj = fl_add_lightbutton( FL_RADIO_BUTTON, x, 565, dx, dy, "Tiny" ); fl_set_object_callback( obj, set_size, FL_TINY_SIZE ); x += dx; obj = fl_add_lightbutton( FL_RADIO_BUTTON, x , 565, dx, dy, "Small" ); fl_set_object_callback( obj, set_size, FL_SMALL_SIZE ); fl_set_button( obj, FL_SMALL_SIZE == FL_BROWSER_FONTSIZE ); x += dx; obj = fl_add_lightbutton( FL_RADIO_BUTTON, x , 565, dx, dy, "Normal" ); fl_set_object_callback( obj, set_size, FL_NORMAL_SIZE ); fl_set_button( obj, FL_NORMAL_SIZE == FL_BROWSER_FONTSIZE ); x += dx; obj = fl_add_lightbutton( FL_RADIO_BUTTON, x , 565, dx, dy, "Large" ); fl_set_object_callback( obj, set_size, FL_LARGE_SIZE ); x += dx + 4; obj = fl_add_button( FL_NORMAL_BUTTON, x, 565, dx, dy, "Hide/Show" ); fl_set_object_callback( obj, hide_show, 0 ); x += dx + 5; obj = fl_add_button( FL_NORMAL_BUTTON, x, 565, 60, dy, "Exit" ); fl_set_object_callback( obj, exit_program, 0 ); fl_end_form(); fl_adjust_form_size( fdui->form ); fdui->form->fdui = fdui; return fdui; } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FD_form *fdui; FL_OBJECT *o; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); fdui = create_form( ); fl_clear_browser( fdui->br ); fl_add_browser_line( fdui->br, "LOAD A FILE." ); fl_set_browser_fontstyle( fdui->br,FL_FIXED_STYLE ); fl_show_form( fdui->form, FL_PLACE_FREE, FL_FULLBORDER, "Browser" ); o = fl_do_forms( ); fprintf( stderr, "%p %d %s\n", o, o->objclass, o->label ? o->label: "" ); fl_hide_form( fdui->form ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/choice.c0000644000175000017500000000636012252553040012465 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * This demo shows the use of choice objects. * * This file is part of xforms package * M. Overmars and T.C. Zhao (1997) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" FL_FORM *form; FL_OBJECT *sexobj, *childobj, *licenceobj, *marriedobj, *readyobj; /*************************************** ***************************************/ static void cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fprintf( stderr, "CallBack: %d\n", fl_get_choice( ob ) ); } /*************************************** ***************************************/ void create_form( void ) { form = fl_bgn_form( FL_NO_BOX, 420, 360 ); fl_add_box( FL_UP_BOX, 0, 0, 420, 360, "" ); fl_add_input( FL_NORMAL_INPUT, 70, 300, 320, 30, "Name" ); fl_add_input( FL_NORMAL_INPUT, 70, 260, 320, 30, "Address" ); fl_add_input( FL_NORMAL_INPUT, 70, 220, 320, 30, "City" ); fl_add_input( FL_NORMAL_INPUT, 70, 180, 320, 30, "Country" ); sexobj = fl_add_choice( FL_NORMAL_CHOICE, 70, 130, 110, 30, "Sex"); fl_set_choice_notitle( sexobj, 1 ); fl_set_object_shortcut( sexobj, "S", 1 ); childobj = fl_add_choice( FL_NORMAL_CHOICE2, 280, 130, 110, 30, "Children" ); licenceobj = fl_add_choice( FL_NORMAL_CHOICE, 280, 80, 110, 30, "Licence" ); fl_set_choice_align_bottom( licenceobj, 1 ); marriedobj = fl_add_choice( FL_DROPLIST_CHOICE, 70, 80, 110, 27, "Married" ); fl_set_object_callback( marriedobj, cb, 0 ); fl_set_object_boxtype( marriedobj, FL_UP_BOX ); readyobj = fl_add_button( FL_NORMAL_BUTTON, 150, 20, 140, 30, "Quit" ); fl_end_form( ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_flip_yorigin( ); fl_initialize( &argc, argv, "FormDemo", 0, 0 ); create_form( ); fl_addto_choice( sexobj,"Male" ); fl_addto_choice( sexobj,"Female" ); fl_addto_choice( childobj, "Zero|One|Two|Three|Four|Many" ); fl_addto_choice( licenceobj, "Yes|No" ); fl_addto_choice( marriedobj, "Yes" ); fl_addto_choice( marriedobj, "No" ); fl_show_form( form, FL_PLACE_CENTER | FL_FREE_SIZE, FL_TRANSIENT, "ChoiceDemo" ); while ( fl_do_forms( ) != readyobj ) /* empty */ ; fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/counter.c0000644000175000017500000000610412251644162012713 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * This is an example of the use of counters. * * This file is part of xforms package * T.C. Zhao and M. Overmars */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" FL_FORM *form; FL_OBJECT *result, *co[ 3 ]; /*************************************** ***************************************/ void color_change( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { int c[ 3 ]; int i; for ( i = 0; i < 3; i++ ) c[ i ] = fl_get_counter_value( co[ i ] ); fl_mapcolor( FL_FREE_COL1, c[ 0 ], c[ 1 ], c[ 2 ] ); fl_redraw_object( result ); } /*************************************** ***************************************/ void create_form_form( void ) { FL_OBJECT *obj; form = fl_bgn_form( FL_NO_BOX, 480, 200 ); fl_add_box( FL_UP_BOX, 0, 0, 480, 200, "" ); result = obj = fl_add_box( FL_DOWN_BOX, 310, 20, 150, 160, "" ); fl_set_object_dblbuffer( result, 1 ); co[ 0 ] = obj = fl_add_counter( FL_NORMAL_COUNTER, 20, 20, 270, 30, "" ); fl_set_object_color( obj, FL_INDIANRED, FL_RED ); fl_set_object_callback( obj, color_change, 0 ); co[ 1 ] = obj = fl_add_counter( FL_NORMAL_COUNTER, 20, 60, 270, 30, "" ); fl_set_object_color( obj, FL_PALEGREEN, FL_GREEN ); fl_set_object_callback( obj, color_change, 0 ); co[ 2 ] = obj = fl_add_counter( FL_NORMAL_COUNTER, 20, 100, 270, 30, "" ); fl_set_object_color( obj, FL_SLATEBLUE, FL_BLUE ); fl_set_object_callback( obj, color_change, 0 ); fl_add_button( FL_NORMAL_BUTTON, 100, 150, 110, 30, "Exit" ); fl_end_form( ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { int i; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); create_form_form( ); fl_set_object_color( result, FL_FREE_COL1, FL_FREE_COL1 ); for ( i = 0; i < 3; i++ ) { fl_set_counter_bounds( co[ i ], 0.0, 255.0 ); fl_set_counter_step( co[ i ], 1.0, 10.0 ); fl_set_counter_precision( co[ i ], 0 ); fl_set_counter_return( co[ i ], 1 ); } fl_call_object_callback( co[ 0 ] ); fl_show_form( form, FL_PLACE_CENTER, FL_TRANSIENT, "Counter" ); fl_do_forms( ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/minput2.c0000644000175000017500000001017212251643601012627 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Input return setting and raw callback. Terrible hack. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include extern void howreturn_callback( FL_OBJECT *, long ); extern void input_callback( FL_OBJECT *, long ); /**** Forms and Objects ****/ typedef struct { FL_FORM * inputform; void * vdata; long ldata; FL_OBJECT * input1; FL_OBJECT * howreturn; FL_OBJECT * status; FL_OBJECT * input2; } FD_inputform; extern FD_inputform *create_form_inputform( void ); /* end of minput.h */ FD_inputform *ui; /*************************************** ***************************************/ int peek_event( FL_FORM * form FL_UNUSED_ARG, void * xev ) { if ( ( ( XEvent * )xev )->type == KeyPress ) { fl_set_object_label( ui->status, "keyboard input" ); fl_XFlush( ); /* necessary to show the label? */ fl_msleep( 50 ); } return 0; } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_initialize( &argc, argv, "FormDemo", 0, 0 ); ui = create_form_inputform( ); fl_register_raw_callback( ui->inputform, KeyPressMask, peek_event ); fl_show_form( ui->inputform, FL_PLACE_CENTER, FL_TRANSIENT, "Input" ); fl_do_forms( ); fl_finish( ); return 0; } /*************************************** ***************************************/ void input_callback( FL_OBJECT * ob FL_UNUSED_ARG, long data ) { char buf[ 32 ]; sprintf( buf, "Input%ld returned", data ); fl_set_object_label( ui->status, buf ); fl_XFlush( ); fl_msleep( 50 ); } /*************************************** ***************************************/ void howreturn_callback( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_set_input_return( ui->input1, fl_get_button( ob ) ); fl_set_input_return( ui->input2, fl_get_button( ob ) ); } /*************************************** ***************************************/ FD_inputform * create_form_inputform( void ) { FL_OBJECT *obj; FD_inputform *fdui = fl_calloc( 1, sizeof *fdui ); fdui->inputform = fl_bgn_form( FL_NO_BOX, 475, 485 ); fl_add_box( FL_UP_BOX, 0, 0, 475, 485, "" ); fdui->input1 = obj = fl_add_input( FL_MULTILINE_INPUT, 15, 275, 350, 180, "" ); fl_set_object_lalign( obj, FL_ALIGN_TOP ); fl_set_object_callback( obj, input_callback, 1 ); fdui->howreturn = obj = fl_add_checkbutton( FL_PUSH_BUTTON, 375, 435, 80, 35, "always\nreturn" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_object_callback( obj, howreturn_callback, 0 ); fdui->status = obj = fl_add_text( FL_NORMAL_TEXT, 20, 15, 270, 30, "" ); fl_set_object_boxtype( obj, FL_FRAME_BOX ); fl_add_button( FL_NORMAL_BUTTON, 375, 15, 80, 35, "Done" ); fdui->input2 = obj = fl_add_input( FL_MULTILINE_INPUT, 15, 60, 349, 185, "" ); fl_set_object_lalign( obj, FL_ALIGN_TOP ); fl_set_object_callback( obj, input_callback, 2 ); fl_end_form( ); return fdui; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/ndial.c0000664000175000017500000000605212353623325012330 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* This is an example of the use of dials. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" FL_FORM *form; FL_OBJECT * dials[ 3 ], * texts[ 3 ], * result; /*************************************** ***************************************/ void cb( FL_OBJECT * obj, long data ) { static int cols[ 3 ] = { 128, 128, 128 }; char str[ 4 ]; cols[ data ] = fl_get_dial_value( obj ); fl_mapcolor( FL_FREE_COL1, cols[ 0 ], cols[ 1 ], cols[ 2 ] ); fl_redraw_object( result ); sprintf( str, "%d", cols[ data ] ); fl_set_object_label( texts[ data ], str ); } /*************************************** ***************************************/ void makeform( void ) { FL_OBJECT *obj; const char *label[ 3 ] = { "Red", "Green", "Blue" }; FL_COLOR col[ 3 ] = { FL_RED, FL_GREEN, FL_BLUE }; int i; int y = 70; form = fl_bgn_form( FL_UP_BOX, 300, 330 ); obj = fl_add_button( FL_NORMAL_BUTTON, 45, 15, 210, 45, "Color Editor" ); fl_set_object_lsize( obj, FL_LARGE_SIZE ); for ( i = 0; i < 3; y += 85, i++ ) { dials[ i ] = obj = fl_add_dial( FL_NORMAL_DIAL, 30, y, 60, 60, label[ i ] ); fl_set_object_boxtype( obj, FL_UP_BOX ); fl_set_dial_bounds( obj, 0.0, 255.0 ); fl_set_dial_value( obj, 128.0 ); fl_set_object_color( obj, col[ i ], FL_DIAL_COL2 ); fl_set_object_callback( obj, cb, i ); fl_set_object_return( obj, FL_RETURN_CHANGED ); texts[ i ] = fl_add_box( FL_DOWN_BOX, 105, y + 17, 50, 25, "128" ); } result = fl_add_box( FL_DOWN_BOX, 180, 70, 90, 245, "" ); fl_set_object_color( result, FL_FREE_COL1, FL_FREE_COL1 ); fl_mapcolor( FL_FREE_COL1, 128, 128, 128 ); fl_set_object_dblbuffer( result, 1 ); /* to avoid flicker */ fl_end_form( ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_initialize( &argc, argv, "FormDemo", 0, 0 ); makeform( ); fl_show_form( form, FL_PLACE_MOUSE, FL_TRANSIENT, "A Form" ); fl_do_forms( ); fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/popup.c0000644000175000017500000002203412251643524012400 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * popup tester * * This file is part of xforms package * T.C. Zhao and Mark Overmars */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" typedef struct { FL_FORM * pupform; void * vdata; char * cdata; long ldata; FL_OBJECT * menu; FL_OBJECT * button; FL_OBJECT * choice; FL_OBJECT * status; FL_OBJECT * done_cb; } FD_pupform; extern FD_pupform * create_form_pupform( void ); extern void menu_callback( FL_OBJECT *, long ); extern void dopup_callback( FL_OBJECT *, long ); extern void choice_callback( FL_OBJECT *, long ); static void init_menu( FL_OBJECT * ); static void init_choice( FL_OBJECT * ); FD_pupform *fd_pupform; /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { fl_initialize( &argc, argv, 0, 0, 0 ); fd_pupform = create_form_pupform( ); /* fill-in form initialization code */ init_menu( fd_pupform->menu ); init_choice( fd_pupform->choice ); /* show the first form */ fl_show_form( fd_pupform->pupform, FL_PLACE_CENTER, FL_FULLBORDER, "pupform" ); fl_do_forms( ); return 0; } /********* MENU ***********************************************/ /*************************************** ***************************************/ void menu_callback( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_pupform *fdui = ob->form->fdui; char buf[ 128 ]; sprintf( buf, "item %d (%s) selected", fl_get_menu( ob ), fl_get_menu_text( ob ) ); fl_set_object_label( fdui->status, buf ); } /* menu initialization entries. No callbacks for the item */ FL_PUP_ENTRY menu_entries[ ] = { { "Menu Item 1", NULL, NULL, 0 }, { "Menu Item 2", NULL, NULL, 0 }, { "_Menu Item 3", NULL, NULL, 0 }, { "/_Menu Item 4", NULL, NULL, 0 }, { "Menu Item 5", NULL, NULL, 0 }, { "Menu Item 6", NULL, NULL, 0 }, { "/Menu Item 7", NULL, NULL, 0 }, { "Menu Item 8", NULL, NULL, 0 }, { "/Menu Item 9", NULL, NULL, 0 }, { "Menu Item 10", NULL, NULL, 0 }, { "Menu Item 11", NULL, NULL, 0 }, { NULL, NULL, NULL, 0 }, { "Menu Item 13", NULL, NULL, 0 }, { NULL, NULL, NULL, 0 }, { NULL, NULL, NULL, 0 }, { "Menu Item 15", NULL, NULL, 0 }, { "menu Item 16", NULL, NULL, 0 }, { "menu Item 17", NULL, NULL, 0 }, { NULL, NULL, NULL, 0 } }; /*************************************** ***************************************/ static void menuitem_entercb( int n, void * data ) { char buf[ 128 ]; FD_pupform *fdui = data; sprintf( buf, "Entered %d (%s)", n, fl_get_menu_item_text( fdui->menu, n ) ); fl_set_object_label( fdui->status, buf ); } /*************************************** ***************************************/ static void init_menu( FL_OBJECT *menu ) { /* if no entercb is desired, set_menu_entries is much simpler */ #if 0 fl_set_menu_entries( menu, menu_entries ); #else int n = fl_newpup( FL_ObjWin( menu ) ); fl_setpup_entries( n, menu_entries ); fl_setpup_entercb( n, menuitem_entercb, menu->form->fdui ); // fl_setpup_bw( n, -2 ); fl_set_menu_popup( menu, n ); #endif } /*********** End of menu *************************/ /******* PopUP ***********************************/ static int pupID = -1; /*************************************** ***************************************/ static int pupitem_cb( int selected ) { char buf[ 128 ]; sprintf( buf,"Item %d (%s) selected", selected, fl_getpup_text( pupID, selected ) ); fl_set_object_label( fd_pupform->status, buf ); return selected; } FL_PUP_ENTRY pup_entries[ ] = { { "Popup item 1", pupitem_cb, "1", FL_PUP_RADIO }, { "Popup Item 2", pupitem_cb, "2", FL_PUP_RADIO }, { "Popup Item 3", pupitem_cb, "3", FL_PUP_RADIO }, { "/Popup Item 4", pupitem_cb, "4", FL_PUP_NONE }, { "Popup Item 5", pupitem_cb, NULL, FL_PUP_GRAY }, { "Popup Item 6", pupitem_cb, NULL, 0 }, { "Popup Item 7", pupitem_cb, NULL, 0 }, { "Popup Item 8", pupitem_cb, NULL, 0 }, { NULL, NULL, NULL, 0 }, { "Popup Item 10", pupitem_cb, NULL, FL_PUP_GRAY }, { "Popup Item 11", pupitem_cb, NULL, 0 }, { NULL, NULL, NULL, 0 } }; /*************************************** ***************************************/ static void pup_entercb( int n, void * data) { FD_pupform *fdui = data; char buf[ 128 ]; sprintf( buf, "Entered %d (%s)", n, pup_entries[ n - 1 ].text ); fl_set_object_label( fdui->status, buf ); } /*************************************** ***************************************/ void dopup_callback( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { if ( pupID < 0 ) { pupID = fl_newpup( FL_ObjWin( ob ) ); #if 0 int subm; subm = fl_newpup( FL_ObjWin( ob ) ); #else fl_setpup_entries( pupID, pup_entries ); #endif #if 0 fl_addtopup( pupID, "Popup item 1%f%s%R1", pupitem_cb, "1" ); fl_addtopup( pupID, "Popup item 2%f%s%r1", pupitem_cb, "2" ); fl_addtopup( pupID, "Popup item 3%l%f%s%r1", pupitem_cb, "3" ); fl_addtopup( pupID, "Popup item 4%l%f%s%m", pupitem_cb, "4", subm ); fl_addtopup( subm, "Popup Item 5%f%x5", pupitem_cb ); fl_addtopup( subm, "Popup Item 6%f%x6", pupitem_cb ); fl_addtopup( subm, "Popup Item 7%f%x7", pupitem_cb ); fl_addtopup( subm, "Popup Item 8%f%x8", pupitem_cb ); fl_addtopup( pupID, "Popup item 9%x9%f%i", pupitem_cb ); fl_addtopup( pupID, "Popup item 10%x10%f", pupitem_cb ); #endif fl_setpup_entercb( pupID, pup_entercb, ob->form->fdui ); #if 0 fl_setpup_entercb( subm, pup_entercb, ob->form->fdui ); #endif } /* since each item has its own callback, ignore the return value */ fl_dopup( pupID ); } /********* End of pup *****************/ /*************************************** ***************************************/ static void init_choice( FL_OBJECT *ob ) { fl_addto_choice( ob,"Choice1|Choice2|Choice3" ); fl_addto_choice( ob,"Choice4|Choice5|Choice6" ); fl_addto_choice( ob,"Choice7|Choice8|Choice9" ); } /*************************************** ***************************************/ void choice_callback( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { char buf[ 128 ]; FD_pupform *fdui = ob->form->fdui; sprintf( buf, "%d (%s) selected", fl_get_choice( ob ), fl_get_choice_text( ob ) ); fl_set_object_label( fdui->status, buf ); } /* Form definition file generated with fdesign. */ #include /*************************************** ***************************************/ FD_pupform * create_form_pupform( void ) { FL_OBJECT *obj; FD_pupform *fdui = fl_calloc( 1, sizeof *fdui ); fdui->pupform = fl_bgn_form( FL_NO_BOX, 320, 250 ); fl_add_box( FL_UP_BOX, 0, 0, 320, 250, "" ); fdui->menu = obj = fl_add_menu( FL_PULLDOWN_MENU, 20, 90, 60, 30, "Menu" ); fl_set_object_boxtype( obj, FL_FLAT_BOX ); fl_set_object_callback( obj, menu_callback, 0 ); fl_set_object_shortcut( obj, "#MM", 1 ); fdui->button = obj = fl_add_button( FL_MENU_BUTTON, 100, 90, 75, 30, "Button" ); fl_set_object_callback( obj, dopup_callback, 0 ); fl_set_object_shortcut( obj, "#BB", 1 ); fdui->choice = obj = fl_add_choice( FL_NORMAL_CHOICE2, 195, 90, 105, 30, "" ); fl_set_object_callback( obj, choice_callback, 0 ); fdui->status = obj = fl_add_text( FL_NORMAL_TEXT, 25, 30, 265, 30, "" ); fl_set_object_boxtype( obj, FL_FRAME_BOX ); fl_set_object_lalign( obj, FL_ALIGN_CENTER ); fl_set_object_dblbuffer( obj, 1 ); fdui->done_cb = obj = fl_add_button( FL_NORMAL_BUTTON, 210, 200, 85, 30, "Done" ); fl_end_form( ); fl_adjust_form_size( fdui->pupform ); fdui->pupform->fdui = fdui; return fdui; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/demo.menu0000664000175000017500000000660412340166201012701 00000000000000# Menu description file for the generic demo program # # Each line consists of three fields, separated by : # # - menu name : To which the item belongs (starts with @) # - item name : Placed on button. (use \n for newline) # - command name: To be executed. Use a menu name to define a submenu. # # @main indicates the main menu. # @main:Simple\nDemos:@simple @simple:Push Me:pushme @simple:A Question:yesno @simple:A Slider:demo05 @simple:Input\nFields:demo06 @main:Object\nClasses:@objects @objects:Buttons:@buttons @buttons:Push\nButtons:pushbutton @buttons:Touch\nButtons:touchbutton @buttons:Different\nButtons:buttonall @buttons:Button\nTypes:butttypes @buttons:Arrow\nButtons:arrowbutton @buttons:Radio\nButtons:demo06 @objects:Sliders\nand\nScrollbars:@sliders @sliders:Simple\nSlider:demo05 @sliders:Inverted\nSlider:invslider @sliders:All\nSliders\nTypes:sliderall @sliders:All\nScrollbars\nTypes:scrollbar @sliders:Non-Active\nSlider:sldinactive @sliders:Slider\nSize:sldsize @objects:Input\nFields:@input @input:Simple\nInput:demo06 @input:Multiline\nInput:minput @input:Secret\nInput:secretinput @input:All\nInput:inputall @objects:Browsers:@browsers @browsers:Simple\nBrowser:fbrowse1 @browsers:Browser\nTypes:browserall @browsers:Changing\nBrowser\nLines:browserop @objects:Charts:@chart @chart:All\nCharts:chartall @chart:Strip\nCharts:chartstrip @objects:Tabbed\nFolder:folder @objects:Dial:@dial @dial:Normal\nDial:ndial @dial:Fill\nDial:fdial @dial:Line\nDial:ldial @objects:Counter:@counter @counter:Normal\nCounter:counter @objects:Other\nObjects:@other @other:Menus\nAnd\nChoices:@menu @menu:Nmenu:nmenu @menu:Select:select @menu:Choice\n(deprecated):choice @other:Canvas:@canvas @canvas:Normal\nCanvas:canvas @canvas:OpenGL\nCanvas:gl @other:Positioner:@positioner @positioner:Normal\nPositioner:positioner @positioner:Overlay\nPositioner:positioner_overlay @other:XYPlot:@xyplot @xyplot:XYPlot\nTypes:xyplotall @xyplot:Active\nXYPlot:xyplotactive @xyplot:Overlayed\nXYPlot:xyplotover @other:PopUp\nMenus:pup @other:Timer\nObjects:@Timer @Timer:Timer:timer @Timer:Timer\nAccuracy:timerprec @other:New Object:newbutton @other:Free\nObject:free1 @other:More\nObjects:@more @more:Bitmaps:demo33 @main:Attributes:@attribs @attribs:All\nBoxtypes:boxtype @attribs:Border\nWidth:borderwidth @attribs:All\nSymbols:symbols @attribs:Fonts and\nSizes:fonts @attribs:Scaling\nForms:rescale @attribs:Multi-Line\nLabels:multilabel @attribs:Long\nLabels:longlabel @attribs:Activating\nObjects:objinactive @attribs:Label\nAlign:lalign @main:Goodies:@goodies @goodies:Simple\nGoodies:goodies # @goodies:Soft\nButtonbox:demo26 @main:Nice\nDemos:@nice @nice:Drawing\nProgram:demo27 @nice:File\nBrowser:fbrowse @nice:Color\nEditor:ldial @nice:Nicer\nDrawing\nProgram:freedraw @nice:Color\nMap:colsel1 @nice:Color\nBrowser:colbrowser @nice:Pixmap\nBrowser:pmbrowse @nice:WWW\nbrowser\nLauncher:wwwl @main:Miscellaneous\nDemos:@Misc @Misc:Iconify\nvia WM:iconify @Misc:Cursor:cursor @Misc:Preemptive\nHandler:preemptive @Misc:Object\nReturn\nBehaviour:objreturn @Misc:Move\nObject:objpos @Misc:Object\nGroups:group @Misc:Form\nResizing:grav xforms-1.2.4/demos/secretinput.c0000644000175000017500000000415212251643407013603 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* Demo showing secret input fields */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FL_FORM *form; FL_OBJECT *but, *password1, *password2, *info; char str[ 256 ]; fl_initialize( &argc, argv, "FormDemo", 0, 0 ); form = fl_bgn_form( FL_UP_BOX, 400, 300 ); password1 = fl_add_input( FL_SECRET_INPUT, 140, 40, 160, 40, "Password 1:" ); fl_set_object_return( password1, FL_RETURN_CHANGED ); password2 = fl_add_input( FL_SECRET_INPUT, 140, 100, 160, 40, "Password 2:" ); fl_set_object_return( password2, FL_RETURN_CHANGED ); info = fl_add_box( FL_SHADOW_BOX, 20, 160, 360, 60, "" ); but = fl_add_button( FL_NORMAL_BUTTON, 280, 240, 100, 40, "Quit" ); fl_end_form( ); fl_show_form( form, FL_PLACE_MOUSE, FL_FULLBORDER, "Secret Input Demo" ); while ( fl_do_forms( ) != but ) { sprintf( str, "Password 1 is: %s\n, Password 2 is: %s", fl_get_input( password1 ), fl_get_input( password2 ) ); fl_set_object_label( info, str ); } fl_finish( ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/Makefile.am0000664000175000017500000001554612353623325013141 00000000000000include $(top_srcdir)/config/common.am EXTRA_DIST = Readme iconvert.1 demo.menu crossbut.h \ bm1.xbm bm2.xbm newmail.xbm nomail.xbm picture.xbm srs.xbm \ crab45.xpm crab_tran.xpm crab.xpm porsche.xpm \ test.xpm xconq.xpm xterm.xpm colorwheel.xpm SUBDIRS = fd SUFFIXES = .fd .c INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/lib $(X_CFLAGS) if BUILD_GL GL = gl glwin else GL = endif noinst_PROGRAMS = \ arrowbutton \ borderwidth \ boxtype \ browserall \ browserop \ buttonall \ butttypes \ canvas \ chartall \ chartstrip \ choice \ colbrowser \ colsel \ colsel1 \ counter \ cursor \ demo \ demo05 \ demo06 \ demo27 \ demo33 \ demotest \ demotest2 \ demotest3 \ dirlist \ fbrowse \ fbrowse1 \ fdial \ flclock \ folder \ fonts \ formbrowser \ free1 \ freedraw \ freedraw_leak \ $(GL) \ goodies \ grav \ group \ ibrowser \ iconify \ iconvert \ inputall \ invslider \ itest \ lalign \ ldial \ ll \ longlabel \ menu \ minput \ minput2 \ multilabel \ ndial \ newbutton \ new_popup \ nmenu \ objinactive \ objpos \ objreturn \ pmbrowse \ popup \ positioner \ positioner_overlay \ positionerXOR \ preemptive \ pup \ pushbutton \ pushme \ rescale \ scrollbar \ secretinput \ select \ sld_alt \ sld_radio \ sldinactive \ sldsize \ sliderall \ strange_button \ strsize \ symbols \ thumbwheel \ timer \ timerprec \ timeoutprec \ touchbutton \ xyplotactive \ xyplotactivelog \ xyplotall \ xyplotover \ yesno \ yesno_cb # menubar # Most of these demos link against libforms only. For them this default is # sufficient: LDFLAGS = ../lib/libforms.la $(X_LIBS) $(X_PRE_LIBS) $(LIBS) $(X_EXTRA_LIBS) arrowbutton_SOURCES = arrowbutton.c borderwidth_SOURCES = borderwidth.c boxtype_SOURCES = boxtype.c browserall_SOURCES = browserall.c browserop_SOURCES = browserop.c buttonall_SOURCES = buttonall.c nodist_buttonall_SOURCES = fd/buttons_gui.c fd/buttons_gui.h buttonall.$(OBJEXT): fd/buttons_gui.c butttypes_SOURCES = butttypes.c nodist_butttypes_SOURCES = fd/butttypes_gui.c fd/butttypes_gui.h butttypes.$(OBJEXT): fd/butttypes_gui.c canvas_SOURCES = canvas.c canvas_LDADD = ../lib/libforms.la \ $(X_LIBS) $(X_PRE_LIBS) -lX11 $(LIBS) $(X_EXTRA_LIBS) chartall_SOURCES = chartall.c chartstrip_SOURCES = chartstrip.c choice_SOURCES = choice.c colbrowser_SOURCES = colbrowser.c colsel_SOURCES = colsel.c colsel1_SOURCES = colsel1.c counter_SOURCES = counter.c cursor_SOURCES = cursor.c demo_SOURCES = demo.c demo05_SOURCES = demo05.c demo06_SOURCES = demo06.c demo27_SOURCES = demo27.c demo27_LDADD = ../lib/libforms.la \ $(X_LIBS) $(X_PRE_LIBS) -lX11 $(LIBS) $(X_EXTRA_LIBS) demo33_SOURCES = demo33.c demotest_SOURCES = demotest.c nodist_demotest_SOURCES = fd/folder_gui.c fd/folder_gui.h demotest.$(OBJEXT): fd/folder_gui.c demotest2_SOURCES = demotest2.c demotest3_SOURCES = demotest3.c dirlist_SOURCES = dirlist.c nodist_dirlist_SOURCES = fd/fbtest_gui.c fd/fbtest_gui.h dirlist.$(OBJEXT): fd/fbtest_gui.c fbrowse_SOURCES = fbrowse.c fbrowse1_SOURCES = fbrowse1.c fdial_SOURCES = fdial.c flclock_SOURCES = flclock.c folder_SOURCES = folder.c nodist_folder_SOURCES = fd/folder_gui.c fd/folder_gui.h folder.$(OBJEXT): fd/folder_gui.c fonts_SOURCES = fonts.c formbrowser_SOURCES = formbrowser.c nodist_formbrowser_SOURCES = fd/formbrowser_gui.c fd/formbrowser_gui.h formbrowser.$(OBJEXT): fd/formbrowser_gui.c free1_SOURCES = free1.c freedraw_SOURCES = freedraw.c freedraw_LDADD = ../lib/libforms.la \ $(X_LIBS) $(X_PRE_LIBS) -lX11 $(LIBS) $(X_EXTRA_LIBS) freedraw_leak_SOURCES = freedraw_leak.c freedraw_leak_LDADD = ../lib/libforms.la \ $(X_LIBS) $(X_PRE_LIBS) -lX11 $(LIBS) $(X_EXTRA_LIBS) gl_SOURCES = gl.c gl_LDADD = ../gl/libformsGL.la ../lib/libforms.la \ $(X_LIBS) $(X_PRE_LIBS) -lGL -lX11 $(LIBS) $(X_EXTRA_LIBS) glwin_SOURCES = glwin.c glwin_LDADD = ../gl/libformsGL.la ../lib/libforms.la \ $(X_LIBS) $(X_PRE_LIBS) -lGL -lX11 $(LIBS) $(X_EXTRA_LIBS) goodies_SOURCES = goodies.c grav_SOURCES = grav.c group_SOURCES = group.c ibrowser_SOURCES = ibrowser.c ibrowser.$(OBJEXT): fd/ibrowser_gui.c ibrowser_LDADD = ../image/libflimage.la ../lib/libforms.la \ $(X_LIBS) $(X_PRE_LIBS) $(JPEG_LIB) $(XPM_LIB) -lX11 $(LIBS) \ $(X_EXTRA_LIBS) iconify_SOURCES = iconify.c iconvert_SOURCES = iconvert.c iconvert_LDADD = ../image/libflimage.la ../lib/libforms.la \ $(X_LIBS) $(X_PRE_LIBS) $(JPEG_LIB) $(XPM_LIB) -lX11 $(LIBS) \ $(X_EXTRA_LIBS) inputall_SOURCES = inputall.c nodist_inputall_SOURCES = fd/inputall_gui.c fd/inputall_gui.h inputall.$(OBJEXT): fd/inputall_gui.c invslider_SOURCES = invslider.c itest_SOURCES = itest.c itest.$(OBJEXT): fd/is_gui.c itest_LDADD = ../image/libflimage.la ../lib/libforms.la \ $(X_LIBS) $(X_PRE_LIBS) $(JPEG_LIB) $(XPM_LIB) -lX11 $(LIBS) \ $(X_EXTRA_LIBS) lalign_SOURCES = lalign.c ldial_SOURCES = ldial.c ll_SOURCES = ll.c ll_LDADD = ../image/libflimage.la ../lib/libforms.la \ $(X_LIBS) $(X_PRE_LIBS) $(JPEG_LIB) $(XPM_LIB) -lX11 $(LIBS) \ $(X_EXTRA_LIBS) longlabel_SOURCES = longlabel.c menu_SOURCES = menu.c #menubar_SOURCES = menubar.c minput_SOURCES = minput.c minput2_SOURCES = minput2.c multilabel_SOURCES = multilabel.c ndial_SOURCES = ndial.c newbutton_SOURCES = newbutton.c crossbut.c new_popup_SOURCES = new_popup.c nmenu_SOURCES = nmenu.c objinactive_SOURCES = objinactive.c objpos_SOURCES = objpos.c objreturn_SOURCES = objreturn.c pmbrowse_SOURCES = pmbrowse.c nodist_pmbrowse_SOURCES = fd/pmbrowse_gui.c fd/pmbrowse_gui.h pmbrowse.$(OBJEXT): fd/pmbrowse_gui.c popup_SOURCES = popup.c positioner_SOURCES = positioner.c positioner_overlay_SOURCES = positioner_overlay.c positionerXOR_SOURCES = positionerXOR.c preemptive_SOURCES = preemptive.c pup_SOURCES = pup.c pushbutton_SOURCES = pushbutton.c pushme_SOURCES = pushme.c rescale_SOURCES = rescale.c scrollbar_SOURCES = scrollbar.c nodist_scrollbar_SOURCES = fd/scrollbar_gui.c fd/scrollbar_gui.h scrollbar.$(OBJEXT): fd/scrollbar_gui.c secretinput_SOURCES = secretinput.c select_SOURCES = select.c sld_alt_SOURCES = sld_alt.c sld_radio_SOURCES = sld_radio.c sldinactive_SOURCES = sldinactive.c sldsize_SOURCES = sldsize.c sliderall_SOURCES = sliderall.c strange_button_SOURCES = strange_button.c strsize_SOURCES = strsize.c symbols_SOURCES = symbols.c thumbwheel_SOURCES = thumbwheel.c nodist_thumbwheel_SOURCES = fd/twheel_gui.c fd/twheel_gui.h thumbwheel.$(OBJEXT): fd/twheel_gui.c timer_SOURCES = timer.c timerprec_SOURCES = timerprec.c timeoutprec_SOURCES = timeoutprec.c touchbutton_SOURCES = touchbutton.c xyplotactive_SOURCES = xyplotactive.c xyplotactivelog_SOURCES = xyplotactivelog.c xyplotall_SOURCES = xyplotall.c xyplotover_SOURCES = xyplotover.c xyplotover_LDADD = ../image/libflimage.la ../lib/libforms.la \ $(X_LIBS) $(X_PRE_LIBS) $(JPEG_LIB) $(XPM_LIB) -lX11 $(LIBS) \ $(X_EXTRA_LIBS) yesno_SOURCES = yesno.c yesno_cb_SOURCES = yesno_cb.c .fd.c: ../fdesign/fdesign ../fdesign/fdesign -convert -dir $(top_srcdir)/demos/fd -I \"include/forms.h\" $< xforms-1.2.4/demos/bm1.xbm0000644000175000017500000000043611665175611012267 00000000000000#define bm1_width 16 #define bm1_height 16 static unsigned char bm1_bits[] = { 0x00, 0x00, 0x00, 0x57, 0x7c, 0x72, 0xc4, 0x52, 0xc4, 0x00, 0x44, 0x01, 0x44, 0x1f, 0xfc, 0x22, 0x40, 0x42, 0x40, 0x44, 0x40, 0x43, 0xc0, 0x40, 0x70, 0x40, 0x8c, 0x20, 0x00, 0x1f, 0x00, 0x00 }; xforms-1.2.4/demos/fd/0000775000175000017500000000000012353624653011550 500000000000000xforms-1.2.4/demos/fd/Makefile.in0000664000175000017500000002520512353624173013536 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/common.am subdir = demos/fd ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FL_FIXLEVEL = @FL_FIXLEVEL@ FL_REVISION = @FL_REVISION@ FL_VERSION = @FL_VERSION@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIB = @JPEG_LIB@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ TEXI2DVI = @TEXI2DVI@ TEXI2DVI_NEEDS_PDF = @TEXI2DVI_NEEDS_PDF@ TEXI2HTML = @TEXI2HTML@ VERSION = @VERSION@ XMKMF = @XMKMF@ XPM_LIB = @XPM_LIB@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign DISTCLEANFILES = *.orig *.rej *~ *.bak core makelog MAINTAINERCLEANFILES = $(srcdir)/Makefile.in makelog AM_INSTALL_DATA_FLAGS = $(INSTALL) -m 644 -D CLEANFILES = *.bak *.[ch] INCLUDE = $(top_srcdir)/lib EXTRA_DIST = \ dim_porsche.xpm \ porsche.xpm \ buttons_gui.fd \ butttypes_gui.fd \ fbtest_gui.fd \ folder_gui.fd \ formbrowser_gui.fd \ ibrowser_gui.fd \ inputall_gui.fd \ is_gui.fd \ pmbrowse_gui.fd \ scrollbar_gui.fd \ twheel_gui.fd all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/common.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/fd/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/fd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/common.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: xforms-1.2.4/demos/fd/ibrowser_gui.fd0000664000175000017500000003071212236225404014475 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL Border Width: -2 SnapGrid: 5 =============== FORM =============== Name: ibcanvas Width: 945 Height: 730 Number of Objects: 36 -------------------- class: FL_BOX type: FL_UP_BOX box: 0 0 945 730 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CANVAS type: FL_NORMAL_CANVAS box: 15 50 770 630 boxtype: FL_DOWN_BOX colors: FL_NoColor FL_BLACK alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthWest FL_SouthEast name: canvas callback: argument: -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 830 35 70 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: File shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthEast FL_NorthEast name: callback: browse_file argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 850 695 70 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Quit shortcut: Qq#Q^[ resize: FL_RESIZE_ALL gravity: FL_SouthEast FL_SouthEast name: callback: quit_callback argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 873 100 60 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: B&\W shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthEast FL_NorthEast name: callback: convert_type argument: FL_IMAGE_MONO -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 813 130 60 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Gray shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthEast FL_NorthEast name: callback: convert_type argument: FL_IMAGE_GRAY -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 873 70 60 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: RGB shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthEast FL_NorthEast name: callback: convert_type argument: FL_IMAGE_RGB -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 813 70 60 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Packed shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthEast FL_NorthEast name: callback: convert_type argument: FL_IMAGE_PACKED -------------------- class: FL_TEXT type: FL_NORMAL_TEXT box: 20 10 760 33 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_X gravity: FL_NorthWest FL_NoGravity name: text callback: argument: -------------------- class: FL_TEXT type: FL_NORMAL_TEXT box: 10 690 230 30 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_SouthWest FL_SouthWest name: status callback: argument: -------------------- class: FL_TEXT type: FL_NORMAL_TEXT box: 245 690 475 30 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_X gravity: FL_SouthWest FL_SouthEast name: error callback: argument: -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 830 440 80 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Write shortcut: resize: FL_RESIZE_ALL gravity: FL_SouthEast FL_SouthEast name: callback: write_image argument: 0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 818 477 109 27 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_SouthEast FL_SouthEast name: format callback: argument: -------------------- class: FL_VALSLIDER type: FL_HOR_BROWSER_SLIDER box: 800 575 135 20 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_SouthEast FL_SouthEast name: xfloat callback: argument: return: FL_RETURN_END_CHANGED bounds: 0 5 precision: 1 value: 1 step: 0.1 -------------------- class: FL_VALSLIDER type: FL_HOR_BROWSER_SLIDER box: 800 595 135 20 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_SouthEast FL_SouthEast name: yfloat callback: argument: return: FL_RETURN_END_CHANGED bounds: 0 5 precision: 1 value: 1 step: 0.1 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 800 620 50 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Scale shortcut: resize: FL_RESIZE_ALL gravity: FL_SouthEast FL_SouthEast name: callback: scale_image argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 835 540 75 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Rotate shortcut: resize: FL_RESIZE_ALL gravity: FL_SouthEast FL_SouthEast name: callback: rotate_image argument: 0 -------------------- class: FL_COUNTER type: FL_NORMAL_COUNTER box: 825 515 100 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_SouthEast FL_SouthEast name: angle callback: argument: bounds: -180 180 precision: 0 sstep: 1 lstep: 5 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 815 655 40 26 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: FlipX shortcut: resize: FL_RESIZE_ALL gravity: FL_SouthEast FL_SouthEast name: callback: flip_image argument: 'y' -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 865 655 40 27 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: FlipY shortcut: resize: FL_RESIZE_ALL gravity: FL_SouthEast FL_SouthEast name: callback: flip_image argument: 'x' -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 813 100 60 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: CI shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthEast FL_NorthEast name: callback: convert_type argument: FL_IMAGE_CI -------------------- class: FL_CHECKBUTTON type: FL_PUSH_BUTTON box: 850 615 30 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: AA shortcut: resize: FL_RESIZE_ALL gravity: FL_SouthEast FL_SouthEast name: anti_aliasing callback: argument: -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 720 690 70 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: comments shortcut: resize: FL_RESIZE_ALL gravity: FL_SouthEast FL_SouthEast name: comments callback: show_comments argument: 0 -------------------- class: FL_CHECKBUTTON type: FL_PUSH_BUTTON box: 815 290 30 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: SubImage shortcut: resize: FL_RESIZE_ALL gravity: FL_SouthEast FL_SouthEast name: subimage callback: argument: -------------------- class: FL_VALSLIDER type: FL_HOR_BROWSER_SLIDER box: 794 359 146 20 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: level shortcut: resize: FL_RESIZE_ALL gravity: FL_East FL_East name: level callback: window_level argument: 0 return: FL_RETURN_CHANGED bounds: 0 4095 precision: 0 value: 0 -------------------- class: FL_VALSLIDER type: FL_HOR_BROWSER_SLIDER box: 792 400 148 20 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: width shortcut: resize: FL_RESIZE_ALL gravity: FL_East FL_East name: width callback: window_level argument: 0 return: FL_RETURN_CHANGED bounds: 0 4095 precision: 0 value: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 803 168 64 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Sharpen shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthEast FL_NorthEast name: callback: convolve_it argument: (long)FL_SHARPEN -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 803 198 64 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Smooth shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthEast FL_NorthEast name: callback: convolve_it argument: (long)FL_SMOOTH -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 803 229 64 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Tint shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthEast FL_NorthEast name: callback: tint_it argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 867 228 69 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Smooth shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthEast FL_NorthEast name: callback: convolve_it argument: (long)FL_SMOOTH -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 867 198 69 29 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: HistoGram shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthEast FL_NorthEast name: callback: enhance_it argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 803 260 64 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Crop shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthEast FL_NorthEast name: callback: crop_it argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 868 260 69 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Border shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthEast FL_NorthEast name: callback: crop_it argument: 1 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 867 168 69 28 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Warp shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthEast FL_NorthEast name: callback: warp_it argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 805 320 55 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Annotate shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: annotate callback: annotate_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 865 320 55 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Render shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: render_cb argument: 0 ============================== create_the_forms xforms-1.2.4/demos/fd/porsche.xpm0000644000175000017500000001101511665175602013655 00000000000000/* XPM */ static char * porsche[] = { /* porsche pixmap * width height ncolors chars_per_pixel */ "64 64 4 1 ", " c None m None s s_slateblue ", ". c yellow m white s s_yellow ", "r c red m white s s_red ", "b c black m black s s_black ", /* pixels */ " ", " ", " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb............................................bb ", " bb..bbbb..bbbb..bbbb..bbbb..bbbb..b..b..bbbb..bb ", " bb..b..b..b..b..b..b..b..b..b..b..b..b..b.....bb ", " bb..b..b..b..b..b..b..b.....b.....b..b..b.....bb ", " bb..bbbb..b..b..bbb...bbbb..b.....bbbb..bbbb..bb ", " bb..b.....b..b..b..b.....b..b.....b..b..b.....bb ", " bb..b.....b..b..b..b..b..b..b..b..b..b..b.....bb ", " bb..b.....bbbb..b..b..bbbb..bbbb..b..b..bbbb..bb ", " bb............................................bb ", " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb.....................bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb......b...b...bb.....bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb.....b...b...b....b..bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb....bb..bb.bbbbbbb...bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb...bbbbbbbb......bb..bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb..bbbb...............bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb.bbb.................bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb..........b..b.......bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb.....b...b..b........bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb....b...b..b..bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb....b.bbbbbbbbb..............bbbbbbbbbbbbbbbbb ", " bb...bbbb.......bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb..bbb.........b..............bbbbbbbbbbbbbbbbb ", " bb.bbb..........b...bbb........bbbbbbbbbbbbbbbbb ", " bb.........b..b.b..bbbbb.......bbbbbbbbbbbbbbbbb ", " bb.....b..b..b..b..b.bbb.....b.brrrrrrrrrrrrrrbb ", " bb....b..b..b..bb....bbb....bb.brrrrrrrrrrrrrrbb ", " bb...bb.bbbbbbb.b....bbb....bb.brrrrrrrrrrrrrrbb ", " bb..bbbbb......bb...bbbbb...b..brrrrrrrrrrrrrrbb ", " bb.bbb..........b.bbbbbbbbbbb..brrrrrrrrrrrrrrbb ", " bb..............b.b.bbbbbbbbb..brrrrrrrrrrrrrrbb ", " bbbbbbbbbbbbbbbbb.b.b....bbbb..bbbbbbbbbbbbbbbbb ", " bbbbbbbbbbbbbbbbb...b.....b.b..b..............bb ", " bbbbbbbbbbbbbbbbb........bb.bb.b...b..b.......bb ", " bbbbbbbbbbbbbbbb........b..b..b..b..b...b...bb ", " bbbbbbbbbbbbbbbb.......b..b...b.b..b...b....bb ", " bbbbbbbbbbbbbbbbb............b.bbbbbbbbbb...bb ", " bbrrrrrrrrrrrrrrb..........bbbb........bb.bb ", " bbrrrrrrrrrrrrrrrb........bbbb............bb ", " bbrrrrrrrrrrrrrrrbbbbbbbb.......b..b....bb ", " bbrrrrrrrrrrrrrrrrrrbb.....b...b..b..b..bb ", " bbrrrrrrrrrrrrrrrrrbb....b...b..b..b..bb ", " bbrrrrrrrrrrrrrrrrrbb...bb.bbbbbbbb...bb ", " bbbbbbbbbbbbbbbbbbbb...bbbb......bb.bb ", " bbbbbbbbbbbbbbbbbbb..bbb...........b ", " bbbbbbbbbbbbbbbbbbb.bbb...........bb ", " bbbbbbbbbbbbbbbbbb..............bb ", " bbbbbbbbbbbbbbbbb...b.b.b.....bb ", " bbbbbbbbbbbbbbbb..b.b.b..b..bb ", " bbrrrrrrrrrrrbb..bbbbbbb..bb ", " bbrrrrrrrrrrbb.bbb....b.bb ", " bbrrrrrrrrrbb.bb......bb ", " bbbrrrrrrrbb.......bbb ", " bbbbrrrrrbb.....bbbb ", " bbbbrrrbb...bbbb ", " bbbbrbb.bbbb ", " bbbbbbbb ", " bbbb ", " bb ", " " } ; xforms-1.2.4/demos/fd/is_gui.fd0000664000175000017500000003633512236225506013266 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 6 Unit of measure: FL_COORD_PIXEL =============== FORM =============== Name: is_mainform Width: 950 Height: 780 Number of Objects: 12 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 950 780 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FL_DOWN_BOX box: 5 50 250 690 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CANVAS type: FL_NORMAL_CANVAS box: 260 55 655 660 boxtype: FL_DOWN_BOX colors: FL_NoColor FL_BLACK alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: canvas callback: argument: -------------------- class: FL_SCROLLBAR type: FL_VERT_THIN_SCROLLBAR box: 920 55 19 665 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: vscroll callback: vscroll_callback argument: 0 -------------------- class: FL_SCROLLBAR type: FL_HOR_THIN_SCROLLBAR box: 258 720 659 20 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: hscroll callback: hscroll_callback argument: 0 -------------------- class: FL_TABFOLDER type: FL_TOP_TABFOLDER box: 8 53 244 684 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_NONE gravity: FL_NoGravity FL_NoGravity name: tabfolder callback: argument: -------------------- class: FL_FRAME type: FL_ENGRAVED_FRAME box: 690 745 255 30 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_FRAME type: FL_ENGRAVED_FRAME box: 259 3 675 45 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_MENU type: FL_PULLDOWN_MENU box: 10 10 60 25 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: File shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: filemenu_callback argument: 0 content: New mode: FL_PUP_NONE shortcut: #N content: Open mode: FL_PUP_NONE shortcut: #O content: Save mode: FL_PUP_NONE shortcut: #S content: Save As%l mode: FL_PUP_NONE shortcut: #A content: Exit mode: FL_PUP_NONE shortcut: #E -------------------- class: FL_SLIDER type: FL_HOR_FILL_SLIDER box: 285 747 156 26 boxtype: FL_FRAME_BOX colors: FL_COL1 FL_DODGERBLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: progressbar callback: argument: 0 return: FL_RETURN_END_CHANGED value: 0 slsize: 0.15 -------------------- class: FL_TEXT type: FL_NORMAL_TEXT box: 6 745 278 29 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: status callback: argument: -------------------- class: FL_TEXT type: FL_NORMAL_TEXT box: 442 745 245 30 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: errormsg callback: argument: 0 =============== FORM =============== Name: viewform Width: 240 Height: 670 Number of Objects: 7 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 240 670 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 10 298 224 68 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Window Levelling shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CHECKBUTTON type: FL_PUSH_BUTTON box: 30 80 40 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: DoubleBuffer shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: doublebuffer callback: doublebuffer_callback argument: 0 -------------------- class: FL_BROWSER type: FL_NORMAL_BROWSER box: 10 460 220 120 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: HeaderInfo shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: headerinfo callback: argument: -------------------- class: FL_VALSLIDER type: FL_HOR_NICE_SLIDER box: 20 340 195 18 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_RIGHT style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: W shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: window callback: windowlevel_callback argument: 0 return: FL_RETURN_CHANGED bounds: 0 4095 precision: 0 value: 256 increment: 1 1 -------------------- class: FL_VALSLIDER type: FL_HOR_NICE_SLIDER box: 20 316 195 18 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_RIGHT style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: L shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: level callback: windowlevel_callback argument: 0 return: FL_RETURN_CHANGED bounds: 0 4095 precision: 0 value: 2514 increment: 1 1 -------------------- class: FL_PIXMAP type: FL_NORMAL_PIXMAP box: 160 585 70 70 boxtype: FL_FRAME_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: pixmap callback: argument: =============== FORM =============== Name: processform Width: 240 Height: 670 Number of Objects: 17 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 240 670 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 10 275 220 90 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: CurrentFillColor shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 6 60 229 150 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Scale shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_COUNTER type: FL_NORMAL_COUNTER box: 60 120 120 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_RIGHT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Width shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: width callback: argument: 0 bounds: 0.1 100.0 value: 1.0 -------------------- class: FL_COUNTER type: FL_NORMAL_COUNTER box: 60 140 120 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_RIGHT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Height shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: height callback: argument: 0 bounds: 0.1 101.0 value: 1.0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 12 80 82 22 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: subpixel callback: argument: content: subpixel mode: FL_PUP_NONE content: no subpixel mode: FL_PUP_NONE -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 96 80 67 22 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: aspect callback: argument: content: aspect mode: FL_PUP_NONE content: exact mode: FL_PUP_NONE value: 2 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 150 175 70 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: OK shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: scaling_callback argument: 0 -------------------- class: FL_CHECKBUTTON type: FL_PUSH_BUTTON box: 40 175 80 25 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Pixel shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: pixel callback: switchtopixel_callback argument: 0 -------------------- class: FL_VALSLIDER type: FL_HOR_FILL_SLIDER box: 30 290 160 20 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_RED alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: red callback: colorchange_callback argument: 0 return: FL_RETURN_CHANGED bounds: 0 255 precision: 0 value: 205 slsize: 0.15 -------------------- class: FL_VALSLIDER type: FL_HOR_FILL_SLIDER box: 30 310 160 20 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_GREEN alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: green callback: colorchange_callback argument: 1 return: FL_RETURN_CHANGED bounds: 0 255 precision: 0 value: 87 slsize: 0.15 step: 1 -------------------- class: FL_VALSLIDER type: FL_HOR_FILL_SLIDER box: 30 330 160 20 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: blue callback: colorchange_callback argument: 2 return: FL_RETURN_CHANGED bounds: 0 255 precision: 0 value: 128 slsize: 0.15 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 193 290 30 60 boxtype: FL_FLAT_BOX colors: FL_FREE_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: colorobj callback: argument: -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 164 80 68 22 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: align callback: argument: content: center mode: FL_PUP_NONE content: topleft mode: FL_PUP_NONE -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 40 410 70 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Sharpen shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: convolve_callback argument: (long)FLIMAGE_SHARPEN -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 120 410 70 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Smooth shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: convolve_callback argument: (long)FLIMAGE_SMOOTH -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 40 450 70 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Auto Crop shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: autocrop_callback argument: 0 =============== FORM =============== Name: saveAs_form Width: 320 Height: 400 Number of Objects: 3 -------------------- class: FL_BOX type: FL_UP_BOX box: 0 0 320 400 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_FORMBROWSER type: FL_NORMAL_FORMBROWSER box: 7 52 310 340 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_NONE gravity: FL_NoGravity FL_NoGravity name: formcontainer callback: argument: -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 65 10 100 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Format shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: outformat callback: outformat_callback argument: 0 =============== FORM =============== Name: annotationform Width: 240 Height: 670 Number of Objects: 1 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 240 670 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: =============== FORM =============== Name: paintform Width: 240 Height: 670 Number of Objects: 1 -------------------- class: FL_BOX type: FL_UP_BOX box: 0 0 240 670 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: ============================== create_the_forms xforms-1.2.4/demos/fd/scrollbar_gui.fd0000664000175000017500000001051312236225451014623 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL =============== FORM =============== Name: scb Width: 470 Height: 230 Number of Objects: 12 -------------------- class: FL_BOX type: FL_UP_BOX box: 0 0 470 230 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_SCROLLBAR type: FL_HOR_SCROLLBAR box: 30 15 230 17 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: HOR_SCROLLBAR shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: hor callback: noop_cb argument: 0 -------------------- class: FL_SCROLLBAR type: FL_HOR_THIN_SCROLLBAR box: 30 60 230 18 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: HOR_THIN_SCROLLBAR shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: hor_thin callback: noop_cb argument: 0 value: 0.11 -------------------- class: FL_SCROLLBAR type: FL_HOR_NICE_SCROLLBAR box: 30 110 230 18 boxtype: FL_FRAME_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: HOR_NICE_SCROLLBAR shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: hor_nice callback: noop_cb argument: 0 -------------------- class: FL_SCROLLBAR type: FL_VERT_SCROLLBAR box: 300 10 17 185 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: vert callback: noop_cb argument: 0 -------------------- class: FL_SCROLLBAR type: FL_VERT_THIN_SCROLLBAR box: 338 10 17 185 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: vert_thin callback: noop_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 20 195 80 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Hide shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: hide callback: hide_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 100 195 80 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Deactivate shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: deactivate callback: deactivate_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 200 195 80 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Done shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: done_cb argument: 0 -------------------- class: FL_SCROLLBAR type: FL_VERT_NICE_SCROLLBAR box: 370 10 17 185 boxtype: FL_FRAME_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: vert_nice callback: noop_cb argument: 0 value: 1 -------------------- class: FL_SCROLLBAR type: FL_HOR_PLAIN_SCROLLBAR box: 30 155 230 18 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: HOR_PLAIN_SCROLLBAR shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: noop_cb argument: 0 value: 0.77 slsize: 0.20 -------------------- class: FL_SCROLLBAR type: FL_VERT_PLAIN_SCROLLBAR box: 410 10 17 185 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: noop_cb argument: 0 value: 0.97 slsize: 0.20 ============================== create_the_forms xforms-1.2.4/demos/fd/dim_porsche.xpm0000644000175000017500000001103011665175602014503 00000000000000/* XPM */ static char * dim_porsche[] = { /* porsche pixmap * width height ncolors chars_per_pixel */ "64 64 4 1 ", " c None m None s s_slateblue ", ". c yellow3 m white s s_yellow3 ", "r c red3 m white s s_red3 ", "b c gray40 m black s s_black40 ", /* pixels */ " ", " ", " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb............................................bb ", " bb..bbbb..bbbb..bbbb..bbbb..bbbb..b..b..bbbb..bb ", " bb..b..b..b..b..b..b..b..b..b..b..b..b..b.....bb ", " bb..b..b..b..b..b..b..b.....b.....b..b..b.....bb ", " bb..bbbb..b..b..bbb...bbbb..b.....bbbb..bbbb..bb ", " bb..b.....b..b..b..b.....b..b.....b..b..b.....bb ", " bb..b.....b..b..b..b..b..b..b..b..b..b..b.....bb ", " bb..b.....bbbb..b..b..bbbb..bbbb..b..b..bbbb..bb ", " bb............................................bb ", " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb.....................bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb......b...b...bb.....bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb.....b...b...b....b..bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb....bb..bb.bbbbbbb...bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb...bbbbbbbb......bb..bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb..bbbb...............bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb.bbb.................bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb..........b..b.......bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb.....b...b..b........bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb....b...b..b..bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb....b.bbbbbbbbb..............bbbbbbbbbbbbbbbbb ", " bb...bbbb.......bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb..bbb.........b..............bbbbbbbbbbbbbbbbb ", " bb.bbb..........b...bbb........bbbbbbbbbbbbbbbbb ", " bb.........b..b.b..bbbbb.......bbbbbbbbbbbbbbbbb ", " bb.....b..b..b..b..b.bbb.....b.brrrrrrrrrrrrrrbb ", " bb....b..b..b..bb....bbb....bb.brrrrrrrrrrrrrrbb ", " bb...bb.bbbbbbb.b....bbb....bb.brrrrrrrrrrrrrrbb ", " bb..bbbbb......bb...bbbbb...b..brrrrrrrrrrrrrrbb ", " bb.bbb..........b.bbbbbbbbbbb..brrrrrrrrrrrrrrbb ", " bb..............b.b.bbbbbbbbb..brrrrrrrrrrrrrrbb ", " bbbbbbbbbbbbbbbbb.b.b....bbbb..bbbbbbbbbbbbbbbbb ", " bbbbbbbbbbbbbbbbb...b.....b.b..b..............bb ", " bbbbbbbbbbbbbbbbb........bb.bb.b...b..b.......bb ", " bbbbbbbbbbbbbbbb........b..b..b..b..b...b...bb ", " bbbbbbbbbbbbbbbb.......b..b...b.b..b...b....bb ", " bbbbbbbbbbbbbbbbb............b.bbbbbbbbbb...bb ", " bbrrrrrrrrrrrrrrb..........bbbb........bb.bb ", " bbrrrrrrrrrrrrrrrb........bbbb............bb ", " bbrrrrrrrrrrrrrrrbbbbbbbb.......b..b....bb ", " bbrrrrrrrrrrrrrrrrrrbb.....b...b..b..b..bb ", " bbrrrrrrrrrrrrrrrrrbb....b...b..b..b..bb ", " bbrrrrrrrrrrrrrrrrrbb...bb.bbbbbbbb...bb ", " bbbbbbbbbbbbbbbbbbbb...bbbb......bb.bb ", " bbbbbbbbbbbbbbbbbbb..bbb...........b ", " bbbbbbbbbbbbbbbbbbb.bbb...........bb ", " bbbbbbbbbbbbbbbbbb..............bb ", " bbbbbbbbbbbbbbbbb...b.b.b.....bb ", " bbbbbbbbbbbbbbbb..b.b.b..b..bb ", " bbrrrrrrrrrrrbb..bbbbbbb..bb ", " bbrrrrrrrrrrbb.bbb....b.bb ", " bbrrrrrrrrrbb.bb......bb ", " bbbrrrrrrrbb.......bbb ", " bbbbrrrrrbb.....bbbb ", " bbbbrrrbb...bbbb ", " bbbbrbb.bbbb ", " bbbbbbbb ", " bbbb ", " bb ", " " } ; xforms-1.2.4/demos/fd/buttons_gui.fd0000664000175000017500000001536012236225235014343 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL =============== FORM =============== Name: buttform Width: 290 Height: 260 Number of Objects: 22 -------------------- class: FL_BOX type: FL_UP_BOX box: 0 0 290 260 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: backface callback: argument: -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 185 215 90 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Done shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: done callback: done_cb argument: 0 -------------------- class: FL_BEGIN_GROUP name: objsgroup -------------------- class: FL_FRAME type: FL_ENGRAVED_FRAME box: 175 170 100 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_GREEN alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_ROUND3DBUTTON type: FL_PUSH_BUTTON box: 210 170 30 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_GREEN alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BITMAPBUTTON type: FL_NORMAL_BUTTON box: 25 85 40 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: bitmapbutton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: bbutt callback: argument: -------------------- class: FL_PIXMAPBUTTON type: FL_NORMAL_BUTTON box: 25 25 40 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: pixmapbutton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: pbutt callback: argument: -------------------- class: FL_CHECKBUTTON type: FL_RADIO_BUTTON box: 100 31 70 32 boxtype: FL_NO_BOX colors: FL_COL1 FL_RED alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Red shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CHECKBUTTON type: FL_RADIO_BUTTON box: 100 60 70 32 boxtype: FL_NO_BOX colors: FL_COL1 FL_GREEN alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Green shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CHECKBUTTON type: FL_RADIO_BUTTON box: 100 90 70 32 boxtype: FL_NO_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Blue shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LIGHTBUTTON type: FL_PUSH_BUTTON box: 20 170 108 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: LightButton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 1 -------------------- class: FL_ROUNDBUTTON type: FL_PUSH_BUTTON box: 200 35 75 25 boxtype: FL_NO_BOX colors: FL_COL1 FL_RED alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Red shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_ROUNDBUTTON type: FL_PUSH_BUTTON box: 200 64 75 25 boxtype: FL_NO_BOX colors: FL_COL1 FL_GREEN alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Green shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_ROUNDBUTTON type: FL_PUSH_BUTTON box: 200 93 75 25 boxtype: FL_NO_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Blue shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_ROUND3DBUTTON type: FL_PUSH_BUTTON box: 180 170 30 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_RED alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_ROUND3DBUTTON type: FL_PUSH_BUTTON box: 240 170 30 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: FL_PUSH_BUTTON box: 130 210 30 30 boxtype: FL_OVAL3D_UPBOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: go shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 20 210 90 30 boxtype: FL_ROUNDED3D_UPBOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Button shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 105 135 80 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: BW shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: bw_obj callback: bw_cb argument: 0 -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 190 25 85 100 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: RoundButton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 90 25 90 100 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: CheckButton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_END_GROUP ============================== create_the_forms xforms-1.2.4/demos/fd/inputall_gui.fd0000664000175000017500000000737312236225544014505 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL =============== FORM =============== Name: input Width: 441 Height: 441 Number of Objects: 10 -------------------- class: FL_BOX type: FL_UP_BOX box: 0 0 441 441 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_INPUT type: FL_NORMAL_INPUT box: 40 40 340 30 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Normal Input shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: norminput callback: input_cb argument: 0 return: FL_RETURN_END_CHANGED -------------------- class: FL_INPUT type: FL_INT_INPUT box: 40 100 160 30 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Integer Input shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: intinput callback: input_cb argument: 0 return: FL_RETURN_END_CHANGED -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 230 100 160 30 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Float Input shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: floatinput callback: input_cb argument: 0 return: FL_RETURN_END_CHANGED -------------------- class: FL_INPUT type: FL_DATE_INPUT box: 40 150 160 30 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Date Input shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: dateinput callback: input_cb argument: 0 return: FL_RETURN_END_CHANGED -------------------- class: FL_INPUT type: FL_SECRET_INPUT box: 230 150 160 30 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Secret Input shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: secretinput callback: input_cb argument: 0 return: FL_RETURN_END_CHANGED -------------------- class: FL_INPUT type: FL_MULTILINE_INPUT box: 40 210 360 180 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Multi-line input shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: multiinput callback: input_cb argument: 0 return: FL_RETURN_END_CHANGED -------------------- class: FL_TEXT type: FL_NORMAL_TEXT box: 30 400 210 30 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: report callback: argument: -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 330 400 70 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Done shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: done_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 250 400 70 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Hide/Show shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: hide_show_cb argument: 0 ============================== create_the_form xforms-1.2.4/demos/fd/twheel_gui.fd0000664000175000017500000000522212236225466014137 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL =============== FORM =============== Name: twheelform Width: 220 Height: 260 Number of Objects: 7 -------------------- class: FL_BOX type: FL_UP_BOX box: 0 0 220 260 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_FRAME type: FL_ENGRAVED_FRAME box: 15 70 190 130 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_THUMBWHEEL type: FL_VERT_THUMBWHEEL box: 30 90 20 100 boxtype: FL_BORDER_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: vert callback: valchange_cb argument: 0 step: 0.01 -------------------- class: FL_THUMBWHEEL type: FL_HOR_THUMBWHEEL box: 60 130 120 23 boxtype: FL_BORDER_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: hor callback: valchange_cb argument: 0 step: 0.01 -------------------- class: FL_TEXT type: FL_NORMAL_TEXT box: 60 90 120 30 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: report callback: argument: -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 35 20 160 30 boxtype: FL_EMBOSSED_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: returnsetting callback: returnchange_cb argument: 0 content: End & Changed content: Whenever Changed content: Always At End content: Always value: 2 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 120 215 80 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Enough shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: ============================== create_the_forms xforms-1.2.4/demos/fd/fbtest_gui.fd0000664000175000017500000000510612236225307014131 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL =============== FORM =============== Name: fbform Width: 371 Height: 361 Number of Objects: 7 -------------------- class: FL_BOX type: FL_UP_BOX box: 0 0 371 361 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BROWSER type: FL_NORMAL_BROWSER box: 20 50 240 290 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: browser callback: argument: -------------------- class: FL_CHECKBUTTON type: FL_RADIO_BUTTON box: 270 50 70 25 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: AlphaSort shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: sort_method_cb argument: FL_ALPHASORT value: 1 -------------------- class: FL_CHECKBUTTON type: FL_RADIO_BUTTON box: 270 85 70 25 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: SizeSort shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: sort_method_cb argument: FL_SIZESORT -------------------- class: FL_CHECKBUTTON type: FL_RADIO_BUTTON box: 270 120 70 25 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: TimeSort shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: sort_method_cb argument: FL_MTIMESORT -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 275 310 75 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Done shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: done_cb argument: 0 -------------------- class: FL_TEXT type: FL_NORMAL_TEXT box: 10 15 220 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: total callback: argument: ============================== create_the_forms xforms-1.2.4/demos/fd/butttypes_gui.fd0000664000175000017500000000746112236225262014713 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL =============== FORM =============== Name: form0 Width: 360 Height: 330 Number of Objects: 11 -------------------- class: FL_BOX type: FL_UP_BOX box: 0 0 360 330 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: FL_HIDDEN_BUTTON box: 0 0 360 330 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: button_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 18 15 107 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Normal shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: button_cb argument: 0 -------------------- class: FL_BUTTON type: FL_PUSH_BUTTON box: 18 53 107 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Push shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: button_cb argument: 0 -------------------- class: FL_BUTTON type: FL_RADIO_BUTTON box: 18 91 107 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Radio 1 shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: button_cb argument: 0 value: 1 -------------------- class: FL_BUTTON type: FL_RADIO_BUTTON box: 18 129 107 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Radio 2 shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: button_cb argument: 0 -------------------- class: FL_BUTTON type: FL_TOUCH_BUTTON box: 18 167 107 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Touch shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: button_cb argument: 0 return: FL_RETURN_CHANGED -------------------- class: FL_BUTTON type: FL_INOUT_BUTTON box: 18 205 107 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: InOut shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: button_cb argument: 0 -------------------- class: FL_BUTTON type: FL_MENU_BUTTON box: 18 243 107 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Menu shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: button_cb argument: 0 -------------------- class: FL_BUTTON type: FL_RETURN_BUTTON box: 18 281 107 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Return shortcut: ^M resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: button_cb argument: 0 -------------------- class: FL_BROWSER type: FL_NORMAL_BROWSER box: 135 15 210 296 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: br callback: button_cb argument: 0 ============================== create_the_forms xforms-1.2.4/demos/fd/folder_gui.fd0000664000175000017500000003607412236225340014122 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 6 Unit of measure: FL_COORD_PIXEL =============== FORM =============== Name: buttonform Width: 430 Height: 210 Number of Objects: 10 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 430 210 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 30 151 80 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Button shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_ROUNDBUTTON type: FL_PUSH_BUTTON box: 40 91 100 30 boxtype: FL_NO_BOX colors: FL_MCOL FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: RoundButton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_ROUND3DBUTTON type: FL_PUSH_BUTTON box: 135 151 110 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Round3DButton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CHECKBUTTON type: FL_PUSH_BUTTON box: 170 111 110 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: CheckButton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LIGHTBUTTON type: FL_PUSH_BUTTON box: 30 31 100 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: LightButton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_PIXMAPBUTTON type: FL_NORMAL_BUTTON box: 320 36 80 80 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: PixmapButton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: file: porsche.xpm fullpath: 1 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 185 26 100 30 boxtype: FL_ROUNDED3D_UPBOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Button shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LIGHTBUTTON type: FL_PUSH_BUTTON box: 290 146 100 30 boxtype: FL_EMBOSSED_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Button shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 175 71 60 25 boxtype: FL_SHADOW_BOX colors: FL_COL1 FL_SLATEBLUE alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Button shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: =============== FORM =============== Name: staticform Width: 431 Height: 211 Number of Objects: 8 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 431 211 boxtype: FL_FLAT_BOX colors: FL_INDIANRED FL_INDIANRED alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_INDIANRED label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FL_UP_BOX box: 40 40 60 45 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: A Box shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 130 30 120 55 boxtype: FL_NO_BOX colors: FL_BLACK FL_INDIANRED alignment: FL_ALIGN_LEFT_TOP style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: LabelFrame shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CHART type: FL_PIE_CHART box: 270 20 130 105 boxtype: FL_BORDER_BOX colors: FL_INDIANRED FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: chart callback: argument: -------------------- class: FL_CLOCK type: FL_ANALOG_CLOCK box: 30 100 85 85 boxtype: FL_UP_BOX colors: FL_COL1 FL_RIGHT_BCOL alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BITMAP type: FL_NORMAL_BITMAP box: 150 140 30 25 boxtype: FL_NO_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_PIXMAP type: FL_NORMAL_PIXMAP box: 210 120 60 60 boxtype: FL_NO_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_TEXT type: FL_NORMAL_TEXT box: 310 150 70 25 boxtype: FL_BORDER_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Text shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: =============== FORM =============== Name: mainform Width: 461 Height: 291 Number of Objects: 8 -------------------- class: FL_BOX type: FL_UP_BOX box: 0 0 461 291 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 381 250 64 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Done shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: done callback: done_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 15 249 64 27 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Hide shortcut: #H resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: hide callback: hide_show_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 79 249 64 27 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Show shortcut: #S resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: show callback: hide_show_cb argument: 1 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 155 249 64 27 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: ReShow shortcut: #R resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: reshow callback: reshow_cb argument: 0 -------------------- class: FL_TABFOLDER type: FL_TOP_TABFOLDER box: 15 11 435 230 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: folder callback: argument: -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 232 249 64 27 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Set shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: set callback: set_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 296 249 69 27 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Deactivate shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: deactivate callback: deactivate_cb argument: 0 =============== FORM =============== Name: valuatorform Width: 431 Height: 211 Number of Objects: 10 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 431 211 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_POSITIONER type: FL_NORMAL_POSITIONER box: 280 50 82 72 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_RED alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: xvalue: 0.679012 yvalue: 0.71831 -------------------- class: FL_VALSLIDER type: FL_HOR_NICE_SLIDER box: 55 10 240 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_RIGHT_BCOL alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: return: FL_RETURN_CHANGED value: 0.87 -------------------- class: FL_COUNTER type: FL_NORMAL_COUNTER box: 130 110 110 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: -1.0 -------------------- class: FL_SLIDER type: FL_VERT_NICE_SLIDER box: 10 30 20 160 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_RED alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: return: FL_RETURN_CHANGED value: 0.49 -------------------- class: FL_VALSLIDER type: FL_HOR_BROWSER_SLIDER box: 70 170 150 21 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: return: FL_RETURN_CHANGED -------------------- class: FL_SLIDER type: FL_HOR_FILL_SLIDER box: 69 57 159 22 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_SLATEBLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: return: FL_RETURN_CHANGED value: 0.25 -------------------- class: FL_DIAL type: FL_NORMAL_DIAL box: 60 90 60 58 boxtype: FL_UP_BOX colors: FL_COL1 FL_RIGHT_BCOL alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: return: FL_RETURN_END_CHANGED -------------------- class: FL_SCROLLBAR type: FL_VERT_THIN_SCROLLBAR box: 394 14 18 180 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: slsize: 0.20 -------------------- class: FL_SCROLLBAR type: FL_HOR_SCROLLBAR box: 238 158 140 16 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: slsize: 0.25 =============== FORM =============== Name: choiceform Width: 431 Height: 211 Number of Objects: 5 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 431 211 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_MENU type: FL_PULLDOWN_MENU box: 45 36 45 21 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_LEFT_BCOL alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Menu shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: pulldown callback: argument: -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 24 93 111 27 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice callback: argument: -------------------- class: FL_BROWSER type: FL_HOLD_BROWSER box: 257 14 154 179 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: browser callback: argument: -------------------- class: FL_MENU type: FL_PUSH_MENU box: 152 51 75 26 boxtype: FL_UP_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Menu shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: pushmenu callback: argument: =============== FORM =============== Name: inputform Width: 430 Height: 210 Number of Objects: 3 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 430 210 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_INPUT type: FL_MULTILINE_INPUT box: 70 20 280 90 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: MultiLine\nInput shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: return: FL_RETURN_END_CHANGED -------------------- class: FL_INPUT type: FL_NORMAL_INPUT box: 80 132 250 34 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Input shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: return: FL_RETURN_END_CHANGED ============================== create_the_forms xforms-1.2.4/demos/fd/pmbrowse_gui.fd0000664000175000017500000000350512236225422014477 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL =============== FORM =============== Name: ttt Width: 330 Height: 320 Number of Objects: 5 -------------------- class: FL_BOX type: FL_UP_BOX box: 0 0 330 320 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BITMAP type: FL_NORMAL_BITMAP box: 30 20 270 240 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: bm callback: argument: -------------------- class: FL_PIXMAP type: FL_NORMAL_PIXMAP box: 30 20 270 240 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: pm callback: argument: -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 220 280 90 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Done shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: done callback: done argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 20 280 90 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Load shortcut: L resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: load callback: reload argument: 0 ============================== create_the_forms xforms-1.2.4/demos/fd/formbrowser_gui.fd0000664000175000017500000004676311774260665015243 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 7 Unit of measure: FL_COORD_PIXEL =============== FORM =============== Name: buttonform Width: 430 Height: 210 Number of Objects: 11 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 430 210 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 30 151 80 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Button shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_ROUNDBUTTON type: FL_PUSH_BUTTON box: 40 91 100 30 boxtype: FL_NO_BOX colors: FL_MCOL FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: RoundButton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_ROUND3DBUTTON type: FL_PUSH_BUTTON box: 160 160 110 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Round3DButton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CHECKBUTTON type: FL_PUSH_BUTTON box: 170 120 110 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: CheckButton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LIGHTBUTTON type: FL_PUSH_BUTTON box: 20 50 100 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: LightButton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_PIXMAPBUTTON type: FL_NORMAL_BUTTON box: 320 36 80 80 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: PixmapButton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: file: porsche.xpm fullpath: 1 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 140 50 100 30 boxtype: FL_ROUNDED3D_UPBOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Button shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LIGHTBUTTON type: FL_PUSH_BUTTON box: 290 146 100 30 boxtype: FL_EMBOSSED_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Button shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 210 90 60 25 boxtype: FL_SHADOW_BOX colors: FL_COL1 FL_SLATEBLUE alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Button shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_FRAME type: FL_ENGRAVED_FRAME box: 130 10 150 30 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Form1 shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: =============== FORM =============== Name: staticform Width: 431 Height: 211 Number of Objects: 8 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 431 211 boxtype: FL_FLAT_BOX colors: FL_INDIANRED FL_INDIANRED alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_INDIANRED label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FL_UP_BOX box: 40 40 60 45 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: A Box shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 130 30 120 55 boxtype: FL_NO_BOX colors: FL_BLACK FL_INDIANRED alignment: FL_ALIGN_LEFT_TOP style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: LabelFrame shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CHART type: FL_PIE_CHART box: 270 20 130 105 boxtype: FL_BORDER_BOX colors: FL_INDIANRED FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: chart callback: argument: -------------------- class: FL_CLOCK type: FL_ANALOG_CLOCK box: 30 100 85 85 boxtype: FL_UP_BOX colors: FL_COL1 FL_RIGHT_BCOL alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BITMAP type: FL_NORMAL_BITMAP box: 150 140 30 25 boxtype: FL_NO_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: file: nomail.xbm fullpath: 1 -------------------- class: FL_PIXMAP type: FL_NORMAL_PIXMAP box: 210 120 60 60 boxtype: FL_NO_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: file: porsche.xpm fullpath: 1 -------------------- class: FL_TEXT type: FL_NORMAL_TEXT box: 310 150 70 25 boxtype: FL_BORDER_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Text shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: =============== FORM =============== Name: mainform Width: 460 Height: 290 Number of Objects: 8 -------------------- class: FL_BOX type: FL_UP_BOX box: 0 0 460 290 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 381 250 64 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Done shortcut: resize: FL_RESIZE_NONE gravity: FL_South FL_South name: done callback: done_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 15 249 64 27 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Hide shortcut: #H resize: FL_RESIZE_NONE gravity: FL_South FL_South name: hide callback: hide_show_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 79 249 64 27 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Show shortcut: #S resize: FL_RESIZE_NONE gravity: FL_South FL_South name: show callback: hide_show_cb argument: 1 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 155 249 64 27 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: ReShow shortcut: #R resize: FL_RESIZE_NONE gravity: FL_South FL_South name: reshow callback: reshow_cb argument: 0 -------------------- class: FL_BUTTON type: FL_PUSH_BUTTON box: 217 249 79 27 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Jump shortcut: resize: FL_RESIZE_NONE gravity: FL_South FL_South name: set callback: scroll_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 296 249 69 27 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Deactivate shortcut: resize: FL_RESIZE_NONE gravity: FL_South FL_South name: deactivate callback: deactivate_cb argument: 0 -------------------- class: FL_FORMBROWSER type: FL_NORMAL_FORMBROWSER box: 20 20 420 220 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthWest FL_SouthEast name: formbrowser callback: argument: =============== FORM =============== Name: valuatorform Width: 430 Height: 390 Number of Objects: 13 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 430 390 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_POSITIONER type: FL_NORMAL_POSITIONER box: 260 180 110 110 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_RED alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: xvalue: 0.679012 yvalue: 0.71831 -------------------- class: FL_VALSLIDER type: FL_HOR_NICE_SLIDER box: 130 130 250 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: return: FL_RETURN_CHANGED value: 0.87 -------------------- class: FL_COUNTER type: FL_NORMAL_COUNTER box: 30 270 110 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: -1.0 -------------------- class: FL_SLIDER type: FL_VERT_NICE_SLIDER box: 10 40 20 160 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_RED alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: return: FL_RETURN_CHANGED value: 0.49 -------------------- class: FL_VALSLIDER type: FL_HOR_BROWSER_SLIDER box: 60 350 150 21 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: return: FL_RETURN_CHANGED -------------------- class: FL_SLIDER type: FL_HOR_FILL_SLIDER box: 60 170 159 22 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_SLATEBLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: return: FL_RETURN_CHANGED value: 0.25 -------------------- class: FL_DIAL type: FL_NORMAL_DIAL box: 160 220 60 58 boxtype: FL_UP_BOX colors: FL_COL1 FL_RIGHT_BCOL alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: return: FL_RETURN_END_CHANGED -------------------- class: FL_SCROLLBAR type: FL_VERT_THIN_SCROLLBAR box: 394 14 18 180 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: slsize: 0.20 -------------------- class: FL_SCROLLBAR type: FL_HOR_SCROLLBAR box: 170 70 140 16 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: slsize: 0.25 -------------------- class: FL_THUMBWHEEL type: FL_VERT_THUMBWHEEL box: 80 70 17 84 boxtype: FL_BORDER_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_THUMBWHEEL type: FL_HOR_THUMBWHEEL box: 280 330 90 19 boxtype: FL_BORDER_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_FRAME type: FL_ENGRAVED_FRAME box: 100 10 180 30 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Valuator Form shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: =============== FORM =============== Name: choiceform Width: 430 Height: 210 Number of Objects: 6 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 430 210 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_MENU type: FL_PULLDOWN_MENU box: 40 70 52 22 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_LEFT_BCOL alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Menu shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: pulldown callback: argument: content: Menu item 1 mode: FL_PUP_NONE shortcut: 1#1 content: Menu item 2 mode: FL_PUP_NONE shortcut: 2#2 content: Menu Item None mode: FL_PUP_GRAY content: Menu item 3 mode: FL_PUP_NONE shortcut: 3#3 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 10 120 111 27 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice callback: argument: content: Choice item 1 mode: FL_PUP_NONE shortcut: 1#1 content: Choice item 2 mode: FL_PUP_NONE content: Choice item 3 mode: FL_PUP_NONE -------------------- class: FL_BROWSER type: FL_HOLD_BROWSER box: 250 10 164 184 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: browser callback: argument: content: @c@bBrowser content: This is line #1 of the browser content: This is line #2 of the browser content: This is line #3 of the browser content: This is line #4 of the browser content: This is line #5 of the browser content: This is line #6 of the browser content: This is line #7 of the browser content: @C1This is line #8 of the browser content: This is line #9 of the browser content: @C2This is line #10 of the browser content: This is line #11 of the browser content: This is line #12 of the browser content: This is line #13 of the browser content: @C3This is line #14 of the browser -------------------- class: FL_MENU type: FL_PUSH_MENU box: 150 130 75 26 boxtype: FL_UP_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Menu shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: pushmenu callback: argument: content: 1 mode: FL_PUP_NONE content: 2 mode: FL_PUP_NONE content: 3 mode: FL_PUP_NONE content: 4 mode: FL_PUP_NONE -------------------- class: FL_FRAME type: FL_ENGRAVED_FRAME box: 40 10 170 30 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Choice Form shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: =============== FORM =============== Name: inputform Width: 430 Height: 210 Number of Objects: 3 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 430 210 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_INPUT type: FL_MULTILINE_INPUT box: 70 40 280 90 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: MultiLine\nInput shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: return: FL_RETURN_END_CHANGED -------------------- class: FL_INPUT type: FL_NORMAL_INPUT box: 80 152 250 34 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Input shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: return: FL_RETURN_END_CHANGED =============== FORM =============== Name: big Width: 520 Height: 460 Number of Objects: 5 -------------------- class: FL_BOX type: FL_BORDER_BOX box: 0 0 520 460 boxtype: FL_BORDER_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_THUMBWHEEL type: FL_VERT_THUMBWHEEL box: 100 50 17 80 boxtype: FL_BORDER_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_POSITIONER type: FL_NORMAL_POSITIONER box: 180 30 180 150 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_RED alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_XYPLOT type: FL_ACTIVE_XYPLOT box: 30 210 290 210 boxtype: FL_DOWN_BOX colors: FL_BLACK FL_GREEN alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: ActiveXYPlot shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: xyplot callback: argument: -------------------- class: FL_BOX type: FL_UP_BOX box: 345 425 170 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: End ofBif FORM shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: ============================== create_the_forms xforms-1.2.4/demos/fd/Makefile.am0000644000175000017500000000053012252426210013503 00000000000000include $(top_srcdir)/config/common.am CLEANFILES = *.bak *.[ch] INCLUDE = $(top_srcdir)/lib EXTRA_DIST = \ dim_porsche.xpm \ porsche.xpm \ buttons_gui.fd \ butttypes_gui.fd \ fbtest_gui.fd \ folder_gui.fd \ formbrowser_gui.fd \ ibrowser_gui.fd \ inputall_gui.fd \ is_gui.fd \ pmbrowse_gui.fd \ scrollbar_gui.fd \ twheel_gui.fd xforms-1.2.4/demos/timeoutprec.c0000644000175000017500000000756212251643320013600 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* * Test the accuracy of timeouts */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include #include /**** Forms and Objects ****/ typedef struct { FL_FORM * form; int timer_id; void * vdata; long ldata; FL_OBJECT * timer; FL_OBJECT * restart; FL_OBJECT * report; } FD_form; static FD_form * create_form_form( void ); static long start_sec, start_usec; static long end_sec, end_usec; /*************************************** ***************************************/ static void exit_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_finish( ); exit( 0 ); } /*************************************** * timer expired ***************************************/ static void timer_cb( int id FL_UNUSED_ARG, void * data ) { char buf[ 128 ]; double df; FD_form *fd = data; double timerval = 1.0e-3 * fd->ldata; fd->timer_id = 0; fl_gettime( &end_sec, &end_usec ); df = end_sec - start_sec + 1.0e-6 * ( end_usec - start_usec ); sprintf( buf,"Timeout: %.3f Actual: %.3f DeltaE: %.3f", timerval, df, df - timerval ); fl_set_object_label( fd->report, buf ); } /*************************************** ***************************************/ static void start_timer( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_form *fd = ob->form->fdui; char buf[ 128 ]; if ( fd->timer_id ) fl_remove_timeout( fd->timer_id ); fd->ldata += 200; sprintf( buf, "Timer accuracy testing %.3f sec ...", fd->ldata * 0.001 ); fl_set_object_label( fd->report, buf ); fl_gettime( &start_sec, &start_usec ); fd->timer_id = fl_add_timeout( fd->ldata, timer_cb, fd ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { FD_form *fd_form; fl_initialize( &argc, argv, 0, 0, 0 ); fd_form = create_form_form( ); /* fill-in form initialization code */ fd_form->ldata = 800; start_timer( fd_form->report, 0 ); /* show the first form */ fl_show_form( fd_form->form, FL_PLACE_CENTER, FL_FULLBORDER, "Timeout precision" ); fl_do_forms( ); return 0; } /*************************************** ***************************************/ static FD_form * create_form_form(void) { FL_OBJECT *obj; FD_form *fdui = fl_calloc( 1, sizeof *fdui ); fdui->form = fl_bgn_form( FL_NO_BOX, 320, 130 ); fl_add_box( FL_UP_BOX, 0, 0, 320, 130, "" ); obj = fl_add_button( FL_NORMAL_BUTTON, 210, 80, 90, 35, "Done" ); fl_set_object_callback( obj, exit_cb, 0 ); fdui->restart = obj = fl_add_button( FL_TOUCH_BUTTON, 110, 80, 90, 35, "Restart" ); fl_set_object_callback( obj, start_timer, 0 ); fdui->report = obj = fl_add_text( FL_NORMAL_TEXT, 10, 20, 290, 50,"" ); fl_end_form( ); fdui->form->fdui = fdui; return fdui; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/demos/picture.xbm0000644000175000017500000000156411665175601013265 00000000000000#define picture_width 32 #define picture_height 32 static char picture_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x80, 0x01, 0x18, 0x64, 0x6f, 0xf6, 0x26, 0x0a, 0x00, 0x00, 0x50, 0xf2, 0xff, 0xff, 0x4f, 0x14, 0x04, 0x00, 0x28, 0x14, 0x0e, 0x00, 0x28, 0x10, 0x32, 0x00, 0x08, 0x94, 0x03, 0x00, 0x08, 0xf4, 0x04, 0x00, 0x08, 0xb0, 0x08, 0x00, 0x08, 0x34, 0x01, 0x00, 0x28, 0x34, 0x01, 0x00, 0x28, 0x12, 0x00, 0x40, 0x48, 0x12, 0x20, 0xa6, 0x48, 0x14, 0x50, 0x11, 0x29, 0x14, 0x50, 0x48, 0x2a, 0x10, 0x27, 0xac, 0x0e, 0xd4, 0x71, 0xe8, 0x0a, 0x74, 0x20, 0xa8, 0x0a, 0x14, 0x20, 0x00, 0x08, 0x10, 0x50, 0x00, 0x08, 0x14, 0x00, 0x00, 0x28, 0x14, 0x00, 0x00, 0x28, 0xf2, 0xff, 0xff, 0x4f, 0x0a, 0x00, 0x00, 0x50, 0x64, 0x6f, 0xf6, 0x26, 0x18, 0x80, 0x01, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; xforms-1.2.4/demos/Readme0000644000175000017500000000246712255011324012210 00000000000000This dorectory contains a number of programs demonstrating the usage and appearance of object classes in the XForms Library. Note that these programs also serve as testing/QA programs, so if you have a problem with a particular object, see if the same object works in the demo program. On the other hand, if one of the demo programs doesn't work you have rather likely found a bug in XForms. Please report it! If this directory was installed from the documentation package for XForms of a distribution you have to modify and compile the programs first before you can run them. This requires that the developm,ent package is also installed. 1) cd into the fd subdirectory and run fdesign -convert *.fd 2) In the program you want to compile replace the line with #include "include/forms.h" by #include 3) Compile the program, typically it just needs gcc -o xyz xyz.c -lforms Some programs also need to be compiled with a C file from the fd subdirectory. This is usually simple to figure out: if a C file includes a header file from the fd subdirectory then you need to compile including the correspoding C file from the fd subdirectory. OpenGL/Mesa demos may not work if you configured XForms to be built without GL support (via the '--disable-gl' option of 'configure'). xforms-1.2.4/gl/0000775000175000017500000000000012353624653010452 500000000000000xforms-1.2.4/gl/Makefile.in0000664000175000017500000004511512353624173012442 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/config/common.am subdir = gl ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libformsGL_la_DEPENDENCIES = ../lib/libforms.la $(am__DEPENDENCIES_1) am_libformsGL_la_OBJECTS = glcanvas.lo libformsGL_la_OBJECTS = $(am_libformsGL_la_OBJECTS) libformsGL_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libformsGL_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/lib depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libformsGL_la_SOURCES) DIST_SOURCES = $(libformsGL_la_SOURCES) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FL_FIXLEVEL = @FL_FIXLEVEL@ FL_REVISION = @FL_REVISION@ FL_VERSION = @FL_VERSION@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIB = @JPEG_LIB@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ TEXI2DVI = @TEXI2DVI@ TEXI2DVI_NEEDS_PDF = @TEXI2DVI_NEEDS_PDF@ TEXI2HTML = @TEXI2HTML@ VERSION = @VERSION@ XMKMF = @XMKMF@ XPM_LIB = @XPM_LIB@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign DISTCLEANFILES = *.orig *.rej *~ *.bak core makelog MAINTAINERCLEANFILES = $(srcdir)/Makefile.in makelog AM_INSTALL_DATA_FLAGS = $(INSTALL) -m 644 -D # forms.h is a generated file INCLUDES = -DMAKING_FORMS -I../lib -I$(top_srcdir)/lib $(X_CFLAGS) include_HEADERS = glcanvas.h lib_LTLIBRARIES = libformsGL.la libformsGL_la_LDFLAGS = -no-undefined -version-info @SO_VERSION@ libformsGL_la_LIBADD = ../lib/libforms.la $(X_LIBS) -lGL -lX11 libformsGL_la_SOURCES = \ glcanvas.c \ glcanvas.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/common.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gl/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gl/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/common.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libformsGL.la: $(libformsGL_la_OBJECTS) $(libformsGL_la_DEPENDENCIES) $(EXTRA_libformsGL_la_DEPENDENCIES) $(libformsGL_la_LINK) -rpath $(libdir) $(libformsGL_la_OBJECTS) $(libformsGL_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glcanvas.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-includeHEADERS install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-includeHEADERS \ uninstall-libLTLIBRARIES # 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: xforms-1.2.4/gl/glcanvas.c0000644000175000017500000002274512251675364012346 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file glcanvas.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * A sample implementation of OpenGL/Mesa canvas class. * * For typical objects, ob->spec is the place for the * object specific info. For OpenGL canvas, however, the * ob->spec is already used by the generic canvas. We use * ob->c_vdata to hang the OpenGL specific stuff. * * See ../DEMOS/gl.c for an example use of glcanvas. * See ../DEMOS/glwin.c for an example use of fl_glwinopen */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "include/forms.h" #include "glcanvas.h" #include #define MAXATTRIB 34 typedef struct { XVisualInfo * xvinfo; GLXContext context; int direct; int glconfig[ MAXATTRIB ]; } CSPEC; /*************************************** * Default GL canvas configuration. The user can modify this default * using fl_set_glcanvas_defaults(const int *config) or * fl_set_glcanvas_attributes(FL_OBJECT *, const int *config) ***************************************/ static int glconfig[ MAXATTRIB ] = { GLX_RGBA, GLX_DEPTH_SIZE, 1, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, GLX_DOUBLEBUFFER, None }; #define GLPROP( ob ) ( ( CSPEC * ) ( ob )->c_vdata ) #define ISGLC( ob ) ( ( ob ) && ( ob )->objclass == FL_GLCANVAS ) static int glx_init( FL_OBJECT * ); static int glx_activate( FL_OBJECT * ); static int glx_cleanup( FL_OBJECT * ); static void copy_attributes( int *, const int * ); /*************************************** * Add a GL canvas to the form ***************************************/ FL_OBJECT * fl_add_glcanvas( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT * ob = fl_create_glcanvas( type, x, y, w, h, label ); fl_add_object( fl_current_form, ob ); return ob; } /*************************************** * Modify the global defaults ***************************************/ void fl_set_glcanvas_defaults( const int * config ) { copy_attributes( glconfig, config ); } /*************************************** ***************************************/ void fl_get_glcanvas_defaults( int * config ) { copy_attributes( config, glconfig ); } /*************************************** * Modify the default configuration of a particular canvas ***************************************/ void fl_set_glcanvas_attributes( FL_OBJECT * ob, const int * config ) { if ( ! ISGLC( ob ) ) fprintf( stderr, "object %s is not glcanvas\n", ob ? ob->label : "null" ); copy_attributes( GLPROP( ob )->glconfig, config ); if ( ob->visible ) { fl_hide_object( ob ); fl_show_object( ob ); } } /*************************************** ***************************************/ void fl_get_glcanvas_attributes( FL_OBJECT * ob, int * attributes ) { copy_attributes( attributes, GLPROP( ob )->glconfig ); } /*************************************** ***************************************/ void fl_set_glcanvas_direct( FL_OBJECT * ob, int direct ) { if ( direct != GLPROP( ob )->direct ) { GLPROP( ob )->direct = direct ? GL_TRUE : GL_FALSE; if ( ob->visible ) { fl_hide_object( ob ); fl_show_object( ob ); } } } /*************************************** ***************************************/ GLXContext fl_get_glcanvas_context( FL_OBJECT * ob ) { return GLPROP( ob )->context; } /*************************************** ***************************************/ XVisualInfo * fl_get_glcanvas_xvisualinfo( FL_OBJECT * ob ) { return GLPROP( ob )->xvinfo; } /*************************************** ***************************************/ void fl_activate_glcanvas( FL_OBJECT * ob ) { if ( FL_ObjWin( ob ) ) glx_activate( ob ); } /*************************************** * Interface routines ***************************************/ FL_OBJECT * fl_create_glcanvas( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob = fl_create_canvas( type, x, y, w, h, label ); ob->objclass = FL_GLCANVAS; fl_modify_canvas_prop( ob, glx_init, glx_activate, glx_cleanup ); /* Initialize glcanvas specific stuff */ ob->c_vdata = fl_calloc( 1, sizeof( CSPEC ) ); memcpy( GLPROP( ob )->glconfig, glconfig, sizeof glconfig ); GLPROP( ob )->direct = GL_TRUE; return ob; } /*************************************** * Initialize the OpenGL stuff before window creation ***************************************/ static int glx_init( FL_OBJECT * ob ) { XVisualInfo *vi; GLXContext context; /* Query for OpenGL capabilities */ if ( ! glXQueryExtension( fl_display, 0, 0 ) ) { fprintf( stderr, "GLCanvas: OpenGL not supported\n" ); return -1; } /* Quit if we can't get a visual */ if ( ! ( vi = glXChooseVisual( fl_display, fl_screen, GLPROP( ob )->glconfig ) ) ) { fprintf( stderr, "GLCanvas: Can't get visual\n" ); return -1; } /* Change canvas defaults */ fl_set_canvas_visual( ob, vi->visual ); fl_set_canvas_depth( ob, vi->depth ); fl_set_canvas_colormap( ob, fl_create_colormap( vi, 1 ) ); context = glXCreateContext( fl_display, vi, None, GLPROP( ob )->direct ); if ( ! context ) { fprintf( stderr, "Can't create GLX context!\n" ); return -1; } /* Under some conditions the parent of the gl canvas might go away, leaving the old context and vi hanging. */ glx_cleanup( ob ); GLPROP( ob )->context = context; GLPROP( ob )->xvinfo = vi; return 0; } /*************************************** * This routine is called after a valid window is created. It simply * binds the OpenGL context to the canvas window ***************************************/ static int glx_activate( FL_OBJECT * ob ) { glXMakeCurrent( fl_display, FL_ObjWin( ob ), GLPROP( ob )->context ); return 0; } /*************************************** * Cleanup is called before destroying the window. Might be called * more than once ***************************************/ static int glx_cleanup( FL_OBJECT * ob ) { if ( GLPROP( ob )->context ) { glXDestroyContext( fl_display, GLPROP( ob )->context ); XFree( GLPROP( ob )->xvinfo ); GLPROP( ob )->context = 0; GLPROP( ob )->xvinfo = 0; } return 0; } /*************************************** ***************************************/ static void copy_attributes( int * dest, const int * src ) { while ( *src != None ) *dest++ = *src++; *dest = None; } /************************************************************* * Open a top-level OpenGL window. * * fl_winset won't work for switching OpenGL windows. * Use glXMakeCurrent ************************************************************/ Window fl_glwincreate( int * config, GLXContext * context, int w, int h ) { XVisualInfo *xvi; XSetWindowAttributes xswa; unsigned int mask; Window win; if ( ! glXQueryExtension( fl_display, 0, 0 ) ) return None; if ( ! ( xvi = glXChooseVisual( fl_display, fl_screen, config ? config : glconfig ) ) ) return None; *context = glXCreateContext( fl_display, xvi, None, GL_TRUE ); xswa.colormap = fl_create_colormap( xvi, 1 ); xswa.border_pixel = 0; mask = CWColormap | CWBorderPixel; xswa.event_mask = ExposureMask | StructureNotifyMask; mask |= CWEventMask; win = XCreateWindow( fl_display, RootWindow( fl_display, fl_screen ), 0, 0, w, h, 0, xvi->depth, InputOutput, xvi->visual, mask, &xswa ); if ( win ) glXMakeCurrent( fl_display, win, *context ); return win; } /*************************************** ***************************************/ Window fl_glwinopen( int * config, GLXContext * context, int w, int h ) { Window win; if ( ( win = fl_glwincreate( config, context, w, h ) ) ) fl_winshow( win ); return win; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/gl/glcanvas.h0000644000175000017500000000273011665175646012351 00000000000000#ifndef FL_GLCANVAS_H #define FL_GLCANVAS_H #if defined( __cplusplus ) extern "C" { #endif #include /* OpenGL canvases */ FL_EXPORT FL_OBJECT * fl_create_glcanvas( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_glcanvas( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT void fl_set_glcanvas_defaults( const int * config ); FL_EXPORT void fl_get_glcanvas_defaults( int * cconfig ); FL_EXPORT void fl_set_glcanvas_attributes( FL_OBJECT * ob, const int * config ); FL_EXPORT void fl_get_glcanvas_attributes( FL_OBJECT * ob, int * attributes ); FL_EXPORT void fl_set_glcanvas_direct( FL_OBJECT * ob, int direct ); FL_EXPORT void fl_activate_glcanvas( FL_OBJECT * ob ); FL_EXPORT XVisualInfo * fl_get_glcanvas_xvisualinfo( FL_OBJECT * ob ); FL_EXPORT GLXContext fl_get_glcanvas_context( FL_OBJECT * ob ); FL_EXPORT Window fl_glwincreate( int * config, GLXContext * context, int w, int h ); FL_EXPORT Window fl_glwinopen( int * config, GLXContext * context, int w, int h ); #if defined( __cplusplus ) } #endif #endif /* NOT FL_GLCANVAS_H */ xforms-1.2.4/gl/Makefile.am0000664000175000017500000000057712353623325012432 00000000000000include $(top_srcdir)/config/common.am # forms.h is a generated file INCLUDES = -DMAKING_FORMS -I../lib -I$(top_srcdir)/lib $(X_CFLAGS) include_HEADERS = glcanvas.h lib_LTLIBRARIES = libformsGL.la libformsGL_la_LDFLAGS = -no-undefined -version-info @SO_VERSION@ libformsGL_la_LIBADD = ../lib/libforms.la $(X_LIBS) -lGL -lX11 libformsGL_la_SOURCES = \ glcanvas.c \ glcanvas.h xforms-1.2.4/configure.ac0000664000175000017500000001546612353623371012266 00000000000000dnl Process with autoconf to generate configure script -*- sh -*- AC_PREREQ(2.59) AC_INIT([xforms],[1.2.4],[xforms-development@nongnu.org]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_SRCDIR(lib/forms.c) XFORMS_CHECK_VERSION AC_CANONICAL_TARGET AC_CONFIG_HEADERS([lib/config.h]) AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION) AM_MAINTAINER_MODE AC_CONFIG_MACRO_DIR([config]) ### This defines the version number of the installed .so files ### using libtool's versioning system. AC_SUBST(SO_VERSION, ["3:3:1"]) # Fix the value of the prefixes. test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Check if the bwc-bs-hack is to be used AC_ARG_ENABLE(bwc_bs_hack, [ AS_HELP_STRING( [--enable-bwc-bs-hack], [enable backward compatiblity hack for browser, scrollbar and tabfolder objects])]) AM_CONDITIONAL(USE_BWC_BS_HACK, test x$enable_bwc_bs_hack = xyes) # Check if old style edit keys are to be used AC_ARG_ENABLE(classic_editkeys, [AS_HELP_STRING([--enable-classic-editkeys], [enable backward compatiblity for behaviour of input edit keys])]) AM_CONDITIONAL(USE_CLASSIC_EDITKEYS, test x$enable_classic_editkeys = xyes) # Check if demos are to be build AC_ARG_ENABLE(demos, [AS_HELP_STRING([--enable-demos], [Build demo programs])]) AM_CONDITIONAL(BUILD_DEMOS, test x$enable_demos = xyes) # Check if docs are to be build AC_ARG_ENABLE(docs, [AS_HELP_STRING([--enable-docs], [build documentation (needs makeinfo)])]) AM_CONDITIONAL(BUILD_DOCS, test x$enable_docs = xyes) # If docs are to be built check for presence of texi2html and pdftex (or # similar), needed for building the html and pdf versions of the docs, # respectively if test BUILD_DOCS; then XFORMS_CHECK_TEXI2HTML XFORMS_CHECK_TEXI2DVI fi AM_CONDITIONAL([BUILD_HTML_DOCS],[test x$TEXI2HTML != xno]) AM_CONDITIONAL([BUILD_PDF_DOCS],[test x$TEXI2DVI != x"no"]) ### Check for programs XFORMS_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_MAKE_SET #### AC_PROG_RANLIB has become obsolete ### Check for special systems AC_ISC_POSIX AC_AIX ### Check for some Cygwin-specific details. CHECK_WITH_CYGWIN # Work around a problem in automake 1.4: when invoking install-strip, # INSTALL_PROGRAM is changed to 'install -s', and since # INSTALL_SCRIPT==INSTALL_PROGRAM, we get errors with fileutils-4.0 # which returns an error condition when stripping fails. INSTALL_SCRIPT='${INSTALL}' ### Setup libtool AC_PROG_LIBTOOL #AC_REQUIRE([AC_CANONICAL_HOST])_LT_SET_OPTION([LT_INIT],[win32-dll]) #AC_DIAGNOSE([obsolete],[AC_LIBTOOL_WIN32_DLL: Remove this warning and the call to _LT_SET_OPTION when you #put the `win32-dll' option into LT_INIT's first parameter.]) LT_INIT([]) ### Add extra directories to check for libraries. XFORMS_WITH_DIR([extra-lib],[extra library directory],extra_lib, NONE) XFORMS_LOOP_DIR($xforms_cv_extra_lib,XFORMS_ADD_LIB_DIR(xforms_ldflags,$dir)) test ! x"$xforms_ldflags" = x && LDFLAGS="$xforms_ldflags $LDFLAGS" ### Add extra directories to check for include files. XFORMS_WITH_DIR([extra-inc],[extra include directory],extra_inc, NONE) XFORMS_LOOP_DIR($xforms_cv_extra_inc,XFORMS_ADD_INC_DIR(xforms_cppflags,$dir)) test ! x"$xforms_cppflags" = x && CPPFLAGS="$xforms_cppflags $CPPFLAGS" ### Add both includes and libraries XFORMS_WITH_DIR([extra-prefix],[extra lib+include directory],extra_prefix, NONE, ${prefix}) XFORMS_LOOP_DIR($xforms_cv_extra_prefix,[ XFORMS_ADD_INC_DIR(CPPFLAGS,$dir/include) XFORMS_ADD_LIB_DIR(LDFLAGS,$dir/lib)]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST dnl used AC_TYPE_PID_T AC_TYPE_SIZE_T # Checks for libraries. dnl by testing these we check if it is ok to have dnl -lc and -lm as args to the compiler AC_CHECK_LIB(m, sin) AC_CHECK_LIB(c, fopen) # Checks for header files. AC_CHECK_HEADERS([sys/select.h]) # Check whether we want to build the gl code AC_ARG_ENABLE(gl, [AS_HELP_STRING([--disable-gl],[Do not build GL support library])]) if test x$enable_gl != xno ; then AC_CHECK_HEADER([GL/glx.h],, [enable_gl=no]) fi AM_CONDITIONAL(BUILD_GL, [test x$enable_gl != xno]) dnl we have some code in lib/listdir.c that could use that... dnl AC_HEADER_DIRENT # Check for X, XPM and JPEG AC_PATH_XTRA XFORMS_PATH_XPM XFORMS_CHECK_LIB_JPEG # Checks for library functions. AC_TYPE_SIGNAL if test $ac_cv_type_signal = "void" ; then AC_DEFINE(RETSIGTYPE_IS_VOID, 1, [Define if the return type of signal handlers is void]) fi AC_CHECK_FUNCS([snprintf strcasecmp strerror usleep nanosleep vsnprintf vasprintf sigaction]) XFORMS_CHECK_DECL(snprintf, stdio.h) XFORMS_CHECK_DECL(vsnprintf, stdio.h) XFORMS_CHECK_DECL(vasprintf, stdio.h) XFORMS_CHECK_DECL(sigaction, signal.h) ### Emit some information on what just happened VERSION_INFO="Configuration:\n Host type: ${host} Special build flags: ${xforms_flags} C Compiler: ${CC} C Compiler flags: ${CFLAGS} Linker flags: ${LDFLAGS}\n" AC_SUBST(X_LIBS) AC_SUBST(X_PRE_LIBS) ## Some config.h stuff AH_TOP([ /* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* \file config.h * * This is the compilation configuration file for xforms. * It was generated by autoconfs configure. * You might want to change some of the defaults if something goes wrong * during the compilation. */ #ifndef CONFIG_H #define CONFIG_H ]) AH_BOTTOM([ #endif /* NOT CONFIG_H */ ]) ### Finish the work. AC_CONFIG_FILES([Makefile \ libforms.spec \ lib/include/AAA.h \ config/Makefile \ lib/Makefile \ lib/bitmaps/Makefile \ lib/fd/Makefile \ lib/include/Makefile \ lib/private/Makefile \ image/Makefile gl/Makefile \ fdesign/Makefile \ fdesign/fd/Makefile \ fdesign/spec/Makefile \ fdesign/xpm/Makefile \ fd2ps/Makefile \ fd2ps/test/Makefile \ demos/Makefile \ demos/fd/Makefile \ doc/Makefile \ doc/xforms_images/Makefile ]) AC_OUTPUT # show version information echo printf "$VERSION_INFO" echo # Display a final warning if there has been a XFORMS_ERROR XFORMS_CHECK_ERRORS xforms-1.2.4/fd2ps/0000775000175000017500000000000012353624653011066 500000000000000xforms-1.2.4/fd2ps/Makefile.in0000664000175000017500000006642112353624173013061 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/common.am bin_PROGRAMS = fd2ps$(EXEEXT) subdir = fd2ps ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_fd2ps_OBJECTS = align.$(OBJEXT) fd2ps.$(OBJEXT) flsupport.$(OBJEXT) \ image2ps.$(OBJEXT) load.$(OBJEXT) papers.$(OBJEXT) \ pscol.$(OBJEXT) psdraw.$(OBJEXT) psobj.$(OBJEXT) \ pstext.$(OBJEXT) readxpm.$(OBJEXT) sys.$(OBJEXT) \ version.$(OBJEXT) xbmtops.$(OBJEXT) xpmtops.$(OBJEXT) fd2ps_OBJECTS = $(am_fd2ps_OBJECTS) am__DEPENDENCIES_1 = fd2ps_DEPENDENCIES = ../lib/libforms.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/lib depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(fd2ps_SOURCES) DIST_SOURCES = $(fd2ps_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FL_FIXLEVEL = @FL_FIXLEVEL@ FL_REVISION = @FL_REVISION@ FL_VERSION = @FL_VERSION@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIB = @JPEG_LIB@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ TEXI2DVI = @TEXI2DVI@ TEXI2DVI_NEEDS_PDF = @TEXI2DVI_NEEDS_PDF@ TEXI2HTML = @TEXI2HTML@ VERSION = @VERSION@ XMKMF = @XMKMF@ XPM_LIB = @XPM_LIB@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign DISTCLEANFILES = *.orig *.rej *~ *.bak core makelog MAINTAINERCLEANFILES = $(srcdir)/Makefile.in makelog AM_INSTALL_DATA_FLAGS = $(INSTALL) -m 644 -D CLEANFILES = fd2ps.1 EXTRA_DIST = Readme fd2ps.man SUBDIRS = test man_MANS = fd2ps.1 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/lib $(X_CFLAGS) fd2ps_LDADD = ../lib/libforms.la $(X_LIBS) $(X_PRE_LIBS) $(LIBS) $(X_EXTRA_LIBS) fd2ps_SOURCES = \ align.c \ fd2ps.c \ fd2ps.h \ flsupport.c \ global.h \ image2ps.c \ load.c \ papers.c \ pscol.c \ psdraw.c \ psobj.c \ pstext.c \ readxpm.c \ sys.c \ version.c \ xbmtops.c \ xpmtops.c all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/common.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign fd2ps/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign fd2ps/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/common.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list fd2ps$(EXEEXT): $(fd2ps_OBJECTS) $(fd2ps_DEPENDENCIES) $(EXTRA_fd2ps_DEPENDENCIES) @rm -f fd2ps$(EXEEXT) $(LINK) $(fd2ps_OBJECTS) $(fd2ps_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/align.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd2ps.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flsupport.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image2ps.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/load.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/papers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pscol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/psdraw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/psobj.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pstext.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readxpm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sys.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbmtops.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpmtops.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list=''; test -n "$(man1dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) $(MANS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-man install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man1 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-man1 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 fd2ps.1: cp -p $(srcdir)/fd2ps.man fd2ps.1 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xforms-1.2.4/fd2ps/papers.c0000644000175000017500000000452712251675455012455 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file papers.c * * This file is part of XForms package * Copyright (c) 1997-2000 by T.C. Zhao * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "fd2ps.h" #ifdef __EMX__ #define strcasecmp stricmp #endif struct paper { const char * name; const char * size; float w, /* in inches */ h; }; static struct paper papers[ ] = { { "Letter", "8.5x11in", 8.5, 11.0 }, { "Legal", "8.5x14in", 8.5, 14.0 }, { "A4", "210x295mm", 7.27, 11.61 }, /* European 210x295mm */ { "B4", "257x364mm", 10.1, 14.33 }, /* Janpanese 275x364mm */ { "B5", "18x20cm", 7.283, 10.630 }, { "B", "11x17in", 11.0, 17.0 }, /* US tabloid */ { "Note", "4x5in", 4.0, 5.0 }, /* sentinel */ { NULL, NULL, 0.0, 0.0 } }; /*************************************** ***************************************/ void get_paper_size( const char * name, float * w, float * h ) { struct paper *p = papers; for ( ; p->name; p++ ) if ( strcasecmp( name, p->name ) == 0 ) { *w = p->w; *h = p->h; return; } fprintf( stderr, "Unknown paper name %s - ignored\n", name ); } /*************************************** ***************************************/ void list_papers( const char * prefix ) { struct paper *p = papers; for ( ; p->name; p++ ) fprintf( stderr, "%s%s\t(%s)\n", prefix, p->name, p->size ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fd2ps/xbmtops.c0000644000175000017500000001071012252435412012632 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file xbmtops.c * * This file is part of XForms package * Copyright (c) 1997-2000 by T.C. Zhao * All rights reserved. * * Turn an xbm file into PostScript */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "fd2ps.h" #include #include static int gethexint( FILE * fp ) { char buf[ 20 ], *p; int c; while ( ( c = getc( fp ) ) == ',' || isspace( ( unsigned char ) c ) ) /* empty */ ; if (c == EOF) return -1; for ( p = buf; c != EOF && c != ',' && !isspace( ( unsigned char ) c ); c = getc( fp ) ) *p++ = c; *p = '\0'; return strtol(buf, 0, 16); } #define MAXH 500 static int bit_w, bit_h; static char *bit_buf[ MAXH ]; static int read_xbm( const char * f ) { char buf[ 256 ]; int nosize, c, i, j, ct, err; FILE *fp; char *bits; if ( ! ( fp = fopen( f, "r" ) ) ) { fprintf( stderr, "Can't open xbm '%s'\n", f ); return -1; } bit_w = bit_h = 0; for ( nosize = 1; nosize && fgets( buf, sizeof buf - 1, fp ); ) { if ( sscanf( buf, "#define %*s %d", &c ) == 1 ) { if ( strstr( buf, "_width" ) ) bit_w = c; else if ( strstr( buf, "_height" ) ) bit_h = c; nosize = bit_w < 1 || bit_h < 1; } } if ( bit_h > MAXH ) { fprintf( stderr, "bitmap too large. truncated\n" ); bit_h = MAXH; } for ( i = 0; i < bit_h; i++ ) { if ( bit_buf[ i ] ) free( bit_buf[ i ] ); bit_buf[ i ] = calloc( bit_w, sizeof *bit_buf[ i ] ); } /* skip until getting a brace */ while ( ( c = getc( fp ) ) != EOF && c != '{' ) /* empty */ ; if ( feof( fp ) || ferror( fp ) ) { fprintf( stderr, "error reading xb, file '%s'\n", f ); bit_w = 0; return -1; } /* read the data */ for ( j = err = c = 0; j < bit_h && ! err; j++ ) { bits = bit_buf[ bit_h - 1 - j ]; for ( i = ct = 0; i < bit_w && ! err; i++, ct = ( ct + 1 ) & 7 ) { if ( ct == 0 ) err = ( c = gethexint( fp ) ) < 0; *bits++ = c & 1; c = c >> 1; } } if ( err ) fprintf( stderr, "Junk in bitmap file '%s' hex stream\n", f ); return j > bit_h / 2 ? 0 : -1; } void draw_bitmap( const char * f, float x, float y, float w, float h, long fcol, long bcol ) { int i, j, r, g, b; char *bits; float xx, yy; fd2psCMAP cmap[ 2 ]; short *pixels, *pix; read_xbm( f ); if ( bit_w < 1 ) return; xx = x + ( w - bit_w ) / 2; yy = y + ( h - bit_h ) / 2; /* in xforms, bitmap is really an image with two colors, not * neccessarily black and white */ fl_query_imap( bcol, &r, &g, &b ); cmap[ 0 ].red = r; cmap[ 0 ].green = g; cmap[ 0 ].blue = b; fl_query_imap( fcol, &r, &g, &b ); cmap[ 1 ].red = r; cmap[ 1 ].green = g; cmap[ 1 ].blue = b; pix = pixels = malloc( bit_w * bit_h * sizeof *pixels ); for ( j = 0; j < bit_h; j++ ) { bits = bit_buf[ bit_h - 1 - j ]; for ( i = 0; i < bit_w; i++, bits++, pix++ ) *pix = ( *bits != 0 ); } ps_verbatim( "\n%% Start of XBM file %s %%{\n", f ); ps_output( "gsave " ); ps_output( "%.1f %.1f translate\n", xx, yy ); if ( flps->colorps ) image2colorps( pixels, bit_w, bit_h, cmap, 2, 0 ); else image2grayps( pixels, bit_w, bit_h, cmap, 2, 0 ); ps_verbatim( "\ngrestore%%}\n" ); free( pixels ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fd2ps/image2ps.c0000644000175000017500000001161412251675463012664 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file image2ps.c * * This file is part of XForms package * Copyright (c) 1997-2000 by T.C. Zhao * All rights reserved. * * Turn a colormapped image into PostScript */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "fd2ps.h" static const char *hexdigits = "0123456789abcdef"; #define LINELENGTH 37 /*************************************** ***************************************/ int image2colorps( short * pixels, int w, int h, fd2psCMAP * map, int ncol FL_UNUSED_ARG, const char * cmt) { int x, y, k, r, g, b; int *rb, *gb, *bb; char pscmd[ 128 ]; short *p; strcpy( pscmd, ps_literal( ( cmt && *cmt ) ? cmt : "startColorImage" ) ); ps_output( "/redstring %d string def\n", w ); ps_output( "/grnstring %d string def\n", w ); ps_output( "/blustring %d string def\n", w ); ps_output( "/%s\n", pscmd ); ps_output( "{%d %d 8 [ %d 0 0 -%d 0 %d]\n", w, h, w, h, h ); ps_output( " {currentfile redstring readhexstring pop}\n" ); ps_output( " {currentfile grnstring readhexstring pop}\n" ); ps_output( " {currentfile blustring readhexstring pop}\n" ); ps_output( " true 3 colorimage\n } bind def\n"); /* Start */ ps_output( "%d %d scale\n", w, h ); ps_verbatim( "%s\n", pscmd ); rb = malloc( w * sizeof *rb ); gb = malloc( w * sizeof *gb ); bb = malloc( w * sizeof *bb ); for ( p = pixels, k = y = 0; y < h; y++ ) { for ( x = 0; x < w; x++, p++ ) { rb[ x ] = map[ *p ].red; gb[ x ] = map[ *p ].green; bb[ x ] = map[ *p ].blue; } for ( x = 0; x < w; x++ ) { r = rb[ x ]; ps_output( "%c%c", hexdigits[ ( r >> 4 ) & 15 ], hexdigits[ r & 15 ] ); if ( ++k % LINELENGTH == 0 ) ps_output( "\n" ); } for ( x = 0; x < w; x++ ) { g = gb[ x ]; ps_output( "%c%c", hexdigits[ ( g >> 4 ) & 15 ], hexdigits[ g & 15 ] ); if ( ++k % LINELENGTH == 0 ) ps_output( "\n" ); } for ( x = 0; x < w; x++ ) { b = bb[ x ]; ps_output( "%c%c", hexdigits[ ( b >> 4 ) & 15 ], hexdigits[ b & 15 ] ); if ( ++k % LINELENGTH == 0 ) ps_output( "\n" ); } } free( rb ); free( gb ); free( bb ); return 0; } /*************************************** ***************************************/ int image2grayps( short * pixels, int w, int h, fd2psCMAP * map, int ncol, const char * cmt) { int x, y, k, r; char pscmd[ 128 ]; short *p; strcpy( pscmd, ps_literal( ( cmt && *cmt ) ? cmt : "startGrayImage" ) ); ps_output( "/graystring %d string def\n", w ); ps_output( "/%s\n", pscmd ); ps_output( "{%d %d 8 [ %d 0 0 -%d 0 %d]\n", w, h, w, h, h ); ps_output( " {currentfile graystring readhexstring pop}\n" ); ps_output( " image \n} bind def\n" ); ps_output( "%d %d scale\n", w, h ); ps_verbatim( "%s\n", pscmd ); /* convert colormap to grayscale */ for ( x = 0; x < ncol; x++ ) map[ x ].red = rgb2gray( map[ x ].red, map[ x ].green, map[ x ].blue ); for ( p = pixels, k = y = 0; y < h; y++ ) { for ( x = 0; x < w; x++, p++ ) { r = map[ *p ].red; ps_output( "%c%c", hexdigits[ ( r >> 4 ) & 15 ], hexdigits[ r & 15 ] ); if ( ++k % LINELENGTH == 0 ) ps_output( "\n" ); } } return 0; } /*************************************** ***************************************/ char * ps_literal( const char * s ) { static char buf[ 1024 ]; char *p = buf; for ( *p = '\0'; s && *s; s++ ) *p++ = ( PS_SPECIAL( *s ) ) ? '$' : *s; *p = '\0'; return buf; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fd2ps/pstext.c0000644000175000017500000002314412251675441012501 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file pstext.c * * This file is part of XForms package * Copyright (c) 1997-2000 by T.C. Zhao * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "fd2ps.h" #include char *ul_magic_char = "\010"; /*************************************** ***************************************/ void ps_text_init( void ) { ps_output( "/point {SX SY add 2 div div} BD\n" ); ps_output( "/SetFont {findfont exch scalefont setfont} BD\n" ); ps_output( "/Lshow {show} BD\n" ); ps_output( "/Cshow {dup stringwidth pop -2 div 0 rmoveto show} BD\n" ); ps_output( "/Rshow {dup stringwidth pop neg 0 rmoveto show} BD\n" ); ps_output( "/CP {currentpoint} bind def /SW {stringwidth} BD\n" ); } /* * Text stuff. Default fonts follows the XFORM built-in */ static const char *fnts[ FL_MAXFONTS ] = { "Helvetica", "Helvetica-Bold", "Helvetica-Oblique", "Helvetica-BoldOblique", "Courier", "Courier-Bold", "Courier-Oblique", "Courier-BoldOblique", "Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic", /* xforms users charter */ "Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic", "Symbol" }; static int cur_style = -1, cur_size = -1; /*************************************** ***************************************/ void ps_invalidate_font_cache( void ) { cur_style = cur_size = -1; } /*************************************** ***************************************/ void ps_set_font( int style, int size ) { if ( style >= FL_SHADOW_STYLE ) style %= FL_SHADOW_STYLE; if ( style == cur_style && cur_size == size ) return; ps_output( "%d point /%s SetFont\n", size, fnts[ style ] ); ps_output( "/H %d point def\n", size ); cur_style = style; cur_size = size; } #define has_desc(s) (strchr(s,'g')||strchr(s,'j')||\ strchr(s,'q')||strchr(s,'y')||strchr(s,'p')) #define is_desc(c) (c=='g'||(c=='j')||(c=='q')||(c=='y')||(c=='p')) /*************************************** ***************************************/ static void do_underline( const char * s, int n ) { ps_output( "/len (%s) SW pop def\n", s ); if ( n == -1 ) { ps_output( "/ty CP exch pop %d sub def ", 1 + has_desc( s ) * 2 ); ps_output( "/tx CP pop len sub def " ); ps_output( "tx ty M len tx add ty LT S\n" ); } else { char *t = fl_strdup( s ); *( t + n ) = '\0'; ps_output( "/ul (%c) SW pop def\n", *( s + n ) ); ps_output( "/ty CP exch pop %d sub def ", 1 + is_desc(s[ n ] ) * 2 ); ps_output( "/tx CP pop len sub (%s) SW pop add def\n", t ); ps_output( "tx ty M ul tx add ty LT S\n" ); free( t ); } } /*************************************** ***************************************/ #define Quote( c ) ( c == '(' || c == ')' || c == '%' ) static char * ps_quote( char *str ) { static char buf[ 1024 ]; char *s, *q = buf; for ( s = str; *s; s++ ) { if ( Quote( *s ) ) *q++ = '\\'; *q++ = *s; } *q = '\0'; return buf; } /*************************************** * This routine is always called by other routines. Once we get here, * the text would always remain within the box specified by * {x,y,w,h}. ***************************************/ static void ps_drw_text( int align, float x, float y, float w, float h, long c, int style, int size, const char * sstr ) { int ulpos = -1, lnumb; int i; char *lines[ 512 ]; char *str; char newlabel[ 255 ], *p; float bw = 2; int halign, valign; ps_color( c ); ps_set_font( style, size ); str = fl_strdup( sstr ); lines[ 0 ] = str; /* Split (multi-line)string into lines */ for ( i = 0, lnumb = 1; str[ i ] != '\0'; i++ ) if ( str[ i ] == '\n' ) { str[ i ] = '\0'; lines[ lnumb ] = str + i + 1; lnumb++; } fl_get_hv_align( align, &halign, &valign ); /* Figure out where the starting point is */ switch ( halign ) { case FL_ALIGN_CENTER: ps_output( "/x %.1f def ", x + 0.5 * w ); break; case FL_ALIGN_LEFT: ps_output( "/x %.1f def ", bw + x ); break; case FL_ALIGN_RIGHT: ps_output( "/x %.1f def ", x + w - 1 - bw ); break; } switch ( valign ) { case FL_ALIGN_TOP: ps_output( "/y %.1f H sub def\n", y + h - bw ); break; case FL_ALIGN_BOTTOM: ps_output( "/y %.1f %.1f H mul add def\n", y + bw, lnumb - 0.9 ); break; case FL_ALIGN_CENTER: ps_output( "/y %.1f %.1f H mul add def\n", y + 0.5 * h, 0.5 * lnumb - 0.9 ); break; } for ( i = 0; i < lnumb; i++ ) { /* Check if have underline request */ if ( ( p = strchr( lines[ i ], *ul_magic_char ) ) ) { char *q; ulpos = p - lines[ i ]; q = newlabel; p = lines[ i ]; for ( ; *p; p++ ) if ( *p != *ul_magic_char ) *q++ = *p; *q = 0; lines[ i ] = newlabel; } ps_output( "x y M " ); switch ( halign ) { case FL_ALIGN_CENTER: ps_output( "(%s) Cshow\n", ps_quote( lines[ i ] ) ); break; case FL_ALIGN_LEFT: ps_output( "(%s) Lshow\n", ps_quote( lines[ i ] ) ); break; case FL_ALIGN_RIGHT: ps_output( "(%s) Rshow\n", ps_quote( lines[ i ] ) ); break; } if ( ulpos >= 0 ) do_underline( lines[ i ], ulpos - 1 ); ulpos = -1; if ( i != lnumb - 1 ) ps_output( "/y y H sub def\n" ); } free( str ); } /*************************************** ***************************************/ #define D( x, y, c ) ps_drw_text( align, x, y, w, h, c, style, size, str ) void ps_draw_text( int align, float x, float y, float w, float h, long col, int style, int size, const char * str) { int special = FL_INVALID_STYLE; if ( ! str || ! *str ) return; if ( *str == '@' ) { ps_draw_symbol( str, x, y, w, h, col ); return; } if ( special_style( style ) ) { special = ( style / FL_SHADOW_STYLE ) * FL_SHADOW_STYLE; style %= FL_SHADOW_STYLE; } if ( special == FL_SHADOW_STYLE ) D( x + 2, y - 2, FL_BOTTOM_BCOL ); else if ( special == FL_ENGRAVED_STYLE ) { D( x - 1, y, FL_RIGHT_BCOL ); D( x, y + 1, FL_RIGHT_BCOL ); D( x - 1, y + 1, FL_RIGHT_BCOL ); D( x + 1, y, FL_LEFT_BCOL ); D( x, y - 1, FL_LEFT_BCOL ); D( x + 1, y - 1, FL_LEFT_BCOL ); } else if ( special == FL_EMBOSSED_STYLE ) { D( x - 1, y, FL_TOP_BCOL ); D( x, y + 1, FL_TOP_BCOL ); D( x - 1, y + 1, FL_TOP_BCOL ); D( x + 1, y, FL_RIGHT_BCOL ); D( x, y - 1, FL_RIGHT_BCOL ); D( x + 1, y - 1, FL_RIGHT_BCOL ); } ps_drw_text( align, x, y, w, h, col, style, size, str ); } /*************************************** ***************************************/ void ps_draw_text_beside( int align, float x, float y, float w, float h, long col, int style, int size, const char * str ) { int newa, newx, newy; if ( ! str || ! *str ) return; align = fl_to_outside_lalign( align ); #if 1 fl_get_outside_align( align, x, y, w, h, &newa, &newx, &newy ); ps_draw_text( newa, newx, newy, w, h, col, style, size, str ); #else if ( align == FL_ALIGN_LEFT ) ps_draw_text( FL_ALIGN_RIGHT, x - h, y, h, h, col, style, size, str ); else if ( align == FL_ALIGN_RIGHT ) ps_draw_text( FL_ALIGN_LEFT, x + w, y, h, h, col, style, size, str ); else if ( align == FL_ALIGN_TOP ) ps_draw_text( FL_ALIGN_BOTTOM, x, y + h, w, h, col, style, size, str ); else if ( align == FL_ALIGN_BOTTOM ) ps_draw_text( FL_ALIGN_TOP, x, y - h, w, h, col, style, size, str ); else ps_draw_text( FL_ALIGN_CENTER, x, y, w, h, col, style, size, str ); #endif } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fd2ps/fd2ps.man0000644000175000017500000000673211665175512012527 00000000000000.\" .\" $Id: fd2ps.man,v 1.3 2009/11/03 23:23:37 jtt Exp $ .\" .\" Man page for Forms Designer .\" Use the following command to generate viewable man page .\" tbl fdesign.1 | {nt}roff -man .\" .\" ul | more -fsk to view .\" .\" .TH FD2PS 1L "October 2009" "Version 0.36" "Forms Library" .SH NAME fd2ps \- Translates fdesign output to PostScript .\" .\" setup .de Cr .ie n (c) .el \(co .. .SH SYNOPSIS .if n fd2ps .if t \{ .B fd2ps \} [-options] input.[fd] [output] .SH DESCRIPTION The program .I fd2ps translates the .I fd file produced by the interface builder program .I fdesign of the .B "Forms Library" into PostScript (ps), or optionally Encapsulated PostScript (eps) for printing or inclusion into other documents. The input file can be given with or without the .fd extension. If output file name is not specified, used is a filename derived from the input file name by replacing the .fd extension with ps or eps. If output filename is specified as \-, stdout is used. .SH OPTIONS .I fd2ps accepts the following command line options .TP 6 .B \-help Prints a brief summary of all command line options. .TP .B \-version Prints the current version of .I fd2ps and exits. .TP .B \-p The option requests portrait orientation. By default, the orientation is switched to landscape if portrait will not fit the page. This option overrides the default. .TP .B \-l This options requests landscape output. .TP .BI \-bw " n" Specifies the border width of the interface. By default this information is obtained from the .fd file. .TP .B \-eps This option requests Encapsulated PostScript instead of the plain PostScript output. .TP .B \-gray This options requests all colors be converted to gray levels. By default, .I fd2ps outputs colors as specified in the .fd file. .TP .B \-G f specifies a gamma factor that will be used to adjust the builtin colors in a non-linear fashion. It can be thought as a way to brighten or dim the builtin colors: larger the gamma, brighter the color. The default gamma is 1.0. .TP .BI \-dpi " f" This option specifies the screen resolution on which the user interface is designed. By giving a smaller or larger dpi number than that of the screen, the output is in effect being enlarged or shrunk. This flag does not affect text size. The default DPI is 85. If the .fd file is specified in device independent unit, this flag does not have effect. .TP .BI \-rgb " file" This option specifies the path to the X color database (rgb.txt) for use in parsing XPM colornames. The default is /usr/lib/X11/rgb.txt. Environment variable .B RGBFile can be used to change the default. .TP .BI \-paper " name" This option specifies the paper name, such as A4, Letter etc. The output PostScript will always center on the page. Use name .I all to get a list of the known paper names and sizes. The default is US Letter unless environment variable .B PAPER is set to one of the known paper names. .TP .BI \-pw " f" Specifies the paper width, in inches. .TP .BI \-ph " f" Specifies the paper height, in inches. .TP .B \-verbose This option specifies verbose output, i.e., comments in the output PostScript file. Most useful for debugging the .I fd2ps program. .SH BUGS Not all objects are currently supported. .SH SEE ALSO fdesign(1L), xforms(5) .SH AUTHOR Copyright .Cr 1997-98 by T.C. Zhao (tc_zhao@yahoo.com) .br Since 2002: GNU Lesser General Public License .br Maintainers: Jean-Marc Lasgouttes, Angus Leeming and Jens Thoms Toerring .SH HOME PAGE http://xforms-toolkit.org .br http://world.std.com/~xforms xforms-1.2.4/fd2ps/pscol.c0000644000175000017500000001321112251704341012254 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file pscol.c * * This file is part of XForms package * Copyright (c) 1997-2000 by T.C. Zhao * All rights reserved. * * Take care of color */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include #include "fd2ps.h" #define VN( a ) a, #a #define NV( a ) #a, a /* slightly different from XForms' built-in due to the difference * between printer and screen */ #define PREVIEW static FLI_IMAP fl_imap[ ] = { { NV( FL_BLACK ), 0, 0, 0, 0, 0 }, { NV( FL_WHITE ), 255, 255, 255, 0, 0 }, { NV( FL_COL1 ), 161, 161, 161, 0, 0 }, /* default color, gray63 */ { NV( FL_MCOL ), 191, 191, 191, 0, 0 }, /* used as magic, gray75 */ { NV( FL_RIGHT_BCOL ), 41, 41, 41, 0, 0 }, /* right gray16 */ { NV( FL_BOTTOM_BCOL ), 89, 89, 89, 0, 0 }, /* bottom gray35 */ { NV( FL_LEFT_BCOL ), 222, 222, 222, 0, 0 }, /* left color gray87 */ { NV( FL_SLATEBLUE ), 113, 113, 198, 0, 0 }, { NV( FL_INDIANRED ), 198, 113, 113, 0, 0 }, { NV( FL_RED ), 255, 0, 0, 0, 0 }, { NV( FL_BLUE ), 0, 0, 255, 0, 0 }, { NV( FL_GREEN ), 0, 255, 0, 0, 0 }, { NV( FL_YELLOW ), 255, 255, 0, 0, 0 }, { NV( FL_MAGENTA ), 255, 0, 255, 0, 0 }, { NV( FL_CYAN ), 0, 255, 255, 0, 0 }, { NV( FL_TOMATO ), 255, 99, 71, 0, 0 }, { NV( FL_INACTIVE ), 110, 110, 110, 0, 0 }, /* gray43 */ { NV( FL_TOP_BCOL ), 204, 204, 204, 0, 0 }, /* top gray80 */ { NV( FL_PALEGREEN ), 113, 198, 113, 0, 0 }, { NV( FL_DARKGOLD ), 205, 149, 10, 0, 0 }, { NV( FL_ORCHID ), 205, 105, 201, 0, 0 }, { NV( FL_DARKCYAN ), 40, 170, 175, 0, 0 }, { NV( FL_DARKTOMATO ), 139, 54, 38, 0, 0 }, { NV( FL_WHEAT ), 255, 231, 155, 0, 0 }, { NV( FL_DARKORANGE ), 255, 128, 0, 0, 0 }, { NV( FL_DEEPPINK ), 255, 0, 128, 0, 0 }, { NV( FL_CHARTREUSE ), 128, 255, 0, 0, 0 }, { NV( FL_DARKVIOLET ), 128, 0, 255, 0, 0 }, { NV( FL_SPRINGGREEN ), 0, 255, 128, 0, 0 }, { NV( FL_DODGERBLUE ), 0, 128, 255, 0, 0 }, { NV( FL_DOGERBLUE ), 0, 128, 255, 0, 0 }, { NV( FL_LIGHTER_COL1 ), 173, 173, 173, 0, 0 }, { NV( FL_DARKER_COL1 ), 153, 153, 153, 0, 0 } }; #define builtin sizeof fl_imap / sizeof *fl_imap /*************************************** * do gamma adjustment ***************************************/ void apply_gamma( float gamma ) { FLI_IMAP *fm = fl_imap, *fs; float lastgamma = 1.0; if ( FL_abs( gamma ) < 1.0e-3 ) { fprintf( stderr, "fd2ps: Bad Gamma value %.2f\n", gamma ); return; } for ( fs = fm + builtin; fm < fs; fm++ ) { if ( psinfo.verbose ) fprintf( stderr, "fm->r=%d\n", fm->r ); fm->r = 0.4 + 255.0 * pow( fm->r / 255.0, lastgamma / gamma ); fm->g = 0.4 + 255.0 * pow( fm->g / 255.0, lastgamma / gamma ); fm->b = 0.4 + 255.0 * pow( fm->b / 255.0, lastgamma / gamma ); if ( psinfo.verbose ) fprintf( stderr, "fm->r=%d\n", fm->r ); } } /*************************************** ***************************************/ void fl_query_imap( long col, int * r, int * g, int * b ) { FLI_IMAP *flmap = fl_imap, *flmape = flmap + builtin; for ( ; flmap < flmape; flmap++ ) if ( col == ( long ) flmap->index ) { *r = flmap->r; *g = flmap->g; *b = flmap->b; return; } } #define C2NC( c ) ( 1.0 / 255.0 * c ) static long cur_color = -1; /*************************************** ***************************************/ void ps_invalidate_color_cache( void ) { cur_color = -1; } /*************************************** ***************************************/ void ps_color( long color ) { int r = 0, g = 0, b = 0; if ( color == cur_color ) return; fl_query_imap( color, &r, &g, &b ); if ( psinfo.colorps && ( r != g || r != b ) ) ps_output( "%.3g %.3g %.3g RGB ", C2NC( r), C2NC( g ), C2NC( b ) ); else ps_output( "%.3g G ", C2NC( rgb2gray( r, g, b ) ) ); cur_color = color; } /*************************************** ***************************************/ int get_gray255( long color ) { int r = 0, g = 0, b = 0; fl_query_imap( color, &r, &g, &b ); return rgb2gray( r, g, b ) + 0.1; } /*************************************** ***************************************/ int fl_get_namedcolor( const char * s ) { FLI_IMAP *flmap = fl_imap, *flmape = flmap + builtin; for ( ; s && flmap < flmape; flmap++ ) if ( strcmp(s, flmap->name) == 0 ) return flmap->index; /* a wild shot */ return s ? atoi( s ) : 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fd2ps/psdraw.c0000644000175000017500000012315212251707156012451 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file psdraw.c * * This file is part of XForms package * Copyright (c) 1997-2000 by T.C. Zhao * All rights reserved. * * Some primitive drawing routines is PS * * (x,y) (w,h) passed to all drawing functions are relative * to PS coordinate system and the unit is point. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "fd2ps.h" #include "flinternal.h" #include static float cur_lwx = 1, cur_lwy = 1; /*************************************** ***************************************/ void ps_log( const char *s ) { fprintf( flps->fp, "%%%s", s ); } #include /*************************************** ***************************************/ void ps_output( const char * fmt, ... ) { va_list args; char buf[ 2048 ], *q; int lastc = flps->lastc; va_start( args, fmt ); vsprintf( buf, fmt, args ); va_end( args ); if ( ! flps->pack ) fprintf( flps->fp, "%s", buf ); else { flps->literal = 0; for ( q = buf; *q; q++ ) { if ( *q == '\n' ) *q = ' '; if ( *q == '(' ) flps->literal = 1; else if ( *q == ')' ) flps->literal = 0; if ( lastc == ' ' && *q == ' ' && flps->literal ) continue; if ( *q == ' ' && flps->len == 0 ) continue; if ( *q == ' ' && flps->len >= 69 ) { putc( '\n', flps->fp ); flps->len = 0; } else { lastc = *q; flps->len++; putc( *q, flps->fp ); } } flps->lastc = lastc; } } /*************************************** ***************************************/ void ps_set_clipping( int x, int y, int w, int h ) { ps_output( "gsave newpath %d %d %d %d rectclip\n", x, y, w, h ); } /*************************************** ***************************************/ void ps_unset_clipping( void ) { ps_output( "grestore\n" ); ps_invalidate_color_cache( ); } /*************************************** ***************************************/ void ps_verbatim( const char * fmt, ... ) { va_list args; va_start( args, fmt ); vfprintf( flps->fp, fmt, args ); va_end( args ); } /*************************************** ***************************************/ void ps_set_linewidth( float lwx, float lwy ) { ps_output( "gsave %.2g %.2g LW\n", cur_lwx = lwx, cur_lwy = lwy ); } /*************************************** ***************************************/ void ps_get_linewidth( float * lwx, float * lwy ) { *lwx = cur_lwx; *lwy = cur_lwy; } /*************************************** ***************************************/ void ps_reset_linewidth( void ) { ps_output( "grestore\n" ); ps_invalidate_color_cache( ); } /* define FAST_POLY to get faster PS polygon at the expense of * larger PS output */ /* #define FAST_POLY */ /******************************************************************** * Basic drawing routines * * Always need to code for different devices * *****************************************************************{**/ /*************************************** * Draw a line in abs coordinate system ***************************************/ void ps_line( float x1, float y1, float x2, float y2, long col ) { ps_color( col ); ps_output( "%.1f %.1f %.1f %.1f L S\n", x2, y2, x1, y1 ); } /*************************************** ***************************************/ void ps_lines( Point * xp, int n, long col ) { Point *xps = xp + n; int cnt = 1; ps_color( col ); for ( ; xp < xps; xp++, cnt++ ) { ps_output( "%.1f %.1f ", ( double ) xp->x, ( double ) xp->y ); if ( cnt % 6 == 0 ) ps_output( "\n" ); } ps_output( "%d linesa\n", n ); } /*************************************** ***************************************/ void ps_poly( int fill, Point * xp, int n, long col ) { Point *xps = xp + n; int cnt = 1; ps_color( col ); for ( ; xp < xps; xp++, cnt++ ) { ps_output( "%.1f %.1f ", ( double ) xp->x, ( double ) xp->y ); if ( cnt % 6 == 0 ) ps_output( "\n" ); } ps_output( "%d P %c\n", n, "SF"[ fill ? 1 : 0 ] ); } /*************************************** ***************************************/ void ps_rectangle( int fill, float x, float y, float w, float h, long col ) { ps_color( col ); ps_output( "%.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f 4 P", x, y, x, y + h - 1, x + w - 1, y + h - 1, x + w - 1, y ); ps_output( " %c\n", "SF"[ fill ? 1 : 0 ] ); } /*************************************** * rectangle with rounded corners ***************************************/ #define RS 16 /* * 0.0, 0.034074, 0.1339746, 0.292893, 0.5, 0.741181, 1.0 */ static float offset[ ] = { 0.0, 0.07612, 0.29289, 0.61732, 1.0 }; #define RN ( sizeof offset / sizeof *offset ) /*************************************** ***************************************/ static int compute_rounded_corners( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, Point * point) { Point *xp; size_t i, n; float rsx, rsy, xf, yf; rsx = rsy = 0.42 * FL_min( w, h ); if ( rsx > RS ) rsx = rsy = RS; for ( xp = point, n = i = 0; i < RN; i++, n++, xp++ ) { xf = x + offset[ RN - i - 1 ] * rsx; yf = y + offset[ i ] * rsy; xp->x = FL_nint( xf ); xp->y = FL_nint( yf ); } for ( i = 0; i < RN; i++, n++, xp++ ) { xf = x + offset[ i ] * rsx; yf = y + h - 1.0 - offset[ RN - i - 1 ] * rsy; xp->x = FL_nint( xf ); xp->y = FL_nint( yf ); } for ( i = 0; i < RN; i++, n++, xp++ ) { xf = x + w - 1.0 - offset[ RN - i - 1 ] * rsx; yf = y + h - 1.0 - offset[ i ] * rsy; xp->x = FL_nint( xf ); xp->y = FL_nint( yf ); } for ( i = 0; i < RN; i++, n++, xp++ ) { xf = x + w - 1.0 - offset[ i ] * rsx; yf = y + offset[ RN - i - 1 ] * rsy; xp->x = FL_nint( xf ); xp->y = FL_nint( yf ); } return n; } #define AddVertex( p, xp, yp ) do{ p->x = xp; p->y = yp; p++; } while( 0 ) /*************************************** ***************************************/ void ps_roundrectangle( int fill, float x, float y, float w, float h, long col ) { Point point[ 5 * RN ]; int n; n = compute_rounded_corners( x, y, w, h, point ); ps_poly( fill, point, n, col ); } #define ps_rbox ps_roundrectangle /*************************************** ***************************************/ void ps_oval( int fill, float x, float y, float w, float h, long col ) { ps_pieslice( fill, x, y, w, h, 0.0, 3600.0, col ); } /*************************************** ***************************************/ void ps_circ( int fill, float x, float y, float r, long col ) { ps_color( col ); ps_output( "newpath %.1f %.1f %.1f 0 360 arc %c\n", x, y, r, "SF"[ fill ? 1 : 0 ] ); } /*************************************** * draw an circular arc, optionally filled. Angle t1 and t2 are in one-tenth of * a degree ***************************************/ void ps_arc( int fill, float x, float y, float r, int t1, int t2, long col ) { ps_color( col ); ps_output( "newpath %.1f %.1f %.1f %.1f %.1f arc %c\n", x, y, r, t1 * 0.1, t2 * 0.1, "SF"[ fill ? 1 : 0 ] ); } /*************************************** * only fill does a pie slice ***************************************/ void ps_pieslice( int fill, float x, float y, float w, float h, int t1, int t2, long col ) { float sx = 1.0, sy = ( float ) h / w; ps_color( col ); ps_output( "gsave newpath %.1f %.1f translate %.1f %.1f scale\n", x + 0.5 * w, y + 0.5 * h, sx, sy ); if ( ! fill ) ps_output( "0 0 %.1f %.1f %.1f arc S grestore\n", w * 0.5, t1 * 0.1, t2 * 0.1 ); else ps_output( "0 0 M 0 0 %.1f %.1f %.1f arc C F grestore\n", w * 0.5, t1 * 0.1, t2 * 0.1 ); ps_invalidate_color_cache( ); } /************ End of basic drawing routines ********}******/ /***************************************************************** * Some high level drawing routines *************************************************************{***/ /*************************************** ***************************************/ static void ps_roundedbox( int style, float x, float y, float w, float h, long col, int bw ) { Point point[ 5 * RN + 2 ]; int n, lw = FL_abs( bw ), lw2 = lw / 2; n = compute_rounded_corners( x + lw2, y + lw2, w - lw, h - lw, point ); ps_poly( 1, point, n, col ); ps_set_linewidth( lw, lw ); if ( style == FL_ROUNDED3D_UPBOX ) { ps_lines( point, 2 * RN, FL_TOP_BCOL ); ps_lines( point + 2 * RN - 3, RN + 1, FL_TOP_BCOL ); ps_lines( point + 3 * RN - 4, RN + 2, FL_BOTTOM_BCOL ); point[ n ] = point[ 0 ]; ps_lines( point + n - 3, 4, FL_BOTTOM_BCOL ); } else { ps_lines( point, 2 * RN, FL_BOTTOM_BCOL ); ps_lines( point + 2 * RN - 3, RN + 1, FL_BOTTOM_BCOL ); ps_lines( point + 3 * RN - 4, RN + 2, FL_LEFT_BCOL ); point[ n ] = point[ 0 ]; ps_lines( point + n - 3, 4, FL_TOP_BCOL ); } ps_reset_linewidth( ); } /*************************************** ***************************************/ static void ps_ovalbox( int style, float x, float y, float w, float h, long col, int bw ) { int lw = FL_abs( bw ), cr = lw / 2; int extra = 1 + ( lw > 3 ); int xx, yy, ww, hh; x += cr; y += cr; w -= 2 * cr; h -= 2 * cr; xx = x + extra; yy = y + extra; ww = w - 2 * extra; hh = h - 2 * extra; ps_pieslice( 1, x, y, w, h, 0, 3600, col ); /* this should be replaced by a loop. Faking it with line thickness looks bad when w != h */ if ( style == FL_OVAL3D_UPBOX ) { ps_set_linewidth( bw, bw ); ps_pieslice( 0, x, y, w, h, 450, 2250, FL_TOP_BCOL ); ps_pieslice( 0, x, y, w, h, 0, 450, FL_BOTTOM_BCOL ); ps_pieslice( 0, x, y, w, h, 2250, 3600, FL_BOTTOM_BCOL ); } else if ( style == FL_OVAL3D_FRAMEBOX ) { ps_set_linewidth( 0.9, 0.9 ); ps_pieslice( 0, x, y, w, h, 450, 2250, FL_BOTTOM_BCOL ); ps_pieslice( 0, xx, yy, ww, hh, 450, 2250, FL_LEFT_BCOL ); ps_pieslice( 0, xx, yy, ww, hh, 0, 450, FL_BOTTOM_BCOL ); ps_pieslice( 0, x, y, w, h, 0, 450, FL_LEFT_BCOL ); ps_pieslice( 0, xx, yy, ww, hh, 2250, 3600, FL_BOTTOM_BCOL ); ps_pieslice( 0, x, y, w, h, 2250, 3600, FL_LEFT_BCOL ); } else if ( style == FL_OVAL3D_EMBOSSEDBOX ) { ps_set_linewidth( 0.9, 0.9 ); ps_pieslice( 0, x, y, w, h, 450, 2250, FL_LEFT_BCOL ); ps_pieslice( 0, xx, yy, ww, hh, 450, 2250, FL_BOTTOM_BCOL ); ps_pieslice( 0, xx, yy, ww, hh, 0, 450, FL_LEFT_BCOL ); ps_pieslice( 0, x, y, w, h, 0, 450, FL_BOTTOM_BCOL ); ps_pieslice( 0, xx, yy, ww, hh, 2250, 3600, FL_LEFT_BCOL ); ps_pieslice( 0, x, y, w, h, 2250, 3600, FL_BOTTOM_BCOL ); } else { ps_set_linewidth( bw, bw ); ps_pieslice( 0, x, y, w, h, 450, 2250, FL_BOTTOM_BCOL ); ps_pieslice( 0, x, y, w, h, 0, 450, FL_TOP_BCOL ); ps_pieslice( 0, x, y, w, h, 2250, 3600, FL_TOP_BCOL ); } ps_reset_linewidth( ); } #define vv2(x1, y1, x2, y2) AddVertex(xp,x1,y1); AddVertex(xp, x2,y2); #define vv3(x1, y1, x2, y2, x3, y3) vv2(x1,y1,x2,y2); AddVertex(xp,x3,y3) #define Corner 4 /*************************************** ***************************************/ static void ps_foldertab_box( int style, float x, float y, float w, float h, long col, float bw ) { float ctr, right, top; Point vert[10], *xp; int border = ( bw > 0 ), i; float absbw = FL_abs( bw ); float C = Corner; ctr = absbw / 2; x += ctr; y += ctr; w -= 2 * absbw; h -= 2 * absbw; right = x + w - 1; top = y + h - 1; xp = vert; switch ( style ) { case FL_TOPTAB_UPBOX : vv3( x, y, x, top - C, x + C, top ); vv2( x + C, top, right - C, top ); vv3( right - C, top, right, top - C, right, y ); ps_poly( 1, vert, 8, col ); ps_set_linewidth( absbw, absbw ); ps_lines( vert, 3, FL_LEFT_BCOL ); ps_lines( vert + 3, 2, FL_TOP_BCOL ); ps_lines( vert + 5, 3, FL_BOTTOM_BCOL ); ps_reset_linewidth( ); if ( border ) for ( i = 0; i < 8; i++ ) { if ( vert[ i ].x > x + w / 2 ) vert[ i ].x += ctr; else vert[ i ].x -= ctr + 1; if ( vert[ i ].y > y + h / 2 ) vert[ i ].y += ctr; } break; case FL_SELECTED_TOPTAB_UPBOX : vv3( x, y - absbw, x, top - C, x + C, top ); vv2( x + C, top, right - C, top ); vv3( right - C, top, right, top - C, right, y - absbw ); ps_poly( 1, vert, 8, col ); ps_set_linewidth( absbw, absbw ); ps_lines( vert, 3, FL_LEFT_BCOL ); ps_lines( vert + 3, 2, FL_TOP_BCOL ); ps_lines( vert + 5, 3, FL_BOTTOM_BCOL ); ps_reset_linewidth( ); break; default: break; } } #define ShrinkBox(x,y,w,h,d) do {x+=d; y+=d; w-=2*d; h-=2*d;} while(0) /*************************************** ***************************************/ void ps_draw_tbox( int style, float x, float y, float w, float h, long col, float bw ) { Point point[ 8 ], *fp; float absbw = FL_abs( bw ); float halfbw = absbw / 2; float xc = x + w / 2, yc = y + h / 2; if ( psinfo.verbose ) ps_verbatim( "%%TBOX %d: %.1f %.1f %.1f %.1f\n", style, x, y, w, h ); fp = point; switch ( style ) { case FLI_TRIANGLE_UPBOX8 : AddVertex(fp, xc, y + h - absbw); AddVertex(fp, x + w - bw, y + absbw); AddVertex(fp, x + bw, y + bw); ps_poly(1, point, 3, col); ps_set_linewidth(absbw, absbw); ShrinkBox(x, y, w, h, halfbw); ps_line(x, y, xc, y + h - 1, FL_LEFT_BCOL); ps_line(xc, y + h - 1, x + w - 1, y, FL_RIGHT_BCOL); ps_line(x + w - 1, y, x, y, FL_BOTTOM_BCOL); ps_reset_linewidth(); break; case FLI_TRIANGLE_UPBOX2 : AddVertex(fp, xc, y + absbw); AddVertex(fp, xc, y + h - absbw); AddVertex(fp, x + w - absbw, y + h - absbw); ps_poly(1, point, 3, col); ps_set_linewidth(absbw, absbw); ShrinkBox(x, y, w, h, halfbw); ps_line(xc, y, x, y + h - 1, FL_LEFT_BCOL); ps_line(x, y + h - 1, x + w - 1, y + h - 1, FL_TOP_BCOL); ps_line(x + w - 1, y + h - 1, xc, y, FL_RIGHT_BCOL); ps_reset_linewidth(); break; case FLI_TRIANGLE_UPBOX6: AddVertex(fp, x + bw, y + h - bw); AddVertex(fp, x + w - bw, yc); AddVertex(fp, x + bw, y + bw); ps_poly(1, point, 3, col); ps_set_linewidth(absbw, absbw); ShrinkBox(x, y, w, h, halfbw); ps_line(x, y + h - 1, x + w - 1, yc, FL_RIGHT_BCOL); ps_line(x + w - 1, yc, x, y, FL_BOTTOM_BCOL); ps_line(x, y, x, y + h - 1, FL_LEFT_BCOL); ps_reset_linewidth(); break; case FLI_TRIANGLE_UPBOX4: AddVertex(fp, x + bw, yc); AddVertex(fp, x + w - bw, y + h - bw); AddVertex(fp, x + w - bw, y); ps_poly(1, point, 3, col); ps_set_linewidth(absbw, absbw); ShrinkBox(x, y, w, h, halfbw); ps_line(x, yc, x + w - 1, y + h - 1, FL_TOP_BCOL); ps_line(x + w - 1, y + h - 1, x + w - 1, y, FL_RIGHT_BCOL); ps_line(x + w - 1, y, x, yc, FL_BOTTOM_BCOL); ps_reset_linewidth(); break; } } /*************************************** ***************************************/ void ps_draw_box( int style, float x, float y, float w, float h, long col, float bw_in ) { int border, B; Point xpoint[ 8 ], *xp; int bw = bw_in; if ( ! ( border = ( bw > 0 ) ) ) bw = -bw; B = border; xp = xpoint; if ( psinfo.verbose ) ps_verbatim( "%%BOX %d: %.1f %.1f %.1f %.1f\n", style, x, y, w, h ); switch (style) { case FL_NO_BOX: break; case FL_UP_BOX: ps_rectf(x + bw, y + bw, w - 2 * bw, h - 2 * bw, col); ps_rectf(x + B, y, w - 2 * B, bw + 1, FL_BOTTOM_BCOL); ps_rectf(x + B, y + h - 1 - bw, w - 2 * B, bw + 1, FL_TOP_BCOL); /* left */ AddVertex(xp, x + B, y + B); AddVertex(xp, x + B, y + h - 1 - B); AddVertex(xp, x + bw + B, y + h - 1 - bw - B); AddVertex(xp, x + bw + B, y + bw + B); ps_poly(1, xpoint, 4, FL_LEFT_BCOL); xp = xpoint; AddVertex(xp, x + w - 1, y); AddVertex(xp, x + w - 1, y + h - 1); AddVertex(xp, x + w - 1 - bw, y + h - 1 - bw); AddVertex(xp, x + w - 1 - bw, y + bw); ps_poly(1, xpoint, 4, FL_RIGHT_BCOL); if (border) ps_rect(x, y, w, h, FL_BLACK); break; case FL_DOWN_BOX: ps_rectf(x, y, w, h, col); ps_rectf(x, y + h - bw, w, bw, FL_BOTTOM_BCOL); ps_rectf(x, y, w, bw, FL_TOP_BCOL); AddVertex(xp, x, y); AddVertex(xp, x, y + h - 1); AddVertex(xp, x + bw - 1, y + h - bw); AddVertex(xp, x + bw - 1, y + bw - 1); ps_poly(1, xpoint, 4, FL_RIGHT_BCOL); /* right */ xp = xpoint; AddVertex(xp, x + w - 1, y); AddVertex(xp, x + w - 1, y + h - 1); #if 0 AddVertex(xp, x + w - 1 - bw, y + h - bw); AddVertex(xp, x + w - 1 - bw, y + bw - 1); #else AddVertex(xp, x + w - bw, y + h - bw); AddVertex(xp, x + w - bw, y + bw - 1); #endif ps_poly(1, xpoint, 4, FL_LEFT_BCOL); break; case FL_FRAME_BOX: ps_rectf(x, y, w, h, col); ps_start_lw(1.1, 1.1); ps_rect(x + 1.4, y, w - 1.4, h - 1.4, FL_TOP_BCOL); ps_end_lw(); ps_rect(x, y + 1.4, w - 1.4, h - 1.4, FL_BOTTOM_BCOL); break; case FL_EMBOSSED_BOX: ps_rectf(x, y, w, h, col); ps_start_lw(1.1, 1.1); ps_rect(x + 1.4, y, w - 1.4, h - 1.4, FL_BOTTOM_BCOL); ps_end_lw(); ps_rect(x, y + 1.4, w - 1.4, h - 1.4, FL_TOP_BCOL); break; case FL_FLAT_BOX: ps_rectf(x, y, w, h, col); break; case FL_SHADOW_BOX: if (w > 100 && h > 100) bw++; ps_rectf(x + bw, y + bw, w - bw, -bw, FL_BOTTOM_BCOL); ps_rectf(x + w - 1, y, -bw, h - bw - 1, FL_BOTTOM_BCOL); ps_rectf(x, y + bw, w - bw, h - bw, col); ps_rect(x, y + bw, w - bw, h - bw, FL_BLACK); break; case FL_BORDER_BOX: ps_rectf(x, y, w, h, col); ps_rect(x, y, w, h, FL_BLACK); break; case FL_RFLAT_BOX: ps_rbox(1, x, y, w, h, col); break; case FL_ROUNDED_BOX: ps_rbox(1, x, y, w, h, col); ps_rbox(0, x, y, w, h, FL_BLACK); break; case FL_ROUNDED3D_UPBOX: case FL_ROUNDED3D_DOWNBOX: ps_roundedbox(style, x, y, w, h, col, bw); break; case FL_RSHADOW_BOX: ps_rbox(1, x + bw, y - 1, w - bw + 1, h - bw, FL_BOTTOM_BCOL); ps_rbox(1, x, y + bw - 1, w - bw + 1, h - bw + 1, col); ps_rbox(0, x, y + bw - 1, w - bw + 1, h - bw + 1, FL_BLACK); break; case FL_OVAL_BOX: ps_oval(1, x, y, w, h, col); ps_oval(0, x, y, w, h, FL_BLACK); break; case FL_OVAL3D_UPBOX: case FL_OVAL3D_DOWNBOX: case FL_OVAL3D_FRAMEBOX: case FL_OVAL3D_EMBOSSEDBOX: ps_ovalbox(style, x, y, w, h, col, bw); break; case FL_TOPTAB_UPBOX: case FL_SELECTED_TOPTAB_UPBOX: case FL_BOTTOMTAB_UPBOX: case FL_SELECTED_BOTTOMTAB_UPBOX: ps_foldertab_box(style, x, y, w, h, col, bw_in); break; default: fprintf(stderr, "Unknown Boxtype %d\n", style); break; } } /*************************************** * Frame is drawn OUTSIDE of the bounding box ***************************************/ void ps_draw_frame( int style, float x, float y, float w, float h, long col FL_UNUSED_ARG, int bw ) { int border; float B; Point xpoint[ 10 ], *xp; if ( ! ( border = ( bw > 0 ) ) ) bw = -bw; B = border; if ( psinfo.verbose ) ps_verbatim( "%%frame (%.2f %.2f %.2f %.2f)\n", x, y, w, h ); switch ( style ) { case FL_UP_FRAME: ps_rectf( x - bw - B, y + h - 1, w + 2 * bw, bw + 1 + B, FL_TOP_BCOL); ps_rectf( x - bw - B, y - bw - B, w + 2 * bw, bw + 1 + B, FL_BOTTOM_BCOL); /* left */ xp = xpoint; AddVertex( xp, x - bw - B, y - bw - B ); AddVertex( xp, x, y ); AddVertex( xp, x, y + h - 1 ); AddVertex( xp, x - bw - B, y + h + bw + B - 1 ); ps_poly( 1, xpoint, 4, FL_LEFT_BCOL ); /* right */ xp = xpoint; AddVertex( xp, x + w - 1 + bw + B, y - bw - B ); AddVertex( xp, x + w - 1 + bw + B, y + h + bw + B - 1 ); AddVertex( xp, x + w - 1, y + h - 1 ); AddVertex( xp, x + w - 1, y ); ps_poly( 1, xpoint, 4, FL_RIGHT_BCOL ); break; case FL_DOWN_FRAME: ps_rectf( x - bw - B, y + h - 1, w + 2 * bw, bw + 1 + B, FL_BOTTOM_BCOL); ps_rectf( x - bw - B, y - bw - B, w + 2 * bw, bw + 1 + B, FL_TOP_BCOL); /* left */ xp = xpoint; AddVertex( xp, x - bw - B, y - bw - B ); AddVertex( xp, x, y ); AddVertex( xp, x, y + h - 1 ); AddVertex( xp, x - bw - B, y + h + bw + B - 1 ); ps_poly( 1, xpoint, 4, FL_RIGHT_BCOL ); /* right */ xp = xpoint; AddVertex( xp, x + w - 1 + bw + B, y - bw - B ); AddVertex( xp, x + w - 1 + bw + B, y + h + bw + B - 1 ); AddVertex( xp, x + w - 1, y + h - 1 ); AddVertex( xp, x + w - 1, y ); ps_poly( 1, xpoint, 4, FL_LEFT_BCOL ); break; case FL_ENGRAVED_FRAME: B = ( bw > 2 ? ( bw - 2 ) : 1 ); B *= 0.5; ps_draw_frame( FL_DOWN_FRAME, x, y, w, h, 0, 1 ); ps_draw_frame( FL_UP_FRAME, x + B, y + B, w - 2 * B, h - 2 * B, 0, -1 ); break; } } /*************************************** ***************************************/ void ps_draw_checkbox( int type, float x, float y, float w, float h, long col, int bw ) { Point xpoint[6], *xp; Point allp[10]; /* generate all points */ xp = allp; AddVertex( xp, x + w / 2, y ); AddVertex( xp, x, y + h / 2 ); AddVertex( xp, x + w / 2, y + h ); AddVertex( xp, x + w, y + h / 2 ); AddVertex( xp, x + w / 2, y + bw ); AddVertex( xp, x + bw, y + h / 2 ); AddVertex( xp, x + w / 2, y + h - bw ); AddVertex( xp, x + w - bw, y + h / 2 ); /* draw overall box */ xp = allp + 4; ps_poly( 1, xp, 4, col ); xp = xpoint; switch ( type ) { case FL_DOWN_BOX : AddVertex( xp, allp[ 0 ].x, allp[ 0 ].y ); AddVertex( xp, allp[ 1 ].x, allp[ 1 ].y ); AddVertex( xp, allp[ 5 ].x, allp[ 5 ].y ); AddVertex( xp, allp[ 4 ].x, allp[ 4 ].y ); ps_poly( 1, xp = xpoint, 4, FL_LEFT_BCOL ); AddVertex(xp, allp[0].x, allp[0].y); AddVertex(xp, allp[4].x, allp[4].y); AddVertex(xp, allp[7].x, allp[7].y); AddVertex(xp, allp[3].x, allp[3].y); ps_poly(1, xp = xpoint, 4, FL_TOP_BCOL); /* right bottom */ AddVertex(xp, allp[6].x, allp[6].y); AddVertex(xp, allp[2].x, allp[2].y); AddVertex(xp, allp[3].x, allp[3].y); AddVertex(xp, allp[7].x, allp[7].y); ps_poly(1, xp = xpoint, 4, FL_RIGHT_BCOL); AddVertex(xp, allp[1].x, allp[1].y); AddVertex(xp, allp[2].x, allp[2].y); AddVertex(xp, allp[6].x, allp[6].y); AddVertex(xp, allp[5].x, allp[5].y); ps_poly(1, xp = xpoint, 4, FL_BOTTOM_BCOL); break; case FL_UP_BOX: AddVertex(xp, allp[0].x, allp[0].y); AddVertex(xp, allp[1].x, allp[1].y); AddVertex(xp, allp[5].x, allp[5].y); AddVertex(xp, allp[4].x, allp[4].y); ps_poly(1, xp = xpoint, 4, FL_BOTTOM_BCOL); AddVertex(xp, allp[0].x, allp[0].y); AddVertex(xp, allp[4].x, allp[4].y); AddVertex(xp, allp[7].x, allp[7].y); AddVertex(xp, allp[3].x, allp[3].y); ps_poly(1, xp = xpoint, 4, FL_RIGHT_BCOL); /* right bottom */ AddVertex(xp, allp[6].x, allp[6].y); AddVertex(xp, allp[2].x, allp[2].y); AddVertex(xp, allp[3].x, allp[3].y); AddVertex(xp, allp[7].x, allp[7].y); ps_poly(1, xp = xpoint, 4, FL_LEFT_BCOL); AddVertex(xp, allp[1].x, allp[1].y); AddVertex(xp, allp[2].x, allp[2].y); AddVertex(xp, allp[6].x, allp[6].y); AddVertex(xp, allp[5].x, allp[5].y); ps_poly(1, xp = xpoint, 4, FL_TOP_BCOL); break; } if (psinfo.verbose) ps_verbatim("%%BOX }\n"); } /******* End of high-level drawing routines **********}******/ /************** Handle built-in symbols. ****************{*/ typedef void ( *PSdrawit ) ( float, float, float, float, int, long ); typedef struct { const char * name; const char * psname; const char * draw; int otherdef; PSdrawit fdrawit; int abs_coordinate; /* fdrawit uses abs coordinate system */ int defined; /* if def code emitted */ } PS_draw; /*************************************** ***************************************/ static void draw_dnline( float x FL_UNUSED_ARG, float y FL_UNUSED_ARG, float w, float h, int angle FL_UNUSED_ARG, long col FL_UNUSED_ARG ) { float t = 0.20; float len; ps_output("%.3f %.3f LW ", 3.5 / (w + h), 3.5 / (w + h)); if ((w + h) > 200) len = 0.99; else if ((w + h) > 150) len = 0.98; else len = 0.93; ps_color(FL_RIGHT_BCOL); ps_output("-%.3f %.2f M %.3f %.2f LT S\n", len, t, len, t); ps_color(FL_LEFT_BCOL); ps_output("-%.3f -%.2f M %.3f -%.2f LT S\n", len, t, len, t); } /*************************************** ***************************************/ static void draw_upline( float x FL_UNUSED_ARG, float y FL_UNUSED_ARG, float w, float h, int angle FL_UNUSED_ARG, long col FL_UNUSED_ARG ) { float t = 0.033; ps_color(FL_LEFT_BCOL); ps_output("%.3f %.3f LW ", 3.7 / (w + h), 3.7 / (w + h)); ps_output("-0.9 %.3f M 0.9 %.3f LT S\n", t, t); ps_color(FL_RIGHT_BCOL); ps_output("0.9 -%.3f M 0.9 %.3f LT S ", t, t); ps_output("-0.9 -%.3f M 0.9 -%.3f LT S\n", t, t); } /*************************************** * due to pixel precision problems, we have to draw uparrow, downarrow * and ripple line in absolute unit with the origin * at the center of the figure. ***************************************/ static void draw_uparrow( float x, float y, float w, float h, int angle, long col FL_UNUSED_ARG ) { float yc = y + h * 0.5; float xc = x + w * 0.5; float dx, dy; int d = 3 + (w + h) * 0.06; dx = w / 2 - d; dy = h / 2 - d; if ( angle == 90 ) { ps_line( xc, yc + dy, xc - dx, yc - dy, FL_LEFT_BCOL ); ps_line( xc - dx, yc - dy, xc + dx, yc - dy, FL_BOTTOM_BCOL ); ps_line( xc + dx, yc - dy, xc, yc + dy, FL_RIGHT_BCOL ); } else if ( angle == 180 ) { ps_line( xc - dx, yc, xc + dx, yc + dy, FL_TOP_BCOL ); ps_line( xc + dx, yc + dy, xc + dx, yc - dy, FL_RIGHT_BCOL ); ps_line( xc + dx, yc - dy, xc - dx, yc, FL_BOTTOM_BCOL ); } else if (angle == 270) { ps_line( xc - dx, yc + dy, xc, yc - dy, FL_BOTTOM_BCOL ); ps_line( xc, yc - dy, xc + dx, yc + dy, FL_RIGHT_BCOL ); ps_line( xc + dx, yc + dy, xc - dx, yc + dy, FL_TOP_BCOL ); } else { ps_line( xc - dx, yc + dy, xc + dx, yc, FL_BOTTOM_BCOL ); ps_line( xc - dx, yc - dy, xc + dx, yc, FL_RIGHT_BCOL ); ps_line( xc - dx, yc - dy, xc - dx, yc + dy, FL_LEFT_BCOL ); } } /*************************************** ***************************************/ static void draw_dnarrow( float x, float y, float w, float h, int angle, long col FL_UNUSED_ARG ) { float yc = y + h * 0.5; float xc = x + w * 0.5; float dx, dy; int d = 3 + ( w + h ) * 0.06; dx = w / 2 - d; dy = h / 2 - d; if ( angle == 90 ) { ps_line( xc, yc + dy, xc - dx, yc - dy, FL_RIGHT_BCOL ); ps_line( xc - dx, yc - dy, xc + dx, yc - dy, FL_TOP_BCOL ); ps_line( xc + dx, yc - dy, xc, yc + dy, FL_TOP_BCOL ); } else if ( angle == 180 ) { ps_line( xc - dx, yc, xc + dx, yc + dy, FL_RIGHT_BCOL ); ps_line( xc + dx, yc + dy, xc + dx, yc - dy, FL_LEFT_BCOL ); ps_line( xc + dx, yc - dy, xc - dx, yc, FL_TOP_BCOL ); } else if ( angle == 270 ) { ps_line( xc - dx, yc + dy, xc, yc - dy, FL_RIGHT_BCOL ); ps_line( xc, yc - dy, xc + dx, yc + dy, FL_LEFT_BCOL ); ps_line( xc + dx, yc + dy, xc - dx, yc + dy, FL_BOTTOM_BCOL ); } else { ps_line( xc - dx, yc - dy, xc - dx, yc + dy, FL_RIGHT_BCOL ); ps_line( xc - dx, yc - dy, xc + dx, yc, FL_TOP_BCOL ); ps_line( xc - dx, yc + dy, xc + dx, yc, FL_BOTTOM_BCOL ); } } /*************************************** * need single pixel precision, draw in abs. coordiante system ***************************************/ static void draw_ripple_lines( float x, float y, float w, float h, int angle, long col FL_UNUSED_ARG ) { float ym = y + h / 2, ys; float xm = x + w / 2, xs; int mw = FL_BOUND_WIDTH; if (h < 9 || w < 9) { fprintf(stderr, "RippledLine: Area too small\n"); return; } xs = xm + 5; ys = ym + 5; if (angle == 90 || angle == 270) { int i; for ( i = 0; i < 3; i++ ) { ps_line(xs, y + mw, xs, y + h - mw - 1, FL_RIGHT_BCOL); xs -= 1; ps_line(xs, y + mw, xs, y + h - mw - 1, FL_LEFT_BCOL); xs -= 3; } } else { int i; for (i = 0; i < 3; i++) { ps_line(x + mw, ys, x + w - mw - 1, ys, FL_LEFT_BCOL); ys -= 1; ps_line(x + mw, ys, x + w - mw - 1, ys, FL_RIGHT_BCOL); ys -= 3; } } } /*************************************** ***************************************/ static void draw_bararrowhead( float x, float y, float w, float h, int angle, long col ) { float xc = x + 0.5 * w, yc = y + 0.5 * h; int d = 3 + 0.06 * (w + h); float dx, dy, mar, dbar, xl; Point point[ 5 ], *p; dx = w / 2 - d; dy = h / 2 - d; dbar = dx * 0.4; mar = 0.2 * dx; ps_output( "gsave %.1f %.1f translate %d rotate\n", xc, yc, angle ); xl = -dx + 1.1 * mar; p = point; AddVertex( p, xl, - dy ); AddVertex( p, xl + dbar, - dy ); AddVertex( p, xl + dbar, dy ); AddVertex( p, xl, dy ); ps_poly( 1, point, 4, col ); ps_poly( 0, point, 4, FL_RIGHT_BCOL ); p = point; AddVertex( p, - mar, - dy ); AddVertex( p, - mar + dx, 0 ); AddVertex( p, - mar, dy ) ; ps_poly( 1, point, 3, col ); ps_poly( 0, point, 3, FL_RIGHT_BCOL ); ps_output( "grestore\n" ); } /* all PS drawings have a size of 2 pixels and centered at origin */ static PS_draw psdraw[] = { {"returnarrow", "returnarrow", "-0.8 0.0 -0.1 0.7 -0.1 0.05 0.6 0.05 0.6 0.7 0.7 0.7 0.7 -0.05\n" "-0.1 -0.05 -0.1 -0.7 9 P", 0, 0, 0, 0 }, {"->", "rarrow", "-0.8 -0.4 -0.8 0.4 0 0.4 0 0.8 0.8 0 0 -0.8 0 -0.4 7 P", 0, 0, 0, 0 }, {"<-", "180 rotate", 0, -1, 0, 0, 0}, {">", "rarrowh", "-0.2 0.7 M 0.5 0.0 LT -0.2 -0.7 LT C", 0, 0, 0, 0}, {"<", "180 rotate", 0, -1, 0, 0, 0}, {"<->", "darrow", "-0.25 0.4 0.25 0.4 0.25 0.8 0.85 0 0.25 -0.8 0.25 -0.4 -0.25 -0.4\n" "-0.25 -0.8 -0.85 0 -0.25 0.8 10 P", 0, 0, 0, 0 }, {"plus", "plus", "-0.9 -0.13 -0.9 0.13 -0.13 0.13 -0.13 0.9 0.13 0.9 0.13 0.13 0.9 0.13\n" "0.9 -0.13 0.13 -0.13 0.13 -0.9 -0.13 -0.9 -0.13 -0.13 12 P", 0, 0, 0, 0 }, {">>", "darrowh", "0.15 0.7 0.85 0 0.15 -0.7 0.15 -0.001 -0.55 -0.7 -0.55 0.7 0.15 0.001\n" "7 P", 0, 0, 0, 0 }, {"<<", "180 rotate", 0, -1, 0, 0, 0}, {"arrow", "thinarrow", "-0.9 0.02 M 0.65 0.02 LT 0.65 0.15 LT 0.9 0 LT 0.65 -0.15 LT\n" "0.65 -0.02 LT -0.9 -0.02 LT C", 0, 0, 0, 0 }, {"circle", "circle", "0 0 0.77 0 360 arc", 0, 0, 0, 0}, {"square", "square", "-0.77 -0.77 M -0.77 0.77 LT 0.77 0.77 LT 0.77 -0.77 LT C", 0, 0, 0, 0 }, {"line", "line", "-0.97 0.01 M 0.97 0.01 LT 0.97 -0.01 LT -0.08 -0.01 LT C", 0, 0, 0, 0 }, {"->|", "arrowbar", "-0.75 0.35 -0.1 0.35 -0.1 0.75 0.6 0.001 0.6 0.75 0.75 0.75\n" " 0.75 -0.75 0.6 -0.75 0.6 -0.001 -0.1 -0.75 -0.1 -0.35 -0.75 -0.35 12 P\n", 0, 0, 0, 0 }, {"|<-", "180 rotate", 0, -1, 0, 0, 0}, {">|", "arrowheadbar", /* bar 0.25 */ "-0.60 0.7 0.22 0.001 0.22 0.7 0.47 0.7 0.47 -0.7 0.22 -0.7\n" " 0.22 -0.001 -0.60 -0.7 8 P", 0, 0, 0, 0 }, {"|<", "180 rotate", 0, -1, 0, 0, 0}, {"|>", "bararrowhead", 0, -1, draw_bararrowhead, 1, 0}, {"DnLine", "dnline", 0, -1, draw_dnline, 0, 0}, {"dnline", "dnline", 0, -1, draw_dnline, 0, 0}, {"UpLine", "upline", 0, -1, draw_upline, 0, 0}, {"upline", "upline", 0, -1, draw_upline, 0, 0}, {"UpArrow", "uparrow", 0, -1, draw_uparrow, 1, 0}, {"DnArrow", "dnarrow", 0, -1, draw_dnarrow, 1, 0}, {"=", "RippleLines", 0, -1, draw_ripple_lines, 1, 0}, /* aliases */ {"RippleLines", "RippleLines", 0, -1, draw_ripple_lines, 1, 0}, {"+", "plus", "-0.9 -0.13 -0.9 0.13 -0.13 0.13 -0.13 0.9 0.13 0.9 0.13 0.13 0.9 0.13\n" "0.9 -0.13 0.13 -0.13 0.13 -0.9 -0.13 -0.9 -0.13 -0.13 12 P", 0, 0, 0, 0 }, {"-->", "thinarrow", "-0.9 0.02 M 0.65 0.02 LT 0.65 0.15 LT 0.9 0 LT 0.65 -0.15 LT\n" "0.65 -0.02 LT -0.9 -0.02 LT C", 0, 0, 0, 0 } }; /*************************************** ***************************************/ static void define_symbol( PS_draw * p ) { if ( ! p->defined && ! p->fdrawit ) { if ( p->otherdef ) define_symbol( p + p->otherdef ); else ps_output( "/%s {%s} bind def\n", p->psname, p->draw ); p->defined = 1; } } /*************************************** ***************************************/ static PS_draw * find( const char *s ) { PS_draw *p = psdraw, *ps = psdraw + sizeof psdraw / sizeof *psdraw; for ( ; p < ps; p++ ) if ( strcmp( s, p->name ) == 0 ) { define_symbol( p ); return p; } return 0; } #define swapit( t, a, b ) do { t t_; t_ = a; a = b; b = t_; } while( 0 ) /*************************************** ***************************************/ int ps_draw_symbol( const char * label, float x, float y, float w, float h, long col ) { int pos, shift, equalscale = 0; short defr[] = { 0, 225, 270, 315, 180, 0, 0, 135, 90, 45 }; PS_draw *s; int rotated = 0; int sw = w, sh = h; int delta = 0; if ( ! label || *label != '@' ) return 0; if ( psinfo.verbose ) ps_verbatim( "%%Symbol %s: %.1f %.1f %.1f %.1f\n", label + 1, x, y, w, h ); x += 1.2; y += 1.2; w -= 2.4; h -= 2.4; /* check special operators */ pos = 1; while ( ( label[ pos ] == '-' && isdigit( label[ pos + 1 ] ) ) || ( label[ pos ] == '+' && isdigit( label[ pos + 1 ] ) ) || label[ pos ] == '#' ) { switch ( label[ pos ] ) { case '+': delta = '0' - label[ ++pos ]; break; case '-': delta = label[ ++pos ] - '0'; break; case '#': equalscale = 1; break; } pos++; } shift = pos; if ( label[ pos ] >= '1' && label[ pos ] <= '9' ) { rotated = defr[ label[ pos ] - '0' ]; shift = pos + 1; } else if ( label[ pos ] == '0' ) { rotated = 100 * ( label[ pos + 1 ] - '0' ) + 10 * ( label[ pos + 2 ] - '0' ) + 1 * ( label[ pos + 3 ] - '0' ); shift = pos + 4; } /* short hand with @4 etc */ if ( ! ( s = ( label[ shift ] ? find( label + shift ) : psdraw ) ) ) { fprintf( stderr, "Bad label %s\n", label + shift ); if ( psinfo.verbose ) ps_verbatim( "%% unknown symbol %s. Not drawn\n", label ); return 0; } if ( equalscale ) sw = sh = FL_min( w, h ); if ( delta ) { if ( s->abs_coordinate ) { x += delta; y += delta; } sw -= 2 * delta; sh -= 2 * delta; } if ( ! s->abs_coordinate ) ps_output( "gsave\n%.1f %.1f translate %.1f %.1f scale %d rotate " "%.3f %.3f LW\n", x + 0.5 * w, y + 0.5 * h, 0.45 * sw, 0.45 * sh, rotated, 3.2 / ( sw + sh ), 3.2 / ( sh + sw ) ); if ( s->fdrawit ) { s->fdrawit( x, y, w, h, rotated, col ); if (!s->abs_coordinate) ps_output( "grestore\n" ); ps_invalidate_color_cache( ); return 1; } if ( s->otherdef ) { ps_output( "%s ", s->psname ); s = s + s->otherdef; } ps_color( col ); ps_output( "%s F ", s->psname ); ps_color( FL_BLACK ); ps_output( "%s S\n", s->psname ); ps_output( "grestore\n" ); ps_invalidate_color_cache( ); return 1; } /********************** end of symbols *************************}*/ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fd2ps/test/0000775000175000017500000000000012353624653012045 500000000000000xforms-1.2.4/fd2ps/test/dial.fd0000644000175000017500000000357011665175512013214 00000000000000Magic: 13000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL Border Width: -2 =============== FORM =============== Name: form0 Width: 320 Height: 155 Number of Objects: 5 -------------------- class: FL_BOX type: UP_BOX box: 0 0 320 155 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LABELFRAME type: ENGRAVED_FRAME box: 10 15 300 120 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_TOP_LEFT style: FL_TIMESBOLD_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Dials shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_DIAL type: LINE_DIAL box: 20 37 80 75 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_BOTTOM_BCOL alignment: FL_ALIGN_BOTTOM style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: LineDial shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.75 -------------------- class: FL_DIAL type: FILL_DIAL box: 120 37 80 75 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_BOTTOM_BCOL alignment: FL_ALIGN_BOTTOM style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: FillDial shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.65 -------------------- class: FL_DIAL type: NORMAL_DIAL box: 220 37 80 75 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_BOTTOM_BCOL alignment: FL_ALIGN_BOTTOM style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: NormalDial shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.2 ============================== create_the_forms xforms-1.2.4/fd2ps/test/Makefile.in0000664000175000017500000002476112353624173014041 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/common.am subdir = fd2ps/test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FL_FIXLEVEL = @FL_FIXLEVEL@ FL_REVISION = @FL_REVISION@ FL_VERSION = @FL_VERSION@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIB = @JPEG_LIB@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ TEXI2DVI = @TEXI2DVI@ TEXI2DVI_NEEDS_PDF = @TEXI2DVI_NEEDS_PDF@ TEXI2HTML = @TEXI2HTML@ VERSION = @VERSION@ XMKMF = @XMKMF@ XPM_LIB = @XPM_LIB@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign DISTCLEANFILES = *.orig *.rej *~ *.bak core makelog MAINTAINERCLEANFILES = $(srcdir)/Makefile.in makelog AM_INSTALL_DATA_FLAGS = $(INSTALL) -m 644 -D EXTRA_DIST = \ allcmm.fd \ all.fd \ allpoint.fd \ bm1.xbm \ buttons.fd \ crab.xpm \ dial.fd \ fd_logo.xpm \ folder_gui.fd \ junk.fd \ parameter.xpm \ picture.xbm \ sym.fd \ xconq.xpm all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/common.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign fd2ps/test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign fd2ps/test/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/common.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: xforms-1.2.4/fd2ps/test/allcmm.fd0000644000175000017500000002045711665175512013553 00000000000000Magic: 13000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: cmm =============== FORM =============== Name: form0 Width: 20969 Height: 13867 Number of Objects: 25 -------------------- class: FL_BOX type: UP_BOX box: 0 0 20969 13867 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: UP_BOX box: 676 676 2030 1015 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Box shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_FRAME type: ENGRAVED_FRAME box: 3044 676 1691 1015 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: frame shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LABELFRAME type: ENGRAVED_FRAME box: 5073 676 3382 1353 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_TOP_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: lframe shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_TEXT type: NORMAL_TEXT box: 8794 676 2029 1015 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Text shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BITMAP type: NORMAL_BITMAP box: 1015 2706 1691 1014 boxtype: FL_NO_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: bitmapbutton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_PIXMAP type: NORMAL_PIXMAP box: 9132 10485 1691 1352 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: pixmapbutton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CHART type: BAR_CHART box: 3720 3044 4059 2029 boxtype: FL_BORDER_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: chart shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CLOCK type: ANALOG_CLOCK box: 8117 2367 2368 2030 boxtype: FL_UP_BOX colors: FL_INACTIVE FL_BOTTOM_BCOL alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: clock shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 676 4735 2030 1015 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Button shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_ROUNDBUTTON type: PUSH_BUTTON box: 676 6088 2368 1014 boxtype: FL_NO_BOX colors: FL_MCOL FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: RButton shortcut: R resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 1 -------------------- class: FL_ROUND3DBUTTON type: PUSH_BUTTON box: 676 7441 2368 1014 boxtype: FL_NO_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: R3DButton shortcut: 3 resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 1 -------------------- class: FL_CHECKBUTTON type: PUSH_BUTTON box: 676 8794 2368 1014 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: CButton shortcut: C resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_SLIDER type: HOR_SLIDER box: 11837 676 6088 1015 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.20 slsize: 0.12 -------------------- class: FL_VALSLIDER type: HOR_BROWSER_SLIDER box: 11837 2029 6088 1015 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.60 -------------------- class: FL_DIAL type: FILL_DIAL box: 11161 3720 3044 2706 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_RIGHT_BCOL alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Dial shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.7 -------------------- class: FL_POSITIONER type: NORMAL_POSITIONER box: 16572 3382 3383 3044 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_RED alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: xvalue: 0.2 yvalue: 0.2 -------------------- class: FL_COUNTER type: NORMAL_COUNTER box: 5750 5750 4058 1014 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.2 -------------------- class: FL_COUNTER type: SIMPLE_COUNTER box: 5750 7102 4058 1015 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.4 -------------------- class: FL_INPUT type: NORMAL_INPUT box: 5073 8794 6088 1014 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Input shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_MENU type: PULLDOWN_MENU box: 11499 9132 3044 1014 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Menu shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CHOICE type: NORMAL_CHOICE2 box: 13867 6764 2705 1015 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BROWSER type: NORMAL_BROWSER box: 15220 8117 4396 3382 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_TIMER type: VALUE_TIMER box: 12514 11837 2706 1015 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_RED alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Timer shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_XYPLOT type: NORMAL_XYPLOT box: 2367 9808 5412 3721 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: ============================== create_the_forms xforms-1.2.4/fd2ps/test/buttons.fd0000644000175000017500000000633411665175512014002 00000000000000Magic: 13000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL =============== FORM =============== Name: fff Width: 340 Height: 170 Number of Objects: 9 -------------------- class: FL_BOX type: ROUNDED3D_UPBOX box: 0 0 340 170 boxtype: FL_ROUNDED3D_UPBOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 40 20 100 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Button shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LIGHTBUTTON type: PUSH_BUTTON box: 40 60 100 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_INACTIVE alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: LightButton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 1 -------------------- class: FL_ROUNDBUTTON type: PUSH_BUTTON box: 210 10 100 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: RoundButton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 1 -------------------- class: FL_BITMAPBUTTON type: NORMAL_BUTTON box: 130 104 45 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_RED alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLUE label: bitmapbutton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: file: picture.xbm fullpath: 1 -------------------- class: FL_PIXMAPBUTTON type: NORMAL_BUTTON box: 40 104 45 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: pixmapbutton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: file: xconq.xpm fullpath: 1 -------------------- class: FL_CHECKBUTTON type: NORMAL_BUTTON box: 210 40 110 30 boxtype: FL_NO_BOX colors: FL_MCOL FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Checkbutton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_ROUND3DBUTTON type: PUSH_BUTTON box: 210 70 90 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Round3dButton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 1 -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 210 115 100 30 boxtype: FL_ROUNDED3D_UPBOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Button shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: ============================== create_the_forms xforms-1.2.4/fd2ps/test/sym.fd0000644000175000017500000004370311665175512013115 00000000000000Magic: 13000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL =============== FORM =============== Name: form0 Width: 411 Height: 261 Number of Objects: 57 -------------------- class: FL_BOX type: UP_BOX box: 0 0 411 261 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 20 15 35 35 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @-> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 10 50 55 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @-> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 75 15 35 35 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 65 50 55 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 130 15 35 35 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @UpArrow shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 110 50 70 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @UpArrow shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 185 15 35 35 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @>> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 180 50 40 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @>> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 240 15 35 35 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @DnArrow shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 225 50 60 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @DnArrow shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 295 15 35 35 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @+ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: RFLAT_BOX box: 295 50 45 20 boxtype: FL_RFLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @+ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 350 15 35 35 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @>| shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 340 50 55 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @>| shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 20 75 35 35 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @circle shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 10 110 55 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @circle shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 75 75 35 35 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @|> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 65 110 55 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @|> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 130 75 35 35 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @square shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 120 110 55 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @square shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 185 75 35 35 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @= shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 175 110 55 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @= shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 240 75 35 35 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @UpLine shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 230 110 55 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @Upline shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 295 75 35 35 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @->| shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 285 110 55 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @->| shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 350 75 35 35 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @--> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 340 110 55 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @--> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 20 135 35 35 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @9-> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 10 170 55 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @9-> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 75 135 35 35 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @2UpArrow shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 55 170 65 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @2UpArrow shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 130 135 35 35 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @8|> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 125 170 45 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @8|> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 185 135 35 35 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @9+ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 175 170 55 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @9+ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 240 135 35 35 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @8DnArrow shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 220 170 70 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @8DnArrow shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 295 135 35 35 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @2>| shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 290 170 45 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @8>| shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 350 135 35 35 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @<-> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 340 170 55 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @<-> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 20 195 35 35 boxtype: FL_OVAL3D_UPBOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @2|> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 10 230 55 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @2|> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 75 195 35 35 boxtype: FL_OVAL3D_UPBOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @-51+ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 65 230 55 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @1+ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 130 195 35 35 boxtype: FL_OVAL3D_UPBOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @UpArrow shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 120 230 55 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @+ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 185 195 35 35 boxtype: FL_OVAL3D_UPBOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @>> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 175 230 55 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @>> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 240 195 35 35 boxtype: FL_OVAL3D_UPBOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @<< shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 230 230 55 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @<< shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 295 195 35 35 boxtype: FL_OVAL3D_UPBOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 285 230 55 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 350 195 35 35 boxtype: FL_OVAL3D_UPBOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BOTTOM_BCOL label: @< shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FLAT_BOX box: 340 230 55 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: @< shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: ============================== create_the_forms xforms-1.2.4/fd2ps/test/junk.fd0000644000175000017500000000236411665175512013252 00000000000000Magic: 13000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL =============== FORM =============== Name: form0 Width: 320 Height: 250 Number of Objects: 3 -------------------- class: FL_BOX type: UP_BOX box: 0 0 320 250 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_PIXMAPBUTTON type: NORMAL_BUTTON box: 40 30 120 70 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: file: fd_logo.xpm fullpath: 1 -------------------- class: FL_PIXMAPBUTTON type: NORMAL_BUTTON box: 170 130 100 90 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: file: parameter.xpm fullpath: 1 ============================== create_the_forms xforms-1.2.4/fd2ps/test/xconq.xpm0000644000175000017500000000254011665175512013642 00000000000000/* XPM */ static char * xconq [] = { "32 32 5 1", " s None c None g4 None", ". m black c black g4 black", "X m white c SkyBlue g4 grey80", "o m white c LightGray g4 grey50", "O m white c OliveDrab g4 grey40", " ", " . ", " ..X.. ", " ..XXXXX.. ", " ..XXXXXXXXX.. ", " ..XXXXXXXXXXXXX.. ", " ..XXXXXXXXXXXXXXXXX.. ", " ..XXXXXXXXXXXXXXXXXXXXX.. ", " ..XXXXXXXXXXXXXXXXX.XXXXXXX.. ", " .XXXXXXXXXXXXXXXXXXX.XXXXXXXX. ", " .XXXXXXXXXXXXXXXXX.X.XXXXXXXX. ", " .XXXXXXXXXXXXXXXXX.X.XXXXXXXX. ", " .XXXXXXXXXXXXXXXXX.X.XXXXXXXX. ", " .XXXXXXXXXXXX..........XXXXXX. ", " .XXXXXXXXXX...oooooooo.XXXXXX. ", " .X..........ooooooooo..XXXXXX. ", " .XXXXXXXXXX.................X. ", " .XXXXXXX...............oooo.X. ", " .XXXXXX..oooooooooooooooooo.X. ", " .XXXXXX....................XX. ", " .XXXXXXX..o.o.o.o.o.o.oo..XXX. ", " .XXXXXXXX................XXXX. ", " .............................. ", " .OOOOOOOOOOOOOOOOOOOOOOOOOOOO. ", " ..OO.O.O.O.O.O.O.O.O.O.O.O.OO. ", " ..O.O.O.O.O.O.O.O.O.O.O.O.. ", " ..OO.O.O.O.O.O.O.O.OO.. ", " ..O.O.O.O.O.O.O.O.. ", " ..OO.O.O.O.OO.. ", " ..O.O.O.O.. ", " ..OOO.. ", " ... "}; xforms-1.2.4/fd2ps/test/all.fd0000644000175000017500000002145311665175512013053 00000000000000Magic: 13000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL =============== FORM =============== Name: form0 Width: 701 Height: 471 Number of Objects: 27 -------------------- class: FL_BOX type: UP_BOX box: 0 0 701 471 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: UP_BOX box: 20 20 60 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Box shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_FRAME type: ENGRAVED_FRAME box: 90 20 50 30 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: frame shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LABELFRAME type: ENGRAVED_FRAME box: 150 20 100 40 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_TOP_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: lframe shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_TEXT type: NORMAL_TEXT box: 260 20 60 30 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Text shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BITMAP type: NORMAL_BITMAP box: 30 80 50 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: bitmapbutton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_PIXMAP type: NORMAL_PIXMAP box: 270 310 50 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: pixmapbutton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CHART type: BAR_CHART box: 110 90 120 60 boxtype: FL_BORDER_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: chart shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CLOCK type: ANALOG_CLOCK box: 240 70 70 60 boxtype: FL_UP_BOX colors: FL_INACTIVE FL_BOTTOM_BCOL alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: clock shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 20 140 60 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Button shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_ROUNDBUTTON type: PUSH_BUTTON box: 20 180 70 30 boxtype: FL_NO_BOX colors: FL_MCOL FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: RButton shortcut: R resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 1 -------------------- class: FL_ROUND3DBUTTON type: PUSH_BUTTON box: 20 220 70 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: R3DButton shortcut: 3 resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 1 -------------------- class: FL_CHECKBUTTON type: PUSH_BUTTON box: 20 260 70 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: CButton shortcut: C resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_SLIDER type: HOR_SLIDER box: 350 20 180 30 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.20 slsize: 0.12 -------------------- class: FL_VALSLIDER type: HOR_BROWSER_SLIDER box: 350 60 180 30 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.60 -------------------- class: FL_DIAL type: FILL_DIAL box: 330 110 90 80 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_RIGHT_BCOL alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Dial shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.7 -------------------- class: FL_POSITIONER type: NORMAL_POSITIONER box: 490 100 100 90 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_RED alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: xvalue: 0.2 yvalue: 0.2 -------------------- class: FL_COUNTER type: NORMAL_COUNTER box: 170 170 120 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.2 -------------------- class: FL_COUNTER type: SIMPLE_COUNTER box: 170 210 120 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.4 -------------------- class: FL_INPUT type: NORMAL_INPUT box: 150 260 180 30 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Input shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_MENU type: PULLDOWN_MENU box: 340 270 90 30 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Menu shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CHOICE type: NORMAL_CHOICE2 box: 410 200 80 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BROWSER type: NORMAL_BROWSER box: 450 240 130 100 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_TIMER type: VALUE_TIMER box: 370 350 80 30 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_RED alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Timer shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_XYPLOT type: NORMAL_XYPLOT box: 80 300 170 130 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_SCROLLBAR type: HOR_SCROLLBAR box: 500 410 170 15 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_SCROLLBAR type: VERT_THIN_SCROLLBAR box: 620 50 17 180 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 1.00 ============================== create_the_forms xforms-1.2.4/fd2ps/test/parameter.xpm0000644000175000017500000000527211665175512014477 00000000000000/* XPM */ /* @(#)26 1.1 src/gos/apps/pm/icons/parameter.pm, pwrgui, gos41J, 9512A_all 3/21/95 00:54:58 * * COMPONENT_NAME: PWRGUI * * FUNCTIONS: none * * ORIGINS: 27 * * * (C) COPYRIGHT International Business Machines Corp. 1995 * All Rights Reserved * US Government Users Restricted Rights - Use, duplication or * disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ static char * Parameter[] = { /* width height ncolors cpp [x_hot y_hot] */ "40 40 12 1 0 0", /* colors */ " s none m none c none", ". s iconColor1 m black c black", "X s iconGray1 m white c #e1e1e1e1e1e1", "o s iconGray2 m white c #c8c8c8c8c8c8", "O s iconColor5 m black c blue", "+ s iconColor7 m white c cyan", "@ s iconGray5 m black c #7d7d7d7d7d7d", "# s iconGray6 m black c #646464646464", "$ s iconColor2 m white c white", "% s iconGray3 m white c #afafafafafaf", "& s iconGray4 m white c #969696969696", "* s iconGray7 m black c #4b4b4b4b4b4b", /* pixels */ " ", " ...... ................... ", " ..XXXXXX.. .ooooooooooooooooooo. ", " .XXXXXXXXXX. .ooooooooooooooooooo. ", " .XXXXXXXXXX. .oo...............oo. ", " ...XXXXXX... .oo.O+O+O+O+O+O+O.oo. ", " .Xo......@#. .oo.+$+O+O+O+O+O+.oo. ", " .Xoo%%&&&@#. .oo.O+O+O+O+O+O+O.oo. ", " .Xoo%%&&&@#. .oo.+O+O+O+O+O+O+.oo. ", " .Xoo%%&&&@#. .oo.O+O+O+O+O+O+O.oo. ", " .Xoo%%&&&@#. .oo.+O+O+O+O+O+O+.oo. ", " .Xoo%%&&&@#. .oo.O+O+O+O+O+O+O.oo. ", " .Xoo%%&&&@#. .oo.+O+O+O+O+O+O+.oo. ", " .Xoo%%&&&@#. .oo.O+O+O+O+O+O+O.oo. ", " .Xoo%%&&&@#. .oo.+O+O+O+O+O+O+.oo. ", " .Xoo%%&&&@#. .oo...............oo. ", " ..o%%&&&.. .ooooooooooooooooooo. ", " ...... .ooooooooooooooooooo. ", " ................... ", " .&&&&&&&. ", " .&&&&&&&. ", " ..................... ", " .ooooooooooooooooooooo. ", " .o*$o*$o*$oo*$o*$o*$oo. ", " . .o**o**o**oo**o**o**$o. ", " ..*. .o*$o*$o*$o*$$o*$o*$o*oo. ", " ..****..o**o**o**o***o**o**o**o. ", " ...***&&**.ooooooooooooooooooooooo. ", " ..****&&*****........................ ", " ..**&&****&&&*. ", " # .*****&&*****. ", " # #.**&&****&&**. ", " # # .*****&&*****. ", " # #.**&&*******. ", " # .********..# ", " # #.*****..# # ", " # .**..# # # ", " # #..# # # ", " # # # ", " # # "}; xforms-1.2.4/fd2ps/test/folder_gui.fd0000644000175000017500000003535111665175512014424 00000000000000Magic: 13000 Internal Form Definition File (do not change) Number of forms: 6 Unit of measure: FL_COORD_PIXEL =============== FORM =============== Name: buttonform Width: 430 Height: 210 Number of Objects: 10 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 430 210 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 30 151 80 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Button shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_ROUNDBUTTON type: PUSH_BUTTON box: 40 91 100 30 boxtype: FL_NO_BOX colors: FL_MCOL FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: RoundButton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_ROUND3DBUTTON type: PUSH_BUTTON box: 135 151 110 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Round3DButton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CHECKBUTTON type: PUSH_BUTTON box: 170 111 110 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: CheckButton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LIGHTBUTTON type: PUSH_BUTTON box: 30 31 100 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: LightButton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_PIXMAPBUTTON type: NORMAL_BUTTON box: 320 36 80 80 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: PixmapButton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: file: porsche.xpm fullpath: 1 -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 185 26 100 30 boxtype: FL_ROUNDED3D_UPBOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Button shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LIGHTBUTTON type: PUSH_BUTTON box: 290 146 100 30 boxtype: FL_EMBOSSED_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Button shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 175 71 60 25 boxtype: FL_SHADOW_BOX colors: FL_COL1 FL_SLATEBLUE alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Button shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: =============== FORM =============== Name: staticform Width: 431 Height: 211 Number of Objects: 8 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 431 211 boxtype: FL_FLAT_BOX colors: FL_INDIANRED FL_INDIANRED alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_INDIANRED label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: UP_BOX box: 40 40 60 45 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: A Box shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LABELFRAME type: ENGRAVED_FRAME box: 130 30 120 55 boxtype: FL_NO_BOX colors: FL_BLACK FL_INDIANRED alignment: FL_ALIGN_TOP_LEFT style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: LabelFrame shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CHART type: PIE_CHART box: 270 20 130 105 boxtype: FL_BORDER_BOX colors: FL_INDIANRED FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: chart callback: argument: -------------------- class: FL_CLOCK type: ANALOG_CLOCK box: 30 100 85 85 boxtype: FL_UP_BOX colors: FL_COL1 FL_RIGHT_BCOL alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BITMAP type: NORMAL_BITMAP box: 150 140 30 25 boxtype: FL_NO_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_PIXMAP type: NORMAL_PIXMAP box: 210 120 60 60 boxtype: FL_NO_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_TEXT type: NORMAL_TEXT box: 310 150 70 25 boxtype: FL_BORDER_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Text shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: =============== FORM =============== Name: mainform Width: 461 Height: 291 Number of Objects: 8 -------------------- class: FL_BOX type: UP_BOX box: 0 0 461 291 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 381 250 64 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Done shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: done callback: done_cb argument: 0 -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 15 249 64 27 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Hide shortcut: #H resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: hide callback: hide_show_cb argument: 0 -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 79 249 64 27 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Show shortcut: #S resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: show callback: hide_show_cb argument: 1 -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 155 249 64 27 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: ReShow shortcut: #R resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: reshow callback: reshow_cb argument: 0 -------------------- class: FL_TABFOLDER type: TOP_TABFOLDER box: 15 11 435 230 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_TOP_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: folder callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 232 249 64 27 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Set shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: set callback: set_cb argument: 0 -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 296 249 69 27 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Deactivate shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: deactivate callback: deactivate_cb argument: 0 =============== FORM =============== Name: valuatorform Width: 431 Height: 211 Number of Objects: 10 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 431 211 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_POSITIONER type: NORMAL_POSITIONER box: 280 50 82 72 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_RED alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: xvalue: 0.679012 yvalue: 0.71831 -------------------- class: FL_VALSLIDER type: HOR_NICE_SLIDER box: 55 10 240 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_RIGHT_BCOL alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.87 -------------------- class: FL_COUNTER type: NORMAL_COUNTER box: 130 110 110 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: -1.0 -------------------- class: FL_SLIDER type: VERT_NICE_SLIDER box: 10 30 20 160 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_RED alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.49 -------------------- class: FL_VALSLIDER type: HOR_BROWSER_SLIDER box: 70 170 150 21 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: slsize: 0.10 -------------------- class: FL_SLIDER type: HOR_FILL_SLIDER box: 69 57 159 22 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_SLATEBLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.25 -------------------- class: FL_DIAL type: NORMAL_DIAL box: 60 90 60 58 boxtype: FL_UP_BOX colors: FL_COL1 FL_RIGHT_BCOL alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_SCROLLBAR type: VERT_THIN_SCROLLBAR box: 394 14 18 180 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: slsize: 0.20 -------------------- class: FL_SCROLLBAR type: HOR_SCROLLBAR box: 238 158 140 16 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: slsize: 0.25 =============== FORM =============== Name: choiceform Width: 431 Height: 211 Number of Objects: 5 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 431 211 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_MENU type: PULLDOWN_MENU box: 45 36 45 21 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_LEFT_BCOL alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Menu shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: pulldown callback: argument: -------------------- class: FL_CHOICE type: NORMAL_CHOICE2 box: 24 93 111 27 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice callback: argument: -------------------- class: FL_BROWSER type: HOLD_BROWSER box: 257 14 154 179 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: browser callback: argument: -------------------- class: FL_MENU type: PUSH_MENU box: 152 51 75 26 boxtype: FL_UP_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Menu shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: pushmenu callback: argument: =============== FORM =============== Name: inputform Width: 430 Height: 210 Number of Objects: 3 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 430 210 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_INPUT type: MULTILINE_INPUT box: 70 20 280 90 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: MultiLine\nInput shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_INPUT type: NORMAL_INPUT box: 80 132 250 34 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Input shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: ============================== create_the_forms xforms-1.2.4/fd2ps/test/fd_logo.xpm0000644000175000017500000000455711665175512014135 00000000000000/* XPM */ static char *fd_logo_pixels[] = { /* fd logo * width height ncolors chars_per_pixel */ "64 32 4 1 ", "b c None m None", "` c #ff6144 m White", "a c #cecece m None", "c c #282828 m None", /* pixels */ "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "bbbbbbbbbbbbaaaaaaaabbaaaaabbaaaaaaabbaaaabbbaaaabbbbbbbbbbbbbbb", "bbbbbbbbbbbba```````caa````cba``````cba```cbaa```cbbbbbbbbbbbbbb", "bbbbbbbbbbbbbc``cc``ca``cc``cbc``cc``cbc```ca```ccbbbbbbbbbbbbbb", "bbbbbbbbbbbbba``cac`c``ccbc``ca``ca``cba```ca```cbbbbbbbbbbbbbbb", "bbbbbbbbbbbbba``c`ccc``cbba``ca``ca``cba```c`c``cbbbbbbbbbbbbbbb", "bbbbbbbbbbbbba````cba``cbba``ca`````ccba`c```c``cbbbbbbbbbbbbbbb", "bbbbbbbbbbbbba``c`cba``cbba``ca``c``cbba`c```c``cbbbbbbbbbbbbbbb", "bbbbbbbbbbbbba``cccba``cbaa``ca``cc``cba`cc`cc``cbbbbbbbbbbbbbbb", "bbbbbbbbbbbbaa``cbbbbc``ca``cca``cac``ca`ca`ca``cbbbbbbbbbbbbbbb", "bbbbbbbbbbbba````cbbbbc````cca````c```````ccc````cbbbbbbbbbbbbbb", "bbbbbbbbbbbbbcccccbbbbbcccccbbcccccccccccccbbcccccbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "aaaaaabbaaaaaaaabaaaaaaaaaaabbaaaaaabaaaabaaaaaaaaaaaaaaaaaaabbb", "``````cba```````ca`````c````caa```c`ca```ca```c```````c``````cbb", "c``cc``cbc``cc``c``cc``cc``cca``cc``cbc```cc`ccc``cc``cc``cc``cb", "a``cbc``ca``cac`c``cbc`ca``ca``ccbc`cba```ca`cba``cac`ca``ca``cb", "a``cba``ca``c`ccc```cacca``ca``cbbbccba`c``c`cba``c`ccca``ca``cb", "a``cba``ca````cbbc````cba``ca``caaaaaba`c``c`cba````cbba`````ccb", "a``cba``ca``c`caaacc```ca``ca``ca````ca`cc```cba``c`caba``c``cbb", "a``caa``ca``ccc`c`cbc``ca``ca``cbc``cca`ca```cba``ccc`ca``cc``cb", "a``ca``cca``ca``c``ca``ca``cbc``ca``caa`cbc``caa``ca``ca``cac``c", "``````cca```````c`````cc````cbc````cca```cbc`ca```````c````c````", "cccccccbbccccccccccccccbcccccbbcccccbbccccbbccbccccccccccccccccc", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" }; xforms-1.2.4/fd2ps/test/crab.xpm0000644000175000017500000000377211665175512013431 00000000000000/* XPM */ static char * crab[] = { /* crab pixmap * width height ncolors chars_per_pixel */ "28 28 6 2 ", ". c None m None s None ", "x c orange m black s s_orange ", "* c #ff72c2 m black s s_#ff72c2 ", "+ c SteelBlue m white s s_SteelBlue ", "G c black m black s s_black ", "a c LightGrey m white s s_LightGrey ", /* pixels */ ". . . . . . * * * * . . . . . . . . . * * * * . . . . . ", ". . . . + * x x * . . . . . . . . . . + * x x * . . . . ", ". . . + * x x * . . . . . . . . . . . . + * x x * . . . ", ". . + * x * . . . * . . . . . . . . . * . . + * x * . . ", ". . + * x * . . + * . . . . . . . . + * . . + * x * . . ", ". . + * x * . + * * . . . . . . . . + * * . + * x * . . ", ". . + * x * + * * . . . . . . . . . . + * * + * x * . . ", ". . + * x * * * . . . . . . . . . . . . + * * x x * . . ", ". . . + * x * . . + * . . . . . . + * . . + * x * . . . ", ". . . + * x . . + * . + * * . * * . + * . . + x * . . . ", ". . . . + x . . + * . + * * . * * . + * . . + x . . . . ", ". . . . + x . . . + * + * * * * * + * . . . + x . . . . ", ". . . . + * x . . + * * * * * * * * * . . + x * . . . . ", ". . . . . + * x * * * * x x x x x * * * * x * . . . . . ", ". . . . + + + * * x x x x x x x x x x x x * . . . . . . ", ". . + + * x x x x x x x x x x x x x x x x x x * x . . . ", ". + * x x a + * * x x x x x x x x x x x * * a G * x * . ", "+ * x . . . + * * x x x x x x x x x x x * * G . . . x * ", ". . . . . . + * * x x x x x x x x x x x * * . . . . . . ", ". . . . . + * * x x x x x x x x x x x x x * * . . . . . ", ". . . + * x x x * x x x x x x x x x x x * x x x * . . . ", ". . + * x a a + * * x x x x x x x x x * * a a a x * . . ", ". + * x G G G + * * x x x x x x x x x * * a G G G x * . ", ". + * G . . . + * x * x x x x x x x * x * a G . . . * . ", ". . . . . . + * x a * * * x x x * * * a x * G . . . . . ", ". . . . . + * x a G a a * * * * * a a G a x * G . . . . ", ". . . . . + x a G . G G a a a a a G G . G G x a G . . . ", ". . . . . + x a G . . . G G G G G . . . . . x a G . . . " } ; xforms-1.2.4/fd2ps/test/allpoint.fd0000644000175000017500000002054611665175512014127 00000000000000Magic: 13000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_centiPOINT =============== FORM =============== Name: form0 Width: 59441 Height: 39307 Number of Objects: 25 -------------------- class: FL_BOX type: UP_BOX box: 0 0 59441 39307 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: UP_BOX box: 1917 1917 5753 2877 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Box shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_FRAME type: ENGRAVED_FRAME box: 8628 1917 4794 2877 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: frame shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LABELFRAME type: ENGRAVED_FRAME box: 14381 1917 9587 3835 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_TOP_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: lframe shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_TEXT type: NORMAL_TEXT box: 24927 1917 5752 2877 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Text shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BITMAP type: NORMAL_BITMAP box: 2876 7670 4794 2876 boxtype: FL_NO_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: bitmapbutton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_PIXMAP type: NORMAL_PIXMAP box: 25885 29720 4794 3835 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: pixmapbutton shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CHART type: BAR_CHART box: 10546 8628 11504 5753 boxtype: FL_BORDER_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: chart shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CLOCK type: ANALOG_CLOCK box: 23009 6711 6711 5752 boxtype: FL_UP_BOX colors: FL_INACTIVE FL_BOTTOM_BCOL alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: clock shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 1917 13422 5753 2876 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Button shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_ROUNDBUTTON type: PUSH_BUTTON box: 1917 17257 6711 2876 boxtype: FL_NO_BOX colors: FL_MCOL FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: RButton shortcut: R resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 1 -------------------- class: FL_ROUND3DBUTTON type: PUSH_BUTTON box: 1917 21092 6711 2876 boxtype: FL_NO_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: R3DButton shortcut: 3 resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 1 -------------------- class: FL_CHECKBUTTON type: PUSH_BUTTON box: 1917 24927 6711 2876 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: CButton shortcut: C resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_SLIDER type: HOR_SLIDER box: 33555 1917 17257 2877 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.20 slsize: 0.12 -------------------- class: FL_VALSLIDER type: HOR_BROWSER_SLIDER box: 33555 5752 17257 2876 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.60 -------------------- class: FL_DIAL type: FILL_DIAL box: 31638 10546 8628 7670 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_RIGHT_BCOL alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Dial shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.7 -------------------- class: FL_POSITIONER type: NORMAL_POSITIONER box: 46977 9587 9587 8629 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_RED alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: xvalue: 0.2 yvalue: 0.2 -------------------- class: FL_COUNTER type: NORMAL_COUNTER box: 16298 16298 11505 2876 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.2 -------------------- class: FL_COUNTER type: SIMPLE_COUNTER box: 16298 20133 11505 2876 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.4 -------------------- class: FL_INPUT type: NORMAL_INPUT box: 14381 24927 17257 2876 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Input shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_MENU type: PULLDOWN_MENU box: 32596 25885 8629 2877 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Menu shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CHOICE type: NORMAL_CHOICE2 box: 39307 19174 7670 2876 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BROWSER type: NORMAL_BROWSER box: 43142 23009 12464 9587 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_TIMER type: VALUE_TIMER box: 35473 33555 7669 2876 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_RED alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Timer shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_XYPLOT type: NORMAL_XYPLOT box: 6711 27803 15339 10546 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: ============================== create_the_forms xforms-1.2.4/fd2ps/test/Makefile.am0000644000175000017500000000035511665175512014022 00000000000000include $(top_srcdir)/config/common.am EXTRA_DIST = \ allcmm.fd \ all.fd \ allpoint.fd \ bm1.xbm \ buttons.fd \ crab.xpm \ dial.fd \ fd_logo.xpm \ folder_gui.fd \ junk.fd \ parameter.xpm \ picture.xbm \ sym.fd \ xconq.xpm xforms-1.2.4/fd2ps/test/bm1.xbm0000644000175000017500000000044011665175512013150 00000000000000 #define bm1_width 16 #define bm1_height 16 static unsigned char bm1_bits[] = { 0x00, 0x00, 0x00, 0x57, 0x7c, 0x72, 0xc4, 0x52, 0xc4, 0x00, 0x44, 0x01, 0x44, 0x1f, 0xfc, 0x22, 0x40, 0x42, 0x40, 0x44, 0x40, 0x43, 0xc0, 0x40, 0x70, 0x40, 0x8c, 0x20, 0x00, 0x1f, 0x00, 0x00 }; xforms-1.2.4/fd2ps/test/picture.xbm0000644000175000017500000000156411665175512014154 00000000000000#define picture_width 32 #define picture_height 32 static char picture_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x80, 0x01, 0x18, 0x64, 0x6f, 0xf6, 0x26, 0x0a, 0x00, 0x00, 0x50, 0xf2, 0xff, 0xff, 0x4f, 0x14, 0x04, 0x00, 0x28, 0x14, 0x0e, 0x00, 0x28, 0x10, 0x32, 0x00, 0x08, 0x94, 0x03, 0x00, 0x08, 0xf4, 0x04, 0x00, 0x08, 0xb0, 0x08, 0x00, 0x08, 0x34, 0x01, 0x00, 0x28, 0x34, 0x01, 0x00, 0x28, 0x12, 0x00, 0x40, 0x48, 0x12, 0x20, 0xa6, 0x48, 0x14, 0x50, 0x11, 0x29, 0x14, 0x50, 0x48, 0x2a, 0x10, 0x27, 0xac, 0x0e, 0xd4, 0x71, 0xe8, 0x0a, 0x74, 0x20, 0xa8, 0x0a, 0x14, 0x20, 0x00, 0x08, 0x10, 0x50, 0x00, 0x08, 0x14, 0x00, 0x00, 0x28, 0x14, 0x00, 0x00, 0x28, 0xf2, 0xff, 0xff, 0x4f, 0x0a, 0x00, 0x00, 0x50, 0x64, 0x6f, 0xf6, 0x26, 0x18, 0x80, 0x01, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; xforms-1.2.4/fd2ps/load.c0000644000175000017500000005723112251706162012070 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file load.c * * This file is part of XForms package * Copyright (c) 1997-2000 by T.C. Zhao * All rights reserved. * * Read a form defination file and call PS output routines */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "fd2ps.h" #include #include #define MAGIC3 12322 #define MAGIC4 13000 #define MAGIC5 14000 #define MAGIC6 15000 extern char *de_space( char *s ); /*************************************** ***************************************/ static FL_FORM * make_form( int type FL_UNUSED_ARG, int w, int h ) { FL_FORM *form; form = calloc( 1, sizeof *form ); form->w = w; form->h = h; form->first = form->last = NULL; form->label = NULL; return form; } #define sl_focus( t ) ( t == FL_HOR_BROWSER_SLIDER \ || t == FL_VERT_BROWSER_SLIDER \ || t == FL_HOR_BROWSER_SLIDER2 \ || t == FL_VERT_BROWSER_SLIDER2 \ || t == FL_HOR_THIN_SLIDER \ || t == FL_VERT_THIN_SLIDER ) /*************************************** ***************************************/ FL_OBJECT * flps_make_object( int objclass, int type, int x, int y, int w, int h, const char * label, void * p FL_UNUSED_ARG ) { FL_OBJECT *ob = calloc( 1, sizeof *ob ); ALLSPEC *sp; ob->objclass = objclass; ob->type = type; ob->boxtype = FL_UP_BOX; ob->x = x; ob->y = y; ob->w = w; ob->h = h; ob->label = fl_strdup( label ? label : "" ); /* Default, must agree with FL default */ ob->align = FL_ALIGN_CENTER; ob->col1 = FL_COL1; ob->col2 = FL_MCOL; ob->lcol = FL_BLACK; ob->lsize = FL_DEFAULT_FONT; ob->lstyle = FL_NORMAL_STYLE; ob->shortcut = calloc( 1, sizeof *ob->shortcut ); ob->shortcut[ 0 ] = 0; ob->next = ob->prev = NULL; ob->form = NULL; ob->bw = ( psinfo.bw && FL_abs( psinfo.bw ) <= 6 ) ? psinfo.bw : FL_BOUND_WIDTH; sp = ob->spec = calloc( 1, sizeof *sp ); sp->content = calloc( MAX_CONTENT + 1, sizeof *sp->content ); sp->mode = calloc( MAX_CONTENT + 1, sizeof *sp->mode ); sp->fontstyle = FL_NORMAL_STYLE; sp->fontsize = FL_DEFAULT_FONT; /* Set object specific defaults */ if ( ob->objclass == FL_SLIDER || ob->objclass == FL_VALSLIDER || ob->objclass == FL_THUMBWHEEL ) { sp->val = 0.5; sp->prec = 2; sp->max = 1.0; sp->min = 0.0; sp->slsize = FL_SLIDER_WIDTH; if ( sl_focus( ob->type ) ) sp->slsize *= 1.5; } else if ( ob->objclass == FL_SCROLLBAR ) { ob->col1 = ob->col2 = FL_COL1; sp->val = 0.5; sp->prec = 2; sp->max = 1.0; sp->min = 0.0; sp->slsize = FL_SLIDER_WIDTH; if ( ob->type == FL_HOR_THIN_SCROLLBAR || ob->type == FL_VERT_THIN_SCROLLBAR || ob->type == FL_HOR_SCROLLBAR || ob->type == FL_VERT_SCROLLBAR ) sp->slsize *= 1.6; } else if ( ob->objclass == FL_POSITIONER ) { sp->xmin = sp->ymin = 0.0; sp->xmax = sp->ymax = 1.0; sp->xval = sp->yval = 0.5; } else if ( ob->objclass == FL_COUNTER ) { sp->val = 0.0; sp->prec = 1; sp->min = -1000000.0; sp->max = 1000000.0; } else if ( ob->objclass == FL_DIAL ) { sp->min = 0.0; sp->max = 1.0; sp->val = 0.5; sp->thetai = 0.0; sp->thetaf = 360; sp->origin = 270; sp->direction = FL_DIAL_CW; } else if ( ob->objclass == FL_PIXMAP || ob->objclass == FL_PIXMAPBUTTON ) { sp->align = FL_ALIGN_CENTER; sp->dx = sp->dy = 3; sp->show_focus = 1; psinfo.epsf_import = 1; } else if ( ob->objclass == FL_CHOICE ) { sp->align = FL_ALIGN_CENTER; sp->fontsize = FL_DEFAULT_FONT; } else if ( ob->objclass == FL_BROWSER ) { sp->fontsize = FL_DEFAULT_FONT; sp->h_pref = FL_AUTO; sp->v_pref = FL_AUTO; } return ob; } /*************************************** ***************************************/ static int read_key_val( FILE * fp, char * key, char * val ) { char buf[ 1024 ], *p; if ( ! fgets( buf, 1024, fp ) ) { strcpy( key, "?" ); return EOF; } buf[ 1023 ] = 0; val[ 0 ] = key[ 0 ] = '\0'; /* Nuke the new line */ if ( ( p = strchr( buf, '\n' ) ) ) *p = '\0'; if ( ! ( p = strchr( buf, ':' ) ) ) { strcpy( key, "?" ); return EOF; } *p = '\0'; strcpy( key, buf ); if ( * ( p + 1 ) ) strcpy( val, p + 2 ); return 0; } /*************************************** * Adds an object to the form. ***************************************/ static void flps_add_object( FL_FORM * form, FL_OBJECT * obj ) { /* Checking for correct behaviour. */ if ( obj == NULL ) { fprintf( stderr, "fl_add_object:Trying to add NULL object.\n" ); return; } if ( form == NULL ) { fprintf( stderr, "fl_add_object:Trying to add object to NULL form\n" ); return; } obj->prev = obj->next = NULL; if ( psinfo.inverted ) obj->y = form->h - obj->h - obj->y; if ( form->first == NULL ) form->first = form->last = obj; else { obj->prev = form->last; form->last->next = obj; form->last = obj; } obj->form = form; } /**************************************** * Sets the label, turning "\\n" in "\n" ****************************************/ static void set_label( FL_OBJECT * obj, const char * str ) { int i = 0, j = 0; static char tmpstr[ 1024 ]; do { if ( str[ i ] == '\\' && str[ i + 1 ] == 'n' ) { tmpstr[ j++ ] = '\n'; i++; } else if ( str[ i ] == '\\' && strncmp( str + i + 1, "010", 3 ) == 0 ) { if ( ! obj->shortcut || ! *obj->shortcut ) tmpstr[ j++ ] = *ul_magic_char; i += 3; } else tmpstr[ j++ ] = str[ i ]; } while ( str[ i++ ] != 0); tmpstr[ j ] = '\0'; obj->label = fl_strdup( tmpstr ); } extern int class_val( char * ); extern int boxtype_val( char * ); extern int align_val( const char * ); extern int style_val( const char * ); extern int lsize_val( const char * ); extern int pupmode_val( const char * ); extern int scbpref_val( const char * ); /*********************************************************************** * Routines to load object specific initialization code **********************************************************************/ #define ISSLIDER( cls ) ( cls == FL_SLIDER || cls == FL_VALSLIDER ) /*************************************** * Lump together all spec info into one routine. We really * should include fd_spec here so we don't write the code * twice ***************************************/ static void load_objclass_spec_info( FILE * fp, FL_OBJECT * ob ) { char key[ 128 ], val[ 128 ]; SPEC *sp = ob->spec; int c; while ( ungetc( ( c = getc( fp ) ), fp ) != '-' && c != '=' ) { read_key_val( fp, key, val ); if ( strlen( de_space( key ) ) < 2 ) /* empty */ ; else if ( strcmp( key, "bounds" ) == 0 ) sscanf( val, "%f %f", &sp->min, &sp->max ); else if ( strcmp( key, "xbounds" ) == 0 ) sscanf( val, "%f %f", &sp->xmin, &sp->xmax ); else if (strcmp( key, "ybounds" ) == 0 ) sscanf( val, "%f %f", &sp->ymin, &sp->ymax ); else if ( strcmp( key, "precision" ) == 0 ) sscanf( val, "%d", &sp->prec ); else if ( strcmp( key, "initial_val" ) == 0 ) sscanf( val, "%f", &sp->val ); else if ( strcmp( key, "value" ) == 0 ) { if ( ISBUTTON( ob->objclass ) || ISCHOICE( ob->objclass ) ) sp->int_val = atoi( val ); else sp->val = atof( val ); } else if ( strcmp( key, "xvalue" ) == 0 ) sscanf( val, "%f", &sp->xval ); else if ( strcmp( key, "yvalue" ) == 0 ) sscanf( val, "%f", &sp->yval ); else if ( strcmp( key, "xstep" ) == 0 ) sscanf( val, "%f", &sp->xstep ); else if ( strcmp( key, "ystep" ) == 0 ) sscanf( val, "%f", &sp->ystep ); else if ( strcmp(key, "sstep" ) == 0 ) sscanf( val, "%f", &sp->sstep ); else if ( strcmp( key, "lstep" ) == 0 ) sscanf( val, "%f", &sp->lstep ); else if ( strcmp( key, "file" ) == 0 ) sp->file = fl_strdup( val ); else if ( strcmp( key, "focus" ) == 0 ) sp->show_focus = atoi( val ); else if ( strcmp( key, "align" ) == 0 ) sp->align = align_val( val ); else if ( strcmp( key, "slsize" ) == 0 ) sscanf( val, "%f", &sp->slsize ); else if ( strcmp( key, "angles" ) == 0 ) sscanf( val, "%f %f", &sp->thetai, &sp->thetaf ); else if ( strcmp( key, "content" ) == 0 ) sp->content[ ++sp->lines ] = fl_strdup( val ); else if ( strcmp( key, "mode" ) == 0 ) sp->mode[ sp->lines ] = pupmode_val( val ); else if ( strcmp( key, "h_pref" ) == 0 ) sp->h_pref = scbpref_val( val ); else if ( strcmp( key, "v_pref" ) == 0 ) sp->v_pref = scbpref_val( val ); else if ( strcmp(key, "dir" ) == 0 ) { if ( strcmp( val, "FL_DIAL_CCW" ) == 0 ) sp->direction = FL_DIAL_CCW; else sp->direction = FL_DIAL_CW; } /* known but don't care */ else if ( ! strcmp( key, "return" ) || ! strcmp( key, "data" ) || ! strcmp( key, "ytics" ) || ! strcmp( key, "xtics" ) || ! strcmp( key, "xscale" ) || ! strcmp( key, "yscale" ) || ! strcmp( key, "struct" ) || ! strcmp( key, "global" ) || ! strcmp( key, "shortcut" ) || ! strcmp( key, "increment" ) || ! strcmp( key, "handler" ) || ! strcmp( key, "fullpath" ) || ! strcmp( key, "mbuttons" ) ) /* empty */; else fprintf( stderr, "%s: Unknown spec (%s = %s) -- Ignored\n", find_class_name(ob->objclass), key, val ); } } /*************************************** ***************************************/ static FL_OBJECT * load_object( FL_FORM * form, FILE * fl ) { FL_OBJECT *obj; int objclass, type = 0; int x = 0, y = 0, w = 0, h = 0; char name[ 64 ], cbname[ 64 ]; char cn1[ 64 ], cn2[ 64 ]; char objcls[ 64 ]; char key[ 64 ], val[ 1000 ]; /* Must demand the vital info */ if ( ! fgets( val, sizeof val, fl ) || *val != '-' || read_key_val(fl, key, objcls ) == EOF || strcmp( key, "class" ) || ( strcmp( objcls, "FL_BEGIN_GROUP" ) && strcmp( objcls, "BEGIN_GROUP" ) && strcmp( objcls, "FL_END_GROUP" ) && strcmp( objcls, "END_GROUP" ) && ( fscanf( fl, "type: %999s\n", val ) != 1 || fscanf( fl, "box: %d %d %d %d\n", &x, &y, &w, &h ) != 4 ) ) ) { fprintf( stderr, "Somethings wrong with the file\n" ); exit( EXIT_FAILURE ); } objclass = find_class_val( objcls ); if ( objclass != FL_BEGIN_GROUP && objclass != FL_END_GROUP ) type = find_type_val( objclass, val ); obj = flps_make_object( objclass, type, x, y, w, h, 0, 0 ); flps_add_object( form, obj ); /* Now parse the attributes */ while ( read_key_val( fl, key, val ) != EOF ) { if ( ( objclass == FL_BEGIN_GROUP || objclass == FL_END_GROUP ) && ( ! strcmp( key, "type" ) || ! strcmp( key, "box" ) ) ) /* do nothing */ ; else if ( ! strcmp( key, "boxtype" ) ) obj->boxtype = boxtype_val( val ); else if ( ! strcmp(key, "colors" ) ) { cn1[ 0 ] = cn2[ 0 ] = '\0'; if ( sscanf( val, "%63s %63s", cn1, cn2 ) != 2 ) { fprintf( stderr, "Somethings wrong with the file\n" ); exit( EXIT_FAILURE ); } obj->col1 = fl_get_namedcolor(cn1); obj->col2 = fl_get_namedcolor(cn2); } else if ( ! strcmp( key, "alignment" ) ) obj->align = align_val(val); else if ( ! strcmp( key, "style" ) || ! strcmp( key, "lstyle" ) ) obj->lstyle = style_val( val ); else if ( ! strcmp( key, "size" ) || ! strcmp( key, "lsize" ) ) obj->lsize = lsize_val(val); else if ( ! strcmp( key, "lcol" ) ) obj->lcol = fl_get_namedcolor( val ); else if ( ! strcmp( key, "label" ) ) set_label( obj, val ); else if ( ! strcmp( key, "shortcut" ) ) flps_set_object_shortcut( obj, val, 1 ); else if ( ! strcmp( key, "callback" ) ) strcpy( cbname, val ); else if ( ! strcmp( key, "name" ) ) strcpy( name, val ); else if ( ! strcmp( key, "argument" ) ) /* empty */ ; else if ( ! strcmp( key, "resize" ) ) /* empty */ ; else if ( ! strcmp( key, "return" ) ) /* empty */ ; else if ( ! strcmp( key, "gravity" ) ) /* empty */ ; else break; } if ( objclass != FL_BEGIN_GROUP && objclass != FL_END_GROUP && *key != '?' ) load_objclass_spec_info( fl, obj ); return obj; } /*************************************** ***************************************/ static FL_FORM * read_form( FILE * fl ) { double w, h; int onumb; FL_FORM *cur_form = 0; char fname[ 1024 ]; if ( ! fgets( fname, sizeof fname, fl ) || *fname != '=' || fscanf( fl, "Name: %1023s\n", fname ) != 1 ) { fprintf( stderr, "Inbvalid format of input file.\n" ); exit( 1 ); } if ( fscanf( fl, "Width: %lf\nHeight: %lf\n", &w, &h ) != 2 ) { fprintf( stderr, "Inbvalid format of input file.\n" ); exit( 1 ); } cur_form = make_form( FL_NO_BOX, w, h ); cur_form->label = fl_strdup( fname ); if ( fscanf( fl, "Number of Objects: %d\n", &onumb ) != 1 ) { /* This is an error and should be handled JTT*/ } /* Here should be checks if as many objects could be loaded as expected JTT */ while ( --onumb >= 0 ) load_object( cur_form, fl ); return cur_form; } /*************************************** ***************************************/ int load_form_definition( const char * filename ) { FILE *fp = fopen( filename, "r" ); int fd_magic, nf; FL_FORM *form; char buf[ 256 ], ubuf[ 32 ]; if ( ! fp ) { perror( filename ); return -1; }; if ( fscanf( fp, "Magic: %d\n\n", &fd_magic ) != 1 || ( fd_magic != MAGIC3 && fd_magic != MAGIC4 && fd_magic != MAGIC5 && fd_magic != MAGIC6 ) ) { fclose( fp ); fprintf( stderr, "Unknown file %s (magic %d)\n", filename, fd_magic ); return -1; } psinfo.inverted = fd_magic >= MAGIC4; if ( ! fgets( buf, sizeof buf, fp ) || strcmp( buf, "Internal Form Definition File\n" ) || ! fgets( buf, sizeof buf, fp ) || strcmp( buf, " (do not change)\n" ) || fgetc( fp ) != '\n' || fscanf( fp, "Number of forms: %d\n", &nf ) != 1 ) { fclose( fp ); fprintf( stderr, "Failure to read file %s\n", filename ); return -1; } psinfo.pages = nf; if ( nf > 1 && psinfo.eps ) fprintf( stderr, "Requesting EPS output with more than one form.\n" ); if ( psinfo.verbose ) fprintf( stderr, "%d forms will be converted\n", nf ); /* read until we hit a seperator line */ while ( fgets( buf, sizeof buf, fp ) && *buf != '\n' ) { if ( strncmp( buf, "Unit", 4 ) == 0 ) { float xs, ys; if ( sscanf( buf, "Unit of measure: %31s", ubuf ) != 1 ) { fclose( fp ); fprintf( stderr, "Failure to read file %s\n", filename ); return -1; } psinfo.unit = unit_val( ubuf ); get_scale_unit( psinfo.unit, &xs, &ys ); } else if ( strncmp( buf, "Border", 6 ) == 0 ) { if ( sscanf( buf, "Border Width: %31s", ubuf ) != 1 ) { fclose( fp ); fprintf( stderr, "Failure to read file %s\n", filename ); return -1; } psinfo.bw = atoi( ubuf ); } else if ( strncmp( buf, "Snap", 4 ) == 0 ) /* empty */ ; else fprintf( stderr, "Unknown token: %s", buf ); } if ( psinfo.user_bw ) psinfo.bw = psinfo.user_bw; while ( --nf >= 0 ) { form = read_form( fp ); ps_show_form( form ); } fclose( fp ); return 0; } /* attributes query routines */ #define VN( v ) { v, #v } typedef struct { int val; char * name; } VN_pair; static VN_pair vn_btype[ ] = { VN( FL_NO_BOX ), VN( FL_UP_BOX ), VN( FL_DOWN_BOX ), VN( FL_FLAT_BOX ), VN( FL_BORDER_BOX ), VN( FL_SHADOW_BOX ), VN( FL_FRAME_BOX ), VN( FL_ROUNDED_BOX ), VN( FL_RFLAT_BOX ), VN( FL_RSHADOW_BOX ), VN( FL_OVAL_BOX ), VN( FL_EMBOSSED_BOX ), VN( FL_ROUNDED3D_UPBOX ), VN( FL_ROUNDED3D_DOWNBOX ), VN( FL_OVAL3D_UPBOX ), VN( FL_OVAL3D_DOWNBOX ), VN( FL_TOPTAB_UPBOX ), VN( FL_SELECTED_TOPTAB_UPBOX ), VN( FL_BOTTOMTAB_UPBOX ), VN( FL_SELECTED_BOTTOMTAB_UPBOX ), VN( -1 ) }; /*************************************** ***************************************/ int boxtype_val( char *cc ) { VN_pair *vn = vn_btype; for ( ; vn->val >= 0; vn++ ) if ( strcmp( cc, vn->name ) == 0 ) return vn->val; fprintf( stderr, "unknown boxtype %s\n", cc ); return atoi( cc ); } static VN_pair vn_align[ ] = { VN( FL_ALIGN_CENTER ), VN( FL_ALIGN_TOP ), VN( FL_ALIGN_BOTTOM ), VN( FL_ALIGN_LEFT ), VN( FL_ALIGN_RIGHT ), VN( FL_ALIGN_LEFT_TOP ), VN( FL_ALIGN_RIGHT_TOP ), VN( FL_ALIGN_LEFT_BOTTOM ), VN( FL_ALIGN_RIGHT_BOTTOM ), VN( FL_ALIGN_TOP_LEFT ), /* need them for backward compatibility */ VN( FL_ALIGN_TOP_RIGHT ), VN( FL_ALIGN_BOTTOM_LEFT ), VN( FL_ALIGN_BOTTOM_RIGHT ), VN( -1 ) }; static VN_pair vn_lsize[ ] = { VN( FL_DEFAULT_FONT ), VN( FL_DEFAULT_SIZE ), VN( FL_TINY_FONT ), VN( FL_TINY_SIZE ), VN( FL_SMALL_FONT ), VN( FL_SMALL_SIZE ), VN( FL_NORMAL_FONT ), VN( FL_NORMAL_SIZE ), VN( FL_MEDIUM_FONT ), VN( FL_MEDIUM_SIZE ), VN( FL_LARGE_FONT ), VN( FL_LARGE_SIZE ), VN( FL_HUGE_FONT ), VN( FL_HUGE_SIZE ), { FL_SMALL_FONT, "FL_NORMAL_FONT1" }, { FL_NORMAL_FONT, "FL_NORMAL_FONT2" }, VN( -1 ) }; static VN_pair vn_lstyle[ ] = { VN(FL_NORMAL_STYLE), VN(FL_BOLD_STYLE), VN(FL_ITALIC_STYLE), VN(FL_BOLDITALIC_STYLE), VN(FL_FIXED_STYLE), VN(FL_FIXEDBOLD_STYLE), VN(FL_FIXEDITALIC_STYLE), VN(FL_FIXEDBOLDITALIC_STYLE), VN(FL_TIMES_STYLE), VN(FL_TIMESBOLD_STYLE), VN(FL_TIMESITALIC_STYLE), VN(FL_TIMESBOLDITALIC_STYLE), VN(FL_SHADOW_STYLE), VN(FL_ENGRAVED_STYLE), VN(FL_EMBOSSED_STYLE), VN(-1) }; static VN_pair vn_pupmode[ ] = { VN( FL_PUP_NONE ), VN( FL_PUP_GRAY ), VN( FL_PUP_BOX ), VN( FL_PUP_CHECK ), VN( FL_PUP_RADIO ), VN( -1 ) }; static VN_pair vn_scbpref[] = { VN( FL_OFF ), VN( FL_ON ), VN( FL_AUTO ), VN( -1 ) }; /*************************************** ***************************************/ static int pure_style_val( const char *cc ) { VN_pair *vn = vn_lstyle; for ( ; vn->val >= 0; vn++ ) if ( strcmp( cc, vn->name ) == 0 ) return vn->val; return atoi( cc ); } /*************************************** ***************************************/ int style_val( const char *cc ) { char lstyle[ 40 ], spstyle[ 40 ], *p; strcpy( lstyle, cc ); spstyle[ 0 ] = '\0'; if ( ( p = strchr( lstyle, '+' ) ) ) memmove( spstyle, p + 1, strlen( p ) ); return pure_style_val( lstyle ) + pure_style_val( spstyle ); } /*************************************** ***************************************/ int lsize_val(const char *cc) { VN_pair *vn = vn_lsize; for ( ; vn->val >= 0; vn++ ) if ( strcmp( cc, vn->name ) == 0 ) return vn->val; return atoi( cc ); } /*************************************** ***************************************/ int pupmode_val( const char *cc ) { VN_pair *vn = vn_pupmode; for (; vn->val >= 0; vn++) if ( strcmp( cc, vn->name ) == 0 ) return vn->val; return atoi( cc ); } /*************************************** ***************************************/ int scbpref_val( const char *cc ) { VN_pair *vn = vn_scbpref; for ( ; vn->val >= 0; vn++) if ( strcmp( cc, vn->name ) == 0 ) return vn->val; return atoi( cc ); } /*************************************** ***************************************/ int align_val( const char *cc ) { VN_pair *vn = vn_align; char s[ 128 ], *p; strcpy( s, cc ); if ( ( p = strchr( s, '|' ) ) ) *p = '\0'; for ( ; vn->val >= 0; vn++) if ( strcmp( s, vn->name ) == 0 ) return p ? fl_to_inside_lalign( vn->val ) : vn->val; if ( ! isdigit( ( unsigned char ) cc[ 0 ] ) ) fprintf( stderr, "Unknown alignment %s\n", cc ); return atoi( cc ); } /*************************************** * Remove leading space ***************************************/ char * de_space( char *s ) { char *p; /* not all isspace considers '\t' a white space */ for ( p = s; p && ( isspace( ( unsigned char ) *p ) || *p == '\t' ); p++ ) /* empty */ ; return ( p == s ) ? s : strcpy( s, p ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fd2ps/flsupport.c0000644000175000017500000003564212251675467013226 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file flsupport.c * * This file is part of XForms package * Copyright (c) 1997-2000 by T.C. Zhao * All rights reserved. * * Support routines to convert string/numeric values of * object classes and types */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include #include #include "fd2ps.h" #define MAXTYPES 17 typedef struct { int val; const char * name; } VN_Pair; #define VN_pair VN_Pair /*************************************** ***************************************/ static int get_vn_val( VN_pair * vn, const char * name ) { for ( ; vn->val >= 0; vn++ ) if ( strcmp(name, vn->name) == 0 ) return vn->val; return atoi( name ); } /*************************************** ***************************************/ static const char * get_vn_name( VN_pair * vn, int val ) { static char buf[ 128 ]; for ( ; vn->val >= 0; vn++ ) if ( vn->val == val ) return vn->name; sprintf( buf, "%d", val ); return buf; } typedef struct { VN_Pair classobj; VN_Pair objtype[ MAXTYPES ]; } AllObj; #define VNP( a ) { a, #a } #define VN( a ) { a, #a } static AllObj allobj[ ] = { /* begin button class */ { VNP( FL_BUTTON ), { VNP( FL_NORMAL_BUTTON ), VNP( FL_PUSH_BUTTON ), VNP( FL_RADIO_BUTTON ), VNP( FL_HIDDEN_BUTTON ), VNP( FL_TOUCH_BUTTON ), VNP( FL_INOUT_BUTTON ), VNP( FL_RETURN_BUTTON ), VNP( FL_HIDDEN_RET_BUTTON ), VNP( FL_MENU_BUTTON ), VNP( -1 ) } }, { VNP( FL_LIGHTBUTTON ), { VNP( FL_NORMAL_BUTTON ), VNP( FL_PUSH_BUTTON ), VNP( FL_RADIO_BUTTON ), VNP( FL_HIDDEN_BUTTON ), VNP( FL_TOUCH_BUTTON ), VNP( FL_INOUT_BUTTON ), VNP( FL_RETURN_BUTTON ), VNP( FL_HIDDEN_RET_BUTTON ), VNP( -1 ) } }, { VNP( FL_ROUNDBUTTON ), { VNP( FL_NORMAL_BUTTON ), VNP( FL_PUSH_BUTTON ), VNP( FL_RADIO_BUTTON ), VNP( FL_HIDDEN_BUTTON ), VNP( FL_TOUCH_BUTTON ), VNP( FL_INOUT_BUTTON ), VNP( FL_RETURN_BUTTON ), VNP( FL_HIDDEN_RET_BUTTON ), VNP( -1 ) } }, { VNP( FL_ROUND3DBUTTON ), { VNP( FL_NORMAL_BUTTON ), VNP( FL_PUSH_BUTTON ), VNP( FL_RADIO_BUTTON ), VNP( FL_HIDDEN_BUTTON ), VNP( FL_TOUCH_BUTTON ), VNP( FL_INOUT_BUTTON ), VNP( FL_RETURN_BUTTON ), VNP( FL_HIDDEN_RET_BUTTON ), VNP( -1) } }, { VNP( FL_SCROLLBUTTON ), { VNP( FL_NORMAL_BUTTON ), VNP( FL_PUSH_BUTTON ), VNP( FL_RADIO_BUTTON ), VNP( FL_HIDDEN_BUTTON ), VNP( FL_TOUCH_BUTTON ), VNP( FL_INOUT_BUTTON ), VNP( FL_RETURN_BUTTON ), VNP( FL_HIDDEN_RET_BUTTON ), VNP( -1) } }, { VNP( FL_BITMAPBUTTON ), { VNP( FL_NORMAL_BUTTON ), VNP( FL_PUSH_BUTTON ), VNP( FL_RADIO_BUTTON ), VNP( FL_HIDDEN_BUTTON ), VNP( FL_TOUCH_BUTTON ), VNP( FL_INOUT_BUTTON ), VNP( FL_RETURN_BUTTON ), VNP( FL_HIDDEN_RET_BUTTON ), VNP( -1 ) } }, { VNP( FL_PIXMAPBUTTON ), { VNP( FL_NORMAL_BUTTON ), VNP( FL_PUSH_BUTTON ), VNP( FL_RADIO_BUTTON ), VNP( FL_HIDDEN_BUTTON ), VNP( FL_TOUCH_BUTTON ), VNP( FL_INOUT_BUTTON ), VNP( FL_RETURN_BUTTON ), VNP( FL_HIDDEN_RET_BUTTON ), VNP( -1 ) } }, { VNP( FL_CHECKBUTTON ), { VNP( FL_NORMAL_BUTTON ), VNP( FL_PUSH_BUTTON ), VNP( FL_RADIO_BUTTON ), VNP( FL_HIDDEN_BUTTON ), VNP( FL_TOUCH_BUTTON ), VNP( FL_INOUT_BUTTON ), VNP( FL_RETURN_BUTTON ), VNP( FL_HIDDEN_RET_BUTTON ), VNP( -1 ) } }, { VNP( FL_LABELBUTTON ), { VNP( FL_NORMAL_BUTTON ), VNP( FL_PUSH_BUTTON ), VNP( FL_RADIO_BUTTON ), VNP( FL_HIDDEN_BUTTON ), VNP( FL_TOUCH_BUTTON ), VNP( FL_INOUT_BUTTON ), VNP( FL_RETURN_BUTTON ), VNP( FL_HIDDEN_RET_BUTTON ), VNP( -1 ) } }, /* end of buttons of all kinds } */ { VNP( FL_BITMAP ), { VNP( FL_NORMAL_BITMAP ), VNP( -1 ) } }, { VNP( FL_PIXMAP ), { VNP( FL_NORMAL_PIXMAP ), VNP( -1 ) } }, { VNP( FL_MENU ), { VNP( FL_PULLDOWN_MENU ), VNP( FL_TOUCH_MENU ), VNP( FL_PUSH_MENU ), VNP( -1 ) } }, { VNP( FL_BOX ), { VNP( FL_NO_BOX ), VNP( FL_UP_BOX ), VNP( FL_DOWN_BOX ), VNP( FL_FLAT_BOX ), VNP( FL_BORDER_BOX ), VNP( FL_SHADOW_BOX ), VNP( FL_FRAME_BOX ), VNP( FL_RFLAT_BOX ), VNP( FL_EMBOSSED_BOX ), VNP( FL_ROUNDED_BOX ), VNP( FL_RSHADOW_BOX ), VNP( FL_OVAL_BOX ), VNP( FL_ROUNDED3D_UPBOX ), VNP( FL_ROUNDED3D_DOWNBOX ), VNP( FL_OVAL3D_UPBOX ), VNP( FL_OVAL3D_DOWNBOX ), VNP( -1 ) } }, { VNP( FL_TEXT ), { VNP( FL_NORMAL_TEXT ), VNP( -1 ), } }, { VNP( FL_CHART ), { VNP( FL_BAR_CHART ), VNP( FL_HORBAR_CHART ), VNP( FL_LINE_CHART ), VNP( FL_FILLED_CHART ), VNP( FL_PIE_CHART ), VNP( FL_SPECIALPIE_CHART ), VNP( -1 ) } }, { VNP( FL_CHOICE ), { VNP( FL_NORMAL_CHOICE ), VNP( FL_NORMAL_CHOICE2 ), VNP( FL_DROPLIST_CHOICE ), VNP( -1 ), } }, { VNP( FL_COUNTER ), { VNP( FL_NORMAL_COUNTER ), VNP( FL_SIMPLE_COUNTER ), VNP( -1 ) } }, { VNP( FL_SLIDER ), { VNP( FL_VERT_SLIDER ), VNP( FL_HOR_SLIDER ), VNP( FL_VERT_FILL_SLIDER ), VNP( FL_HOR_FILL_SLIDER ), VNP( FL_VERT_NICE_SLIDER ), VNP( FL_HOR_NICE_SLIDER ), VNP( FL_HOR_BROWSER_SLIDER ), VNP( FL_VERT_BROWSER_SLIDER ), VNP( FL_HOR_THIN_SLIDER ), VNP( FL_VERT_THIN_SLIDER ), VNP( FL_HOR_BROWSER_SLIDER2 ), VNP( FL_VERT_BROWSER_SLIDER2 ), VNP( -1 ) } }, { VNP( FL_VALSLIDER ), { VNP( FL_VERT_SLIDER ), VNP( FL_HOR_SLIDER ), VNP( FL_VERT_FILL_SLIDER ), VNP( FL_HOR_FILL_SLIDER ), VNP( FL_VERT_NICE_SLIDER ), VNP( FL_HOR_NICE_SLIDER ), VNP( FL_HOR_BROWSER_SLIDER ), VNP( FL_VERT_BROWSER_SLIDER ), VNP( -1 ) } }, { VNP( FL_SCROLLBAR ), { VNP( FL_VERT_SCROLLBAR ), VNP( FL_HOR_SCROLLBAR ), VNP( FL_VERT_THIN_SCROLLBAR ), VNP( FL_HOR_THIN_SCROLLBAR ), VNP( FL_VERT_NICE_SCROLLBAR ), VNP( FL_HOR_NICE_SCROLLBAR ), VNP( FL_VERT_BASIC_SCROLLBAR ), VNP( FL_HOR_BASIC_SCROLLBAR ), VNP( -1 ) } }, { VNP( FL_THUMBWHEEL ), { VNP( FL_VERT_THUMBWHEEL ), VNP( FL_HOR_THUMBWHEEL ), VNP( -1 ) } }, { VNP( FL_INPUT ), { VNP( FL_NORMAL_INPUT ), VNP( FL_FLOAT_INPUT ), VNP( FL_INT_INPUT ), VNP( FL_HIDDEN_INPUT ), VNP( FL_MULTILINE_INPUT ), VNP( FL_SECRET_INPUT ), VNP( -1 ), } }, { VNP( FL_BROWSER ), { VNP( FL_NORMAL_BROWSER ), VNP( FL_SELECT_BROWSER ), VNP( FL_HOLD_BROWSER ), VNP( FL_MULTI_BROWSER ), VNP( FL_DESELECTABLE_HOLD_BROWSER ), VNP( -1 ), } }, { VNP( FL_TIMER ), { VNP( FL_NORMAL_TIMER ), VNP( FL_VALUE_TIMER ), VNP( FL_HIDDEN_TIMER ), VNP( -1 ) } }, { VNP( FL_DIAL ), { VNP( FL_NORMAL_DIAL ), VNP( FL_LINE_DIAL ), VNP( FL_FILL_DIAL ), VNP( -1 ) } }, { VNP( FL_POSITIONER ), { VNP( FL_NORMAL_POSITIONER ), VNP( FL_OVERLAY_POSITIONER ), VNP( -1 ) } }, { VNP( FL_XYPLOT ), { VNP( FL_NORMAL_XYPLOT ), VNP( FL_SQUARE_XYPLOT ), VNP( FL_CIRCLE_XYPLOT ), VNP( FL_FILL_XYPLOT ), VNP( FL_POINTS_XYPLOT ), VNP( FL_DASHED_XYPLOT ), VNP( FL_ACTIVE_XYPLOT ), VNP( -1 ) } }, { VNP( FL_FRAME ), { VNP( FL_UP_FRAME ), VNP( FL_DOWN_FRAME ), VNP( FL_ENGRAVED_FRAME ), VNP( FL_EMBOSSED_FRAME ), VNP( FL_BORDER_FRAME ), VNP( -1 ) } }, { VNP( FL_LABELFRAME ), { VNP( FL_UP_FRAME ), VNP( FL_DOWN_FRAME ), VNP( FL_ENGRAVED_FRAME ), VNP( FL_EMBOSSED_FRAME ), VNP( FL_BORDER_FRAME ), VNP( -1 ) } }, { VNP( FL_CLOCK ), { VNP( FL_ANALOG_CLOCK ), VNP( FL_DIGITAL_CLOCK ), VNP( -1 ) } }, { VNP( FL_FREE ), { VNP( FL_NORMAL_FREE ), VNP( FL_INACTIVE_FREE ), VNP( FL_INPUT_FREE ), VNP( FL_CONTINUOUS_FREE ), VNP( FL_ALL_FREE ), VNP( -1 ) } }, { VNP( FL_TIMER ), { VNP( FL_NORMAL_TIMER ), VNP( FL_VALUE_TIMER ), VNP( FL_HIDDEN_TIMER ), VNP( -1 ) } }, { VNP( FL_SPINNER ), { VNP( FL_INT_SPINNER ), VNP( FL_FLOAT_SPINNER ), VNP( -1 ) } }, /* special: groups */ { VNP( FL_BEGIN_GROUP ), { VNP( 0 ), VNP( -1 ) } }, { VNP( 10000 ), { VNP( 0 ), VNP( -1 ) } }, { VNP( FL_END_GROUP ), { VNP( 0 ), VNP( -1 ) } }, { VNP( 20000 ), { VNP( 0 ), VNP( -1 ) } }, /* sentinel */ { VNP( -1 ), { VNP( -1 ) } } }; /*************************************** ***************************************/ static AllObj * find_valp( int val ) { AllObj *ob = allobj; for ( ; ob->classobj.val >= 0; ob++ ) if ( ob->classobj.val == val ) return ob; return NULL; } /*************************************** ***************************************/ static AllObj * find_namep( const char * name ) { AllObj *ob = allobj; for ( ; ob->classobj.val >= 0; ob++ ) if ( strcmp( name, ob->classobj.name ) == 0 || strcmp( name, ob->classobj.name + 3 ) == 0 ) return ob; fprintf( stderr, "%s definition not found\n", name ); return NULL; } /*************************************** ***************************************/ int find_class_val( const char * name ) { AllObj *ob = find_namep (name ); return ob ? ob->classobj.val : atoi( name ); } /*************************************** ***************************************/ const char * find_class_name( int val ) { AllObj *ob = find_valp( val ); return ob ? ob->classobj.name : "??"; } /*************************************** ***************************************/ int find_type_val( int objclass, const char * name ) { AllObj *ob = find_valp( objclass ); VN_Pair *vnp; if ( ! ob ) return 0; for ( vnp = ob->objtype; vnp->val >= 0; vnp++ ) if ( strcmp( name, vnp->name ) == 0 || strcmp( name, vnp->name + 3 ) == 0 ) return vnp->val; if ( ! isdigit( ( int ) *name ) ) fprintf( stderr, "class %s type %s not found\n", ob->classobj.name, name ); return atoi( name ); } static VN_Pair vn_unit[ ] = { VN(FL_COORD_PIXEL), {FL_COORD_PIXEL, "pixel"}, VN(FL_COORD_MM), {FL_COORD_MM, "mm"}, VN(FL_COORD_POINT), {FL_COORD_POINT, "point"}, VN(FL_COORD_centiPOINT), {FL_COORD_centiPOINT, "cp"}, {FL_COORD_centiMM, "cmm"}, {FL_COORD_centiPOINT, "cpoint"}, VN(-1) }; /*************************************** ***************************************/ int unit_val( const char * name ) { return get_vn_val( vn_unit, name ); } /*************************************** ***************************************/ const char * unit_name( int u ) { return get_vn_name( vn_unit, u ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fd2ps/sys.c0000644000175000017500000000425312252147006011760 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file sys.c */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "fd2ps.h" #include #include #include /*************************************** ***************************************/ const char * ascii_date( void ) { time_t t = time( 0 ); static char buf[ 64 ]; strcpy( buf, asctime( localtime( &t ) ) ); buf[ strlen( buf ) - 1 ] = '\0'; return buf; } #include #include #include #include /*************************************** ***************************************/ const char * whoami( void ) { #ifndef __VMS struct passwd *passwd = getpwuid( getuid( ) ); const char *name = passwd ? passwd->pw_name : "Unknown"; endpwent( ); #else const char *name = getenv( "USER" ); #endif return name ? name : "unknown"; } /*************************************** ***************************************/ char * fl_strdup( const char * s ) { char *p = malloc( strlen( s ) + 1 ); return p ? strcpy( p, s ) : NULL; } /*************************************** ***************************************/ #ifndef HAVE_STRCASECMP int strcasecmp( const char * s1, const char * s2 ) { int c1, c2; while ( *s1 && *s2 ) { c1 = tolower( *s1 ); c2 = tolower( *s2 ); if ( c1 != c2 ) return c1 - c2; s1++; s2++; } return *s1 - *s2; } #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fd2ps/global.h0000644000175000017500000000147611665175512012425 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifndef FD2PS_GLOBAL #define FD2PS_GLOBAL PSInfo psinfo, *flps; #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fd2ps/psobj.c0000664000175000017500000020017012353623325012262 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file psobj.c * * This file is part of XForms package * Copyright (c) 1997-2000 by T.C. Zhao * All rights reserved. * * Draw FL object in ps */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "fd2ps.h" #include "flinternal.h" /* for UPBOX8 etc */ #include #include extern int fl_convert_shortcut(const char *str, long sc[]); extern int fl_get_underline_pos(const char *label, const char *sc); #ifndef M_PI #define M_PI 3.14159265 #endif static void ps_draw_object(FL_OBJECT * ob); /*************************************** * stuff that only need to be output once ***************************************/ static void emit_prolog( void ) { static int emitted; if ( emitted ) return; ps_verbatim( "%%!PS-Adobe-3.0%s\n", psinfo.eps ? " EPSF-2.0" : "" ); ps_verbatim( "%%%%Creator: %s\n", get_version( ) ); ps_verbatim( "%%%%CreateDate: %s\n", ascii_date( ) ); ps_verbatim( "%%%%For: %s\n", whoami( ) ); ps_verbatim( "%%%%Pages: %d\n", psinfo.pages ); ps_verbatim( "%%%%Orientation: %s\n", psinfo.landscape == 1 ? "Landscape" : "Portrait" ); emitted = 1; } /*************************************** * emit some basic macros ***************************************/ static void emit_basic_defs( float xscale, float yscale ) { static int emitted; if ( emitted ) return; emitted = 1; ps_output( "/BD {bind def} def\n" ); ps_output( "/M {moveto} bind def /LT {lineto} BD\n" ); ps_output( "/L {M LT} bind def /C {closepath} BD\n" ); ps_output( "/LW {setlinewidth} BD\n" ); ps_output( "/S {stroke} BD /F {fill} BD\n" ); ps_output( "/G {setgray} bind def /RGB {setrgbcolor} BD\n" ); /* x y x y N */ ps_output( "/P {3 1 roll M 2 exch 1 exch {pop LT} for C} BD\n" ); ps_output( "/lines {3 1 roll M 2 exch 1 exch {pop LT} for S} BD\n" ); ps_output( "/SX %.2g def /SY %.2g def\n", xscale, yscale ); #if 0 if ( psinfo.epsf_import && ! psinfo.xpmtops_direct ) emit_epsf_import_command( ); #endif ps_text_init( ); } /*************************************** * Since some of the internal coordinates defaults, such * as border width and line width, are expressed in pixels, * it is more convenient to work in pixel coordinates. * For point, mm units, we convert everything to a pseudo pixel * unit. * * psinfo.scale turns object coordinates into pseudo pixel unit * and xscale yscale turns pseudo pixel into point ***************************************/ void get_scale_unit( int unit, float * xscale, float * yscale ) { if ( unit == FL_COORD_PIXEL ) { *xscale = 72.0 / psinfo.xdpi; *yscale = 72.0 / psinfo.ydpi; psinfo.xscale = psinfo.yscale = 1.0; } else if ( unit == FL_COORD_centiPOINT ) { *xscale = *yscale = 0.8; /* pixel size in point */ psinfo.xscale = psinfo.yscale = 0.01 / *xscale; } else if ( unit == FL_COORD_POINT ) { *xscale = *yscale = 0.8; /* pixel size in point */ psinfo.xscale = psinfo.yscale = 1 / *xscale; } else if ( unit == FL_COORD_centiMM ) { *xscale = *yscale = 0.8; /* pixel size in point */ psinfo.xscale = psinfo.yscale = 0.01 * 72 / 25.4 / *xscale; } else fprintf( stderr, "Unknown coordinate unit\n" ); } #define P2CM( n ) ( n / 72.0 * 2.45 ) /*************************************** ***************************************/ static void auto_orientation( float pw, float ph, float obw, float obh ) { int plm, pbm, llm, lbm; plm = ( pw - obw ) / 2; pbm = ( ph - obh ) / 2; llm = ( pw - obh ) / 2; lbm = ( ph - obw ) / 2; /* Switch to landscape only if portrait won't fit */ flps->landscape = FL_abs( lbm - llm ) < FL_abs( pbm - plm ) && ( pbm < 0 || plm < 0 ); } /*************************************** ***************************************/ static void ps_bgn_form( int w, int h, const char * label ) { float pw = psinfo.paper_w * 72, ph = psinfo.paper_h * 72; float fw, fh; float xscale, yscale; float bxi, byi, bxf, byf; /* bounding box */ float margin = 0.4 * 72; /* about 1cm */ if ( ! label ) label = "annonymous"; get_scale_unit( psinfo.unit, &xscale, &yscale ); /* Figure out bounding box. Note bounding box is always expressed in points */ fw = w * psinfo.xscale * xscale; fh = h * psinfo.yscale * yscale; if ( psinfo.landscape == -1 ) auto_orientation( pw - 2.0 * margin, ph - 2.0 * margin, fw, fh ); emit_prolog( ); if ( psinfo.landscape ) { bxi = ( pw - fh ) * 0.5; byi = ( ph - fw ) * 0.5; bxf = bxi + fh + 0.5; byf = byi + fw + 0.5; } else { bxi = ( pw - fw ) * 0.5; byi = ( ph - fh ) * 0.5; bxf = bxi + fw + 0.5; byf = byi + fh + 0.5; } if ( bxi < -15.0 ) fprintf( stderr, "Warning: %s %.2f cm too wide\n", label, -P2CM( bxi ) ); if ( bxi < -15.0 ) fprintf( stderr, "Warning: %s %.2f cm too long\n", label, -P2CM( byi ) ); if ( psinfo.page == 1 ) { ps_verbatim( "%%%%BoundingBox: %d %d %d %d\n", ( int ) bxi, ( int ) byi, ( int ) bxf, ( int ) byf ); ps_verbatim( "%%%%EndComments\n" ); ps_verbatim( "%% paper name/size: %s (%gx%gin) ", psinfo.paper_name ? psinfo.paper_name : "unknown", psinfo.paper_w, psinfo.paper_h ); ps_verbatim( " BW=%d DPI=%.1f \n", psinfo.bw, psinfo.xdpi ); } emit_basic_defs( xscale, yscale ); ps_verbatim( "\n%%%%Page: %s %d\n", ( label && *label ) ? label : "anonymous", psinfo.page ); ps_verbatim( "%%%%PageBoundingBox: %d %d %d %d\n", ( int ) bxi, ( int ) byi, ( int ) bxf, ( int ) byf ); ps_verbatim( "\ngsave %%{\n" ); ps_output( "%.1f %.1f translate ", bxi, byi ); if ( psinfo.landscape ) ps_output( "%d 0 translate 90 rotate\n", ( int ) fh ); /* Thinner lines look better */ ps_output( "%.2f %.2f LW\n", 0.6, 0.6 ); ps_output( "SX SY scale " ); } /*************************************** * Since ob->{x,y,w,h} are int special care needs to be taken * to avoid numerical inaccuracies ***************************************/ static void scale_object( FL_OBJECT * ob ) { int xi, yi, xf, yf; float delta = 0.4; if ( psinfo.xscale == 1.0 && psinfo.yscale == 1.0 ) return; xi = ob->x * psinfo.xscale + delta; xf = ( ob->x + ob->w ) * psinfo.xscale + delta; ob->w = xf - xi; ob->x = xi; yi = ob->y * psinfo.yscale + delta; yf = ( ob->y + ob->h ) * psinfo.yscale + delta; ob->h = yf - yi; ob->y = yi; } /*************************************** ***************************************/ static void ps_end_form( void ) { ps_verbatim( "grestore %% }\n%s", psinfo.eps ? "" : "showpage\n\n" ); ps_invalidate_color_cache( ); ps_invalidate_font_cache( ); } #include #define ALT_CHAR '#' #define CNTL_CHAR '^' #define FKEY_CHAR '&' /*************************************** ***************************************/ int fl_convert_shortcut(const char * str, long * sc ) { int i, j, offset, key; /* str might be obj->shortcut */ i = j = offset = 0; while ( str[ i ] != '\0' ) { if ( str[ i ] == ALT_CHAR ) offset = FL_ALT_MASK; else if ( str[ i ] == CNTL_CHAR ) { i++; if ( str[ i ] >= 'A' && str[ i ] <= 'Z' ) sc[ j++ ] = str[ i ] - 'A' + 1 + offset; else if ( str[ i ] >= 'a' && str[ i ] <= 'z' ) sc[ j++ ] = str[ i ] - 'a' + 1 + offset; else if ( str[ i ] == '[' ) sc[ j++ ] = 27 + offset; else sc[ j++ ] = str[ i ] + offset; offset = 0; } else if ( str[ i ] == FKEY_CHAR ) /* special characters */ { i++; if ( str[ i ] == FKEY_CHAR ) sc[ j++ ] = FKEY_CHAR + offset; else if ( str[ i ] == 'A' ) sc[ j++ ] = offset + XK_Up; else if ( str[ i ] == 'B' ) sc[ j++ ] = offset + XK_Down; else if ( str[ i ] == 'C' ) sc[ j++ ] = offset + XK_Right; else if ( str[ i ] == 'D' ) sc[ j++ ] = offset + XK_Left; else if ( isdigit( ( unsigned char ) str[ i ] ) && ( key = atoi( str + i ) ) < 35 ) { i += key >= 10; sc[ j++ ] = offset + XK_F1 + key - 1; } offset = 0; } else { sc[ j++ ] = str[ i ] + offset; offset = 0; } i++; } sc[ j ] = 0; return j; } static void ps_draw_object_label( FL_OBJECT * ob ) { int align = fl_to_outside_lalign( ob->align ); ( align != ob->align ? ps_draw_text : ps_draw_text_beside ) ( align, ob->x, ob->y, ob->w, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); } /*************************************** ***************************************/ static void ps_draw_object_label_beside( FL_OBJECT * ob ) { ps_draw_text_beside( ob->align, ob->x, ob->y, ob->w, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); } /*************************************** ***************************************/ int fl_get_underline_pos( const char * label, const char * sc ) { int c; const char *p; /* Find the first non-special char in shortcut str */ for ( c = 0, p = sc; ! c && *p; p++ ) { if ( isalnum( ( unsigned char ) *p ) ) { if ( p == sc ) c = *p; else if ( *( p - 1 ) != FKEY_CHAR && ! isdigit( ( unsigned char ) *( p - 1 ) ) ) c = *p; } } if ( ! c ) return -1; /* Find where the matches occur */ if ( c == sc[ 0 ] ) p = strchr( label, c ); else if ( ! ( p = strchr( label, c ) ) ) p = strchr( label, islower( c ) ? toupper( c ) : tolower( c ) ); if ( ! p ) return -1; return ( p - label ) + 1; } /*************************************** ***************************************/ void flps_set_object_shortcut( FL_OBJECT * obj, const char * sstr, int showit ) { long sc[ 16 ]; int scsize, n; if ( obj == NULL ) { fprintf( stderr, "fl_set_object_shortcut:Object is NULL\n" ); return; } if ( ! sstr || ! *sstr ) return; n = fl_convert_shortcut( sstr, sc ); scsize = ( n + 1 ) * sizeof *obj->shortcut; obj->shortcut = realloc( obj->shortcut, scsize ); memcpy( obj->shortcut, sc, scsize ); if ( ! showit || ! obj->label || ! *obj->label || *obj->label == '@' ) return; if ( ( n = fl_get_underline_pos( obj->label, sstr ) ) > 0 && ! strchr( obj->label, *ul_magic_char ) ) { char *q = obj->label; obj->label = malloc( strlen( q ) + 2 ); strncpy( obj->label, q, n ); obj->label[ n ] = *ul_magic_char; strcpy( obj->label + n + 1, q + n ); free( q ); } } #define ISUPBOX FL_IS_UPBOX #define DOWNBOX FL_TO_DOWNBOX /*************************************** ***************************************/ static void flps_draw_button( FL_OBJECT * ob ) { FL_COLOR col = ( ( SPEC * ) ob->spec )->int_val ? ob->col2 : ob->col1; FL_Coord dh, dw, ww, absbw = FL_abs( ob->bw ); float off2 = 0.0; if ( ob->type == FL_HIDDEN_BUTTON ) return; if ( ISUPBOX( ob->boxtype ) && ( ( SPEC * ) ob->spec )->int_val != 0 ) ps_draw_box( DOWNBOX( ob->boxtype ), ob->x, ob->y, ob->w, ob->h, col, ob->bw ); else ps_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, col, ob->bw ); dh = 0.6 * ob->h; dw = FL_min( 0.6 * ob->w, dh ); ww = 0.75 * ob->h; if ( ww < dw + FL_abs( ob->bw ) + 1 + ( ob->bw > 0 ) ) ww = dw + FL_abs( ob->bw ) + 1 + ( ob->bw > 0 ); if ( ob->type == FL_RETURN_BUTTON ) { ps_draw_text( 0, ob->x + ob->w - ww, ob->y + 0.2 * ob->h, dw, dh, ob->lcol, 0, 0, "@returnarrow" ); off2 = dw - 2; } if ( ob->type == FL_MENU_BUTTON && ob->boxtype == FL_UP_BOX ) { dh = FL_max( 6 + ( ob->bw > 0 ), ob->h * 0.1 ); dw = FL_max( 0.11 * ob->w, 13 ); ps_draw_box( FL_UP_BOX, ob->x + ob->w - dw - absbw - 2, ob->y + ( ob->h - dh ) / 2, dw, dh, ob->col1, -2 ); off2 = dw - 1; } ob->w -= off2; ps_draw_object_label( ob ); ob->w += off2; } /*************************************** ***************************************/ static void flps_draw_labelbutton( FL_OBJECT * ob ) { FL_COLOR save_col = ob->lcol; FL_Coord dh, dw, ww, absbw = FL_abs(ob->bw); ob->lcol = ( ( SPEC * ) ob->spec )->int_val ? ob->col2 : ob->lcol; dh = 0.6 * ob->h; dw = FL_min( 0.6 * ob->w, dh ); ww = 0.75 * ob->h; if ( ww < dw + absbw + 1 + ( ob->bw > 0 ) ) ww = dw + absbw + 1 + ( ob->bw > 0 ); if ( ob->type == FL_RETURN_BUTTON ) ps_draw_text( 0, ob->x + ob->w - ww, ob->y + 0.2 * ob->h, dw, dh, ob->lcol, 0, 0, "@returnarrow" ); ps_draw_object_label( ob ); ob->lcol = save_col; } #define NEAR 600.0f #define GRID 0.18 /*************************************** ***************************************/ static void flps_draw_thumbwheel( FL_OBJECT * ob ) { float absbw = FL_abs( ob->bw ), h2 = ob->h * 0.5, w2 = ob->w * 0.5; float x0 = ob->x + ob->w / 2, yo = ob->y + ob->h / 2; float x, y, w, h, dx, dy; double junk; float theta; float arc = M_PI * 0.49, delta = GRID; float offset = 0.0; FL_COLOR c1, c2; ps_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); x = ob->x + absbw; y = ob->y + absbw; w = ob->w - 2 * absbw; h = ob->h - 2 * absbw; if ( ob->type == FL_VERT_THUMBWHEEL ) { float extra = h2 * ( NEAR / ( NEAR - h2 ) - 0.96 ); /* (fake) depth-cue */ ps_rectf( x, y + 1, w, h - 1, FL_DARKER_COL1 ); ps_rectf( x, yo - ob->h / 4.0, w, ob->h / 2.0, FL_COL1 ); ps_rectf( x, yo - ob->h / 10.0, w, ob->h / 5.0, FL_LIGHTER_COL1 ); for ( theta = arc + modf( offset / delta, &junk ); theta > - arc; theta -= delta ) { dy = ( h2 + extra ) * sin( theta ); dx = ob->h - ( h2 + extra ) * cos( theta ); y = yo + FL_nint( dy * NEAR / ( NEAR + dx ) ); if ( y > ob->y + 3 && y < ob->y + ob->h - 3 ) { int d = 1; if ( y < yo + h2 / 4 && y > yo - h2 / 4 ) { c1 = FL_LEFT_BCOL; c2 = FL_RIGHT_BCOL; } else if ( y < ob->y + h2 / 5 || y > yo + h2 - h2 / 5 ) { c1 = FL_LIGHTER_COL1; c2 = FL_BOTTOM_BCOL; d = 0; } else { c1 = FL_MCOL; c2 = FL_BOTTOM_BCOL; } ps_line( x + 1, y - 1, x + w - 2, y - 1, c2 ); ps_line( x + 1, y + d, x + w - 2, y + d, c1 ); } } /* bottom */ y = ob->y + absbw; ps_rectf( x - 1, ob->y + ob->h - 6, w, 3, FL_RIGHT_BCOL ); /* top */ ps_rectf( x - 1, y, w, 3, FL_RIGHT_BCOL ); /* left */ ps_line( x - 1, y, x - 1, y + h - 1, FL_BLACK ); /* right */ ps_rectf( x + w - 1, y, 2, h, FL_RIGHT_BCOL ); /* highlight */ ps_line( x + 1, yo - h2 + 10, x + 1, yo + h2 - 10, FL_LEFT_BCOL ); } else { float extra = w2 * ( NEAR / ( NEAR - w2 ) - 0.96 ); ps_rectf( x, y, w, h, FL_DARKER_COL1 ); ps_rectf( x0 - w / 4, y, w / 2, h, FL_COL1 ); dx = ob->w / 10; ps_rectf( x0 - dx, y, 2 * dx, h, FL_LIGHTER_COL1 ); for ( theta = arc + modf(offset / delta, &junk ); theta > - arc; theta -= delta) { dx = ( w2 + extra ) * sin( theta ); dy = ob->w - ( w2 + extra ) * cos( theta ); x = x0 + FL_nint( dx * NEAR / ( NEAR + dy ) ); if ( x > ob->x + absbw + 1 && x < x0 + w2 - absbw - 2 ) { int d = 1; if ( x < x0 + w2 / 4 && x > x0 - w2 / 4 ) { c1 = FL_LEFT_BCOL; c2 = FL_RIGHT_BCOL; } else if ( x < ob->x + ( w2 / 4 ) || x > x0 + w2 - ( w2 / 4 ) ) { c1 = FL_LIGHTER_COL1; c2 = FL_BOTTOM_BCOL; } else { c1 = FL_MCOL; c2 = FL_BOTTOM_BCOL; } ps_line( x - 1, y + 2, x - 1, yo + h2 - 2 * absbw, c1 ); ps_line( x + d, y + 2, x + d, yo + h2 - 2 * absbw, c2 ); } x = ob->x + absbw; w = ob->w - 2 * absbw; /* top shadow */ ps_line( x, y - 1, x + w - 2, y - 1, FL_BLACK ); ps_line( x, y, x + w - 4, y, FL_BLACK ); /* bottom shadow */ ps_line( x + 5, y + h - 2, x + w - 4, y + h - 2, FL_BLACK ); ps_line( x, y + h - 1, x + w - 2, y + h - 1, FL_BLACK ); ps_line( x, y + h, x + w - 2, y + h, FL_BLACK ); /* left & right */ ps_rectf( x, y - 1, 3, h + 1, FL_RIGHT_BCOL ); ps_rectf( x + w - 4, y - 1, 3, h + 1, FL_RIGHT_BCOL ); /* hight light */ ps_line( x + 4, y + h - 2, x + w - 4, y + h - 2, FL_DARKER_COL1 ); ps_line( x0 - w2 + 11, y + h - 2, x0 + w2 - 11, y + h - 2, FL_TOP_BCOL ); } } ps_draw_object_label( ob ); } /*************************************** ***************************************/ static void flps_draw_lightbutton( FL_OBJECT * ob ) { SPEC *sp = ob->spec; float ww, hh, xx, yy, libox; float absbw = FL_abs( ob->bw ), bw2; long lightcol = sp->int_val > 0 ? ob->col2 : ob->col1; ps_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); if ( ob->boxtype == FL_NO_BOX || ob->boxtype == FL_FLAT_BOX ) absbw = FL_BOUND_WIDTH; if ( absbw < 3 ) absbw = 3; /* Calculate and draw the light */ hh = ob->h - 3 * absbw - 1; if ( hh < FL_LIGHTBUTTON_MINSIZE ) hh = FL_LIGHTBUTTON_MINSIZE; ww = hh / 2; if ( ww < FL_LIGHTBUTTON_MINSIZE ) ww = FL_LIGHTBUTTON_MINSIZE; if ( ww > ob->w / 6 ) ww = ob->w / 6; xx = ob->x + 1.5 * absbw + 1.0; yy = ob->y + ob->h / 2 - hh / 2; absbw = FL_abs( ob->bw ); /* Adjustment for non-rectangular boxes */ if ( ob->boxtype == FL_ROUNDED3D_UPBOX || ob->boxtype == FL_ROUNDED3D_DOWNBOX ) { hh -= 2; yy += 1; xx += 3 + ob->w * 0.01; ww -= 1; } else if ( ob->boxtype == FL_RSHADOW_BOX ) { hh -= 1; xx += 1; } switch ( ob->boxtype ) { case FL_UP_BOX: case FL_ROUNDED3D_UPBOX: libox = FL_DOWN_BOX; break; case FL_DOWN_BOX: case FL_ROUNDED3D_DOWNBOX: libox = FL_DOWN_BOX; break; case FL_FRAME_BOX: case FL_EMBOSSED_BOX: case FL_ROUNDED_BOX: libox = ob->boxtype; break; case FL_RFLAT_BOX: case FL_RSHADOW_BOX: libox = FL_ROUNDED_BOX; break; default: libox = FL_BORDER_BOX; break; } bw2 = absbw > 2 ? absbw - 1 : absbw; ps_draw_box( libox, xx, yy, ww, hh, lightcol, bw2 ); /* Draw the label */ if ( fl_is_center_lalign( ob->align ) ) ps_draw_text( FL_ALIGN_LEFT, xx + ww, ob->y, 0, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); else ps_draw_object_label( ob ); ww = 0.75 * ob->h; if ( ww < absbw + 1 ) ww = absbw + 1; if ( ob->type == FL_RETURN_BUTTON ) ps_draw_text( 0, ob->x + ob->w - ww, ob->y + 0.2 * ob->h, 0.6 * ob->h, 0.6 * ob->h, ob->lcol, 0, 0, "@returnarrow" ); } /*************************************** ***************************************/ static void flps_draw_roundbutton( FL_OBJECT * ob ) { float xx, yy, rr; float bw = FL_abs( ob->bw ); ps_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, FL_ROUNDBUTTON_TOPCOL, ob->bw ); rr = 0.3 * FL_min( ob->w, ob->h ); rr = rr + 0.5; xx = ob->x + 1.5 * ( bw < 2 ? 2 : bw ) + rr + 1; yy = ob->y + ob->h / 2; ps_circ( 1, xx, yy, rr, ob->col1 ); ps_circ( 0, xx, yy, rr, FL_BLACK ); ps_circ( 1, xx, yy, rr, ob->col2 ); ps_circ( 0, xx, yy, rr, FL_BLACK ); if ( fl_is_center_lalign( ob->align ) ) ps_draw_text( FL_ALIGN_LEFT, xx + rr + 1, ob->y, 0, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); else ps_draw_object_label_beside( ob ); if ( ob->type == FL_RETURN_BUTTON ) ps_draw_text( 0, ob->x + ob->w - 0.8 * ob->h, ob->y + 0.2 * ob->h, 0.6 * ob->h, 0.6 * ob->h, ob->lcol, 0, 0, "@returnarrow" ); } static void flps_draw_scrollbutton( FL_OBJECT * ob ) { char *label = ob->label; int x = ob->x, y = ob->y, w = ob->w, h = ob->h; int absbw = FL_abs( ob->bw ); int extra = absbw; int btype = FL_NO_BOX; SPEC *sp = ob->spec; ps_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); if ( *label == '#' ) { w = h = FL_min( ob->w, ob->h ); x += ( ob->w - w ) / 2; y += (ob->h - h) / 2; label++; } if ( ob->boxtype != FL_NO_BOX && ob->boxtype != FL_FLAT_BOX ) { extra += 1 + 0.051 * FL_min( w, h ); absbw = 1; } if ( *label == '8' ) btype = sp->int_val ? FLI_TRIANGLE_DOWNBOX8 : FLI_TRIANGLE_UPBOX8; else if ( *label == '2' ) btype = sp->int_val ? FLI_TRIANGLE_DOWNBOX2 : FLI_TRIANGLE_UPBOX2; else if ( *label == '6' ) btype = sp->int_val ? FLI_TRIANGLE_DOWNBOX6 : FLI_TRIANGLE_UPBOX6; else if ( *label == '4' ) btype = sp->int_val ? FLI_TRIANGLE_DOWNBOX4 : FLI_TRIANGLE_UPBOX4; ps_draw_tbox( btype, x + extra, y + extra, w - 2 * extra, h - 2 * extra, ob->col2, absbw ); } /*************************************** ***************************************/ static void flps_draw_round3dbutton( FL_OBJECT * ob ) { float xx, yy, rr, cr; float bw = FL_abs( psinfo.bw ); ALLSPEC *sp = ob->spec; ps_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, FL_ROUND3DBUTTON_TOPCOL, ob->bw ); rr = 0.3 * FL_min( ob->h, ob->w ); xx = ob->x + 1.5 * ( bw < 2 ? 2 : bw ) + rr + 1; yy = ob->y + 0.5 * ob->h; if ( rr < bw * 0.5 ) rr = bw / 2 + 1; ps_set_linewidth( bw, bw ); cr = bw / 2; ps_arc( 0, xx, yy, rr - cr, 450, 2250, FL_BOTTOM_BCOL ); ps_arc( 0, xx, yy, rr - cr, 0, 450, FL_TOP_BCOL ); ps_arc( 0, xx, yy, rr - cr, 2250, 3600, FL_TOP_BCOL ); ps_reset_linewidth( ); if ( sp->int_val ) { if ( ( cr = 0.8 * rr - 1.0 - bw * 0.5 ) < 1 ) cr = 1; ps_circ( 1, xx, yy, cr, ob->col2 ); } else ps_circ( 1, xx, yy, rr - bw, ob->col1 ); if ( fl_is_center_lalign( ob->align ) ) ps_draw_text( FL_ALIGN_LEFT, xx + rr + 1, ob->y, 0, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); else ps_draw_object_label_beside( ob ); if ( ob->type == FL_RETURN_BUTTON ) ps_draw_text( 0, ob->x + ob->w - 0.8 * ob->h, ob->y + 0.2 * ob->h, 0.6 * ob->h, 0.6 * ob->h, ob->lcol, 0, 0, "@returnarrow" ); } /*************************************** ***************************************/ static void flps_draw_checkbutton( FL_OBJECT * ob ) { float xx, yy, ww, hh, bw = FL_abs( ob->bw ); SPEC *sp = ob->spec; ps_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); ww = hh = 0.6 * FL_min( ob->w, ob->h ); xx = ob->x + 1.5 * ( bw < 2 ? 2 : bw) + 1.5; yy = ob->y + ( ob->h - hh ) / 2; if ( sp->int_val != 0.0 ) ps_draw_checkbox( FL_DOWN_BOX, xx, yy, ww, hh, ob->col2, bw ); else ps_draw_checkbox( FL_UP_BOX, xx, yy, ww, hh, ob->col1, bw ); if ( fl_is_center_lalign( ob->align ) ) ps_draw_text( FL_ALIGN_LEFT, xx + ww + 1, ob->y, 0, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); else ps_draw_object_label_beside( ob ); if ( ob->type == FL_RETURN_BUTTON ) ps_draw_text( 0, ob->x + ob->w - 0.8 * ob->h, ob->y + 0.2 * ob->h, 0.6 * ob->h, 0.6 * ob->h, ob->lcol, 0, 0, "@returnarrow" ); } /*************************************** ***************************************/ static void flps_draw_pixmap( FL_OBJECT * ob ) { SPEC *sp = ob->spec; if ( FL_IS_UPBOX( ob->boxtype ) && sp->int_val != 0 ) ps_draw_box( FL_TO_DOWNBOX(ob->boxtype), ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); else ps_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); if ( sp->file ) { if ( ob->objclass == FL_BITMAP || ob->objclass == FL_BITMAPBUTTON ) draw_bitmap( sp->file, ob->x, ob->y, ob->w, ob->h, ob->lcol, ob->col1 ); else draw_xpm( ob ); } ps_draw_object_label( ob ); } /* * Dial support */ static float xori, yori; #define ROTx( x, y, a ) \ ( xori + ( ( x ) - xori ) * cos( a ) + ( ( y ) - yori ) * sin( a ) ) #define ROTy( x, y, a ) \ ( yori + ( ( x ) - xori ) * sin( a ) + ( ( y ) - yori ) * cos( a ) ) /*************************************** ***************************************/ static void rotate_it( Point * xp, float x, float y, float a ) { xp->x = ROTx( x, y, a ); xp->y = ROTy( x, y, a ); } /*************************************** ***************************************/ static void flps_draw_dial( FL_OBJECT * ob ) { float x, y, w, h, radius; float dangle; SPEC *sp = ob->spec; Point xp[ 6 ]; int boxtype, iradius; /* Get mapping */ sp->ax = ( sp->max - sp->min ) / ( sp->thetaf - sp->thetai ); sp->bx = sp->max - sp->ax * sp->thetaf; dangle = ( sp->val - sp->bx ) / sp->ax; if ( sp->direction == FL_DIAL_CW ) dangle = sp->origin - dangle; else dangle += sp->origin; if ( ( dangle = fmod( dangle, 360.0 ) ) < 0.0 ) dangle += 360.0; w = ob->w - 3; h = ob->h - 3; x = xori = ob->x + ob->w / 2; y = yori = ob->y + ob->h / 2; if ( FL_IS_UPBOX( ob->boxtype ) ) boxtype = FL_OVAL3D_UPBOX; else if ( FL_IS_DOWNBOX( ob->boxtype ) ) boxtype = FL_OVAL3D_DOWNBOX; else if ( ob->boxtype == FL_FRAME_BOX ) boxtype = FL_OVAL3D_FRAMEBOX; else if ( ob->boxtype == FL_EMBOSSED_BOX ) boxtype = FL_OVAL3D_EMBOSSEDBOX; else boxtype = FL_OVAL_BOX; /* The dial itself */ radius = 0.5 * FL_min(w, h); iradius = radius - 1; ps_draw_box( boxtype, x - radius, y - radius, 2 * radius, 2 * radius, ob->col1, ob->bw ); dangle *= M_PI / 180.0; /* The "hand" */ if ( ob->type == FL_NORMAL_DIAL ) { float r; #if 0 float xc = x + iradius - r - 2, yc = y; rotate_it( xp, xc, yc, dangle ); if ( ( r = = FL_nint( 0.1 * radius ) ) < 1 ) r = 1; ps_circ( 1, xp[ 0 ].x, xp[ 0 ].y, r, ob->col2 ); ps_circ( 0, xp[ 0 ].x, xp[ 0 ].y, r, FL_BLACK ); #else r = 0.5 * iradius; r = FL_min( 15, r ); rotate_it( xp, x + iradius - 1, y - 1.5, dangle ); rotate_it( xp + 1, x + iradius - 1 - r, y - 1.5, dangle ); rotate_it( xp + 2, x + iradius - 1 - r, y + 1.5, dangle ); rotate_it( xp + 3, x + iradius - 1, y + 1.5, dangle ); ps_poly( 1, xp, 4, ob->col2 ); #endif } else if ( ob->type == FL_LINE_DIAL ) { float dx = 0.1 + 0.08 * iradius, dy = 0.1 + 0.08 * iradius; rotate_it( xp, x, y, dangle ); rotate_it( xp + 1, x + dx, y - dy, dangle ); rotate_it( xp + 2, x + iradius - 1.5, y, dangle ); rotate_it( xp + 3, x + dx, y + dy, dangle ); ps_poly( 1, xp, 4, ob->col2 ); ps_poly( 0, xp, 4, FL_BLACK ); } else if ( ob->type == FL_FILL_DIAL ) { float ti, delta; delta = ( sp->val - sp->bx ) / sp->ax; delta = FL_abs( sp->thetai - delta ); iradius -= boxtype != FL_OVAL_BOX; if ( sp->direction == FL_DIAL_CCW ) ti = sp->thetai + sp->origin; else ti = sp->origin - sp->thetai; if ( ( ti = fmod( ti, 360.0 ) ) < 0.0 ) ti += 360.0; /* Have to break the drawing into two parts if cross 0 */ if ( sp->direction == FL_DIAL_CCW ) { if ( delta > 360 - ti ) { ps_pieslice( 1, xori - iradius, yori - iradius, 2 * iradius, 2 * iradius, ti * 10, 3600, ob->col2 ); ps_pieslice( 1, xori - iradius, yori - iradius, 2 * iradius, 2 * iradius, 0, ( delta - 360 + ti ) * 10, ob->col2 ); } else ps_pieslice( 1, xori - iradius, yori - iradius, 2 * iradius, 2 * iradius, ti * 10, ( ti + delta ) * 10, ob->col2 ); } else { if ( delta > ti ) { ps_pieslice( 1, xori - iradius, yori - iradius, 2 * iradius, 2 * iradius, 0, ti * 10, ob->col2 ); ps_pieslice( 1, xori - iradius, yori - iradius, 2 * iradius, 2 * iradius, 3600 - ( delta - ti ) * 10, 3600, ob->col2 ); } else ps_pieslice( 1, xori - iradius, yori - iradius, 2 * iradius, 2 * iradius, ( ti - delta ) * 10, ti * 10, ob->col2); } rotate_it( xp, xori + iradius - 1, yori, dangle ); rotate_it( xp + 1, xori + iradius - 1, yori, ti * M_PI / 180.0 ); ps_line( xori, yori, xp[ 0 ].x, xp[ 0 ].y, FL_BLACK ); ps_line( xori, yori, xp[ 1 ].x, xp[ 1 ].y, FL_BLACK ); if ( boxtype == FL_OVAL_BOX ) ps_circ( 0, x, y, iradius, FL_BLACK ); } else fprintf( stderr, "Unknown/unsupported dial type %d\n", ob->type ); ps_draw_object_label_beside( ob ); } /*************************************** ***************************************/ static void flps_draw_text( FL_OBJECT * ob ) { ps_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); ps_draw_object_label( ob ); } static void flps_draw_box( FL_OBJECT * ob ) { ps_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, psinfo.bw ); ps_draw_object_label_beside( ob ); } /*************************************** ***************************************/ static void flps_draw_choice( FL_OBJECT * ob ) { float off1 = 0, off2 = 0; SPEC *sp = ob->spec; ps_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); if ( ob->type == FL_NORMAL_CHOICE2 ) { int absbw = FL_abs( ob->bw ); int dh = FL_max( 6 + ( ob->bw > 1 ), ob->h * 0.1 ); int dw = FL_max( 0.11 * ob->w, 13 ); int dbh = FL_max( absbw - 1.2, 1 ); int align = fl_to_outside_lalign( sp->align ); ps_draw_box( FL_UP_BOX, ob->x + ob->w - dw - absbw - 2, ob->y + ( ob->h - dh ) / 2, dw, dh, ob->col1, -dbh ); off1 = align == FL_ALIGN_CENTER ? ( dw / 2 ) : ( align == FL_ALIGN_LEFT ? - FL_abs( ob->bw ) : 0 ); off2 = align == FL_ALIGN_RIGHT ? dw + 1 : 0; } ps_draw_object_label_beside( ob ); /* Draw the choice string */ if ( sp->int_val > 0 && sp->lines >= sp->int_val ) { char *str = sp->content[ sp->int_val ]; ps_draw_text( sp->align, ob->x - off1, ob->y, ob->w - off2, ob->h, ob->col2, sp->fontstyle, sp->fontsize, str + ( str && ( *str == '\010' ) ) ); } } static void flps_draw_counter( FL_OBJECT * ob ) { int i, btype[ 5 ]; float xx[ 5 ] = { 0.0, 0.0, 0.0, 0.0, 0.0 }, ww[ 5 ] = { 0.0, 0.0, 0.0, 0.0, 0.0 }; char str[ 30 ]; SPEC *sp = ob->spec; for ( i = 0; i < 5; i++ ) btype[ i ] = ob->boxtype; if ( btype[ 4 ] == FL_UP_BOX ) btype[ 4 ] = FL_DOWN_BOX; /* Compute sizes */ if ( ob->type == FL_NORMAL_COUNTER ) { /* button is numbered 01 4 23 */ ww[ 0 ] = ww[ 1 ] = ww[ 2 ] = ww[ 3 ] = FL_min( 0.16 * ob->w, ob->h ); ww[ 4 ] = ob->w - 4 * ww[ 0 ]; /* must calculate this way */ xx[ 0 ] = ob->x; xx[ 1 ] = xx[ 0 ] + ww[ 0 ]; xx[ 4 ] = xx[ 1 ] + ww[ 1 ]; xx[ 2 ] = xx[ 4 ] + ww[ 4 ]; xx[ 3 ] = xx[ 2 ] + ww[ 2 ]; } else { /* 1 4 2 */ ww[ 1 ] = ww[ 2 ] = FL_min( 0.20 * ob->w, ob->h ); ww[ 4 ] = ob->w - 2 * ww[ 1 ]; xx[ 1 ] = ob->x; xx[ 4 ] = ob->x + ww[ 1 ]; xx[ 2 ] = xx[ 4 ] + ww[ 4 ]; } /* Create value string */ sprintf( str, "%.*f", sp->prec, sp->val ); /* Draw the thing */ if ( ob->type == FL_NORMAL_COUNTER ) { ps_draw_box( btype[ 0 ], xx[ 0 ], ob->y, ww[ 0 ], ob->h, ob->col1, ob->bw ); ps_draw_text( FL_ALIGN_CENTER, xx[ 0 ], ob->y, ww[ 0 ], ob->h, ob->col2, 0.0, 0, "@<<" ); } ps_draw_box( btype[ 1 ], xx[ 1 ], ob->y, ww[ 1 ], ob->h, ob->col1, ob->bw ); ps_draw_text( FL_ALIGN_CENTER, xx[ 1 ], ob->y, ww[ 1 ], ob->h, ob->col2, 0.0, 0, "@<" ); ps_draw_box( btype[ 4 ], xx[ 4 ], ob->y, ww[ 4 ], ob->h, ob->col1, ob->bw ); ps_draw_text( FL_ALIGN_CENTER, xx[ 4 ], ob->y, ww[ 4 ], ob->h, ob->lcol, ob->lstyle, ob->lsize, str ); ps_draw_box( btype[ 2 ], xx[ 2 ], ob->y, ww[ 2 ], ob->h, ob->col1, ob->bw ); ps_draw_text( FL_ALIGN_CENTER, xx[ 2 ], ob->y, ww[ 2 ], ob->h, ob->col2, 0.0, 0, "@>" ); if ( ob->type == FL_NORMAL_COUNTER ) { ps_draw_box( btype[ 3 ], xx[ 3 ], ob->y, ww[ 3 ], ob->h, ob->col1, ob->bw ); ps_draw_text( FL_ALIGN_CENTER, xx[ 3 ], ob->y, ww[ 3 ], ob->h, ob->col2, 0.0, 0, "@>>" ); } ps_draw_object_label_beside( ob ); } /*************************************** * Performs linear interpolation ***************************************/ static float flinear( float val, float smin, float smax, float gmin, float gmax ) { if ( smin == smax ) return gmax; else return gmin + ( gmax - gmin ) * ( val - smin ) / ( smax - smin ); } #define is_horiz( t ) ( t == FL_HOR_SLIDER \ || t == FL_HOR_FILL_SLIDER \ || t == FL_HOR_NICE_SLIDER \ || t == FL_HOR_BROWSER_SLIDER \ || t == FL_HOR_BROWSER_SLIDER2 \ || t == FL_HOR_THIN_SLIDER \ || t == FL_HOR_BASIC_SLIDER ) #define is_vert( t ) ( t == FL_VERT_SLIDER \ || t == FL_VERT_FILL_SLIDER \ || t == FL_VERT_NICE_SLIDER \ || t == FL_VERT_BROWSER_SLIDER \ || t == FL_VERT_BROWSER_SLIDER2 \ || t == FL_VERT_THIN_SLIDER \ || t == FL_VERT_BASIC_SLIDER ) /* Minimum knob size */ #define MINKNOB_SB 18 /* for scrollbars on browser */ #define MINKNOB_SL 6 /* for regular sliders */ /* Sliders that must have certain minimum value for the knob */ #define SLIDER_MIN( t ) ( t == FL_HOR_BROWSER_SLIDER \ || t == FL_HOR_BROWSER_SLIDER2 \ || t == FL_VERT_BROWSER_SLIDER \ || t == FL_VERT_BROWSER_SLIDER2 ) /*************************************** ***************************************/ static void ps_drw_slider_shape( int boxtype, float x, float y, float w, float h, long col1, long col2, int sltype, float size, float val, const char * str, int inv, float bw ) { float slx, sly, slw, slh; int slbox = boxtype, slbw = bw; float absbw = FL_abs( bw ); if ( sltype == FL_VERT_FILL_SLIDER ) { slh = ( inv ? ( 1 - val ) : val ) * ( h - 2 * absbw ); sly = inv ? y + h - absbw - slh : y + absbw; slw = w - 2 * absbw; slx = x + absbw; } else if ( sltype == FL_HOR_FILL_SLIDER ) { slw = val * ( w - 2 * absbw ); slx = x + absbw; slh = h - 2 * absbw; sly = y + absbw; } else if ( is_vert( sltype ) ) { slh = size * ( h - 2 * absbw ); if ( SLIDER_MIN( sltype ) && slh < MINKNOB_SB ) slh = MINKNOB_SB; else if ( slh < 2 * absbw + MINKNOB_SL ) slh = 2 * absbw + MINKNOB_SL; if ( sltype == FL_VERT_BROWSER_SLIDER2 ) { slh = size * h; sly = flinear( val, 1.0, 0.0, y, y + h - slh ); slx = x + 1; slw = w - 2; } else if ( sltype == FL_VERT_THIN_SLIDER || sltype == FL_VERT_BASIC_SLIDER ) { slh = size * h; sly = flinear( val, 0.0, 1.0, y, y + h - slh ); slx = x + absbw - 0.5; slw = w - 2 * absbw + 0.5; } else { if ( inv ) sly = flinear( val, 1.0, 0.0, y + absbw, y + h - absbw - slh ); else sly = flinear( val, 0.0, 1.0, y + absbw, y + h - absbw - slh ); slw = w - 2 * absbw; slx = x + absbw; } } else if ( is_horiz( sltype ) ) { slw = size * ( w - 2 * absbw ); if ( SLIDER_MIN( sltype ) && slw < MINKNOB_SB ) slw = MINKNOB_SB; else if ( slw < 2 * absbw + MINKNOB_SL ) slw = 2 * absbw + MINKNOB_SL; if ( sltype == FL_HOR_BROWSER_SLIDER2 ) { slw = size * w; slx = flinear( val, 0.0, 1.0, x, x + w - slw ); slh = h - 2; sly = y + 1; } else if ( sltype == FL_HOR_THIN_SLIDER || sltype == FL_HOR_BASIC_SLIDER ) { slw = size * w; slx = flinear( val, 0.0, 1.0, x, x + w - slw ); sly = y + absbw + 0.5; slh = h - 2 * absbw + 0.5; } else { slx = flinear( val, 0.0, 1.0, x + absbw, x + w - absbw - slw ); slh = h - 2 * absbw; sly = y + absbw; } } else { fprintf( stderr, "Unknown slider type %d\n", sltype ); return; } /* Start drawing */ slbox = boxtype; slbw = bw; if ( sltype == FL_VERT_BROWSER_SLIDER2 || sltype == FL_HOR_BROWSER_SLIDER2 ) slbw = bw > 0 ? 1 : -1; if ( sltype != FL_HOR_THIN_SLIDER && sltype != FL_VERT_THIN_SLIDER && sltype != FL_HOR_BASIC_SLIDER && sltype != FL_VERT_BASIC_SLIDER ) ps_draw_box( slbox, x, y, w, h, col1, slbw ); if ( sltype == FL_VERT_NICE_SLIDER ) { int xoff = absbw - 0.01; ps_draw_box( FL_FLAT_BOX, x + w / 2.0 - 2.0, y + absbw, 4.0, h - 2.0 * absbw, FL_BLACK, 0 ); ps_draw_box( FL_UP_BOX, slx, sly, slw, slh, col1, bw ); ps_draw_box( FL_DOWN_BOX, slx + xoff, sly + slh / 2.0 - 2.2, slw - 2 * xoff, 5.5, col2, 1.1 ); } else if ( sltype == FL_HOR_NICE_SLIDER ) { int yoff = absbw - 0.4; ps_draw_box( FL_FLAT_BOX, x + absbw, y + h / 2 - 2, w - 2 * absbw, 4.0, FL_BLACK, 0.0 ); ps_draw_box( FL_UP_BOX, slx, sly, slw, slh, col1, bw ); ps_draw_box( FL_DOWN_BOX, slx + slw / 2.0 - 2, sly + yoff, 5, slh - 2 * yoff, col2, 1.1 ); } else { int absbw2, bw2; switch ( boxtype ) { case FL_UP_BOX: slbox = FL_UP_BOX; break; case FL_DOWN_BOX: slbox = FL_UP_BOX; break; case FL_FRAME_BOX: case FL_EMBOSSED_BOX: case FL_ROUNDED_BOX: slbox = boxtype; break; case FL_RFLAT_BOX: slbox = FL_ROUNDED_BOX; break; case FL_RSHADOW_BOX: slbox = FL_ROUNDED_BOX; break; default: slbox = FL_FRAME_BOX; break; } absbw2 = absbw >= 2 ? absbw - 1 : absbw - ( bw < 0 ); bw2 = bw > 0 ? absbw2 : - absbw2; ps_draw_box( slbox, slx, sly, slw, slh, col2, bw2 ); if ( sltype == FL_VERT_BROWSER_SLIDER || sltype == FL_VERT_BROWSER_SLIDER2 || sltype == FL_VERT_THIN_SLIDER ) { int extra = ( bw2 < 0 ); ps_draw_text( FL_ALIGN_CENTER, slx - extra, sly, slw + 2 * extra, slh, 0, FL_TINY_FONT, FL_NORMAL_STYLE, "@RippleLines" ); } else if ( sltype == FL_HOR_BROWSER_SLIDER || sltype == FL_HOR_BROWSER_SLIDER2 || sltype == FL_HOR_THIN_SLIDER ) ps_draw_text( FL_ALIGN_CENTER, slx - 1, sly - 1, slw, slh + 2, 0, FL_TINY_FONT, FL_NORMAL_STYLE, "@2RippleLines" ); } /* Draw the label */ ps_draw_text( FL_ALIGN_CENTER, slx, sly, slw, slh, 0, FL_NORMAL_STYLE, FL_SMALL_FONT, str ); } #define VAL_BOXW FL_max( 35, 0.18 * ob->w ) #define VAL_BOXH 25 /*************************************** ***************************************/ static void flps_draw_slider( FL_OBJECT * ob ) { SPEC *sp = ob->spec; char valstr[ 32 ]; float bx = ob->x, by = ob->y, bw = ob->w, bh = ob->h; /* value box */ float sx = ob->x, sy = ob->y, sw = ob->w, sh = ob->h; /* slider */ float val; int inv; /* Draw the value box */ if ( ob->objclass == FL_VALSLIDER ) { if ( is_vert( ob->type ) ) { bh = VAL_BOXH; by = ob->y + ob->h - 1 - bh; sh -= bh;; } else { bw = VAL_BOXW; sx += bw; sw -= bw; } sprintf( valstr, "%.*f", sp->prec, sp->val ); ps_draw_box( ob->boxtype, bx, by, bw, bh, ob->col1, ob->bw ); ps_draw_text_beside( FL_ALIGN_CENTER, bx, by, bw, bh, ob->lcol, ob->lstyle, ob->lsize, valstr ); } if ( sp->min == sp->max ) val = 0.5; else val = ( sp->val - sp->min ) / ( sp->max - sp->min ); inv = sp->min < sp->max; /* Draw the slider */ if ( fl_is_center_lalign( ob->align ) ) ps_drw_slider_shape( ob->boxtype, sx, sy, sw, sh, ob->col1, ob->col2, ob->type, sp->slsize, val, ob->label, inv, ob->bw ); else { ps_drw_slider_shape( ob->boxtype, sx, sy, sw, sh, ob->col1, ob->col2, ob->type, sp->slsize, val, "", inv, ob->bw ); ps_draw_object_label_beside( ob ); } } /* * SCROLL BAR */ #define is_hor_scrollbar( t ) ( t == FL_HOR_SCROLLBAR \ || t == FL_HOR_THIN_SCROLLBAR \ || t == FL_HOR_NICE_SCROLLBAR \ || t == FL_HOR_BASIC_SCROLLBAR) /*************************************** ***************************************/ static void get_geom( FL_OBJECT * parent, FL_OBJECT * up, FL_OBJECT * slider, FL_OBJECT * down ) { int x = parent->x, y = parent->y, w = parent->w, h = parent->h; int absbw = FL_abs( parent->bw ); if ( is_hor_scrollbar( parent->type ) ) { down->x = x; up->x = x + w - h; up->y = down->y = y; down->w = down->h = up->w = up->h = h; slider->x = x + h; slider->y = y; slider->w = w - 2 * h; slider->h = h; } else { up->x = down->x = x; up->y = y + h - w; down->y = y; up->w = up->h = down->w = down->h = w; slider->x = x; slider->y = y + w; slider->w = w; slider->h = h - 2 * w; } up->col1 = down->col1 = slider->col1 = parent->col1; up->col2 = down->col2 = slider->col2 = parent->col2; up->bw = down->bw = slider->bw = parent->bw; if ( absbw > 2 ) absbw--; if ( parent->bw > 0 ) up->bw = down->bw = absbw; else up->bw = down->bw = -absbw; slider->boxtype = parent->boxtype; if ( parent->type == FL_HOR_THIN_SCROLLBAR || parent->type == FL_VERT_THIN_SCROLLBAR || parent->type == FL_HOR_BASIC_SCROLLBAR || parent->type == FL_VERT_BASIC_SCROLLBAR ) { up->boxtype = down->boxtype = FL_NO_BOX; if ( parent->type == FL_VERT_THIN_SCROLLBAR || parent->type == FL_VERT_BASIC_SCROLLBAR ) { slider->y += absbw - 1; slider->h += 2 * (absbw - 1); } else { slider->x -= absbw - 1; slider->w += 2 * ( absbw - 1 ); } } else up->boxtype = down->boxtype = parent->boxtype; } /*************************************** ***************************************/ static void flps_draw_scrollbar( FL_OBJECT * ob ) { FL_OBJECT *sld, *up, *down; int sltype; if ( ob->type == FL_HOR_THIN_SCROLLBAR || ob->type == FL_VERT_THIN_SCROLLBAR || ob->type == FL_HOR_BASIC_SCROLLBAR || ob->type == FL_VERT_BASIC_SCROLLBAR ) ps_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); switch ( ob->type ) { case FL_HOR_SCROLLBAR: sltype = FL_HOR_BROWSER_SLIDER2; break; case FL_VERT_SCROLLBAR: sltype = FL_VERT_BROWSER_SLIDER2; break; case FL_HOR_THIN_SCROLLBAR: sltype = FL_HOR_THIN_SLIDER; break; case FL_VERT_THIN_SCROLLBAR: sltype = FL_VERT_THIN_SLIDER; break; case FL_HOR_BASIC_SCROLLBAR: sltype = FL_HOR_BASIC_SLIDER; break; case FL_VERT_BASIC_SCROLLBAR: sltype = FL_VERT_BASIC_SLIDER; break; case FL_HOR_NICE_SCROLLBAR: sltype = FL_HOR_NICE_SLIDER; break; case FL_VERT_NICE_SCROLLBAR: sltype = FL_VERT_NICE_SLIDER; break; default: fprintf( stderr, "Unknown scrollbar type: %d\n", ob->type ); sltype = FL_HOR_BROWSER_SLIDER2; break; } if ( is_hor_scrollbar( ob->type ) ) { up = flps_make_object( FL_SCROLLBUTTON, FL_TOUCH_BUTTON, 1, 1, 1, 1, "6", 0 ); down = flps_make_object( FL_SCROLLBUTTON, FL_TOUCH_BUTTON, 1, 1, 1, 1, "4", 0 ); sld = flps_make_object( FL_SLIDER, sltype, 1, 1, 1, 1, "", 0 ); } else { up = flps_make_object( FL_SCROLLBUTTON, FL_TOUCH_BUTTON, 1, 1, 1, 1, "8", 0 ); down = flps_make_object( FL_SCROLLBUTTON, FL_TOUCH_BUTTON, 1, 1, 1, 1, "2", 0 ); sld = flps_make_object( FL_SLIDER, sltype, 1, 1, 1, 1, "", 0 ); } get_geom( ob, up, sld, down ); sld->spec = ob->spec; ps_draw_object( up ); ps_draw_object( sld ); ps_draw_object( down ); ps_draw_object_label_beside( ob ); } /*************************************** ***************************************/ static void flps_draw_frame( FL_OBJECT * ob ) { ps_draw_frame( ob->type, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); ps_draw_object_label( ob ); } /* In addition to computing the string length, it enlarges the * bounding box and leaves a copy of the string on the stack */ static void ps_len( const char * s, int style, int size) { ps_set_font( style, size ); /* this sets flfont height */ ps_output( "(%s) dup stringwidth pop /w exch 6 add def\n", s ); ps_output( "/h {H 2 add} bind def\n" ); } /*************************************** ***************************************/ static void ps_boxf( long col ) { ps_color( col ); ps_output( "x y " ); /* (x,y) */ ps_output( "x y h 1 sub add\n" ); /* (x, y+h - 1) */ ps_output( "x w 1 sub add y h 1 sub add " ); /* (x+w-1, y+h-1) */ ps_output( "x w 1 sub add y 4 P F\n" ); /* (x+w-1,y) */ } /*************************************** ***************************************/ static void flps_draw_lframe( FL_OBJECT * ob ) { int align, margin, dy = 0; int est; ps_draw_frame( ob->type, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); if ( ob->type == FL_UP_FRAME || ob->type == FL_DOWN_FRAME ) dy = ( FL_abs( ob->bw ) + 1 ) / 2; align = fl_to_outside_lalign( ob->align ); margin = 11 + ob->w * 0.02; if ( ob->type == FL_ROUNDED_FRAME ) margin += 7; est = strlen( ob->label ) * ob->lsize; /* Turn into pixels */ est *= psinfo.xdpi / 75.0; if ( ob->w - est < 2 * margin ) margin /= 2; if ( ob->w - est < 2 * margin ) margin /= 2; ps_len( ob->label, ob->lstyle, ob->lsize ); switch( align ) { case FL_ALIGN_LEFT_BOTTOM : ps_output( "/x {%d %d add} bind def\n", ob->x, margin ); ps_output( "/y {%d h -2 div add %d sub} bind def\n", ob->y, dy ); break; case FL_ALIGN_BOTTOM : ps_output( "/x {%d %d w sub 2 div add} bind def\n", ob->x, ob->w ); ps_output( "/y {%d h -2 div add %d sub} bind def\n", ob->y, dy ); break; case FL_ALIGN_RIGHT_BOTTOM : ps_output( "/x {%d %d add w sub %d sub} bind def\n", ob->x, ob->w, margin ); ps_output( "/y {%d h -2 div add %d sub} bind def\n", ob->y, dy ); break; case FL_ALIGN_TOP : ps_output( "/x {%d %d w sub 2 div add} bind def\n", ob->x, ob->w ); ps_output( "/y {%d %d add h -2 div add %d add} bind def\n", ob->y, ob->h, dy ); break; case FL_ALIGN_RIGHT_TOP : case FL_ALIGN_RIGHT : ps_output( "/x {%d %d add w sub %d sub} bind def\n", ob->x, ob->w, margin ); ps_output( "/y {%d %d add h -2 div add %d add} bind def\n", ob->y, ob->h, dy ); break; default : ps_output( "/x {%d %d add} bind def\n", ob->x, margin ); ps_output( "/y {%d %d add h -2 div add %d add} bind def\n", ob->y, ob->h, dy ); break; } ps_boxf( ob->col2 ); ps_color( ob->lcol ); ps_output( "x w 2 div add y h 2 div add -0.3 h mul add M Cshow\n" ); } /*************************************** ***************************************/ static void flps_draw_positioner( FL_OBJECT * ob ) { ALLSPEC *sp = ob->spec; float absbw = FL_abs( ob->bw ); float xo = ob->x + absbw + 1, yo = ob->y + absbw + 1; float w1 = ob->w - 2 * ( absbw + 1 ), h1 = ob->h - 2 * ( absbw + 1 ); float xx, yy; if ( ob->type != FL_OVERLAY_POSITIONER ) ps_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); ps_draw_object_label( ob ); xx = flinear( sp->xval, sp->xmin, sp->xmax, xo, xo + w1 - 1.0 ); yy = flinear( sp->yval, sp->ymin, sp->ymax, yo, yo + h1 - 1.0 ); ps_line( xo, yy, xo + w1 - 1, yy, ob->col2 ); ps_line( xx, yo, xx, yo + h1 - 1, ob->col2 ); } #define IS_FLATBOX( b ) ( b == FL_FRAME_BOX \ || b == FL_EMBOSSED_BOX \ || b == FL_BORDER_BOX \ || b == FL_ROUNDED_BOX ) /*************************************** ***************************************/ static int calc_sbw( FL_OBJECT * ob ) { int delta = FL_abs( ob->bw ) + 3 * ( ob->bw > 0 ); int flat = IS_FLATBOX( ob->boxtype ) ? 2 : 0; if ( ob->w > 250 && ob->h > 250 ) return 15 + delta - flat; else if ( ob->w < 150 || ob->h < 150 ) return 13 + delta - flat; else return 14 + delta - flat; } /*************************************** ***************************************/ static void browser_partition( FL_OBJECT * ob, int sbw, int * tx, int * ty, int * tw, int * th ) { SPEC *sp = ob->spec; int dx = 0, dy = 0; *tx = ob->x; *ty = ob->y; *tw = ob->w; *th = ob->h; if ( sp->v_pref == FL_ON ) { dx = sbw; *tw -= dx; } if ( sp->h_pref == FL_ON ) { dy = sbw; *ty += dy; *th -= dy; } if ( sp->v_pref == FL_ON ) { FL_OBJECT *vscb = flps_make_object( FL_SCROLLBAR, FL_VERT_THIN_SCROLLBAR, ob->x + ob->w - sbw, ob->y + dy, sbw, ob->h - dy, 0, 0 ); /* Copy some attributes from parent */ vscb->bw = ob->bw; vscb->boxtype = ob->boxtype; ( ( SPEC * ) vscb->spec )->slsize = 0.5; ( ( SPEC * ) vscb->spec )->val = 1; flps_draw_scrollbar( vscb ); } if ( sp->h_pref == FL_ON ) { FL_OBJECT *hscb = flps_make_object( FL_SCROLLBAR, FL_HOR_THIN_SCROLLBAR, ob->x, ob->y, ob->w - dx, sbw, 0, 0 ); /* Copy some attributes from parent */ hscb->bw = ob->bw; hscb->boxtype = ob->boxtype; ( ( SPEC * ) hscb->spec )->slsize = 0.5; ( ( SPEC * ) hscb->spec )->val = 0; flps_draw_scrollbar( hscb ); } } /*************************************** ***************************************/ static void flps_draw_browser( FL_OBJECT * ob ) { SPEC *sp = ob->spec; int absbw = FL_abs( ob->bw ); int sbw; int tx, ty, tw, th; int m = absbw / 2 + 1; sbw = calc_sbw( ob ); /* scroll bar width */ browser_partition( ob, sbw, &tx, &ty, &tw, &th ); ps_draw_box( ob->boxtype, tx, ty, tw, th, ob->col1, ob->bw ); ps_draw_object_label_beside( ob ); /* Start clipping */ ps_set_clipping( tx + absbw, ty + absbw, tw - 2 * absbw - 1, th - 2 * absbw ); if ( sp->content[ 1 ] ) { char *str; int i, cur_size; str = malloc( 1 ); *str = '\0'; cur_size = 1; for ( i = 1; i <= sp->lines; i++ ) { cur_size += strlen( sp->content[ i ] ) + 2; str = realloc( str, cur_size ); strcat( str, sp->content[ i ] ); strcat( str, "\n" ); } ps_draw_text( FL_ALIGN_LEFT_TOP | FL_ALIGN_INSIDE, tx + m, ty, tw, th, ob->lcol, sp->fontstyle, sp->fontsize, str ); free( str ); } ps_unset_clipping( ); } /*************************************** ***************************************/ static void flps_draw_input( FL_OBJECT * ob ) { long col = ob->focus ? ob->col2 : ob->col1; ob->align = fl_to_outside_lalign( ob->align ); ps_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, col, ob->bw ); ps_draw_object_label_beside( ob ); } /*************************************** ***************************************/ static void flps_draw_free( FL_OBJECT * ob ) { ps_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); } /*************************************** ***************************************/ static char * default_filter( FL_OBJECT * ob FL_UNUSED_ARG, double totalsec ) { static char buf[ 32 ]; int minutes; float sec; if ( totalsec >= 3600.0 ) { int hr = totalsec / 3600.0 + 0.001; minutes = totalsec / 60.0 + 0.001; minutes -= hr * 60; sec = totalsec - 60 * ( minutes + 60 * hr ); sprintf( buf, "%2d:%0d:%2.1f", hr, minutes, sec ); } else if ( totalsec >= 60.0 ) { minutes = totalsec / 60.0 + 0.001; sec = totalsec - minutes * 60; sprintf( buf, "%2d:%2.1f", minutes, sec ); } else sprintf(buf, "%2.1f", totalsec); return buf; } /*************************************** ***************************************/ static void flps_draw_timer( FL_OBJECT * ob ) { char *str; SPEC *sp = ob->spec; if ( ob->type == FL_HIDDEN_TIMER ) return; ps_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); if ( ob->type == FL_VALUE_TIMER ) { str = default_filter( ob, sp->val == 0.0 ? 100.0 : sp->val ); ps_draw_text( FL_ALIGN_CENTER, ob->x, ob->y, ob->w, ob->h, ob->lcol, ob->lstyle, ob->lsize, str ); ob->align = fl_to_outside_lalign( ob->align ) ; if ( ob->align == FL_ALIGN_CENTER ) ob->align = FL_ALIGN_LEFT; } ps_draw_object_label( ob ); } /*************************************** ***************************************/ static void flps_draw_spinner( FL_OBJECT * ob ) { FL_OBJECT *input, *up, *down; if ( ob->w >= ob->h ) { FL_Coord bwh = FL_max( ob->h / 2, 1 ); ob->h = 2 * bwh; input = flps_make_object( FL_INPUT, ob->type == FL_INT_SPINNER ? FL_INT_INPUT : FL_FLOAT_INPUT, ob->x, ob->y, ob->w - bwh - 1, ob->h, "", NULL ); up = flps_make_object( FL_BUTTON, FL_TOUCH_BUTTON, ob->x + ob->w - bwh - 1, ob->y + bwh, bwh, bwh, "@8>", NULL ); down = flps_make_object( FL_BUTTON, FL_TOUCH_BUTTON, ob->x + ob->w - bwh - 1, ob->y, bwh, bwh, "@2>", NULL ); } else { FL_Coord bwh = FL_max( ob->w / 2, 1 ); ob->w = 2 * bwh; input = flps_make_object( FL_INPUT, ob->type == FL_INT_SPINNER ? FL_INT_INPUT : FL_FLOAT_INPUT, ob->x, ob->y + bwh, ob->w, ob->h - bwh - 1, "", NULL ); up = flps_make_object( FL_BUTTON, FL_TOUCH_BUTTON, ob->x + bwh, ob->y, bwh, bwh, "@6>", NULL ); down = flps_make_object( FL_BUTTON, FL_TOUCH_BUTTON, ob->x, ob->y, bwh, bwh, "@4>", NULL ); } input->boxtype = FL_DOWN_BOX; input->col1 = ob->col1; input->col2 = ob->col2; ps_draw_object( input ); ps_draw_object( up ); ps_draw_object( down ); ob->align = fl_to_outside_lalign( ob->align ); ps_draw_object_label_beside( ob ); } /****************** TABLES ****************************/ typedef void ( * DRAW )( FL_OBJECT * ); typedef struct { int objclass; DRAW drawit; } FLPS_draw; static FLPS_draw flps_draw[ ] = { { FL_BUTTON, flps_draw_button }, { FL_LIGHTBUTTON, flps_draw_lightbutton }, { FL_ROUNDBUTTON, flps_draw_roundbutton }, { FL_LABELBUTTON, flps_draw_labelbutton }, { FL_ROUND3DBUTTON, flps_draw_round3dbutton }, { FL_SCROLLBUTTON, flps_draw_scrollbutton }, { FL_CHECKBUTTON, flps_draw_checkbutton }, { FL_PIXMAPBUTTON, flps_draw_pixmap }, { FL_BITMAPBUTTON, flps_draw_pixmap }, { FL_PIXMAP, flps_draw_pixmap }, { FL_BITMAP, flps_draw_pixmap }, { FL_SLIDER, flps_draw_slider }, { FL_VALSLIDER, flps_draw_slider }, { FL_SCROLLBAR, flps_draw_scrollbar }, { FL_THUMBWHEEL, flps_draw_thumbwheel }, { FL_BOX, flps_draw_box }, { FL_TEXT, flps_draw_text }, { FL_COUNTER, flps_draw_counter }, { FL_DIAL, flps_draw_dial }, { FL_CHOICE, flps_draw_choice }, { FL_MENU, flps_draw_text }, { FL_BROWSER, flps_draw_browser }, { FL_POSITIONER, flps_draw_positioner }, { FL_FRAME, flps_draw_frame }, { FL_LABELFRAME, flps_draw_lframe }, { FL_INPUT, flps_draw_input }, { FL_FREE, flps_draw_free }, { FL_TIMER, flps_draw_timer }, { FL_SPINNER, flps_draw_spinner } }; #define NOBJ ( sizeof flps_draw / sizeof *flps_draw ) /*************************************** ***************************************/ static void ps_draw_object( FL_OBJECT * ob ) { FLPS_draw *d = flps_draw, *ds; for ( ds = d + NOBJ; d < ds; d++ ) { if ( d->objclass == ob->objclass ) { if ( psinfo.verbose ) ps_verbatim( "%%%s {\n", find_class_name( ob->objclass ) ); d->drawit( ob ); if ( psinfo.verbose ) ps_verbatim( "%%%s }\n", find_class_name( ob->objclass ) ); return; } } if ( ob->objclass != FL_BEGIN_GROUP && ob->objclass != FL_END_GROUP ) fprintf( stderr, "Unknown/unsupported object: %s (%d)\n", find_class_name( ob->objclass ), ob->objclass ); } /*************************************** ***************************************/ void ps_show_form( FL_FORM * form ) { FL_OBJECT *ob; ps_bgn_form( form->w, form->h, form->label ); for ( ob = form->first; ob; ob = ob->next ) { scale_object( ob ); ps_draw_object( ob ); } ps_end_form( ); psinfo.page++; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fd2ps/fd2ps.c0000644000175000017500000001707512251675472012202 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fd2ps.c * * This file is part of XForms package * Copyright (c) 1997-2000 by T.C. Zhao * All rights reserved. * * Read in a form defination file (.fd) and write an EPS output * for inclusion in a document */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "include/forms.h" #include "fd2ps.h" #include "global.h" #include static int parse_command_line( int argc, char * argv[ ] ); static void usage( const char *, int ); static void fd2ps_init( void ); static char *helpmsg[ ] = { "-h this help", "-dpi f specifies the pixel/length conversion", "-gray requests grayscale output", "-l requests landscape output", "-p requests portrait output", "-bw n sets object border width", "-eps requests Encapsulated PostScript", "-G f specifies gamma", "-verbose specifies verbose output", "-version prints version info and exits", "-paper s specifies paper name (A4 etc). Use all for a list", "-pw f specifies paper width (in inches)", "-ph f specifies paper height (in inches)", 0 }; /*************************************** ***************************************/ static void usage( const char * cmd, int die ) { char **q = helpmsg; fprintf( stderr, "Usage: %s [options] infile.[fd] [outfile]\n", cmd ); fprintf( stderr, " where options are\n" ); for ( ; *q; q++ ) fprintf( stderr, " %s\n", *q ); fprintf( stderr, " -rgb file specifies the path to rgb.txt. " "Default is %s\n", psinfo.rgbfile ); if ( die ) exit( 1 ); } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { int n; char outname[ 512 ], inname[ 512 ], *p; FILE *fp; fd2ps_init( ); n = parse_command_line( argc, argv ); strcpy( inname, argv[ n ] ); if ( ! strstr( inname, ".fd" ) ) strcat( inname, ".fd" ); if ( n < argc - 1 ) strcpy( outname, argv[ ++n ] ); else { strcpy( outname, inname ); if ( ( p = strrchr( outname, '.' ) ) ) *p = '\0'; strcat( outname, psinfo.eps ? ".eps" : ".ps" ); } /* before opening the output file, check the existence of input */ if ( ! ( fp = fopen( inname, "r" ) ) ) { perror( inname ); exit( 1 ); } fclose( fp ); if ( strcmp( outname, "-" ) == 0 ) flps->fp = stdout; else if ( ! ( flps->fp = fopen( outname, "w" ) ) ) { fprintf( stderr, "Can't open %s for output\n", outname ); exit( 1 ); } load_form_definition( inname ); return 0; } /*************************************** * Overall default configuration ***************************************/ static void fd2ps_init( void ) { char *env; struct stat statbuf; psinfo.xdpi = psinfo.ydpi = 85; psinfo.paper_name = "Letter"; get_paper_size( psinfo.paper_name, &psinfo.paper_w, &psinfo.paper_h ); psinfo.bw = 1; psinfo.verbose = 0; psinfo.colorps = 1; psinfo.eps = 0; psinfo.gamma = 1.0; psinfo.page = 1; psinfo.xscale = psinfo.yscale = 1.0; psinfo.pack = 1; psinfo.landscape = -1; /* auto */ psinfo.fp = stdout; psinfo.rgbfile = "/usr/lib/X11/rgb.txt"; if ( stat( psinfo.rgbfile, &statbuf ) < 0 ) psinfo.rgbfile = "/usr/share/X11/rgb.txt"; psinfo.xpmtops_direct = 1; flps = &psinfo; /* Check if enviornment variable paper is defined */ if ( ( env = getenv( "PAPER" ) ) ) { get_paper_size( env, &psinfo.paper_w, &psinfo.paper_h ); psinfo.paper_name = env; } if ( ( env = getenv( "RGBFile" ) ) ) psinfo.rgbfile = env; } /*************************************** ***************************************/ static int parse_command_line( int argc, char * argv[ ] ) { int i; float ftmp; for ( i = 1; i < argc && *argv[ i ] == '-'; i++ ) { if ( strcmp( argv[ i ], "-bw" ) == 0 && i + 1 < argc ) psinfo.user_bw = atoi( argv[ ++i ] ); else if ( strcmp( argv[ i ], "-dpi" ) == 0 && i + 1 < argc ) { ftmp = atof( argv[ ++i ] ); psinfo.xdpi = psinfo.ydpi = ftmp; } else if ( strncmp( argv[ i ], "-verb", 5 ) == 0 ) psinfo.verbose = 1; else if ( strcmp( argv[ i ], "-eps" ) == 0 ) psinfo.eps = 1; else if ( strncmp( argv[ i ], "-vers", 5 ) == 0 ) print_version( 1 ); else if ( strncmp( argv[ i ], "-h", 2 ) == 0 ) usage( argv[ 0 ], 1 ); else if ( strcmp( argv[ i ], "-pw" ) == 0 && i + 1 < argc ) { psinfo.paper_w = atof( argv[ ++i ] ); psinfo.paper_name = 0; } else if ( strcmp( argv[ i ], "-ph" ) == 0 && i + 1 < argc ) { psinfo.paper_h = atof( argv[ ++i ] ); psinfo.paper_name = 0; } else if ( strcmp( argv[ i ], "-G" ) == 0 && i + 1 < argc ) psinfo.gamma = atof( argv[ ++i ] ); else if ( strcmp( argv[ i ], "-l" ) == 0 ) psinfo.landscape = 1; else if ( strcmp( argv[ i ], "-p" ) == 0 ) psinfo.landscape = 0; else if ( strcmp( argv[ i ], "-color" ) == 0 ) psinfo.colorps = 1; else if ( strcmp( argv[ i ], "-pack" ) == 0 ) psinfo.pack = !psinfo.pack; else if ( strcmp( argv[ i ], "-gray" ) == 0 || strcmp( argv[ i ], "-grey" ) == 0 ) psinfo.colorps = 0; else if ( strcmp( argv[ i ], "-rgb" ) == 0 && i + 1 < argc ) psinfo.rgbfile = fl_strdup( argv[ ++i ] ); else if ( strcmp( argv[ i ], "-paper" ) == 0 && i + 1 < argc ) { if ( strcmp( argv[ ++i ], "all" ) == 0 ) { fprintf( stderr, " The following paper names are known\n" ); list_papers( "\t" ); exit( 0 ); } get_paper_size( argv[ i ], &psinfo.paper_w, &psinfo.paper_h ); psinfo.paper_name = argv[ i ]; } else { usage( argv[ 0 ], 0 ); fprintf( stderr, "Unknown Option %s\n", argv[ i ] ); exit( 1 ); } } if ( i == argc ) usage( argv[ 0 ], 1 ); /* limited validation */ if ( psinfo.paper_h <= 1 || psinfo.paper_w <= 1 ) { fprintf( stderr, "%s: incorrect paper size (%.1fX%.1f)\n", argv[ 0 ], psinfo.paper_w, psinfo.paper_h ); exit( 0 ); } if ( psinfo.xdpi < 50 || psinfo.xdpi > 300 ) { fprintf( stderr, "%s: unusual DPI value %.1f\n", argv[ 0 ], psinfo.xdpi ); } if ( psinfo.gamma != 1.0 ) apply_gamma( psinfo.gamma ); return i; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fd2ps/readxpm.c0000644000175000017500000003244512251675434012620 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file readxpm.c * * This file is part of XForms package * Copyright (c) 1997-2000 by T.C. Zhao * All rights reserved. * * read an XPM file. Only handles XPM3 files. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "fd2ps.h" /*#define DEBUG */ enum { CMAP, GMAP, MMAP, G4MAP, SMAP }; #define NMAPS 5 static char *keys[ ] = { "c", "g", "m", "g4", "s" }; static int lookup_rgb( const char *, int *, int *, int * ); /*************************************** ***************************************/ #ifdef DEBUG static void dump_map( char * name, fd2psCMAP * m, int ncol ) { int i; for ( i = 0; i < ncol; i++ ) fprintf( stderr, "%s: %s %s (%d %d %d)\n", name, m[ i ].key, m[ i ].name, m[ i ].red, m[ i ].green, m[ i ].blue); } #endif /*************************************** ***************************************/ static short * read_xpm( const char * file, int * w, int * h, int * ncol, fd2psCMAP ** maps, int * set ) { char buf[ 2048 ], val[ 64 ], *head, key[ 16 ], ckey[ 8 ]; int char_per_pixel, signature = 0; int x, y, icol, c, n, i, match; fd2psCMAP *map = 0; int r = 0, g = 0, b = 0; short *pixels, *p; FILE *fp; if ( ! ( fp = fopen( file, "r" ) ) ) { fprintf( stderr, "unable to open xpm file %s\n", file ); return 0; } while ( ! signature && fgets( buf, sizeof buf, fp ) ) { if ( strstr( buf, "XPM" ) && strstr( buf, "/*" ) ) signature = 1; } if ( ! signature ) { fprintf( stderr, "%s does not seem to be an XPM3 file\n", file ); return 0; } while ( ( c = getc( fp ) ) != EOF && c != '"' ) /* empty */ ; if ( fscanf( fp, "%d %d %d %d", w, h, ncol, &char_per_pixel ) != 4 ) { fprintf( stderr, "can't determine xpm size\n" ); return 0; } while ( getc(fp) != '\n' ) /* empty */ ; /* We only handle 1, 2, or 3 char_per_pixel due to colormap limit */ if ( char_per_pixel > 3 || char_per_pixel <= 0 ) { fprintf( stderr, "can't handle char_per_pixel: %d\n", char_per_pixel ); return 0; } #ifdef DEBUG fprintf( stderr, "xpm: w=%d h=%d ncol=%d cpp=%d\n", *w, *h, *ncol, char_per_pixel ); #endif memset( set, 0, sizeof *set * NMAPS ); for ( i = 0; i < NMAPS; i++ ) maps[ i ] = malloc( *ncol * sizeof **maps ); /* Read the colormap. We handle color, grayscale mono only */ for ( icol = 0; icol < *ncol; icol++ ) { /* Skip comments if any */ while ( fgets( buf, sizeof buf, fp ) && strncmp( buf, "/*", 2 ) == 0 ) /* empty */ ; if ( ( head = strchr( buf, '"' ) ) == 0 ) { fprintf( stderr, "bad color line:%s", buf ); return 0; } else head++; strncpy( key, head, char_per_pixel ); key[ char_per_pixel ] = '\0'; head += char_per_pixel + 1; loop: sscanf( head, " %7s %63s %n", ckey, val, &n ); if ( val[ strlen( val ) - 1 ] == '"') val[ strlen( val ) - 1 ] = '\0'; if ( val[ strlen( val ) - 1 ] == ',' ) val[ strlen( val ) - 2 ] = '\0'; head += n; /* Find the color code. We do not handle s currently */ for ( match = i = 0; i < NMAPS; i++ ) if ( strcmp( ckey, keys[ i ] ) == 0 ) { match = 1; map = maps[ i ]; set[ i ] = 1; } if ( map != maps[ SMAP ] ) lookup_rgb( val, &r, &g, &b ); if ( ! match ) { fprintf( stderr, "colormode %s not handled\n", ckey ); map = 0; } if ( map ) { strcpy( map[ icol ].key, key ); strcpy( map[ icol ].name, val ); map[ icol ].red = r; map[ icol ].green = g; map[ icol ].blue = b; } if ( *head != '\n' && *head != '\0' && *head != ',' && *head != '"' ) goto loop; } #ifdef DEBUG if ( set[ CMAP ] ) dump_map( "CMAP", maps[ CMAP ], *ncol ); if ( set[ GMAP ] ) dump_map( "GMAP", maps[ GMAP ], *ncol ); if ( set[ G4MAP ] ) dump_map( "G4MAP", maps[ G4MAP ], *ncol ); if ( set[ MMAP ] ) dump_map( "MMAP", maps[ MMAP ], *ncol ); #endif /* Read the pixels */ map = maps[ CMAP ]; p = pixels = malloc( *w * *h * sizeof *pixels ); for ( y = 0; y < *h; y++ ) { while ( fgets( buf, sizeof buf, fp ) && strncmp( buf, "/*", 2 ) == 0 ) /* e,pty */ ; head = strchr( buf, '"' ); for ( x = 0; x < *w; x++ ) { for ( i = 0; i < char_per_pixel; i++ ) key[ i ] = *++head; key[ char_per_pixel ] = '\0'; /* Search colormap for pixel value */ for ( match = icol = 0; ! match && icol < *ncol; icol++ ) { if ( strcmp(map[ icol ].key, key ) == 0 ) { match = 1; *p++ = icol; } } if ( ! match ) { fprintf( stderr, "pixel %s unknown\n", key ); *p++ = 0; } } } return pixels; } /*************************************** * read the standard RGB file and get rid of the spaces in color names * return 1 for success. ***************************************/ static int read_entry( FILE * fp, int * r, int * g, int * b, char * name ) { int n; char buf[ 512 ], *p; if ( ! fgets( buf, sizeof buf, fp ) ) return 0; while ( buf[ 0 ] == '!' ) if ( fgets( buf, sizeof buf, fp ) ) return 0; if ( sscanf( buf, " %d %d %d %n", r, g, b, &n ) != 3 ) return 0; p = buf + n; /* Remove all spaces */ while ( *p ) { if ( *p != ' ' && *p != '\n' ) *name++ = *p; p++; } *name = '\0'; return ! feof( fp ) && ! ferror( fp ); } /*************************************** ***************************************/ #define MAXDBSIZE 1024 static int lookup_rgb( const char * name, int * red, int * green, int * blue ) { static fd2psCMAP *predef, *end; fd2psCMAP *db; int match; FILE *fp; char lname[ 64 ]; static char hexv[ 128 ]; if ( ! predef ) { long ccol, lcol = -1; int r, g, b; for ( r = 0; r < 10; r++ ) hexv[ r + '0' ] = r; for ( r = 10; r <= 15; r++ ) { hexv[ r - 10 + 'a' ] = r; hexv[ r - 10 + 'A' ] = r; } db = predef = malloc( MAXDBSIZE * sizeof *predef ); if ( ! ( fp = fopen( flps->rgbfile, "r" ) ) ) { fprintf( stderr, "can't find RGB database %s\n", flps->rgbfile ); fprintf( stderr, "Alternative files will be tried\n" ); } /* Try some alternative before giving up */ if ( ! fp ) fp = fopen( "/usr/local/lib/X11/rgb.txt", "r" ); if ( ! fp ) fp = fopen( "/etc/X11/rgb.txt", "r" ); #if defined sun || defined __sun__ if ( ! fp ) fp = fopen( "/usr/openwin/lib/rgb.txt", "r" ); #endif #if defined __EMX__ if ( ! fp ) fp = fopen( "/XFree86/lib/X11/rgb.txt", "r" ); #endif #if defined __VMS if ( ! fp ) fp = fopen( "SYS$MANAGER:DECW$RGB.DAT", "r" ); #endif if ( ! fp ) { fprintf( stderr, "no suitable rgb.txt files found\n" ); return -1; } end = predef + MAXDBSIZE; while ( db < end && read_entry( fp, &r, &g, &b, db->name ) ) { db->red = r; db->green = g; db->blue = b; ccol = ( r << 16 ) + ( g << 8 ) + b; if ( ccol != lcol || strcasecmp( lname, db->name ) ) { strcpy( lname, db->name ); lcol = ccol; db++; } } fclose( fp ); } /* Search for special cases: numerical and None */ if ( strcasecmp( name, "None" ) == 0 ) *red = *green = *blue = -1; else if ( *name == '#' ) { if ( ( match = strlen( name ) ) == 7 ) /* #rrggbb */ { *red = ( hexv[ ( int ) name[ 1 ] ] << 4 ) + hexv[ ( int ) name[ 2 ] ]; *green = ( hexv[ ( int ) name[ 3 ] ] << 4 ) + hexv[ ( int ) name[ 4 ] ]; *blue = ( hexv[ ( int ) name[ 5 ] ] << 4 ) + hexv[ ( int ) name[ 6 ] ]; } else if ( match == 13 ) /* #rrrrggggbbbb */ { *red = ( hexv[ ( int ) name[ 1 ] ] << 12 ) + ( hexv[ ( int ) name[ 2 ] ] << 8 ) + ( hexv[ ( int ) name[ 3 ] ] << 4 ) + hexv[ ( int ) name[ 4 ] ]; *green = ( hexv[ ( int ) name[ 5 ] ] << 12 ) + ( hexv [( int ) name[ 6 ] ] << 8 ) + ( hexv[ ( int ) name[ 7 ] ] << 4 ) + hexv[ ( int ) name[ 8 ] ]; *blue = ( hexv[ ( int ) name[ 9 ] ] << 12 ) + ( hexv[ ( int ) name[ 10 ] ] << 8 ) + ( hexv[ ( int ) name[ 11 ] ] << 4 ) + hexv[ ( int ) name[ 12 ] ]; *red = ( *red * 255L ) / 65535L; *green = ( *green * 255L ) / 65535L; *blue = ( *blue * 255L ) / 65535L; } else if ( match == 4 ) { *red = ( hexv[ ( int ) name[ 1 ] ] * 255 ) / 15; *green = ( hexv[ ( int ) name[ 2 ] ] * 255 ) / 15; *blue = ( hexv[ ( int ) name[ 3 ] ] * 255 ) / 15; } else fprintf( stderr, "can't handle color %s\n", name ); } else { /* Search the pre-defined colorname database */ for ( match = 0, db = predef; ! match && db < predef + MAXDBSIZE; db++ ) { if ( strcasecmp(name, db->name ) == 0 ) { match = 1; *red = db->red; *green = db->green; *blue = db->blue; } } if ( ! match ) fprintf( stderr, "colorname %s not found\n", name ); } return 0; } /*************************************** ***************************************/ int xpmtops_direct( const char * file, int xo, int yo, long tran ) { short *pixels; fd2psCMAP *maps[ NMAPS ], *map; int set[ NMAPS ]; int ncols, w, h, i, r, g, b; if ( ! ( pixels = read_xpm( file, &w, &h, &ncols, maps, set ) ) ) return -1; #ifdef DEBUG { int x, y; short *p; fprintf( stderr, "xmapfile: w=%d h=%d ncol=%d\n", w, h, ncols ); for ( p = pixels, y = 0; y < h; y++ ) { for ( x = 0; x < w; x++ ) fprintf( stderr, "%1d", *p++ ); fprintf(stderr, "\n" ); } } #endif /* Make sure we get a usable colormap */ if ( set[ CMAP ] + set[ GMAP ] + set[ G4MAP ] + set[ MMAP ] == 0 ) { fprintf( stderr, "no usable colormap found\n" ); return -1; } if ( set[ CMAP ] ) map = maps[ CMAP ]; else if ( set[ GMAP ]) map = maps[ GMAP ]; else if ( set[ G4MAP ] ) map = maps[ G4MAP ]; else map = maps[ MMAP ]; /* If gray scale, graymap has priority */ if ( ! flps->colorps && set[ GMAP ] ) map = maps[ GMAP ]; /* Fix transparency */ fl_query_imap( tran, &r, &g, &b ); for ( i = 0; i < ncols; i++ ) { if ( map[ i ].red < 0 ) { map[ i ].red = r; map[ i ].green = g; map[ i ].blue = b; } } /* Start outputting */ ps_verbatim( "\n%% Start of pixmap file %s {\n", file ); ps_output( "gsave\n" ); ps_output( "%d %d translate\n", xo, yo ); ( flps->colorps ? image2colorps : image2grayps )( pixels, w, h, map, ncols, 0 ); ps_verbatim( "\ngrestore %%}\n" ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fd2ps/xpmtops.c0000644000175000017500000000475612252150140012655 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file xpmtops.c * * This file is part of XForms package * Copyright (c) 1997-2000 by T.C. Zhao * All rights reserved. * * Turn an xpm file into PostScript. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "fd2ps.h" #include #include #include #include /* unlink */ #include /*************************************** * Get the dimension of the xpm file for alignment ***************************************/ static int get_xpm_size( const char * file, int * w, int *h ) { FILE *fp = fopen( file, "r" ); int c, j; if ( ! fp ) { fprintf( stderr, "Can't open xpm file '%s'\n", file ); return -1; } while ( ( c = getc( fp ) ) != '"' && c != EOF ) /* empty */ ; if ( c == EOF ) { fprintf( stderr, "Error reading xpm file '%s'\n", file ); fclose( fp ); return -1; } if ( fscanf( fp, "%d %d %d %d", w, h, &j, &j ) != 4 ) { fprintf( stderr, "Failed to get the size of xpm file '%s'\n", file ); fclose( fp ); return -1; } fclose( fp ); return 0; } /*************************************** ***************************************/ void draw_xpm( FL_OBJECT * ob ) { SPEC *sp = ob->spec; int xx, yy, w, h; if ( get_xpm_size( sp->file, &w, &h ) != -1 ) { fl_get_align_xy( sp->align, ob->x, ob->y, ob->w, ob->h, w, h, FL_abs( ob->bw ) + sp->dx, FL_abs( ob->bw ) + sp->dy, &xx, &yy ); xpmtops_direct( sp->file, xx, yy, ob->col1 ); } } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fd2ps/version.c0000644000175000017500000000342512251675422012636 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file version.c * * This file is part of XForms package * Copyright (c) 1997-2000 by T.C. Zhao * All rights reserved. * * version information */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "fd2ps.h" #define S( a ) #a #define LIBVERSION( a, b ) S( a ) "." S( b ) static char *version[ ] = { "fd2ps " LIBVERSION( FL_VERSION, FL_REVISION ) "." FL_FIXLEVEL, "Copyright (c) 1997-2002 by T.C. Zhao", "GNU Lesser General Public License since 2002", NULL }; /*************************************** ***************************************/ void print_version( int die ) { char **q = version; for ( ; *q; q++ ) fprintf( stderr, "%s\n", *q ); if ( die ) exit( 0 ); } /*************************************** ***************************************/ const char * get_version( void ) { static char buf[ 256 ]; char **q = version; for ( *buf = '\0'; *q; q++ ) strcat( buf, *q ); return buf; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fd2ps/Makefile.am0000664000175000017500000000124412353623325013036 00000000000000include $(top_srcdir)/config/common.am CLEANFILES = fd2ps.1 EXTRA_DIST = Readme fd2ps.man SUBDIRS = test man_MANS = fd2ps.1 fd2ps.1: cp -p $(srcdir)/fd2ps.man fd2ps.1 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/lib $(X_CFLAGS) bin_PROGRAMS = fd2ps fd2ps_LDADD = ../lib/libforms.la $(X_LIBS) $(X_PRE_LIBS) $(LIBS) $(X_EXTRA_LIBS) fd2ps_SOURCES = \ align.c \ fd2ps.c \ fd2ps.h \ flsupport.c \ global.h \ image2ps.c \ load.c \ papers.c \ pscol.c \ psdraw.c \ psobj.c \ pstext.c \ readxpm.c \ sys.c \ version.c \ xbmtops.c \ xpmtops.c xforms-1.2.4/fd2ps/align.c0000644000175000017500000001645612251675475012263 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file align.c * * This file is part of XForms package * Copyright (c) 1996-2000 T.C. Zhao and Mark Overmars * All rights reserved. * * Handles align requests */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "fd2ps.h" /*************************************** ***************************************/ int fl_is_inside_lalign( int align ) { return ( unsigned int ) align & FL_ALIGN_INSIDE || align == FL_ALIGN_CENTER; } /*************************************** ***************************************/ int fl_is_outside_lalign( int align ) { return ! fl_is_inside_lalign( align ); } /*************************************** ***************************************/ int fl_is_center_lalign( int align ) { return ( ( unsigned int ) align & ~ FL_ALIGN_INSIDE ) == FL_ALIGN_CENTER; } /*************************************** ***************************************/ int fl_to_inside_lalign( int align ) { return fl_is_center_lalign( align ) ? FL_ALIGN_CENTER : ( ( unsigned int ) align | FL_ALIGN_INSIDE ); } /*************************************** ***************************************/ int fl_to_outside_lalign( int align ) { return fl_is_center_lalign( align ) ? FL_ALIGN_CENTER : ( ( unsigned int ) align & ~FL_ALIGN_INSIDE ); } /*************************************** ***************************************/ void fl_get_hv_align( int align, int * halign, int * valign ) { align = fl_to_outside_lalign( align ); switch ( align ) { case FL_ALIGN_LEFT : *halign = FL_ALIGN_LEFT; *valign = FL_ALIGN_CENTER; break; case FL_ALIGN_RIGHT : *halign = FL_ALIGN_RIGHT; *valign = FL_ALIGN_CENTER; break; case FL_ALIGN_CENTER : *halign = FL_ALIGN_CENTER; *valign = FL_ALIGN_CENTER; break; case FL_ALIGN_TOP : *halign = FL_ALIGN_CENTER; *valign = FL_ALIGN_TOP; break; case FL_ALIGN_BOTTOM : *halign = FL_ALIGN_CENTER; *valign = FL_ALIGN_BOTTOM; break; case FL_ALIGN_LEFT_BOTTOM : *halign = FL_ALIGN_LEFT; *valign = FL_ALIGN_BOTTOM; break; case FL_ALIGN_RIGHT_BOTTOM : *halign = FL_ALIGN_RIGHT; *valign = FL_ALIGN_BOTTOM; break; case FL_ALIGN_LEFT_TOP : *halign = FL_ALIGN_LEFT; *valign = FL_ALIGN_TOP; break; case FL_ALIGN_RIGHT_TOP : *halign = FL_ALIGN_RIGHT; *valign = FL_ALIGN_TOP; break; default : fprintf( stderr, "GetAlign - Bad request: %d\n", align ); *halign = FL_ALIGN_CENTER; *valign = FL_ALIGN_CENTER; break; } } /*************************************** ***************************************/ void fl_get_outside_align( int align, int x, int y, int w, int h, int * new_align, int * newx, int * newy ) { *newx = x; *newy = y; *new_align = FL_ALIGN_CENTER; align = fl_to_outside_lalign( align ); if ( align == FL_ALIGN_LEFT ) { *new_align = FL_ALIGN_RIGHT; *newx = x - w; } else if ( align == FL_ALIGN_RIGHT ) { *new_align = FL_ALIGN_LEFT; *newx = x + w; } else if ( align == FL_ALIGN_TOP ) { *new_align = FL_ALIGN_BOTTOM; *newy = y + h; } else if ( align == FL_ALIGN_BOTTOM ) { *new_align = FL_ALIGN_TOP; *newy = y - h; } else if ( align == FL_ALIGN_LEFT_TOP ) { *new_align = FL_ALIGN_LEFT_BOTTOM; *newy = y + h; } else if ( align == FL_ALIGN_RIGHT_TOP ) { *new_align = FL_ALIGN_RIGHT_BOTTOM; *newy = y + h; } else if ( align == FL_ALIGN_LEFT_BOTTOM ) { *new_align = FL_ALIGN_LEFT_TOP; *newy = y - h; } else if ( align == FL_ALIGN_RIGHT_BOTTOM ) { *new_align = FL_ALIGN_RIGHT_TOP; *newy = y - h; } } /*************************************** ***************************************/ static void get_align_inside( int align, int x, int y, int w, int h, int xsize, int ysize, int xoff, int yoff, int * xx, int * yy ) { int hor, vert; fl_get_hv_align( align, &hor, &vert ); x += xoff; y += yoff; w -= 2 * xoff; h -= 2 * yoff; switch ( hor ) { case FL_ALIGN_LEFT : *xx = x; break; case FL_ALIGN_RIGHT : *xx = x + w - xsize; break; case FL_ALIGN_CENTER : default: *xx = x + ( w - xsize ) / 2; break; } switch ( vert ) { case FL_ALIGN_TOP : *yy = y + h - ysize; break; case FL_ALIGN_BOTTOM : *yy = y; break; case FL_ALIGN_CENTER : default: *yy = y + ( h - ysize ) / 2; break; } } /*************************************** ***************************************/ static void get_align_outside( int align, int x, int y, int w, int h, int xsize, int ysize, int xoff, int yoff, int * xx, int * yy ) { int newx, newy, new_align; fl_get_outside_align( align, x, y, w, h, &new_align, &newx, &newy ); get_align_inside( new_align, newx, newy, w, h, xsize, ysize, xoff, yoff, xx, yy ); } /*************************************** ***************************************/ void fl_get_align_xy( int align, int x, int y, int w, int h, int xsize, int ysize, int xoff, int yoff, int * xx, int * yy ) { ( ( align & FL_ALIGN_INSIDE ) ? get_align_inside : get_align_outside ) ( align, x, y, w, h, xsize, ysize, xoff, yoff, xx, yy ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fd2ps/fd2ps.h0000644000175000017500000002112212201161621012150 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fd2ps.h */ #ifndef FD2PS_H #define FD2PS_H #include "include/forms.h" /* configuration infomation */ typedef struct { FILE * fp; float xdpi, /* screen resolution */ ydpi; int colorps; /* false if grayscale */ int eps; /* true for EPS */ float paper_w, /* default paper size */ paper_h; const char * paper_name; int bw; /* current border width */ int user_bw; /* bw specified on cmdline */ int verbose; int inverted; /* take care of coord switch */ int landscape; /* print version */ int unit; /* unit of measure */ int pages; /* how many pages */ int page; /* current page */ int epsf_import; /* true if importing EPS */ float xscale, yscale; float gamma; /* color adjustment */ int pack, len, lastc, literal; char * rgbfile; int xpmtops_direct; /* internal stuff */ const char * poly_name; /* PS poly name */ } PSInfo; typedef struct { float x, y; } Point; #define MAX_CONTENT 64 /* max browser initialization lines */ #define rgb2gray( r, g, b ) \ ( 0.299 * ( r ) + 0.587 * ( g ) + 0.114 * ( b ) + 0.4 ) /* since we never take interactions with PS device, we can use a * common SPEC to hold all attributes of all types of objects * that have effect on the drawings. */ typedef struct { float ax, /* mapping factor */ bx, ay, by; float xval, yval; float xmin, ymin; float xmax, ymax; float xstep, /* positioner */ ystep; float lstep, /* counter */ sstep; float slsize; /* sliders */ float val; /* */ float max, min; int prec; int int_val; float thetai, thetaf; float origin; int direction; /* pixmap/bitmap stuff */ char * file; int dx, /* alignment margin */ dy; int align; int show_focus; /* slider spec */ int right; float xsl, ysl, wsl, hsl, sbw; int has_sb; int lines, screenlines; char ** content; /* for input & browser */ short * mode; int fontstyle, fontsize; int v_pref, h_pref; } ALLSPEC; #define SPEC ALLSPEC extern PSInfo psinfo, *flps; extern void ps_color(long); /* basic drawing of simple geomtric figures */ extern void ps_draw_init( void ); extern void ps_rectangle( int, float, float, float, float, long ); extern void ps_roundrectangle( int, float, float, float, float, long ); extern void ps_lines( Point *, int, long ); extern void ps_line( float, float, float, float, long ); extern void ps_poly( int, Point *, int, long ); extern int ps_draw_symbol( const char *, float, float, float, float, long ); extern void ps_oval( int, float, float, float, float, long ); extern void ps_pieslice( int fill, float x, float y, float w, float h, int t1, int t2, long col ); extern void ps_circ( int, float, float, float, long ); extern void ps_arc( int fill, float x, float y, float r, int t1, int t2, long col ); extern void ps_set_clipping( int, int, int, int ); extern void ps_unset_clipping( void ); #define ps_rectf( x, y, w, h, c ) ps_rectangle( 1, x, y, w, h, c ) #define ps_rect( x, y, w, h, c ) ps_rectangle( 0, x, y, w, h, c ) extern void ps_draw_box( int, float, float, float, float, long, float ); extern void ps_draw_tbox( int, float, float, float, float, long, float ); extern void ps_draw_frame( int, float, float, float, float, long, int ); extern void ps_draw_checkbox( int, float, float, float, float, long, int ); /* basic text drawing routines */ extern void ps_draw_text( int, float, float, float, float, long, int, int, const char * ); extern void ps_draw_text_beside( int, float, float, float, float, long, int, int, const char * ); extern void ps_text_init( void ); /* FL Object drawing routine */ extern void ps_show_form( FL_FORM * ); extern int load_form_definiation( const char * ); extern char *ul_magic_char; extern char *fl_strdup( const char * ); extern int find_type_val( int, const char * ); extern void ps_invalidate_color_cache( void ); extern void ps_set_linewidth( float, float ); extern void ps_get_linewidth( float *, float * ); extern void ps_reset_linewidth( void ); #define ps_start_lw ps_set_linewidth #define ps_end_lw ps_reset_linewidth extern void set_object_modifier( void ( * )( FL_OBJECT * ) ); extern int fl_get_namedcolor( const char *s ); extern void flps_set_object_shortcut( FL_OBJECT *, const char *, int ); extern void print_version( int ); extern const char *get_version( void ); extern int unit_val(const char *); extern const char *unit_name( int ); extern void ps_log( const char *s ); extern void apply_gamma( float ); extern const char *ascii_date( void ); extern const char *whoami( void ); extern const char *find_class_name( int ); extern int find_class_val( const char * ); extern void ps_set_font( int, int ); extern int load_form_definition( const char * ); int fl_is_inside_lalign( int align ); extern int fl_is_outside_lalign( int align ); extern int fl_is_center_lalign( int align ); extern int fl_to_inside_lalign( int align ); extern int fl_to_outside_lalign( int align ); extern void fl_get_outside_align( int align, int x, int y, int w, int h, int *new_align, int *newx, int *newy ); extern void fl_get_hv_align( int, int *, int * ); extern void draw_bitmap( const char *, float, float, float, float, long, long ); extern int get_gray255( long ); extern void get_scale_unit( int, float *, float * ); extern void draw_xpm( FL_OBJECT * ); extern void fl_query_imap( long col, int *r, int *g, int *b ); extern void get_paper_size( const char *, float *, float * ); extern void list_papers( const char * ); extern void ps_invalidate_font_cache( void ); extern void emit_epsf_import_command( void ); extern FL_OBJECT *flps_make_object( int, int, int, int, int, int, const char *, void * ); #define PS_SPECIAL( c ) ( c == '(' || c == ')' \ || c == '[' || c == ']' \ || c == ' ' || c == '<' \ || c == '>' || c == '%' \ || c == '#' || c == '/' ) extern void ps_output( const char *, ... ); extern void ps_verbatim( const char *, ... ); #define ISBUTTON( cls ) \ ( cls == FL_BUTTON || cls == FL_LIGHTBUTTON \ || cls == FL_CHECKBUTTON || cls == FL_ROUNDBUTTON \ || cls == FL_ROUND3DBUTTON || cls == FL_PIXMAPBUTTON \ || cls == FL_BITMAPBUTTON || cls == FL_SCROLLBUTTON \ || cls == FL_LABELBUTTON ) #define ISCHOICE( cls ) \ ( cls == FL_CHOICE || cls == FL_MENU || cls == FL_BROWSER ) extern int xpmtops_direct( const char *, int, int, long ); typedef struct { int red, green, blue, alpha; char key[ 4 ]; char name[ 32 ]; } fd2psCMAP; extern int image2colorps( short *, int, int, fd2psCMAP *, int, const char * ); extern int image2grayps( short *, int, int, fd2psCMAP *, int, const char * ); extern char *ps_literal( const char * ); #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fd2ps/Readme0000644000175000017500000000013311665175512012121 00000000000000 fd2ps is a program that translates the fdesign output (.fd files) into a postscript file. xforms-1.2.4/libforms.spec0000664000175000017500000001630112353624204012452 00000000000000# The original name of the software package is 'xforms' but the # rpm packages go by the name 'libforms' in all distros. We need # the original name in some situations. %define origname xforms # Building a debug package doesn't seem to make too much sense %define debug_package %{nil} # Here we start... Summary: XForms library Name: libforms Version: 1.2.4 Release: 1%{?dist} Source0: %{name}-%{version}.tar.gz License: LGPLv2+ Group: Development/Libraries # To build the libraries we need the libXpm and libjpeg development # packages (which in turn depend on the corresponding library packages) BuildRequires: libXpm-devel BuildRequires: libjpeg-devel BuildRequires: mesa-libGL-devel BuildRoot: %{_tmppath}/%{name}-buildroot Prefix: %{_prefix} URL: http://xforms-toolkit.org/ %description This is a GUI toolkit based on the X library for X Window Systems. It features a rich set of objects, such as buttons, sliders, and menus etc. integrated into an easy and efficient object/event callback execution model that allows fast and easy construction of X-applications. In addition, the library is extensible and new objects can easily be created and added to the library. # Beside the normal package create a "development" package, containing # the header files for the three libraries, the static versions of the # libraries and the fdesign and fd2ps programs. %package devel Summary: Header files and tools Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel Header files, tools and static libraries for development with XForms. # Also create a documentation package with the full documentation in # info, HTML and PDF format. This is an architecture-independent # package. # # Note: older rpmbuild versions get very unhappy when you try to build # a 'noarch' sub-package together with architecture-dependent packages, # spitting out weird error messages and refusing to build the package, # so use 'noarch' only with newer versions of rpmbuild. %package doc Summary: XForms documentation Group: Development/Libraries Requires(post): info Requires(preun): info BuildRequires: texi2html BuildRequires: texinfo BuildRequires: texinfo-tex BuildRequires: ImageMagick %if 0%{?fedora} >= 10 || 0%{?rhel} >= 6 || 0%{?centos} >= 6 || 0%{?suse_version} >= 1230 BuildArch: noarch %endif %description doc Info, HTML, PDF documentation and demo programs for XForms. # Copy and unpack the tar-ball %prep %setup -q # Build everything ('make' can be done in parallel) %build ./configure --prefix=%{_prefix} \ --mandir=%{_mandir} \ --bindir=%{_bindir} \ --libdir=%{_libdir} \ --infodir=%{_infodir} \ --htmldir=%{_docdir}/%{name}/html \ --pdfdir=%{_docdir}/%{name} \ --enable-docs \ --disable-demos \ --disable-warnings \ --disable-debug \ --enable-optimization=-O2 make %{?_smp_mflags} rm -rf demos/.deps # Clear out the {buildroot} and install everything in {buildroot}, # then apply the following tweaks: # 1) Delete the dir file from {_infodir}, it's not to be distributed # and gets created (or updated) during installation on the target # machine. # 2) Strip the fdesign and fd2ps programs # 3) Copy the directory with the demo programs to the documentation # directory # 4) Create a symbolic link from the xforms.5 man page to libforms.5 # (do that in a sub-process to avoid changing the working directory). %install rm -rf %{buildroot} install -d -m 755 %{buildroot} make DESTDIR=%{buildroot} install rm -f %{buildroot}%{_infodir}/dir /usr/bin/strip %{buildroot}%{_libdir}/*.so.*.*.* /usr/bin/strip %{buildroot}%{_bindir}/* cp -r %{_builddir}/%{name}-%{version}/demos %{buildroot}%{_docdir}/%{name} `cd %{buildroot}%{_mandir}/man5 && ln -s %{origname}.5.gz %{name}.5.gz` %clean rm -rf %{buildroot} # Set up list of files in the binary package: just the libraries and the # man page for the libforms library. %files %{_libdir}/*.so.* %{_mandir}/man5/* %defattr(-,root,root) %doc COPYING.LIB Copyright ChangeLog README # Set up list of files going into the development package: header files, # static libraries, utility programs and their man pages %files devel %{_bindir}/* %{_includedir}/* %{_libdir}/*.so %{_libdir}/*.a %{_libdir}/*.la %{_mandir}/man1/* %defattr(-,root,root) # Set up list of files distributed with the documentation package: # info, HTML, PDF documentation and demo programs %files doc %{_docdir}/%{name}/* %{_infodir}/* %defattr(-,root,root) # Run ldconfig after install on the target machine to make the dynamic # linker aware of the new libraries %post /sbin/ldconfig # Run ldconfig after deinstall on the target machine of libraries %postun /sbin/ldconfig # Update the info dir file and undo the compression that rpmbuild # has applied to the image files below {_infodir} (these are image # file for use by emacs' info mode and can't be read when gzip'ed). %post doc /sbin/install-info %{_infodir}/%{origname}.info %{_infodir}/dir || : gunzip %{_infodir}/%{origname}_images/*.png.gz # Before uninstalling remove the entry for the XForms info file from # the dir file in {_infdir}. Also gzip the image files again because # that's what they were during installation %preun doc if [ $1 = 0 ] ; then /sbin/install-info --delete %{_infodir}/%{origname}.info %{_infodir}/dir || : gzip %{_infodir}/%{origname}_images/*.png fi %changelog * Sat Dec 21 2013 Jens Thoms Toerring 1.1.2.0-1 - spec file mostly rewritten for new 1.2.0 release, resulting packages now have a name starting with 'libforms' * Thu Jun 1 2010 Jens Thoms Toerring 1.0.93sp1 - New release 1.0.93sp1 * Wed Nov 4 2009 Jens Thoms Toerring 1.0.93sp1 - New release 1.0.91sp2 * Sat Nov 22 2008 Jens Thoms Toerring 1.0.91 - New release 1.0.91 - lots of bug fixes * Wed Oct 6 2004 Angus Leeming 1.0.90 - Re-write the 'post' and 'postun' scripts to create the symbolic links correctly without requiring the SO_VERSION hack. * Fri May 7 2004 Angus Leeming 1.0.90 - add code to the 'post' script to modify libforms.la et al. to prevent libtool from complaining that the files have been moved. * Thu May 6 2004 Angus Leeming 1.0.90 - fix 'Release' and 'Source0' info. - add 'post' and 'postun' scripts to create and remove symbolic links, respectively. * Thu May 6 2004 Angus Leeming 1.0.90 - no longer place devfiles and binfiles in ${RPM_BUILD_ROOT}. Prevents rpm from bombing with a "Checking for unpackaged files" error. * Sat Aug 31 2002 Duncan Haldane 1.0-RC4 - mv fdesign, fd2ps to devel. restore xforms name of rpm. * Sun Jul 14 2002 Greg Hosler 1.0-RC4 - Pass DESTDIR to makeinstall_std. * Thu Jul 11 2002 Peter Galbraith 1.0-RC4 - Move from libxforms to libforms to match other distros. * Tue Jul 8 2002 Chris Freeze 1.0-RC4 - First stab at spec file. xforms-1.2.4/ChangeLog0000664000175000017500000033004412353623325011541 000000000000002014-06-12 Jens Thoms Toerring * lib/forms.c: an object that isn't visible could become the focus object, which was an insidious bug:-( 2014-06-07 Jens Thoms Toerring * Lots of minor corrections 2014-06-04 Jens Thoms Toerring * lib/input.c: some more corrections. 2014-06-02 Jens Thoms Toerring * lib/input.c: Attempt to fix bugs and inconsistencies reported by Lucas Sköldqvist. 2014-05-24 Jens Thoms Toerring * lib.bitmaps/colorwheel.xpm: number of colors reduced since this bitmap alone was resposible for over a third of the size of the tar ball. 2014-05-23 Jens Thoms Toerring * lib/goodie_colchooser.c: new goodie for picking arbitrary colors interactively added. 2014-05-23 Jens Thoms Toerring * lib/positioner.c: major changes: range of values can now be controlled via a validation function. New functions for setting both alues at once and getting the current boundary settings. Drawing now is done differently (instead of XOR current background is stored and redrawn). Mouse is hidden while over positioner and active. 2014-05-22 Jens Thoms Toerring * lib/positioner.c: step values are now also factored in when a new x- or y-value gets set by the user. 2014-05-14 Jens Thoms Toerring * lib/spinner.c: Bug in handling of FL_FLOAT_SPINNER fixed. 2014-05-06 Jens Thoms Toerring * lib/xyplot.c: fl_set_xyplot_mouse_buttons() and fl_get_xyplot_mouse_buttons() added and clean-up of code to fix memory leaks. 2014-04-28 Jens Thoms Toerring * lib/slider.c: Function for selecting mouse buttons added. * lib/input.c: Validator for dates improved 2014-04-26 Jens Thoms Toerring * lib/input.c: Further bug fixes and code simplifications 2014-04-25 Jens Thoms Toerring * lib/input.c: Bugs found by Lucas Sköldqvist in input objects (hopefully) fixed. 2014-04-12 Jens Thoms Toerring * lib/fonts.c: Bug in font caching code, found by "Sunny", that could result in crashes fixed. 2014-03-27 Jens Thoms Toerring * Some minor fixes for object label alignment 2014-03-25 Jens Thoms Toerring * */Makefile.am: Removed '-Wl,--no-undefined' since this linker flag is not available everywhere * lib/flinternal.h: Removed stupid definition of variables - thanks go to André Ludwig for noticing the problem. 2014-03-19 Jens Thoms Toerring * lib/objects.c: Another attempt at speeding-up redraws 2014-03-18 Jens Thoms Toerring * lib/objects.c: Speed-up for redraws 2014-03-12 Jens Thoms Toerring * lib/menu.c: Fix by Lothar Esser added for bug in menu handling. 2014-01-15 Jens Thoms Toerring * lib/xyplot.c: Bug reported by Arie van Wettum fixed. 2014-01-14 Jens Thoms Toerring * lib/events.c: Newer Gnome desktop versions send a seemingly bogus _XIM_PROTOCOL message (for a window we never opened) that resulted in fl_do_forms() re- turning prematurely. 2014-01-05 Jens Thoms Toerring * lib/xyplot.c: Stupid bug fixed that could crash the program when using an xyplot object. * lib/forms.c, lib/object.c: Handling of coordinates after call of fl_flip_yorigin() wasn't correct. 2014-01-02 Jens Thoms Toerring * Final corrections for new 1.2.0 release 2013-12-30 Jens Thoms Toerring * fdesign: Bug found by Werner Heisch fixed when editing several objects at once fixed (all got the same label string). Also bug in reset of spinner after testing removed. 2013-12-27 Jens Thoms Toerring * libforms.spec.in: Check added if noarch package can be build of the documentation for (open)SUSE. Removed build dependencies on libXpm and libjpeg packages, which are already required by the libXpm-devel and libjpeg-devel packages we depend on. Also added 'mesa-libGL-devel' as another build dependency (otherwise libformsGL isn't contained in the RPM). 2013-12-22 Jens Thoms Toerring * libforms.spec.in, Makefile.am: Lots of changes to cleanly build rpm packages (with name 'libforms') 2013-12-17 Jens Thoms Toerring * fdesign: Bug found by Serge Bromow with saving files fixed. * xforms.spec.in: Patch from Russ Herrold applied. 2013-12-15 Jens Thoms Toerring * A number of further tweaks to the build system to make sure that it also works on older systens (tested CentOS 5) applied. An installed version of libtool is now required for generating the package from scratch (i.e. with the 'autogen.sh' script). * A few things related to the build system issues in fdesign have been fixed. 2013-12-13 Jens Thoms Toerring * Bug fixes in fdesign: Some xpm files weren't read in and editing choice/menu/browser object attributes could crash the program * Changes to build system to avoid recompilations on install * Clean-up of code after check with clang static analyzer 2013-12-09 Jens Thoms Toerring * fdesign: Applied a patch Serge Bromow created to add a '-migrate' option to fdesign * Thanks to a suggestion from David Binderman all code was checked with the 'cppcheck' static checking tool, which resulted in finding several bugs and improvements in the code with respect to readability. 2013-12-04 Jens Thoms Toerring * fdesign: Minor display bug reported by Segre Bromow fixed * docs: Thanks to Michal Szymanski PDF documentation can now also be build on systems with older texi2dvi versions * Clean-up: Several functions declared in public header files but which were either not present or only meant for internal use removed, other functions documented. 2013-12-01 Jens Thoms Toerring * lib/objects.c: Bug fix in fl_set_obkject_resize() * fdesign: Several bug fixes * build system: Fixes for creation of documentation to allow build with older texi2dvi versions 2013-11-25 Jens Thoms Toerring * Bug fixes and documentation update for new 1.0.94pre22 pre-release. 2013-11-23 Jens Thoms Toerring * lib: for quite a number of functions taking a string as their last argument there's now another version with the same name but with '_f' appended that allows to pass the function a printf()-like format srring, followed by the appropriate number of arguments. * fdesign: editing object attributes has gotten a rework, it now hopefully works more consistently (and, in some cases, correctly;-) 2013-11-07 Jens Thoms Toerring * lib/input.c: Bug in validator for float inputs fixed that allowed entering a number followed by a char other than 'e' or 'E'. * lib/dial.c: Functions added for obtaining the settings for the dial angles, step size and direction 2013-11-05 Jens Thoms Toerring Addition of several functions that instead of accepting just a string expect a printf()-like format string and and an unspecified number of arguments, from which the string is constructed. All these functions have the same name as their simpler counterpart but with an "_f" added at the end. 2013-11-01 Jens Thoms Toerring Further changes to build system to check for availability of tools required for creating the documentation 2013-10-31 Jens Thoms Toerring Changes in the build system, mostly for automatic build and installation of documentation 2013-10-30 Jens Thoms Toerring * src/slider.c etc.: new slider types FL_VERT_PROGRESS_BAR and FL_HOR_PROGRESS_BAR added * src/choice.c, src/xpopup(): new function fl_set_choice_align_bottom() and fl_setpup_align_bottom() added. 2013-08-17 Jens Thoms Toerring * fdesign: small fixes of some inconsistencies 2013-08-13 Jens Thoms Toerring * lib/browser.c etc.: New type FL_DESELECTABLE_HOLD_BROWSER added. * fdesign: Some more bug fixes and cleanup for consistency of handling. 2013-08-13 Jens Thoms Toerring * lib/xyplot.c: Logarithmically spaces minor tic added aa suggested by Bill Unruh and minor bug fixes 2013-08-12 Jens Thoms Toerring * fdesign: Some more bug fixes and modification of tge control panel layout. Documentation update. 2013-08-11 Jens Thoms Toerring * fdesign: Bug fixes in handling of group cutting/pasting 2013-08-10 Jens Thoms Toerring * fdesign: Included Paul Nichelsons patch for reading .fd files with xyplot objects. 2013-08-09 Jens Thoms Toerring * lib/tabfolder.c: Problem with setting graphic properties of the tab riders infividually ad all at once pointed out by Rob Carpenter hopefully fixed. * lib/objects.c: Slow down of fl_unfreeze_form() due to the fli_recalc_interactions function noticed by Rob Carpenter whle not completely eliminated hopefully made less noticable. * fd2ps/psobj.c: Support for FL_SPINNER added * fdesign: Inconsistencies in handling of path names pointed out by Donato Lorenzo López hopefully fixed. 2013-01-05 Jens Thoms Toerring * fdesign/fd_select.c: Cutting/copying whole groups didn't work properly, now only the members of the group get copied/cut, but not the property of belonging to a group. 2013-01-04 Jens Thoms Toerring * fdesign/fd_select.c: Raising and lowering objects didn't work properly * fdesign/fd_control.c: Store and reset button state before and after test. * autogen.sh: Cleanup 2013-01-03 Jens Thoms Toerring * fdesign/fd_select.c: Ungrouping didn't work properly since also all members of the group got deleted *fdesign/fd_main.c: As proposed by Michal Szymanski a left double clock on an object brings up the attribute dialog, while deleting is done via right double click. * lib/fselect.c: if a default file is passed to fl_show_file_selctor() it's now shown centered in the browser (and you don't have to strip the path from the file name for that t work) * lib/objects.c: Adding a composite object to a reopened group didn't work, hopefully fixed. 2013-01-02 Jens Thoms Toerring * lib/input.c: New function fl_set_input_mode() added according to proposal by Serge Bromow. * lib/objects.c: Don't show tooltip while object is de- activated as proposed by Serge Bromow. * fdesign/fd_main.c, fd_names.c: as Serge Bromow noticed fdesign didn't ork correctly in '-convert' mode when lots of files were converted at once by the same instance of the program - hopefully fixed that. 2012-12-30 Jens Thoms Toerring * lib/tbox.c: made browser not react to keyboard input when deactivated (to be consistent with the fact that a browser also doesn't resond to mouse events under that condition) - thanks to Serge Bromow for making me aware of this issue * lib/imput.c: Fixed another bug Serge pointed out: when pressing the or button on single-line input objects strange things happend. Fix was to do nothing in fl_set_input_topline() for that kind of objects. 2012-12-26 Jens Thoms Toerring * lib/objects.c (and some other file): Lots of changes to the way things are redrawn in order to fix bugs and speed up things * lib/flresource.c: Rare problem about a BadWindow error in initialization of the library fixed * fdesign/fd_file.c: Reading the label style from an .fd file didn't work properly * config/libtool.m4 and ltmain.sh: Use newest files from the libtools package 2012-12-08 Jens Thoms Toerring * doc/part1_goodies.texi: Small documentation improvement. 2012-11-29 Jens Thoms Toerring * lib/xyplot.c: Bug in postioning of x-axis after a resize, reported by Michal Szymanski, fixed. 2012-11-04 Jens Thoms Toerring * lib/spinner.c: Bug reported by Sian Mountbatten fixed that led to two invocations of a spinner's callback when one of the buttons was clicked. 2012-07-20 Jens Thoms Toerring * lib/xdraw.c, include/XBasic.h: fl_circ() and fl_xircf() macros replaced by functions, fl_circbound() added. Also fl_arc() and fl_arcf() macros replaced by functions. Documentation updated - thanks to Rouben Rostamian for pointing out several problems. 2012-07-04 Jens Thoms Toerring A bit of clean-up for new pre-release 2012-07-02 Jens Thoms Toerring * lib/objects.c: Attempt to avoid a massive slow-down observed by Rob Carpenter while creating and deleting forms due to much too many calls of fli_recalc_intersections(). * lib/button.c: Some mis-handling of mouse buttons a button isn't supposed to react to found by Rob fixed. lib/formbrowser.c: Some problem resulting in infinite recursion fixed. 2012-06-12 Jens Thoms Toerring * lib/tbox.c: Problem poinyed out by Rob Carpenter with fl_addto_browser_chars() when first seting an "escape sequence" and then text (which resulted in the effects of the escape sequence getting lost) fixed. 2012-04-12 Jens Thoms Toerring * lib/xtext.c: Problem when drawing strings with zero or negative "height" fixed * lib/positioner.c: Function for selecting which mouse a positioner reacts to added * lib/button.c: Button now reacts only to the release of the mouse button that was pressed first on it 2012-03-25 Jens Thoms Toerring * lib/xtext.c: Added fl_get_label_char_at_mouse() function and new demo program 'strange_button.c'. * lib/events.c, lib/handling.c: Added new function fl_current_event() that allows callbacks to determine the Xforms event they were called for (instead of the raw XEvent as it can be obtained with fl_last_event()). 2012-03-24 Jens Thoms Toerring * lib/xtext.c, lib/input.c: Clean-up in string drawing routine (and detection of mouse position in a string) - labels are now more properly positioned. 2012-03-21 Jens Thoms Toerring * lib/symbols.c: Simplifications (control sequences are now more powerful and the order is unimportant) and new function for removing symbols. * lib/vstrcat.c: Removed the file after rewriting the only function in lib/errmsg.c that used anything from that file. * lib/objects.c: Changed signature of fl_get_object_bw() to match the documentation (it now returns an int and takes only a single argument). * lib/box.c: Boxes of type FL_NO_BOX and FL_FLAT_BOX now have a border width of 0. * lib/objects.c: attempt to speed up the detection of overlap between objects. 2012-03-19 Jens Thoms Toerring * lib/objects.c, lib/forms.c: Several changes to speed up redraw, thanks to Werner Heisch noticing the problem. Function for setting form background color added. * lib/handling.c: when in a callback e.g. for a browser a new window was opened was under the mouse the browser didn't receive the correct coordinates on mouse release as Werner Heisch noticed. * lib/align.c: Cleanup of code for label alignments and some new functions added (this resulted also in lot of minor changes in other files). 2012-03-12 Jens Thoms Toerring * lib/xdraw.c: Code cleanup for handling of clipping, several new functions added for that. * lib/tbox.c: Drawing outside the object disabled, thanks to Sian Mountbatten for reportimg the problem and Paul Nicholson for analyzing its causes. * lib/handling.c: Bug that appeared when in the callback of a browswer a new window was created, that led to inconsistencies in the original browser hopefully fixed. Thanks to Werner Heisch for finding this strange problem!x 2011-11-17 Jens Thoms Toerring * lib/button.c: Bug pointed out by Michal Szymanski on resetting radio buttons fixed. 2011-11-06 Jens Thoms Toerring * lib/flresource.c: Previous change that made double buffering the default for forms reverted. 2011-10-06 Jens Thoms Toerring * xyplot.c: Drawing bug when fl_set_xyplot_fixed_xaxis() or fl_set_xyplot_fixed_yaxis() had been used and pointed out by Alessandro Basili hopefully fixed. 2011-10-01 Jens Thoms Toerring * Bits of code cleanup in preparation for new pre-release and removal of a bug introduced a few commits earlier. 2011-09-28 Jens Thoms Toerring * lib/xyplot.c: memory leak in fl_set_xyplot_alphatic() found by Alessandro Basili fixed. 2011-09-24 Jens Thoms Toerring * fdesign/fd_select.c: Bug in undo of alignment fixed. * demos/yesno.c, demos/yesno_cb.c: Changed them to have them behave exactly identical. 2011-09-11 Jens Thoms Toerring * Several corrections for problems pointed out by Donato Lorenzo that resulted in problems when building with aCC on HP-UX and of which some might have led to memory corruption (calls of calloc() with sizeof(void) which gcc doesn't complain about). * lib/handling.c: Guard added to avoid an idle callback accidentally being called from within itself. 2011-08-11 Jens Thoms Toerring * lib/input.c, lib/include/input.h: Changes tp the default behavior of the edit keys. Old behavior can be obtained via the '--enable-classic-editkeys' option to 'configure'. 2011-05-21 Jens Thoms Toerring * lib/xyplot.c: Two new public functions added: fl_get_xyplot_screen_area() and fl_get_xyplot_woorld_area() Also a number of bug fixes for double buffered drawing and concerning the displayed axes. 2011-01-01 Jens Thoms Toerring * lib/include/Basic.h: Small change as proposed by LukenShiro 2010-12-31 Jens Thoms Toerring * lib/button.c: Fixed bug that made buttons on which the wrong mouse button was released, seem to have been released. 2010-12-29 Jens Thoms Toerring * fdesign/fd_file.c: Changed the input function to accept .fd files so that for pseudo-objects of type FL_BEGIN_GROUP and FL_END_GROUP no more than a single line with the class name is required. * fdesign/fd_file.c, fd_main.h: Change of .fd file to avoid writing out useless informantion for FL_BEGIN_GROUP and FL_END_GROUP and to have object type names start also with 'FL_'. "Magic" number of .fd file bumped up to 15000. * fd2ps/load.c: Changes to make fd2ps work with the new layout of the .fd files * fdesign/fd_attributes.c: Fixed a bug pointed out by LukenShiro that resulted in garbage appearing in an objects label with a shortcut when the type of the object got changed. 2010-12-20 Jens Thoms Toerring * lib/part5_resources.texi: Wrong signature of fl_get_app_resources() as pointed out by LukenShiro corrected. * lib/xsupport.c: Strange returned string in (undocumented function) fl_vclass_name() on invalid argument changed to something hopefully more reasonable (bug found by LukenShiro) * lib/xdraw.c, doc/part5_drawing_obects.texi: As LukenShiro pointed out fl_dashedlinestyle() will fail with BadValue Xlib error when the first argument ontains '\0' characters. In that case no also the default dash pattern is set instead. 2010-12-18 Jens Thoms Toerring * lib/include/tabfolder.h, doc/part3_container_objects.texi: Declaration of fl_get_tabfolder_offset() added and description of both fl_get_tabfolder_offset() and fl_set_tabfolder_offset() which as LukenShiro noted was missing./ * doc/part5_useful_function.texi: Corrections to the descriptions of fl_iconify() and flwinresize() as proposed by LukeShiro. 2010-12-14 Jens Thoms Toerring * lib/win.c, lib/flcolor.c, doc/part4_drawing_objects.texi: In some places there was a mix-up between FL_COLOR and 'unsigned long' as LukenShiro pointed out. While this has no direct consequences it obscures the distinction between XForms colors and the colors the X server kows about. 2010-12-12 Jens Thoms Toerring lib/version.c: fl_library_full_version() function added as sugested by LukenShiro. 2010-12-06 Jens Thoms Toerring * lib/input.c: Bug removed that kept a multi-line input object to return (or invloe a callback) under the requested circumstances. Thanks to Eberhard Kuemmerle for pointing out the problem and submitting a patch. * lib/button.c: As Michal Szymanski pointed out the fl_set_button() function didn't work as described in the documentation for radio buttons (it did either lead to the button object getting returned to the program or an associated callback to be called). Hopefully fixed. * lib/xyplot.c: Marcus D. Leech reported problems with xyplot objects of type FL_ACTIVE_XYPLOT when using double buffering. For the time being (as a temporary fix) double buffering is disabled for such objects. 2010-10-28 Jens Thoms Toerring * fdesign/fd_printC.c: Changed the output format so that the resulting C files also compile with C++ compilers (cast of return value of fd_malloc() needed). Thanks to John Wang for pointing out the problem. 2010-10-18 Jens Thoms Toerring * lib/select.c: Memory allocation bug found by Luis Balona removed. 2010-08-01 Jens Thoms Toerring * doc/part3_choice_objects.texi, doc/part3_valuatorobjects.texi: Added documentation for functions to set the repeat rate for sliders and browser scrollbars. 2010-06-20 Jens Thoms Toerring * lib/slider.c: Doubled the time we wait immediately after a mouse button has pressed in a slider "through" to give the user more time to release the button before "jumping" sets in. * lib/objects.c: Recognition of "^[" as meaning the key as shortcut key was broken. * lib/fselect.c: When a callnback is set for a file selector now has the same function as a double-click. "Dismiss" button was renamed "Close" and now has shortcut keys. * lib/browser.c: Added function proposed by Michal Szymanski that allows to set the speed with which the browsers scroll- bar "jump". 2010-06-13 Jens Thoms Toerring * lib/tabfolder.c: Serge Bromow found that under Gnome the contents of a tabfolder weren't positioned correctly, hopefully fixed. * lib/input.c, xtext.c: As serge Bromow pointed out selection was not always drawn correctly if the text in an input object was longer than the width of the object. 2010-05-24 Jens Thoms Toerring * lib/spinner.c: Werner Heisch found a bug in the float spinner that kept the user from editing the value. 2010-05-23 Jens Thoms Toerring * lib/flinternals.h, browser.c, objects.c, input.c: Moved duplicate code in brower and input module into a function in objects.c. 2010-05-22 Jens Thoms Toerring * doc: Paul Nicholson put a lot of work into correcting all kinds of issue with the documentation! * lib/input.c: in some situations in a multi-line input object parts of the scrollbar were drawn even though no scrollbars were suposed to be shown. * lib/xyplot.c: Active xyplot was broken. * lib/box.c: If label is inside of box it's now clipped to the inside of the box and never draws outside of it. 2010-05-21 Jens Thoms Toerring * doc: Many spelling errors etc. removed that Paul Nicholson had pointed out. * fdesign: deprecated values from alignment label menu in the form for editing object attributes removed. * lib/forms.c: Bug with resizing scrollbars on resize of form that Paul Nicholson pointed out fixed. * fdesign/fd_attribs.c: Another bug found by Paul Nicholson: when in changing the type of an object with childs and then undoing the change immediately ("Attributes" form still open and clicking "Cancel") fdesign crashed. Hopefully fixed now. 2010-05-19 Jens Thoms Toerring * fdesign: Minor changes (mostly to fd/ui_theforms.fd) to get rid of annoying flicker in the control window when adding a new object in the other window. 2010-05-18 Jens Thoms Toerring lib/objects.c: Another bug found by Serge Bromow fixed: shortcuts with ALT key had stopped to work. 2010-05-17 Jens Thoms Toerring * lib/tbox.c: As Serge Bromow pointed out in the functions fl_set_browser_topline(), fl_set_browser_bottomline() and fl_set_browser_centerline() there was a missing check for the browser being empty, resulting in dereferencing a NULL pointer. 2010-05-15 Jens Thoms Toerring * lib/handling.c, lib/include/Basic.h: After intensive discussions with Serge Bromow added new funtion that allows to switch back to the pre-1.0.91 behavior concerning when an interaction with an input object is considered to have ended. 2010-05-07 Jens Thoms Toerring * lib/tbox.c: As Marcus D. Leech pointed out setting colors for a browser via fl_set_object_color() didn't work for the font color (always black), hopefully fixed * doc/part6_images.texi: Some more typos etc. found by LukenShiro removed 2010-05-05 Jens Thoms Toerring * doc/part6_images.texi: A number of typos etc. found by LukenShiro removed. 2010-05-04 Jens Thoms Toerring * image/image.c: LukenShiro pointed out a deviation between the diocumented return type of the flimage_free() function. It now returns void as already documented. * lib/font.c: Fix for (rather hypothetical buffer) overrun in get_fname(). 2010-03-14 Jens Thoms Toerring * clipboard.c: Converted error message into warning printed out when a selectio request is made to the XForms program for a type of Atom that XForms doesn't support. Thanks to Mark Adler for pointing out the problem. 2010-03-09 Jens Thoms Toerring * Several changes to the way things redrawn - there were some problems with redrawing labels that needed several changes to get it right (again). * Some unused stuff removed from include files * Corrections in the documentation 2010-01-09 Jens Thoms Toerring * Lots of clean-up in header files to address inconsistencies (and in some cases also function prototypes had to be changed) as pointed out by LukenShiro. * lib/input.c: Bug with return behaviour of FL_MULTI_INPUT objects fixed. * lib/popup.c, lib/nmenu.c: Functions added for adding and modifying popup entries using a FL_POPUP_ITEM added. * lib/objects.c: Several getter functions for object properties added * gl/glcanvas.c: Bug about missing requested event and pointed out by Dave Strang fixed. 2009-12-21 Jens Thoms Toerring Some problems with new forms.h pointed out by Lukenshiro and Luis Balona cleaned up. 2009-12-14 Jens Thoms Toerring Some more clean-up in header files (and documentation) 2009-12-13 Jens Thoms Toerring demos/thumbwheel.c: Bug fixed as pointed out by LukeShiro images/flimage.h: Removed useless declaration of fl_basename() as proposed by LukenShiro several include files: Removed useless members from a number of structures and enums, adjusted return types of a few functions to fit the documentation, all as part of the clean up for the new SO version since this just th right moment to get rid of garbage. 2009-11-30 Jens Thoms Toerring * configure.ac: Updated SO_VERSION since the library isn't compatible anymore with the 1.0.90 release and this lead to trouble for Debian (at least). * lib/spinner.c, lib/handling.c: Updates to eliminate a bug detected by Werner Heisch that kept spinner objects from working correctly if they are the only input object in a form. 2009-11-23 Jens Thoms Toerring * lib/fselect.c: Improved algorithm for finding file to be shown selected on changes of input field 2009-11-20 Jens Thoms Toerring * lib/positioner lib/include/positioner.h: Added a new type of positioner (FL_INVISIBLE_POSITIONER) that's completely invisible to put on top of other objects. The idea for that came from Werner Heisch. * fdesign/fd_superspec.c: Werner Heisch found that changing copied menu and choice object entries also change the ones of the object copied from. Bug hopefully fixed. * lib/fselect.c: When entering text into the input object of a file selector now a fitting file/directory (if one exists) will now be selected automatically in the browser. 2009-11-03 Jens Thoms Toerring lib/xyplot.c: As Jussi Elorante noticed posthandlers didn't work with XYPLOT objects. This now should be fixed. Peter S. Galbraith pointed out that building the documen- tation in info format didn't work properly. 2009-09-21 Jens Thoms Toerring * fdesign/fd_forms.c, fdesign/fd_groups.c, fdesign/fd_super.c: Two bugs in fdesign, found by Werner Heisch, removed. 2009-09-20 Jens Thoms Toerring Minor corrections in the documentation. 2009-09-16 Jens Thoms Toerring * lib/include/Basic.h: Removed a nonexistent color that had made it into the list of colors as Werner Heisch pointed out. 2009-09-15 Jens Thoms Toerring * lib/events.c: general callbacks for events for user generated windows weren't called anymore, repaired. * lib/include/xpopup.h: Broken define Rouben Rostamian found for the fl_setpup_default_checkcolor() repaired. 2009-09-14 Jens Thoms Toerring * lib/thumwheel.c, lib/validator.c: Fixed return behaviour of thumbwheel. 2009-09-13 Jens Thoms Toerring * lib/input.c: Further problems with beep and input objects removed. 2009-09-12 Jens Thoms Toerring * fdesign/sp_spinner.c: Added forgotten output to C file for setting colors and text size and style. * lib/input.c: Removed beep on valid input into FL_INT_INPUT and FL_FLOAT_INPUT objects. 2009-09-11 Jens Thoms Toerring * lib/flcolor.c, lib/include/Basic.h: New pre-defined colors added as proposed and assembled by Rob Carpenter. * lib/spinner.c: Corrections to return behaviour of spinner objects as pointed out by Werner Heisch. 2009-09-08 Jens Thoms Toerring * lib/input.c: Bug in copy-and-paste and found by Werner Heisch repaired. * lib/include/zzz.h: defines of 'TRUE' and 'FALSE' relaced by 'FL_TRUE' and 'FL_FALSE' to avoid problems for other programs that may define them on their own (thanks to Serge Bromow for pointing out that this can be a real problem). 2009-09-06 Jens Thoms Toerring Some more bugs in fdesign, found by Werner Heisch, removed. Most important: bitmaps weren't drawn correctly. * lib/bitmap.c: fl_set_bitmapbutton_file() removed, is now an alias for fl_set_bitmap_file() * lib/sysdep.c: fl_now() doesn't add a trailing '\n' anymore 2009-09-05 Jens Thoms Toerring Several bugs reported by Werner Heisch in fdesign fixed. Input of form and group names is now checked for being a valid C identifier. 2009-09-03 Jens Thoms Toerring * lib/util.c: Removed function fli_get_string() which was just a duplication of fli_print_to_string() 2009-09-01 Jens Thoms Toerring Tabs replaced by spaces. Repairs to fd2ps that had stopped working (output doesn't look too nice yet, changing that will probably take quite a bit of work...) 2009-08-30 Jens Thoms Toerring Support for spinner objects built into fdesign. 2009-08-28 Jens Thoms Toerring Dependence of form size on snap grid setting in fdesign removed since it led to unpleasant effects under KDE, form size can now be set directly via a popup window. Some more bugs with new way of reading .fd files removed. * lib/browser.c: Missing redraw of scrollbar added in fl_show_browser_line() (thanks to Werner Heisch for noticing and telling me about it), 2009-08-26 Jens Thoms Toerring * README: updated to reflect new mailing list location and homepage 2009-08-25 Jens Thoms Toerring A number of bugs in the new code for reading in .fd-Files pointed out by Werder Heisch have been removed. 2009-08-22 Jens Thoms Toerring Thanks to lots of input (patches and discussions) by Werner Heisch the way .fd files get read in and analyzed has been changed to be a lot more liberal of what is accepted as well as spitting out reasonable error messages and warnings if things go awry. New files added are fdesign/fd_file_fun.c and fdesign/sp_util.c and lots of others have been changed. 2009-08-13 Jens Thoms Toerring * fdesign/fd_printC.c: Some corrections/bug fixes * Bit of clean-up all over the place;-) 2009-08-06 Jens Thoms Toerring * lib/Makefile.am, gl/Makefile.am, image/Makefile.am: Applied patch send by Rex Dieter that changes the way the dynamic libraries get created so that linking explicitely against libX11.so and ibXpm.so (and possibly others) isn't necessary anymore when linking against libforms.so. 2009-07-12 Jens Thoms Toerring * lib/objects.c: Bug in convertion of string to shortcut characters removed 2009-07-11 Jens Thoms Toerring * Bit of cleanup of error handling 2009-07-10 Jens Thoms Toerring * lib/forms.c: Forms.c split into two, forms.c and handling.c 2009-07-09 Jens Thoms Toerring * lib/events.c: Bug found by Werner Heisch when using fdesign under KDE/Gnome removed 2009-07-05 Jens Thoms Toerring * lib/forms.c: Hack added to correct drawing of formbrowser objects * lib/input.c: Cursor was sometimes not drawn at the correct position 2009-07-05 Jens Thoms Toerring * lib/tbox.c: Some adjustments to redraw of textbox 2009-07-04 Jens Thoms Toerring * Bugs found by Werner Heisch in fdesign fixed. 2009-07-03 Jens Thoms Toerring * Some bugs in code for drawing of folder and formbrowser objects repaired. * Mistakes in documentation removed. 2009-07-01 Jens Thoms Toerring * Several bugs in fdesign removed * lib/tbox.c: Realculation of horizontal offset after removal of longest line fixed 2009-06-29 Jens Thoms Toerring * Some bugs found by Werner Heisch in the new browser implementation corrected. * Some issues with fdesign and browsers removed. * lib/scrolbar.c: Cleanup due to compiler warning 2009-06-12 Jens Thoms Toerring * lib/tbox.c: Some corner cases for browsers corrected. 2009-06-10 Jens Thoms Toerring * lib/tbox.c: Bug in handling of new lines and appending to existing lines fixed to make it work like earlier versions. 2009-06-09 Jens Thoms Toerring Several bug-fixes and changes all over the place to get everything working again. Flag '--enable-bwc-bs-hack' added to 'configure' to allow compliation for programs that rely on the tradi- tional behaviour of browsers and scrollbars, i.e. that they don't report changes via e.g. fl_do_forms() but do invoke a callback if installed. 2009-06-04 Jens Thoms Toerring lib/tbox.c: Replacement for lib/textbox.c used in all browsers. 2009-05-21 Jens Thoms Toerring Lots of changes to the event handling system. The handler routines for objects now are supposed to return information about what happend (changes, end of interaction) instead of just 1 or 0 (which indicated if the user application was to be notified or not. Using the new system makes it easier to use objects that consist of child objects e.g. when dealing with callbacks for these kinds of objects. 2009-05-17 Jens Thoms Toerring * lib/events.c: Bug fixed that resulted in crashes when in the callback for an object the object itself got deleted. * lib/input.c: fl_validate_input() function added. * configure.ac, config/common.am, config/texinfo.tex, doc/Makefile.am: Documentation added to built system 2009-05-16 Jens Thoms Toerring * lib/events.c: Objects consisting just of child objects weren't handled correctly in that they never got returned by fl_do_forms(). * lib/browser.c, lib/formbrowser.c, lib/scrollbar.c, lib/tabfolder.c: these objects now get created with a default callback that does nothing to keep them reported by fl_do_forms() (for backward compatibility reasons). Also quite a bit of cleanup in lib/browser.c * lib/spinner.c, lib/include/spinner.h, lib/private/pspinner.h: new widget added, very similar to counter object (but realized just using already existing objects). * lib/child.c, lib/include/Basic.h: fl_add_child() is am exported function now (again) since it might be rather useful for creating new, composite widgets. 2009-05-13 Jens Thoms Toerring * fdesign/Makefile: Added a few include directories in order to allow fdesign's fd files when newly converted with fdesign to be compiled without manual changes. 2009-05-08 Jens Thoms Toerring * lib/forms.c, lib/objects.c, lib/flinternals.h: Using the return key to activate a FL_RETURN_BUTTON object in a form with a single input object works again. 2009-05-08 Jens Thoms Toerring * configure.ac: check for nanosleep too * lib/sysdep.c (fl_msleep): use HAVE_NONOSLEEP 2009-05-06 Jens Thoms Toerring * lib/form.c: Changed return type of the functions fl_show_form(), fl_prepare_form_window() and fl_show_form_window() to 'Window' to reflect what was (mostly) said in the documentation. That also required including X11 header files already in lib/include/Basic.h instead of lib/include/XBasic.h. fl_prepare_form_window() now returns 'None' on failure instead of -1. Also the type of the 'window' member of the FL_FORM structure is now 'Window' instead of 'unsigned long' and that of 'icon_pixmap' and 'icon_mask' is 'Pixmap'. FL_TRIANGLE_* macros renamed to FLI_TRIANGLE_* and moved to lib/flinternal.h. 2009-05-06 Jens Thoms Toerring * Just a bit of code cleanup in fdesign and minor changes of the documentation. 2009-05-04 Jens Thoms Toerring * lib/signal.c: in handle_signal() a caught signal could lead to an infinite loop when the handling function did something that put it back into the main loop. * Some improvements of teh documentation 2009-05-03 Jens Thoms Toerring * fdesign/fd_attribs.c: Bug that kept composite objects from being selected after type change in fdesign removed. Length of labels is now unlimited. 2009-05-02 Jens Thoms Toerring * Some missing figures added to documentation. 2009-04-16 Jens Thoms Toerring Git repository added. 2009-03-27 Jens Thoms Toerring * fdesign/fd_main.c, fdesign/fd_printC.c: As Rob Carpenter noticed doesn't get inclued in the files generated by fdesign when a glcanvas object exists. Changed that so that both and (but only if required) get included in the header file created by fdesign. 2009-01-26 Jens Thoms Toerring * lib/include/AAA.h.in: Contact address etc. corrected. 2009-01-25 Jens Thoms Toerring * doc/images/: Some new figures added. 2009-01-21 Jens Thoms Toerring * fdesign/fd_spec.c, fdesign/fd_super.c: Removed lots of potential buffer overruns and restriction on number of lines/entries that could be used for browser, menu and choice objects. * lib/utils: Added function for reading in lines of arbitrary length from a file and a function with similar functionality as GNUs asprintf(). 2009-01-16 Jens Thoms Toerring * image/image_disp.c: Tried to correct display of images on machines where the COMPOSITE extension is supported. As Luis Balona noticed on these systems images dispayed with the itest demo program appear half-transparent. Probably not solved but looks a bit better now... * image/image_jpeg.c: Bug in identification of JPEG images corrected. 2009-01-11 Jens Thoms Toerring * lib/nmenu.c, lib/include/nmenu.h, lib/private/pnmenu.h: New type of menus based on the new popup code. * lib/private/pselect.h: Small correction to get the knob of browser sliders drawn correctly. 2009-01-03 Jens Thoms Toerring * lib/select.c: Corrections and additions of new functions for select objects. * demos: Changes to a number of demo programs to use select instead of choice objects. * doc: Updates of some of the files of the documentation. 2009-01-02 Jens Thoms Toerring * lib/select.c, lib/include/select.h, lib/private/pselect.h: Files for the new select object added that is supposed to replace the old choice object and is based on the new popup code recently added. * doc/part3_choice_objects.texi, doc/part3_deprecated_objects.texi: Documentation of choice objects moved from that for choice objects to that for deprecated objects and documenttation for the new select object was added to that for choice objects. 2008-12-28 Jens Thoms Toerring * fdesign/fd_printC.c: Applied a patch Werner Heisch send in for a bug that resulted in the label alignment getting set incorrectly (always ended up as FL_ALIGN_CENTER). 2008-12-27 Jens Thoms Toerring * doc: Reassembly of documentation in texinfo format more or less complete. Still missing are most of the figures. * lib/include/popup.h: File has been renamed xpopup.h. * lib/popup.c, lib/include/popup.h, demo/new_popup.c: New implementation of popups, supposed to replace old Xpopups. Still missing: reimplementation of menu and choice objects based on the new Popup class. * lib/forms.c: fl_end_group() now returns void instead of a pseudo-object that never should be used by the user. 2008-12-10 Jens Thoms Toerring * lib/xpopup.c: Found that FL_PUP_GREY and FL_PUP_INACTIVE are actually the same, so removed all uses of FL_PUP_INACTIVE. 2008-12-01 Jens Thoms Toerring * doc: New directory with first parts of rewrite of docu- mentation in texi format. * lib/counter.c: Rob Carpenter noticed that it sometimes can be difficult to use a counter to just change it by a single step. Thus, according to his suggstions, the first step now takes longer and the time between following steps gets smaller and smaller until a final minimum timeout is reached (initial timeout is 600 ms and final is 50 ms per default). The fl_get_counter_repeat() and fl_set_counter_repeat() are now for the initial timeout and the final timeout can be controlled vianew functions fl_set_counter_min_repeat()/fl_get_counter_min_repeat(). To switch back to the old behaviour use the functions fl_set_counter_speedup()/fl_get_counter_speedup() and set the initial and final rate to the same value. If speed-up is switched off but initial and final timeouts differ the initial timeout is used for the first step and the final timeout for all following steps. * lib/choice.c: Choices didn't react immediately to a click with the middle or left mouse button. Now the selected entry will change immediately and continue to change slowly when the mouse button is kept pressed down. * fdesign/fd_forms.c: Rob Carpenter and Werner Heisch found that while loading .fd file a spurious "Failure to read file" warning gets emitted. 2008-11-22 Jens Thoms Toerring * lib/appwin.c, lib/events.c: Small changes to clean up a few things that did look a bit confusing. 2008-11-11 Jens Thoms Toerring Cosmetic changes to a number of files to pacify the newest gcc/libc combination about issues with disre- garded return values of standard input/output func- tions (fgets(), fread(), fwrite(), sscanf() etc.) 2008-11-10 Jens Thoms Toerring * lib/textbox.c: Another bug Rob Carpenter found: when trying to scroll in an empty browser the program crashed with a segmentation fault due to miscalculation of the number of the topmost line of text. 2008-11-04 Jens Thoms Toerring * lib/objects.c: Rob Carpenter pointed out another bug that resulted in extremely slow redraws of objects and was due to a off-by-one error in the calculation of the bounding box of objects (which in turn made non-overlap- ping objects appear to overlap. 2008-10-27 Jens Thoms Toerring * lib/button.c: Bug in function for selecting which mouse buttons a button reacts to fixed. 2008-10-20 Jens Thoms Toerring * lib/forms.c: Added function fl_form_is_iconified() that returns if a forms window is in iconfied state. Thanks to Serge Bromow for propose a function like that. 2008-10-18 Jens Thoms Toerring * lib/forms.c, lib/tooltip.c: Bug removed that led to multiple deletes of tooltip form in the fl_finish() function. 2008-09-24 Jens Thoms Toerring * lib/clock.c: FL_POINT array in draw_hand() was one element too short. 2008-09-22 Jens Thoms Toerring * Further code cleanup * Update of man page 2008-09-21 Jens Thoms Toerring * Bits of code clean-up in several places. 2008-09-17 Jens Thoms Toerring * lib/objects.c: Added removal of tooltip when object gets deleted. 2008-09-16 Jens Thoms Toerring * lib/win.c, lib/forms.c: Code for showing a form was changed. The previous code made the assumption that all window managers would reparent the form window withing a window with the decorations, but this is not necessary the case (e.g. metacity, the default window manager of Gnome). This led to inconsistencies in the positioning of forms with different window managers. Also positioning forms with negative values for x and y (to position a window with its right or bottom border relative to the right or bottom of the screen didn't work correctly. 2008-08-04 Jens Thoms Toerring * lib/goodie_choice.c: Bug in setting the buttons texts removed. 2008-08-03 Jens Thoms Toerring * lib/forms.c, lib/objects.c: Removed bug pointed out by J. P. Mellor that allowed selecting and editing input objects even when the were deactivated. * fdesign/fd_attribs.c: Removed a bug pointed out by Werner Heisch that crashed fdesign if the type of an object was changed. * fdesign/fd_attribs.c: Bug in fdesign fixed that led to crash when the type of a composite object was changed and then Restore or Cancel was clicked. 2008-07-05 Jens Thoms Toerring * lib/menu.c: Thanks to a lot of input from Jason Cipriani several changes were made concerning the ability to set menu item IDs and callback functions for menu items. This includes slight changes to the prototype of the three functions fl_set_menu(), fl_addto_menu() and fl_replace_menu_item(). All of them now accept in addition to their traditional arguments an unspecified number of extra arguments. Also tow new functions were added: fl_set_menu_item_callback( ) fl_set_menu_item_id( ) Please see the file 'New_Features.txt' for a more complete description. * fdesign: Support for setting menu item IDs and menu item callbacks has been added. 2008-07-03 Jens Thoms Toerring * lib/forms.c: for radio buttons an associated callback function wasn't called on a click on an already pressed radio button as Luis Balona found out. Since this isn't the bahaviour of older XForms version this could lead to problems for applictaions that expect the old behaviour, so the behaviour was switched back to the old one. * config/: on "make maintainer-mode the scripts install-sh, missing and mkinstalldirs got deleted. While the first two were generated automatically during the autoconf process the last wasn't which led to a warning when running configure. Thus the 'mkinstalldirs' (from automake 1.10) was added. 2008-07-02 Jens Thoms Toerring * lib/xpopup.c, lib/menu.c: Tried to fix a bug resulting in artefacts with menus on some machines as Luis Balona pointed out. 2008-06-30 Jens Thoms Toerring * lib/objects.c: Removed a bug in the calculation of size of the bounding of an object. Thanks to Rob Carpenter for sending me example code that did show the problem nicely. * lib/forms.c, lib/objects.c: Added some code to speed up freeing of forms (overlap of objects does not get recalculated anymore, which could take a considerable time for forms with many objects). 2008-06-29 Jens Thoms Toerring * lib/object.c, lib/button.c, lib/xpopup.c: Fixed two bugs found by Luis Balona that under certain circumstances led to a segmentation fault. * config/ltmain.sh, config/libtool.m4, config/config.guess, config/config.sub: Updated libtool files from version 1.4.3 to 1.5.26 since Raphael Straub, the maintainer of the MacPorts port of XForms, pointed out that compilation of fdesign on Mac OSX failed due to a problem with the old libtool version. 2008-06-22 Jens Thoms Toerring * lib/xsupport.c: Code cleanup. * lib/pixmap.c: Changed code for drawing a pixmap to take the current clipping setting unto account. Many thanks To Werner Heisch for explaining the problem with a lot of screentshots and several example programs that did show what went wrong! * lib/bitmap.c: Made bitmap buttons behave like normal buttons, just with a bitmap drawn on top of it. The foreground color of the bitmap is the same as the label color (and never changes). Also changed the code for drawing a bitmap to take account fo the current clipping setting. 2008-06-17 Jens Thoms Toerring * lib/pixmap.c: Made pixmap buttons behave like normal buttons, just with a pixmap drawn on top of it (which may get changed when the button receives or loses the focus). * lib/objects.c: Made some changes to the redraw of objects when a "lower" object gets redrawn and thus an object on top of it also needs to be redrawn. 2008-05-31 Jens Thoms Toerring * lib/pixmap.c: As Werner Heinsch pointed out the display of partially transparent pixmaps was broken due to a bug I had introduced when cleaning up the code for redraw. Moreover, already in 1.0.90 the pixmap of a pixmap button was exchanged for the focus pixmap when the button was pressed, which wasn't what the documentation said. Code changed to avoid that. * lib/objects.c: The code for determining if two objects intersect was broken and reported all objects to intersect, which then resulted in a lot of useless redraws. Hopefully fixed. 2008-05-24 Jens Thoms Toerring * Got rid of some compiler warnings removed. * lib/fldraw.c: As Andrea Scopece pointed out colors of box borders weren't correct and the shadow wasn't drawn for for shadow boxes with a border width of 1 or -1. Added his proposed patches. 2008-05-17 Jens Thoms Toerring * lib/goodies.c, lib/goodie_*.c: Some code cleanup and made sure that memory allocated gets released. 2008-05-16 Jens Thoms Toerring * lib/objects.c: Removed a bug that has been pointed out by Werner Heisch with a small demo program: if an object is partially or even fully hidden by another object and gets redrawn it got drawn above the object it was supposed to be (more or less) hidden by, thus obscuring the "upper" object. * lib/pixmap.c: It could happen that parts of a pixmap got drawn outside of the object that it belongs to. That in turn could mess up redrawing (e.g. if the pixmap object got hidden). Thus now only that part of a pixmap that fits inside the object gets drawn. 2008-05-15 Jens Thoms Toerring * lib/textbox.c: The functions fl_addto_browser() and fl_addto_browser_chars() didn't worlk correctly anymore. When lines where appended the browser wasn't shifted to display the new line. Thanks to Werner Heisch for pointing out the problem. 2008-05-12 Jens Thoms Toerring * lib/goodie_alert.c: Removed restriction on the maximum length of the alert message. Added new function void fl_show_alert2( int c, const char * fmt, ... ) The first argument is the same as the last of fl_show_alert(), indicating if the alert box is to be centered on the screen. The second one is a printf()- like format string, followed by as many further arguments as there are format specifiers in the 'fmt' argument. The title and the alert message are taken from the resulting string, where the first form-feed character ('\f') embedded in the string is used as the separator between the title and the message. 2008-05-10 Jens Thoms Toerring * lib/menu.c: Changed the default font style of menus from FL_BOLD_STYLE to FL_NORMAL_STYLE and menu entries from FL_BOLDITALIC_STYLE also to FL_NORMAL_STYLE. * lib/xpopup.c: Changed the default font style of both popup entries as well as the title from FL_BOLDITALIC_STYLE to FL_NORMAL_STYLE. * lib/flcolor.c: Made the default background color a bit lighter. 2008-05-09 Jens Thoms Toerring * lib/objects.c: Removed bug that kept canvases from being hidden and tabfolders from being re-shown correctly. This was especially annoying with fdesign as Rob Carpenter pointed out. * lib/forms.c: Added a new function int fl_get_decoration_sizes( FL_FORM * form, int * top, int * right, int * bottom, int * left ); which returns the widths of the additional decorations the window manager puts around a forms window. This function can be useful if e.g. one wants to store the position of a window in a file and use the position the next time the program is started. If one stores the forms position and uses that to place the window it will appear to be shifted by the size of the top and left decoration. So instead storing the forms position one has to correct it for the decoration sizes. * everywhere: further clean up (getting internal stuff separated from stuff that belongs to API) 2008-05-08 Jens Thoms Toerring * lib.objects.c, lib/childs.c: Rewrite of the functions for hidding an object. Some adjustments to the code for freeing objects to set the focus correctly. * lib/flresource.c: Changed the name of the option to set the debug level from 'debug' to 'fldebug' since it's too likely that a program using XForms also has a 'debug' option which would get over- written by XForms option. Also added a 'flhelp' option that outputs the options that XForms accepts and then calls exit(1). Thanks to Andrea Scopece for contributing this. 2008-05-07 Jens Thoms Toerring * lib/objects.c, lib/child.c: Handling of child objects corrected - valgrind was reporting an error with the old code (access to already re- leased memory) and the code was rather buggy and inconsistent anyway. * lib/xpopup.c: Changed a XFhlush() to XSync() after a popup was opened - without it an Map- Notify was sometimes passed back to the user program (happened due to a fix to a different bug in lib/events.c). * fdesign: Tried to make the fdesign GUI look a bit nicer (thinner borders etc.). Some changes to generated output files (format, call of fl_free() on the different fdui's at the end of the main() function etc.). 2008-05-05 Jens Thoms Toerring * further clean-up of header files and renaming of functions and macros usied only internally. 2008-05-04 Jens Thoms Toerring * fdesign/fd_forms.c: Removed limit on number of forms that can be created or read from a file. Few changes to error handling. * fdesign/fd_control.c: Removed limit on number of objects in a form that can be dealt with. * fdesign/fd_groups.c: Removed limit on number of groups that can be dealt with. * fdesign/fd/ui_theforms.fd: Changed browser for groups to be a multi instead of hold browser. * lib/events.c: Bug I had ontroduced in function fl_handle_event_callbacks() repaired. Thanks to Andrea Scopece for pointing out the problem. * everywhere: started attempt to distinguish clearly between functions, variables, and macros belonging to the API and those only used internally to the library by having API names start with 'fl_' (or 'FL_') while internal names start with 'fli_' (or FLI_'). Also removed doubly declared or non-existent functions in lib/flinternal.h. 2008-05-01 Jens Thoms Toerring * lib/goodies_msg.c: New function fl_show_msg() now works. 2008-04-30 Jens Thoms Toerring * lib/goodie_msg.c: Added function void fl_show_msg( const char * fmt, ... ) The first argument is a printf-like format string, followed by as many arguments as required by the format specifiers in the format string. This simplfies outputting freely formatted messages. Changed fl_show_message() to avoid an upper limit of 2048 characters on the total length of the three strings passed to it. Added #defines for fl_hide_messages and fl_hide_msg - they are just alternative names for fl_hide_message(). 2008-04-29 Jens Thoms Toerring * lib/fselect.c: If a callback for a file selector is installed the prompt line and the input field aren't shown anymore. As Andrea Scopece pointed out the input field can't be used at all for file selectors with a callback (only a double click in the browser works) so it doesn't make sense to show it. * lib/n2a.c: This file isn't needed anymore - the only of its functions used at all, fl_itoa(), was used in only a single place (lib/errmsg.c) and got replaced by sprintf(). * image/image_proc.c: Bug fixed in flimage_tint() that led to writes past the end of an array. 2008-04-28 Jens Thoms Toerring * lib/forms.c: Jumping backwards with Shift- through a set of input objects now works even if there are non-input objects in between. * demos/browserop.c: Bug removed that only surfaced now since clicking onto a button makes an input object lose the focus. * lib/canvas.c, lib/forms.c: On hiding a form it was forgotten to unmap the windows of canvases belonging to that form and to reset the ID of these windows. Resulted in an XError on unhiding the form. Thanks to Andrea Scopece for finding this bug. 2008-04-27 Jens Thoms Toerring * lib/input.c: Correct leap year handling in date input validator. Multi-line input field don't receive a anymore (which never did work anyway). * lib/forms.c: can now also be used to move the focus out of a multi-line input field and into the next input field. * lib/version.c: The version output now contains the full copyright information, not just the first three lines. 2008-04-26 Jens Thoms Toerring * lib/flresource.c: Library version information wasn't output when the '-flversion' option was given. Repaired by a patch Andrea Scopece send. * lib/forms.c: Scrollbars had been extempt from resizing due to the wrong assumption that they always would be childs of a composite object, which isn't the case. Thanks to Andrea Scopece for finding this problem. * lib/scrollbar.c: Horizontal scrollbars now only get resized in x-direction per default, verticall ones in y-direction only. 2008-04-22 Jens Thoms Toerring * lib/async_io.c: Removed a bug pointed out by Andrea Scopece that resulted in a segmentation fault in the 'demo' program. This also needed some changes in the files lib/flresource.c and lib/flinternal.h (where also all remains from be.c were removed). 2008-04-20 Jens Thoms Toerring * lib/flresource.c: Removed setting of the machines locale setting as default for the program. This change had already been discussed by Jean-Marc and Angus back in 2004 but never actually done. * lib/fselect.c: Programs doesn't crash anymore when fl_set_directory() gets passed a NULL pointer. * lib/buttons.c: Bug repaired that kept buttons from becoming highlighted when the mouse was moved nto them (and vice versa). * lib/formbrowser.c: Changed the handling of the scroll- bars to hopefully make it work correctly even when the form gets resized. 2008-04-13 Jens Thoms Toerring * fdesign/fd/*.c, fdesign/spec/*.c: Replaced '#include "forms.h"' with '#include "include/forms.h" to avoid compilation problems Peter Galbraith pointed out. * fdesign/fd_printC.c: In created C files we now have '#include ' instead of '#include "forms.h"'. 2008-04-10 Jens Thoms Toerring * lib/buttons.c: Removed code that enforced on of a set of radio buttons to be set - thus led to problems for some older applications. Also emoved restriction that buttons only react to a click with the left mouse button per default. Instead added two new public functions fl_set_button_mouse_buttons() fl_get_button_mouse_buttons() that allow to set and query the mouse buttons a button will react to. dfault is to react to all mouse buttons. * fdesign/sp_buttons.c, fdesign/fd_spec.c: Added support for setting the mouse buttons a button reacts to via fdesign (click the "Spec" tab rider in the attributes window). * fdesign/fd_main.c: Added option '-xforms-version' to print out the version of the library being used. * lib/tabfolder.c: All memory now gets released on call of fl_finish(). * lib/symbols.c: Unlimited number of symbols can be created without restrictions on the name length. Memory allocated for symbols gets deallocated in fl_finish(). * lib/flresource.c: Array allocated for copy of command line arguments was one element too short which led to crashes when using lots of command line arguments. Added function to free this memory in fl_finish(). * fdesign/fd_printC.c: Output wasn't correct ANSI-C89 when the pre_form_output() function was called. * fdesign/fd/*.[ch], fdesign/spec/*.[ch]: Newly generated using the newest fdesign version. 2008-03-27 Jens Thoms Toerring * lib/button.c: Most buttons now again react only to the release of the left mouse button, I had introduced a bug that broke this behaviour. * fdesign/sp_*.c: Some cosmetic correction to the output format of the files generated by fdesign. 2008-03-26 Jens Thoms Toerring * lib/forms.c: Clicking on a "pushable" object now leads to an input object currently having the focus lose the focus, thus enforcing it to report changes. Until now this only happened if the object that was clicked on was another input object. A FocusOut event now takes away keyboard input from input objects on the form in the window that lost the focus, a FocusIn event restores it. 2008-03-25 Jens Thoms Toerring * lib/forms.c: Further restructuring of event handling. All memory for objects of a form now (hopefully) gets deallocated on a call of fl_free_form() and a call of fl_finish() deallocates all memory used for forms and their objects, removes signal callbacks and deletes timers. The only exception is memory for tabfolder, I haven't yet understood the code for that... * lib/objects.c: Object pre- and posthandlers aren't called anymore on FL_FREEMEM events (the object or some of its childs probably doesn't exist anymore in that kind of situation). * lib/timeout.c: Changed the code a bit and, in combi- nation with changes in lib/forms.c, got the precision of timeouts to be a bit higher (haven't seen it being off more than 5 ms on my machine under light load) and made sure they never expire too early (as promised in the manual). Added a function to remove all timeouts, to be be called from fl_finish(). * lib/be.c: File isn't used anymore, the list of memory to be allocated never was used anyway if no idle handler was installed and it also didn't do the right thing. No calls to fl_addto_freelist() and fl_free_freelist() are left in XForms. * lib/include/Basic.h: FL_MOTION has come back, what I should have thrown out was FL_MOUSE. FL_MOUSE is still available for backward compatibility but isn't used in the code anymore - FL_UPDATE is the new name (in the object structure the 'want_update' member must be set to request this type of event - can be switched on and off at any time). * lib/slider.c: Changed the code for sliders (and thereby scrollbars) quite a bit - it was much too complicated (unfortunately still is:-( and didn't always work correctly. Scrollbars now react to scroll wheel mouse the same way a textbrowser does. * lib/signal: On system that support it sigaction() instead of signal() is used now. Added a function to remove all signal handlers, to be used from fl_finish(). * fdesign/ps_printC.c: Replaced the use of fl_calloc() by fl_malloc() when writing out C files - there's no good reason to spend time on zeroing out the memory. 2008-03-20 Jens Thoms Toerring * textbox.c: Textboxes didn't get regular update events that are needed for scrolling with the mouse pressed down just below or above the box. They also did only react to left mouse buttons (and scroll wheel) and now again also to the middle and right button. * lib/counter.c, fdesign/fd_object.c: Removed some debugging output accidentally left in. * lib/dial.c: Corrected return behaviour on mouse button release. 2008-03-19 Jens Thoms Toerring * lib/forms.c: Further cleanup and removal of cruft that was hard to understand but actually was unnecessary or counter-productive. Added check that makes sure that one of the radio buttons of a form is always set. * lib/include/Basic.h: FL_MOTION got removed, instead FL_UPDATE was introduced for events of the artificial timer (the one that kicks in when there are no events). The FL_OBJECT structure got two new elements, 'want_motion' and 'want_update'. If the first is set an object which is not an object that can be "pushed" will receive mouse movement events (e.g. in case the object has some inner structure that depends on the mouse position like counter objects) and the second is to be set by objects that want to receive FL_UPDATE events (but they still need to be objects that can be "pushed") - at the moment these are touch buttons, counters and choice objects. * lib/choice.c: FL_DROPLIST_CHOICE didn't work correctly anymore, fixed. Scroll wheel can now also be used to walk through the entry up or down in the popup. Added a new function fl_get_choice_item_mode() to the public interface. * lib/menu.c: Menus become highlighted when the mouse is moved onto it. Code cleaned up a bit. Added a function fl_set_menu_notitle() (analogous to the fl_set_choice_notitle() function) to allow removal of the sometimes ugly menu popup titles. This leads to an important change in the behaviour of FL_PUSH_MENU objects: if the title is switched off they only get opened on button release and stay directly below the menu button (like FL_PULLDOWN_MENU objects). There's a lot of code identical to that in choice.c, it might be reasonable to remove the duplication (what actually is the big difference between the menu and choice objects, anyway?) * lib/button: Changes to fit the new event handling code. Buttons now only react to clicks with the left mouse. button. Handling of radio buttons corrected. * lib/choice, lib/counter: Changes to fit the new event handling code. * lib/slider.c, lib/thumbwheel.c, lib/textbox.c, lib/positioner.c, lib/dial.c: Now react to left mouse button only (and mouse wheel as far as reasonable). * lib/fldraw.c: Issues with memory handling checked and corrected. 2008-03-12 Jens Thoms Toerring * lib/forms.c: Removed code injecting fake FL_RELEASE events that led to problems with double click selections e.g. in the file selector (this in turn required changes to lib/xpopup.c). * lib/xpopup.c: Extensive code cleanup, bug fixes and rewrite of event handling. Popup's, menus etc. now work more like one is it used from other toolkits. Shadows around popups got removed since they don't (and never did) work correctly. * Further code cleanup all over the place, removing bugs that may lead to segmentation faults or memory or X resources leaks. 2008-02-04 Jens Thoms Toerring * Resizing code again changed since I hadn't understood all the interdepencies between gravity and resize settings. Hopefully works correctly now. The special treatment of the case for objects that have no gravity set and all resizing switched off (in which case the center of gravity is moved when the enclosing form is resized) seems to be a bit strange. Why is not the same behaviour used for e.g. the x-direction if an object isn't fixed in x-direction by its gravity setting and it isn't to be resized in horizontal direction (same for y)? * lib/events.c: Changed the Expose event compression code that did lead to missed redraws under e.g. KDE or Gnome if they are set up to update a window also during resizing and the mouse is moved around a lot in the process. * lib/textbox.c: Hopefully fixed a bug (perhaps it's the one that Michal Szymanski reported on 2005/3/11 in the XForms mailing list) that resulted under certain circumstances in e.g. fl_do_forms() returning the object for a normal textbrowser unexpectedly when the mouse wheel was used, which in turn could make programs exit that did not expect such a return value (the fbrowse.c demo program did show the problem). * lib/textbox.c: Hopefully fixed another bug that kept the text area of a browser from being redrawn correctly following the resizing of its window when sliders were on and not in the left- or top-most position. * lib/objects.c: Added three functions fl_get_object_bw(), fl_get_object_gravity() and fl_get_object_resize() (to be added to the public interface). * lib/flinternal.h: Added several macros that test if the upper left hand and the lower right hand corner of an object are locked due to gravity settings and macros that test if the width or height is "fixed", i.e. determined by the gravity settings (so they are not influenced by the corresponding resizing settings). * demos/grav.c: Created a small demo program that shows the effects of the different gravity and resizing settings. The results can sometimes be a bit surprising at a first glance but I hope to have gotten it right;-) 2008-01-28 Jens Thoms Toerring * Resizing behaviour got rewritten to get it to work correctly even if a window gets resized to a very small size and then back to a large one (see e.g. the xyplotall demo program for the behaviour). This required to add elements to the FL_FORM and FL_OBJECT structures, but since they shouldn't be used directly from user programs and also user defined object should always be created via a call of fl_make_object(), where the geometry of the object gets set, this shouldn't lead to any trouble. One aspect of the changes is that an objects gravity setting now always takes precedence over the 'resize' setting and the 'resize' setting gets automatically corrected whenever necessary. * lib/events.c: changed queueing system so that queue overflows and thus loss of calls of callback functions or Xevents shouldn't be possible anymore. The queues are now implemented using linked lists that get extendend if necessary, deallocation is done from fl_finish(). * Got rid of a redraw bug that led to a form not being redrawn correctly after its window was made smaller (e.g. under fvwm2) * Several bugs where fixed that sometimes crashed the program with XErrors after resizing a window, especially when the window was made very small (exhibited by e.g. the formbrowser demo program). * Number of forms that can be created is now unlimited (or only limited by the available memory) instead of having an arbitrary maximum of 64 * Changes to autogen.sh to allow built with newer versions of autoconf and small changes on config/xformsinclude.m4 to avoid warnings. Added '-W' compiler flag (which in turn required to mark unused arguments of a lot of functions as such to avoid compiler warnings, see the new macro FL_UNUSED_ARG in lib/include/Basic.h that exists for just that purpose). * Handling of the number of colors was corrected for displays with more colors than can be stored in an unsigned long (e.g. 32-bit depth display with 32-bit wide unsigned longs). * Correction of the sizes of the scrollbars of FL_NORMAL_FORMBROWSER type of objects. * lib/dial.c: mouse-wheel handling for dials added * lib/tabfolder.c: bugs in memory handling corrected * Replaced float by double in many places (not yet finished!). * Code cleanup (concerns several dozens of files) 2004-12-28 Jean-Marc Lasgouttes * image/image_jpeg.c: fix compilation with IBM's xlc. * Makefile.am: remove useless GNUish construct. * lib/listdir.c: add a better definition of S_ISSOCK, that works with SCO OpenServer (thanks to Paul McNary). 2004-10-05 Angus Leeming * xforms.spec.in: Updating SO_VERSION revealed a flaw in the logic that tries to use this variable to define some missing symbolic links. The 'post' and 'postun' scripts have been rewritten to work once more. * lib/flinternal.h: move FL_NoColor... * lib/include/Basic.h: here. * lib/forms.c (do_interaction_step): prevent potential crash caused by invoking fl_get_winsize with a width as the first argument rather than a window ID. * NEWS: add some highlights post 1.0.90. 2004-10-05 Angus Leeming * configure.ac (SO_VERSION): updated to "2:0:1" in preparation for the xforms 1.1 release. 2004-10-06 Angus Leeming * lib/textbox.c (fl_set_textbox_xoffset): don't ignore a request to reset the offset if the manipulated value is less than zero. Instead, reset it to zero and proceed. * lib/browser.c (get_geometry): reset the horizontal offset to zero if the horizontal scrollbar is turned off. (Bug #3205.) 2004-07-28 Angus Leeming * lib/forms.c (fl_prepare_form_window): correct typo in error message. 2004-06-04 Angus Leeming * lib/fonts.c (fl_try_get_font_struct): change an error message to an informational one as the function is often used to test whether a font is loadable or not. 2004-06-03 Angus Leeming * lib/Makefile.am (EXTRA_DIST): distribute dirent_vms.h and vms_readdir.c. 2004-06-01 Duncan Simpson * fdesign/fd_printC.c (build_fname): re-write using fl_snprintf as a simpler and safer replacement for strncat and strncpy. 2004-05-27 Angus Leeming * fdesign/fd_printC.c (build_fname): if no output_dir is specified, then output files in the current directory. 2004-05-27 Angus Leeming * fdesign/fd_main.c: improve diagnostics when failing to convert the .fd file to a .[ch] pair. Also remove some redundant cruft. 2004-05-18 Angus Leeming * lib/include/Basic.h (fl_set_err_logfp): function was known as 'fl_set_error_logfp' in XForms 0.89. Define a typedef to map from the old to the new. 2004-05-18 Angus Leeming * demos/demo27.c: * demos/iconify.c: * demos/pup.c: * fdesign/fd_attribs.c: * fdesign/fd_main.c: * fdesign/fd_main.h: * fdesign/fd_rubber.c: * gl/glcanvas.c: * image/flimage.h: * image/flimage_int.h: * image/image.c: * image/image_disp.c: * image/image_fits.c: * image/image_gif.c: * image/image_jquant.c: * image/image_marker.c: * image/image_proc.c: * image/image_xwd.c: * image/matrix.c: * lib/asyn_io.c: * lib/canvas.c: * lib/child.c: * lib/choice.c: * lib/flcolor.c: * lib/flinternal.h: * lib/flresource.c: * lib/forms.c: * lib/fselect.c: * lib/input.c: * lib/listdir.c: * lib/menu.c: * lib/objects.c: * lib/pixmap.c: * lib/win.c: * lib/xdraw.c: * lib/xpopup.c: * lib/xsupport.c: * lib/include/Basic.h: * lib/include/XBasic.h: * lib/include/bitmap.h: * lib/include/button.h: * lib/include/canvas.h: * lib/include/choice.h: * lib/include/menu.h: * lib/include/popup.h: * lib/private/pcanvas.h: * lib/private/ptextbox.h: s/unsigned/unsigned int/ 2004-05-17 Angus Leeming Revert some functions to the same API as was used in XForms version 0.89, patch level 5. In all cases, this is just a case of using the typedef rather than the raw type. * lib/browser.c (fl_create_browser, fl_add_browser): * lib/include/browser.h (fl_create_browser, fl_add_browser): use FL_Coord. * lib/flcolor.c (fl_bk_color, fl_bk_textcolor): * lib/include/Basic.h (fl_bk_color, fl_bk_textcolor): use FL_COLOR. * lib/flresource.c (fl_initialize): * lib/include/XBasic.h (fl_initialize): use FL_CMD_OPT *. * lib/formbrowser.c (fl_add_formbrowser): * lib/include/formbrowser.h (fl_add_formbrowser): use FL_Coord. * lib/oneliner.c (fl_show_oneliner): * lib/include/goodies.h (fl_show_oneliner): use FL_Coord. * lib/scrollbar.c (fl_create_scrollbar, fl_add_scrollbar(): * lib/include/scrollbar.h (fl_create_scrollbar, fl_add_scrollbar(): use FL_Coord. * lib/signal.c (fl_add_signal_callback): * lib/include/Basic.h (fl_add_signal_callback): use FL_SIGNAL_HANDLER. * lib/tabfolder.c (fl_add_tabfolder, fl_get_folder_area): * lib/include/tabfolder.h (fl_add_tabfolder, fl_get_folder_area): use FL_Coord. * lib/win.c (fl_winmove, fl_winreshape): * lib/include/XBasic.h (fl_winmove, fl_winreshape): use FL_Coord. * lib/xdraw.c (fl_polygon): * lib/include/XBasic.h (fl_polygon): use FL_COLOR. * lib/xtext.c (fl_drw_text_beside): * lib/include/Basic.h (fl_drw_text_beside): use FL_COLOR. * lib/include/goodies.h (fl_exe_command, fl_end_command, fl_check_command): use FL_PID_T. 2004-05-17 Angus Leeming * lib/include/canvas.h: change the change to AUTOINCLUDE_GLCANVAS_H. * gl/glcanvas.h: #include . Add C++ guards. 2004-05-14 Angus Leeming * lib/include/canvas.h: add a preprocessor-qualified #include of glcanvas.h. The user must inititalise the GLCANVAS_H_LOCATION appropriately. This is a means to maintain some sort of backwards compatibility without the old, hacky code. 2004-05-13 Angus Leeming * image/Makefile.am (libflimage_la_LDFLAGS): * gl/Makefile.am (libformsGL_la_LDFLAGS): change the -version-info data to '@SO_VERSION@' so that all get updated automatically. 2004-05-13 Reed Riddle * lib/xyplot.c: * lib/include/xyplot.h (fl_replace_xyplot_point_in_overlay): new function, generalizing the existing fl_replace_xyplot_point which acts only on the first dataset. 2004-05-12 Jean-Marc Lasgouttes * gl/Makefile.am (INCLUDES): * demos/Makefile.am (INCLUDES): * fd2ps/Makefile.am (INCLUDES): * fdesign/Makefile.am (INCLUDES): add X_CFLAGS 2004-05-07 Angus Leeming * (xforms.spec.in): add code to the 'post' script to modify libforms.la et al. to prevent libtool from complaining that the files have been moved. 2004-05-07 Angus Leeming * lib/private/pvaluator.h (repeat_ms, timeout_id, mouse_pos): new variables. * lib/include/slider.[ch] (fl_[sg]et_slider_repeat): * lib/include/counter.[ch] (fl_[sg]et_counter_repeat): new accessor functions, enabling the user to query and modify the timeout used to control the behaviour of these widgets when the mouse is kept pressed down. * lib/include/slider.[ch] (handle_mouse): * lib/include/counter.[ch] (handle_mouse): use a timeout to control the rate at which the slider/counter is incremented. Replaces the current strategy which used a simple counter loop and which has become unusable with today's fast processors. 2004-05-06 Angus Leeming * configure.ac (SO_VERSION): new variable defining the libtool version info. Substituted in lib/Makefile.am and xforms.spec.in. * lib/Makefile.am (libforms_la_LDFLAGS): use the configure-time variable @SO_VERSION@ rather than the hard-coded 1:0:0. * xforms.spec.in: fix 'Release' and 'Source0' info. add 'post' and 'postun' scripts to create and remove symbolic links, respectively. 2004-05-06 Angus Leeming * fdesign/fd_spec.c: revert the change made earlier today. Turned out to be used in the demos code... 2004-05-06 Angus Leeming * xforms.spec.in: modify so that devfiles and binfiles are not placed in ${RPM_BUILD_ROOT}. Prevents rpm from bombing out with a "Checking for unpackaged files" error. 2004-05-05 Angus Leeming * lib/xtext.c (fl_drw_string): enable the drawing of characters in a font larger than the input widget. 2004-05-06 Angus Leeming * fdesign/fd_spec.c: initialization of the FL_CHOICE component of the objspec struct used 'emit_menu_header' and 'emit_menu_global', a cut-n-paste typo from the following FL_MENU component. They have both been reset to '0'. 2004-05-04 Angus Leeming * NT/libxforms.dsp, NT/xformsAll.dsw: removed these Visual C++ project files. They're way out of date and can be re-added if needed. 2004-05-05 Mike Heffner * lib/fselect.c (select_cb): clean-up and simplify this callback function by use of the existing fl_set_browser_dblclick_callback. 2004-05-04 Angus Leeming The original patch, posted to the xforms list on June 21, 2002, appears to have got lost. Archived here: http://bob.usuhs.mil/mailserv/list-archives/xforms-archive/0285.html Pass the associated (XEvent * xev) to fl_handle_object on an FL_DRAW event. This XEvent * is not used at all by any of xforms' "native" widgets, but an FL_FREE object is able to make use of this info to redraw only the part of the window that has changed. * forms.c (fl_handle_form): pass the XEvent on an FL_DRAW event. * objects.c (redraw_marked): pass the XEvent to fl_handle_object. (mark_for_redraw): new, static function containing all but the 'redraw_marked' call of the original fl_redraw_form. (fl_redraw_form): refactored code. Functionality unchanged. (fl_redraw_form_using_xevent): identical to fl_redraw_form, except that it passes the XEvent on to redraw_marked. 2004-05-02 Angus Leeming * lib/flresource.c (get_command_name): squash valgrind warning about a possible memory leak. 2004-04-30 Angus Leeming * lib/Makefile.am, fdesign/Makefile.am: silence automake warning about trailing backslash on last line of file. 2004-04-20 Jean-Marc Lasgouttes * lib/xpopup.c (fl_freepup): do not free unallocated entries (fl_setpup_maxpup): do not forget to reset parent and window in newly created menu_rec entries 2004-04-19 Jean-Marc Lasgouttes * demos/Makefile.am (glwin_LDADD, gl_LDADD): fix ordering of libraries (LDFLAGS): rename from AM_LDFLAGS (automake 1.5 did not like that) * config/xformsinclude.m4 (XFORMS_PROG_CC): fix description of --enable-debug 2004-04-05 Angus Leeming * Dummy commit to check all is well with my account. 2004-04-01 Jean-Marc Lasgouttes * lib/flresource.c (fl_get_resource): when a resource is a FL_STRING, avoid doing a strncpy of a string over itself (triggers a valgrind report) 2004-03-30 Jean-Marc Lasgouttes * README: mention the --enable-demos and --disable-gl flags, which got forgotten 2004-03-30 Hans J. Johnson * lib/pixmap.c (cleanup_xpma_struct): use a better check for libXpm version 2004-03-30 Jean-Marc Lasgouttes * XForms 1.0.90 released * NEWS: * README: update for 1.0.90 * configure.ac: set version to 1.0.90. Use XFORMS_CHECK_VERSION * config/xformsinclude.m4 (XFORMS_CHECK_VERSION): merge XFORMS_SET_VERSION and XFORMS_CHECK_VERSION. Set PACKAGE here and read version from PACKAGE_VERSION (set by AC_INIT). Remove detection of prereleases. Development versions are now versions with minor version number >= 50. * README: small update * configure.ac: add new define RETSIGTYPE_IS_VOID * lib/signal.c: fix handling of RETSIGTYPE 2003-12-02 Angus Leeming * demos/Makefile.am: enable 'make -j2' to work on a multi-processor machine. * demos/Makefile.am: handle the .fd -> .c conversion in automake-standard fashion. * lib/include/Makefile.am: pass sed the names of the files to be manipulated as '${srcdir}/`basename $$i`' rather than as '${srcdir}/$$i' or things go awol on the Dec. (Running ksh, fwiw.) 2003-11-28 Angus Leeming * Makefile.am: re-add xforms.spec to EXTRA_DIST. It is needed as well as xforms.spec.in or else 'make rpmdist' will fail. 2003-11-28 Angus Leeming * fdesign/fd_attribs.c: * image/image_jpeg.c: * image/image_xwd.c: * lib/flcolor.c: warning free compilation of the entire xforms source. 2003-11-28 Angus Leeming * demos/demotest.c: * demos/folder.c: * demos/free1.c: * demos/group.c: * demos/popup.c: * demos/wwwl.c: * demos/xyplotall.c: * demos/fd/scrollbar_gui.fd: squash all remaining warnings when compiling the demos directory '-W -Wall -Wno-unused-parameter'. 2003-11-28 Angus Leeming * Makefile.am: * configure.ac: compile fd2ps after fdesign. Will allow me to get rid of the files generated from the .fd files. 2003-11-27 Angus Leeming * demos/fd/Makefile.am: remove all the .[ch] files generated from their .fd parents. * demos/Makefile.am: generate the fd/*.[ch] files on-the-fly. * demos/buttonall.c: no longer #include fd/buttons_gui.c. * demos/butttypes.c: * demos/demotest.c: * demos/dirlist.c: * demos/folder.c: * demos/formbrowser.c: * demos/inputall.c: * demos/pmbrowse.c: * demos/scrollbar.c: * demos/thumbwheel.c: ditto for their own fd-generated files. * demos/pmbrowse.h: removed: cruft. * demos/fd/buttons_gui.[ch]: * demos/fd/butttypes_gui.[ch]: * demos/fd/fbtest_gui.[ch]: * demos/fd/folder_gui.[ch]: * demos/fd/formbrowser_gui.[ch]: * demos/fd/ibrowser_gui.[ch]: * demos/fd/inputall_gui.[ch]: * demos/fd/is_gui.[ch]: * demos/fd/is_gui_main.c: * demos/fd/pmbrowse_gui.[ch]: * demos/fd/scrollbar_gui.[ch]: * demos/fd/twheel_gui.[ch]: removed. 2003-11-27 Angus Leeming * fdesign/fd_printC.c (filename_only): use strrchr. * fdesign/fdesign.man: document the -dir option. 2003-11-27 Angus Leeming * NEWS: updated to reflect what has been going on in the 1.1 cycle. 2003-11-26 Angus Leeming * fdesign/fd_main.h: add a 'char * output_dir' var to the FD_Opt struct. * fdesign/fd_main.c: add code to initialize FD_Opt::output_dir. * fdesign/fd_forms.c (save_forms): pass fdopt.output_dir var to the external converter if non-zero. * fdesign/fd_printC.c (filename_only, build_fname): new helper functions that use FD_Opt::output_dir if it is set. (C_output): invoke build_fname rather than building the file name itself. 2003-11-27 Angus Leeming * demos/demotest_fd.[ch]: * demos/demotest_fd.fd: removed. The routines were not invoked by demotest (witness that it still links fine). * demos/pmbrowse.c: split out the fdesign generated code. Ensuing changes to use the fdesign generated code unchanged. * demos/pmbrowse.fd: moved... * demos/fd/pmbrowse_gui.[ch]: * demos/fd/pmbrowse_gui.fd: to here. * demos/Makefile.am: * demos/fd/Makefile.am: ensuing changes. 2003-11-27 Angus Leeming * image/image_gif.c (flush_buffer): do not pass 'incode'. Instead use a local variable. 2003-11-26 Jean-Marc Lasgouttes * fdesign/fd_forms.c (save_forms): do not try to remove twice ".fd" from file name (avoids problem with path names containing a '.'). 2003-11-25 Clive A Stubbings * image/image_gif.c (flush_buffer): new static function, containing code factored out of process_lzw_code. (process_lzw_code): invoke flush_buffer where old code was in process_lzw_code itself. In addition, also invoke flush_buffer when cleaning up after an old-style gif image. * image/image_jpeg.c (JPEG_identify): handle 'raw' JPEG images without the JFIF header. 2003-11-26 Angus Leeming * demos/boxtype.c: squash warning about uninitialized data. 2003-11-24 Angus Leeming * fdesign/sp_menu.c (emit_menu_header): output properly initialized C-code. 2003-11-20 Angus Leeming * demos/Makefile.am: enable the conditional building of the demo GL codes. * demos/gl.c: * demos/glwin.c: #include gl/glcanvas.h and so prevent warnings about implicit function declarations. 2003-11-20 Jean-Marc Lasgouttes * lib/local.h: do not define HAVE_KP_DEFINE * lib/flinternal.h: test directly for X11 version here * lib/forms.c (fl_keyboard): * lib/flcolor.c (fl_mapcolor, fl_dump_state_info): * lib/xpopup.c (fl_addtopup): * lib/clock.c (draw_clock): use proper ML_xxx macros instead of bogus names 2003-11-20 Angus Leeming * lib/events.c: * lib/fldraw.c: * lib/forms.c: * lib/xpopup.c: * lib/xsupport.c: * image/image_fits.c: * image/image_gif.c: * image/image_jpeg.c: * image/image_replace.c: * image/image_tiff.c: * image/ps_core.c: * image/ps_draw.c: * image/image_fits.c: * image/image_gif.c: * image/image_jpeg.c: * image/image_replace.c: * image/image_tiff.c: * image/image_xwd.c: * image/ps_core.c: * image/ps_draw.c: * fdesign/fd_main.c: squash warnings about comparison of signed and unsigned variables. Only 'safe' warnings have been squashed. 2003-11-20 Angus Leeming * lib/flsnprintf.c: remove unused variable 'credits'. * lib/flresource.c: remove line 'fl_context->xim;' as it is a statement with no effect. * lib/version.c: remove unused variable 'c'. 2003-11-20 Angus Leeming * lib/flinternal.h: add declaration of fl_handle_form. Squash warnings about implicit declaration of the function when compiling lib/tabfolder.c. * gl/glcanvas.h: remove #ifdef HAVE_GL_GLX_H guard. Cruft from pre-autoconf days. Squash warnings about implicit declaration of the function when compiling gl/glcanvas.c 2003-11-20 Angus Leeming * fd2ps/papers.c: * fd2ps/pscol.c: * fd2ps/psdraw.c: * fdesign/fd_control.c: * fdesign/fd_main.c: * fdesign/fd_printC.c: * fdesign/fd_spec.c: * fdesign/sp_dial.c: * image/image_marker.c: * image/image_tiff.c: * image/ps_core.c: * lib/cursor.c: * lib/flcolor.c: squash warnings about 'var may be uninitialized' when compiling with gcc -W -Wall by explicitly initializing all parts of the arrays in the above files. 2003-11-19 Angus Leeming * autogen.sh: enable the use of autoconf 2.58. 2003-11-19 Angus Leeming * lib/OS2 and all files therein: removed. * lib/Makefile.am: remove mention of OS2. * lib/Readme: removed. * os2move.cmd: removed. * gl/canvas.h: removed. * gl/Makefile.am: remove canvas.h. 2003-11-19 Jean-Marc Lasgouttes * lib/flinternal.h: remove obsolete comment * config/xformsinclude.m4 (XFORMS_PATH_XPM): honor X_CFLAGS to find xpm.h (should fix problem reported by Reed Riddle) * README: update. In particular, the acknowledgement of copyright has been removed since the code is not here anymore (and the advertising clause is not needed anymore). Try to point to the new nongnu.org site. * Makefile.am (dist-hook): remove old leftover from LyX (EXTRA_DIST): do not distribute xforms.spec, which is generated at configure time * lib/signal.c (default_signal_handler): fix typo 2003-11-14 Jean-Marc Lasgouttes * config/config.guess: * config/config.sub: * config/libtool.m4: * config/ltmain.sh: updated from libtool 1.4.3 (as distributed with rh9) * config/depcomp: updated from automake 1.4 (as distributed with rh9) 2003-11-18 Angus Leeming * xforms.spec.in: update the %doc list to reflect actuality. 2003-11-18 Jean-Marc Lasgouttes * INSTALL: generic instructions from autoconf. 2003-10-03 Angus Leeming Patch from Matthew Yaconis by way of David Dembrow . * lib/fselect.c: remove the arbitrary restriction on the display of borderless forms. * lib/tabfolder.c: display the tab forms correctly when using bottom tab folders. 2003-11-13 Jean-Marc Lasgouttes * config/common.am: do not set LIBS to an empty value * image/Makefile.am (INCLUDES): * lib/Makefile.am (INCLUDES): honor X_CFLAGS * demos/Makefile.am: * fdesign/Makefile.am: * fd2ps/Makefile.am: use $(foo) form instead of @foo@ for variables references. Honor X_LIBS, X_PRE_LIBS and X_EXTRA_LIBS. 2003-09-10 Jean-Marc Lasgouttes * Makefile.am: only build the gl/ directory if required * configure.ac: simplify handling of --enable-demos. Add support for --disable-gl option; gl support is only compiled in if GL/glx.h is found 2003-09-09 Jean-Marc Lasgouttes * config/xformsinclude.m4 (XFORMS_CHECK_LIB_JPEG): no need to link against the X11 libs... * configure.ac: remove lots of checks for headers and functions. We only keep the ones that were already tested for in the old source (although we do not know whether they are still useful). * lib/asyn_io.c: use HAVE_SYS_SELECT_H 2003-09-09 Jean-Marc Lasgouttes * Makefile.am: only build demos/ directory if required * configure.ac: add --enable-demos option 2003-09-09 Angus Leeming * lib/forms.c (fl_keyboard): pass it the event to allow it to distinguish between KeyPress and KeyRelease events. (dispatch_key): new function, factored out of do_keyboard. (do_keyboard): Handles KeyRelease events correctly. The KeyPress keysym is stored and then dispatched on KeyRelease also, since XmbLookupString is undefined on a KeyRelease event. 2003-09-05 Jean-Marc Lasgouttes * lib/version.c (fl_print_version): remove workaround for XENIX * lib/local.h: remove NO_SOCK (who wants to support old SCO anyway?) 2003-07-31 Jean-Marc Lasgouttes * lib/local.h (FL_SIGRET): * lib/signal.c (default_signal_handler): use RETSIGTYPE instead of FL_SIG_RET * lib/errmsg.c (fl_get_syserror_msg): use HAVE_STRERROR * lib/sysdep.c (fl_msleep): use HAVE_USLEEP * lib/local.h: remove variables DONT_HAVE_USLEEP, DONT_HAVE_STRERROR, NO_CONST (handled by AC_C_CONST), FL_SIGRET_IS_VOID, FL_SIGRET * configure.ac: check for usleep too 2003-05-23 Angus Leeming * image/rgb_db.c: follow Rouben Rostamian's advice and remove all the helper functions that were used to ascertain the name of the RGB color before he rewrote fl_lookup_RGBcolor. * flimage.h: add a comment to the declaration of fl_init_RGBdatabase that is does nothing and is retained for compatibility only. 2003-05-23 Angus Leeming * lib/include/Basic.h: remove declarations of functions fl_init_RGBdatabase and fl_lookup_RGBcolor as they are part of libflimage, not libforms. 2003-05-30 Angus Leeming * Changes: renamed as NEWS. * COPYING: renamed as COPYING.LIB. * 00README: renamed as README. 2003-05-22 Jean-Marc Lasgouttes * lib/include/Makefile.am: make sure that forms.h is not distributed 2003-05-21 Jean-Marc Lasgouttes * configure.ac: do not set VERSION explicitely, this is done in XFORMS_SET_VERSION. * config/xformsinclude.m4 (XFORMS_SET_VERSION): simplify a tiny bit 2003-05-22 Rouben Rostamian * image/rgb_db.c (fl_lookup_RGBcolor): this function fell off the dist at 1.0pre3. Now it is back again with a shiny new, more efficient implementation. 2003-05-05 Jean-Marc Lasgouttes * lib/include/Makefile.am (forms.h): create forms.h using the target stamp-forms, so that it remains untouched when AAA.h is regenerated but did not change. * lib/include/AAA.h.in: new file. This is the template from which AAA.h is generated * lib/include/.cvsignore: add AAA.h * configure.ac: call XFORMS_SET_VERSION; generate AAA.h from AAA.h.in * config/xformsinclude.m4 (XFORMS_SET_VERSION): new macro, which sets the VERSION string for xforms (XFORMS_CHECK_VERSION): simplify a bit 2003-04-24 Jean-Marc Lasgouttes * image/image_fits.c (Bad_bpp): use abs() and not fabs(), since bpp is an int 2003-04-24 Angus Leeming Migrate from imake to autoconf/automake. * Imakefile: * Imakefile.os2: * demos/Imakefile: * demos/Imakefile.os2: * fd2ps/Imakefile: * fd2ps/Imakefile.os2: * fdesign/Imakefile: * fdesign/Imakefile.os2: * fdesign/Imakefile.xxx: * gl/Imakefile: * image/Imakefile: * lib/Imakefile: * lib/Imakefile.os2: * lib/OS2/Imakefile.os2: * lib/include/Imakefile: removed. * autogen.sh: * configure.ac: * config/.cvsignore: * config/common.am: * config/config.guess: * config/config.sub: * config/cygwin.m4: * config/depcomp: * config/libtool.m4: * config/ltmain.sh: * config/xformsinclude.m4: Here be magic ;-) * Makefile.am: * config/Makefile.am: * demos/Makefile.am: * demos/fd/Makefile.am: * fd2ps/Makefile.am: * fd2ps/test/Makefile.am: * fdesign/Makefile.am: * fdesign/fd/Makefile.am: * fdesign/fd4test/Makefile.am: * fdesign/notes/Makefile.am: * fdesign/spec/Makefile.am: * fdesign/xpm/Makefile.am: * gl/Makefile.am: * image/Makefile.am: * lib/Makefile.am: * lib/OS2/Makefile.am: * lib/bitmaps/Makefile.am: * lib/fd/Makefile.am: * lib/include/Makefile.am: * lib/private/Makefile.am: added. * xforms.spec.in: the RPM spec file. * lib/local.h: make use of the HAVE_STRCASECMP preprocessor variable. * lib/pixmap.c: use XPM_H_LOCATION instead of pre-processor stuff. * demos/demotest.c: define the callback. * fd2ps/sys.c: use preprocessor variable HAVE_STRCASECMP rather than NO_STRCASECMP. * fd2ps/sys.h: now redundant, so remove it. * fd2ps/fd2ps.h: * fd2ps/sys.c: remove #include "sys.h" * gl/canvas.h: * gl/glcanvas.h: make use of HAVE_GL_GLX_H preprocessor variable. 2003-04-24 Angus Leeming * lib/tabfolder.c (handle): ensure that we have an active folder before trying to manipulate its contents. 2003-04-24 Angus Leeming * lib/include/Imakefile: do not copy the generated forms.h to ../. * lib/Imakefile: remove the targets to install forms.h. * pretty well all .c files: change #include "forms.h" to #include "include/forms.h". 2003-04-22 Angus Leeming * fd2ps/sys.h: remove #define NO_STRDUP and FL_SIGRET as they aren't used. 2003-04-22 Angus Leeming * */*.c: ensure that config.h is #included if the HAVE_CONFIG_H preprocessor variable is set. 2003-04-22 Angus Leeming * lib/include/zzz.h: remove the #include "flinternal.h" line whose inclusion depends on the MAKING_FORMS preprocessor variable. * lib/forms.h: * lib/include/forms.h: regenerated. 2003-04-20 Angus Leeming * demos/wwwl.c: #include "private/flsnprintf.h". 2003-04-20 Angus Leeming * lib/private/flsnprintf.h: use #defines to prevent needless fl_snprintf bloat. * lib/flsnprintf.c: prepend portable_v?snprintf with "fl_" to prevent name clashes with other software. Make these functions globally accessible. Importantly, #if 0...#endif a block that prevents the code from linking correctly on the DEC. 2003-04-20 Angus Leeming * image/image.c: * lib/errmsg.c: no need to check for fl_vsnprintf anymore. 2003-04-20 Angus Leeming * demos/Imakefile: * fd2ps/Imakefile: * fdesign/Imakefile: * gl/Imakefile: * image/Imakefile: * lib/Imakefile: pass the expected -DHAVE_SNPRINTF options to the compiler. 2003-04-17 Angus Leeming Make fl_snprintf private. * lib/include/flsnprintf.h: moved to lib/private/flsnprintf.h. * lib/include/Imakefile: remove flsnprintf.h. * lib/forms.h: * lib/include/forms.h: regenerated. * fdesign/fd_attribs.c: * image/image.c: * image/image_io_filter.c: * image/image_postscript.c: * lib/choice.c: * lib/cmd_br.c: * lib/events.c: * lib/flresource.c: * lib/fselect.c: * lib/goodie_alert.c: * lib/goodie_choice.c: * lib/goodie_msg.c: * lib/goodie_salert.c: * lib/version.c: * lib/xpopup.c: add #include "private/flsnprintf.h". 2003-04-17 Jean-Marc Lasgouttes * lib/Imakefile (EXTRA_INCLUDES): add $(XPMINC) 2003-04-17 Angus Leeming * demos/Imakefile: * fd2ps/Imakefile: * fdesign/Imakefile: * gl/Imakefile: * image/Imakefile: * lib/Imakefile: don't pass -Iprivate to the complier. * fdesign/fd_super.c: * fdesign/sp_browser.c: * fdesign/sp_choice.c: * fdesign/sp_counter.c: * fdesign/sp_dial.c: * fdesign/sp_menu.c: * fdesign/sp_positioner.c: * fdesign/sp_xyplot.c: * image/image_postscript.c: * image/postscript.c: * image/ps_core.c: * image/ps_draw.c: * image/ps_text.c: * lib/browser.c: * lib/canvas.c: * lib/choice.c: * lib/counter.c: * lib/dial.c: * lib/flinternal.h: * lib/formbrowser.c: * lib/menu.c: * lib/objects.c: * lib/positioner.c: * lib/scrollbar.c: * lib/sldraw.c: * lib/slider.c: * lib/textbox.c: * lib/thumbwheel.c: * lib/valuator.c: * lib/xyplot.c: associated changes to the #include directives. 2003-04-17 Angus Leeming * lib/xforms.5: renamed as xforms.man. This probably breaks the installation, but that is all slated for change anyway. 2003-04-17 Angus Leeming * demos/Imakefile: do not -Ifd when compiling. * demos/Imakefile: * demos/buttonall.c: * demos/demotest.c: * demos/dirlist.c: * demos/folder.c: * demos/formbrowser.c: * demos/ibrowser.c: * demos/inputall.c: * demos/itest.c: * demos/scrollbar.c: * demos/thumbwheel.c: associated changes. * demos/.cvsignore: add all the generated executables. 2003-04-17 Angus Leeming * lib/include/canvas.h: cruft removal. Don't mention glcanvas.h here in case the user does not want GL support. * lib/include/forms.h * lib/forms.h: regenerated. * gl/glcanvas.c: include glcanvas.h as this is no longer in forms.h 2003-04-16 Angus Leeming Remove the SNP directory and replace it with a single file, flsnprintf.c. Invoke snprintf through a wrapper fl_snprintf. * Imakefile: remove SUBDIR snp. * lib/flsnprintf.c, lib/include/flsnprintf.h: new files. * lib/include/Imakefile: add flsnprintf.h to the files used to generated forms.h. * lib/forms.h * lib/include/forms.h: regenerated. * lib/Imakefile: add flsnprintf.c. Pass -DHAVE_SNPRINTF as a compiler option. * lib/local.h: remove HAVE_SNPRINTF stuff. * demos/Imakefile: * fd2ps/Imakefile: * fdesign/Imakefile: * gl/Imakefile: * image/Imakefile: pass -DHAVE_SNPRINTF as a compiler option. Remove other SNP stuff. * demos/wwwl.c: * fdesign/fd_attribs.c: * image/image.c: * image/image_io_filter.c: * image/image_postscript.c: * lib/choice.c: * lib/cmd_br.c: * lib/errmsg.c: * lib/events.c: * lib/flresource.c: * lib/fselect.c: * lib/goodie_alert.c: * lib/goodie_choice.c: * lib/goodie_msg.c: * lib/goodie_salert.c: * lib/version.c: * lib/xpopup.c: s/\(v*snprintf\)/fl_\1/ * snp/*: all files removed. 2003-04-15 Angus Leeming * lots of files: reduce the amount of magic includes of header files and therefore include flinternal.h explicitly much more. 2003-04-15 Angus Leeming * .cvsignore: * demos/.cvsignore: * fd2ps/.cvsignore: * fdesign/.cvsignore: * gl/.cvsignore: * image/.cvsignore: * libs/.cvsignore: * libs/include/.cvsignore: prepare the way for autoconf/automake. 2003-04-10 Angus Leeming * lib/include/Basic.h: add FL_RESIZED to the FL_EVENTS enum. * lib/include/AAA.h: up FL_FIXLEVEL to 2 to reflect this. * lib/forms.h: * lib/include/forms.h: regenerated. * lib/forms.c (scale_form): pass event FL_RESIZED to the object handler if the object size is changed. * lib/tabfolder.c (handle): handle the FL_RESIZED event to ensure that the currently active folder is resized. 2003-04-10 Angus Leeming * lib/version.c (fl_print_version, fl_library_version): use FL_VERSION, FL_REVISION rather than RCS stuff. 2003-04-10 Angus Leeming * most files: Remove all the RCS strings from the header files and about half of 'em from the .c files. 2003-04-10 John Levon * lib/pixmap.c (init_xpm_attributes): "fix" XPixmaps containing colour "opaque". 2003-04-09 Angus Leeming * demos/.cvsignore: * snp/.cvsignore: Ignore Makefile* 2003-04-09 Angus Leeming Move tabfolder-specific code out of forms.c and allow individual FL_OBJECTs to respond to such events. Means that the library becomes extensible to new, user-defined widgets once again. * lib/include/Basic.h: add FL_MOVEORIGIN to the FL_EVENTS enum. * lib/forms.h: * lib/include/forms.h: regenerated automatically. * lib/forms.c (fl_handle_form): no longer a static function. Dispatch FL_MOVEORIGIN events to the form's constituent objects. (fl_get_tabfolder_origin): removed. Functionality moved into tabfolder.c. (do_interaction_step): no longer call fl_get_tabfolder_origin. Instead, dispatch a call to fl_handle_form(form, FL_MOVEORIGIN, ...). * lib/tabfolder.c (handle): add FL_MOVEORIGIN to the event switch. Update the x,y absolute coords of the active_folder and dispatch a call to fl_handle_form(active_folder, FL_MOVEORIGIN, ...) to ensure that the x,y absolute coords of nested tabfolders are also updated. 2003-04-09 Jean-Marc Lasgouttes * image/Imakefile (EXTRA_INCLUDES): change the order of includes, to avoid that an older installed forms.h is used instead of the fresh one 2003-04-09 Angus Leeming * lib/objects.c (hide_tooltip): renamed as checked_hide_tooltip. (unconditional_hide_tooltip): new static helper function, invoked within fl_handle_it on FL_KEYPRESS and FL_PUSH events. * lib/include/AAA.h: up-ed FL_FIXLEVEL to 1 to reflect the changes made above. * lib/forms.h: regenerated to reflect changed FL_FIXLEVEL. * version.c (version): update to reflect this also. 2003-04-08 Angus Leeming Enable tooltips to be shown correctly in "composite" widgets such as the browser. * lib/objects.c (get_parent): new static helper function. Given an FL_OBJECT*, returns its parent FL_OBJECT. (tooltip_handler): rewritten to show the tooltip that is stored by the parent FL_OBJECT. (hide_tooltip): new static helper function: on leaving an FL_OBJECT, only hide the tooltip if we have also left the bounds of the parent FL_OBJECT. (fl_handle_it): make use of these new functions to show and hide tooltips. 2003-04-08 Angus Leeming * image/image_rotate.c (flimage_rotate): enable the rotation of grayscale images by 90 degree multiples and more generally prevent other unsupported image types from crashing xforms. * lib/flresource.c (fl_initialize): clean-up properly if we fail to create input contexts or methods. * lib/textbox.c (handle_textbox): * lib/thumbwheel.c (handle): * lib/util.c (flevent): FL_KEYBOARD has been replaced by FL_KEYPRESS. The former is retained for compatability, but the latter should be used internally. xforms-1.2.4/fdesign/0000775000175000017500000000000012353624653011467 500000000000000xforms-1.2.4/fdesign/fd_printC.c0000664000175000017500000012663112353623325013467 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fd_printC.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Generate header/C files */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "fd_main.h" #include "private/flsnprintf.h" #include "fd_spec.h" #include "sp_menu.h" #ifdef WIN32 #include #endif /*************************************** ***************************************/ void make_backup( const char *s ) { char *buf; if ( access( s, R_OK ) ) { if ( errno != ENOENT ) M_err( "make_backup", "Creating backup file %s.bak failed", s ); return; } buf = malloc( strlen( s ) + 5 ); sprintf( buf, "%s.bak", s ); #ifdef __EMX__ if ( unlink( buf ) ) { M_err( "make_backup", "Creating backup file %s failed", buf ); free( buf ); return; } #endif if ( rename( s, buf ) ) M_err( "make_backup", "Creating backup file %s failed %s", buf, strerror( errno ) ); free( buf ); } /*************************************** ***************************************/ static char const * filename_only( char const * filename ) { char const * ptr = strrchr( filename, '/' ); if ( ptr ) return ptr + 1; return filename; } /*************************************** ***************************************/ static int build_fname( char * fname, size_t fname_capacity, char const * filename, char const * ext ) { int npc; if ( fdopt.output_dir ) npc = fli_snprintf( fname, fname_capacity, "%s%s%s%s", fdopt.output_dir, fdopt.output_dir[ strlen( fdopt.output_dir ) - 1 ] != '/' ? "/" : "", filename_only( filename ), ext ); else npc = fli_snprintf( fname, fname_capacity, "%s%s", filename, ext ); /* Older libc return -1 if text doesn't, newer ones the total number of chars that would have been written if there would have been enough space */ return npc >= 0 && ( size_t ) npc <= fname_capacity; } /*************************************** * Note: 'filename' has no extensions ***************************************/ int C_output( const char * filename, FRM * forms, int fnumb ) { char fname[ PATH_MAX + 1 ]; const char *name_only; int i; FILE *fn; FL_OBJECT *obj; int use_glcanvas = 0; /* Figure out the name of the file without any path */ if ( ( name_only = strrchr( filename, '/' ) ) ) ++name_only; else name_only = filename; if ( ! build_fname( fname, sizeof fname, filename, ".h" ) ) { if ( ! fdopt.conv_only ) fl_show_alert( "Can't create header file!", "Filename is too long:", "", 1 ); else M_err( "C_output", "Can't create header file, filename is too long" ); return 0; } make_backup( fname ); if ( ! ( fn = fopen( fname, "w" ) ) ) { if ( ! fdopt.conv_only ) fl_show_alert( "Can't open header file!", fname, "", 1 ); else M_err( "C_output", "Can't create open header file '%s'", fname ); return 0; } fprintf( fn, "/* Header file generated by fdesign on %s */\n\n" "#ifndef %s_h_\n" "#define %s_h_\n\n" "#include %c%s%c\n", fl_now( ), get_fd_name( forms[ 0 ].fname ), get_fd_name( forms[ 0 ].fname ), xform_header[ 0 ] == '"' ? ' ' : '<', xform_header, xform_header[ 0 ] == '"' ? ' ' : '>' ); for ( i = 0; i < fnumb && ! use_glcanvas; i++ ) { obj = forms[ i ].form->first; while ( ( obj = obj->next ) != NULL ) if ( obj->objclass == FL_GLCANVAS ) { use_glcanvas = 1; break; } } if ( use_glcanvas ) fprintf( fn, "#include <%s>\n", glcanvas_header ); fprintf( fn, "\n/* Callbacks, globals and object handlers */\n\n" ); for ( i = 0; i < fnumb; i++ ) print_callbacks_and_globals( fn, forms[ i ].form, 0 ); fprintf( fn, "\n/* Forms and Objects */\n\n" ); for ( i = 0; i < fnumb; i++ ) print_header( fn, forms[ i ].form, forms[ i ].fname ); if ( fdopt.altformat ) fprintf( fn, "\n/* Creation Routine */\n\n" "void %s( void );\n", main_name ); fprintf( fn, "\n#endif /* %s_h_ */\n", get_fd_name( forms[ 0 ].fname ) ); fclose( fn ); /* Make the .c file. */ if ( ! build_fname( fname, sizeof fname, filename, ".c" ) ) { if ( ! fdopt.conv_only ) fl_show_alert( "Can't create C file!", "Filename is too long.", "", 1 ); else M_err( "C_output", "Can't create C file, filename is too long" ); return 0; } make_backup( fname ); if ( ! ( fn = fopen( fname, "w" ) ) ) { if ( ! fdopt.conv_only ) fl_show_alert( "Can't open C file!", fname, "", 1 ); else M_err( "C_output", "Can't open C file '%s'", fname ); return 0; } fprintf( fn, "/* Form definition file generated by fdesign on %s */\n\n" "#include \n" "#include \"%s.h\"\n\n", fl_now( ), name_only ); for ( i = 0; i < fnumb; i++ ) print_form( fn, forms[ i ].form, forms[ i ].fname ); if ( fdopt.altformat ) { fprintf( fn, "void %s( void )\n{\n", main_name ); for ( i = 0; i < fnumb; i++ ) fprintf( fn, " create_form_%s( );\n", forms[ i ].fname ); fprintf( fn, "}\n" ); } fclose( fn ); /* Check if we need to output a template for the main program */ if ( fdopt.emit_main ) { if ( ! build_fname( fname, sizeof fname, filename, "_main.c" ) ) { if ( ! fdopt.conv_only ) fl_show_alert( "Can't create C file for main() function!", "Filename is too long:", "", 1 ); else M_err( "C_output", "Can't create C file for main() function, " "filename is too long" ); reset_dupinfo_cache( ); return 0; } make_backup( fname ); if ( ! ( fn = fopen( fname, "w" ) ) ) { if ( ! fdopt.conv_only ) fl_show_alert( "Can't open file for main() function!", "", "", 1 ); else M_err( "C_output", "Can't open file for main() function!" ); reset_dupinfo_cache( ); return 0; } /* Print out the include for the header file and then all the code */ fprintf( fn, "#include \"%s.h\"\n\n", name_only ); output_main( fn, forms, fnumb ); fclose( fn ); } /* Output callback stubs */ if ( fdopt.emit_cb ) { if ( ! build_fname( fname, sizeof fname, filename, "_cb.c" ) ) { if ( ! fdopt.conv_only ) fl_show_alert( "Can't create C file for callbacks!", "Filename is too long:", "", 1 ); else M_err( "C_output", "Can't create C file for callbacks, " "filename is too long" ); reset_dupinfo_cache( ); return 0; } make_backup( fname ); if ( ! ( fn = fopen( fname, "w" ) ) ) { if ( ! fdopt.conv_only ) fl_show_alert( "Can't open C file for callbacks!", fname, "", 1 ); else M_err( "C_output", "Can't open C file for callbacks '%s'", fname ); reset_dupinfo_cache( ); return 0; } /* Print out the include for the header file and then all the code */ fprintf( fn, "#include \"%s.h\"\n\n", name_only ); output_callbacks( fn, forms, fnumb ); fclose( fn ); } reset_dupinfo_cache( ); return 1; } /* Some attributes query routines */ #define VN( v ) { v, #v, NULL, NULL } #define PVN( v ) v, #v VN_pair vn_btype[ ] = { { PVN( FL_NO_BOX ), "No box%r1", "Nn#n" }, { PVN( FL_UP_BOX ), "Up box%r1", "Uu#u" }, { PVN( FL_DOWN_BOX ), "Down box%r1", "Dd#d" }, { PVN( FL_BORDER_BOX ), "Border box%r1", "Bb#b" }, { PVN( FL_SHADOW_BOX ), "Shadow box%r1", "Ss#s" }, { PVN( FL_FRAME_BOX ), "Frame box%r1", "Ff#f" }, { PVN( FL_ROUNDED_BOX ), "Rounded box%r1", "Rr#r" }, { PVN( FL_EMBOSSED_BOX ), "Embossed box%r1", "Ee#e" }, { PVN( FL_FLAT_BOX ), "Flat box%r1", "Ff#f" }, { PVN( FL_RFLAT_BOX ), "Rflat box%r1", "lL#l" }, { PVN( FL_RSHADOW_BOX ), "Rshadow box%r1", "wW#w" }, { PVN( FL_OVAL_BOX ), "Oval box%r1", "Oo#o" }, { PVN( FL_ROUNDED3D_UPBOX ), "rounded3d upbox%r1", "nN#n" }, { PVN( FL_ROUNDED3D_DOWNBOX ), "rounded3d downbox%r1", "oO#o" }, { PVN( FL_OVAL3D_UPBOX ), "Oval3d upbox%r1", "vV#v" }, { PVN( FL_OVAL3D_DOWNBOX ), "Oval3d downbox%r1", "lL#l" }, { PVN( FL_OVAL3D_FRAMEBOX ), "Oval3d framebox%r1", "eE#e" }, { PVN( FL_OVAL3D_EMBOSSEDBOX ), "Oval3d embossed%r1", "eE#e" }, #if 0 { PVN( FL_TOPTAB_UPBOX ), "toptab%r1", "tT#t" }, { PVN( FL_SELECTED_TOPTAB_UPBOX ), "selected toptab%r1", "sS#s" }, #endif { PVN( -1 ), NULL, NULL } }; VN_pair vn_align[ ] = { VN( FL_ALIGN_TOP ), VN( FL_ALIGN_BOTTOM ), VN( FL_ALIGN_LEFT ), VN( FL_ALIGN_RIGHT ), VN( FL_ALIGN_CENTER ), VN( FL_ALIGN_RIGHT_TOP ), VN( FL_ALIGN_LEFT_TOP ), VN( FL_ALIGN_RIGHT_BOTTOM ), VN( FL_ALIGN_LEFT_BOTTOM ), VN( FL_ALIGN_TOP_RIGHT ), /* need them for backward compatibility */ VN( FL_ALIGN_TOP_LEFT ), VN( FL_ALIGN_BOTTOM_RIGHT ), VN( FL_ALIGN_BOTTOM_LEFT ), { -1, NULL, NULL, NULL } }; static VN_pair vn_lsize[ ] = { VN( FL_DEFAULT_SIZE ), VN( FL_TINY_SIZE ), VN( FL_SMALL_SIZE ), VN( FL_NORMAL_SIZE ), VN( FL_MEDIUM_SIZE ), VN( FL_LARGE_SIZE ), VN( FL_HUGE_SIZE ), VN( FL_DEFAULT_FONT ), VN( FL_TINY_FONT ), VN( FL_SMALL_FONT ), VN( FL_NORMAL_FONT ), VN( FL_MEDIUM_FONT ), VN( FL_LARGE_FONT ), VN( FL_HUGE_FONT ), { FL_SMALL_FONT, "FL_NORMAL_FONT1", NULL, NULL }, { FL_NORMAL_FONT, "FL_NORMAL_FONT2", NULL, NULL }, { -1, NULL, NULL, NULL } }; static VN_pair vn_lstyle[ ] = { VN( FL_NORMAL_STYLE ), VN( FL_BOLD_STYLE ), VN( FL_ITALIC_STYLE ), VN( FL_BOLDITALIC_STYLE ), VN( FL_FIXED_STYLE ), VN( FL_FIXEDBOLD_STYLE ), VN( FL_FIXEDITALIC_STYLE ), VN( FL_FIXEDBOLDITALIC_STYLE ), VN( FL_TIMES_STYLE ), VN( FL_TIMESBOLD_STYLE ), VN( FL_TIMESITALIC_STYLE ), VN( FL_TIMESBOLDITALIC_STYLE ), VN( FL_SHADOW_STYLE ), VN( FL_ENGRAVED_STYLE ), VN( FL_EMBOSSED_STYLE ), { -1, NULL, NULL, NULL } }; VN_pair vn_gravity[] = { VN( FL_NoGravity ), VN( FL_NorthWest ), VN( FL_North ), VN( FL_NorthEast ), VN( FL_West ), VN( FL_East ), VN( FL_South ), VN( FL_SouthEast ), VN( FL_SouthWest ), VN( FL_ForgetGravity ), VN( ForgetGravity ), VN( NorthWestGravity ), VN( NorthGravity ), VN( NorthEastGravity ), VN( WestGravity ), VN( EastGravity ), VN( SouthGravity ), VN( SouthEastGravity ), VN( SouthWestGravity ), { -1, NULL, NULL, NULL } }; VN_pair vn_resize[ ] = { VN( FL_RESIZE_NONE ), VN( FL_RESIZE_X ), VN( FL_RESIZE_Y ), VN( FL_RESIZE_ALL ), { -1, NULL, NULL, NULL } }; static VN_pair vn_unit[ ] = { VN( FL_COORD_PIXEL ), VN( FL_COORD_MM ), VN( FL_COORD_centiMM ), VN( FL_COORD_POINT ), VN( FL_COORD_centiPOINT ), { FL_COORD_PIXEL, "pixel", NULL, NULL }, { FL_COORD_MM, "mm", NULL, NULL }, { FL_COORD_POINT, "point", NULL, NULL }, { FL_COORD_centiPOINT, "cp", NULL, NULL }, { FL_COORD_centiMM, "cmm", NULL, NULL }, { FL_COORD_centiPOINT, "cpoint", NULL, NULL }, { -1, NULL, NULL, NULL } }; /*************************************** ***************************************/ int get_vn_val( VN_pair * vn, const char * name ) { long val; char *ep; for ( ; vn->name; vn++ ) if ( strcmp( name, vn->name ) == 0 ) return vn->val; val = strtol( name, &ep, 10 ); if ( ep != name && ! *ep && val >= INT_MIN && val <= INT_MAX ) return val; return -1; } /*************************************** ***************************************/ char * get_vn_name( VN_pair * vn, int val ) { static char buf[ MAX_TYPE_NAME_LEN ]; for ( ; vn->name; vn++ ) if ( vn->val == val ) return vn->name; sprintf( buf, "%d", val ); return buf; } static void output_object( FILE * fn, FL_OBJECT * obj, int ); static void pre_form_output( FILE * fn ); static void post_form_output( FILE * fn ); /*************************************** ***************************************/ static void emit_attrib( FILE * fp, int a, VN_pair * vn, const char * aname ) { const char *s; if ( vn == vn_align ) s = align_name( a, 1 ); else s = get_vn_name( vn, a ); fprintf( fp, " %s( obj, %s );\n", aname, s ); } /*************************************** ***************************************/ static char * pure_style_name( int val ) { VN_pair *vn = vn_lstyle; static char buf[ 64 ]; for ( ; vn->name && vn->val != val; vn++ ) /* empty */ ; if ( vn->val == val ) return vn->name; else { sprintf( buf, "%d", val ); return buf; } } /*************************************** ***************************************/ static int pure_style_val( const char * cc ) { VN_pair *vn = vn_lstyle; for ( ; vn->name && strcmp( cc, vn->name ); vn++ ) /* empty */; return ( vn->name && ! strcmp( cc, vn->name ) ) ? vn->val : atoi( cc ); } /*************************************** ***************************************/ char * style_name( int style ) { static char buf[ 64 ]; int lstyle = style % FL_SHADOW_STYLE; int spstyle = ( style / FL_SHADOW_STYLE ) * FL_SHADOW_STYLE; strcpy( buf, pure_style_name( lstyle ) ); if ( spstyle ) strcat( strcat( buf, " + " ), pure_style_name( spstyle ) ); return buf; } /*************************************** ***************************************/ int style_val( const char * cc ) { char lstyle[ MAX_TYPE_NAME_LEN ], spstyle[ MAX_TYPE_NAME_LEN ], *p; fli_sstrcpy( lstyle, cc, sizeof lstyle ); *spstyle = '\0'; if ( ( p = strchr( lstyle, '|' ) ) || ( p = strchr( lstyle, '+' ) ) ) { strcpy( spstyle, p + 1 ); *p = 0; } return pure_style_val( lstyle ) + pure_style_val( spstyle ); } /*************************************** ***************************************/ char * lsize_name( int val ) { return get_vn_name( vn_lsize, val ); } /*************************************** ***************************************/ int lsize_val( const char * cc ) { return get_vn_val( vn_lsize, cc ); } /*************************************** ***************************************/ char * gravity_name( int val ) { return get_vn_name( vn_gravity, val ); } /*************************************** ***************************************/ int gravity_val( const char * cc ) { return get_vn_val( vn_gravity, cc ); } /*************************************** ***************************************/ char * resize_name( int val ) { return get_vn_name( vn_resize, val ); } /*************************************** ***************************************/ int resize_val( const char * cc ) { return get_vn_val( vn_resize, cc ); } /*************************************** ***************************************/ const char * align_name( int val, int with_spaces ) { static char buf[ 128 ]; strcpy( buf, get_vn_name( vn_align, fl_to_outside_lalign( val ) ) ); if ( fl_is_inside_lalign( val ) && ! fl_is_center_lalign( val ) ) { strcat( buf, with_spaces ? " | " : "|" ); strcat( buf, "FL_ALIGN_INSIDE" ); } return buf; } /*************************************** ***************************************/ int align_val( const char * cc ) { char s[ MAX_TYPE_NAME_LEN ], *p; int val; fli_sstrcpy( s, cc, sizeof s ); if ( ( p = strchr( s, '|' ) ) ) { *p = '\0'; while ( isspace( ( unsigned char ) *--p ) ) *p = '\0'; } val = get_vn_val( vn_align, s ); return p ? fl_to_inside_lalign( val ) : val; } /*************************************** ***************************************/ char * boxtype_name( int val ) { return get_vn_name( vn_btype, val ); } /*************************************** ***************************************/ int boxtype_val( const char * cc ) { return get_vn_val( vn_btype, cc ); } /*************************************** ***************************************/ char * unit_name( int val ) { return get_vn_name( vn_unit, val ); } /*************************************** ***************************************/ int unit_val( const char * s ) { return get_vn_val( vn_unit, s ); } /*** End of attributes query routines ***/ /*------------- Keeping track of array names. -------------------*/ #define MAXARNAME 100 static char *arnames[ MAXARNAME ]; static unsigned long arsizes[ MAXARNAME ]; static size_t anumb = 0; /*************************************** * Initializes the aray names. ***************************************/ static void init_array_names( void ) { anumb = 0; } /*************************************** * Checks whether an object name is an array name and remembers it ***************************************/ static int check_array_name( char * aname ) { char tmpstr[ MAX_VAR_LEN ]; char *p, *ep; unsigned long ind; size_t i; if ( ! ( p = strchr( aname, '[' ) ) ) return FL_FALSE; strcpy( tmpstr, aname ); p = tmpstr + ( p - aname ); ind = strtoul( p + 1, &ep, 10 ); if ( ep == p + 1 ) ind = 0; *p = 0; for ( i = 0; i < anumb; i++ ) if ( strcmp( arnames[ i ], tmpstr ) == 0 ) { if ( ind + 1 > arsizes[ i ] ) arsizes[ i ] = ind + 1; return FL_TRUE; } if ( anumb == MAXARNAME ) return FL_FALSE; arnames[ anumb ] = malloc( MAX_VAR_LEN ); strcpy( arnames[ anumb ], tmpstr); arsizes[ anumb++ ] = ind + 1; return FL_TRUE; } /*************************************** ***************************************/ static int are_there_array_names( void ) { return anumb > 0; } /*************************************** * Prints the array names of the file. ***************************************/ static void print_array_names( FILE * fn, int newf ) { size_t i; for ( i = 0; i < anumb; i++ ) if ( ! newf ) { fprintf( fn, " *%s[ %lu ]", arnames[ i ], arsizes[ i ] ); if ( i < anumb - 1 ) fprintf( fn, ",\n" ); } else fprintf( fn, " FL_OBJECT * %s[ %lu ];\n", arnames[ i ], arsizes[ i ] ); } /*----------------------- Printing the C-code --------------------*/ /*************************************** * Prints the form description in C-code. Note that no matter what * the internal coordinate system is, externally we always have * positive y pointing upward from the lower-left corner of the * screen ***************************************/ const char * get_fd_name( const char * form_name ) { static char fdtname[ MAX_VAR_LEN ]; sprintf( fdtname, "FD_%s", form_name ); return fdtname; } /*************************************** ***************************************/ double get_conversion_factor( void ) { double sc = 1.0; if ( fdopt.unit == FL_COORD_POINT ) sc = 72.00 / fl_dpi; else if ( fdopt.unit == FL_COORD_MM ) sc = 25.40 / fl_dpi; else if ( fdopt.unit == FL_COORD_centiPOINT ) sc = 7200.00 / fl_dpi; else if ( fdopt.unit == FL_COORD_centiMM ) sc = 2540.00 / fl_dpi; return sc; } /*************************************** ***************************************/ int convert_u( FL_Coord l ) { return FL_nint( get_conversion_factor( ) * l ); } /* * emit fl_set_xxxx_shortcut instead of fl_set_object_shortcut */ static VN_pair scclass[ ] = { { FL_BUTTON, "button", 0, 0 }, { FL_LIGHTBUTTON, "button", 0, 0 }, { FL_ROUNDBUTTON, "button", 0, 0 }, { FL_CHECKBUTTON, "button", 0, 0 }, { FL_BITMAPBUTTON, "button", 0, 0 }, { FL_PIXMAPBUTTON, "button", 0, 0 }, { FL_INPUT, "input", 0, 0 }, { -1, NULL, 0, 0 } /* sentinel */ }; /*************************************** ***************************************/ static const char * supported_shortcut( int objclass ) { VN_pair *vn = scclass; for ( ; vn->val >= 0; vn++ ) if ( vn->val == objclass ) return vn->name; return "object"; } /*************************************** * Generate the C file for the forms we've defined. Header is generated * elsewhere. All default attributes are omitted. ***************************************/ static void print_form_newformat( FILE * fn, FL_FORM * form, const char * fname ) { FL_OBJECT *obj; char fdtname[ MAX_VAR_LEN ], fdvname[ MAX_VAR_LEN ]; strcpy( fdtname, get_fd_name( fname ) ); strcpy( fdvname, "fdui" ); /* Check if object specific stuff wants to write anything */ for ( obj = form->first; obj; obj = obj->next ) emit_objclass_spec_header( fn, obj ); fprintf( fn, "\n/***************************************\n" " ***************************************/\n\n" ); fprintf( fn, "%s *\ncreate_form_%s( void )\n{\n FL_OBJECT *obj;\n", fdtname, fname ); /* Note: we output code that casts the return value of fl_malloc() in order to make the it acceptable for C++ compilers */ fprintf( fn, " %s *%s = ( %s * ) fl_malloc( sizeof *%s );\n\n", fdtname, fdvname, fdtname, fdvname ); /* Take care of unit, borderwidth etc. that affect the entire form */ pre_form_output( fn ); fprintf( fn, " %s->vdata = %s->cdata = NULL;\n" " %s->ldata = 0;\n\n", fdvname, fdvname, fdvname ); fprintf( fn, " %s->%s = fl_bgn_form( FL_NO_BOX, %d, %d );\n", fdvname, fname, convert_u( form->w ), convert_u( form->h ) ); /* Don't output the first object, it's a box only used by fdesign */ if ( form->first ) for ( obj = form->first->next; obj; obj = obj->next ) output_object( fn, obj, 0 ); fprintf( fn, "\n fl_end_form( );\n\n"); if ( fdopt.compensate ) fprintf( fn, " fl_adjust_form_size( %s->%s );\n", fdvname, fname ); fprintf( fn, " %s->%s->%s = %s;\n", fdvname, fname, fdvname, fdvname ); /* Restore */ post_form_output( fn ); fprintf( fn, "\n return %s;\n}\n", fdvname ); } /*************************************** * Output C files for the forms defined, but slightly different from * the earlier routines. Activated by -altformat on the command line ***************************************/ static void print_form_altformat( FILE * fn, FL_FORM * form, const char * fname ) { FL_OBJECT *obj; char name[ MAX_VAR_LEN ]; int first = 1; /* Print the form declaration */ fprintf( fn, "FL_FORM *%s;\n\n", fname ); /* Print the object declarations */ init_array_names( ); obj = form->first; while ( ( obj = obj->next ) != NULL ) { get_object_name( obj, name, NULL, NULL ); if ( *name ) { if ( ! check_array_name( name ) ) { fprintf( fn, first ? "FL_OBJECT\n" : ",\n" ); first = 0; fprintf( fn, " *%s", name ); } } } if ( are_there_array_names( ) ) { fprintf( fn, first ? "FL_OBJECT\n" : ",\n"); first = 0; print_array_names( fn, 0 ); } fprintf( fn, first ? "\n" : ";\n\n" ); /* Check if object specific stuff wants to write anything */ for ( obj = form->first; obj; obj = obj->next ) emit_objclass_spec_header( fn, obj ); /* Print the defining procedure */ fprintf( fn, "\n\n/***************************************\n" " ***************************************/\n\n" ); fprintf( fn, "void\ncreate_form_%s( void )\n{\n FL_OBJECT *obj;\n\n", fname ); pre_form_output( fn ); fprintf( fn, " if ( %s )\n" " return;\n\n", fname ); fprintf( fn, " %s = fl_bgn_form( FL_NO_BOX, %d, %d );\n", fname, convert_u( form->w ), convert_u( form->h ) ); for ( obj = form->first; obj; obj = obj->next ) output_object( fn, obj, 1 ); fprintf( fn, " fl_end_form( );\n" ); if ( fdopt.compensate ) fprintf( fn, " fl_adjust_form_size( %s );\n", fname ); post_form_output( fn ); fprintf( fn, "\n}\n\n\n/*---------------------------------------*/\n\n" ); } /*************************************** * This is the routine called the output rotuine in fd_forms.c ***************************************/ void print_form( FILE * fn, FL_FORM * form, const char * fname ) { ( ! fdopt.altformat ? print_form_newformat : print_form_altformat ) ( fn, form, fname ); } /*************************************** * Check if a callback stub has already been emitted so we can suppress * duplicates as callbacks can be bound to multiple objects. * Potential problems: this check is only for a particular form, * if a callback is bound to multiple objects across many forms, * the callback will be output at least once per form. ***************************************/ static int already_emitted( FL_OBJECT * first, FL_OBJECT * curobj, const char * cb ) { char cbname[ MAX_VAR_LEN ]; FL_OBJECT *ob = first; for ( ob = first->next; ob && ob != curobj; ob = ob->next ) { get_object_name( ob, NULL, cbname, NULL ); if ( *cbname && strcmp( cbname, cb ) == 0 ) return 1; } return 0; } #define MAXFREEOBJ 16 /*************************************** ***************************************/ static char * get_free_handle( FL_OBJECT * ob, const char * name ) { static int n; static char buf[ 1024 ]; static FL_OBJECT *freeobj[ MAXFREEOBJ ]; if ( ob->c_vdata ) strcpy( buf, ob->c_vdata ); else if ( *name ) sprintf( buf, "freeobj_%s_handler", name ); else if ( *ob->label ) sprintf( buf, "freeobj_%s_handler", ob->label ); else { int i, k; for ( k = -1, i = 0; i < MAXFREEOBJ && k < 0; i++ ) if ( freeobj[ i ] == ob ) k = i; if ( k < 0 ) { k = ++n; freeobj[ k ] = ob; } sprintf( buf, "freeobj%d_handler", k ); } return buf; } /*************************************** * Prints the callback routines used in form ***************************************/ void print_callbacks_and_globals( FILE * fn, FL_FORM * form, int code ) { FL_OBJECT *obj; char name[ MAX_VAR_LEN ], cbname[ MAX_VAR_LEN ]; obj = form->first; while ( ( obj = obj->next ) != NULL ) { get_object_name( obj, name, cbname, NULL ); if ( obj->objclass == FL_FREE ) { if ( ! code ) { fprintf( fn, "int %s( FL_OBJECT *, int, FL_Coord, " "FL_Coord, int, void * );\n", get_free_handle( obj, name ) ); } else { const char * hname = get_free_handle( obj, name ); int width = strlen( hname ) + 1; fprintf( fn, "/***************************************\n" " ***************************************/\n\n" "int\n%s( FL_OBJECT * obj,\n" "%*s int ev,\n" "%*s FL_Coord mx,\n" "%*s FL_Coord my,\n" "%*s int key,\n" "%*s void * xev )\n" "{\n" " /* Free object handler code */\n\n" " return 0;\n" "}\n\n\n", hname, width, " ", width, " ", width, " ", width, " ", width, " " ); } } if ( *cbname && ! strstr( cbname, "::" ) && ! already_emitted( form->first, obj, cbname ) ) { if ( ! code ) fprintf( fn, "void %s( FL_OBJECT *, long );\n", cbname ); else fprintf( fn, "/***************************************\n" " ***************************************/\n\n" "void\n%s( FL_OBJECT * obj,\n" "%*s long data )\n" "{\n" " /* Fill-in code for callback here */\n" "}\n\n\n", cbname, ( int ) strlen( cbname ) + 1, " " ); } if ( obj->objclass == FL_MENU ) menu_emit_item_callback_headers( fn, obj, code ); if ( ! code ) emit_objclass_spec_global( fn, obj ); } fprintf( fn, "\n" ); } /*************************************** * Output header file that contains the form definition. ***************************************/ static void print_header_newformat( FILE * fn, FL_FORM * form, const char * fname) { FL_OBJECT *obj; char name[ MAX_VAR_LEN ], fdtname[ MAX_VAR_LEN ]; sprintf( fdtname, "FD_%s", fname ); fprintf( fn, "typedef struct {\n" " FL_FORM * %s;\n", fname ); fprintf( fn, " void * vdata;\n" " char * cdata;\n" " long ldata;\n"); init_array_names( ); for ( obj = form->first; obj; obj = obj->next ) { get_object_name( obj, name, NULL, NULL ); if ( *name && ! check_array_name( name ) ) fprintf( fn, " FL_OBJECT * %s;\n", name ); } if ( are_there_array_names( ) ) print_array_names( fn, 1 ); fprintf( fn, "} %s;\n", fdtname ); fprintf( fn, "\n%s * create_form_%s( void );\n", fdtname, fname ); } /*************************************** * Prints the object declarations used in form ***************************************/ static void print_header_altformat( FILE * fn, FL_FORM * form, const char * fname) { FL_OBJECT *obj; char name[ MAX_VAR_LEN ]; int first = 1; fprintf( fn, "extern FL_FORM *%s;\n\n", fname ); init_array_names( ); obj = form->first; while ( ( obj = obj->next ) != NULL ) { get_object_name( obj, name, NULL, NULL ); if ( *name ) { if ( ! check_array_name( name ) ) { fprintf( fn, first ? "extern FL_OBJECT\n" : ",\n" ); first = 0; fprintf( fn, " *%s", name ); } } } if ( are_there_array_names( ) ) { fprintf( fn, first ? "extern FL_OBJECT\n" : ",\n" ); first = 0; print_array_names( fn, 0 ); } if ( ! first ) fprintf( fn, ";\n\n" ); } /*************************************** ***************************************/ void print_header( FILE * fn, FL_FORM * form, const char * fname ) { ( ! fdopt.altformat ? print_header_newformat : print_header_altformat ) ( fn, form, fname ); } /* * All callback stubs */ /*************************************** ***************************************/ void output_callbacks( FILE * fn, FRM * fdform, int nform ) { int i; for ( i = 0; i < nform; i++ ) { fprintf( fn, "/* Callbacks and freeobj handlers for form %s */\n\n\n", fdform[ i ].fname ); print_callbacks_and_globals( fn, fdform[i].form, 1 ); fprintf( fn, "\n" ); } } /*************************************** ***************************************/ const char * get_placement( FL_FORM * form ) { if ( ! form->first ) return "FL_PLACE_CENTER"; else if ( ! form->first->next ) return "FL_PLACE_CENTER"; else if ( form->first->next->resize ) return "FL_PLACE_CENTERFREE"; return "FL_PLACE_CENTER"; } /* * A Main stub. */ /*************************************** ***************************************/ static void output_main_newformat( FILE * fn, FRM * fdform, int nform ) { char fdtname[ MAX_VAR_LEN ]; char * fname; int i; /* Only output callback stubs if not already output */ if ( ! fdopt.emit_cb ) output_callbacks( fn, fdform, nform ); fprintf( fn, "\n/***************************************\n" " ***************************************/\n\n" "int\nmain( int argc,\n char * argv[ ] )\n{\n" ); for ( i = 0; i < nform; i++ ) { fname = fdform[ i ].fname; sprintf( fdtname, "FD_%s", fname ); fprintf( fn, " %s *fd_%s;\n", fdtname, fname ); } fprintf( fn, "\n" ); fprintf( fn, " fl_initialize( &argc, argv, 0, 0, 0 );\n" ); for ( i = 0; i < nform; i++ ) { fname = fdform[ i ].fname; fprintf( fn, " fd_%s = create_form_%s( );\n", fname, fname ); } fprintf( fn, "\n /* Fill-in form initialization code */\n\n" ); fprintf( fn, " /* Show the first form */\n\n" ); fprintf( fn, " fl_show_form( fd_%s->%s, %s, FL_FULLBORDER, " "\"%s\" );\n\n", fdform[ 0 ].fname, fdform[ 0 ].fname, get_placement( fdform[ 0 ].form), fdform[ 0 ].fname ); fprintf( fn, " fl_do_forms( );\n\n" ); for ( i = 0; i < nform; i++ ) fprintf( fn, " if ( fl_form_is_visible( fd_%s->%s ) )\n" " fl_hide_form( fd_%s->%s );\n" " fl_free( fd_%s );\n", fdform[ i ].fname, fdform[ i ].fname, fdform[ i ].fname, fdform[ i ].fname, fdform[ i ].fname ); fprintf( fn, " fl_finish( );\n\n" " return 0;\n" "}\n" ); } /*************************************** ***************************************/ static void output_main_altformat( FILE * fn, FRM * fdform, int nform ) { /* Only output callback stubs if not already output */ if ( ! fdopt.emit_cb ) output_callbacks( fn, fdform, nform ); fprintf( fn, "int\nmain( int argc,\n char * argv[ ] )\n{\n" ); fprintf( fn, " fl_initialize( &argc, argv, 0, 0, 0 );\n\n" ); fprintf( fn, "\n %s( );\n\n", main_name ); fprintf( fn, "\n /* Fill-in form initialization code */\n\n" ); fprintf( fn, " /* Show the first form */\n\n" ); fprintf( fn, " fl_show_form( %s, FL_PLACE_CENTER, FL_FULLBORDER, " "\"%s\" );\n", fdform[ 0 ].fname, fdform[ 0 ].fname); fprintf( fn, " fl_do_forms( );\n\n return 0;\n}\n" ); } /*************************************** ***************************************/ void output_main( FILE * fn, FRM * fdform, int nform ) { ( fdopt.altformat ? output_main_altformat : output_main_newformat ) ( fn, fdform, nform ); } /*************************************** * set some defaults, unit/bw etc. ***************************************/ static void pre_form_output( FILE * fn ) { /* Some global defaults */ if ( fdopt.unit != FL_COORD_PIXEL ) fprintf( fn, " int old_unit = fl_get_coordunit( );\n" ); if ( fd_bwidth != FL_BOUND_WIDTH && fd_bwidth != 0 ) fprintf( fn, " int old_bw = fl_get_border_width( );\n" ); if ( fdopt.unit != FL_COORD_PIXEL ) fprintf( fn, " fl_set_coordunit( %s );\n", unit_name( fdopt.unit ) ); if ( fd_bwidth != FL_BOUND_WIDTH && fd_bwidth != 0 ) fprintf( fn, " fl_set_border_width( %d );\n", fd_bwidth ); if ( fdopt.unit != FL_COORD_PIXEL || ( fd_bwidth != FL_BOUND_WIDTH && fd_bwidth != 0 ) ) fprintf( fn, "\n" ); } /*************************************** ***************************************/ static void post_form_output( FILE * fn ) { if ( fdopt.unit != FL_COORD_PIXEL ) fprintf( fn, " fl_set_coordunit( old_unit );\n" ); if ( fd_bwidth != FL_BOUND_WIDTH && fd_bwidth ) fprintf( fn, " fl_set_border_width( old_bw );\n" ); } /*************************************** ***************************************/ static void output_object( FILE * fp, FL_OBJECT * obj, int altfmt ) { FL_OBJECT * defobj, fakeobj; char name[ MAX_VAR_LEN ], cbname[ MAX_VAR_LEN ], argname[ MAX_VAR_LEN ]; char * p, fdvname[ MAX_VAR_LEN ]; char *label; double sc = get_conversion_factor( ); if ( obj->parent ) return; strcpy( fdvname, "fdui" ); get_object_name( obj, name, cbname, argname ); if ( obj->objclass == FL_BEGIN_GROUP ) { if ( *name ) { if ( ! altfmt ) fprintf( fp, "\n %s->%s = ", fdvname, name ); else fprintf( fp, "\n %s = ", name ); } else fprintf( fp, "\n %s", name ); fprintf( fp, "fl_bgn_group( );\n" ); } else if ( obj->objclass == FL_END_GROUP ) fprintf( fp, "\n fl_end_group( );\n"); else { defobj = find_class_default( obj->objclass, obj->type ); if ( ! defobj ) { M_err( "output_object", "Failed to create default (class = %s, type = %s)", find_class_name( obj->objclass ), find_type_name( obj->objclass, obj->type ) ); exit( 1 ); } fprintf( fp, "\n " ); if ( *name ) { if ( ! altfmt ) fprintf( fp, "%s->%s = ", fdvname, name ); else fprintf( fp, "%s = ", name ); } fprintf( fp, "obj = " ); fprintf( fp, "fl_add_%s( ", find_class_name( obj->objclass ) ); fprintf( fp, "FL_%s,", find_type_name( obj->objclass, obj->type ) ); fakeobj.x = obj->x; fakeobj.y = obj->y; fakeobj.w = obj->w; fakeobj.h = obj->h; fli_scale_object( &fakeobj, sc, sc ); label = get_label( obj, 1 ); if ( obj->objclass != FL_FREE ) fprintf( fp, " %d, %d, %d, %d, \"%s\" );\n", fakeobj.x, fakeobj.y, fakeobj.w, fakeobj.h, label ); else fprintf( fp, "% d, %d, %d, %d, \"%s\", %s );\n", fakeobj.x, fakeobj.y, fakeobj.w, fakeobj.h, label, get_free_handle( obj, name ) ); fl_free( label ); if ( ( p = get_shortcut_string( obj ) ) && *p && obj->type != FL_RETURN_BUTTON ) fprintf( fp, " fl_set_%s_shortcut( obj, \"%s\", 1 );\n", supported_shortcut( obj->objclass ), get_shortcut_string( obj ) ); if ( obj->boxtype != defobj->boxtype && obj->objclass != FL_BOX ) { if ( obj->objclass != FL_CANVAS && obj->objclass != FL_FRAME ) emit_attrib( fp, obj->boxtype, vn_btype, "fl_set_object_boxtype" ); } if ( obj->col1 != defobj->col1 || obj->col2 != defobj->col2 ) { if ( obj->objclass != FL_CANVAS ) fprintf( fp, " fl_set_object_color( obj, %s, %s );\n", fli_query_colorname( obj->col1 ), fli_query_colorname( obj->col2 ) ); } if ( obj->lcol != defobj->lcol ) fprintf( fp, " fl_set_object_lcolor( obj, %s );\n", fli_query_colorname( obj->lcol ) ); if ( obj->lsize != defobj->lsize ) emit_attrib( fp, obj->lsize, vn_lsize, "fl_set_object_lsize" ); if ( obj->align != defobj->align ) emit_attrib( fp, obj->align, vn_align, "fl_set_object_lalign" ); if ( obj->lstyle != defobj->lstyle ) fprintf( fp, " fl_set_object_lstyle( obj, %s );\n", style_name( obj->lstyle ) ); /* 'resize' must be checked for consistency with the gravity settings */ obj->resize = check_resize( obj->resize, obj->nwgravity, obj->segravity ); if ( obj->resize != defobj->resize ) fprintf( fp, " fl_set_object_resize( obj, %s );\n", resize_name( obj->resize ) ); if ( obj->nwgravity != defobj->nwgravity || obj->segravity != defobj->segravity) fprintf( fp, " fl_set_object_gravity( obj, %s, %s );\n", gravity_name( obj->nwgravity ), gravity_name( obj->segravity ) ); if ( *cbname ) fprintf( fp, " fl_set_object_callback( obj, %s, %s );\n", cbname, argname ); if ( obj->how_return != defobj->how_return ) fprintf( fp, " fl_set_object_return( obj, %s );\n", get_how_return_name( obj->how_return, 1 ) ); } /* Generate object class specifc settings */ emit_objclass_spec_info( fp, obj ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/Makefile.in0000664000175000017500000007340612353624173013463 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/common.am bin_PROGRAMS = fdesign$(EXEEXT) subdir = fdesign ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_fdesign_OBJECTS = fd_attribs.$(OBJEXT) fd_control.$(OBJEXT) \ fd_fake.$(OBJEXT) fd_file.$(OBJEXT) fd_file_fun.$(OBJEXT) \ fd_forms.$(OBJEXT) fd_groups.$(OBJEXT) fd_help.$(OBJEXT) \ fd_initforms.$(OBJEXT) fd_main.$(OBJEXT) fd_names.$(OBJEXT) \ fd_objects.$(OBJEXT) fd_pallette.$(OBJEXT) fd_printC.$(OBJEXT) \ fd_rubber.$(OBJEXT) fd_select.$(OBJEXT) fd_spec.$(OBJEXT) \ fd_super.$(OBJEXT) fd_iconinfo.$(OBJEXT) fd_util.$(OBJEXT) \ sp_browser.$(OBJEXT) sp_button.$(OBJEXT) sp_choice.$(OBJEXT) \ sp_counter.$(OBJEXT) sp_spinner.$(OBJEXT) sp_dial.$(OBJEXT) \ sp_freeobj.$(OBJEXT) sp_menu.$(OBJEXT) sp_pixmap.$(OBJEXT) \ sp_positioner.$(OBJEXT) sp_scrollbar.$(OBJEXT) \ sp_slider.$(OBJEXT) sp_twheel.$(OBJEXT) sp_xyplot.$(OBJEXT) \ sp_util.$(OBJEXT) fdesign_OBJECTS = $(am_fdesign_OBJECTS) am__DEPENDENCIES_1 = fdesign_DEPENDENCIES = $(top_srcdir)/lib/libforms.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/lib depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(fdesign_SOURCES) DIST_SOURCES = $(fdesign_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FL_FIXLEVEL = @FL_FIXLEVEL@ FL_REVISION = @FL_REVISION@ FL_VERSION = @FL_VERSION@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIB = @JPEG_LIB@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ TEXI2DVI = @TEXI2DVI@ TEXI2DVI_NEEDS_PDF = @TEXI2DVI_NEEDS_PDF@ TEXI2HTML = @TEXI2HTML@ VERSION = @VERSION@ XMKMF = @XMKMF@ XPM_LIB = @XPM_LIB@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign DISTCLEANFILES = *.orig *.rej *~ *.bak core makelog MAINTAINERCLEANFILES = $(srcdir)/Makefile.in makelog AM_INSTALL_DATA_FLAGS = $(INSTALL) -m 644 -D CLEANFILES = fdesign.1 EXTRA_DIST = Readme fdesign.man SUBDIRS = fd spec xpm man_MANS = fdesign.1 INCLUDES = -I./xpm $(X_CFLAGS) fdesign_LDADD = $(top_srcdir)/lib/libforms.la $(X_LIBS) $(X_PRE_LIBS) $(XPM_LIB) -lX11 $(LIBS) $(X_EXTRA_LIBS) fdesign_SOURCES = \ fd_attribs.c \ fd_control.c \ fd_fake.c \ fd_file.c \ fd_file_fun.c \ fd_forms.c \ fd_groups.c \ fd_help.c \ fd_help.h \ fd_initforms.c \ fd_main.c \ fd_main.h \ fd_names.c \ fd_objects.c \ fd_pallette.c \ fd_printC.c \ fd_rubber.c \ fd_select.c \ fd_spec.c \ fd_spec.h \ fd_super.c \ fd_iconinfo.c \ fd_iconinfo.h \ fd_util.c \ sp_browser.c \ sp_browser.h \ sp_button.c \ sp_button.h \ sp_choice.c \ sp_choice.h \ sp_counter.c \ sp_counter.h \ sp_spinner.c \ sp_spinner.h \ sp_dial.c \ sp_dial.h \ sp_freeobj.c \ sp_freeobj.h \ sp_menu.c \ sp_menu.h \ sp_pixmap.c \ sp_pixmap.h \ sp_positioner.c \ sp_positioner.h \ sp_scrollbar.c \ sp_scrollbar.h \ sp_slider.c \ sp_slider.h \ sp_twheel.c \ sp_twheel.h \ sp_xyplot.c \ sp_xyplot.h \ sp_util.c all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/common.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign fdesign/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign fdesign/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/common.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list fdesign$(EXEEXT): $(fdesign_OBJECTS) $(fdesign_DEPENDENCIES) $(EXTRA_fdesign_DEPENDENCIES) @rm -f fdesign$(EXEEXT) $(LINK) $(fdesign_OBJECTS) $(fdesign_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd_attribs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd_control.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd_fake.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd_file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd_file_fun.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd_forms.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd_groups.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd_help.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd_iconinfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd_initforms.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd_main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd_names.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd_objects.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd_pallette.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd_printC.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd_rubber.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd_select.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd_spec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd_super.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd_util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sp_browser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sp_button.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sp_choice.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sp_counter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sp_dial.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sp_freeobj.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sp_menu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sp_pixmap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sp_positioner.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sp_scrollbar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sp_slider.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sp_spinner.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sp_twheel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sp_util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sp_xyplot.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list=''; test -n "$(man1dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) $(MANS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-man install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man1 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-man1 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 fdesign.1: cp -p $(srcdir)/fdesign.man fdesign.1 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xforms-1.2.4/fdesign/sp_button.h0000664000175000017500000000263112244217405013567 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifndef SP_BUTTON_H_ #define SP_BUTTON_H_ void button_change_type( FL_OBJECT * obj, int new_type ); FL_FORM * button_create_spec_form( void ); void button_adjust_spec_form( FL_OBJECT * obj ); void button_fill_in_spec_form( FL_OBJECT * obj ); void button_reread_spec_form( FL_OBJECT * obj ); void button_restore_spec( FL_OBJECT * obj ); void button_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ); void button_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ); void button_emit_spec_header( FILE * fp, FL_OBJECT * obj ); #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fd_pallette.c0000664000175000017500000001204112353623325014027 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fd_pallette.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * handles the object pallette */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "fd_main.h" #include "fd/pallette.h" #include static FD_pmain *pmain; typedef struct { FL_OBJECT * ob; /* the object (radio button) handle */ int cls; /* the obj class it represents */ } Entry; static Entry *entries; static int nentries; /*************************************** ***************************************/ static void init_entry_table( FL_FORM * form ) { FL_OBJECT *ob; int i; if ( ! entries ) entries = fl_calloc( 1, MAXCLASSES * sizeof *entries ); /* we obtain the class by looking at the callback function */ for ( i = 0, ob = form->first; i < MAXCLASSES && ob; ob = ob->next, i++ ) if ( ob->object_callback ) { entries[ nentries ].ob = ob; entries[ nentries ].cls = ob->argument; nentries++; } if ( i >= MAXCLASSES ) fprintf( stderr, "fd_pallette - Internal Error: MAXCLASSES " "too small?\n"); } /*************************************** ***************************************/ static FL_FORM * create_all( void ) { FD_buttform *bf; FD_staticform *sf; FD_valuatorform *vf; FD_choiceform *cf; FD_miscform *mf; if ( pmain ) return pmain->pmain; pmain = create_form_pmain( ); bf = create_form_buttform( ); sf = create_form_staticform( ); vf = create_form_valuatorform( ); cf = create_form_choiceform( ); mf = create_form_miscform( ); fl_addto_tabfolder( pmain->folder, " Static ", sf->staticform ); init_entry_table( sf->staticform ); fl_addto_tabfolder( pmain->folder, " Button ", bf->buttform ); init_entry_table( bf->buttform ); fl_addto_tabfolder( pmain->folder, " Valuator ", vf->valuatorform ); init_entry_table( vf->valuatorform ); fl_addto_tabfolder( pmain->folder, " Choice ", cf->choiceform ); init_entry_table( cf->choiceform ); fl_addto_tabfolder( pmain->folder, " Misc. ", mf->miscform ); init_entry_table( mf->miscform ); return pmain->pmain; } /*************************************** ***************************************/ void dismiss_pallete( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_hide_form( ob->form ); reset_pallette_menu_status( ); } /*************************************** ***************************************/ void hide_pallette( void ) { FL_FORM *form = create_all( ); if ( form->visible ) fl_hide_form( form ); } /*************************************** ***************************************/ void show_pallette( void ) { FL_FORM *form = create_all( ); static int first = 1; if ( first ) { fl_set_form_position( form, -form->w - 50, 20 ); first = 0; } select_pallette_entry( cur_class ); fl_show_form( form, FL_PLACE_POSITION, FL_TRANSIENT, "Pallette" ); } /*************************************** * All pallette entries are radio buttons ***************************************/ void pallette_entry_callback( FL_OBJECT * ob, long data ) { if ( pmain->vdata && ( ( FL_OBJECT * ) pmain->vdata )->form != ob->form ) fl_set_button( pmain->vdata, 0 ); pmain->vdata = ob; pmain->ldata = data; /* selects the object in the object browser */ select_object_by_class( data ); } /*************************************** ***************************************/ void reset_pallette( void ) { if ( pmain && pmain->vdata ) { fl_set_button( pmain->vdata, 0 ); pmain->vdata = 0; } } /*************************************** * This function will be called on object class browser (de)selections ***************************************/ void select_pallette_entry( int cls ) { int i; if ( ! entries || cls < 0 ) return; for ( i = 0; i < nentries; i++ ) if ( entries[ i ].cls == cls ) { fl_set_folder( pmain->folder, entries[ i ].ob->form ); fl_set_button( entries[ i ].ob, 1 ); break; } } #include "fd/pallette.c" /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_browser.h0000664000175000017500000000221212244217405013732 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifndef SP_BROWSER_H_ #define SP_BROWSER_H_ FL_FORM * browser_create_spec_form( void ); void browser_adjust_spec_form( FL_OBJECT * obj ); void browser_fill_in_spec_form( FL_OBJECT * obj ); void browser_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ); void browser_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ); #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_scrollbar.h0000664000175000017500000000234012244217405014234 00000000000000/* * * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifndef SP_SCROLLBAR_H_ #define SP_SCROLLBAR_H_ #include "include/forms.h" #include FL_FORM * scrollbar_create_spec_form( void ); void scrollbar_adjust_spec_form( FL_OBJECT * obj ); void scrollbar_fill_in_spec_form( FL_OBJECT * obj ); void scrollbar_reread_spec_form( FL_OBJECT * obj ); void scrollbar_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ); void scrollbar_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ); #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_freeobj.c0000664000175000017500000001114212353623325013663 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file sp_freeobj.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Settting free object class specific attributes, in this * case, the handler name. We store this piece of into in * ob->c_vdata. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "fd_main.h" #include "fd_spec.h" #include "sp_freeobj.h" #include "spec/freeobj_spec.h" static char *get_free_handle( FL_OBJECT * ob, const char * name ); static char ori_handle_name[ 128 ]; static FD_freeobjattrib *fo_attrib; static FL_OBJECT *curobj; /*************************************** ***************************************/ FL_FORM * freeobj_create_spec_form( void ) { if ( ! fo_attrib ) fo_attrib = create_form_freeobjattrib( ); return fo_attrib->freeobjattrib; } /*************************************** ***************************************/ void freeobj_adjust_spec_form( FL_OBJECT * obj ) { curobj = obj; *ori_handle_name = '\0'; if ( obj->c_vdata ) strcpy( ori_handle_name, obj->c_vdata ); } /*************************************** ***************************************/ void freeobj_fill_in_spec_form( FL_OBJECT * obj ) { fl_set_input( fo_attrib->hname, get_free_handle( obj, 0 ) ); } /*************************************** ***************************************/ void freeobj_reread_spec_form( FL_OBJECT * obj FL_UNUSED_ARG ) { if ( curobj ) handler_name_change_cb( fo_attrib->hname, 0 ); } /*************************************** ***************************************/ void freeobj_restore_spec( FL_OBJECT * obj ) { fli_safe_free( obj->c_vdata ); obj->c_vdata = fl_strdup( ori_handle_name ); } /*************************************** ***************************************/ void freeobj_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ) { if ( obj->c_vdata ) fprintf( fp, " handler: %s\n", ( char * ) obj->c_vdata ); } /*************************************** ***************************************/ int noop_handle( FL_OBJECT * obj, int e, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int k FL_UNUSED_ARG, void * xev FL_UNUSED_ARG ) { if ( e == FL_DRAW ) { fl_draw_box( obj->boxtype, obj->x, obj->y, obj->w, obj->h, obj->col1, obj->bw ); return 0; } if ( obj->type == FL_INACTIVE_FREE ) return 0; else if ( obj->type == FL_INPUT_FREE ) return e == FL_KEYPRESS; return 1; } /*************************************** ***************************************/ void handler_name_change_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { fli_safe_free( curobj->c_vdata ); curobj->c_vdata = fl_strdup( fl_get_input( obj ) ); } /* default free object handler name */ #define MAXFREEOBJ 16 /*************************************** ***************************************/ static char * get_free_handle( FL_OBJECT * obj, const char * name ) { static int n; static char buf[ 1024 ]; static FL_OBJECT *freeobj[ MAXFREEOBJ ]; if ( obj->c_vdata ) strcpy( buf, obj->c_vdata ); else if ( name && *name ) sprintf( buf, "freeobj_%s_handle", name ); else if ( *obj->label ) sprintf( buf, "freeobj_%s_handle", obj->label ); else { int i, k; for ( k = -1, i = 0; i < MAXFREEOBJ && k < 0; i++ ) if ( freeobj[ i ] == obj ) k = i; if ( k < 0 ) { k = ++n; freeobj[ k ] = obj; } sprintf( buf, "freeobj%d_handle", k ); } return buf; } #include "spec/freeobj_spec.c" /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fd_objects.c0000664000175000017500000010206012353623325013647 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fd_objects.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * This file is part of the Form Designer. * * It contains routines to keep track of all different object classes * and the types inside each class. To add a class of object to the * form designer, only this file has to be changed slightly: * - in init_classes() the class and types must be added. * - in add_an_object() the way of adding it should be added. * * Also to support output fully, fd_spec.c needs to be modified */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "fd_main.h" #include "sp_freeobj.h" #include "xpm/broken.xpm" #include "xpm/broken.xbm" #define VN( a ) a,#a #define OBJNAME( a ) #a,fl_create_##a,fl_add_##a typedef struct { int defined; char tname[ MAX_TYPE_NAME_LEN ]; } TDEF; typedef FL_OBJECT * ( * FL_ADDPTR ) ( int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char * ); typedef struct { int cn; FL_OBJECT * defobj; /* default */ TDEF types[ MAXTYPES ]; char cname[ MAX_CLASS_NAME_LEN ]; /* add_XXX */ char formal_cname[ MAX_CLASS_NAME_LEN ]; FL_OBJECT * defobj1; /* to specific type */ FL_ADDPTR createit, addit; int var_boxtype; /* means default boxtype may depend on type */ int default_type; const char * default_label; int bline; } CDEF; static CDEF classes[ MAXCLASSES ]; static int cnumb = 0; typedef FL_OBJECT * ( * FL_ADDFREEPTR )( int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char *, FL_HANDLEPTR ); /*************************************** * Adds a class definition ***************************************/ static void add_class_def( int numb, char * formal_name, char * name, FL_ADDPTR createit, FL_ADDPTR addit, int bl ) { int i; if ( cnumb == MAXCLASSES ) { fprintf( stderr, "exceeding maxclass allowed\n" ); return; } classes[ cnumb ].cn = numb; strcpy( classes[ cnumb ].cname, name ); strcpy( classes[ cnumb ].formal_cname, formal_name ); if ( createit ) classes[ cnumb ].defobj = createit( 1, 0, 0, 1, 1, "" ); classes[ cnumb ].createit = createit; classes[ cnumb ].addit = addit; classes[ cnumb ].bline = bl; for ( i = 0; i < MAXTYPES; i++ ) classes[ cnumb ].types[ i ].defined = FL_FALSE; cnumb++; } /*************************************** ***************************************/ static CDEF * find_class_struct( int n ) { int i; for ( i = 0; i < cnumb; i++ ) { if ( classes[ i ].cn == n ) return classes + i; } M_err( "find_class_struct", "Can't find class %d", n ); return NULL; } /*************************************** * Adds a type definition to a class ***************************************/ static void add_type_def( int cn, int tn, char name[ ] ) { int i; if ( tn >= MAXTYPES || tn < 0 ) { M_err( "add_type_def", "Bad type: %d", tn ); return; } for ( i = 0; i < cnumb; i++ ) if ( classes[ i ].cn == cn ) { classes[ i ].types[ tn ].defined = FL_TRUE; strcpy( classes[ i ].types[ tn ].tname, name ); } } /*************************************** * Sets a default type and label for class cn ***************************************/ static void set_class_default( int cn, int def_type, char * label ) { int i; for ( i = 0; i < cnumb; i++ ) if ( classes[ i ].cn == cn ) { classes[ i ].default_type = def_type; classes[ i ].default_label = label; /* note: no copy */ } } /*************************************** ***************************************/ static void set_var_boxtype( int cn, int yes FL_UNUSED_ARG ) { int i; for ( i = 0; i < cnumb; i++ ) if ( classes[ i ].cn == cn ) classes[ i ].var_boxtype = 1; } /*************************************** ***************************************/ static FL_OBJECT * fd_create_free( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * l ) { return fl_create_free( type, x, y, w, h, l, noop_handle ); } /*************************************** ***************************************/ static FL_OBJECT * fd_add_free( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * l ) { FL_OBJECT *obj = fl_add_free( type, x, y, w, h, l, noop_handle ); obj->c_vdata = NULL; return obj; } /**** INITIALIZING THE CLASSES ****/ int cur_class = -1; /* class selected in the object class browser */ /**** CALLBACK ROUTINES ****/ /*************************************** * Handles a class change event ***************************************/ void object_cb( FL_OBJECT * obj, long arg FL_UNUSED_ARG ) { int line = fl_get_browser( obj ); clear_selection( ); redraw_the_form( 0 ); cur_class = -1; if ( line > 0 ) { const char *name = fl_get_browser_line( obj, line ); int i; for ( i = 0; *classes[ i ].cname && i < MAXCLASSES; i++ ) if ( ! strcmp( classes[ i ].cname, name ) ) { cur_class = classes[ i ].cn; break; } } select_pallette_entry( cur_class ); } /*************************************** ***************************************/ static void add_button_types( int button_class ) { add_type_def( button_class, FL_NORMAL_BUTTON, "NORMAL_BUTTON" ); add_type_def( button_class, FL_PUSH_BUTTON, "PUSH_BUTTON" ); add_type_def( button_class, FL_RADIO_BUTTON, "RADIO_BUTTON" ); add_type_def( button_class, FL_TOUCH_BUTTON, "TOUCH_BUTTON" ); add_type_def( button_class, FL_HIDDEN_BUTTON, "HIDDEN_BUTTON" ); add_type_def( button_class, FL_INOUT_BUTTON, "INOUT_BUTTON" ); add_type_def( button_class, FL_MENU_BUTTON, "MENU_BUTTON" ); add_type_def( button_class, FL_RETURN_BUTTON, "RETURN_BUTTON" ); add_type_def( button_class, FL_HIDDEN_RET_BUTTON, "HIDDEN_RET_BUTTON" ); } /*************************************** ***************************************/ static void add_frame_types( int frame_class ) { add_type_def( frame_class, FL_NO_FRAME, "NO_FRAME" ); add_type_def( frame_class, FL_UP_FRAME, "UP_FRAME" ); add_type_def( frame_class, FL_DOWN_FRAME, "DOWN_FRAME" ); add_type_def( frame_class, FL_BORDER_FRAME, "BORDER_FRAME" ); add_type_def( frame_class, FL_ENGRAVED_FRAME, "ENGRAVED_FRAME" ); add_type_def( frame_class, FL_ROUNDED_FRAME, "ROUNDED_FRAME" ); add_type_def( frame_class, FL_EMBOSSED_FRAME, "EMBOSSED_FRAME" ); add_type_def( frame_class, FL_SHADOW_FRAME, "SHADOW_FRAME" ); add_type_def( frame_class, FL_OVAL_FRAME, "OVAL_FRAME" ); } /*************************************** ***************************************/ static void add_slider_types( int sclass ) { add_type_def( sclass, FL_VERT_SLIDER, "VERT_SLIDER" ); add_type_def( sclass, FL_HOR_SLIDER, "HOR_SLIDER" ); add_type_def( sclass, FL_VERT_FILL_SLIDER, "VERT_FILL_SLIDER" ); add_type_def( sclass, FL_HOR_FILL_SLIDER, "HOR_FILL_SLIDER" ); add_type_def( sclass, FL_VERT_NICE_SLIDER, "VERT_NICE_SLIDER" ); add_type_def( sclass, FL_HOR_NICE_SLIDER, "HOR_NICE_SLIDER" ); add_type_def( sclass, FL_VERT_BROWSER_SLIDER, "VERT_BROWSER_SLIDER" ); add_type_def( sclass, FL_HOR_BROWSER_SLIDER, "HOR_BROWSER_SLIDER" ); add_type_def( sclass, FL_VERT_PROGRESS_BAR, "VERT_PROGRESS_BAR" ); add_type_def( sclass, FL_HOR_PROGRESS_BAR, "HOR_PROGRESS_BAR" ); } /*************************************** ***************************************/ static void add_scrollbar_types( int sclass ) { add_type_def( sclass, FL_VERT_SCROLLBAR, "VERT_SCROLLBAR" ); add_type_def( sclass, FL_HOR_SCROLLBAR, "HOR_SCROLLBAR" ); add_type_def( sclass, FL_VERT_THIN_SCROLLBAR, "VERT_THIN_SCROLLBAR" ); add_type_def( sclass, FL_HOR_THIN_SCROLLBAR, "HOR_THIN_SCROLLBAR" ); add_type_def( sclass, FL_VERT_NICE_SCROLLBAR, "VERT_NICE_SCROLLBAR" ); add_type_def( sclass, FL_HOR_NICE_SCROLLBAR, "HOR_NICE_SCROLLBAR" ); add_type_def( sclass, FL_VERT_PLAIN_SCROLLBAR, "VERT_PLAIN_SCROLLBAR" ); add_type_def( sclass, FL_HOR_PLAIN_SCROLLBAR, "HOR_PLAIN_SCROLLBAR" ); } /*************************************** ***************************************/ static void add_chart_types( int cclass ) { add_type_def( cclass, FL_BAR_CHART, "BAR_CHART" ); add_type_def( cclass, FL_HORBAR_CHART, "HORBAR_CHART" ); add_type_def( cclass, FL_LINE_CHART, "LINE_CHART" ); add_type_def( cclass, FL_FILLED_CHART, "FILLED_CHART" ); add_type_def( cclass, FL_SPIKE_CHART, "SPIKE_CHART" ); add_type_def( cclass, FL_PIE_CHART, "PIE_CHART" ); add_type_def( cclass, FL_SPECIALPIE_CHART, "SPECIALPIE_CHART" ); } /*************************************** ***************************************/ static void add_xyplot_types( int xyclass ) { add_type_def( xyclass, FL_NORMAL_XYPLOT, "NORMAL_XYPLOT" ); add_type_def( xyclass, FL_ACTIVE_XYPLOT, "ACTIVE_XYPLOT" ); add_type_def( xyclass, FL_SQUARE_XYPLOT, "SQUARE_XYPLOT" ); add_type_def( xyclass, FL_CIRCLE_XYPLOT, "CIRCLE_XYPLOT" ); add_type_def( xyclass, FL_POINTS_XYPLOT, "POINTS_XYPLOT" ); add_type_def( xyclass, FL_LINEPOINTS_XYPLOT, "LINEPOINTS_XYPLOT" ); add_type_def( xyclass, FL_DASHED_XYPLOT, "DASHED_XYPLOT" ); add_type_def( xyclass, FL_DOTTED_XYPLOT, "DOTTED_XYPLOT" ); add_type_def( xyclass, FL_DOTDASHED_XYPLOT, "DOTDASHED_XYPLOT" ); add_type_def( xyclass, FL_LONGDASHED_XYPLOT, "LONGDASHED_XYPLOT" ); add_type_def( xyclass, FL_FILL_XYPLOT, "FILL_XYPLOT" ); add_type_def( xyclass, FL_IMPULSE_XYPLOT, "IMPULSE_XYPLOT" ); add_type_def( xyclass, FL_EMPTY_XYPLOT, "EMPTY_XYPLOT" ); } /*************************************** * Initializes all the classes and types. Must be adapted * to add new classes and types. ***************************************/ void init_classes( void ) { static int initialized; VN_pair *vp; int bl = 0; if ( initialized ) return; initialized = 1; fl_set_browser_fontstyle( fd_control->objectbrowser, FL_TIMES_STYLE ); fl_add_browser_line( fd_control->objectbrowser, "box" ); add_class_def( VN( FL_BOX ), OBJNAME( box ), ++bl ); for ( vp = vn_btype; vp->val >= 0; vp++ ) add_type_def( FL_BOX, vp->val, vp->name + 3 ); set_class_default( FL_BOX, FL_UP_BOX, "" ); fl_add_browser_line( fd_control->objectbrowser, "frame" ); add_class_def( VN( FL_FRAME ), OBJNAME( frame ), ++bl ); add_frame_types( FL_FRAME ); set_class_default( FL_FRAME, FL_ENGRAVED_FRAME, "" ); fl_add_browser_line( fd_control->objectbrowser, "labelframe" ); add_class_def( VN( FL_LABELFRAME ), OBJNAME( labelframe ), ++bl ); add_frame_types( FL_LABELFRAME ); set_class_default( FL_LABELFRAME, FL_ENGRAVED_FRAME, "frame" ); fl_add_browser_line( fd_control->objectbrowser, "text" ); add_class_def( VN( FL_TEXT ), OBJNAME( text ), ++bl ); add_type_def( FL_TEXT, FL_NORMAL_TEXT, "NORMAL_TEXT" ); set_class_default( FL_TEXT, FL_NORMAL_TEXT, "text" ); fl_add_browser_line( fd_control->objectbrowser, "bitmap" ); add_class_def( VN( FL_BITMAP ), OBJNAME( bitmap ), ++bl ); add_type_def( FL_BITMAP, FL_NORMAL_BITMAP, "NORMAL_BITMAP" ); fl_add_browser_line( fd_control->objectbrowser, "pixmap" ); add_class_def( VN( FL_PIXMAP ), OBJNAME( pixmap ), ++bl ); add_type_def( FL_PIXMAP, FL_NORMAL_PIXMAP, "NORMAL_PIXMAP" ); fl_add_browser_line( fd_control->objectbrowser, "chart" ); add_class_def( VN( FL_CHART ), OBJNAME( chart ), ++bl ); add_chart_types( FL_CHART ); fl_add_browser_line( fd_control->objectbrowser, "clock" ); add_class_def( VN( FL_CLOCK ), OBJNAME( clock ), ++bl ); add_type_def( FL_CLOCK, FL_ANALOG_CLOCK, "ANALOG_CLOCK" ); add_type_def( FL_CLOCK, FL_DIGITAL_CLOCK, "DIGITAL_CLOCK" ); set_class_default( FL_CLOCK, FL_ANALOG_CLOCK, "" ); fl_add_browser_line( fd_control->objectbrowser, "@-" ); bl++; fl_add_browser_line( fd_control->objectbrowser, "button" ); add_class_def( VN( FL_BUTTON ), OBJNAME( button ), ++bl ); add_button_types( FL_BUTTON ); set_class_default( FL_BUTTON, FL_NORMAL_BUTTON, "button" ); fl_add_browser_line( fd_control->objectbrowser, "roundbutton" ); add_class_def( VN( FL_ROUNDBUTTON ), OBJNAME( roundbutton ), ++bl ); add_button_types( FL_ROUNDBUTTON ); set_class_default( FL_ROUNDBUTTON, FL_PUSH_BUTTON, "button" ); fl_add_browser_line( fd_control->objectbrowser, "round3dbutton" ); add_class_def( VN( FL_ROUND3DBUTTON ), OBJNAME( round3dbutton ), ++bl ); add_button_types( FL_ROUND3DBUTTON ); set_class_default( FL_ROUND3DBUTTON, FL_PUSH_BUTTON, "button" ); fl_add_browser_line( fd_control->objectbrowser, "checkbutton" ); add_class_def( VN( FL_CHECKBUTTON ), OBJNAME( checkbutton ), ++bl ); add_button_types( FL_CHECKBUTTON ); set_class_default( FL_CHECKBUTTON, FL_PUSH_BUTTON, "button" ); fl_add_browser_line( fd_control->objectbrowser, "lightbutton" ); add_class_def( VN( FL_LIGHTBUTTON ), OBJNAME( lightbutton ), ++bl ); add_button_types( FL_LIGHTBUTTON ); set_class_default( FL_LIGHTBUTTON, FL_PUSH_BUTTON, "button" ); fl_add_browser_line( fd_control->objectbrowser, "scrollbutton" ); add_class_def( VN( FL_SCROLLBUTTON ), OBJNAME( scrollbutton ), ++bl ); add_button_types( FL_SCROLLBUTTON ); set_class_default( FL_SCROLLBUTTON, FL_TOUCH_BUTTON, "8" ); fl_add_browser_line( fd_control->objectbrowser, "bitmapbutton" ); add_class_def( VN( FL_BITMAPBUTTON ), OBJNAME( bitmapbutton ), ++bl ); add_button_types( FL_BITMAPBUTTON ); fl_add_browser_line( fd_control->objectbrowser, "pixmapbutton" ); add_class_def( VN( FL_PIXMAPBUTTON ), OBJNAME( pixmapbutton ), ++bl ); add_button_types( FL_PIXMAPBUTTON ); fl_add_browser_line( fd_control->objectbrowser, "labelbutton" ); add_class_def( VN( FL_LABELBUTTON ), OBJNAME( labelbutton ), ++bl ); add_button_types( FL_LABELBUTTON ); fl_add_browser_line( fd_control->objectbrowser, "@-" ); bl++; fl_add_browser_line( fd_control->objectbrowser, "slider" ); add_class_def( VN( FL_SLIDER ), OBJNAME( slider ), ++bl ); add_slider_types( FL_SLIDER ); fl_add_browser_line( fd_control->objectbrowser, "valslider" ); add_class_def( VN( FL_VALSLIDER ), OBJNAME( valslider ), ++bl ); add_slider_types( FL_VALSLIDER ); fl_add_browser_line( fd_control->objectbrowser, "scrollbar" ); add_class_def( VN( FL_SCROLLBAR ), OBJNAME( scrollbar ), ++bl ); add_scrollbar_types( FL_SCROLLBAR ); fl_add_browser_line( fd_control->objectbrowser, "dial" ); add_class_def( VN( FL_DIAL ), OBJNAME( dial ), ++bl ); add_type_def( FL_DIAL, FL_NORMAL_DIAL, "NORMAL_DIAL" ); add_type_def( FL_DIAL, FL_LINE_DIAL, "LINE_DIAL" ); add_type_def( FL_DIAL, FL_FILL_DIAL, "FILL_DIAL" ); set_var_boxtype( FL_DIAL, 1 ); fl_add_browser_line( fd_control->objectbrowser, "positioner" ); add_class_def( VN( FL_POSITIONER ), OBJNAME( positioner ), ++bl ); add_type_def( FL_POSITIONER, FL_NORMAL_POSITIONER, "NORMAL_POSITIONER" ); add_type_def( FL_POSITIONER, FL_OVERLAY_POSITIONER, "OVERLAY_POSITIONER" ); add_type_def( FL_POSITIONER, FL_INVISIBLE_POSITIONER, "INVISIBLE_POSITIONER" ); set_var_boxtype( FL_POSITIONER, 1 ); fl_add_browser_line( fd_control->objectbrowser, "thumbwheel" ); add_class_def( VN( FL_THUMBWHEEL ), OBJNAME( thumbwheel ), ++bl ); add_type_def( FL_THUMBWHEEL, FL_HOR_THUMBWHEEL, "HOR_THUMBWHEEL" ); add_type_def( FL_THUMBWHEEL, FL_VERT_THUMBWHEEL, "VERT_THUMBWHEEL" ); fl_add_browser_line( fd_control->objectbrowser, "counter" ); add_class_def( VN( FL_COUNTER ), OBJNAME( counter ), ++bl ); add_type_def( FL_COUNTER, FL_NORMAL_COUNTER, "NORMAL_COUNTER" ); add_type_def( FL_COUNTER, FL_SIMPLE_COUNTER, "SIMPLE_COUNTER" ); fl_add_browser_line( fd_control->objectbrowser, "spinner" ); add_class_def( VN( FL_SPINNER ), OBJNAME( spinner ), ++bl ); add_type_def( FL_SPINNER, FL_INT_SPINNER, "INT_SPINNER" ); add_type_def( FL_SPINNER, FL_FLOAT_SPINNER, "FLOAT_SPINNER" ); fl_add_browser_line( fd_control->objectbrowser, "@-" ); bl++; fl_add_browser_line( fd_control->objectbrowser, "input" ); add_class_def( VN( FL_INPUT ), OBJNAME( input ), ++bl ); add_type_def( FL_INPUT, FL_NORMAL_INPUT, "NORMAL_INPUT" ); add_type_def( FL_INPUT, FL_FLOAT_INPUT, "FLOAT_INPUT" ); add_type_def( FL_INPUT, FL_INT_INPUT, "INT_INPUT" ); add_type_def( FL_INPUT, FL_HIDDEN_INPUT, "HIDDEN_INPUT" ); add_type_def( FL_INPUT, FL_MULTILINE_INPUT, "MULTILINE_INPUT" ); add_type_def( FL_INPUT, FL_SECRET_INPUT, "SECRET_INPUT" ); add_type_def( FL_INPUT, FL_DATE_INPUT, "DATE_INPUT" ); fl_add_browser_line( fd_control->objectbrowser, "@-" ); bl++; fl_add_browser_line( fd_control->objectbrowser, "menu" ); add_class_def( VN( FL_MENU ), OBJNAME( menu ), ++bl ); add_type_def( FL_MENU, FL_PUSH_MENU, "PUSH_MENU" ); add_type_def( FL_MENU, FL_PULLDOWN_MENU, "PULLDOWN_MENU" ); add_type_def( FL_MENU, FL_TOUCH_MENU, "TOUCH_MENU" ); set_var_boxtype( FL_MENU, 1 ); fl_add_browser_line( fd_control->objectbrowser, "choice" ); add_class_def( VN( FL_CHOICE ), OBJNAME( choice ), ++bl ); add_type_def( FL_CHOICE, FL_NORMAL_CHOICE, "NORMAL_CHOICE" ); add_type_def( FL_CHOICE, FL_NORMAL_CHOICE2, "NORMAL_CHOICE2" ); add_type_def( FL_CHOICE, FL_DROPLIST_CHOICE, "DROPLIST_CHOICE" ); set_var_boxtype( FL_CHOICE, 1 ); fl_add_browser_line( fd_control->objectbrowser, "browser" ); add_class_def( VN( FL_BROWSER), OBJNAME( browser ), ++bl ); add_type_def( FL_BROWSER, FL_NORMAL_BROWSER, "NORMAL_BROWSER" ); add_type_def( FL_BROWSER, FL_SELECT_BROWSER, "SELECT_BROWSER" ); add_type_def( FL_BROWSER, FL_HOLD_BROWSER, "HOLD_BROWSER" ); add_type_def( FL_BROWSER, FL_DESELECTABLE_HOLD_BROWSER, "DESELECTABLE_HOLD_BROWSER" ); add_type_def( FL_BROWSER, FL_MULTI_BROWSER, "MULTI_BROWSER" ); fl_add_browser_line( fd_control->objectbrowser, "@-" ); bl++; fl_add_browser_line( fd_control->objectbrowser, "timer" ); add_class_def( VN( FL_TIMER ), OBJNAME( timer ), ++bl ); add_type_def( FL_TIMER, FL_NORMAL_TIMER, "NORMAL_TIMER" ); add_type_def( FL_TIMER, FL_VALUE_TIMER, "VALUE_TIMER" ); add_type_def( FL_TIMER, FL_HIDDEN_TIMER, "HIDDEN_TIMER" ); set_class_default( FL_TIMER, FL_NORMAL_TIMER, "timer" ); fl_add_browser_line( fd_control->objectbrowser, "@-" ); bl++; fl_add_browser_line( fd_control->objectbrowser, "xyplot" ); add_class_def( VN( FL_XYPLOT ), OBJNAME( xyplot ), ++bl ); add_xyplot_types( FL_XYPLOT ); fl_add_browser_line( fd_control->objectbrowser, "@-" ); bl++; fl_add_browser_line( fd_control->objectbrowser, "canvas" ); add_class_def( VN( FL_CANVAS ), "canvas", fl_create_simu_canvas, fl_add_simu_canvas, ++bl ); add_type_def( FL_CANVAS, FL_NORMAL_CANVAS, "NORMAL_CANVAS" ); add_type_def( FL_CANVAS, FL_SCROLLED_CANVAS, "SCROLLED_CANVAS" ); set_class_default( FL_CANVAS, FL_NORMAL_CANVAS, "" ); fl_add_browser_line( fd_control->objectbrowser, "glcanvas" ); add_class_def( VN( FL_GLCANVAS ), "glcanvas", fl_create_simu_glcanvas, fl_add_simu_glcanvas, ++bl ); add_type_def( FL_GLCANVAS, FL_NORMAL_CANVAS, "NORMAL_CANVAS" ); add_type_def( FL_GLCANVAS, FL_SCROLLED_CANVAS, "SCROLLED_CANVAS" ); set_class_default( FL_GLCANVAS, FL_NORMAL_CANVAS, "" ); fl_add_browser_line( fd_control->objectbrowser, "@-" ); bl++; fl_add_browser_line( fd_control->objectbrowser, "tabfolder" ); add_class_def( FL_NTABFOLDER, "FL_TABFOLDER", "tabfolder", fl_create_ntabfolder, fl_add_ntabfolder, ++bl ); add_type_def( FL_NTABFOLDER, FL_TOP_TABFOLDER, "TOP_TABFOLDER" ); add_type_def( FL_NTABFOLDER, FL_BOTTOM_TABFOLDER, "BOTTOM_TABFOLDER" ); set_class_default( FL_NTABFOLDER, FL_TOP_TABFOLDER, "" ); fl_add_browser_line( fd_control->objectbrowser, "formbrowser" ); add_class_def( FL_FORMBROWSER, "FL_FORMBROWSER", "formbrowser", fl_create_nformbrowser, fl_add_nformbrowser, ++bl ); add_type_def( FL_FORMBROWSER, FL_NORMAL_FORMBROWSER, "NORMAL_FORMBROWSER" ); fl_add_browser_line( fd_control->objectbrowser, "@-" ); bl++; fl_add_browser_line( fd_control->objectbrowser, "freeobject" ); add_class_def( VN( FL_FREE ), "freeobject", fd_create_free, fd_add_free, ++bl ); add_type_def( FL_FREE, FL_NORMAL_FREE, "NORMAL_FREE" ); add_type_def( FL_FREE, FL_INACTIVE_FREE, "INACTIVE_FREE" ); add_type_def( FL_FREE, FL_INPUT_FREE, "INPUT_FREE" ); add_type_def( FL_FREE, FL_CONTINUOUS_FREE, "CONTINUOUS_FREE" ); add_type_def( FL_FREE, FL_ALL_FREE, "ALL_FREE" ); /* ADD NEW CLASSES HERE */ /* Group must be last, palette.c need this */ add_class_def( VN( FL_BEGIN_GROUP ), "group", 0, 0, 0 ); add_type_def( FL_BEGIN_GROUP, 0, "0" ); add_class_def( VN( FL_END_GROUP ), "endgroup", 0, 0, 0 ); add_type_def( FL_END_GROUP, 0, "0" ); } /*************************************** ***************************************/ void select_object_by_class( int cn ) { int i; for ( i = 0; i < cnumb; i++ ) if ( classes[ i ].cn == cn ) { fl_select_browser_line( fd_control->objectbrowser, classes[ i ].bline ); fl_show_browser_line( fd_control->objectbrowser, classes[ i ].bline ); cur_class = cn; break; } } /**** GETTING INFORMATION ABOUT CLASSES AND TYPES ****/ /*************************************** * Returns a pointer to the (short) name of the class ***************************************/ char * find_class_name( int cln ) { int i; static char buf[ MAX_CLASS_NAME_LEN ]; for ( i = 0; i < cnumb; i++ ) if ( classes[ i ].cn == cln ) return classes[ i ].cname; sprintf( buf, "%d", cln ); return buf; } /*************************************** * Returns a pointer to the formal name of the class ***************************************/ char * class_name( int cls ) { int i; static char buf[ MAX_CLASS_NAME_LEN ]; for ( i = 0; i < cnumb; i++ ) if ( classes[ i ].cn == cls ) return classes[ i ].formal_cname; sprintf( buf, "%d", cls ); return buf; } /*************************************** * Returns the class value ***************************************/ int class_val( const char * name ) { int i; for ( i = 0; i < cnumb; i++ ) { if ( strcmp( classes[ i ].cname, name ) == 0 || strcmp( classes[ i ].formal_cname, name ) == 0 ) return classes[ i ].cn; } return atoi( name ); } /*************************************** * Returns a pointer to the default object of the class. var_boxtype * means different type may have different boxtypes ***************************************/ FL_OBJECT * find_class_default( int cln, int t ) { int i; CDEF *c = classes; for ( i = 0; i < cnumb; i++, c++ ) if ( c->cn == cln ) { if ( c->var_boxtype ) { if ( c->defobj1 ) fl_free_object( c->defobj1 ); return c->defobj1 = c->createit( t, 0, 0, 1, 1, "" ); } else return c->defobj; } return NULL; } /*************************************** * Returns the number of types in the class ***************************************/ int find_class_maxtype( int cln ) { int i, j, n = 0; for ( i = 0; i < cnumb; i++ ) if ( classes[ i ].cn == cln ) for ( j = 0; j < MAXTYPES; j++ ) if ( classes[ i ].types[ j ].defined ) n++; return n; } /*************************************** * Returns a pointer to the name of the type in the class ***************************************/ const char * find_type_name( int cln, int tyn ) { int i; static char buf[ MAX_TYPE_NAME_LEN ]; for ( i = 0; i < cnumb; i++ ) if ( classes[ i ].cn == cln ) return classes[ i ].types[ tyn ].tname; sprintf( buf, "%d", tyn ); return buf; } /*************************************** * Returns a integer indicating the value of a type ***************************************/ int find_type_value( int cln, const char * type_name ) { int i, jmax = find_class_maxtype( cln ), j; for ( i = 0; i < cnumb; i++ ) if ( classes[ i ].cn == cln ) for ( j = 0; j < jmax; j++ ) if ( ! strcmp( classes[ i ].types[ j ].tname, type_name ) || ( ! strncmp( type_name, "FL_", 3 ) && ! strcmp( classes[ i ].types[ j ].tname, type_name + 3 ) ) ) return j; M_err( "TypeValue", "type %s is unknown", type_name ); return -1; } /**** ADDING OBJECTS ****/ #define pm_width 28 #define pm_height 28 /*************************************** ***************************************/ void set_testing_pixmap( FL_OBJECT * ob ) { fl_set_pixmap_data( ob, broken ); } /*************************************** ***************************************/ void set_testing_bitmap( FL_OBJECT * obj ) { if ( obj->objclass == FL_BITMAP ) fl_set_bitmap_data( obj, broken_width, broken_height, ( unsigned char * ) broken_bits ); else fl_set_bitmapbutton_data( obj, broken_width, broken_height, ( unsigned char * ) broken_bits ); } /*************************************** * Adds an object to the current form type = -1 means default type ***************************************/ FL_OBJECT * add_an_object( int objclass, int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h ) { FL_OBJECT *obj = NULL; CDEF *cls; static FL_FORM *cf = NULL; if ( cur_form == NULL ) return NULL; /* This routine is called with X coordinate system, need to translate to up-right coordinate system */ if ( ! ( cls = find_class_struct( objclass ) ) ) { fprintf( stderr, "unknown class %d\n", objclass ); return 0; } if ( ! cf ) fl_addto_form( cur_form ); switch ( objclass ) { case FL_BEGIN_GROUP: cf = cur_form; obj = fl_bgn_group( ); break; case FL_END_GROUP: obj = fli_end_group( ); break; case FL_BITMAP: if ( type == -1 ) type = FL_NORMAL_BITMAP; obj = cls->addit( type, x, y, w, h, "" ); if ( ! fdopt.conv_only ) set_testing_bitmap( obj ); break; case FL_PIXMAP: if ( type == -1 ) type = FL_NORMAL_PIXMAP; obj = cls->addit( type, x, y, w, h, "" ); if ( ! fdopt.conv_only ) set_testing_pixmap( obj ); break; case FL_CHART: if ( type == -1 ) type = FL_BAR_CHART; obj = cls->addit( type, x, y, w, h, "" ); fl_add_chart_value( obj, 4.0, "item 1", 2 ); fl_add_chart_value( obj, 8.0, "item 2", 3 ); fl_add_chart_value( obj, 2.0, "item 3", 4 ); fl_add_chart_value( obj, 5.0, "item 4", 5 ); break; case FL_BITMAPBUTTON: if ( type == -1 ) type = FL_NORMAL_BUTTON; obj = cls->addit( type, x, y, w, h, "" ); if ( ! fdopt.conv_only ) set_testing_bitmap( obj ); break; case FL_PIXMAPBUTTON: if ( type == -1 ) type = FL_NORMAL_BUTTON; obj = cls->addit( type, x, y, w, h, "" ); if ( ! fdopt.conv_only ) set_testing_pixmap( obj ); break; case FL_SLIDER: if ( type == -1 ) type = h > w ? FL_VERT_BROWSER_SLIDER : FL_HOR_BROWSER_SLIDER; obj = cls->addit( type, x, y, w, h, "" ); break; case FL_VALSLIDER: if ( type == -1 ) type = h > w ? FL_VERT_BROWSER_SLIDER : FL_HOR_BROWSER_SLIDER; obj = cls->addit( type, x, y, w, h, "" ); break; case FL_SCROLLBAR: if ( type == -1 ) type = h > w ? FL_VERT_SCROLLBAR : FL_HOR_SCROLLBAR; obj = cls->addit( type, x, y, w, h, "" ); break; case FL_THUMBWHEEL: if ( type == -1 ) type = h > w ? FL_VERT_THUMBWHEEL : FL_HOR_THUMBWHEEL; obj = cls->addit( type, x, y, w, h, "" ); break; case FL_INPUT: if ( type == -1 ) type = h < 60 ? FL_NORMAL_INPUT : FL_MULTILINE_INPUT; obj = cls->addit( type, x, y, w, h, "Input" ); fl_set_input_hscrollbar( obj, FL_OFF ); fl_set_input_vscrollbar( obj, FL_OFF ); break; case FL_MENU: if ( type == -1 ) type = FL_PULLDOWN_MENU; obj = cls->addit( type, x, y, w, h, "Menu" ); get_superspec( obj ); /* super spec must exist for testing */ break; case FL_CHOICE: if ( type == -1 ) type = FL_NORMAL_CHOICE2; obj = cls->addit( type, x, y, w, h, "" ); get_superspec( obj ); /* super spec must exist for testing */ break; case FL_BROWSER: if ( type == -1 ) type = FL_NORMAL_BROWSER; obj = cls->addit( type, x, y, w, h, "" ); get_superspec( obj ); /* super spec must exist for testing */ break; case FL_XYPLOT: if ( type == -1 ) type = FL_NORMAL_XYPLOT; { float xx[ 30 ], yy[ 30 ]; int i; for ( i = 0; i < 30; i++ ) { xx[ i ] = 3.1415 * ( i + 0.5 ) / 8.0; yy[ i ] = FL_abs( sin( 2 * xx[ i ] ) + cos( xx[ i ] ) ); } obj = cls->addit( type, x, y, w, h, "" ); fl_set_xyplot_data( obj, xx, yy, 30, "", "", "" ); } break; case FL_FREE: if ( type == -1 ) type = FL_NORMAL_FREE; obj = fl_add_free( type, x, y, w, h, "", noop_handle ); break; default: if ( type == -1 ) type = cls->default_type; obj = cls->addit( type, x, y, w, h, cls->default_label ); break; } if ( ! obj ) { fprintf( stderr, "Failed to create object (class = %d type = %d)\n", objclass, type ); return NULL; } obj->fl1 = obj->x; obj->fr1 = cur_form->w_hr - obj->fl1; obj->ft1 = obj->y; obj->fb1 = cur_form->h_hr - obj->ft1; obj->fl2 = obj->x + obj->w; obj->fr2 = cur_form->w - obj->fl2; obj->ft2 = obj->y + obj->h; obj->fb2 = cur_form->h - obj->ft2; if ( ! cf || objclass == FL_END_GROUP ) { fl_end_form( ); cf = NULL; } obj->active = 1; return obj; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fd_names.c0000664000175000017500000001064012251555360013323 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fd_names.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * This file is part of the Form Designer. * * It contains the routines that keep track of the names and * callback routines associated to the different objects. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "fd_main.h" /**** * Structure for storing names connected with an object ****/ typedef struct { FL_OBJECT * obj; /* The object */ char name[ MAX_VAR_LEN ]; /* Its name (if any) */ char cbname[ MAX_VAR_LEN ]; /* Callback Routine */ char argname[ MAX_VAR_LEN ]; /* The argument */ } OBJ; static OBJ * objects = NULL; /* The stored objects */ static int num_objects = 0; /* Their number */ /*************************************** * Deletes the list of object name structures ***************************************/ void reset_object_list( void ) { fli_safe_free( objects ); num_objects = 0; } /*************************************** * Returns the index of the object in the list (or -1 if it's not found) ***************************************/ static int get_object_numb( const FL_OBJECT * obj ) { int i; for ( i = 0; i < num_objects; i++ ) if ( objects[ i ].obj == obj ) return i; return -1; } /*************************************** ***************************************/ static void check_names( int on ) { /* Fill in argument if missing */ if ( *objects[ on ].cbname && ! *objects[ on ].argname) strcpy( objects[ on ].argname, "0" ); } /*************************************** * Returns the names associated with an object ***************************************/ void get_object_name( const FL_OBJECT * obj, char * name, char * cbname, char * argname) { int on = get_object_numb( obj ); if ( name ) strcpy( name, on == -1 ? "" : objects[ on ].name ); if ( cbname ) strcpy( cbname, on == -1 ? "" : objects[ on ].cbname ); if ( argname ) strcpy( argname, on == -1 ? "" : objects[ on ].argname ); } /*************************************** * Sets the names belonging to an object ***************************************/ void set_object_name( FL_OBJECT * obj, const char * name, const char * cbname, const char * argname ) { int on; if ( obj == NULL ) return; if ( ( on = get_object_numb( obj ) ) == -1 ) { if ( ( ! name || ! *name ) && ( ! cbname || ! *cbname ) && ( ! argname || ! *argname ) ) return; objects = fl_realloc( objects, ++num_objects * sizeof *objects ); on = num_objects - 1; objects[ on ].obj = obj; *objects[ on ].name = *objects[ on ].cbname = *objects[ on ].argname = '\0'; } if ( name ) fli_sstrcpy( objects[ on ].name, name, sizeof objects[ on ].name ); if ( cbname) fli_sstrcpy( objects[ on ].cbname, cbname, sizeof objects[ on ].cbname ); if ( argname ) fli_sstrcpy( objects[ on ].argname, argname, sizeof objects[ on ].argname ); check_names( on ); } /*************************************** ***************************************/ const char * get_object_c_name( FL_OBJECT * obj ) { int on = get_object_numb( obj ); return on == -1 ? NULL : objects[ on ].name; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fd_help.h0000644000175000017500000000165311665175642013170 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifndef FD_HELP_H #define FD_HELP_H enum { HELP_VERSION, HELP_GENERAL, HELP_MOUSE, HELP_KEYBOARD, HELP_GROUP, HELP_TEST, HELP_SAVE }; #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fd_iconinfo.c0000664000175000017500000002224712353623325014032 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "fd_main.h" #include "fd_iconinfo.h" /*************************************** ***************************************/ static int is_blank( char c ) { return c == ' ' || c == '\t'; } /*************************************** ***************************************/ IconInfo * get_iconinfo( FL_OBJECT * obj ) { IconInfo *info = obj->c_vdata; if ( obj->objclass != FL_PIXMAPBUTTON && obj->objclass != FL_BITMAPBUTTON && obj->objclass != FL_PIXMAP && obj->objclass != FL_BITMAP ) return NULL; if ( ! info ) { info = obj->c_vdata = fl_malloc( sizeof *info ); info->use_data = 0; info->show_focus = 1; info->dx = 0; info->dy = 0; info->align = FL_ALIGN_CENTER; info->fullpath = 1; *info->filename = '\0'; *info->focus_filename = '\0'; *info->data = '\0'; *info->focus_data = '\0'; *info->width = '\0'; *info->height = '\0'; } return info; } /*************************************** ***************************************/ void copy_iconinfo( FL_OBJECT * target, FL_OBJECT * src ) { IconInfo *si = get_iconinfo( src ), *ti; fli_safe_free( target->c_vdata ); if ( ! si ) return; ti = get_iconinfo( target ); *ti = *si; } /*************************************** ***************************************/ void free_iconinfo( FL_OBJECT * obj ) { fli_safe_free( obj->c_vdata ); } /*************************************** * Function tries to read a line (of arbirary length) from a file * On failure (either due to read error or missing memory) NULL is * returned, otherwise a pointer to an allocated buffer that must * be freed by the caller. ***************************************/ #define STRING_TRY_LENGTH 128 static char * read_line( FILE * fp ) { char *line = NULL; char *old_line = NULL; size_t len = STRING_TRY_LENGTH; size_t old_len = 0; while ( 1 ) { if ( ( line = fl_realloc( line, len ) ) == NULL ) { fli_safe_free( old_line ); return NULL; } if ( ! fgets( line + old_len, len - old_len, fp ) ) { if ( ferror( fp ) ) { fl_free( line ); return NULL; } if ( old_len == 0 ) { fl_free( line ); return NULL; } break; } if ( strchr( line + old_len, '\n' ) ) break; old_line = line; old_len = len - 1; len *= 2; } old_line = line; if ( ( line = fl_realloc( line, strlen( line ) + 1 ) ) == NULL ) return old_line; return line; } /*************************************** ***************************************/ static const char * check_for_define( const char * line ) { while ( *line && is_blank( *line ) ) line++; if ( ! *line || *line != '#' ) return NULL; while ( *++line && is_blank( *line ) ) /* empty */ ; if ( ! *line ) return NULL; if ( strncmp( line, "define", 6 ) ) return NULL; line += 6; while ( *line && is_blank( *line ) ) line++; if ( ! ( isupper( *line ) || islower( *line ) || *line == '_' ) ) return NULL; return line; } /*************************************** ***************************************/ static char * check_for_end( const char * line, const char * what ) { static char name[ MAX_VAR_LEN ]; const char *start; size_t len; if ( ( ! ( start = check_for_define( line ) ) ) ) return NULL; line = start; while ( *line && ( isupper( *line ) || islower( *line ) || isdigit( *line ) || *line == '_' ) ) line++; if ( ! is_blank( *line ) ) return NULL; len = line - start; if ( len > MAX_VAR_LEN - 1 || len <= strlen( what ) ) return NULL; strncpy( name, start, len ); name[ len ] = '\0'; if ( strcmp( name + len - strlen( what ), what ) ) return NULL; return name; } /*************************************** ***************************************/ static char * check_for_data( const char * line, const char * what ) { static char name[ MAX_VAR_LEN ]; const char *start; size_t len; /* Skip leading blanks */ while ( *line && is_blank( *line ) ) line++; /* First word must be 'static', followed by a blank */ if ( ! *line || strncmp( line, "static", 6 ) ) return NULL; line += 6; if ( ! *line || ! is_blank( *line ) ) return NULL; while ( *++line && is_blank( *line ) ) /* empty */ ; /* Skip optional 'const', followed by a blank */ if ( ! strncmp( line, "const", 5 ) ) { line += 5; if ( ! *line || ! is_blank( *line ) ) return NULL; while ( *++line && is_blank( *line ) ) /* empty */ ; } /* Skip optional 'unsigned', followed by a blank */ if ( ! strncmp( line, "unsigned", 8 ) ) { line += 8; if ( ! *line || ! is_blank( *line ) ) return NULL; while ( *++line && is_blank( *line ) ) /* empty */ ; } /* Now 'char', followed by at least one blank must follow */ if ( ! *line || strncmp( line, "char", 4 ) ) return NULL; line += 4; if ( ! *line || ! ( is_blank( *line ) || *line == '*' ) ) return NULL; while ( *++line && is_blank( *line ) ) /* empty */ ; /* Skip optional 'const', followed by a blank */ if ( ! strncmp( line, "const", 5 ) ) { line += 5; while ( *line && is_blank( *line ) ) line++; } /* When reading an xpm file a '*' must come next */ if ( ! strcmp( what, "_pixels" ) ) { if ( ! *line || *line != '*' ) return NULL; while ( ++line && is_blank( *line ) ) /* empty */ ; } /* Now we should have arrived at the variable name */ start = line; while ( *line && ( isupper( *line ) || islower( *line ) || isdigit( *line ) || *line == '_' ) ) line++; /* Check that the variable name is ok */ len = line - start; if ( len > MAX_VAR_LEN - 1 || ( ! strcmp( what, "_bits" ) && len < 6 ) ) return NULL; strncpy( name, start, len ); name[ len ] = '\0'; /* A blank or a '[' must immediately followe the variable name */ if ( ! *line || ! ( is_blank( *line ) || *line == '[' ) ) return NULL; /* Make sure that the next non-blank char is a '[' */ while ( *line && is_blank( *line ) ) line++; return *line == '[' ? name : NULL; } /*************************************** * Tries to guess the names of the variables used for width, height * and data in a xbm file from the file name. ***************************************/ void get_xbm_stuff( IconInfo * info, FILE * fp ) { char *line; char *res; int found = 0; *info->width = *info->height = *info->data = '\0'; while ( found < 3 && ( line = read_line( fp ) ) ) { if ( ( res = check_for_end( line, "_width" ) ) ) { strcpy( info->width, res ); found++; } else if ( ( res = check_for_end( line, "_height" ) ) ) { strcpy( info->height, res ); found++; } else if ( ( res = check_for_data( line, "_bits" ) ) ) { strcpy( info->data, res ); found++; } fl_free( line ); } if ( found < 3 ) { fprintf( stderr, "Failed to parse xbm file\n" ); *info->width = *info->height = *info->data = '\0'; } } /*************************************** * Read in an (already opened) xpm file and return via 'in' * the name of the variable for the data. ***************************************/ void get_xpm_stuff( char * in, FILE * fp ) { char *line; char *res; *in = '\0'; while ( ( line = read_line( fp ) ) ) { if ( ( res = check_for_data( line, "_pixels" ) ) ) { strcpy( in, res ); fl_free( line ); return; } fl_free( line ); } } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_twheel.h0000664000175000017500000000225412244217405013545 00000000000000/* * * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifndef SP_THWHEEL_H_ #define SP_THWHEEL_H_ #include "include/forms.h" #include FL_FORM * thwheel_create_spec_form( void ); void twheel_fill_in_spec_form( FL_OBJECT * obj ); void twheel_reread_spec_form( FL_OBJECT * obj ); void twheel_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ); void twheel_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ); #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_menu.h0000664000175000017500000000264212244217405013222 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifndef SP_MENU_H_ #define SP_MENU_H_ void menu_change_type( FL_OBJECT * obj, int new_type ); FL_FORM * menu_create_spec_form( void ); void menu_fill_in_spec_form( FL_OBJECT * obj ); void menu_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ); void menu_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ); void menu_emit_spec_header( FILE * fp, FL_OBJECT * obj ); void menu_emit_spec_global_header( FILE * fp, FL_OBJECT * obj ); void menu_emit_item_callback_headers( FILE * fn, FL_OBJECT * obj, int code ); #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_browser.c0000664000175000017500000001626212253056056013742 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file sp_browser.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. *. * Settting browser class specific attributes. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "fd_main.h" #include "fd_spec.h" #include "sp_browser.h" #include "private/pbrowser.h" #include "spec/browser_spec.h" static FD_browserattrib *br_attrib; static FL_OBJECT * curobj; /*************************************** ***************************************/ FL_FORM * browser_create_spec_form( void ) { if ( br_attrib ) return br_attrib->browserattrib; br_attrib = create_form_browserattrib( ); fl_addto_choice( br_attrib->hscb_pref, get_scrollbar_pref_string( ) ); fl_addto_choice( br_attrib->vscb_pref, get_scrollbar_pref_string( ) ); setup_how_return_menu( br_attrib->returnsetting ); return br_attrib->browserattrib; } /*************************************** ***************************************/ void browser_fill_in_spec_form( FL_OBJECT * obj ) { FLI_BROWSER_SPEC *sp = obj->spec; int i; int nlines = fl_get_browser_maxline( obj ); curobj = obj; fl_set_choice( br_attrib->hscb_pref, sp->h_pref + 1 ); fl_set_choice( br_attrib->vscb_pref, sp->v_pref + 1 ); fl_freeze_form( br_attrib->content_br->form ); fl_clear_browser( br_attrib->content_br ); for ( i = 1; i <= nlines; i++ ) fl_add_browser_line( br_attrib->content_br, fl_get_browser_line( obj, i ) ); fl_unfreeze_form( br_attrib->content_br->form ); reset_how_return_menu( br_attrib->returnsetting, obj->how_return ); } /*************************************** ***************************************/ void browser_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = fl_create_browser( obj->type, 0, 0, 0, 0, "" ); FLI_BROWSER_SPEC *sp = obj->spec, *defsp = defobj->spec; int i; int nlines = fl_get_browser_maxline( obj ); if ( sp->h_pref != defsp->h_pref ) fprintf( fp, "h_pref: %s\n", get_scrollbar_pref_name( sp->h_pref ) ); if ( sp->v_pref != defsp->v_pref ) fprintf( fp, "v_pref: %s\n", get_scrollbar_pref_name( sp->v_pref ) ); for ( i = 1; i <= nlines; i++ ) fprintf( fp, "content: %s\n", fl_get_browser_line( obj, i ) ); } /*************************************** ***************************************/ void browser_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = fl_create_browser( obj->type, 0, 0, 0, 0, "" ); FLI_BROWSER_SPEC *sp = obj->spec, *defsp = defobj->spec; int i; int nlines = fl_get_browser_maxline( obj ); if ( sp->h_pref != defsp->h_pref ) fprintf( fp, " fl_set_browser_hscrollbar( obj, %s );\n", get_scrollbar_pref_name( sp->h_pref ) ); if ( sp->v_pref != defsp->v_pref ) fprintf( fp, " fl_set_browser_vscrollbar( obj, %s );\n", get_scrollbar_pref_name( sp->v_pref ) ); for ( i = 1; i <= nlines; i++ ) fprintf( fp, " fl_add_browser_line( obj, \"%s\" );\n", fl_get_browser_line( obj, i ) ); } /*************************************** * Callbacks and freeobj handles for form browserattrib ***************************************/ void add_item_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { FD_browserattrib *ui = obj->form->fdui; const char *s = fl_get_input( ui->input ); if ( ! s ) s = ""; fl_addto_browser( ui->content_br, s ); fl_addto_browser( curobj, s ); if ( fl_get_button( ui->auto_clear ) ) fl_set_input( ui->input, "" ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void replace_item_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { FD_browserattrib *ui = obj->form->fdui; int i = fl_get_browser( ui->content_br ); const char *s = fl_get_input( ui->input ); if ( i > 0 ) { if ( ! s ) s = ""; fl_replace_browser_line( ui->content_br, i, s ); fl_replace_browser_line( curobj, i, s ); if ( fl_get_button( ui->auto_clear ) ) fl_set_input( ui->input, "" ); } redraw_the_form( 0 ); } /*************************************** ***************************************/ void insert_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { FD_browserattrib *ui = obj->form->fdui; int i = fl_get_browser( ui->content_br ); const char *s = fl_get_input( ui->input ); if ( i > 0 ) { if ( ! s ) s = ""; fl_insert_browser_line( ui->content_br, i, s ); fl_insert_browser_line( curobj, i, s ); if ( fl_get_button( ui->auto_clear ) ) fl_set_input( ui->input, "" ); } redraw_the_form( 0 ); } /*************************************** ***************************************/ void delete_item_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { FD_browserattrib *ui = obj->form->fdui; int i = fl_get_browser( ui->content_br ); if ( i <= 0 ) return; fl_delete_browser_line( ui->content_br, i ); fl_delete_browser_line( curobj, i ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void hscb_pref_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { fl_set_browser_hscrollbar( curobj, fl_get_choice( obj ) - 1 ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void vscb_pref_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { fl_set_browser_vscrollbar( curobj, fl_get_choice( obj ) - 1 ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void br_returnsetting_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { handle_how_return_changes( obj, curobj ); } /*************************************** ***************************************/ void clear_field_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_browserattrib *ui = ob->form->fdui; fl_set_input( ui->input, "" ); } #include "spec/browser_spec.c" /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fd_select.c0000664000175000017500000012241712353623325013505 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fd_select.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Part of the Form Designer. * * This file contains all routines and data types to maintain the current * selection and manipulate (move, scale) and draw it. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "fd_main.h" #include "fd_spec.h" #include "fd_iconinfo.h" #define MAXSEL 2048 #define BackOBJ( ) cur_form->first->next static FL_OBJECT *selobj[ MAXSEL ]; /* list of selected objects */ static int selnumb = 0; /* and their number */ static int backf = FL_FALSE; /* whether the selection is the backface */ static FL_OBJECT * copy_object( FL_OBJECT * obj, int exact ); static void set_attribs( FL_OBJECT * obj, FL_OBJECT * src ); /*************************************** * Returns the index of a particular object. -1 if it is not selected ***************************************/ static int find_selobject( FL_OBJECT * obj ) { int i; for ( i = 0; i < selnumb; i++ ) if ( selobj[ i ] == obj ) return i; return -1; } /*************************************** * Make a new, properly ordered list of selected objects, removing * duplicates and objects set to NULL ***************************************/ static void cleanup_selection_list( void ) { FL_OBJECT **tmpobj = fl_malloc( selnumb * sizeof *tmpobj ), *obj; int tmpnumb = 0; for ( obj = cur_form->first; obj != NULL; obj = obj->next ) if ( find_selobject( obj ) != -1 ) tmpobj[ tmpnumb++ ] = obj; memcpy( selobj, tmpobj, tmpnumb * sizeof *tmpobj ); fl_free( tmpobj ); selnumb = tmpnumb; } /*************************************** * Cleans up the selection, ordering the objects and creating * groups if all elements are in there ***************************************/ static void cleanup_selection( void ) { FL_OBJECT *obj, *begobj = NULL; int tt, sel = -1; if ( cur_form == NULL ) { selnumb = 0; backf = FL_FALSE; return; } /* Figure out whether whole groups are selected */ for ( obj = cur_form->first; obj != NULL; obj = obj->next ) { if ( obj->objclass == FL_BEGIN_GROUP ) { sel = 1; begobj = obj; } else if ( obj->objclass == FL_END_GROUP ) { if ( sel ) { selobj[ selnumb++ ] = begobj; selobj[ selnumb++ ] = obj; sel = 0; } else { if ( ( tt = find_selobject( begobj ) ) != -1 ) selobj[ tt ] = NULL; if ( ( tt = find_selobject( obj ) ) != -1 ) selobj[ tt ] = NULL; } } else if ( ! obj->parent && find_selobject( obj ) == -1 ) sel = 0; } cleanup_selection_list( ); fillin_groups( ); } /*************************************** * Returns whether object is selected ***************************************/ int is_selected( FL_OBJECT * obj ) { return find_selobject( obj ) != -1; } /*************************************** * Adds an object to the current selection ***************************************/ void addto_selection( FL_OBJECT * obj ) { /* Find the real parent */ while ( obj->parent ) obj = obj->parent; /* Don't add objects with backface */ if ( backf ) clear_selection( ); if ( selnumb >= MAXSEL ) { fprintf( stderr, "Exceeding selection limits\n" ); return; } selobj[ selnumb++ ] = obj; cleanup_selection( ); } /*************************************** * Adds a group to the current selection ***************************************/ void addgroupto_selection( FL_OBJECT * obj ) { FL_OBJECT *ob; if ( obj->objclass != FL_BEGIN_GROUP ) return; /* If the currently selected object is the backface then deselect it */ if ( backf ) clear_selection( ); for ( ob = obj; ob && ob->objclass != FL_END_GROUP; ob = ob->next ) { if ( ob->parent ) continue; if ( selnumb >= MAXSEL - 1 ) { fprintf( stderr, "Exceeding selection limits\n" ); while ( selobj[ --selnumb ]->objclass != FL_BEGIN_GROUP ) /* empty */ ; return; } selobj[ selnumb++ ] = ob; } if ( ob != NULL ) selobj[ selnumb++ ] = ob; cleanup_selection( ); } /*************************************** * Removes an object from the selection (if present) ***************************************/ void deletefrom_selection( FL_OBJECT * obj ) { int ind = find_selobject( obj ); if ( ind != -1 ) selobj[ ind ] = NULL; cleanup_selection( ); } /*************************************** * Removes a group to the current selection ***************************************/ void deletegroupfrom_selection( FL_OBJECT * obj ) { FL_OBJECT *ob; int ind; if ( backf ) return; /* Don't remove objects with backface */ if ( obj->objclass != FL_BEGIN_GROUP ) return; for ( ob = obj; ob != NULL && ob->objclass != FL_END_GROUP; ob = ob->next ) if ( ( ind = find_selobject( ob ) ) != -1 ) selobj[ ind ] = NULL; cleanup_selection( ); } /*************************************** * Clears the complete selection ***************************************/ void clear_selection( void ) { backf = FL_FALSE; selnumb = 0; cleanup_selection( ); } /**** Helper procedures ****/ /*************************************** * Compute the bounding box of the selection ***************************************/ static void compute_selbox( double * x, double * y, double * w, double * h ) { int i; double x1 = DBL_MAX, y1 = DBL_MAX, x2 = - DBL_MAX, y2 = - DBL_MAX; for ( i = 0; i < selnumb; i++ ) if ( selobj[ i ]->objclass != FL_BEGIN_GROUP && selobj[ i ]->objclass != FL_END_GROUP ) { if ( selobj[ i ]->fl1 < x1 ) x1 = selobj[ i ]->fl1; if ( selobj[ i ]->ft1 < y1 ) y1 = selobj[ i ]->ft1; if ( selobj[ i ]->fl2 > x2 ) x2 = selobj[ i ]->fl2; if ( selobj[ i ]->ft2 > y2 ) y2 = selobj[ i ]->ft2; } *x = x1; *y = y1; *w = x2 - x1; *h = y2 - y1; } /*************************************** * Find position of the mouse mouse ***************************************/ static void find_mousepos( double * mx, double * my ) { if ( cur_form == NULL ) return; fl_winset( main_window ); get_mouse_pos( mx, my ); } /*************************************** * Returns the object under the mouse. ***************************************/ static FL_OBJECT * find_mouseobj( void ) { double xx, yy; if ( cur_form == NULL ) return NULL; find_mousepos( &xx, &yy ); return fli_find_last( cur_form, FLI_FIND_MOUSE, xx, yy ); } /**** Drawing routines ****/ #define HS 8 int hidden = FL_FALSE; /*************************************** * Draw the selection box ***************************************/ void draw_selbox( void ) { double x, y, w, h; int i; FL_OBJECT *ob; if ( selnumb == 0 ) return; /* Draw object boxes */ color( fd_red ); for ( i = 0; i < selnumb; i++ ) { ob = selobj[ i ]; if ( ob->objclass != FL_BEGIN_GROUP && ob->objclass != FL_END_GROUP ) rect( ob->x, ob->y, ob->x + ob->w - 1.0, ob->y + ob->h - 1.0 ); } if ( hidden ) return; /* Draw the total box */ compute_selbox( &x, &y, &w, &h ); show_geometry( x, y, w, h ); if ( ! backf ) { x -= 1.0; y -= 1.0; w += 2.0; h += 2.0; } color( fd_red ); rect( x, y, x + w - 1.0, y + h - 1.0 ); rectf( x, y, x + HS - 1.0, y + HS - 1.0 ); rectf( x + w - HS, y, x + w - 1.0, y + HS - 1.0 ); rectf( x + w - HS, y + h - HS, x + w - 1.0, y + h - 1.0 ); rectf( x, y + h - HS, x + HS - 1.0, y + h - 1.0 ); show_selmessage( selobj, selnumb ); } /**** Interaction handling ****/ /*************************************** * Handles the moving of the selection (by mouse) ***************************************/ int within_selection( double mx, double my ) { double x, y, w = 0.0, h = 0.0; if ( ! selnumb || ! cur_form || ! cur_form->first ) return 0; compute_selbox( &x, &y, &w, &h ); /* If backface, only within scale knob is considered within */ if ( selobj[ selnumb - 1 ] == BackOBJ( ) ) return mx >= x + w - HS && mx < x + w && my >= y + h - HS && my < y + h; return mx > x && mx < x + w && my > y && my < y + h; } /*************************************** ***************************************/ void handle_move( const XEvent * xev ) { double mx, my; double x, y, w, h; int s; if ( cur_form == NULL || backf ) return; fl_winset( main_window ); s = ShiftIsDown( xev->xbutton.state ); find_mousepos( &mx, &my ); compute_selbox( &x, &y, &w, &h ); if ( mx < x || mx > x + w || my < y || my > y + h ) return; /* not in box */ hidden = FL_TRUE; redraw_the_form( 0 ); if ( s ) { copy_selection( ); paste_selection( ); } else { int i; double ox = x; double oy = y; double ow = w; double oh = h; /* Show the rubberband box */ if ( mx <= x + HS && my <= y + HS ) { x += w; y += h; w = -w; h = -h; scale_box( &x, &y, &w, &h ); } else if ( mx <= x + HS && my >= y + h - HS ) { x += w; w = -w; scale_box( &x, &y, &w, &h ); } else if ( mx >= x + w - HS && my <= y + HS ) { y += h; h = -h; scale_box( &x, &y, &w, &h ); } else if ( mx >= x + w - HS && my >= y + h - HS ) scale_box( &x, &y, &w, &h ); else move_box( &x, &y, &w, &h, FL_TRUE ); /* Recompute object sizes */ for ( i = 0; i < selnumb; i++ ) { if ( selobj[ i ]->objclass != FL_BEGIN_GROUP && selobj[ i ]->objclass != FL_END_GROUP ) { selobj[ i ]->fl1 -= ox; selobj[ i ]->fl2 -= ox; selobj[ i ]->fr1 += ox; selobj[ i ]->fr2 += ox; selobj[ i ]->ft1 -= oy; selobj[ i ]->ft2 -= oy; selobj[ i ]->fb1 += oy; selobj[ i ]->fb2 += oy; fli_scale_object( selobj[ i ], w / ow, h / oh); selobj[ i ]->x = selobj[ i ]->fl1 += x; selobj[ i ]->fl2 += x; selobj[ i ]->fr1 -= x; selobj[ i ]->fr2 -= x; selobj[ i ]->y = selobj[ i ]->ft1 += y; selobj[ i ]->ft2 += y; selobj[ i ]->fb1 -= y; selobj[ i ]->fb2 -= y; fli_notify_object( selobj[ i ], FL_RESIZED ); } } } fli_recalc_intersections( cur_form ); hidden = FL_FALSE; redraw_the_form( backf ); changed = FL_TRUE; } /*************************************** * We know how many pixels to move ***************************************/ void move_selection( FL_Coord dx, FL_Coord dy ) { int i; double x, y, w, h; double ox, oy; FL_OBJECT *ob; if ( ! cur_form || backf || selnumb == 0 ) return; compute_selbox( &x, &y, &w, &h ); ox = x; oy = y; if ( ( x += dx ) < 0 ) x = 0.0; else if ( x + w > winw ) x = winw - w; if ( ( y += dy ) < 0 ) y = 0.0; else if ( y + h > winh ) y = winh - h; if ( ( dx = x - ox ) == 0 && ( dy = y - oy ) == 0 ) return; for ( i = 0; i < selnumb; i++ ) { ob = selobj[ i ]; if ( ob->objclass != FL_BEGIN_GROUP && ob->objclass != FL_END_GROUP ) { ob->x += dx; ob->fl1 += dx; ob->fl2 += dx; ob->fr1 -= dx; ob->fr2 -= dx; ob->y += dy; ob->ft1 += dy; ob->ft2 += dy; ob->fb1 -= dy; ob->fb2 -= dy; fli_notify_object( ob, FL_RESIZED ); } } redraw_the_form( 1 ); changed = FL_TRUE; } /*************************************** * Change the selection size ***************************************/ #define MINSIZE 5 #define DELTA 0.2 void resize_selection( FL_Coord dx, FL_Coord dy ) { double x, y, w, h, ox, oy, ow, oh; double yscale, xscale; int i; if ( ! cur_form || selnumb == 0 ) return; compute_selbox( &x, &y, &w, &h ); ox = x; oy = y; ow = w; oh = h; if ( backf ) { winw = fl_scrw; winh = fl_scrh; } if ( ( w += dx ) > winw) w = winw; else if ( w < MINSIZE ) w = MINSIZE; if ( ( h += dy ) > winh ) h = winh; else if ( h < MINSIZE ) h = MINSIZE; if ( w == ow && oh == h ) return; xscale = w / ow; yscale = h / oh; /* Recompute object sizes */ for ( i = 0; i < selnumb; i++ ) if ( selobj[ i ]->objclass != FL_BEGIN_GROUP && selobj[ i ]->objclass != FL_END_GROUP ) { selobj[ i ]->fl1 -= ox; selobj[ i ]->fl2 -= ox; selobj[ i ]->fr1 += ox; selobj[ i ]->fr2 += ox; selobj[ i ]->ft1 -= oy; selobj[ i ]->ft2 -= oy; selobj[ i ]->fb1 += oy; selobj[ i ]->fb2 += oy; fli_scale_object( selobj[ i ], xscale, yscale ); selobj[ i ]->x = selobj[ i ]->fl1 += x; selobj[ i ]->fl2 += x; selobj[ i ]->fr1 -= x; selobj[ i ]->fr2 -= x; selobj[ i ]->y = selobj[ i ]->ft1 += y; selobj[ i ]->ft2 += y; selobj[ i ]->fb1 -= y; selobj[ i ]->fb2 -= y; fli_notify_object( selobj[ i ], FL_RESIZED ); } fli_recalc_intersections( cur_form ); if ( backf ) { cur_form->w_hr = cur_form->w = selobj[ 0 ]->w; cur_form->h_hr = cur_form->h = selobj[ 0 ]->h; fl_winresize( main_window, cur_form->w, cur_form->h ); } redraw_the_form( 1 ); changed = FL_TRUE; } /*************************************** * Handles the selection of objects ***************************************/ void handle_select( const XEvent * xev ) { int s; FL_OBJECT * obj, * mouseobj; double x, y, w, h; double stepsize; if ( ! ( mouseobj = find_mouseobj( ) ) ) return; if ( ( s = ShiftIsDown( xev->xbutton.state ) ) ) /* Shift Push */ { if ( ! cur_form->first ) { fprintf( stderr, "something is wrong, form has No objects\n" ); return; } if ( mouseobj == BackOBJ( ) ) return; if ( find_selobject( mouseobj ) == -1 ) addto_selection( mouseobj ); else deletefrom_selection( mouseobj ); return; } clear_selection( ); find_mousepos( &x, &y ); w = 0.0; h = 0.0; stepsize = get_step_size( ); set_step_size( 0.0 ); if ( xev->type != ButtonRelease ) scale_box( &x, &y, &w, &h ); set_step_size( stepsize ); obj = BackOBJ( )->next; while ( obj != NULL ) { if ( obj->objclass != FL_BEGIN_GROUP && obj->objclass != FL_END_GROUP && obj->x >= x && obj->y >= y && obj->x + obj->w <= x + w && obj->y + obj->h <= y + h ) addto_selection( obj ); obj = obj->next; } if ( selnumb == 0 ) { if ( mouseobj == NULL ) return; else if ( mouseobj == BackOBJ( ) ) { addto_selection( mouseobj ); backf = FL_TRUE; } else addto_selection( mouseobj ); } } /*************************************** * Selects all objects in the form. ***************************************/ void select_all( void ) { FL_OBJECT *obj; if ( ! cur_form ) return; clear_selection( ); for ( obj = BackOBJ( )->next; obj != NULL; obj = obj->next ) if ( ! obj->parent ) selobj[ selnumb++ ] = obj; cleanup_selection( ); } /**** Operations on the selection ****/ /*************************************** * Clone curobj's attributes to the currently selected objects ***************************************/ static void change_selected_objects( FL_OBJECT * curobj ) { int i; FL_OBJECT *ob; for ( i = 0; i < selnumb; i++ ) { ob = selobj[ i ]; if ( ob == curobj ) continue; if ( ob->objclass != FL_BEGIN_GROUP && ob->objclass != FL_END_GROUP ) { spec_change_type( ob, curobj->type ); set_attribs( ob, curobj ); } } } /*************************************** * Interactively change the attributes of the selection ***************************************/ void change_selection( void ) { FL_OBJECT *firstobj = NULL; int objclass = -1, i; FL_OBJECT *ob; if ( ! cur_form ) return; if ( selnumb == 0 ) { fl_show_alert( "", "Please select object to edit", "by single-clicking on it", 0 ); return; } if ( selnumb == 1 ) { if ( change_object( selobj[ 0 ], FL_TRUE ) ) changed = 1; return; } for ( i = 0; i < selnumb; i++ ) { ob = selobj[ i ]; if ( ob->objclass != FL_BEGIN_GROUP && ob->objclass != FL_END_GROUP ) { if ( firstobj == NULL ) { firstobj = ob; objclass = ob->objclass; } else if ( objclass != ob->objclass ) { fl_show_messages( "Selected objects have different " "classes" ); return; } } } if ( firstobj == NULL ) return; if ( ! change_object( firstobj, FL_FALSE ) ) return; change_selected_objects( firstobj ); changed = 1; } /*************************************** * Aligns the objects in the selection ***************************************/ void align_selection( int dir ) { double x, y, w, h, gap, shift; int used[ MAXSEL ], current; int i, j; if ( backf || ! cur_form ) return; /* Cannot align the backface */ if ( selnumb <= 1 ) return; /* Nothing to align */ compute_selbox( &x, &y, &w, &h ); if ( dir == FD_HEQUAL ) /* Horizontal equal distance */ { gap = 0.0; for ( i = 0; i < selnumb; i++ ) gap += selobj[ i ]->w; gap = ( w - gap ) / ( selnumb - 1 ); for ( i = 0; i < selnumb; i++ ) used[ i ] = 0; for ( j = 0; j < selnumb; j++ ) { current = -1; for ( i = 0; i < selnumb; i++ ) if ( ! used[ i ] ) if ( current == -1 || selobj[ i ]->x < selobj[ current ]->x ) current = i; used[ current ] = 1; shift = x - selobj[ current ]->x; selobj[ current ]->x += shift; selobj[ current ]->fl1 += shift; selobj[ current ]->fl2 += shift; selobj[ current ]->fr1 -= shift; selobj[ current ]->fr2 -= shift; x += selobj[ current ]->w + gap; } } else if ( dir == FD_VEQUAL ) /* Vertical equal distance */ { gap = 0.0; for ( i = 0; i < selnumb; i++ ) gap += selobj[ i ]->h; gap = ( h - gap ) / ( selnumb - 1 ); for ( i = 0; i < selnumb; i++ ) used[ i ] = 0; for ( j = 0; j < selnumb; j++ ) { current = -1; for ( i = 0; i < selnumb; i++ ) if ( ! used[ i ] ) if ( current == -1 || selobj[ i ]->y < selobj[ current ]->y ) current = i; used[ current ] = 1; shift = y - selobj[ current ]->y; selobj[ current ]->y += shift; selobj[ current ]->ft1 += shift; selobj[ current ]->ft2 += shift; selobj[ current ]->fb1 -= shift; selobj[ current ]->fb2 -= shift; y += selobj[ current ]->h + gap; } } else for ( i = 0; i < selnumb; i++ ) { switch ( dir ) { case FD_LEFT: /* Left */ shift = x - selobj[ i ]->x; selobj[ i ]->x += shift; selobj[ i ]->fl1 += shift; selobj[ i ]->fl2 += shift; selobj[ i ]->fr1 -= shift; selobj[ i ]->fr2 -= shift; break; case FD_HCENTER: /* Center */ shift = x + w / 2.0 - selobj[ i ]->w / 2.0 - selobj[ i ]->x; selobj[ i ]->x += shift; selobj[ i ]->fl1 += shift; selobj[ i ]->fl2 += shift; selobj[ i ]->fr1 -= shift; selobj[ i ]->fr2 -= shift; break; case FD_RIGHT: /* Right */ shift = x + w - selobj[ i ]->w - selobj[ i ]->x; selobj[ i ]->x += shift; selobj[ i ]->fl1 += shift; selobj[ i ]->fl2 += shift; selobj[ i ]->fr1 -= shift; selobj[ i ]->fr2 -= shift; break; case FD_TOP: shift = y - selobj[ i ]->y; selobj[ i ]->y += shift; selobj[ i ]->ft1 += shift; selobj[ i ]->ft2 += shift; selobj[ i ]->fb1 -= shift; selobj[ i ]->fb2 -= shift; break; case FD_VCENTER: /* Center */ shift = y + h / 2.0 - selobj[ i ]->h / 2.0 - selobj[ i ]->y; selobj[ i ]->y += shift; selobj[ i ]->ft1 += shift; selobj[ i ]->ft2 += shift; selobj[ i ]->fb1 -= shift; selobj[ i ]->fb2 -= shift; break; case FD_BOTTOM: shift = y + h - selobj[ i ]->h - selobj[ i ]->y; selobj[ i ]->y += shift; selobj[ i ]->ft1 += shift; selobj[ i ]->ft2 += shift; selobj[ i ]->fb1 -= shift; selobj[ i ]->fb2 -= shift; break; } } redraw_the_form( 0 ); changed = 1; } /*************************************** * Shows all objects in the selection. ***************************************/ void show_selection( void ) { int i; if ( backf ) return; /* Cannot show the backface */ if ( ! cur_form ) return; for ( i = 0; i < selnumb; i++ ) fl_show_object( selobj[ i ] ); } /*************************************** * Hides all objects in the selection. ***************************************/ void hide_selection( void ) { int i; if ( backf ) return; /* Cannot hide the backface */ if ( ! cur_form ) return; for ( i = 0; i < selnumb; i++ ) fl_hide_object( selobj[ i ] ); } /*************************************** * Raises the selected objects ***************************************/ void raise_selection( void ) { int i; FL_OBJECT **tmpobj; if ( backf ) return; /* Cannot raise the backface */ if ( ! cur_form ) return; tmpobj = fl_malloc( selnumb * sizeof *tmpobj ); memcpy( tmpobj, selobj, selnumb * sizeof *selobj ); for ( i = 0; i < selnumb; i++ ) { FL_OBJECT *first, *last; first = last = selobj[ i ]; if ( ! first ) continue; if ( first->objclass == FL_BEGIN_GROUP ) { int idx; /* If a whole group is selected we move it all at once, including the objects marking the groups begin and end */ do { last = last->next; if ( ( idx = find_selobject( last ) ) != -1 ) selobj[ idx ] = NULL; } while ( last->objclass != FL_END_GROUP ); /* If the group is already at the end of the forms objects there's nothing to raise */ if ( ! last->next ) continue; } else { /* If the object has children they also need raising, set last to the last child belonging to the object */ if ( last->child ) while ( last->next && last->next->parent ) last = last->next; /* Nothing to raise if we're already at the end of the list of objects of the form */ if ( ! last->next ) continue; /* If the object we raise belongs to a group remove it (and all it's chilren) from the group */ if ( first->group_id ) { FL_OBJECT *o; for ( o = first; o != last; o = o->next ) o->group_id = 0; last->group_id = 0; } } changed = 1; first->prev->next = last->next; last->next->prev = first->prev; first->prev = cur_form->last; cur_form->last->next = first; last->next = NULL; cur_form->last = last; } memcpy( selobj, tmpobj, selnumb * sizeof *selobj ); fl_free( tmpobj ); cleanup_selection( ); } /*************************************** * Lowers the selection ***************************************/ void lower_selection( void ) { int i; FL_OBJECT **tmpobj; if ( backf ) return; /* Cannot lower the backface. */ if ( ! cur_form ) return; tmpobj = fl_malloc( selnumb * sizeof *tmpobj ); memcpy( tmpobj, selobj, selnumb * sizeof *selobj ); for ( i = selnumb - 1; i >= 0; i-- ) { FL_OBJECT *first, *last; first = last = selobj[ i ]; if ( ! first || first->prev == BackOBJ( ) ) continue; if ( first->objclass == FL_END_GROUP ) { int idx; do { first = first->prev; if ( ( idx = find_selobject( first ) ) != -1 ) selobj[ idx ] = NULL; } while ( first->objclass != FL_BEGIN_GROUP ); /* If the group is already at the start of the forms objects (except the backface object) there's nothing to raise */ if ( first->prev == BackOBJ( ) ) continue; } else { /* If the object has children they also need lowering, set last to the last child belonging to the object */ if ( last->child ) while ( last->next && last->next->parent ) last = last->next; /* Nothing to lower if we're already at the start of the list of objects of the form (module the backface object) */ if ( first->prev == BackOBJ( ) ) continue; /* If the object we raise belongs to a group remove it (and all it's chilren) from the group */ if ( first->group_id ) { FL_OBJECT *o; for ( o = first; o != last; o = o->next ) o->group_id = 0; last->group_id = 0; } } changed = 1; first->prev->next = last->next; if ( last->next ) last->next->prev = first->prev; else cur_form->last = first->prev; BackOBJ( )->next->prev = last; last->next = BackOBJ( )->next; BackOBJ( )->next = first; first->prev = BackOBJ( ); } memcpy( selobj, tmpobj, selnumb * sizeof *selobj ); fl_free( tmpobj ); cleanup_selection( ); } static FL_OBJECT *cutbuf[ MAXSEL ]; /* Buffered objects */ static int ncut = 0; /* and their number */ /*************************************** ***************************************/ static void clear_cutbuffer( void ) { while ( ncut > 0 ) { ncut--; if ( cutbuf[ ncut ]->u_vdata ) fl_free( cutbuf[ ncut ]->u_vdata ); fl_free_object( cutbuf[ ncut ] ); } } /*************************************** * Removes all elements in the selection ***************************************/ void cut_selection( void ) { int i; if ( backf ) return; /* Cannot cut the backface. */ if ( ! cur_form ) { addform_cb( NULL, 0 ); if ( ! cur_form ) return; } if ( selnumb == 0 ) return; clear_cutbuffer( ); /* Make new deletion and save it */ for ( i = 0; i < selnumb; i++ ) if ( selobj[ i ]->objclass != FL_BEGIN_GROUP && selobj[ i ]->objclass != FL_END_GROUP ) { fl_delete_object( selobj[ i ] ); cutbuf[ ncut++ ] = copy_object( selobj[ i ], 1 ); } selnumb = 0; clear_selection( ); changed = 1; } /*************************************** * Pastes elements from buffer into form ***************************************/ void paste_selection( void ) { FL_OBJECT *obj; double x, y, w, h, ox, oy, shift; int i; if ( ! cur_form || ! ncut ) return; is_pasting = 1; /* horrible hack */ /* Copy selection from buffer */ clear_selection( ); redraw_the_form( 0 ); for ( i = 0; i < ncut; i++ ) { obj = copy_object( cutbuf[ i ], 1 ); /* Fix label: if underlining caused by cutbuf shortcut, remove it. Note can't use cutbuf as cutbuf does not contain shortcut info */ if ( obj->label && strchr( obj->label, *fl_ul_magic_char ) && selobj[ i ]->shortcut[ 0 ] ) { char *t, *b; b = t = fl_strdup( obj->label ); while ( ( b = strchr( b, *fl_ul_magic_char ) ) ) memmove( b, b + 1, strlen( b ) ); fl_set_object_label( obj, t ); fl_free( t ); } fl_add_object( cur_form, obj ); selobj[ selnumb++ ] = obj; } /* Move the selection to the correct place */ compute_selbox( &x, &y, &w, &h ); ox = x; oy = y; move_box( &x, &y, &w, &h, FL_FALSE ); /* Recompute object position */ for ( i = 0; i < selnumb; i++ ) if ( selobj[ i ]->objclass != FL_BEGIN_GROUP && selobj[ i ]->objclass != FL_END_GROUP) { shift = x - ox; selobj[ i ]->x += shift; selobj[ i ]->fl1 += shift; selobj[ i ]->fl2 += shift; selobj[ i ]->fr1 -= shift; selobj[ i ]->fr2 -= shift; shift = y - oy; selobj[ i ]->y += shift; selobj[ i ]->ft1 += shift; selobj[ i ]->ft2 += shift; selobj[ i ]->fb1 -= shift; selobj[ i ]->fb2 -= shift; fli_notify_object( selobj[ i ], FL_RESIZED ); } cleanup_selection( ); redraw_the_form( 0 ); changed = 1; is_pasting = 0; } /*************************************** * Copies all elements in the selection to the buffer ***************************************/ void copy_selection( void ) { int i; if ( backf || selnumb == 0 || ! cur_form ) return; clear_cutbuffer( ); /* Copy the objects */ for ( i = 0; i < selnumb; i++ ) if ( selobj[ i ]->objclass != FL_BEGIN_GROUP && selobj[ i ]->objclass != FL_END_GROUP ) cutbuf[ ncut++ ] = copy_object( selobj[ i ], 0 ); } /*************************************** * Makes a copy of the current selection ***************************************/ FL_OBJECT ** dup_selection( void ) { FL_OBJECT **ob; int i; if ( ! selnumb ) return NULL; ob = fl_malloc( ( selnumb + 1 ) * sizeof *ob ); for ( i = 0; i < selnumb; i++ ) ob[ i ] = copy_object( selobj[ i ], 1 ); ob[ selnumb ] = NULL; return ob; } /*************************************** ***************************************/ void free_dupped_selection( FL_OBJECT ** ob ) { int i; for ( i = 0; ob[ i ]; i++ ) fl_free_object( ob[ i ] ); fl_free( ob ); } /*************************************** * Changes the selection to a new list of objects and show it. * The pointer received must be an array of object pointers * with the last element being set to NULL. ***************************************/ void set_selection( FL_OBJECT ** ob ) { FL_OBJECT *obj; int i; for ( i = 0; i < selnumb; i++ ) fl_delete_object( selobj[ i ] ); clear_selection( ); redraw_the_form( 0 ); for ( selnumb = 0; selnumb < MAXSEL && ob[ selnumb ]; selnumb++ ) { obj = copy_object( ob[ selnumb ], 1 ); if ( selobj[ selnumb ]->objclass != FL_BEGIN_GROUP && selobj[ selnumb ]->objclass != FL_END_GROUP ) fl_add_object( cur_form, obj ); selobj[ selnumb ] = obj; } redraw_the_form( 0 ); } /*************************************** ***************************************/ void next_selection( void ) { if ( ! cur_form || ! BackOBJ( ) ) return; do { if ( ! selnumb || ! selobj[ 0 ]->next ) selobj[ 0 ] = BackOBJ( )->next ? BackOBJ( )->next : BackOBJ( ); else if ( selnumb && selobj[ 0 ]->next ) selobj[ 0 ] = selobj[ 0 ]->next; selnumb = 1; } while ( selobj[ 0 ]->parent || selobj[ 0 ]->objclass == FL_BEGIN_GROUP || selobj[ 0 ]->objclass == FL_END_GROUP ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void prev_selection( void ) { if ( ! cur_form || ! BackOBJ( ) ) return; do { if ( ! selnumb || ! selobj[ 0 ]->prev ) selobj[ 0 ] = BackOBJ( )->prev ? BackOBJ( )->prev : BackOBJ( ); else if ( selnumb && selobj[ 0 ]->prev ) selobj[ 0 ] = selobj[ 0 ]->prev; } while ( selobj[ 0 ]->parent ); selnumb = 1; redraw_the_form( 0 ); } /*************************************** * Groups all elements in the selection into a group ***************************************/ void group_selection( void ) { int i; FL_OBJECT *obj; const char *s; if ( backf ) return; /* Cannot group the backface */ if ( ! cur_form || selnumb == 0 ) return; get_new_group_name: if ( ! ( s = fl_show_input( "Group name (must be usable as " "a C variable or empty):", "" ) ) ) return; if ( *s && ! is_valid_c_name( s ) ) { fl_show_alert( "Error", "Invalid C identifier for group " "name:", s, 0 ); goto get_new_group_name; } obj = add_an_object( FL_BEGIN_GROUP, -1, 0, 0, 0, 0 ); for ( i = 0; i < selnumb; i++ ) { if ( selobj[ i ]->form ) fl_delete_object( selobj[ i ] ); if ( selobj[ i ]->objclass != FL_BEGIN_GROUP && selobj[ i ]->objclass != FL_END_GROUP ) fl_add_object( cur_form, selobj[ i ] ); } add_an_object( FL_END_GROUP, -1, 0, 0, 0, 0 ); clear_selection( ); set_object_name( obj, s, "", "" ); addgroupto_selection( obj ); changed = 1; } /*************************************** * Removes begin and endgroups from the selection ***************************************/ void flatten_selection( void ) { int i, j; /* Cannot flatten the backface */ if ( backf ) return; if ( ! cur_form ) return; for ( i = 0; i < selnumb; i++ ) { /* Bothig to be done for selected object that aren't part of a group */ if ( selobj[ i ]->objclass != FL_BEGIN_GROUP ) continue; /* Unset the group ID of all the objects that rae part of the group (unless. of course, the object for the start and the end of the group. that will keep them from getting deleted when the object for the start of thegroup is deleted. */ for ( j = i + 1; j < selnumb; j++ ) if ( selobj[ j ]->objclass == FL_END_GROUP ) break; else selobj[ j ]->group_id = 0; /* Delete the obkect for the start of the group - this will also delete the object for teh end of the group (but ot the actual members of the group since we just reset theirgroup ID) */ fl_delete_object( selobj[ i ] ); /* Mark start and end object in the list of selected objects as deleted */ selobj[ i ] = NULL; if ( j < selnumb ) selobj[ j ] = NULL; /* Look for more grouped objects in the list of selected objects */ i = j; } cleanup_selection( ); changed = 1; } /*************************************** * Makes a copy of the object. Only if 'exact' is set * the objects name is copied. ***************************************/ static FL_OBJECT * copy_object( FL_OBJECT * obj, int exact ) { char name[ MAX_VAR_LEN ], cbname[ MAX_VAR_LEN ], argname[ MAX_VAR_LEN ]; FL_OBJECT *obj2; char *label; char *s; obj2 = add_an_object( obj->objclass, obj->type, obj->x, obj->y, obj->w, obj->h ); get_object_name( obj, name, cbname, argname ); set_object_name( obj2, exact ? name : "", cbname, argname ); set_attribs( obj2, obj ); s = label = fl_strdup( obj->label ); while ( ( s = strchr( s, '\010' ) ) ) memmove( s, s + 1, strlen( s ) + 1 ); fl_set_object_label( obj2, label ); fl_free( label ); /* Also copy the object specific info */ copy_superspec( obj2, obj ); superspec_to_spec( obj2 ); copy_iconinfo( obj2, obj ); restore_spec( obj2 ); fl_delete_object( obj2 ); return obj2; } /*************************************** * Sets the attributes of an object ***************************************/ static void set_attribs( FL_OBJECT * obj, FL_OBJECT * src ) { obj->boxtype = src->boxtype; obj->col1 = src->col1; obj->col2 = src->col2; obj->lcol = src->lcol; obj->lsize = src->lsize; obj->lstyle = src->lstyle; if ( obj->objclass == FL_SLIDER && ! ( obj->type & FL_VERT_PROGRESS_BAR ) ) { obj->align = fl_to_outside_lalign( obj->align ); if ( fl_is_center_lalign( obj->align ) ) obj->align = FL_SLIDER_ALIGN; } else obj->align = src->align; obj->nwgravity = src->nwgravity; obj->segravity = src->segravity; obj->resize = src->resize; obj->how_return = src->how_return; fli_handle_object( obj, FL_ATTRIB, 0, 0, 0, NULL, 0 ); /* Some extra adjustments for spinner objects (this is a hack but avoiding it would require a complete change of how fdesign works) */ if ( obj->objclass == FL_SPINNER ) { FL_OBJECT *subobj = fl_get_spinner_input( obj ); subobj->col1 = src->col1; subobj->col2 = src->col2; subobj->lstyle = src->lstyle; subobj->lsize = src->lsize; fli_handle_object( subobj, FL_ATTRIB, 0, 0, 0, NULL, 0 ); } } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_spinner.c0000664000175000017500000002375012253056201013725 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "fd_main.h" #include "fd_spec.h" #include "sp_spinner.h" #include "private/pspinner.h" #include "spec/spinner_spec.h" static FD_spinnerattrib * spn_attrib; FL_OBJECT *curobj; /*************************************** ***************************************/ void spinner_change_type( FL_OBJECT * obj, int new_type ) { FLI_SPINNER_SPEC *sp = obj->spec; if ( obj->type == FL_INT_SPINNER ) { sp->f_min = sp->i_min; sp->f_max = sp->i_max; sp->f_val = sp->i_val; sp->f_incr = sp->i_incr; } else { sp->i_min = sp->f_min; sp->i_max = sp->f_max; sp->i_val = sp->f_val; sp->i_incr = sp->f_incr; } obj->type = new_type; } /*************************************** ***************************************/ FL_FORM * spinner_create_spec_form( void ) { if ( spn_attrib ) return spn_attrib->spinnerattrib; spn_attrib = create_form_spinnerattrib( ); setup_how_return_menu( spn_attrib->returnsetting ); fl_set_menu_item_mode( spn_attrib->returnsetting, 5, FL_PUP_BOX | FL_PUP_GRAY ); fl_set_menu_item_mode( spn_attrib->returnsetting, 6, FL_PUP_BOX | FL_PUP_GRAY ); return spn_attrib->spinnerattrib; } /*************************************** ***************************************/ void spinner_adjust_spec_form( FL_OBJECT * obj ) { curobj = obj; if ( obj->type == FL_INT_SPINNER ) { fl_hide_object( spn_attrib->prec ); } else { fl_set_counter_step( spn_attrib->prec, 1, 2 ); fl_set_counter_bounds( spn_attrib->prec, 0, DBL_DIG ); fl_set_counter_precision( spn_attrib->prec, 0 ); fl_show_object( spn_attrib->prec ); } fl_set_object_return( spn_attrib->minval, FL_RETURN_END ); fl_set_object_return( spn_attrib->maxval, FL_RETURN_END ); fl_set_object_return( spn_attrib->initialval, FL_RETURN_END ); fl_set_object_return( spn_attrib->step, FL_RETURN_END ); } /*************************************** ***************************************/ void spinner_fill_in_spec_form( FL_OBJECT * obj ) { FLI_SPINNER_SPEC *sp = obj->spec; fl_set_counter_value( spn_attrib->prec, sp->prec ); if ( obj->type == FL_INT_SPINNER ) { set_finput_value( spn_attrib->minval, sp->i_min, 0 ); set_finput_value( spn_attrib->maxval, sp->i_max, 0 ); set_finput_value( spn_attrib->initialval, sp->i_val, 0 ); set_finput_value( spn_attrib->step, sp->i_incr, 0 ); } else { set_finput_value( spn_attrib->minval, sp->f_min, sp->prec ); set_finput_value( spn_attrib->maxval, sp->f_max, sp->prec ); set_finput_value( spn_attrib->initialval, sp->f_val, sp->prec ); set_finput_value( spn_attrib->step, sp->f_incr, sp->prec ); } reset_how_return_menu( spn_attrib->returnsetting, obj->how_return ); } /*************************************** ***************************************/ void spinner_reread_spec_form( FL_OBJECT * obj ) { double r1, r2; if ( get_checked_float( fl_get_input( spn_attrib->minval ), &r1 ) && get_checked_float( fl_get_input( spn_attrib->maxval ), &r2 ) ) fl_set_spinner_bounds( obj, r1, r2 ); if ( get_checked_float( fl_get_input( spn_attrib->initialval ), &r1 ) ) fl_set_spinner_value( obj, r1 ); if ( get_checked_float( fl_get_input( spn_attrib->step ), &r1 ) ) fl_set_spinner_step( obj, r1 ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void spinner_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = fl_create_spinner( obj->type, 0, 0, 0, 0, "" ); FLI_SPINNER_SPEC *sp = obj->spec, *defsp = defobj->spec; if ( obj->type == FL_FLOAT_SPINNER && sp->prec != defsp->prec ) fprintf( fp, " precision: %d\n", sp->prec ); if ( obj->type == FL_INT_SPINNER ) { if ( sp->i_min != defsp->i_min || sp->i_max != defsp->i_max ) fprintf( fp, " bounds: %d %d\n", sp->i_min, sp->i_max ); if ( sp->i_val != defsp->i_val ) fprintf( fp, " value: %d\n", sp->i_val ); if ( sp->i_incr != defsp->i_incr ) fprintf( fp, " step: %d\n", sp->i_incr ); } else { if ( sp->f_min != defsp->f_min || sp->f_max != defsp->f_max ) fprintf( fp, " bounds: %.*fd %.*f\n", sp->prec, sp->f_min, sp->prec, sp->f_max ); if ( sp->f_val != defsp->f_val ) fprintf( fp, " value: %.*f\n", sp->prec, sp->f_val ); if ( sp->f_incr != defsp->f_incr ) fprintf( fp, " step: %.*f\n", sp->prec, sp->f_incr ); } fl_free_object( defobj ); } /*************************************** ***************************************/ void spinner_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = fl_create_spinner( obj->type, 0, 0, 0, 0, "" ); FLI_SPINNER_SPEC *sp = obj->spec, *defsp = defobj->spec; if ( obj->type == FL_FLOAT_SPINNER && sp->prec != defsp->prec ) fprintf( fp, " fl_set_spinner_precision( obj, %d );\n", sp->prec ); if ( obj->type == FL_INT_SPINNER ) { if ( sp->i_min != defsp->i_min || sp->i_max != defsp->i_max ) fprintf( fp, " fl_set_spinner_bounds( obj, %d, %d );\n", sp->i_min, sp->i_max ); if ( sp->i_val != defsp->i_val ) fprintf( fp, " fl_set_spinner_value( obj, %d );\n", sp->i_val ); if ( sp->i_incr != defsp->i_incr ) fprintf( fp, " fl_set_spinner_step( obj, %d );\n", sp->i_incr ); } else { if ( sp->f_min != defsp->f_min || sp->f_max != defsp->f_max ) fprintf( fp, " fl_set_spinner_bounds( obj, %.*f, %.*f );\n", sp->prec, sp->f_min, sp->prec, sp->f_max ); if ( sp->f_val != defsp->f_val ) fprintf( fp, " fl_set_spinner_value( obj, %.*f );\n", sp->prec, sp->f_val ); if ( sp->f_incr != defsp->f_incr ) fprintf( fp, " fl_set_spinner_step( obj, %.*f );\n", sp->prec, sp->f_incr ); } if ( obj->lsize != defobj->lsize ) fprintf( fp, " fl_set_object_lsize( fl_get_spinner_input( obj ), " "%s );\n", lsize_name( obj->lsize ) ); if ( obj->lstyle != defobj->lstyle ) fprintf( fp, " fl_set_object_lstyle( fl_get_spinner_input( obj ), " "%s );\n", style_name( obj->lstyle ) ); if ( obj->col1 != defobj->col1 || obj->col2 != defobj->col2 ) fprintf( fp, " fl_set_object_color( fl_get_spinner_input( obj ), " "%s, %s );\n", fli_query_colorname( obj->col1 ), fli_query_colorname( obj->col2 ) ); fl_free_object( defobj ); } /*************************************** ***************************************/ void spn_precision_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { fl_set_spinner_precision( curobj, fl_get_counter_value( obj ) ); spn_minmax_change( NULL, 0 ); spn_stepchange_cb( NULL, 0 ); spn_initialvalue_change( NULL, 0 ); } /*************************************** ***************************************/ void spn_minmax_change( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { FLI_SPINNER_SPEC *sp = curobj->spec; set_finput_value( spn_attrib->minval, get_finput_value( spn_attrib->minval ), curobj->type == FL_INT_SPINNER ? 0 : sp->prec ); set_finput_value( spn_attrib->maxval, get_finput_value( spn_attrib->maxval ), curobj->type == FL_INT_SPINNER ? 0 : sp->prec ); fl_set_spinner_bounds( curobj, get_finput_value( spn_attrib->minval ), get_finput_value( spn_attrib->maxval ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void spn_stepchange_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { FLI_SPINNER_SPEC *sp = curobj->spec; set_finput_value( obj, get_finput_value( obj ), curobj->type == FL_INT_SPINNER ? 0 : sp->prec ); fl_set_spinner_step( curobj, get_finput_value( obj ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void spn_initialvalue_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { FLI_SPINNER_SPEC *sp = curobj->spec; set_finput_value( obj, get_finput_value( obj ), curobj->type == FL_INT_SPINNER ? 0 : sp->prec ); fl_set_spinner_value( curobj, get_finput_value( obj ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void spn_returnsetting_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { handle_how_return_changes( obj, curobj ); } #include "spec/spinner_spec.c" /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fd_util.c0000664000175000017500000001240712353623325013200 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fd_util.c * * Eliminate the emission of duplicate info. This is necessary as * some #include define data (pixmap for example). * * We should eventually move the functionality of already_emited in * fd_printC.c into this function so callback is also checked. This * probably means we need make struct CodeInfo more efficient. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "fd_main.h" static char ** dup_info_cache = NULL; static size_t n_dup_info = 0; /*************************************** ***************************************/ unsigned int check_resize( unsigned int what, int nw, int se ) { if ( what & FL_RESIZE_X && ( nw == FL_NorthWest || nw == FL_West || nw == FL_SouthWest ) && ( se == FL_NorthWest || se == FL_West || se == FL_SouthWest ) ) what &= ~ FL_RESIZE_X; else if ( ! ( what & FL_RESIZE_X ) && ( nw == FL_NorthWest || nw == FL_West || nw == FL_SouthWest ) && ( se == FL_NorthEast || se == FL_East || se == FL_SouthEast ) ) what |= ~ FL_RESIZE_X; if ( what & FL_RESIZE_Y && ( nw == FL_NorthWest || nw == FL_North || nw == FL_NorthEast ) && ( se == FL_NorthWest || se == FL_North || se == FL_NorthEast ) ) what &= ~ FL_RESIZE_Y; else if ( ! ( what & FL_RESIZE_Y ) && ( nw == FL_NorthWest || nw == FL_North || nw == FL_NorthEast ) && ( se == FL_SouthWest || se == FL_South || se == FL_SouthEast ) ) what |= ~ FL_RESIZE_Y; return what; } /*************************************** ***************************************/ void reset_dupinfo_cache( void ) { size_t i; for ( i = 0; i < n_dup_info; i++ ) fl_free( dup_info_cache[ i ] ); fli_safe_free( dup_info_cache ); n_dup_info = 0; } /*************************************** ***************************************/ int is_duplicate_info( const char * s ) { size_t i; for ( i = 0; i < n_dup_info; i++ ) if ( ! strcmp( s, dup_info_cache[ i ] ) ) return 1; if ( ! ( ( dup_info_cache = fl_realloc( dup_info_cache, ++n_dup_info * sizeof dup_info_cache ) ) && ( dup_info_cache[ n_dup_info - 1 ] = fl_strdup( s ) ) ) ) { fprintf( stderr, "Running oit of memory\n" ); exit( 1 ); } return 0; } /*************************************** * Returns a newly allocated string with the aboslute path * for the input path ***************************************/ char * rel2abs( const char * rel_path ) { char * abs_path = NULL; char *res; if ( *rel_path == '/' ) abs_path = fl_strdup( rel_path ); else { long path_max = pathconf( ".", _PC_PATH_MAX ); size_t size; if ( path_max == -1 ) size = 1024; else size = path_max; while ( 1 ) { abs_path = fl_realloc( abs_path, size + strlen( rel_path ) + 2 ); if ( ! getcwd( abs_path, size ) ) size += 1024; else break; } strcat( strcat( abs_path, "/" ), rel_path ); } while ( ( res = strstr( abs_path, "/./" ) ) ) memmove( res, res + 2, strlen( res ) - 1 ); while ( ( res = strstr( abs_path, "/../" ) ) ) { if ( res != abs_path ) { char * dest = res - 1; while ( *dest != '/' ) dest--; memmove( dest, res + 3, strlen( res ) - 2 ); } else memmove( abs_path, abs_path + 3, strlen( abs_path ) - 2 ); } return fl_realloc( abs_path, strlen( abs_path ) + 1 ); } /*************************************** * Returns if a string can be used as a valid C identifier ***************************************/ int is_valid_c_name( const char * str ) { const char * sp; if ( fdopt.lax ) return 1; if ( ! isascii( ( unsigned char ) *str ) || ! ( isalpha( ( unsigned char ) *str ) || *str == '_' ) ) return 0; for ( sp = str + 1; *sp; sp++ ) if ( ! isascii( ( unsigned char ) *sp ) || ! ( isalnum( ( unsigned char ) *sp ) || *sp == '_' ) ) return 0; return 1; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_choice.h0000664000175000017500000000225312244217405013506 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifndef SP_CHOICE_H_ #define SP_CHOICE_H_ void choice_change_type( FL_OBJECT * obj, int new_type ); FL_FORM * choice_create_spec_form( void ); void choice_fill_in_spec_form( FL_OBJECT * obj ); void choice_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ); void choice_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ); #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fd_iconinfo.h0000664000175000017500000000265112246655636014047 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #if ! defined FD_ICONINFO_H #define FD_ICONINFO_H typedef struct { int align; int dx, dy; int show_focus; char filename[ 2048 ]; char focus_filename[ 2048 ]; char data[ MAX_VAR_LEN ]; char focus_data[ MAX_VAR_LEN ]; char width[ MAX_VAR_LEN ]; char height[ MAX_VAR_LEN ]; int use_data; int fullpath; } IconInfo; IconInfo * get_iconinfo( FL_OBJECT * obj ); void copy_iconinfo( FL_OBJECT * target, FL_OBJECT * src ); void free_iconinfo( FL_OBJECT * obj ); void get_xbm_stuff( IconInfo * info, FILE * fp ); void get_xpm_stuff( char * in, FILE * fp ); #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_slider.c0000664000175000017500000002124712253056170013535 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file sp_slider.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Settting slider class specific attributes. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "fd_main.h" #include "fd_spec.h" #include "sp_slider.h" #include "spec/slider_spec.h" #include "private/pslider.h" static FD_sliderattrib * sl_attrib; static FL_OBJECT * curobj; /*************************************** ***************************************/ FL_FORM * slider_create_spec_form( void ) { if ( sl_attrib ) return sl_attrib->sliderattrib; sl_attrib = create_form_sliderattrib( ); setup_how_return_menu( sl_attrib->returnsetting ); fl_set_menu_item_mode( sl_attrib->returnsetting, 5, FL_PUP_BOX | FL_PUP_GRAY ); fl_set_menu_item_mode( sl_attrib->returnsetting, 6, FL_PUP_BOX | FL_PUP_GRAY ); fl_set_counter_step( sl_attrib->prec, 1, 2 ); fl_set_counter_precision( sl_attrib->prec, 0 ); fl_set_counter_bounds( sl_attrib->prec, 0, FL_SLIDER_MAX_PREC ); return sl_attrib->sliderattrib; } /*************************************** ***************************************/ void slider_adjust_spec_form( FL_OBJECT * obj ) { curobj = obj; if ( obj->objclass == FL_VALSLIDER ) fl_show_object( sl_attrib->prec ); else fl_hide_object( sl_attrib->prec ); if ( obj->type & FL_HOR_FLAG ) { fl_set_object_label( sl_attrib->minval, "Value at left" ); fl_set_object_label( sl_attrib->maxval, "Value at right" ); } else { fl_set_object_label( sl_attrib->minval, "Value at top" ); fl_set_object_label( sl_attrib->maxval, "Value at bottom" ); } } /*************************************** ***************************************/ void slider_fill_in_spec_form( FL_OBJECT * obj ) { FLI_SLIDER_SPEC *sp = obj->spec; set_finput_value( sl_attrib->minval, sp->min, sp->prec ); set_finput_value( sl_attrib->maxval, sp->max, sp->prec ); set_finput_value( sl_attrib->initial_val, sp->val, sp->prec ); set_finput_value( sl_attrib->slsize, sp->slsize, 2 ); set_finput_value( sl_attrib->step, sp->step, 3 ); set_finput_value( sl_attrib->ldelta, sp->ldelta, -1 ); set_finput_value( sl_attrib->rdelta, sp->rdelta, -1 ); fl_set_counter_value( sl_attrib->prec, sp->prec ); reset_how_return_menu( sl_attrib->returnsetting, curobj->how_return ); } /*************************************** ***************************************/ void slider_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = ( obj->objclass == FL_SLIDER ? fl_create_slider : fl_create_valslider ) ( obj->type, 0, 0, 0, 0, "" ); FLI_SLIDER_SPEC *sp = obj->spec, *defsp = defobj->spec; if ( sp->min != defsp->min || sp->max != defsp->max ) fprintf( fp, " bounds: %g %g\n", sp->min, sp->max ); if ( sp->prec != defsp->prec ) fprintf( fp, " precision: %d\n", sp->prec ); if ( sp->val != defsp->val ) fprintf( fp, " value: %g\n", sp->val ); if ( sp->ldelta != defsp->ldelta || sp->rdelta != defsp->rdelta ) fprintf( fp, " increment: %g %g\n", sp->ldelta, sp->rdelta ); if ( sp->slsize != defsp->slsize ) fprintf( fp, " slsize: %.2f\n", sp->slsize ); if ( sp->step != defsp->step ) fprintf( fp, " step: %g\n", sp->step ); fl_free_object( defobj ); } /*************************************** ***************************************/ void slider_reread_spec_form( FL_OBJECT * obj ) { double r1, r2; if ( get_checked_float( fl_get_input( sl_attrib->minval ), &r1 ) && get_checked_float( fl_get_input( sl_attrib->maxval ), &r2 ) ) fl_set_slider_bounds( obj, r1, r2 ); if ( get_checked_float( fl_get_input( sl_attrib->initial_val ), &r1 ) ) fl_set_slider_value( obj, r1 ); if ( get_checked_float( fl_get_input( sl_attrib->step ), &r1 ) ) fl_set_slider_step( obj, r1 ); if ( get_checked_float( fl_get_input( sl_attrib->slsize ), &r1 ) ) fl_set_slider_size( obj, r1 ); if ( get_checked_float( fl_get_input( sl_attrib->ldelta ), &r1 ) && get_checked_float( fl_get_input( sl_attrib->ldelta ), &r2 ) ) fl_set_slider_increment( obj, r1, r2 ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void slider_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = ( obj->objclass == FL_SLIDER ? fl_create_slider : fl_create_valslider ) ( obj->type, 0, 0, 0, 0, "" ); FLI_SLIDER_SPEC *sp = obj->spec, *defsp = defobj->spec; if ( sp->prec != defsp->prec ) fprintf( fp, " fl_set_slider_precision( obj, %d );\n", sp->prec ); if ( sp->min != defsp->min || sp->max != defsp->max ) fprintf( fp, " fl_set_slider_bounds( obj, %g, %g );\n", sp->min, sp->max ); if ( sp->val != defsp->val ) fprintf( fp, " fl_set_slider_value( obj, %g );\n", sp->val ); if ( sp->slsize != defsp->slsize ) fprintf( fp, " fl_set_slider_size( obj, %.2f );\n", sp->slsize ); if ( sp->step != defsp->step ) fprintf( fp, " fl_set_slider_step( obj, %g );\n", sp->step ); if ( sp->ldelta != defsp->ldelta || sp->rdelta != defsp->rdelta ) fprintf( fp, " fl_set_slider_increment( obj, %g, %g );\n", sp->ldelta, sp->rdelta ); fl_free_object( defobj ); } /*************************************** ***************************************/ void adjust_precision( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_set_slider_precision( curobj, fl_get_counter_value( ob ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void minmax_change( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_set_slider_bounds( curobj, get_finput_value( sl_attrib->minval ), get_finput_value( sl_attrib->maxval ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void slsize_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { fl_set_slider_size( curobj, get_finput_value( obj ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void step_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { FLI_SLIDER_SPEC *sp = curobj->spec; set_finput_value( obj, get_finput_value( obj ), sp->prec ); fl_set_slider_step( curobj, get_finput_value( obj ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void increment_change( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_set_slider_increment( curobj, get_finput_value( sl_attrib->ldelta ), get_finput_value( sl_attrib->rdelta ) ); } /*************************************** ***************************************/ void initialvalue_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { FLI_SLIDER_SPEC *sp = curobj->spec; set_finput_value( obj, get_finput_value( obj ), sp->prec ); fl_set_slider_value( curobj, get_finput_value( obj ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void returnsetting_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { handle_how_return_changes( obj, curobj ); } #include "spec/slider_spec.c" /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fd_file_fun.c0000664000175000017500000006127412346313251014014 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "fd_main.h" #include #include #include #include #include #include static struct { FILE * fp; char * fname; size_t line_no; char * line; char * pos; int merge; } ff = { NULL, NULL, 0, NULL, NULL, 0 }; /*************************************** * Returns a pointer to the first position in a string * that's not a white-space character ***************************************/ static char * ff_skip_spaces( const char * cp ) { while ( *cp && isspace( ( unsigned char ) *cp ) ) cp++; return ( char * ) cp; } /*************************************** ***************************************/ char * ff_get_filename_copy( void ) { if ( ! ff.fname || ! ff.fp ) return NULL; return fl_strdup( ff.fname ); } /*************************************** ***************************************/ static int ff_is_comment( void ) { ff.pos = ff_skip_spaces( ff.pos ); return ! *ff.pos || *ff.pos == ';' || *ff.pos == '#' || *ff.pos == '-' || *ff.pos == '='; } /*************************************** ***************************************/ void ff_close( void ) { if ( ff.fp ) { fclose( ff.fp ); ff.fp = NULL; } fli_safe_free( ff.fname ); fli_safe_free( ff.line ); ff.pos = NULL; ff.line_no = 0; ff.merge = 0; } /*************************************** ***************************************/ int ff_err( const char * message ) { if ( message ) { if ( ! fdopt.conv_only ) fl_show_alert_f( 0, "Error:\f%s\n%s:%lu.%lu", message, ff.fname, ( unsigned long ) ff.line_no, ff.line ? ( unsigned long ) ( ff.pos - ff.line ) : 0 ); else M_err( "Error", "%s at %s:%lu.%lu", message, ff.fname, ( unsigned long ) ff.line_no, ff.line ? ( unsigned long ) ( ff.pos - ff.line ) : 0 ); } ff_close( ); return FF_READ_FAILURE; } /*************************************** ***************************************/ static int ff_get_line( void ) { if ( ff.fp ) do { fli_safe_free( ff.line ); if ( ! ( ff.line = fli_read_line( ff.fp ) ) ) { if ( feof( ff.fp ) ) { ff.line_no++; return 0; } return ff_err( "Error while reading from file" ); } ff.line_no++; ff.pos = ff.line; } while ( ff_is_comment( ) ); return 0; } /*************************************** ***************************************/ int ff_get_fd_file( const char * str, int merge ) { ff_close( ); ff.merge = merge; fl_use_fselector( LOAD_FSELECTOR ); /* Get the filename if necessary */ if ( ! str || ! *str ) { str = fl_show_fselector( merge ? "Filename to merge forms from" : "Filename to load forms from", "", "*.fd", "" ); if ( ! str || ! *str ) return -1; } /* Append ".fd" if required. */ ff.fname = append_fd_suffix( str ); /* Open the file for reading */ if ( ! ( ff.fp = fopen( ff.fname, "r" ) ) ) { if ( ! fdopt.conv_only ) fl_show_alert( "Can't open file for reading", ff.fname, "", 0 ); else M_err( "ff_get_fd_file", "Can't open '%s' for reading", ff.fname ); ff_close( ); return -1; } if ( ff_get_line( ) < 0 ) { if ( ! fdopt.conv_only ) fl_show_alert( "Nothing to be read from", ff.fname, "", 0 ); else M_err( "ff_get_fd_file", "Nothing to be read from '%s'", ff.fname ); ff_close( ); return -1; } return 0; } /*************************************** * Checks if an input text matches text read from the file * - with multiple white-spaces treated as a single space ***************************************/ static const char * ff_match_text( const char *txt ) { char *src = ff.pos; txt = ff_skip_spaces( txt ); while ( *src && *txt ) { if ( *src != *txt && ! ( isspace( ( unsigned char ) *src ) && isspace( ( unsigned char ) *txt ) ) ) return NULL; if ( isspace( ( unsigned char ) *src ) ) { src = ff_skip_spaces( src ); txt = ff_skip_spaces( txt ); } else { src++; txt++; } } txt = ff_skip_spaces( txt ); if ( *txt ) return NULL; ff.pos = src; return txt; } /*************************************** ***************************************/ static int ff_match_long( long * p ) { long val; char *ep; val = strtol( ff.pos, &ep, 10 ); if ( ep == ff.pos ) return -1; if ( *ep != '\0' && ! isspace( ( unsigned char ) *ep ) ) return -1; if ( ( val == LONG_MAX || val == LONG_MIN ) && errno == ERANGE ) return -1; ff.pos = ep; *p = val; return 0; } /*************************************** ***************************************/ static int ff_match_ulong( unsigned long * p ) { unsigned long val; char *ep; if ( *ff.pos == '-' ) return -1; val = strtoul( ff.pos, &ep, 10 ); if ( ep == ff.pos || ( *ep != '\0' && ! isspace( ( unsigned char ) *ep ) ) || ( val == ULONG_MAX && errno == ERANGE ) ) return -1; ff.pos = ep; *p = val; return 0; } /*************************************** ***************************************/ static int ff_match_int( int * p ) { long val; char *old_pos = ff.pos; if ( ff_match_long( &val ) < 0 ) return -1; if ( ( val > INT_MAX || val < INT_MIN ) ) { ff.pos = old_pos; return -1; } *p = val; return 0; } /*************************************** ***************************************/ static int ff_match_uint( unsigned int * p ) { unsigned long val; char *old_pos = ff.pos; if ( ff_match_ulong( &val ) < 0 ) return -1; if ( val > UINT_MAX ) { ff.pos = old_pos; return -1; } *p = val; return 0; } /*************************************** ***************************************/ static int ff_match_double( double * p ) { double val; char *ep; val = strtod( ff.pos, &ep ); if ( ep == ff.pos || ( *ep != '\0' && ! isspace( ( unsigned char ) *ep ) ) || ( ( val == HUGE_VAL || val == - HUGE_VAL ) && errno == ERANGE ) ) return -1; ff.pos = ep; *p = val; return 0; } /*************************************** ***************************************/ static int ff_match_float( float * p ) { double val; char *old_pos = ff.pos; if ( ff_match_double( &val ) < 0 || val < - FLT_MAX || val > FLT_MAX) { ff.pos = old_pos; return -1; } *p = val; return 0; } /*************************************** ***************************************/ static int ff_match_coord( FL_Coord * p, int need_positive ) { int val; char *old_pos = ff.pos; if ( ff_match_int( &val ) < 0 || ( need_positive && val < 0 ) ) { ff.pos = old_pos; return -1; } *p = val; return 0; } /*************************************** ***************************************/ static int ff_match_string( char ** p ) { /* Backtrack to start of line or last ':' */ while ( ff.pos > ff.line && isspace( ( unsigned char ) *--ff.pos ) ) /* empty */ ; /* If we're at a ':' skip the next space if if exists */ if ( ff.pos > ff.line && *ff.pos == ':' && isspace( ( unsigned char ) *++ff.pos ) ) ff.pos++; *p = ff.pos + strlen( ff.pos ) - 1; if ( **p == '\n' ) **p = '\0'; *p = fl_strdup( ff.pos ); while ( *ff.pos ) ff.pos++; return 0; } /*************************************** ***************************************/ static int ff_match_trimmed_string( char ** p ) { char *ep = ff.pos + strlen( ff.pos ) - 1, *fp = ep + 1; char old_c; if ( ! *ff.pos ) { *p = fl_strdup( ff.pos ); return 0; } *p = NULL; while ( ep > ff.pos && isspace( ( unsigned char ) *ep ) ) ep--; old_c = *ep; *++ep = '\0'; *p = fl_strdup( ff.pos ); *ep = old_c; ff.pos = fp; return 0; } /*************************************** ***************************************/ static int ff_match_spaceless_string( char ** p ) { char *ep = ff.pos; while ( *ep && ! isspace( ( unsigned char ) *ep ) ) ep++; if ( ep == ff.pos ) *p = fl_strdup( "" ); else if ( ( *p = fl_malloc( ep - ff.pos + 2 ) ) ) { fli_sstrcpy( *p, ff.pos, ep - ff.pos + 1 ); ff.pos = ep; } return p ? 0 : -1; } /*************************************** ***************************************/ static int ff_match_var( char ** p ) { char *ep = ff.pos; char old_c; if ( ! *ep ) { *p = fl_strdup( ff.pos ); return -1; } *p = NULL; if ( ! isascii( ( unsigned char ) *ep ) || ! ( isalpha( ( unsigned char ) *ep ) || *ep == '_' ) ) { *p = fl_strdup( "" ); return -1; } while ( *++ep && isascii( ( unsigned char ) *ep ) && ( isalnum( ( unsigned char ) *ep ) || *ep == '_' ) ) /* empty */ ; if ( *ep && ! isspace( ( unsigned char ) *ep ) ) { *p = fl_strdup( "" ); return -1; } /* Currently variable, function etc. names can't be longer... */ if ( ep - ff.pos >= MAX_VAR_LEN ) { *p = fl_strdup( "" ); return -1; } old_c = *ep; *ep = '\0'; *p = fl_strdup( ff.pos ); *ep = old_c; ff.pos = ep + 1; return 0; } /*************************************** ***************************************/ static int ff_match_objclass( int * p ) { char *class_name; int class; char * old_pos = ff.pos; if ( ff_match_spaceless_string( &class_name ) < 0 ) return -1; if ( ! *class_name || ( class = class_val( class_name ) ) == -1 ) { ff.pos = old_pos; fl_free( class_name ); return -1; } *p = class; fl_free( class_name ); return 0; } /*************************************** ***************************************/ static int ff_match_boxtype( int * p ) { char *boxtype_name; char *old_pos = ff.pos; int boxtype; if ( ff_match_spaceless_string( &boxtype_name ) < 0 ) return -1; if ( ! *boxtype_name || ( boxtype = boxtype_val( boxtype_name ) ) == -1 ) { ff.pos = old_pos; fl_free( boxtype_name ); return -1; } *p = boxtype; fl_free( boxtype_name ); return 0; } /*************************************** ***************************************/ static int ff_match_color( FL_COLOR * p ) { char *color_name; char *old_pos = ff.pos; FL_COLOR color; if ( ff_match_spaceless_string( &color_name ) < 0 ) return -1; if ( ! *color_name || ( ( color = fli_query_namedcolor( color_name ) ) > FL_MAX_COLORS && color != FL_NoColor ) ) { ff.pos = old_pos; fl_free( color_name ); return -1; } *p = color; if ( *p == 0x8fffffff ) *p = FL_NoColor; fl_free( color_name ); return 0; } /*************************************** * align may consist of two values, separated by a '|' or '+' ***************************************/ static int ff_match_align( int * p ) { char *align_name; char *old_pos = ff.pos; char *sp = strchr( ff.pos, '|' ); int align; if ( ! sp ) sp = strchr( ff.pos, '+' ); if ( ! sp || ( sp > ff.pos && ! isspace( ( unsigned char ) sp[ -1 ] ) && ! isspace( ( unsigned char ) sp[ 1 ] ) ) ) { if ( ff_match_spaceless_string( &align_name ) < 0 ) return -1; } else { char *a1, *a2, o = *sp; *sp = '\0'; if ( ff_match_spaceless_string( &a1 ) < 0 || ! *a1 ) { fl_free( a1 ); ff.pos = old_pos; *sp = o; return -1; } *sp = o; ff.pos = sp + 1; ff.pos = ff_skip_spaces( ff.pos ); if ( ff_match_spaceless_string( &a2 ) < 0 || ! *a2 ) { fl_free( a1 ); fl_free( a2 ); ff.pos = old_pos; return -1; } align_name = fl_malloc( strlen( a1 ) + strlen( a2 ) + 2 ); if ( align_name ) sprintf( align_name, "%s|%s", a1, a2 ); fl_free( a1 ); fl_free( a2 ); } if ( ! align_name || ! *align_name || ( align = align_val( align_name ) ) == -1 ) { ff.pos = old_pos; fl_free( align_name ); return -1; } *p = align; fl_free( align_name ); return 0; } /*************************************** * lstyle may consist of two values, separated by '|' or '+' ***************************************/ static int ff_match_lstyle( int * p ) { char *lstyle_name = NULL; int lstyle; char *old_pos = ff.pos; char *sp = strchr( ff.pos, '|' ); if ( ! sp ) sp = strchr( ff.pos, '+' ); if ( ! sp || ( sp > ff.pos && ! isspace( ( unsigned char ) sp[ -1 ] ) && ! isspace( ( unsigned char ) sp[ 1 ] ) ) ) { if ( ff_match_spaceless_string( &lstyle_name ) < 0 ) return -1; } else { char *l1, *l2, *old_pos = ff.pos, o = *sp; *sp = '\0'; if ( ff_match_spaceless_string( &l1 ) < 0 ) { fl_free( l1 ); *sp = o; return -1; } *sp = o; ff.pos = sp + 1; ff.pos = ff_skip_spaces( ff.pos ); if ( ff_match_spaceless_string( &l2 ) < 0 || ! *l2 ) { ff.pos = old_pos; fl_free( l1 ); fl_free( l2 ); return -1; } lstyle_name = fl_malloc( strlen( l1 ) + strlen( l2 ) + 2 ); if ( lstyle_name ) sprintf( lstyle_name, "%s|%s", l1, l2 ); fl_free( l1 ); fl_free( l2 ); } if ( ! lstyle_name || ! *lstyle_name || ( lstyle = style_val( lstyle_name ) ) == -1 ) { ff.pos = old_pos; fl_free( lstyle_name ); return -1; } *p = lstyle; fl_free( lstyle_name ); return 0; } /*************************************** ***************************************/ static int ff_match_lsize( int * p ) { char *lsize_name; char *old_pos = ff.pos; int lsize; if ( ff_match_spaceless_string( &lsize_name ) < 0 ) return -1; if ( ! *lsize_name || ( lsize = lsize_val( lsize_name ) ) == -1 ) { fl_free( lsize_name ); ff.pos = old_pos; return -1; } *p = lsize; fl_free( lsize_name ); return 0; } /*************************************** ***************************************/ static int ff_match_resize( int * p ) { char *resize_name; char *old_pos = ff.pos; int resize; if ( ff_match_spaceless_string( &resize_name ) < 0 ) return -1; if ( ! *resize_name || ( resize = resize_val( resize_name ) ) == -1 ) { fl_free( resize_name ); ff.pos = old_pos; return -1; } *p = resize; fl_free( resize_name ); return 0; } /*************************************** ***************************************/ static int ff_match_gravity( int * p ) { char *gravity_name; char *old_pos = ff.pos; int gravity; if ( ff_match_spaceless_string( &gravity_name ) < 0 ) return -1; if ( ! *gravity_name || ( gravity = gravity_val( gravity_name ) ) == -1 ) { ff.pos = old_pos; fl_free( gravity_name ); return -1; } *p = gravity; fl_free( gravity_name ); return 0; } /*************************************** ***************************************/ static int ff_match_unit( int * p ) { char *unit_name; char *old_pos = ff.pos; int unit; if ( ff_match_spaceless_string( &unit_name ) < 0 ) return -1; if ( ! *unit_name || ( unit = unit_val( unit_name ) ) == -1 ) { ff.pos = old_pos; fl_free( unit_name ); return -1; } *p = unit; fl_free( unit_name ); return 0; } /*************************************** ***************************************/ static int ff_match_key( char ** p ) { char *ep = ff.pos; char *np; char old_c; *p = NULL; while ( *ep && *ep != ':' ) ep++; if ( ! *ep ) return -1; np = ep-- + 1; while ( ep > ff.pos && isspace( ( unsigned char ) *ep ) ) ep--; if ( ep == ff.pos ) return -1; old_c = *++ep; *ep = '\0'; *p = fl_strdup( ff.pos ); *ep = old_c; ff.pos = np; return 0; } /*************************************** ***************************************/ static int ff_match_type( char ** p ) { return ff_match_var( p ); } /*************************************** * Function for reading data from .fd files in a fscanf()-like way. * * The format string may contain the following: * a) text which must match the text in the string at that position * b) %l match long (requires long *) * b) %d match int (requires int *) * c) %u match unsigned int (requires int *) * d) %D match FL_Coord (requires FL_Coord *) * e) %U match FL_Coord with positive value (requires FL_Coord *) * f) %s match string (trimmed of spaces at start and end) (requires char **) * g) %S match string (with all spaces) (requires char **) * h) %h match string, stopping at the first space (requires char **) * i) %f match single-precision floating point value (requires float *) * j) %D match double floating point value (requires double *) * k) %o match object class (requires int *) * l) %t match type (requires char **) * m) %b match boxtype (requires int *) * n) %c match color (requires FL_COLOR *) * o) %a match align (requires int *) * p) %p match lstyle (requires int *) * q) %q match lsize (requires int *) * r) %r match resize (requires int *) * s) %g match gravity (requires int *) * t) %x match unit (requires int *) * u) %v match C variable (requires char **) * v) %k match a key (word(s) with a final colon) (requires char **) * * In case a string gets returned a copy must be made before the next * call of this function. * The function returns the number of items matched or a negative * value on failure (in that case an error message is output). ***************************************/ int ff_read( const char * format, ... ) { va_list ap; char *fmt; const char *fp; int cnt = 0; char last = '\0'; if ( ! ff.line ) return -1; format = ff_skip_spaces( format ); if ( ! format || ! *format ) { M_err( "ff_read", "Invalid argument(s)" ); return FF_READ_FAILURE; } fp = fmt = fl_strdup( format ); va_start( ap, format ); while ( *fp ) { if ( *fp != '%' ) { if ( ! ( fp = ff_match_text( fp ) ) ) { va_end( ap ); return FF_READ_FAILURE; } last = '\0'; } else { int r; switch ( *++fp ) { case 'l' : /* long int */ r = ff_match_long( va_arg( ap, long * ) ); break; case 'd' : /* int */ r = ff_match_int( va_arg( ap, int * ) ); break; case 'u' : /* unsigned int */ r = ff_match_uint( va_arg( ap, unsigned int * ) ); break; case 'D' : /* FL_Coord ('U' for positive) */ case 'U' : r = ff_match_coord( va_arg( ap, FL_Coord * ), *fp == 'U' ); break; case 's' : /* trimmed string */ r = ff_match_trimmed_string( va_arg( ap, char ** ) ); break; case 'S' : /* string (with spaces) */ r = ff_match_string( va_arg( ap, char ** ) ); break; case 'h' : /* string (without embedded spaces) */ r = ff_match_spaceless_string( va_arg( ap, char ** ) ); break; case 'f' : /* float */ r = ff_match_float( va_arg( ap, float * ) ); break; case 'F' : /* double */ r = ff_match_double( va_arg( ap, double * ) ); break; case 'o' : /* object class */ r = ff_match_objclass( va_arg( ap, int * ) ); break; case 't' : /* object type */ r = ff_match_type( va_arg( ap, char ** ) ); break; case 'b' : /* box type */ r = ff_match_boxtype( va_arg( ap, int * ) ); break; case 'c' : /* color */ r = ff_match_color( va_arg( ap, FL_COLOR * ) ); break; case 'a' : /* alignment value */ r = ff_match_align( va_arg( ap, int * ) ); break; case 'p' : /* lstyle value */ r = ff_match_lstyle( va_arg( ap, int * ) ); break; case 'q' : /* lsize value */ r = ff_match_lsize( va_arg( ap, int * ) ); break; case 'r' : /* resize value */ r = ff_match_resize( va_arg( ap, int * ) ); break; case 'g' : /* gravity value */ r = ff_match_gravity( va_arg( ap, int * ) ); break; case 'x' : /* unit value */ r = ff_match_unit( va_arg( ap, int * ) ); break; case 'v' : /* C variable name */ r = ff_match_var( va_arg( ap, char ** ) ); break; case 'k' : /* key with trailing colon */ r = ff_match_key( va_arg( ap, char ** ) ); break; default : /* error, wrong format */ va_end( ap ); fl_free( fmt ); M_err( "ff_read", "Invalid argument(s)" ); return FF_READ_FAILURE; } last = *fp; if ( r < 0 ) break; cnt++; fp++; } ff.pos = ff_skip_spaces( ff.pos ); fp = ff_skip_spaces( fp ); } va_end( ap ); fl_free( fmt ); /* If we're at the end of the line read in the next - except when the last request was for a key, in that case the next one will be for a value and it's allowed that no value exists even when there's a key... */ if ( last != 'k' && ! *ff.pos ) ff_get_line( ); return cnt; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_positioner.h0000664000175000017500000000226512244217405014452 00000000000000/* * * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifndef SP_POSITIONER_H_ #define SP_POSITIONER_H_ #include "include/forms.h" #include FL_FORM * positioner_create_spec_form( void ); void positioner_fill_in_spec_form( FL_OBJECT * obj ); void positioner_reread_spec_form( FL_OBJECT * obj ); void positioner_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ); void positioner_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ); #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fd_initforms.c0000664000175000017500000001206412353623325014234 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fd_initforms.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * create and initialize all control panels */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "fd_main.h" #include "fd/ui_attrib.h" /* from directory fd */ #include "fd/ui_theforms.h" /* from directory fd */ FD_control *fd_control; FD_test *fd_test; FD_align *fd_align; FD_resize *fd_resize; FD_helpform *fd_help; FD_attrib *fd_attrib; FD_generic_attrib *fd_generic_attrib; extern int fd_helpfontsize; extern int fd_align_fontsize, fd_type_fontsize; static void init_helpform( void ); static void init_controlform( void ); static void init_attribform( void ); static void init_testform( void ); /*************************************** ***************************************/ void create_the_forms( void ) { static int init; if ( init ) { fprintf( stderr, "fd forms already initialized\n" ); return; } init = 1; fd_control = create_form_control( ); init_controlform( ); /* GUI */ control_init( fd_control ); /* menu */ fd_attrib = create_form_attrib( ); fd_generic_attrib = create_form_generic_attrib( ); init_attribform( ); fd_test = create_form_test( ); init_testform( ); fd_align = create_form_align( ); init_align( ); fd_resize = create_form_resize( ); /* Help form */ fd_help = create_form_helpform( ); init_helpform( ); } /*************************************** * Conditionally modify the basic color of attribute form ***************************************/ void modify_attrib_basic_color( FL_COLOR col1, FL_COLOR col2 ) { fl_set_object_color( fd_generic_attrib->text[ 0 ], col1, col2 ); fl_set_object_color( fd_generic_attrib->text[ 1 ], col1, col2 ); fl_set_object_color( fd_generic_attrib->text[ 2 ], col1, col2 ); fl_set_object_color( fd_generic_attrib->text[ 3 ], col1, col2 ); fl_set_object_color( fd_generic_attrib->background, col1, col2 ); } /*************************************** ***************************************/ void clearlog_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_clear_browser( fd_test->browser ); } /*************************************** ***************************************/ static void init_helpform( void ) { fl_adjust_form_size( fd_help->helpform ); fl_set_form_position( fd_help->helpform, -1, 1 ); /* load one help */ fl_set_button( fd_help->vbutt, 1 ); fl_call_object_callback( fd_help->vbutt ); } /*************************************** ***************************************/ static void init_controlform( void ) { /* sort of auto-resizing depending on the font size */ if ( fli_cntl.buttonFontSize > FL_DEFAULT_SIZE ) { fd_align_fontsize = FL_SMALL_SIZE; fd_type_fontsize = FL_SMALL_SIZE; } if ( fd_control->objectbrowser->lsize > FL_NORMAL_SIZE ) { fl_set_object_lsize( fd_control->objectbrowser, FL_NORMAL_SIZE ); fl_set_object_lsize( fd_control->formbrowser, FL_NORMAL_SIZE ); fl_set_object_lsize( fd_control->groupbrowser, FL_NORMAL_SIZE ); } // fl_fit_object_label( fd_control->renameform, 1, 0 ); // fl_fit_object_label( fd_control->resizeform, 1, 0 ); fl_fit_object_label( fd_control->objectmenu, -3, 0 ); } /*************************************** ***************************************/ static void init_attribform( void ) { FL_OBJECT *t; if ( fl_get_visual_depth( ) <= 2 ) modify_attrib_basic_color( FL_WHITE, FL_WHITE ); fl_adjust_form_size( fd_attrib->attrib ); fl_fit_object_label( fd_attrib->readyobj, 12, 1 ); fd_attrib->attrib->y = 5; fl_set_tabfolder_autofit( fd_attrib->attrib_folder, FL_ENLARGE_ONLY ); t = fl_addto_tabfolder( fd_attrib->attrib_folder, " Generic ", fd_generic_attrib->generic_attrib ); fl_set_object_shortcut( t, "#G", 1 ); } /*************************************** ***************************************/ static void init_testform( void ) { fl_fit_object_label( fd_test->stoptesting, 2, 1 ); fl_set_object_dblbuffer( fd_test->browser, 1 ); } #include "fd/ui_attrib.c" #include "fd/ui_theforms.c" /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fd_main.h0000664000175000017500000005261612353623325013162 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fd_main.h * * This file is the header file used in the Form Designer */ #ifndef FD_MAIN_H_ #define FD_MAIN_H_ #include #include "include/forms.h" #include "flinternal.h" #ifndef FALSE #define FALSE 0 #define TRUE ( ! FALSE ) #endif /* since MAGIC4 all coordinates are relative to the top-left */ #define MAGIC2 12321 #define MAGIC3 12322 #define MAGIC4 13000 #define MAGIC5 14000 /* since XForms 1.0.92 */ #define MAGIC6 15000 /* since XForms 1.0.94pre4 */ /* general limits */ #define MAX_CLASS_NAME_LEN 64 /* FL_BUTTON etc. */ #define MAX_TYPE_NAME_LEN 64 /* FL_RADIO_BUTTON etc */ #define MAX_VAR_LEN 128 /* max. length of a variable/function */ /* various options of the program */ typedef struct { int language; int emit_code; /* if emit UI code */ int emit_main; int emit_cb; int lax; int altformat; int conv_only; int show_pallete; int compensate; /* if emit font size compensation code */ int unit; char * output_dir; } FD_Opt; enum { FD_C = 1, FD_ADA95, FD_PERL, FD_PASCAL, FD_PYTHON, FD_FORTRAN, FD_PS, FD_SCM, FD_EXP }; /* We use different file selector for different tasks */ enum { SAVE_FSELECTOR, LOAD_FSELECTOR, XPM_FSELECTOR }; #define MAX_CONVERTOR ( FD_EXP + 1 ) /* Structure that will hole all forms created */ typedef struct { FL_FORM * form; /* The form */ char fname[ MAX_VAR_LEN ]; /* Its name */ } FRM; typedef struct { const char * lang_name; int ( * convert )( const char *, FRM *, int ); /* built-in convertor */ const char * extern_convertor; /* the converter itself */ const char * contact_info; /* who to contact in case of error */ int need_c_code; /* if translator works on C or .fd file */ void ( * init )( void ); /* additional initialization */ } Conv; extern Conv convertor[ ]; extern FD_Opt fdopt; #define ShiftIsDown( mask ) ( mask & ShiftMask ) /******** in fd_main.c *********/ extern long main_window; /* The identifier of the main window */ extern FL_Coord winw, winh; extern int changed; /* Whether the file has changed. */ extern char main_name[ ]; /* Main creation routine name */ /******** in fd_rubber.c *********/ /* Contains routines for drawing rubberband boxes. */ void set_step_size( double ); /* sets the stepsize */ double get_step_size( void ); /* returns the stepsize */ /* Sets the bounding box in which the drawing occurs */ void set_bounding_box( double, double, double, double ); /* returns the position of the mouse in world coordinates */ void get_mouse_pos( double *, double * ); /* drag a box around until the user releases a mouse button */ void move_box( double *, double *, double *, double *, int ); /* scales a box until the user releases a left mouse button */ void scale_box( double *, double *, double *, double * ); /******** in fd_select.c *********/ /* Contains the routines that deal with the maintenance of the current selection of objects */ int is_selected( FL_OBJECT * ); /* Returns whether the object is selected. */ void addto_selection( FL_OBJECT * ); /* Adds an object to a selection */ void addgroupto_selection( FL_OBJECT * ); /* Adds a group of objects to a selection */ void deletefrom_selection( FL_OBJECT * ); /* Deletes an object from a selection */ void clear_selection( void ); /* Clears the current selection */ void resize_selection( FL_Coord, FL_Coord ); void move_selection( FL_Coord, FL_Coord ); void deletegroupfrom_selection( FL_OBJECT * ); /* Deletes a group of objects from a selection */ void draw_selbox( void ); /* Draws the box around the selected objects */ void handle_select( const XEvent * ); /* Change the selection when user puhed mouse. */ void handle_move( const XEvent * ); /* Moves or scales the selection. */ void select_all( void ); /* Selects all objectsin the form */ void change_selection( void ); /* Changes the atributes of the selection */ void align_selection( int ); /* Aligns the objects in the selection */ void show_selection( void ); /* Makes the selection visible. */ void hide_selection( void ); /* Makes the selection invisible. */ void raise_selection( void ); /* Raises the selection */ void lower_selection( void ); /* Lower the selection */ void cut_selection( void ); /* Deletes all objects in the selection */ void paste_selection( void ); /* Puts elements from buffer into form */ void copy_selection( void ); /* Copies objects in selection to buffer */ FL_OBJECT **dup_selection( void ); void set_selection( FL_OBJECT ** ); void free_dupped_selection( FL_OBJECT ** ); void next_selection( void ); void prev_selection( void ); void group_selection( void ); /* Turns objects in the selection into a group. */ void flatten_selection( void ); /* Removes begin and end groups from the selection. */ /******** in fd_attribs.c **********/ /* Contains routines to set and change attributes of objects. */ int change_object( FL_OBJECT *, /* changes the settings for object */ int ); void change_type( FL_OBJECT *, /* Changes the type of a particular object. */ int); void set_label( FL_OBJECT *, /* Sets the object label (interpreting \n's). */ const char * ); void set_shortcut( FL_OBJECT *, const char * ); char *get_label( const FL_OBJECT *, /* Returns object label */ int); /* (turning NL's into \n's). */ char *get_shortcut_string( const FL_OBJECT * ); /******** in fl_file_fun.c ********/ #define FF_READ_FAILURE -1 #define FF_AT_END_OF_FILE 0 #define FF_AT_START_OF_FORM 1 #define FF_AT_START_OF_OBJECT 2 int ff_get_fd_file( const char *, int ); char *ff_get_filename_copy( void ); int ff_read( const char *, ... ); void ff_close( void ); int ff_err( const char * ); /******** in fl_file.c ********/ /* Contains all routines that deal with saving and loading forms. */ int read_form( void ); void write_form( FILE *, FL_FORM *, char[ ] ); /******** in fl_print.c ********/ /* Contains all routines that deal with printing forms in C format. */ void print_form( FILE *, FL_FORM *, const char * ); void print_callbacks_and_globals( FILE *, FL_FORM *, int ); /* For making the header file */ void print_header( FILE *, FL_FORM *, const char * ); void output_main( FILE *, FRM *, int ); void output_callbacks( FILE *, FRM *, int ); /******** in fd_forms.c *********/ /* Contains the routines that maintain the collection of forms. */ extern FL_FORM *cur_form; const char * get_form_name( FL_FORM * form ); /* The current form under construction */ void redraw_the_form( int ); /* Redraws the current form. The argument indicates whether the background should be redrawn. */ void reshape_form_background( FL_Coord, FL_Coord ); /* loads the forms from a file */ int load_forms( int, const char * ); int save_forms( const char * ); /* saves the forms to a file, returns whether actually saved */ /******** fd_groups.c *********/ /* Contains the routines that deal with groups. */ /* Fills in the groups in the current form. */ void fillin_groups( void ); /******** fd_names.c **********/ /* Routines that keep track of the object names */ void get_object_name( const FL_OBJECT *, char *, char *, char * ); void set_object_name( FL_OBJECT *, const char *, const char *, const char * ); const char * get_object_c_name( FL_OBJECT * obj ); /******** fd_objects.c *********/ /* Contains the different object classes and types. */ #define MAXCLASSES 60 /* Max. number of object classes handled */ #define MAXTYPES 24 /* Max. number of types per class. */ /* Maximal number of object classes. */ /* The current class of object to be added */ extern int cur_class; /* Initializes all the classes and types. */ void init_classes( void ); /* adds an object to the current form */ FL_OBJECT * add_an_object( int, int, FL_Coord, FL_Coord, FL_Coord, FL_Coord ); /* Returns a pointer to the name of the class */ char *find_class_name( int ); char * find_class_name( int ); /* Returns the number of types in the class */ int find_class_maxtype( int ); /* Returns the default object in the class */ FL_OBJECT * find_class_default( int, int ); /* Returns a pointer to the name of the type in the class */ const char *find_type_name( int, int ); int find_type_value( int, const char * ); extern unsigned long fd_red, fd_black, fd_white, fd_col; extern int fd_magic; extern int fd_border; extern int fd_trackgeometry, fd_buttonLabelSize, fd_testborder; void color( unsigned long ); int getbutton( int ); void fd_clear( int, int, int, int ); void rect( FL_Coord, FL_Coord, FL_Coord, FL_Coord ); void rectf( FL_Coord, FL_Coord, FL_Coord, FL_Coord ); int fl_qtest( void ); /* attribute query routines */ char * class_name( int ); int class_val( const char * ); char * gravity_name( int ); int gravity_val( const char * ); char * resize_name( int ); int resize_val( const char * ); char * style_name( int ); int style_val( const char * ); const char * align_name( int, int ); int align_val( const char * ); char * lsize_name( int ); int lsize_val( const char * ); char * boxtype_name( int ); int boxtype_val( const char * ); extern char * loadedfile; extern char *loadedfile_fullpath; typedef struct { int val; /* value */ char * name; /* formal name */ char * shown; /* name shown */ char * hotkey; /* hotkeys */ } VN_pair; char * get_vn_name( VN_pair *, int ); int get_vn_val( VN_pair *, const char * ); extern VN_pair vn_btype[ ]; extern VN_pair vn_gravity[ ]; extern VN_pair vn_align[ ]; extern VN_pair vn_resize[ ]; extern int fd_align_fontsize, fd_type_fontsize; extern int fd_convert, fd_show_palette; const char * get_fd_name( const char * ); extern int fd_bwidth; char * unit_name( int ); int unit_val( const char * ); int convert_u( int ); double get_conversion_factor( void ); extern char xform_header[ ]; extern char glcanvas_header[ ]; void show_geometry( int, int, int, int ); void show_selmessage( FL_OBJECT *[ ], int ); enum { FD_LEFT = 1, FD_HCENTER = 2, FD_RIGHT = 3, FD_HEQUAL = 4, FD_BOTTOM = 5, FD_VCENTER = 6, FD_TOP = 7, FD_VEQUAL = 8 }; enum { HELP_VERSION, HELP_GENERAL, HELP_MOUSE, HELP_KEYBOARD, HELP_GROUP, HELP_TEST, HELP_SAVE }; extern FL_FORM * thetestform; FL_OBJECT * fl_create_simu_canvas( int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char * ); FL_OBJECT * fl_add_simu_canvas( int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char * ); FL_OBJECT * fl_create_simu_glcanvas( int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char * ); FL_OBJECT * fl_add_simu_glcanvas( int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char * ); /* Object class specific info handler */ void save_objclass_spec_info( FILE *, FL_OBJECT * ); int load_objclass_spec_info( FL_OBJECT *, char *); void emit_objclass_spec_info( FILE *, FL_OBJECT * ); void emit_objclass_spec_header( FILE *, FL_OBJECT * ); void emit_objclass_spec_global( FILE *, FL_OBJECT * ); void set_objclass_spec_attributes( FL_OBJECT *, long ); void obj_spec_reread( FL_OBJECT * obj ); void obj_spec_apply( FL_OBJECT * obj ); void obj_spec_restore( FL_OBJECT * obj ); int has_class_spec_info( FL_OBJECT * ); void modify_attrib_basic_color( FL_COLOR, FL_COLOR ); /* Control panel etc */ #include "fd/ui_theforms.h" #include "fd/ui_attrib.h" extern FD_control *fd_control; extern FD_attrib *fd_attrib; extern FD_generic_attrib *fd_generic_attrib; extern FD_test * fd_test; extern FD_align * fd_align; extern FD_resize * fd_resize; extern FD_helpform * fd_help; void loadforms_cb( FL_OBJECT *, long ); void saveforms_cb( FL_OBJECT *, long ); void saveforms_as_cb( FL_OBJECT *, long ); void mergeforms_cb( FL_OBJECT *, long ); void exit_cb( FL_OBJECT *, long ); void changegroupname_cb( FL_OBJECT *, long ); void mainname_cb( FL_OBJECT *, long ); void create_the_forms( void ); void control_init( FD_control * ); extern FL_FORM *thetestform; int within_selection( double, double ); extern int no_selection; int C_output( const char *, FRM *, int ); extern int is_pasting; void init_align( void ); void cleanup_spec( FL_OBJECT * ); /* fake stuff */ #define FL_NTABFOLDER 50 FL_OBJECT *fl_add_ntabfolder( int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char *); FL_OBJECT *fl_create_ntabfolder( int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char * ); FL_OBJECT *fl_add_nformbrowser( int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char * ); FL_OBJECT *fl_create_nformbrowser( int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char * ); void make_backup( const char * ); int is_var_boxtype( int cn ); void set_testing_pixmap( FL_OBJECT * ); void set_testing_bitmap( FL_OBJECT * ob ); void set_snap_size( int, int ); int get_snap_size( void ); void show_pallette( void ); void hide_pallette( void ); void reset_pallette_menu_status( void ); void select_pallette_entry( int ); void reset_pallette( void ); typedef struct { double min, max, xmin, xmax, ymin, ymax; double val, xval, yval; double step, sstep, lstep, xstep, ystep; double slsize; double thetai, thetaf; double ldelta, rdelta; double dval, dmin, dmax, dstep; int prec; int direction; int mbuttons; int int_val; int align; int dx, dy; int show_focus; int h_pref, v_pref; int nlines; int xmajor, xminor; int ymajor, yminor; int xscale, yscale; float xbase, ybase; int xgrid, ygrid; char ** content; char ** shortcut; char ** callback; unsigned char * mode; int new_menuapi; int global_scope; int showsymbol; char * misc_char; int grid_linestyle; int no_title; int mark_active; int * mval; int orient; } SuperSPEC; SuperSPEC * get_superspec( FL_OBJECT * ); SuperSPEC * spec_to_superspec( FL_OBJECT * ); void * superspec_to_spec( FL_OBJECT * ); void copy_superspec( FL_OBJECT * dest, FL_OBJECT * src ); void free_superspec( FL_OBJECT * obj ); #define ISBUTTON( cls ) ( ( cls ) == FL_BUTTON \ || ( cls ) == FL_LIGHTBUTTON \ || ( cls ) == FL_CHECKBUTTON \ || ( cls ) == FL_ROUNDBUTTON \ || ( cls ) == FL_ROUND3DBUTTON \ || ( cls ) == FL_PIXMAPBUTTON \ || ( cls ) == FL_BITMAPBUTTON \ || ( cls ) == FL_SCROLLBUTTON \ || ( cls ) == FL_LABELBUTTON ) #define ISCHOICE( cls ) ( ( cls ) == FL_CHOICE \ || ( cls ) == FL_MENU \ || ( cls ) == FL_BROWSER ) void select_object_by_class( int ); char * append_fd_suffix( const char * ); const char * get_placement( FL_FORM * ); unsigned int check_resize( unsigned int what, int nw, int se ); void reset_dupinfo_cache( void ); int is_duplicate_info( const char * ); char * rel2abs( const char * rel_path ); int is_valid_c_name( const char * str ); void setup_how_return_menu( FL_OBJECT * ); void reset_how_return_menu( FL_OBJECT *, unsigned int ); void handle_how_return_changes( FL_OBJECT *, FL_OBJECT * ); int get_how_return_val( const char * ); const char * get_how_return_name( unsigned int, int ); const char * file_tail( const char * ); void reset_object_list( void ); void addform_cb( FL_OBJECT *, long ); void deleteform_cb( FL_OBJECT *, long ); void changename_cb( FL_OBJECT *, long ); void changesize_cb( FL_OBJECT *, long ); #endif /* FD_MAIN_H */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fd_groups.c0000664000175000017500000001245212253055546013545 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fd_groups.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * This file is part of the Form Designer. * * It maintains a list of groups in the form. Each group can be * assigned a name. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "fd_main.h" #include "fd/ui_theforms.h" /**** Data Structure maintaining groups in current form ****/ static FL_OBJECT **begobj = NULL; /* Begin objects of the groups */ /**** Call-back routines ****/ /*************************************** * Sets the current group in the form ***************************************/ void group_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { int n = fl_get_browser( fd_control->groupbrowser ); cur_class = -1; fl_deselect_browser( fd_control->objectbrowser ); reset_pallette( ); cur_class = -1; if ( n > 0 ) { /* In order to stay consistent with the rest of the interface (where adding to the selection requires the button to be kept pressed down) we clear the selection of the button isn't pressed */ if ( ! ( fl_last_event( )->xmotion.state & ShiftMask ) ) clear_selection( ); addgroupto_selection( begobj[ n ] ); } else if ( n < 0 ) deletegroupfrom_selection( begobj[ -n ] ); redraw_the_form( 0 ); } /*************************************** * Changes the name of the current group ***************************************/ void changegroupname_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { char name[ MAX_VAR_LEN ]; int i, numb = 0; const char *s; if ( cur_form == NULL ) return; for ( i = 1; i <= fl_get_browser_maxline( fd_control->groupbrowser ); i++ ) if ( fl_isselected_browser_line( fd_control->groupbrowser, i ) ) { if ( numb != 0 ) { fl_show_messages( "Cannot change name of multiple groups" ); return; } numb = i; } if ( numb == 0 ) { fl_show_messages( "No group is selected" ); return; } get_object_name( begobj[ numb ], name, NULL, NULL ); get_changed_group_name: if ( ! ( s = fl_show_input( "Group name (must be usable as " "a C variable or empty):", name ) ) ) return; if ( *s && ! is_valid_c_name( s ) ) { fl_show_alert( "Error", "Invalid C identifier specified for group " "name:", s, 0 ); goto get_changed_group_name; } strcpy( name, s ); set_object_name( begobj[ numb ], name, NULL, NULL ); fillin_groups( ); changed = FL_TRUE; } /*************************************** * Fills in the current list of groups ***************************************/ void fillin_groups( void ) { char name[ MAX_VAR_LEN ]; FL_OBJECT *obj, *obj2; int i; if ( cur_form == NULL ) { fl_clear_browser( fd_control->groupbrowser ); return; } fl_freeze_form( fd_control->groupbrowser->form ); fl_clear_browser( fd_control->groupbrowser ); /* Check whether groups are empty. */ obj = cur_form->first; while ( obj != NULL ) { obj2 = obj; obj = obj->next; if ( obj2->objclass == FL_END_GROUP && obj2->prev != NULL && obj2->prev->objclass == FL_BEGIN_GROUP ) fl_delete_object( obj2->prev ); } /* Put the still existing groups in the list */ for ( i = 0, obj = cur_form->first; obj; obj = obj->next ) if ( obj->objclass == FL_BEGIN_GROUP ) i++; if ( i > 0 ) { begobj = fl_realloc( begobj, ( i + 1 ) * sizeof *begobj ); for ( i = 1, obj = cur_form->first; obj; obj = obj->next ) if ( obj->objclass == FL_BEGIN_GROUP ) { begobj[ i ] = obj; get_object_name( obj, name, NULL, NULL ); if ( ! *name ) strcpy( name, "" ); fl_add_browser_line( fd_control->groupbrowser, name ); if ( is_selected( obj ) ) fl_select_browser_line( fd_control->groupbrowser, i ); } else if ( obj->objclass == FL_END_GROUP ) i++; } fl_unfreeze_form( fd_control->groupbrowser->form ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fd_attribs.c0000664000175000017500000006570012353623325013677 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "fd_main.h" #include "fd_spec.h" #include "fd_iconinfo.h" /* Pointer to object currently being edited */ static FL_OBJECT * curobj; static void save_edited_object( FL_OBJECT * obj ); static void restore_edited_object( FL_OBJECT * obj ); static void attrib_init( FD_generic_attrib * ui ); static int validate_attributes( FL_OBJECT * obj ); static void readback_attributes( FL_OBJECT * obj ); static void copy_shortcut( FL_OBJECT * dest, FL_OBJECT * src ); static void cleanup_saved_object( void ); static void show_attributes( const FL_OBJECT * obj ); static int valid_c_identifier( const char * s ); static void add_font_choice( const char * p ); static int validate_cvar_name( FL_OBJECT * obj, const char * w ); /* Structuure for storing the initial state of the object */ static struct { FL_OBJECT * obj; char name[ MAX_VAR_LEN ]; char cbname[ MAX_VAR_LEN ]; char argname[ MAX_VAR_LEN ]; } saved_object; /* Font sizes, need to do this because of symbolic names */ static FL_OBJECT *fnts; typedef struct { int size; char * name, * sc; } Fsizes; static Fsizes fsizes[ ] = { { FL_TINY_SIZE, "Tiny", "Tt#t" }, { FL_SMALL_SIZE, "Small", "Ss#s" }, { FL_NORMAL_SIZE, "Normal", "Nn#n" }, { FL_MEDIUM_SIZE, "Medium", "Mm#m" }, { FL_LARGE_SIZE, "Large", "Ll#l" }, { FL_HUGE_SIZE, "Huge", "Hh#h" }, { 11, "Variable", "" } }; #define NFSIZE ( sizeof fsizes / sizeof *fsizes ) /* Character used for newline */ #define NL 0x0a /*************************************** * Displays and do interaction with the form for changing object attributes. * 'all' indicates whether label, name, etc. should also be changed and is * only set when only a single object is to selected for changing. ***************************************/ int change_object( FL_OBJECT * obj, int all ) { FL_OBJECT *retobj; FD_generic_attrib *ui = fd_generic_attrib; FL_FORM * spec_form = NULL; attrib_init( ui ); /* Save current attributes for later restore */ curobj = obj; save_edited_object( obj ); /* Show only required parts */ if ( all ) { fl_show_object( ui->labelobj ); fl_show_object( ui->scobj ); fl_show_object( ui->nameobj ); fl_show_object( ui->cbnameobj ); fl_show_object( ui->argobj ); if ( ( spec_form = create_spec_form( curobj ) ) ) { FL_OBJECT *t; t = fl_addto_tabfolder( fd_attrib->attrib_folder, "Spec", spec_form ); fl_set_object_shortcut( t, "#S", 1 ); } } else { fl_hide_object( ui->labelobj ); fl_hide_object( ui->scobj ); fl_hide_object( ui->nameobj ); fl_hide_object( ui->cbnameobj ); fl_hide_object( ui->argobj ); } /* Show attributes of the current object */ show_attributes( obj ); /* Do interaction */ fl_deactivate_all_forms( ); /* Disable selection */ no_selection = 1; fl_show_form( fd_attrib->attrib, FL_PLACE_GEOMETRY, FL_FULLBORDER, "Attributes" ); fl_set_app_mainform( fd_attrib->attrib ); /* Both cancel and readyobj should have their own callbacks, so we don't need to call fl_do_forms(), but since attribute editing can't be invoked for more than one item at a time we need to block the process_xevent. TODO */ do { XEvent xev; retobj = fl_do_forms( ); if ( retobj == FL_EVENT ) fl_XNextEvent( &xev ); } while ( ! ( ( retobj == fd_attrib->readyobj && validate_attributes( curobj ) ) || retobj == fd_attrib->cancelobj ) ); if ( retobj == fd_attrib->cancelobj ) { restore_edited_object( obj ); redraw_the_form( 0 ); } else { reread_spec_form( obj ); readback_attributes( obj ); spec_to_superspec( obj ); } cleanup_saved_object( ); fl_set_app_mainform( fd_control->control ); fl_set_folder_bynumber( fd_attrib->attrib_folder, 1 ); if ( spec_form ) fl_delete_folder( fd_attrib->attrib_folder, spec_form ); fl_hide_form( fd_attrib->attrib ); fl_activate_all_forms( ); no_selection = 0; return retobj == fd_attrib->readyobj; } /*************************************** * Called on switching between "Generic" and "Spec" folder ***************************************/ void folder_switch_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { int active = fl_get_active_folder_number( ( ( FD_attrib * ) obj->form->fdui )->attrib_folder ); if ( active == 1 ) reread_spec_form( curobj ); else { readback_attributes( curobj ); prepare_spec_form( curobj ); } } /*************************************** * Callback for most of the objects for setting generic attributes * (instead of having one for each of them) - evaluates the settings * from all the objects in the generic attributes form and sets the * object accordingly. ***************************************/ void apply_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { readback_attributes( curobj ); show_attributes( curobj ); } /*************************************** * Callback for the "Restore" button ***************************************/ void restore_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { restore_edited_object( curobj ); show_attributes( curobj ); redraw_the_form( 0 ); } /*************************************** * Stores all information about the initial settings of the object * being edited (for restoring it) ***************************************/ static void save_edited_object( FL_OBJECT * obj ) { /* Get memory for the object to save and copy everything */ /* Now get memory for the saved object and store what it contains */ saved_object.obj = fl_malloc( sizeof *saved_object.obj ); *saved_object.obj = *obj; saved_object.obj->spec = NULL; /* Get the objects name, name of the callback function and the argument string and store them */ get_object_name( obj, saved_object.name, saved_object.cbname, saved_object.argname ); /* Now get memory for the saved object, store what it contains and also save the label and the shortcut for real */ /* Make a copy of allocated memory in the obejct */ saved_object.obj->label = fl_strdup( obj->label ); copy_shortcut( saved_object.obj, obj ); saved_object.obj->u_vdata = saved_object.obj->c_vdata = NULL; copy_superspec( saved_object.obj, obj ); copy_iconinfo( saved_object.obj, obj ); } /*************************************** * Restores the object state to what it was when editing started ***************************************/ static void restore_edited_object( FL_OBJECT * obj ) { void *sp = obj->spec; fl_free( obj->label ); fl_free( obj->shortcut ); free_superspec( obj ); free_iconinfo( obj ); *obj = *saved_object.obj; obj->spec = sp; obj->label = fl_strdup( saved_object.obj->label ); copy_shortcut( obj, saved_object.obj ); obj->u_vdata = obj->c_vdata = NULL; copy_superspec( obj, saved_object.obj ); superspec_to_spec( obj ); copy_iconinfo( obj, saved_object.obj ); restore_spec( obj ); set_object_name( obj, saved_object.name, saved_object.cbname, saved_object.argname ); /* It the "Spec" folder is currently been shown set its content to the restored object settings and redraw it */ if ( fl_get_active_folder_number( fd_attrib->attrib_folder ) == 2 ) { prepare_spec_form( obj ); fl_redraw_object( fd_attrib->attrib_folder ); } } /*************************************** * Remove all data allocated in the structure for saving the objects * initial state ***************************************/ static void cleanup_saved_object( void ) { if ( ! saved_object.obj ) return; fl_free( saved_object.obj->label ); fl_free( saved_object.obj->shortcut ); free_superspec( saved_object.obj ); free_iconinfo( saved_object.obj ); fli_safe_free( saved_object.obj ); } /*************************************** * Initialize the form used for editing the objects attributes, needs to * be run only once ***************************************/ static void attrib_init( FD_generic_attrib * ui ) { static int attrib_initialized; int i; VN_pair *vp; if ( attrib_initialized ) return; attrib_initialized = 1; fl_clear_choice( ui->boxobj ); for ( i = 1, vp = vn_btype; vp->val >= 0; vp++, i++ ) { fl_addto_choice( ui->boxobj, vp->shown ); fl_set_choice_item_shortcut( ui->boxobj, i, vp->hotkey ); } fl_set_object_return( ui->nameobj, FL_RETURN_END ); fl_set_object_return( ui->cbnameobj, FL_RETURN_END ); /* Resize */ fl_set_choice_fontsize( ui->resize, fd_align_fontsize ); for ( vp = vn_resize; vp->val >= 0; vp++ ) fl_addto_choice( ui->resize, vp->name + 3 ); /* Gravity. Due to compatibility issues there are more than is needed in vn_gravity */ for ( i = 0, vp = vn_gravity; vp->val >= 0 && i < 9; vp++, i++ ) { fl_addto_choice( ui->nwgravity, vp->name + 3 ); fl_addto_choice( ui->segravity, vp->name + 3 ); } /* Align (only show the first 9 elements of 'vn_align' the rest is in there for backward compatibility reasons when reading in a file) */ fl_set_choice_fontsize( ui->align, fd_align_fontsize ); for ( vp = vn_align, i = 0; vp->val >= 0 && i < 9; vp++, i++ ) fl_addto_choice( ui->align, vp->name + 9 ); fl_addto_choice( ui->inside, "Inside|Outside" ); /* Font stuff */ fnts = ui->fontobj; fl_enumerate_fonts( add_font_choice, 1 ); fl_addto_choice( ui->styleobj, "Normal|Shadow|Engraved|Embossed" ); /* Size */ for ( i = 0; i < ( int ) NFSIZE; i++ ) { if ( fsizes[ i ].size == FL_NORMAL_SIZE ) { fsizes[ i ].name = "Normal"; fsizes[ i ].sc = "Nn#n"; } fl_addto_choice_f( ui->sizeobj, "%2d %s%%r1", fsizes[ i ].size, fsizes[ i ].name ); fl_set_choice_item_shortcut( ui->sizeobj, i + 1, fsizes[ i ].sc ); } } /*************************************** * Sets up the "Generic" attributes form with the properties of the * object currently being edited ***************************************/ static void show_attributes( const FL_OBJECT * obj ) { char objname[ MAX_VAR_LEN ], cbname[ MAX_VAR_LEN ], argname[ MAX_VAR_LEN ]; char *label; int i, lstyle, spstyle, oksize, align = fl_to_outside_lalign( obj->align ); static char othersize[ 32 ]; fl_freeze_form( fd_generic_attrib->generic_attrib ); /* Fill in list of types */ fl_clear_choice( fd_generic_attrib->typeobj ); fl_set_choice_fontsize( fd_generic_attrib->typeobj, fd_type_fontsize ); if ( obj->objclass != FL_BOX ) { for ( i = 0; i < find_class_maxtype( obj->objclass ); i++ ) fl_addto_choice_f( fd_generic_attrib->typeobj, "%s%%r1", find_type_name( obj->objclass, i ) ); fl_set_choice( fd_generic_attrib->typeobj, obj->type + 1 ); } /* Fill in settings */ /* a) boxtype */ fl_set_choice( fd_generic_attrib->boxobj, obj->boxtype + 1 ); /* b) label alignment */ fl_set_choice_text( fd_generic_attrib->align, align_name( align, 0 ) + 9 ); fl_set_choice( fd_generic_attrib->inside, fl_is_outside_lalign( obj->align ) + 1 ); /* c) label font and style */ lstyle = obj->lstyle % FL_SHADOW_STYLE; spstyle = obj->lstyle / FL_SHADOW_STYLE; if ( spstyle >= 3 ) spstyle = 3; fl_set_choice( fd_generic_attrib->fontobj, lstyle + 1 ); fl_set_choice( fd_generic_attrib->styleobj, spstyle + 1 ); /* d) label font size */ for ( oksize = i = 0; ! oksize && i < ( int ) NFSIZE; i++ ) if ( ( oksize = ( obj->lsize == fsizes[ i ].size ) ) ) fl_set_choice( fd_generic_attrib->sizeobj, i + 1 ); if ( ! oksize ) { sprintf( othersize, "%d (Variable)", obj->lsize ); fsizes[ NFSIZE - 1 ].size = obj->lsize; fsizes[ NFSIZE - 1 ].name = othersize; fl_replace_choice( fd_generic_attrib->sizeobj, NFSIZE, othersize ); fl_set_choice( fd_generic_attrib->sizeobj, NFSIZE ); } /* e) gravity settings */ fl_set_choice_text( fd_generic_attrib->nwgravity, gravity_name( obj->nwgravity ) + 3 ); fl_set_choice_text( fd_generic_attrib->segravity, gravity_name( obj->segravity ) + 3 ); /* f) resize behaviour */ fl_set_choice_text( fd_generic_attrib->resize, resize_name( obj->resize ) + 3 ); /* g) Label string */ label = get_label( obj, 0 ); fl_set_input( fd_generic_attrib->labelobj, label ); fl_free( label ); /* h) name, callback function name and argument */ get_object_name( obj, objname, cbname, argname ); fl_set_input( fd_generic_attrib->nameobj, objname ); fl_set_input( fd_generic_attrib->cbnameobj, cbname ); fl_set_input( fd_generic_attrib->argobj, argname ); /* h) shortcut */ fl_set_input( fd_generic_attrib->scobj, get_shortcut_string( obj ) ); /* i) object and label colors */ fl_set_object_color( fd_generic_attrib->col1obj, obj->col1, obj->col1 ); fl_set_object_color( fd_generic_attrib->col2obj, obj->col2, obj->col2 ); fl_set_object_color( fd_generic_attrib->lcolobj, obj->lcol, obj->lcol ); fl_unfreeze_form( fd_generic_attrib->generic_attrib ); } /*************************************** * Sets the objects attributes from the content of the "Generic" attributes * form ***************************************/ static void readback_attributes( FL_OBJECT * obj ) { int v1, v2; char * name, * cbname; char tmpbuf[ 128 ]; obj->boxtype = fl_get_choice( fd_generic_attrib->boxobj ) - 1; /* Take care: for some objects the "Type" choice is empty! */ if ( ( v1 = fl_get_choice( fd_generic_attrib->typeobj ) - 1 ) >= 0 && v1 != obj->type ) spec_change_type( obj, v1 ); /* Label style consists of two parts */ v1 = fl_get_choice( fd_generic_attrib->fontobj ) - 1; v2 = fl_get_choice( fd_generic_attrib->styleobj ) - 1; v1 += v2 == 3 ? FL_EMBOSSED_STYLE : ( v2 * FL_SHADOW_STYLE ); fl_set_object_lstyle( obj, v1 ); fl_set_object_color( obj, fd_generic_attrib->col1obj->col1, fd_generic_attrib->col2obj->col1 ); fl_set_object_lcol( obj, fd_generic_attrib->lcolobj->col1 ); sprintf( tmpbuf, "FL_ALIGN_%s", fl_get_choice_text( fd_generic_attrib->align ) ); v1 = align_val( tmpbuf ); if ( fl_get_choice( fd_generic_attrib->inside ) == 1 ) v1 = fl_to_inside_lalign( v1 ); else v1 = fl_to_outside_lalign( v1 ); fl_set_object_lalign( obj, v1 ); sprintf( tmpbuf, "FL_%s", fl_get_choice_text( fd_generic_attrib->nwgravity ) ); v1 = gravity_val( tmpbuf ); sprintf( tmpbuf, "FL_%s", fl_get_choice_text( fd_generic_attrib->segravity ) ); v2 = gravity_val( tmpbuf ); fl_set_object_gravity( obj, v1, v2 ); /* Set resize property after making sure it fits with the gravity settings */ sprintf( tmpbuf, "FL_%s", fl_get_choice_text( fd_generic_attrib->resize ) ); fl_set_object_resize( obj, check_resize( resize_val( tmpbuf ), obj->nwgravity, obj->segravity ) ); fl_set_object_lsize( obj, fsizes[ fl_get_choice( fd_generic_attrib->sizeobj ) - 1 ].size ); set_label( obj, fl_get_input( fd_generic_attrib->labelobj ) ); set_shortcut( obj, fl_get_input( fd_generic_attrib->scobj ) ); name = fl_strdup( fl_get_input( fd_generic_attrib->nameobj ) ); cbname = fl_strdup( fl_get_input( fd_generic_attrib->cbnameobj ) ); if ( ! valid_c_identifier( name ) ) *name = '\0'; if ( ! valid_c_identifier( cbname ) ) *cbname = '\0'; set_object_name( obj, name, cbname, fl_get_input( fd_generic_attrib->argobj ) ); fl_free( cbname ); fl_free( name ); redraw_the_form( 0 ); } /*************************************** * Turns the string from the label input field into a string suitable for * an object label (taking care of newlines and shortcut markers) and * the sets the label of the object being edited. ***************************************/ void set_label( FL_OBJECT * obj, const char * str ) { int i = 0, j = 0; char *tmpstr = fl_malloc( strlen( str ) + 1 ); *tmpstr = '\0'; do { if ( str[ i ] == '\\' && str[ i + 1 ] == 'n' ) { tmpstr[ j++ ] = NL; i++; } else if ( str[ i ] == '\\' && strncmp( str + i + 1, "010", 3 ) == 0 ) { if ( ! obj->shortcut || ! *obj->shortcut ) tmpstr[ j++ ] = *fl_ul_magic_char; i += 3; } else tmpstr[ j++ ] = str[ i ]; } while ( str[ i++ ] ); fl_set_object_label( obj, tmpstr ); fl_free( tmpstr ); } /*************************************** * Sets the shortcut of the object being edited. ***************************************/ void set_shortcut( FL_OBJECT * obj, const char * sc ) { if ( obj->type != FL_RETURN_BUTTON && obj->type != FL_HIDDEN_RET_BUTTON ) fl_set_object_shortcut( obj, sc, 1 ); } /* if \ preceeds c, \ does not need quote */ #define Ok( c ) \ ( c== '"' || c== '\\' || c == 't' || c == 'n' \ || isdigit( ( unsigned char ) c ) ) /*************************************** * Decides if label need quotes ('\') ***************************************/ static int need_quote( const char * s, int i ) { int c = s[ i ], p = i ? s[ i - 1 ] : 0, /* prev char */ n = *s ? s[ i + 1 ] : 0; /* next char */ if ( c == '"' && p != '\\' ) return 1; else if ( c == '\\' && p != '\\' ) return ! isdigit( ( unsigned char ) n ) && ! Ok( n ); else return 0; } /*************************************** * Takes an objects label string and converts it into a string suitable * for setting as the content of the label input field ***************************************/ char * get_label( const FL_OBJECT * obj, int c_source ) { int i = 0, j = 0; const char *label = obj->label; int len = strlen( label ); int tlen = len + 1; char *tmpstr = fl_malloc( tlen ); for ( i = 0; i < len; i++ ) { if ( label[ i ] == NL ) { tmpstr = fl_realloc( tmpstr, tlen += 1 ); tmpstr[ j++ ] = '\\'; tmpstr[ j++ ] = 'n'; } else if ( label[ i ] == *fl_ul_magic_char ) { if ( ! obj->shortcut || ! *obj->shortcut ) { tmpstr = fl_realloc( tmpstr, tlen += 3 ); tmpstr[ j++ ] = '\\'; tmpstr[ j++ ] = '0'; tmpstr[ j++ ] = '1'; tmpstr[ j++ ] = '0'; } } else if ( c_source && need_quote( label, i ) ) { tmpstr = fl_realloc( tmpstr, tlen += 1 ); tmpstr[ j++ ] = '\\'; tmpstr[ j++ ] = label[ i ]; } else tmpstr[ j++ ] = label[ i ]; } tmpstr[ j ] = '\0'; return tmpstr; } /*************************************** * Convert shortcut into string representation. * ESC -> ^[, F1 -> &1 etc. ***************************************/ static int special_key( int key, char * outbuf ) { char *start = outbuf; if ( key >= XK_F1 && key <= XK_F30 ) { int p = ( key - XK_F1 + 1 ) / 10, q = ( key - XK_F1 + 1 ) % 10; *outbuf++ = '&'; if ( p ) *outbuf++ = '0' + p; *outbuf++ = '0' + q; } else if ( IsUp( key ) ) { *outbuf++ = '&'; *outbuf++ = 'A'; } else if ( IsDown( key ) ) { *outbuf++ = '&'; *outbuf++ = 'B'; } else if ( IsRight( key ) ) { *outbuf++ = '&'; *outbuf++ = 'C'; } else if ( IsLeft( key ) ) { *outbuf++ = '&'; *outbuf++ = 'D'; } else *outbuf++ = key; *outbuf = '\0'; return outbuf - start; } /*************************************** * Converts the objects shortcut string into a string suitable for * setting as the content of the shortcut input object ***************************************/ char * get_shortcut_string( const FL_OBJECT * obj ) { static char tmps[ 127 ]; char *p = tmps; long *sc = obj->shortcut; int n; for ( *p = '\0'; sc && *sc; sc++ ) { if ( *sc >= FL_ALT_MASK ) { *p++ = '#'; n = special_key( *sc - FL_ALT_MASK, p ); p += n; } else if ( *sc == '#' || *sc == '&' || *sc == '^' ) /* prefixed w/ ^ */ { *p++ = '^'; *p++ = *sc; } else if ( *sc < 30 ) { *p++ = '^'; if ( *sc <= 'Z' ) *p++ = 'A' + *sc - 1; else if ( *sc == 27 ) /* Escape */ *p++ = '['; } else if ( *sc > 255 ) { n = special_key( *sc, p ); p += n; } else *p++ = *sc; } *p = '\0'; return tmps; } /*************************************** * Callback for fl_enumerate_fonts() used in intializing the form ***************************************/ static void add_font_choice( const char * p ) { fl_addto_choice( fnts, p ); } /*************************************** * Callback routine for getting a color from the user ***************************************/ void setcolor_cb( FL_OBJECT * obj, long arg FL_UNUSED_ARG ) { int col1 = fl_show_colormap( obj->col1 ); fl_set_object_color( obj, col1, col1 ); readback_attributes( curobj ); } /*************************************** * Validates the name of the object and the callback function ***************************************/ static int validate_attributes( FL_OBJECT * obj ) { FL_OBJECT *o; const char *name, *cn; if ( ! validate_cvar_name( fd_generic_attrib->nameobj, "object name" ) || ! validate_cvar_name( fd_generic_attrib->cbnameobj, "callback" ) ) return 0; name = fl_get_input( fd_generic_attrib->nameobj ); if ( ! name || ! *name ) return 1; /* Make sure the name diesn't clash with its forms name */ if ( ( cn = get_form_name( obj->form ) ) && ! strcmp( name, cn ) ) { fl_show_alert( "Error", "Invalid C identifier:", "Object has same name as the form it belongs to!", 0 ); fl_set_focus_object( fd_generic_attrib->nameobj->form, fd_generic_attrib->nameobj ); return 0; } /* Make sure the name doesn clash with the name of another object in the form it belongs to */ for ( o = obj->form->first; o; o = o->next ) if ( o != obj && ( cn = get_object_c_name( o ) ) && ! strcmp( name, cn ) ) { fl_show_alert( "Error", "Invalid C identifier:", "Object has sam name as another one!", 0 ); fl_set_focus_object( fd_generic_attrib->nameobj->form, fd_generic_attrib->nameobj ); return 0; } return 1; } /*************************************** ***************************************/ void validate_cvar_name_cb( FL_OBJECT * obj, long data ) { validate_cvar_name( obj, data == 0 ? "object name" : "callback" ); } /*************************************** * Checks if the string of an input field is a valid C indentifier ***************************************/ static int validate_cvar_name( FL_OBJECT * obj, const char * w ) { const char *s = fl_get_input( obj ); if ( valid_c_identifier( s ) ) return 1; /* If something's wrong switch to the form with the generic attributs, since there's were the input fields with the name and the callback function are */ fl_set_folder_bynumber( fd_attrib->attrib_folder, 1 ); if ( ! w || ! *w ) fl_show_alert_f( 0, "Error\fInvalid C identifier:\n'%s'", s ); else fl_show_alert_f( 0, "Error\fInvalid C identifier\nfor %s: '%s'", w, s ); fl_set_focus_object( obj->form, obj ); return 0; } /* Check for obvious errors */ #define OK_letter( c ) ( *c == '_' \ || *c == '[' \ || *c == ']' \ || * c== '.' \ || ( *c == ':' && *++c == ':' ) \ || ( *c == '-' && *++c == '>' ) ) /*************************************** ***************************************/ static int valid_c_identifier( const char * s ) { if ( fdopt.lax ) return 1; /* Empty is considered to be valid */ if ( ! s || ! *s || ( *s == ' ' && *( s + 1 ) == '\0' ) ) return 1; if ( ! isalpha( ( unsigned char ) *s ) && *s != '_' ) return 0; for ( s++; *s; s++ ) if ( ! isalnum( ( unsigned char ) *s ) && ! OK_letter( s ) ) return 0; return 1; } /*************************************** ***************************************/ static void copy_shortcut( FL_OBJECT * dest, FL_OBJECT * src ) { if ( src->shortcut ) { size_t i = 0; while ( src->shortcut[ i++ ] ) /* empty */ ; if ( i ) { dest->shortcut = malloc( i * sizeof *dest->shortcut ); memcpy( dest->shortcut, src->shortcut, i * sizeof *dest->shortcut ); } } else dest->shortcut = NULL; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_pixmap.h0000664000175000017500000000253612244217405013556 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifndef SP_PIXMAP_H_ #define SP_PIXMAP_H_ void pixmap_change_type( FL_OBJECT * obj, int new_type ); FL_FORM * pixmap_create_spec_form( void ); void pixmap_adjust_spec_form( FL_OBJECT * obj ); void pixmap_fill_in_spec_form( FL_OBJECT * obj ); void pixmap_reread_spec_form( FL_OBJECT * obj ); void pixmap_restore_spec( FL_OBJECT * obj ); void pixmap_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ); void pixmap_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ); void pixmap_emit_spec_header( FILE * fp, FL_OBJECT * obj ); #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/xpm/0000775000175000017500000000000012353624653012273 500000000000000xforms-1.2.4/fdesign/xpm/Makefile.in0000664000175000017500000002562012353624173014262 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/common.am subdir = fdesign/xpm ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FL_FIXLEVEL = @FL_FIXLEVEL@ FL_REVISION = @FL_REVISION@ FL_VERSION = @FL_VERSION@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIB = @JPEG_LIB@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ TEXI2DVI = @TEXI2DVI@ TEXI2DVI_NEEDS_PDF = @TEXI2DVI_NEEDS_PDF@ TEXI2HTML = @TEXI2HTML@ VERSION = @VERSION@ XMKMF = @XMKMF@ XPM_LIB = @XPM_LIB@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign DISTCLEANFILES = *.orig *.rej *~ *.bak core makelog MAINTAINERCLEANFILES = $(srcdir)/Makefile.in makelog AM_INSTALL_DATA_FLAGS = $(INSTALL) -m 644 -D EXTRA_DIST = allbutton.fd \ bm1.xbm \ bottom.xbm \ box.xpm \ br.xpm \ broken.xpm \ broken.xbm \ butt.xpm \ chart.xpm \ check.xpm \ choice.fd \ choice.xpm \ clock.xpm \ cnt.xpm \ crab_focus.xpm \ crab.xpm \ dial.xpm \ fd_logo.xpm \ frame.xpm \ glcan.xpm \ hcenter.xbm \ left.xbm \ lightb.xpm \ menu.xpm \ misc.fd \ nomail.xbm \ picture1.xbm \ picture.xbm \ porsche.xpm \ pos.xpm \ r3dbut.xpm \ right.xbm \ roundb.xpm \ scb.xpm \ sld.xpm \ tab.xpm \ text.xpm \ timer.xpm \ top.xbm \ twheel.xpm \ val.fd \ vals.xpm \ vcenter.xbm \ xconq1.xpm \ xconq.xpm \ xyplot.xpm all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/common.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign fdesign/xpm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign fdesign/xpm/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/common.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: xforms-1.2.4/fdesign/xpm/timer.xpm0000644000175000017500000000207111665175645014066 00000000000000/* XPM */ static char *timer_pixels[] = { "40 22 2 1", "+ c #040204 g grey1 ", "a c #a4a2a4 g grey63 ", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaa++aaaaaaa+++aaaaa++aaaaaa+++aaaaaa", "aaaaa+++aaaaaa+++++aaaa++aaaaa+++++aaaaa", "aaaaaa++aaaaaa+aa++aaa+++aaaaa+aa++aaaaa", "aaaaaa++aaa++aaaa++aa+a++aaaaaaaa++aaaaa", "aaaaaa++aaa++aaaa+aaa+a++aaaaaaaa+aaaaaa", "aaaaaa++aaaaaaaa+aaa++a++aaaaaaa+aaaaaaa", "aaaaaa++aaaaaaa+aa+a++++++aaaaa+aa+aaaaa", "aaaaaa++aaa++a+++++aaaa++aa++a+++++aaaaa", "aaaaa++++aa++a+++++aaaa++aa++a+++++aaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", }; xforms-1.2.4/fdesign/xpm/chart.xpm0000644000175000017500000000454311665175645014055 00000000000000/* XPM */ static char *chart_pixels[] = { " 55 38 6 1", "` c black", "a c yellow", "b c green", "c c None", "d c magenta", "e c blue", "ccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "ccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "ccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "ccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "ccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "ccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "ccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "ccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "ccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "ccccccccccccccccccc`````````ccccccccccccccccccccccccccc", "ccccccccccccccccccc`aaaaaaa`ccccccccccccccccccccccccccc", "ccccccccccccccccccc`aaaaaaa`ccccccccccccccccccccccccccc", "ccccccccccccccccccc`aaaaaaa`ccccccccccccccccccccccccccc", "ccccccccccccccccccc`aaaaaaa`ccccccc`````````ccccccccccc", "ccccccccccc`````````aaaaaaa`ccccccc`ddddddd`ccccccccccc", "ccccccccccc`bbbbbbb`aaaaaaa`ccccccc`ddddddd`ccccccccccc", "ccccccccccc`bbbbbbb`aaaaaaa`ccccccc`ddddddd`ccccccccccc", "ccccccccccc`bbbbbbb`aaaaaaa`````````ddddddd`ccccccccccc", "ccccccccccc`bbbbbbb`aaaaaaa`eeeeeee`ddddddd`ccccccccccc", "ccccccccccc``````````````````````````````````cccccccccc", "ccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "ccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "ccccc`cc`cccc`cc`cccc`cc`cccc`cc`cccccccccccccccccccccc", "cccccccc`ccccccc`ccccccc`cccccc``cccccc``ccccccc`cccccc", "ccccc`c```c`c`````c`c`````c`c`````c`cc````cccccc`cccccc", "ccccc`cc`c`c```c`c`c```c`c`c```c```c`c```c`cccc``cccccc", "ccccc`cc`c`````c`c`````c`c`````c`c```c`c```ccc````ccccc", "ccccc`cc`c`cc``c`c`cc``c`c`cc````c`ccc`c```ccccc`cccccc", "ccccc`cc`cc````c`c`````c`c```````````c```c`ccccc`cccccc", "ccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "ccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "ccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "ccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "ccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "ccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "ccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "ccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "ccccccccccccccccccccccccccccccccccccccccccccccccccccccc" }; xforms-1.2.4/fdesign/xpm/br.xpm0000644000175000017500000000633511665175645013360 00000000000000/* XPM */ static char *br_pixels[] = { "54 54 6 1", "` c black", "a c None", "b c gray87", "c c #cecece", "d c #282828", "e c gray35", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeaa", "aadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabdaaaaaaaabaa", "aadaaaaa`aaaaaaaaaaaaaaaaaaaaaaaaaaa`aaaabdaaaaeaaabaa", "aadaaaaa```aa`a`a``aa`a`a`aa`aa`a`a``aaaabdaaabeaaabaa", "aadaaaaa`aa`a``a`aa`a`a`a`a`a`a``aaa`aaaabdaaabaeaabaa", "aadaaaaa`aa`a`aa`aa`a`a`a`a```a`aaaa`aaaabdaabaaeaabaa", "aadaaaaa`aa`a`aa`aa`aa`a`aa`aaa`aaaa`aaaabdaabaaaeabaa", "aadaaaaa```aa`aaa``aaa`a`aaa``a`aaaa`aaaabdaeeeeeaabaa", "aadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabdaaaaaaaabaa", "aadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabdacccccaabaa", "aadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabdabaaaadabaa", "aadaaaaa`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabdabaaaadabaa", "aadaaaaa`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa``bdabaaaadabaa", "aadaaaaa```aa`a`a``aa`a`a`aa``aa`aa`a``aabdabaaaadabaa", "aadaaaaa`aa`a``a`aa`a`a`a`a`aaa`a`a``aaaabdabaaaadabaa", "aadaaaaa`aa`a`aa`aa`a`a`a`aa``a```a`aaaa`bdababbadabaa", "aadaaaaa`aa`a`aa`aa`aa`a`aaaa`a`aaa`aaa`abdabaddadabaa", "aadaaaaa```aa`aaa``aaa`a`aa``aaa``a`aa```bdabaaaadabaa", "aadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabdabaaaadabaa", "aadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabdababbadabaa", "aadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabdabaddadabaa", "aadaaaaa`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabdabaaaadabaa", "aadaaaaa`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa``bdabaaaadabaa", "aadaaaaa```aa`a`a``aa`a`a`aa``aa`aa`a`aaabdababbadabaa", "aadaaaaa`aa`a``a`aa`a`a`a`a`aaa`a`a``aa``bdabaddadabaa", "aadaaaaa`aa`a`aa`aa`a`a`a`aa``a```a`aaaaabdabaaaadabaa", "aadaaaaa`aa`a`aa`aa`aa`a`aaaa`a`aaa`aaaaabdabaaaadabaa", "aadaaaaa```aa`aaa``aaa`a`aa``aaa``a`aaa``bdabaaaadabaa", "aadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabdabaaaadabaa", "aadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabdabaaaadabaa", "aadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabdabeeeedabaa", "aadaaaaa`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabdaaaaaaaabaa", "aadaaaaa`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`bdacccccaabaa", "aadaaaaa```aa`a`a``aa`a`a`aa``aa`aa`a`aa`bdaabaaadabaa", "aadaaaaa`aa`a``a`aa`a`a`a`a`aaa`a`a``aa``bdaabaadaabaa", "aadaaaaa`aa`a`aa`aa`a`a`a`aa``a```a`aa```bdaaabadaabaa", "aadaaaaa`aa`a`aa`aa`aa`a`aaaa`a`aaa`aaaa`bdaaabdaaabaa", "aadaaaaa```aa`aaa``aaa`a`aa``aaa``a`aaaa`bdaaaadaaabaa", "aadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabdaaaaaaaabaa", "aabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbaa", "aaeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeaaaaaaaaaaaa", "aadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaa", "aadaaaaaadacccccccccccccccccccccaabaaaaaabaaaaaaaaaaaa", "aadaaaaccdabaaaaaaaaaaaaaaaaaaaadabddaaaabaaaaaaaaaaaa", "aadaaccaadabaaaabdaabdaabdaaaaaadabaaddaabaaaaaaaaaaaa", "aadaeeaaadabaaaabdaabdaabdaaaaaadabaaaeaabaaaaaaaaaaaa", "aadaaaeeadabaaaaaaaaaaaaaaaaaaaadabaeeaaabaaaaaaaaaaaa", "aadaaaaaeaabeeeeeeeeeeeeeeeeeeeedaeeaaaaabaaaaaaaaaaaa", "aadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaa", "aabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }; xforms-1.2.4/fdesign/xpm/scb.xpm0000644000175000017500000000342711665175645013523 00000000000000/* XPM */ static char *scb_pixels[] = { " 60 26 5 1", "` c None", "a c gray87", "b c #cecece", "c c #282828", "d c gray35", "````````````````````````````````````````````````````````````", "````````````````````````````````````````````````````````````", "````````````````````````````````````````````````````````````", "````````````````````````````````````````````````````````````", "````````````````````````````````````````````````````````````", "````````````````````````````````````````````````````````````", "`ddddddddddddddddddddddddddddddddddddddddddddddddddddddddd``", "`c```````````````````````````````````````````````````````a``", "`c`````````bc````````bbbbbbbbbbbbbbbb`````````ac`````````a``", "`c````````bbc````````a```````````````c````````acc````````a``", "`c``````bb``c````````a`ac``ac``ac````c````````a``cc``````a``", "`c````bb````c````````a`ac``ac``ac````c````````a````cc````a``", "`c``bb``````c````````a`ac``ac``ac````c````````a``````cc``a``", "`c`dd```````c````````a`ac``ac``ac````c````````a```````d``a``", "`c```dd`````c````````a`ac``ac``ac````c````````a`````dd```a``", "`c`````dd```c````````a`ac``ac``ac````c````````a```dd`````a``", "`c```````dd`c````````a```````````````c````````a`dd```````a``", "`c`````````d`````````adddddddddddddddc````````dd`````````a``", "`c```````````````````````````````````````````````````````a``", "`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa``", "````````````````````````````````````````````````````````````", "````````````````````````````````````````````````````````````", "````````````````````````````````````````````````````````````", "````````````````````````````````````````````````````````````", "````````````````````````````````````````````````````````````", "````````````````````````````````````````````````````````````" }; xforms-1.2.4/fdesign/xpm/broken.xbm0000664000175000017500000000156212244217405014177 00000000000000#define broken_width 28 #define broken_height 32 static char broken_bits[] = { 0xFF, 0xFF, 0xDF, 0x0F, 0xFF, 0xBE, 0xEF, 0x0F, 0x03, 0x00, 0x10, 0x0F, 0x03, 0x00, 0x40, 0x0F, 0x01, 0x00, 0x00, 0x0E, 0x03, 0x00, 0x20, 0x0C, 0x03, 0x18, 0x00, 0x04, 0x03, 0x74, 0x30, 0x08, 0x03, 0xDB, 0xF0, 0x0F, 0x03, 0xF5, 0xE1, 0x0F, 0x01, 0xEB, 0x60, 0x0C, 0x03, 0xFC, 0x00, 0x0C, 0x03, 0x7E, 0x00, 0x0C, 0x03, 0x3C, 0x02, 0x0C, 0x03, 0x00, 0x7E, 0x0C, 0x03, 0x80, 0xFF, 0x0C, 0x43, 0x00, 0xF3, 0x0C, 0x83, 0x01, 0xFB, 0x0C, 0x83, 0x01, 0xFF, 0x0F, 0x83, 0x8B, 0xFF, 0x0F, 0x83, 0x0A, 0xFF, 0x0C, 0x43, 0x15, 0xFF, 0x0C, 0x81, 0x15, 0x3F, 0x0C, 0x43, 0x6F, 0x3F, 0x0C, 0xC3, 0xFF, 0x3F, 0x0C, 0xC3, 0xFF, 0x3F, 0x0C, 0x03, 0xFF, 0x03, 0x0C, 0x03, 0xFF, 0x03, 0x08, 0xC3, 0xFF, 0x00, 0x0C, 0xC3, 0xFF, 0x00, 0x0C, 0xFF, 0xFF, 0xF7, 0x0F, 0xFF, 0xFF, 0xFF, 0x0F, }; xforms-1.2.4/fdesign/xpm/porsche.xpm0000644000175000017500000001101511665175645014407 00000000000000/* XPM */ static char * porsche[] = { /* porsche pixmap * width height ncolors chars_per_pixel */ "64 64 4 1 ", " c None m None s s_slateblue ", ". c yellow m white s s_yellow ", "r c red m white s s_red ", "b c black m black s s_black ", /* pixels */ " ", " ", " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb............................................bb ", " bb..bbbb..bbbb..bbbb..bbbb..bbbb..b..b..bbbb..bb ", " bb..b..b..b..b..b..b..b..b..b..b..b..b..b.....bb ", " bb..b..b..b..b..b..b..b.....b.....b..b..b.....bb ", " bb..bbbb..b..b..bbb...bbbb..b.....bbbb..bbbb..bb ", " bb..b.....b..b..b..b.....b..b.....b..b..b.....bb ", " bb..b.....b..b..b..b..b..b..b..b..b..b..b.....bb ", " bb..b.....bbbb..b..b..bbbb..bbbb..b..b..bbbb..bb ", " bb............................................bb ", " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb.....................bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb......b...b...bb.....bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb.....b...b...b....b..bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb....bb..bb.bbbbbbb...bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb...bbbbbbbb......bb..bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb..bbbb...............bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb.bbb.................bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb..........b..b.......bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb.....b...b..b........bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb....b...b..b..bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb....b.bbbbbbbbb..............bbbbbbbbbbbbbbbbb ", " bb...bbbb.......bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb..bbb.........b..............bbbbbbbbbbbbbbbbb ", " bb.bbb..........b...bbb........bbbbbbbbbbbbbbbbb ", " bb.........b..b.b..bbbbb.......bbbbbbbbbbbbbbbbb ", " bb.....b..b..b..b..b.bbb.....b.brrrrrrrrrrrrrrbb ", " bb....b..b..b..bb....bbb....bb.brrrrrrrrrrrrrrbb ", " bb...bb.bbbbbbb.b....bbb....bb.brrrrrrrrrrrrrrbb ", " bb..bbbbb......bb...bbbbb...b..brrrrrrrrrrrrrrbb ", " bb.bbb..........b.bbbbbbbbbbb..brrrrrrrrrrrrrrbb ", " bb..............b.b.bbbbbbbbb..brrrrrrrrrrrrrrbb ", " bbbbbbbbbbbbbbbbb.b.b....bbbb..bbbbbbbbbbbbbbbbb ", " bbbbbbbbbbbbbbbbb...b.....b.b..b..............bb ", " bbbbbbbbbbbbbbbbb........bb.bb.b...b..b.......bb ", " bbbbbbbbbbbbbbbb........b..b..b..b..b...b...bb ", " bbbbbbbbbbbbbbbb.......b..b...b.b..b...b....bb ", " bbbbbbbbbbbbbbbbb............b.bbbbbbbbbb...bb ", " bbrrrrrrrrrrrrrrb..........bbbb........bb.bb ", " bbrrrrrrrrrrrrrrrb........bbbb............bb ", " bbrrrrrrrrrrrrrrrbbbbbbbb.......b..b....bb ", " bbrrrrrrrrrrrrrrrrrrbb.....b...b..b..b..bb ", " bbrrrrrrrrrrrrrrrrrbb....b...b..b..b..bb ", " bbrrrrrrrrrrrrrrrrrbb...bb.bbbbbbbb...bb ", " bbbbbbbbbbbbbbbbbbbb...bbbb......bb.bb ", " bbbbbbbbbbbbbbbbbbb..bbb...........b ", " bbbbbbbbbbbbbbbbbbb.bbb...........bb ", " bbbbbbbbbbbbbbbbbb..............bb ", " bbbbbbbbbbbbbbbbb...b.b.b.....bb ", " bbbbbbbbbbbbbbbb..b.b.b..b..bb ", " bbrrrrrrrrrrrbb..bbbbbbb..bb ", " bbrrrrrrrrrrbb.bbb....b.bb ", " bbrrrrrrrrrbb.bb......bb ", " bbbrrrrrrrbb.......bbb ", " bbbbrrrrrbb.....bbbb ", " bbbbrrrbb...bbbb ", " bbbbrbb.bbbb ", " bbbbbbbb ", " bbbb ", " bb ", " " } ; xforms-1.2.4/fdesign/xpm/vals.xpm0000644000175000017500000000404311665175645013714 00000000000000/* XPM */ static char *vals_pixels[] = { "60 30 6 1", "` c black", "a c None", "b c gray87", "c c #cecece", "d c #282828", "e c gray35", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeea", "aadaaaaaaaaaaaaaaaabdaaaaaaaaaaaacccccccccccaaaaaaaaaaaaaaba", "aadaaaaaaaaaaaaaaaabdaaaaaaaaaaaabaaaaaaaaaadaaaaaaaaaaaaaba", "aadaaaaaaaaaaaaaaaabdaaaaaaaaaaaabaaaaaaaaaadaaaaaaaaaaaaaba", "aadaaaa``aaaaa```aabdaaaaaaaaaaaabaaaaaaaaaadaaaaaaaaaaaaaba", "aadaaa`aa`aaaa`aaaabdaaaaaaaaaaaabaaaaaaaaaadaaaaaaaaaaaaaba", "aadaaa`aa`aaaa``aaabdaaaaaaaaaaaabaaaaaaaaaadaaaaaaaaaaaaaba", "aadaaa`aa`aaaaaa`aabdaaaaaaaaaaaabaaaaaaaaaadaaaaaaaaaaaaaba", "aadaaa`aa`aaaaaa`aabdaaaaaaaaaaaabaaaaaaaaaadaaaaaaaaaaaaaba", "aadaaaa``aa`aa``aaabdaaaaaaaaaaaabaaaaaaaaaadaaaaaaaaaaaaaba", "aadaaaaaaaaaaaaaaaabdaaaaaaaaaaaabaaaaaaaaaadaaaaaaaaaaaaaba", "aadaaaaaaaaaaaaaaaabdaaaaaaaaaaaabaaaaaaaaaadaaaaaaaaaaaaaba", "aadaaaaaaaaaaaaaaaabdaaaaaaaaaaaabaaaaaaaaaadaaaaaaaaaaaaaba", "aadaaaaaaaaaaaaaaaabdaaaaaaaaaaaabeeeeeeeeeedaaaaaaaaaaaaaba", "aabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbba", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }; xforms-1.2.4/fdesign/xpm/sld.xpm0000644000175000017500000000345311665175645013535 00000000000000/* XPM */ static char *sld_pixels[] = { "61 26 5 1", "` c None", "a c gray87", "b c #cecece", "c c #282828", "d c gray35", "`````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````", "``ddddddddddddddddddddddddddddddddddddddddddddddddddddddddd``", "``c`````````````````bbbbbbbbbbbbbbbbbbb```````````````````a``", "``c`````````````````a``````````````````c``````````````````a``", "``c`````````````````a```ac``ac``ac`````c``````````````````a``", "``c`````````````````a```ac``ac``ac`````c``````````````````a``", "``c`````````````````a```ac``ac``ac`````c``````````````````a``", "``c`````````````````a```ac``ac``ac`````c``````````````````a``", "``c`````````````````a```ac``ac``ac`````c``````````````````a``", "``c`````````````````a```ac``ac``ac`````c``````````````````a``", "``c`````````````````a```ac``ac``ac`````c``````````````````a``", "``c`````````````````a```ac``ac``ac`````c``````````````````a``", "``c`````````````````a``````````````````c``````````````````a``", "``c`````````````````addddddddddddddddddc``````````````````a``", "``aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa``", "`````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````" }; xforms-1.2.4/fdesign/xpm/butt.xpm0000644000175000017500000000414411665175645013727 00000000000000/* XPM */ static char *butt_pixels[] = { " 65 29 5 1", "` c None", "a c gray87", "b c #cecece", "c c #282828", "d c gray35", "`````````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````````", "``````bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb````````", "``````abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc```````", "``````aa````````````````````````````````````````````````cc```````", "``````aa````````````````````````````````````````````````cc```````", "``````aa````````````````````````````````````````````````cc```````", "``````aa````````````````````````````````````````````````cc```````", "``````aa````````````````````````````````````````````````cc```````", "``````aa````````````````````````````````````````````````cc```````", "``````aa````````````````````````````````````````````````cc```````", "``````aa````````````````````````````````````````````````cc```````", "``````aa````````````````````````````````````````````````cc```````", "``````aa````````````````````````````````````````````````cc```````", "``````aa````````````````````````````````````````````````cc```````", "``````aa````````````````````````````````````````````````cc```````", "``````aa````````````````````````````````````````````````cc```````", "``````aa````````````````````````````````````````````````cc```````", "``````aa````````````````````````````````````````````````cc```````", "``````aa````````````````````````````````````````````````cc```````", "``````aa````````````````````````````````````````````````cc```````", "``````aa````````````````````````````````````````````````cc```````", "``````aa````````````````````````````````````````````````cc```````", "``````aaddddddddddddddddddddddddddddddddddddddddddddddddcc```````", "``````addddddddddddddddddddddddddddddddddddddddddddddddddc```````", "`````````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````````" }; xforms-1.2.4/fdesign/xpm/picture1.xbm0000644000175000017500000000160011665175645014461 00000000000000#define picture1_width 32 #define picture1_height 32 static unsigned char picture1_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x80, 0x01, 0x18, 0x64, 0x6f, 0xf6, 0x26, 0x0a, 0x00, 0x00, 0x50, 0xf2, 0xff, 0xff, 0x4f, 0x14, 0x04, 0x00, 0x28, 0x14, 0x0e, 0x00, 0x28, 0x10, 0x32, 0x00, 0x08, 0x94, 0x03, 0x00, 0x08, 0xf4, 0x04, 0x00, 0x08, 0xb0, 0x08, 0x00, 0x08, 0x34, 0x01, 0x00, 0x28, 0x34, 0x01, 0x00, 0x28, 0x12, 0x00, 0x40, 0x48, 0x12, 0x20, 0xa6, 0x48, 0x14, 0x50, 0x11, 0x29, 0x14, 0x50, 0x48, 0x2a, 0x10, 0x27, 0xac, 0x0e, 0xd4, 0x71, 0xe8, 0x0a, 0x74, 0x20, 0xa8, 0x0a, 0x14, 0x20, 0x00, 0x08, 0x10, 0x50, 0x00, 0x08, 0x14, 0x00, 0x00, 0x28, 0x14, 0x00, 0x00, 0x28, 0xf2, 0xff, 0xff, 0x4f, 0x0a, 0x00, 0x00, 0x50, 0x64, 0x6f, 0xf6, 0x26, 0x18, 0x80, 0x01, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; xforms-1.2.4/fdesign/xpm/crab_focus.xpm0000644000175000017500000000377311665175645015066 00000000000000/* XPM */ static char * crab_focus[] = { /* crab pixmap * width height ncolors chars_per_pixel */ "28 28 6 2 ", ". c None m white s None ", "x c red m black s s_red ", "* c #ff72c2 m black s s_#ff72c2 ", "+ c SteelBlue m white s s_SteelBlue ", "G c black m black s s_black ", "a c LightGrey m white s s_LightGrey ", /* pixels */ ". . . . . . * * * * . . . . . . . . . * * * * . . . . . ", ". . . . + * x x * . . . . . . . . . . + * x x * . . . . ", ". . . + * x x * . . . . . . . . . . . . + * x x * . . . ", ". . + * x * . . . * . . . . . . . . . * . . + * x * . . ", ". . + * x * . . + * . . . . . . . . + * . . + * x * . . ", ". . + * x * . + * * . . . . . . . . + * * . + * x * . . ", ". . + * x * + * * . . . . . . . . . . + * * + * x * . . ", ". . + * x * * * . . . . . . . . . . . . + * * x x * . . ", ". . . + * x * . . + * . . . . . . + * . . + * x * . . . ", ". . . + * x . . + * . + * * . * * . + * . . + x * . . . ", ". . . . + x . . + * . + * * . * * . + * . . + x . . . . ", ". . . . + x . . . + * + * * * * * + * . . . + x . . . . ", ". . . . + * x . . + * * * * * * * * * . . + x * . . . . ", ". . . . . + * x * * * * x x x x x * * * * x * . . . . . ", ". . . . + + + * * x x x x x x x x x x x x * . . . . . . ", ". . + + * x x x x x x x x x x x x x x x x x x * x . . . ", ". + * x x a + * * x x x x x x x x x x x * * a G * x * . ", "+ * x . . . + * * x x x x x x x x x x x * * G . . . x * ", ". . . . . . + * * x x x x x x x x x x x * * . . . . . . ", ". . . . . + * * x x x x x x x x x x x x x * * . . . . . ", ". . . + * x x x * x x x x x x x x x x x * x x x * . . . ", ". . + * x a a + * * x x x x x x x x x * * a a a x * . . ", ". + * x G G G + * * x x x x x x x x x * * a G G G x * . ", ". + * G . . . + * x * x x x x x x x * x * a G . . . * . ", ". . . . . . + * x a * * * x x x * * * a x * G . . . . . ", ". . . . . + * x a G a a * * * * * a a G a x * G . . . . ", ". . . . . + x a G . G G a a a a a G G . G G x a G . . . ", ". . . . . + x a G . . . G G G G G . . . . . x a G . . . " } ; xforms-1.2.4/fdesign/xpm/choice.fd0000644000175000017500000000706711665175645013777 00000000000000Magic: 13000 Internal Form Definition File (do not change) Number of forms: 3 Unit of measure: FL_COORD_PIXEL Border Width: -1 =============== FORM =============== Name: form0 Width: 54 Height: 54 Number of Objects: 6 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 54 54 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BEGIN_GROUP type: 0 box: 0 0 0 0 boxtype: FL_NO_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: grp callback: argument: -------------------- class: FL_TEXT type: NORMAL_TEXT box: 2 2 40 40 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: brower1\nbrowser2\nbrowser3\nbrowser4 shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_SCROLLBAR type: VERT_THIN_SCROLLBAR box: 42 2 10 40 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: slsize: 1.00 -------------------- class: FL_SCROLLBAR type: HOR_THIN_SCROLLBAR box: 2 42 40 10 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: slsize: 1.00 -------------------- class: FL_END_GROUP type: 0 box: 0 0 0 0 boxtype: FL_NO_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: =============== FORM =============== Name: choice Width: 54 Height: 48 Number of Objects: 2 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 54 48 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CHOICE type: NORMAL_CHOICE2 box: 0 10 53 16 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: content: choice value: 1 =============== FORM =============== Name: menu Width: 54 Height: 38 Number of Objects: 2 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 54 38 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_MENU type: PULLDOWN_MENU box: 4 2 46 18 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Menu shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: ============================== create_the_forms xforms-1.2.4/fdesign/xpm/choice.xpm0000644000175000017500000000560511665175645014206 00000000000000/* XPM */ static char *choice_pixels[] = { "54 48 6 1", "` c black", "a c None", "b c gray87", "c c #cecece", "d c #282828", "e c gray35", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "ccccccccccccccccccccccccccccccccccccccccccccccccccccaa", "baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaada", "baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaada", "baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaada", "baaaaaaaaaa`aaaaaaaaaaa`aaaaaaaaaaaaaaaaaaaaaaaaaaaada", "baaaaaaaaaa`aaaaaaaaaaaaaaaaaaaaaaaaaccccccccccccaaada", "baaaaaa``aa`a``aaa```aa`aa``aaa``aaaabaaaaaaaaaaadaada", "baaaaa`aa`a``aa`a`aaa`a`a`aa`a`aa`aaabaaaaaaaaaaadaada", "baaaaa`aaaa`aaa`a`aaa`a`a`aaaa````aaabaaaaaaaaaaadaada", "baaaaa`aaaa`aaa`a`aaa`a`a`aaaa`aaaaaabaaaaaaaaaaadaada", "baaaaa`aa`a`aaa`a`aaa`a`a`aa`a`aa`aaabeeeeeeeeeeedaada", "baaaaaa``aa`aaa`aa```aa`aa``aaa``aaaaaaaaaaaaaaaaaaada", "baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaada", "baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaada", "baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaada", "beeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeda", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }; xforms-1.2.4/fdesign/xpm/check.xpm0000644000175000017500000000354211665175645014027 00000000000000/* XPM */ static char *check_pixels[] = { "51 31 5 1 ", "` c None m None ", "a c gray87 m black ", "b c #cecece m black ", "c c #282828 m black ", "d c gray35 m black ", "```````````````````````````````````````````````````", "```````````````````````````````````````````````````", "```````````````````````````````````````````````````", "```````````````````````````````````````````````````", "```````````````````````````````````````````````````", "```````````````````````````````````````````````````", "```````````````````````````````````````````````````", "```````````````````````````````````````````````````", "```````````````````````````````````````````````````", "```````````````ab``````````````````````````````````", "``````````````aabb`````````````````````````````````", "`````````````aa``bb````````````````````````````````", "````````````aa````bb```````````````````````````````", "```````````aa``````bb``````````````````````````````", "``````````aa````````bb`````````````````````````````", "`````````dd``````````cc````````````````````````````", "``````````dd````````cc`````````````````````````````", "```````````dd``````cc``````````````````````````````", "````````````dd````cc```````````````````````````````", "`````````````dd``cc````````````````````````````````", "``````````````ddcc`````````````````````````````````", "```````````````dc``````````````````````````````````", "```````````````````````````````````````````````````", "```````````````````````````````````````````````````", "```````````````````````````````````````````````````", "```````````````````````````````````````````````````", "```````````````````````````````````````````````````", "```````````````````````````````````````````````````", "```````````````````````````````````````````````````", "```````````````````````````````````````````````````", "```````````````````````````````````````````````````" }; xforms-1.2.4/fdesign/xpm/frame.xpm0000644000175000017500000000417211665175645014044 00000000000000/* XPM */ static char *frame_pixels[] = { "55 34 6 1", "` c black", "a c None", "b c gray87", "c c #cecece", "d c #282828", "e c gray35", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaa````aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaa`aaa`a```aa````aaa`aaaaaaaaaaaaaaaaaaaaaa", "aaeeeeeeeaaaaa```a``aaa`a`a`a`a`a`aaaeeeeeeeeeeeeeeeeea", "aadccccccaaaaa`aaa`aa```a`a`a`a```aaacccccccccccccccaba", "aadbaaaaaaaaaa`aaa`aa`a`a`a`a`a`aaaaaaaaaaaaaaaaaaaadba", "aadbaaaaaaaaaa`aaa`aa``a``a`a`aa``aaaaaaaaaaaaaaaaaadba", "aadbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadba", "aadbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadba", "aadbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadba", "aadbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadba", "aadbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadba", "aadbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadba", "aadbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadba", "aadbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadba", "aadbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadba", "aadbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadba", "aadbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadba", "aadbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadba", "aadbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadba", "aadbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadba", "aadbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadba", "aadbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadba", "aadbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadba", "aadbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadba", "aadbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadba", "aadbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadba", "aadbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadba", "aadbeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeedba", "aabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbba", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }; xforms-1.2.4/fdesign/xpm/menu.xpm0000644000175000017500000000436511665175645013722 00000000000000/* XPM */ static char *menu_pixels[] = { "54 38 2 1", "` c black", "a c None", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaa``aaaaa``aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaa```aaa```aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaa```aaa```aa```aa`a``aa``a``aaaaaaaaaaaaaa", "aaaaaaaaaaaaa````a````a``a``a``a``a``a``aaaaaaaaaaaaaa", "aaaaaaaaaaaaa``a`a`a``a`````a``a``a``a``aaaaaaaaaaaaaa", "aaaaaaaaaaaaa``a```a``a``aaaa``a``a``a``aaaaaaaaaaaaaa", "aaaaaaaaaaaaa``aa`aa``a``a``a``a``a``a``aaaaaaaaaaaaaa", "aaaaaaaaaaaaa``aa`aa``aa```aa``a``aa``a`aaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }; xforms-1.2.4/fdesign/xpm/lightb.xpm0000644000175000017500000000415111665175645014220 00000000000000/* XPM */ static char *lightb_pixels[] = { "65 29 6 1 ", "` c None ", "a c gray87 ", "b c #cecece", "c c blue ", "d c #282828", "e c gray35", "`````````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````````", "````bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb`````````", "````abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbd````````", "````aa`````````````````````````````````````````````````dd````````", "````aa`````````````````````````````````````````````````dd````````", "````aa`````````````````````````````````````````````````dd````````", "````aa```eeeeeeee``````````````````````````````````````dd````````", "````aa```deeeeeea``````````````````````````````````````dd````````", "````aa```ddccccaa``````````````````````````````````````dd````````", "````aa```ddccccaa``````````````````````````````````````dd````````", "````aa```ddccccaa``````````````````````````````````````dd````````", "````aa```ddccccaa``````````````````````````````````````dd````````", "````aa```ddccccaa``````````````````````````````````````dd````````", "````aa```ddccccaa``````````````````````````````````````dd````````", "````aa```ddccccaa``````````````````````````````````````dd````````", "````aa```ddccccaa``````````````````````````````````````dd````````", "````aa```ddccccaa``````````````````````````````````````dd````````", "````aa```ddccccaa``````````````````````````````````````dd````````", "````aa```ddaaaaaa``````````````````````````````````````dd````````", "````aa```aaaaaaaa``````````````````````````````````````dd````````", "````aa`````````````````````````````````````````````````dd````````", "````aa`````````````````````````````````````````````````dd````````", "````aa`````````````````````````````````````````````````dd````````", "````aaeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeedd````````", "````aeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed````````", "`````````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````````" }; xforms-1.2.4/fdesign/xpm/clock.xpm0000644000175000017500000000455012246713464014036 00000000000000/* XPM */ static char *clock_pixels[] = { "55 38 6 1", "` c None", "a c gray87", "b c #cecece", "c c #282828", "d c #6d6d6d", "e c gray35", "```````````````````````````````````````````````````````", "````````````````````````````b``````````````````````````", "```````````````````````bbbbbbbbbbb`````````````````````", "````````````````````bbbbbbbbdbbbbbbbb``````````````````", "``````````````````bbbbbddddaddddddbbbbb````````````````", "`````````````````bbbbdddddddddddddddbbbb```````````````", "````````````````bbbdadddddddddddddadddbbb``````````````", "```````````````bbbdddddddddddddddddddddbee`````````````", "``````````````bbadddddddddddddddddddddddeee````````````", "`````````````bbbdadddddadddddddddddddddddeee```````````", "`````````````bbdddaadddaadddddddddddddddddee```````````", "````````````bbddaddcadddacddddddddddddaddddee``````````", "````````````bbddddddcaddaacddddddddddddddddee``````````", "```````````bbbddddddddadaacdddddddddaaaadddeee`````````", "```````````bbddddddddddaaeacddaaaaaaaaddddddee`````````", "```````````bbdddddddddddcaaaaaeaaaadddccccddee`````````", "```````````bbdddddddddddaaaaaaadccccccccddddee`````````", "```````````bbdadddddddddddaaaccccccccdddadddee`````````", "```````````bbdddddddddddddcacccccdddddddddddee`````````", "```````````bbdddddddddddddddcccdddddddddddddee`````````", "```````````bbddddddddddddddddcddddddddddddddee`````````", "```````````bbdddddddddddddddddddddddddddddddee`````````", "```````````bbdddddddddddddddddddddddddddddddee`````````", "```````````bbdddddddddddddddddddddddddddddddee`````````", "```````````bbbddadddddddddddddddddddddaddddeee`````````", "````````````bbdddddddddddddddddddddddddddddee``````````", "````````````bbdddddddddddddddddddddddddddddee``````````", "`````````````bbdddddddddddddddddddddddddddee```````````", "`````````````bbbdddddadddddddddddadddddddeee```````````", "``````````````bbbdddddddddddddddddddddddeee````````````", "```````````````bbedddddddddadddddddddddeee`````````````", "````````````````eeedddddddddddddddddddeee``````````````", "`````````````````eeeedddddddddddddddeeee```````````````", "``````````````````eeeeedddddddddddeeeee````````````````", "````````````````````eeeeeeeeeeeeeeeee``````````````````", "```````````````````````eeeeeeeeeee`````````````````````", "```````````````````````````````````````````````````````", "```````````````````````````````````````````````````````" }; xforms-1.2.4/fdesign/xpm/xconq.xpm0000644000175000017500000000254011665175645014077 00000000000000/* XPM */ static char * xconq [] = { "32 32 5 1", " s None c None g4 None", ". m black c black g4 black", "X m white c SkyBlue g4 grey80", "o m white c LightGray g4 grey50", "O m white c OliveDrab g4 grey40", " ", " . ", " ..X.. ", " ..XXXXX.. ", " ..XXXXXXXXX.. ", " ..XXXXXXXXXXXXX.. ", " ..XXXXXXXXXXXXXXXXX.. ", " ..XXXXXXXXXXXXXXXXXXXXX.. ", " ..XXXXXXXXXXXXXXXXX.XXXXXXX.. ", " .XXXXXXXXXXXXXXXXXXX.XXXXXXXX. ", " .XXXXXXXXXXXXXXXXX.X.XXXXXXXX. ", " .XXXXXXXXXXXXXXXXX.X.XXXXXXXX. ", " .XXXXXXXXXXXXXXXXX.X.XXXXXXXX. ", " .XXXXXXXXXXXX..........XXXXXX. ", " .XXXXXXXXXX...oooooooo.XXXXXX. ", " .X..........ooooooooo..XXXXXX. ", " .XXXXXXXXXX.................X. ", " .XXXXXXX...............oooo.X. ", " .XXXXXX..oooooooooooooooooo.X. ", " .XXXXXX....................XX. ", " .XXXXXXX..o.o.o.o.o.o.oo..XXX. ", " .XXXXXXXX................XXXX. ", " .............................. ", " .OOOOOOOOOOOOOOOOOOOOOOOOOOOO. ", " ..OO.O.O.O.O.O.O.O.O.O.O.O.OO. ", " ..O.O.O.O.O.O.O.O.O.O.O.O.. ", " ..OO.O.O.O.O.O.O.O.OO.. ", " ..O.O.O.O.O.O.O.O.. ", " ..OO.O.O.O.OO.. ", " ..O.O.O.O.. ", " ..OOO.. ", " ... "}; xforms-1.2.4/fdesign/xpm/nomail.xbm0000644000175000017500000000640711665175645014216 00000000000000#define nomail_width 64 #define nomail_height 64 static unsigned char nomail_bits[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x70, 0x38, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x0e, 0xc0, 0x00, 0x00, 0x80, 0x01, 0x00, 0xc0, 0x01, 0x00, 0x01, 0x00, 0x80, 0x01, 0x00, 0x38, 0x00, 0x00, 0x02, 0x00, 0x80, 0x01, 0x00, 0x06, 0x00, 0x00, 0x04, 0x00, 0x80, 0x01, 0xc0, 0x1f, 0x00, 0x00, 0x04, 0x00, 0x80, 0x01, 0x30, 0x60, 0x00, 0x00, 0x08, 0x00, 0x80, 0x01, 0x08, 0x80, 0x00, 0x00, 0x08, 0x00, 0x80, 0x01, 0x04, 0x07, 0x01, 0x00, 0x10, 0x00, 0x80, 0x01, 0x82, 0x0f, 0x02, 0x00, 0x10, 0x00, 0x80, 0x01, 0x82, 0x0f, 0x02, 0x00, 0x10, 0x00, 0x80, 0x01, 0x01, 0x07, 0x04, 0x00, 0x20, 0x00, 0x80, 0x01, 0x01, 0x00, 0x04, 0x00, 0x20, 0x00, 0x80, 0x81, 0x00, 0x00, 0x08, 0x00, 0x26, 0x00, 0x80, 0x81, 0x00, 0x00, 0x08, 0x80, 0x27, 0x00, 0x80, 0x81, 0x00, 0x00, 0x08, 0xe0, 0x27, 0x00, 0x80, 0x81, 0x22, 0xa2, 0x08, 0xd8, 0x27, 0x00, 0x80, 0x41, 0x36, 0xa5, 0x10, 0xc6, 0x27, 0x00, 0x80, 0x41, 0xaa, 0xa8, 0x90, 0xc1, 0x27, 0x00, 0x80, 0x41, 0xaa, 0xaf, 0x90, 0xc1, 0x27, 0x00, 0x80, 0x41, 0xa2, 0xa8, 0x10, 0xc0, 0x27, 0x00, 0x80, 0x41, 0xa2, 0xa8, 0x17, 0xc0, 0x21, 0x00, 0x80, 0x41, 0x00, 0x00, 0x10, 0x40, 0x20, 0x00, 0x80, 0x41, 0x00, 0x00, 0x10, 0x00, 0x20, 0x00, 0x80, 0x41, 0xfe, 0xff, 0x17, 0x00, 0x20, 0x00, 0x80, 0x41, 0x00, 0x00, 0x10, 0x00, 0x30, 0x00, 0x80, 0x41, 0xfe, 0xff, 0x17, 0x00, 0x3c, 0x0e, 0x80, 0x41, 0x00, 0x00, 0x10, 0x00, 0x0f, 0x11, 0x80, 0x41, 0x00, 0x00, 0x10, 0xc0, 0x1b, 0x11, 0x80, 0x41, 0x00, 0x00, 0x10, 0xf0, 0xe4, 0x10, 0x80, 0x41, 0x00, 0x00, 0x10, 0x3c, 0x84, 0x08, 0x80, 0x41, 0x00, 0x00, 0x10, 0x0f, 0x88, 0x3c, 0x80, 0x41, 0x00, 0x00, 0xd0, 0x03, 0xf0, 0x43, 0x80, 0x41, 0x00, 0x00, 0xf0, 0x01, 0x8c, 0x43, 0x80, 0xc1, 0xff, 0xff, 0x3f, 0x01, 0x82, 0x24, 0x80, 0xc1, 0xff, 0xff, 0x1f, 0x01, 0x82, 0x18, 0x80, 0x01, 0x00, 0x02, 0x02, 0x01, 0xfc, 0x08, 0x80, 0x01, 0x00, 0x02, 0x02, 0x01, 0x20, 0x09, 0x80, 0x01, 0x00, 0x02, 0x02, 0x01, 0x10, 0x06, 0x80, 0x01, 0x00, 0x02, 0x02, 0x01, 0x10, 0x00, 0x80, 0x01, 0x00, 0x02, 0x02, 0x01, 0x08, 0x00, 0x80, 0x01, 0x00, 0x02, 0x02, 0x01, 0x08, 0x00, 0x80, 0x01, 0x00, 0x02, 0x02, 0x01, 0xb4, 0x3f, 0x80, 0x01, 0x00, 0x02, 0x02, 0x01, 0x0e, 0x28, 0x80, 0x01, 0x00, 0x02, 0x02, 0x01, 0x03, 0x16, 0x80, 0x01, 0x00, 0x02, 0x02, 0x81, 0xc0, 0x11, 0x80, 0x01, 0x00, 0x02, 0x02, 0x41, 0x38, 0x08, 0x80, 0x01, 0x00, 0x02, 0x02, 0x21, 0x04, 0x04, 0x80, 0x01, 0x00, 0x02, 0x02, 0x11, 0x03, 0x02, 0x80, 0x01, 0x00, 0x02, 0x02, 0xc9, 0x80, 0x01, 0x80, 0x01, 0x00, 0x02, 0x02, 0x25, 0x60, 0x00, 0x80, 0x01, 0x00, 0x02, 0x02, 0x13, 0x18, 0x00, 0x80, 0x01, 0x00, 0x02, 0x02, 0x01, 0x07, 0x00, 0x80, 0x01, 0x00, 0x02, 0xc2, 0xfe, 0x00, 0x00, 0x80, 0x01, 0x00, 0x02, 0x32, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x02, 0x0e, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xfe, 0x03, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; xforms-1.2.4/fdesign/xpm/broken.xpm0000664000175000017500000001057012237430066014216 00000000000000/* XPM */ static char *broken[] = { /* columns rows colors chars-per-pixel */ "28 32 153 2 ", " c black", ". c #070E07", "X c #0D0D0D", "o c #001400", "O c #001A00", "+ c #1D1D1D", "@ c #000035", "# c #00003C", "$ c #3B003C", "% c #232523", "& c #292629", "* c #2C2C2C", "= c #213621", "- c #213D21", "; c #333333", ": c #3B3C36", "> c #3D3D3D", ", c #4A003A", "< c #005D00", "1 c #095109", "2 c #006000", "3 c #096709", "4 c #000040", "5 c #2E2E5A", "6 c #000079", "7 c #592A59", "8 c #424242", "9 c #4D4D4D", "0 c #4D524D", "q c #535052", "w c #5F5F5F", "e c #64645F", "r c #606060", "t c #6D746D", "y c #737373", "u c #7B7B7B", "i c #ED0032", "p c #F12C26", "a c #F61C4A", "s c #F42149", "d c #F8204C", "f c #F12657", "g c #FF0069", "h c #E54E49", "j c #E4544B", "k c #E45450", "l c #DB6C76", "z c #DC6C78", "x c #008600", "c c #008E00", "v c #009600", "b c #009C00", "n c #218221", "m c #2B8B2B", "M c #21A421", "N c #00CE00", "B c #00D200", "V c #09D009", "C c #529A52", "Z c #6D8B6D", "A c #6DAC6D", "S c #00008F", "D c #0000B1", "F c #0000BF", "G c #0010B6", "H c #2E2EBE", "J c #000CFF", "K c #0010FF", "L c #0033E7", "P c #0033EB", "I c #002EFF", "U c #0031FF", "Y c #2C27F0", "T c #2E2BF1", "R c #5353E6", "E c #BF00BF", "W c #BE2BBE", "Q c #CB009B", "! c #FC0997", "~ c #FE089A", "^ c #BF00C2", "/ c #FF00CE", "( c #FF00D4", ") c #F02AC2", "_ c #FF00F2", "` c #FF00FE", "' c #EF2DF3", "] c #EF2EF8", "[ c #F32DF2", "{ c #0097FF", "} c #009AFD", "| c #838383", " . c #848884", ".. c #8E8E8E", "X. c #908E90", "o. c #9E8F9E", "O. c #939293", "+. c #91919E", "@. c #9B9B9B", "#. c #A09E9D", "$. c #90AE90", "%. c #9EB49E", "&. c #9191A0", "*. c #9191BF", "=. c #A09DA0", "-. c #BE90BE", ";. c #A3A3A2", ":. c #ACACAC", ">. c #A0B5A0", ",. c #A0B8A0", "<. c #B0B0AE", "1. c #B4B4B5", "2. c #B6BDB6", "3. c #BABAB6", "4. c #BEBEBE", "5. c #CF918D", "6. c #CF8D9D", "7. c #CB9C9A", "8. c #CAA19D", "9. c #CDA1A0", "0. c #C3B4B3", "q. c #C2B9B7", "w. c #C6BAB9", "e. c #C4C4BF", "r. c #918ECF", "t. c #9191C0", "y. c #9190CF", "u. c #928FD0", "i. c #9291D1", "p. c #A0A0CF", "a. c #BCBCCB", "s. c #CE8FC0", "d. c #CF90CF", "f. c #CE90D1", "g. c #C0BFC0", "h. c #BEC3C3", "j. c #BEC8C8", "k. c #C2C2C2", "l. c #C4C8C7", "z. c #C7C5C8", "x. c #C0C9C9", "c. c #CBCBCB", "v. c #D3D4D3", "b. c #D3D8D5", "n. c #DBDBDB", "m. c #E4E4E4", "M. c #EDEDEC", "N. c #F6F6F6", "B. c #F5F9F5", "V. c #F8F7F8", "C. c #F5F8F8", "Z. c #FDFDFD", "A. c None", /* pixels */ " + r | A.A.A.A.A.A.", " X * > > > > > > > > > > > > > > > > 9 y | A.A.A.A.A.A.", " * X.w.a.k.k.h.g.g.g.g.k.g.g.k.e.a.k.<.X.u u u A.A.A.A.", " > l.Z.B.N.N.N.V.V.V.V.V.V.N.N.N.N.N.n.@.| @.@.A.A.A.A.", " > h.Z.m.v.v.v.v.v.v.v.v.v.v.v.v.v.v.4.X.@.c.c.@.u A.A.", " > h.N.v.3.4.w.g.3.>.$.$.%.3.k.k.3.g.:...;.M.M.3.@.A.A.", " > h.N.v.4.4.k.z.>.C m m C >.z.k.k.k.:...;.m.Z.M.v.@.| ", " > w.N.v.4.h.2.>.A M v x n Z =.1.k.k.:.y y ;.k.k.;.u r ", " > k.N.v.g.g.>.C M V N b 3 - q #.k.l.@.8 % ; : > ; & + ", " > a.N.v.g.z.$.m c N B b < o & O.z.k.@.0 & & * ; & X ", " > e.N.v.g.k.$.m x b b c < o & X.k.l.1.@.X...@.3.X.* ", " : e.N.v.g.k.%.C n 3 < 2 1 = q #.z.e.e.z.z.l.n.Z.k.> ", " > h.N.v.4.g.2.,.Z - o O = t ;.q.e.e.e.e.z.z.n.Z.k.> ", " > k.N.v.4.h.k.z.=.q * * q =.a.p.y.y.y.y.*.O.<.M.c.9 ", " > k.N.v.4.h.k.k.3.@.X.O.#.3.p.R T T T T H 5 r c.M.A.A.", " > 4.N.v.0.7.7.q.k.l.z.l.l.e.r.T J I U K F @ : e.Z.A.A.", " > h.C.v.7.h h 7.j.x.k.l.k.e.r.Y I { } U F @ : e.Z.A.A.", " > 4.B.v.6.f a z 8.q.h.e.e.e.y.T U } } L D # > l.Z.A.A.", " > h.B.b.s.) ! s j 8.j.k.e.e.y.T K U L G S A.A.A.A.A.A.", " > 4.B.b.f.] / g s l 8.q.k.l.t.H F F D S 6 A.A.A.A.A.A.", " > k.B.b.d.' _ / ! s j 8.x.x.&.5 # # 4 A.A.A.A.Z.k.> ", " > 4.B.b.d.' ` ` ( g s z 9.w.@.: A.A.A.A.Z.k.> ", " > k.B.b.d.[ ` ` ` ( ~ d k 8.1.A.A.A.A.A.A.w.v.V.k.> ", " : h.B.b.-.W E E ^ ^ Q i p 5.x.A.A.A.A.A.A.h.v.N.w.> ", " > a.B.b.o.7 $ $ $ $ , A.A.A.A.A.A.A.A.A.A.4.v.N.h.> ", " > k.V.b.@.0 % . A.A.A.A.A.A.A.A.A.A.3.v.N.h.> ", " > k.N.v.1.@. .A.A.A.A.A.A.A.A.A.A.w.4.a.3.4.v.N.h.> ", " > k.Z.n.c.z.z.A.A.A.A.A.A.A.A.A.A.b.v.v.v.v.m.V.k.> ", " > l.Z.B.M.A.A.A.A.A.A.A.A.A.A.Z.Z.V.N.N.N.N.C.Z.l.> ", " * X.c.M.Z.A.A.A.A.A.A.A.A.A.A.k.k.h.k.h.k.h.w.w.X.* ", " X * 9 A.A.A.A.A.A.A.A.A.A.A.A.8 > > > > > > > > * X ", " A.A.A.A.A.A.A.A.A.A.A.A. " }; xforms-1.2.4/fdesign/xpm/vcenter.xbm0000644000175000017500000000071211665175645014376 00000000000000#define vcenter_width 20 #define vcenter_height 20 static char vcenter_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x80, 0x1f, 0x00, 0x9f, 0x1f, 0x00, 0x9f, 0x9f, 0x0f, 0x9f, 0x9f, 0x0f, 0x9f, 0x9f, 0x0f, 0x9f, 0x9f, 0x0f, 0x9f, 0x9f, 0x0f, 0x9f, 0x9f, 0x0f, 0x9f, 0x1f, 0x00, 0x80, 0x1f, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; xforms-1.2.4/fdesign/xpm/fd_logo.xpm0000644000175000017500000000454511665175645014367 00000000000000/* XPM */ static char *fd_logo_pixels[] = { /* fd logo * width height ncolors chars_per_pixel */ "64 32 4 1 ", "b c None m None", "` c #ff6144 m White", "a c #cecece m None", "c c #282828 m None", /* pixels */ "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "bbbbbbbbbbbbaaaaaaaabbaaaaabbaaaaaaabbaaaabbbaaaabbbbbbbbbbbbbbb", "bbbbbbbbbbbba```````caa````cba``````cba```cbaa```cbbbbbbbbbbbbbb", "bbbbbbbbbbbbbc``cc``ca``cc``cbc``cc``cbc```ca```ccbbbbbbbbbbbbbb", "bbbbbbbbbbbbba``cac`c``ccbc``ca``ca``cba```ca```cbbbbbbbbbbbbbbb", "bbbbbbbbbbbbba``c`ccc``cbba``ca``ca``cba```c`c``cbbbbbbbbbbbbbbb", "bbbbbbbbbbbbba````cba``cbba``ca`````ccba`c```c``cbbbbbbbbbbbbbbb", "bbbbbbbbbbbbba``c`cba``cbba``ca``c``cbba`c```c``cbbbbbbbbbbbbbbb", "bbbbbbbbbbbbba``cccba``cbaa``ca``cc``cba`cc`cc``cbbbbbbbbbbbbbbb", "bbbbbbbbbbbbaa``cbbbbc``ca``cca``cac``ca`ca`ca``cbbbbbbbbbbbbbbb", "bbbbbbbbbbbba````cbbbbc````cca````c```````ccc````cbbbbbbbbbbbbbb", "bbbbbbbbbbbbbcccccbbbbbcccccbbcccccccccccccbbcccccbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "aaaaaabbaaaaaaaabaaaaaaaaaaabbaaaaaabaaaabaaaaaaaaaaaaaaaaaaabbb", "``````cba```````ca`````c````caa```c`ca```ca```c```````c``````cbb", "c``cc``cbc``cc``c``cc``cc``cca``cc``cbc```cc`ccc``cc``cc``cc``cb", "a``cbc``ca``cac`c``cbc`ca``ca``ccbc`cba```ca`cba``cac`ca``ca``cb", "a``cba``ca``c`ccc```cacca``ca``cbbbccba`c``c`cba``c`ccca``ca``cb", "a``cba``ca````cbbc````cba``ca``caaaaaba`c``c`cba````cbba`````ccb", "a``cba``ca``c`caaacc```ca``ca``ca````ca`cc```cba``c`caba``c``cbb", "a``caa``ca``ccc`c`cbc``ca``ca``cbc``cca`ca```cba``ccc`ca``cc``cb", "a``ca``cca``ca``c``ca``ca``cbc``ca``caa`cbc``caa``ca``ca``cac``c", "``````cca```````c`````cc````cbc````cca```cbc`ca```````c````c````", "cccccccbbccccccccccccccbcccccbbcccccbbccccbbccbccccccccccccccccc", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" }; xforms-1.2.4/fdesign/xpm/misc.fd0000644000175000017500000000423111665175645013466 00000000000000Magic: 13000 Internal Form Definition File (do not change) Number of forms: 2 Unit of measure: FL_COORD_PIXEL Border Width: -1 =============== FORM =============== Name: form0 Width: 59 Height: 35 Number of Objects: 4 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 59 35 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: NO_BOX box: 3 2 18 10 boxtype: FL_NO_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_TIMES_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: A shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: UP_BOX box: 2 10 55 23 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: NO_BOX box: 21 2 19 8 boxtype: FL_NO_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_TIMES_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: B shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: =============== FORM =============== Name: xy Width: 54 Height: 30 Number of Objects: 2 -------------------- class: FL_BOX type: BORDER_BOX box: 0 0 54 30 boxtype: FL_BORDER_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_XYPLOT type: NORMAL_XYPLOT box: 0 0 55 30 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: xtics: -1 2 ytics: -1 2 ============================== create_the_forms xforms-1.2.4/fdesign/xpm/crab.xpm0000644000175000017500000000377311665175645013667 00000000000000/* XPM */ static char * crab[] = { /* crab pixmap * width height ncolors chars_per_pixel */ "28 28 6 2 ", ". c None m white s None ", "x c orange m black s s_orange ", "* c #ff72c2 m black s s_#ff72c2 ", "+ c SteelBlue m white s s_SteelBlue ", "G c black m black s s_black ", "a c LightGrey m white s s_LightGrey ", /* pixels */ ". . . . . . * * * * . . . . . . . . . * * * * . . . . . ", ". . . . + * x x * . . . . . . . . . . + * x x * . . . . ", ". . . + * x x * . . . . . . . . . . . . + * x x * . . . ", ". . + * x * . . . * . . . . . . . . . * . . + * x * . . ", ". . + * x * . . + * . . . . . . . . + * . . + * x * . . ", ". . + * x * . + * * . . . . . . . . + * * . + * x * . . ", ". . + * x * + * * . . . . . . . . . . + * * + * x * . . ", ". . + * x * * * . . . . . . . . . . . . + * * x x * . . ", ". . . + * x * . . + * . . . . . . + * . . + * x * . . . ", ". . . + * x . . + * . + * * . * * . + * . . + x * . . . ", ". . . . + x . . + * . + * * . * * . + * . . + x . . . . ", ". . . . + x . . . + * + * * * * * + * . . . + x . . . . ", ". . . . + * x . . + * * * * * * * * * . . + x * . . . . ", ". . . . . + * x * * * * x x x x x * * * * x * . . . . . ", ". . . . + + + * * x x x x x x x x x x x x * . . . . . . ", ". . + + * x x x x x x x x x x x x x x x x x x * x . . . ", ". + * x x a + * * x x x x x x x x x x x * * a G * x * . ", "+ * x . . . + * * x x x x x x x x x x x * * G . . . x * ", ". . . . . . + * * x x x x x x x x x x x * * . . . . . . ", ". . . . . + * * x x x x x x x x x x x x x * * . . . . . ", ". . . + * x x x * x x x x x x x x x x x * x x x * . . . ", ". . + * x a a + * * x x x x x x x x x * * a a a x * . . ", ". + * x G G G + * * x x x x x x x x x * * a G G G x * . ", ". + * G . . . + * x * x x x x x x x * x * a G . . . * . ", ". . . . . . + * x a * * * x x x * * * a x * G . . . . . ", ". . . . . + * x a G a a * * * * * a a G a x * G . . . . ", ". . . . . + x a G . G G a a a a a G G . G G x a G . . . ", ". . . . . + x a G . . . G G G G G . . . . . x a G . . . " } ; xforms-1.2.4/fdesign/xpm/cnt.xpm0000644000175000017500000000374511665175645013543 00000000000000/* XPM */ static char *cnt_pixels[] = { "64 27 7 1", "` c black", "a c None", "b c gray87", "c c #cecece", "d c blue", "e c #282828", "f c gray35", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "cccccccccacccccccccafffffffffffffffffffffffcccccccccacccccccccaa", "baaaaaaaaebaaaaaaaaeeaaaaaaaaaaaaaaaaaaaaabbaaaaaaaaebaaaaaaaaea", "baaaaaaaaebaaaaaaaaeeaaaaaaaaaaaaaaaaaaaaabbaaaaaaaaebaaaaaaaaea", "baaaaaaaaebaaaaaaaaeeaaaaaaaaaaaaaaaaaaaaabbaaaaaaaaebaaaaaaaaea", "baaaaaaaaebaaaaaaaaeeaaaaaa``aaaaa``aaaaaabbaaaaaaaaebaaaaaaaaea", "baaa``aaaebaaaaa`aaeeaaaaa`aa`aaaaaa`aaaaabbaaa`aaaaebaa``aaaaea", "baa```aaaebaaaa``aaeeaaaaa`aa`aaaa``aaaaaabbaaa``aaaebaa```aaaea", "ba`d``aaaebaaa`d`aaeeaaaaa`aa`aaaaaa`aaaaabbaaa`d`aaebaa``d`aaea", "baa```aaaebaaaa``aaeeaaaaa`aa`aaaaaa`aaaaabbaaa``aaaebaa```aaaea", "baaa``aaaebaaaaa`aaeeaaaaaa``aa`aa``aaaaaabbaaa`aaaaebaa``aaaaea", "baaaaaaaaebaaaaaaaaeeaaaaaaaaaaaaaaaaaaaaabbaaaaaaaaebaaaaaaaaea", "baaaaaaaaebaaaaaaaaeeaaaaaaaaaaaaaaaaaaaaabbaaaaaaaaebaaaaaaaaea", "baaaaaaaaebaaaaaaaaeeaaaaaaaaaaaaaaaaaaaaabbaaaaaaaaebaaaaaaaaea", "bffffffffebffffffffebbbbbbbbbbbbbbbbbbbbbbbbffffffffebffffffffea", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }; xforms-1.2.4/fdesign/xpm/text.xpm0000644000175000017500000000420111665175645013727 00000000000000/* XPM */ static char *text_pixels[] = { "54 36 2 1", "` c black", "a c None", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaa``````aaaaaaaaaaaaaa``aaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaa``aaaaaaaaaaaaaaaa``aaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaa``aaaa```aa``aa``a```aaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaa``aaa``a``aa````aa``aaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaa``aaa`````aaa``aaa``aaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaa``aaa``aaaaa````aa``aaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaa``aaa``a``a``aa``a``aaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaa``aaaa```aa``aa``aa``aaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }; xforms-1.2.4/fdesign/xpm/val.fd0000644000175000017500000001134211665175645013316 00000000000000Magic: 13000 Internal Form Definition File (do not change) Number of forms: 6 Unit of measure: FL_COORD_PIXEL Border Width: -1 =============== FORM =============== Name: form0 Width: 61 Height: 26 Number of Objects: 2 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 61 26 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_SLIDER type: HOR_BROWSER_SLIDER box: 2 5 57 14 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: slsize: 0.20 =============== FORM =============== Name: valslider Width: 60 Height: 30 Number of Objects: 3 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 60 30 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_TEXT type: NORMAL_TEXT box: 2 7 18 15 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER|FL_ALIGN_INSIDE style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: 0.5 shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_SLIDER type: HOR_SLIDER box: 20 7 39 15 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: =============== FORM =============== Name: scb Width: 60 Height: 26 Number of Objects: 2 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 60 26 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_SCROLLBAR type: HOR_THIN_SCROLLBAR box: 1 6 57 14 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: slsize: 0.57 =============== FORM =============== Name: dial Width: 46 Height: 34 Number of Objects: 2 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 46 34 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_DIAL type: NORMAL_DIAL box: 5 0 36 34 boxtype: FL_UP_BOX colors: FL_COL1 FL_RIGHT_BCOL alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.4 =============== FORM =============== Name: counter Width: 64 Height: 27 Number of Objects: 2 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 64 27 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_COUNTER type: NORMAL_COUNTER box: 0 5 63 14 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 0.3 =============== FORM =============== Name: pos Width: 56 Height: 33 Number of Objects: 2 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 56 33 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_POSITIONER type: NORMAL_POSITIONER box: 4 4 48 26 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: xvalue: 0.7 yvalue: 0.6 ============================== create_the_forms xforms-1.2.4/fdesign/xpm/xyplot.xpm0000644000175000017500000000343211665175645014307 00000000000000/* XPM */ static char *xyplot_pixels[] = { "55 29 3 1", "` c black", "a c None", "b c blue", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aa```````````````````````````````````````````````````aa", "aa`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`aa", "aa`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`aa", "aa`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`aa", "aa`aaaabaaaaaaabaaaaaaaaaaaaaaabaaaaaaabaaaaaaaaaaaa`aa", "aa`aaaabbaaaaabbaaaaaaaaaaaaaaabbaaaaabbaaaaaaaaaaaa`aa", "aa`aaaabbaaaaababaaaaaaaaaaaaaabbaaaaababaaaaaaaaaaa`aa", "aa`aaabaabaaabaabaaaaaaaaaaaaabaabaaabaabaaaaaaaaaaa`aa", "aa`aaabaabaaabaabaaaaaaaaaaaaabaabaaabaabaaaaaaaaaaa`aa", "aa`aaaaaabaaabaabaaaaaaaaaaaaabaabaaabaabaaaaaaaaaaa`aa", "aa`aaaaaabaaabaabaaaaaaaaaaaaabaabaaabaabaaaaaaaaaaa`aa", "aa`aaaaaabaaabaaabaaaaaaaaaaabaaabaaabaabaaaaaaaaaaa`aa", "aa`aaaaaaabaabaaabaaaaaaaaaaabaaaabaabaabaaaaaaaaaaa`aa", "aa`aaaaaaababaaaabaaaaaaaaaaabaaaababaaaabaaaaaaaaaa`aa", "aa`aaaaaaababaaaabaaaaaaaaaaabaaaababaaaabaaaaaaaaaa`aa", "aa`aaaaaaababaaaaabaaaaaaaaabaaaaababaaaabaaaaaaaaaa`aa", "aa`aaaaaaababaaaaabaaaaaaaaabaaaaababaaaabaaaaaaaaaa`aa", "aa`aaaaaaabbbaaaaabaaaaaaaaabaaaaabbbaaaabaaaaaaaaaa`aa", "aa`aaaaaaaaaaaaaaabaaaaaaaaabaaaaaaaaaaaabaaaaaaaaaa`aa", "aa`aaaaaaaaaaaaaaabaaaaaaaaabaaaaaaaaaaaaabaaaaaaaaa`aa", "aa`aaaaaaaaaaaaaaaababaaabaabaaaaaaaaaaaaababaaaabaa`aa", "aa`aaaaaaaaaaaaaaaabbabaabbbaaaaaaaaaaaaaababbaabaaa`aa", "aa`aaaaaaaaaaaaaaaabbabbbabbaaaaaaaaaaaaaaabaabbaaaa`aa", "aa`aaaaaaaaaaaaaaaabaaaaaaabaaaaaaaaaaaaaaabaaaaaaaa`aa", "aa`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`aa", "aa`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`aa", "aa```````````````````````````````````````````````````aa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }; xforms-1.2.4/fdesign/xpm/tab.xpm0000644000175000017500000000450511665175645013520 00000000000000/* XPM */ static char *tabfolder_pixels[] = { "59 35 6 1", "` c black", "a c None", "b c gray87", "c c #cecece", "d c #282828", "e c gray35", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaccccccccccccccaeaacccccccccccccccaeaaaaaaaaaaaaaaaaaaaa", "aaabaaaaaaaaaaaaaaaaebaaaaaa```aaaaaaaaeaaaaaaaaaaaaaaaaaaa", "aaabaaaaaaa`aaaaaaaaebaaaaaaa`a`aaaaaaaeaaaaaaaaaaaaaaaaaaa", "aaabaaaaaa`a`aaaaaaaebaaaaaaa``aaaaaaaaeaaaaaaaaaaaaaaaaaaa", "aaabaaaaaa```aaaaaaaebaaaaaaa`a`aaaaaaaeaaaaaaaaaaaaaaaaaaa", "aaabaaaaaa`a`aaaaaaaebaaaaaa```aaaaaaaaeaaaaaaaaaaaaaaaaaaa", "aaabaaaaa``a``aaaaaaebaaaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaaaaaa", "aaabaaaaaaaaaaaaaaaaebaaaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaaaaaa", "aacccccccccccccccccccbaaaaaaaaaaaaaaaaaeccccccccccccccccaaa", "aabaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaaadaa", "aabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaa", "aabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaa", "aabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaa", "aabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaa", "aabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaa", "aabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaa", "aabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaa", "aabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaa", "aabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaa", "aabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaa", "aabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaa", "aabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaa", "aabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaa", "aabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaa", "aabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaa", "aabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaa", "aabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaa", "aabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaa", "aabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaa", "aabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaa", "aabeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeedaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }; xforms-1.2.4/fdesign/xpm/top.xbm0000644000175000017500000000067611665175645013543 00000000000000#define top_width 20 #define top_height 20 static char top_bits[] = { 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x0f, 0x3f, 0x3f, 0x0f, 0x3f, 0x3f, 0x0f, 0x3f, 0x3f, 0x0f, 0x3f, 0x3f, 0x00, 0x3f, 0x3f, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; xforms-1.2.4/fdesign/xpm/bottom.xbm0000644000175000017500000000070711665175645014240 00000000000000#define bottom_width 20 #define bottom_height 20 static char bottom_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x3f, 0x00, 0x3f, 0x3f, 0x00, 0x3f, 0x3f, 0x00, 0x3f, 0x3f, 0x0f, 0x3f, 0x3f, 0x0f, 0x3f, 0x3f, 0x0f, 0x3f, 0x3f, 0x0f, 0x3f, 0x3f, 0x0f, 0x00, 0x00, 0x00}; xforms-1.2.4/fdesign/xpm/allbutton.fd0000644000175000017500000000572511665175645014550 00000000000000Magic: 13000 Internal Form Definition File (do not change) Number of forms: 4 Unit of measure: FL_COORD_PIXEL Border Width: -2 =============== FORM =============== Name: form0 Width: 65 Height: 29 Number of Objects: 2 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 65 29 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LIGHTBUTTON type: PUSH_BUTTON box: 4 3 53 24 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: =============== FORM =============== Name: roundb Width: 65 Height: 29 Number of Objects: 2 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 65 29 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_ROUNDBUTTON type: PUSH_BUTTON box: 7 0 50 29 boxtype: FL_NO_BOX colors: FL_MCOL FL_BLUE alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 1 =============== FORM =============== Name: r3db Width: 65 Height: 29 Number of Objects: 2 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 65 29 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_ROUND3DBUTTON type: PUSH_BUTTON box: 10 0 50 29 boxtype: FL_NO_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: value: 1 =============== FORM =============== Name: butt Width: 65 Height: 29 Number of Objects: 2 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 65 29 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 6 2 52 23 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: ============================== create_the_forms xforms-1.2.4/fdesign/xpm/glcan.xpm0000644000175000017500000000403111665175645014030 00000000000000/* XPM */ static char *glcan_pixels[] = { "40 39 16 1", "` c black", "a c #0b070a", "b c #5d3d6b", "c c #70c6ab", "d c #d1ccdc", "e c #09080a", "f c #0c0706", "g c #7f89d3", "h c #0f2430", "i c #d43ca3", "j c #0b090b", "k c #3889ac", "l c #0c070d", "m c #0b0551", "n c #090b10", "o c None", "````````````````````````````````````````", "````````````````````````````````````````", "````````````````````````````````````````", "````````````````````````````````````````", "nnoojejejjjjjjjjjjjjjjnnjffffjjjfffjlleo", "hhnooeejejjjjjjjjjjjjjeoffffennnnofflllo", "bcbhonjejjjjjjjjjjjjjjooffflnnhmhnoflnno", "hccbhojeejjjjajjjjjjjjeejjlnhbgkmhojlnjo", "bcckbhofjnnnfleoojlljffjonnhgddkmmnllloo", "bccckbhoennelleoojlllfjnnhkdddgkmmmlaleo", "bcdcckbhofllnnlaaaljafnnbgddddgkmmmnonlo", "bcddckkkhjfjnnllllaajenbddddddgmmmmmnnll", "bcdddckkbhoooellllfoenhddddddgkmmmmmmnll", "bcdddcckkkhnofalllffenbdddddggkmmmmmmhlf", "hccddcckkkkhnojenafjnhgddddgggkkmmmmmmnf", "hccddccckkkbhhonnjfonbddggkggkkgkmmmmmno", "hcccccccckkkkbhnnefongdgggkgkkkkkkmmmmno", "hccccddccckkkkbhnnlnhggkkkggggkkkgkmmmno", "hkcccdddcckkkbbgbbhlhkkgkkkgggkkkkgkmmnn", "hkccdddccckggdiiiiibhhkkkkggkgkgggkkmmnn", "hkccccccccgdddddiiiiihmkkgkkkkgggkkkgmnl", "hkcccccccdddddddiiiiiihmgkgkkkkkkkkggbof", "hkkccccccddddddddiiiiibhbgkkkkkkkkgkmmjf", "hkkkkckkdddddddddiiiiibhhbkkkgkkkkmnnnen", "nhbkkkkbdddddddddiiiiiiblhkkggkkmhnfflen", "fohhhhhbdddddddddiiiiiiblnhkgkmnallffaje", "oooooojhdddddddddiiiiiiblonnhnnlajjajjej", "ejjjejlhdddddddddiiiiiiblneanojajjjjjjej", "jjejallhddddddddiiiiiiibloolneaajjjjjjjj", "jjjafllhgddddddiiiiiiibbloallnjjjjjjjejj", "jejjflnnbiiidiiiiiiiiibhloalnnfajjjjjjjj", "jjeaajnlbiiiiiiiiiiiibblaollnefajjjjejjj", "jjjjojonlbiiiiiiiiibbbhloollnnfajjjejeje", "jjjaajooalbiiiiiiiibblleoollnnfajjjjjjjj", "jjejjffooolbbbbbbbbblfleooannefajjjjjjjj", "jejjjjjjejalllhhlllaljejejjjeejjjjjjjjjj", "````````````````````````````````````````", "````````````````````````````````````````", "````````````````````````````````````````" }; xforms-1.2.4/fdesign/xpm/hcenter.xbm0000644000175000017500000000071211665175645014360 00000000000000#define hcenter_width 20 #define hcenter_height 20 static char hcenter_bits[] = { 0xf0, 0xff, 0x00, 0xf0, 0xff, 0x00, 0xf0, 0xff, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0xff, 0xff, 0x0f, 0xff, 0xff, 0x0f, 0xff, 0xff, 0x0f, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03, 0xfc, 0xff, 0x03, 0xfc, 0xff, 0x03, 0xfc, 0xff, 0x03}; xforms-1.2.4/fdesign/xpm/left.xbm0000644000175000017500000000070111665175645013660 00000000000000#define left_width 20 #define left_height 20 static char left_bits[] = { 0xfe, 0x07, 0x00, 0xfe, 0x07, 0x00, 0xfe, 0x07, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0xfe, 0xff, 0x0f, 0xfe, 0xff, 0x0f, 0xfe, 0xff, 0x0f, 0xfe, 0xff, 0x0f, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x01, 0xfe, 0xff, 0x01, 0xfe, 0xff, 0x01, 0xfe, 0xff, 0x01}; xforms-1.2.4/fdesign/xpm/twheel.xpm0000644000175000017500000000430311665175645014236 00000000000000/* XPM */ static char *twheel[] = { /* width height num_colors chars_per_pixel */ " 66 28 9 1", /* colors */ ". c #000000", "# c #bebebe", "a c #a1a1a1", "b c #cecece", "c c #282828", "d c #595959", "e c #dedede", "f c #aeaeae", "g c #959595", /* pixels */ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaa........................................................aaaaa", "aaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaa", "aaaaa.aaccc...........................................cccaaa.aaaaa", "aaaaa.aaccc...........................................cccgaa.aaaaa", "aaaaa.aacccgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggcccgaa.aaaaa", "aaaaa.aacccgdg#gdgg#gdaa#adaffefcfffefcaaa#adag#gdg#gdcccgaa.aaaaa", "aaaaa.aacccgdg#gdgg#gdaa#adaffefcfffefcaaa#adag#gdg#gdcccgaa.aaaaa", "aaaaa.aacccgdg#gdgg#gdaa#adaffefcfffefcaaa#adag#gdg#gdcccgaa.aaaaa", "aaaaa.aacccgdg#gdgg#gdaa#adaffefcfffefcaaa#adag#gdg#gdcccgaa.aaaaa", "aaaaa.aacccgdg#gdgg#gdaa#adaffefcfffefcaaa#adag#gdg#gdcccgaa.aaaaa", "aaaaa.aacccgdg#gdgg#gdaa#adaffefcfffefcaaa#adag#gdg#gdcccgaa.aaaaa", "aaaaa.aacccgdg#gdgg#gdaa#adaffefcfffefcaaa#adag#gdg#gdcccgaa.aaaaa", "aaaaa.aacccgdg#gdgg#gdaa#adaffefcfffefcaaa#adag#gdg#gdcccgaa.aaaaa", "aaaaa.aacccgg.........................................cccgaa.aaaaa", "aaaaa.aaccc...........................................cccgaa.aaaaa", "aaaaa.aa.................................................aaa.aaaaa", "aaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaa", "aaaaa........................................................aaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }; xforms-1.2.4/fdesign/xpm/box.xpm0000644000175000017500000000430411665175645013537 00000000000000/* XPM */ static char *box_pixels[] = { "54 36 6 1", "` c black", "a c None", "b c gray87", "c c #cecece", "d c #282828", "e c gray35", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaacccccccccccccccccccccccccccccccccccccccccaaaaaaa", "aaaaaabccccccccccccccccccccccccccccccccccccccccdaaaaaa", "aaaaaabbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaddaaaaaa", "aaaaaabbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaddaaaaaa", "aaaaaabbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaddaaaaaa", "aaaaaabbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaddaaaaaa", "aaaaaabbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaddaaaaaa", "aaaaaabbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaddaaaaaa", "aaaaaabbaaaaaaaaaa`aaaaaaaaaaaaaaaaaaaaaaaaaaaddaaaaaa", "aaaaaabbaaaaaaaaaa`aaaaaaaaaaaaaaaaaaaaaaaaaaaddaaaaaa", "aaaaaabbaaaaaaaaaa`a``aaa```aa`aaa`aaaaaaaaaaaddaaaaaa", "aaaaaabbaaaaaaaaaa``aa`a`aaa`aa`a`aaaaaaaaaaaaddaaaaaa", "aaaaaabbaaaaaaaaaa`aaa`a`aaa`aaa`aaaaaaaaaaaaaddaaaaaa", "aaaaaabbaaaaaaaaaa`aaa`a`aaa`aa`a`aaaaaaaaaaaaddaaaaaa", "aaaaaabbaaaaaaaaaa``aa`a`aaa`a`aaa`aaaaaaaaaaaddaaaaaa", "aaaaaabbaaaaaaaaaa`a``aaa```aa`aaa`aaaaaaaaaaaddaaaaaa", "aaaaaabbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaddaaaaaa", "aaaaaabbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaddaaaaaa", "aaaaaabbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaddaaaaaa", "aaaaaabbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaddaaaaaa", "aaaaaabbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaddaaaaaa", "aaaaaabbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaddaaaaaa", "aaaaaabbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaddaaaaaa", "aaaaaabbeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeddaaaaaa", "aaaaaabeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeedaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }; xforms-1.2.4/fdesign/xpm/roundb.xpm0000644000175000017500000000410411665175645014236 00000000000000/* XPM */ static char *roundb_pixels[] = { "65 29 4 1", "` c black", "a c None", "b c blue", "c c gray", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaa`````aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaa``ccccc``aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaa`cc`````cc`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaa`cc`bbbbb`cc`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaa`cc`bbbbbbb`cc`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaa`c`bbbbbbbbb`c`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaa`c`bbbbbbbbbbb`c`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaa`c`bbbbbbbbbbb`c`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaa`c`bbbbbbbbbbb`c`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaa`c`bbbbbbbbbbb`c`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaa`c`bbbbbbbbbbb`c`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaa`c`bbbbbbbbb`c`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaa`cc`bbbbbbb`cc`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaa`cc`bbbbb`cc`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaa`cc`````cc`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaa``ccccc``aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaa`````aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }; xforms-1.2.4/fdesign/xpm/right.xbm0000644000175000017500000000070411665175645014046 00000000000000#define right_width 20 #define right_height 20 static char right_bits[] = { 0x00, 0xff, 0x0f, 0x00, 0xff, 0x0f, 0x00, 0xff, 0x0f, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0xff, 0xff, 0x0f, 0xff, 0xff, 0x0f, 0xff, 0xff, 0x0f, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x0f, 0xf8, 0xff, 0x0f, 0xf8, 0xff, 0x0f, 0xf8, 0xff, 0x0f}; xforms-1.2.4/fdesign/xpm/xconq1.xpm0000644000175000017500000000253611665175645014165 00000000000000/* XPM */ static char * xconq1 [] = { "32 32 5 1", " s None c None g4 None", ". m black c black g4 black", "X m white c Blue g4 grey80", "o m white c LightGray g4 grey50", "O m white c OliveDrab g4 grey40", " ", " . ", " ..X.. ", " ..XXXXX.. ", " ..XXXXXXXXX.. ", " ..XXXXXXXXXXXXX.. ", " ..XXXXXXXXXXXXXXXXX.. ", " ..XXXXXXXXXXXXXXXXXXXXX.. ", " ..XXXXXXXXXXXXXXXXX.XXXXXXX.. ", " .XXXXXXXXXXXXXXXXXXX.XXXXXXXX. ", " .XXXXXXXXXXXXXXXXX.X.XXXXXXXX. ", " .XXXXXXXXXXXXXXXXX.X.XXXXXXXX. ", " .XXXXXXXXXXXXXXXXX.X.XXXXXXXX. ", " .XXXXXXXXXXXX..........XXXXXX. ", " .XXXXXXXXXX...oooooooo.XXXXXX. ", " .X..........ooooooooo..XXXXXX. ", " .XXXXXXXXXX.................X. ", " .XXXXXXX...............oooo.X. ", " .XXXXXX..oooooooooooooooooo.X. ", " .XXXXXX....................XX. ", " .XXXXXXX..o.o.o.o.o.o.oo..XXX. ", " .XXXXXXXX................XXXX. ", " .............................. ", " .OOOOOOOOOOOOOOOOOOOOOOOOOOOO. ", " ..OO.O.O.O.O.O.O.O.O.O.O.O.OO. ", " ..O.O.O.O.O.O.O.O.O.O.O.O.. ", " ..OO.O.O.O.O.O.O.O.OO.. ", " ..O.O.O.O.O.O.O.O.. ", " ..OO.O.O.O.OO.. ", " ..O.O.O.O.. ", " ..OOO.. ", " ... "}; xforms-1.2.4/fdesign/xpm/r3dbut.xpm0000644000175000017500000000410111665175645014145 00000000000000/* XPM */ static char *r3dbut_pixels[] = { " 65 29 4 1", "` c None", "a c #cecece", "b c blue", "c c gray35", "`````````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````````", "``````````````````````c``````````````````````````````````````````", "```````````````````ccccccc```````````````````````````````````````", "`````````````````ccccc`ccccc`````````````````````````````````````", "````````````````ccc```````caa````````````````````````````````````", "````````````````cc````b````aa````````````````````````````````````", "```````````````cc```bbbbb```aa```````````````````````````````````", "```````````````cc``bbbbbbb``aa```````````````````````````````````", "```````````````cc``bbbbbbb``aa```````````````````````````````````", "``````````````cc``bbbbbbbb``aa```````````````````````````````````", "```````````````cc``bbbbbbb``aa```````````````````````````````````", "```````````````cc``bbbbbbb``aa```````````````````````````````````", "```````````````cc```bbbbb```aa```````````````````````````````````", "````````````````cc`````````aa````````````````````````````````````", "````````````````caa```````aaa````````````````````````````````````", "`````````````````aaaaaaaaaaa`````````````````````````````````````", "```````````````````aaaaaaa```````````````````````````````````````", "`````````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````````", "`````````````````````````````````````````````````````````````````" }; xforms-1.2.4/fdesign/xpm/Makefile.am0000664000175000017500000000121112251727437014243 00000000000000include $(top_srcdir)/config/common.am EXTRA_DIST = allbutton.fd \ bm1.xbm \ bottom.xbm \ box.xpm \ br.xpm \ broken.xpm \ broken.xbm \ butt.xpm \ chart.xpm \ check.xpm \ choice.fd \ choice.xpm \ clock.xpm \ cnt.xpm \ crab_focus.xpm \ crab.xpm \ dial.xpm \ fd_logo.xpm \ frame.xpm \ glcan.xpm \ hcenter.xbm \ left.xbm \ lightb.xpm \ menu.xpm \ misc.fd \ nomail.xbm \ picture1.xbm \ picture.xbm \ porsche.xpm \ pos.xpm \ r3dbut.xpm \ right.xbm \ roundb.xpm \ scb.xpm \ sld.xpm \ tab.xpm \ text.xpm \ timer.xpm \ top.xbm \ twheel.xpm \ val.fd \ vals.xpm \ vcenter.xbm \ xconq1.xpm \ xconq.xpm \ xyplot.xpm xforms-1.2.4/fdesign/xpm/pos.xpm0000644000175000017500000000411211665175645013545 00000000000000/* XPM */ static char *pos_pixels[] = { "56 33 5 1", "` c None", "a c gray87", "b c blue", "c c #282828", "d c gray35", "````````````````````````````````````````````````````````", "````````````````````````````````````````````````````````", "````````````````````````````````````````````````````````", "````````````````````````````````````````````````````````", "````dddddddddddddddddddddddddddddddddddddddddddddddd````", "````c``````````````````````````````````````````````a````", "````c```````````````````````````````b``````````````a````", "````c```````````````````````````````b``````````````a````", "````c```````````````````````````````b``````````````a````", "````c```````````````````````````````b``````````````a````", "````c```````````````````````````````b``````````````a````", "````c```````````````````````````````b``````````````a````", "````c```````````````````````````````b``````````````a````", "````c```````````````````````````````b``````````````a````", "````c`bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb`a````", "````c```````````````````````````````b``````````````a````", "````c```````````````````````````````b``````````````a````", "````c```````````````````````````````b``````````````a````", "````c```````````````````````````````b``````````````a````", "````c```````````````````````````````b``````````````a````", "````c```````````````````````````````b``````````````a````", "````c```````````````````````````````b``````````````a````", "````c```````````````````````````````b``````````````a````", "````c```````````````````````````````b``````````````a````", "````c```````````````````````````````b``````````````a````", "````c```````````````````````````````b``````````````a````", "````c```````````````````````````````b``````````````a````", "````c```````````````````````````````b``````````````a````", "````c``````````````````````````````````````````````a````", "````aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa````", "````````````````````````````````````````````````````````", "````````````````````````````````````````````````````````", "````````````````````````````````````````````````````````" }; xforms-1.2.4/fdesign/xpm/bm1.xbm0000644000175000017500000000042011665175645013403 00000000000000#define bm1_width 16 #define bm1_height 16 static char bm1_bits[] = { 0xff, 0xff, 0xff, 0xa8, 0x83, 0x8d, 0x3b, 0xad, 0x3b, 0xff, 0xbb, 0xfe, 0xbb, 0xe0, 0x03, 0xc0, 0x3f, 0x80, 0x3f, 0x80, 0x3f, 0x80, 0x3f, 0x80, 0x0f, 0x80, 0x73, 0xc0, 0xff, 0xe0, 0xff, 0xff}; xforms-1.2.4/fdesign/xpm/picture.xbm0000644000175000017500000000157511665175645014413 00000000000000#define picture_width 32 #define picture_height 32 static unsigned char picture_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x80, 0x01, 0x18, 0x64, 0x6f, 0xf6, 0x26, 0x0a, 0x00, 0x00, 0x50, 0xf2, 0xff, 0xff, 0x4f, 0x14, 0x04, 0x00, 0x28, 0x14, 0x0e, 0x00, 0x28, 0x10, 0x32, 0x00, 0x08, 0x94, 0x03, 0x00, 0x08, 0xf4, 0x04, 0x00, 0x08, 0xb0, 0x08, 0x00, 0x08, 0x34, 0x01, 0x00, 0x28, 0x34, 0x01, 0x00, 0x28, 0x12, 0x00, 0x40, 0x48, 0x12, 0x20, 0xa6, 0x48, 0x14, 0x50, 0x11, 0x29, 0x14, 0x50, 0x48, 0x2a, 0x10, 0x27, 0xac, 0x0e, 0xd4, 0x71, 0xe8, 0x0a, 0x74, 0x20, 0xa8, 0x0a, 0x14, 0x20, 0x00, 0x08, 0x10, 0x50, 0x00, 0x08, 0x14, 0x00, 0x00, 0x28, 0x14, 0x00, 0x00, 0x28, 0xf2, 0xff, 0xff, 0x4f, 0x0a, 0x00, 0x00, 0x50, 0x64, 0x6f, 0xf6, 0x26, 0x18, 0x80, 0x01, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; xforms-1.2.4/fdesign/xpm/dial.xpm0000644000175000017500000000344411665175645013664 00000000000000/* XPM */ static char *dial_pixels[] = { "46 34 4 1", "` c None", "a c #cecece", "b c #282828", "c c gray35", "``````````````````````````````````````````````", "``````````````````````````````````````````````", "````````````````````aaaaaaa```````````````````", "`````````````````aaa```````aaa````````````````", "```````````````aa`````````````aa``````````````", "``````````````a`````````````````a`````````````", "`````````````a`bb````````````````a````````````", "````````````abbbbb````````````````c```````````", "```````````a``bbbbb````````````````c``````````", "``````````a````bbbbb````````````````c`````````", "``````````a````bbbbbb```````````````c`````````", "`````````a``````bbbb`````````````````c````````", "`````````a```````bb``````````````````c````````", "`````````a```````````````````````````c````````", "````````a`````````````````````````````c```````", "````````a`````````````````````````````c```````", "````````a`````````````````````````````c```````", "````````a`````````````````````````````c```````", "````````a`````````````````````````````c```````", "````````a`````````````````````````````c```````", "````````a`````````````````````````````c```````", "`````````a```````````````````````````c````````", "`````````a```````````````````````````c````````", "`````````a```````````````````````````c````````", "``````````a`````````````````````````c`````````", "``````````a`````````````````````````c`````````", "```````````a```````````````````````c``````````", "````````````a`````````````````````c```````````", "`````````````c```````````````````c````````````", "``````````````c`````````````````c`````````````", "```````````````cc`````````````cc``````````````", "`````````````````ccc```````ccc````````````````", "````````````````````ccccccc```````````````````", "``````````````````````````````````````````````" }; xforms-1.2.4/fdesign/sp_xyplot.c0000664000175000017500000002536412253056226013620 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file sp_xyplot.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Settting xyplot class specific attributes. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "fd_main.h" #include "fd_spec.h" #include "sp_xyplot.h" #include "private/pxyplot.h" #include "spec/xyplot_spec.h" static FD_xyplotattrib *xyplot_attrib; static FL_OBJECT *curobj; /*************************************** ***************************************/ FL_FORM * xyplot_create_spec_form( void ) { if ( xyplot_attrib ) return xyplot_attrib->xyplotattrib; xyplot_attrib = create_form_xyplotattrib( ); fl_addto_choice( xyplot_attrib->xscale, get_scale_string( ) ); fl_addto_choice( xyplot_attrib->yscale, get_scale_string( ) ); fl_addto_choice( xyplot_attrib->xgrid, get_grid_string( ) ); fl_addto_choice( xyplot_attrib->ygrid, get_grid_string( ) ); fl_addto_choice( xyplot_attrib->gridstyle, get_linestyle_string( ) ); setup_how_return_menu( xyplot_attrib->how_return ); fl_set_menu_item_mode( xyplot_attrib->how_return, 5, FL_PUP_BOX | FL_PUP_GRAY ); fl_set_menu_item_mode( xyplot_attrib->how_return, 6, FL_PUP_BOX | FL_PUP_GRAY ); return xyplot_attrib->xyplotattrib; } /*************************************** ***************************************/ void xyplot_adjust_spec_form( FL_OBJECT * obj ) { FLI_XYPLOT_SPEC *sp = obj->spec; curobj = obj; if ( obj->type != FL_ACTIVE_XYPLOT ) { fl_hide_object( xyplot_attrib->how_return ); fl_hide_object( xyplot_attrib->mark_active ); } else { fl_show_object( xyplot_attrib->how_return ); fl_show_object( xyplot_attrib->mark_active ); } if ( sp->xscale != FL_LOG ) fl_hide_object( xyplot_attrib->xbase ); else fl_show_object( xyplot_attrib->xbase ); if ( sp->yscale != FL_LOG ) fl_hide_object( xyplot_attrib->ybase ); else fl_show_object( xyplot_attrib->ybase ); if ( sp->xgrid || sp->ygrid ) fl_show_object( xyplot_attrib->gridstyle ); else fl_hide_object( xyplot_attrib->gridstyle ); } /*************************************** ***************************************/ void xyplot_fill_in_spec_form( FL_OBJECT * obj ) { FLI_XYPLOT_SPEC *sp = obj->spec; fl_set_counter_value( xyplot_attrib->xmajor, sp->xmajor ); fl_set_counter_value( xyplot_attrib->xminor, sp->xminor ); fl_set_counter_value( xyplot_attrib->ymajor, sp->ymajor ); fl_set_counter_value( xyplot_attrib->yminor, sp->yminor ); fl_set_choice( xyplot_attrib->xgrid, sp->xgrid + 1 ); fl_set_choice( xyplot_attrib->ygrid, sp->ygrid + 1 ); fl_set_choice( xyplot_attrib->xscale, sp->xscale + 1 ); fl_set_choice( xyplot_attrib->yscale, sp->yscale + 1 ); fl_set_choice( xyplot_attrib->gridstyle, sp->grid_linestyle + 1 ); set_finput_value( xyplot_attrib->xbase, sp->xbase, -1 ); set_finput_value( xyplot_attrib->ybase, sp->ybase, -1 ); reset_how_return_menu( xyplot_attrib->how_return, obj->how_return ); fl_set_button( xyplot_attrib->mark_active, sp->mark_active ); } /*************************************** ***************************************/ void xyplot_emit_spec_fd_code( FILE * fp, FL_OBJECT * ob ) { FL_OBJECT *defobj; SuperSPEC *defsp, *sp; if ( ob->objclass != FL_XYPLOT ) return; /* create a default object */ defobj = fl_create_xyplot( ob->type, 0, 0, 0, 0, "" ); defsp = get_superspec( defobj ); sp = get_superspec( ob ); if ( sp->xmajor != defsp->xmajor || sp->xminor != defsp->xminor ) fprintf( fp, " xtics: %d %d\n", sp->xmajor, sp->xminor ); if ( sp->ymajor != defsp->ymajor || sp->yminor != defsp->yminor ) fprintf( fp, " ytics: %d %d\n", sp->ymajor, sp->yminor ); if ( sp->xgrid != defsp->xgrid || sp->ygrid != defsp->ygrid ) fprintf( fp, " grid: %s %s\n", get_grid_name( sp->xgrid ), get_grid_name( sp->ygrid ) ); if ( sp->grid_linestyle != defsp->grid_linestyle ) fprintf( fp, " gridstyle: %s\n", get_linestyle_name( sp->grid_linestyle ) ); if ( sp->xscale != defsp->xscale || sp->xbase != defsp->xbase ) fprintf( fp, " xscale: %s %g\n", get_scale_name( sp->xscale ), sp->xbase ); if ( sp->yscale != defsp->yscale || sp->ybase != defsp->ybase ) fprintf( fp, " yscale: %s %g\n", get_scale_name( sp->yscale ), sp->ybase ); if ( ob->type == FL_ACTIVE_XYPLOT ) { if ( sp->mark_active != defsp->mark_active ) fprintf( fp, " markactive: %d\n", sp->mark_active ); } fl_free_object( defobj ); } /*************************************** ***************************************/ void xyplot_emit_spec_c_code( FILE * fp, FL_OBJECT * ob ) { FL_OBJECT *defobj; SuperSPEC *sp, *defsp; if ( ob->objclass != FL_XYPLOT ) { M_err( "EmitXYPlotCode", "not xyplot class!" ); return; } /* create a default object */ defobj = fl_create_xyplot( ob->type, 0, 0, 0, 0, "" ); defsp = get_superspec( defobj ); sp = get_superspec( ob ); if ( sp->xmajor != defsp->xmajor || sp->xminor != defsp->xminor ) fprintf( fp, " fl_set_xyplot_xtics( obj, %d, %d );\n", sp->xmajor, sp->xminor ); if ( sp->ymajor != defsp->ymajor || sp->yminor != defsp->yminor ) fprintf( fp, " fl_set_xyplot_ytics( obj, %d, %d );\n", sp->ymajor, sp->yminor ); if ( sp->xscale != defsp->xscale || ( sp->xscale == FL_LOG && sp->xbase != defsp->xbase ) ) fprintf( fp, " fl_set_xyplot_xscale( obj, %s, %g );\n", get_scale_name( sp->xscale ), sp->xbase ); if ( sp->yscale != defsp->yscale || ( sp->yscale == FL_LOG && sp->ybase != defsp->ybase ) ) fprintf( fp, " fl_set_xyplot_yscale( obj, %s, %g );\n", get_scale_name( sp->yscale ), sp->ybase ); if ( sp->xgrid != defsp->xgrid ) fprintf( fp, " fl_set_xyplot_xgrid( obj, %s );\n", get_grid_name( sp->xgrid ) ); if ( sp->ygrid != defsp->ygrid ) fprintf( fp, " fl_set_xyplot_ygrid( obj, %s );\n", get_grid_name( sp->ygrid ) ); if ( sp->grid_linestyle != defsp->grid_linestyle ) fprintf( fp, " fl_set_xyplot_grid_linestyle( obj, %s );\n", get_linestyle_name( sp->grid_linestyle ) ); if ( ob->type == FL_ACTIVE_XYPLOT ) { if ( sp->mark_active != defsp->mark_active ) fprintf( fp, " fl_set_xyplot_mark_active( obj, %d );\n", sp->mark_active ); } fl_free_object( defobj ); } /*************************************** ***************************************/ void grid_change_cb( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { int xg = fl_get_choice( xyplot_attrib->xgrid ) - 1; int yg = fl_get_choice( xyplot_attrib->ygrid ) - 1; if ( xg || yg ) fl_show_object( xyplot_attrib->gridstyle ); else fl_hide_object( xyplot_attrib->gridstyle ); fl_set_xyplot_xgrid( curobj, xg ); fl_set_xyplot_ygrid( curobj, yg ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void markactive_change_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { fl_set_xyplot_mark_active( curobj, fl_get_button( obj ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void gridstyle_change_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { fl_set_xyplot_grid_linestyle( curobj, fl_get_choice( obj ) - 1 ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void xscale_change_cb( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { int s = fl_get_choice( xyplot_attrib->xscale ) - 1; if ( s == FL_LOG ) fl_show_object( xyplot_attrib->xbase ); else fl_hide_object( xyplot_attrib->xbase ); fl_set_xyplot_xscale( curobj, s, get_finput_value( xyplot_attrib->xbase ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void yscale_change_cb( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { int s = fl_get_choice( xyplot_attrib->yscale ) - 1; if ( s == FL_LOG ) fl_show_object( xyplot_attrib->ybase ); else fl_hide_object( xyplot_attrib->ybase ); fl_set_xyplot_yscale( curobj, s, get_finput_value( xyplot_attrib->ybase ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void ymajorminor_change_cb( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { /* fill-in code for callback */ fl_set_xyplot_ytics( curobj, fl_get_counter_value( xyplot_attrib->ymajor ), fl_get_counter_value( xyplot_attrib->yminor ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void xmajorminor_change_cb( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_set_xyplot_xtics( curobj, fl_get_counter_value( xyplot_attrib->xmajor ), fl_get_counter_value( xyplot_attrib->xminor ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void xyplot_returnsetting_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { handle_how_return_changes( obj, curobj ); } #include "spec/xyplot_spec.c" /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fd_help.c0000664000175000017500000003516012253055555013157 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fd_help.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * This file is part of the Form Designer. * * It contains the routines for the help feature of the designer. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "fd_main.h" #include "fd/ui_theforms.h" /*************************************** * Loads the help browser with specific information. ***************************************/ static void load_it( char str[ ][ 80 ] ) { int i; fl_freeze_form( fd_help->helpform ); fl_clear_browser( fd_help->browser ); for ( i = 0; str[ i ][ 0 ]; i++ ) fl_add_browser_line( fd_help->browser, str[ i ] ); fl_unfreeze_form( fd_help->helpform ); } /*************************************** * Shows the help form. ***************************************/ void help_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { static int has_pos = 0; fl_show_form( fd_help->helpform, has_pos ? FL_PLACE_GEOMETRY : FL_PLACE_CENTER, FL_FULLBORDER, "fdesign help" ); if ( ! has_pos ) has_pos = 1; } /*************************************** * Stop showing the help window ***************************************/ void exithelp_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { fl_hide_form( fd_help->helpform ); } extern char testhelp[ ][ 80 ], mainhelp[ ][ 80 ], generalhelp[ ][ 80 ], keyhelp[ ][ 80 ], grouphelp[ ][ 80 ], savehelp[ ][ 80 ], mousehelp[ ][ 80 ]; /*************************************** * Shows a particular help item. ***************************************/ void showhelp_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg ) { switch ( arg ) { case HELP_VERSION: load_it( mainhelp ); break; case HELP_GENERAL: load_it( generalhelp ); break; case HELP_MOUSE: load_it( mousehelp ); break; case HELP_KEYBOARD: load_it( keyhelp ); break; case HELP_GROUP: load_it( grouphelp ); break; case HELP_TEST: load_it( testhelp ); break; case HELP_SAVE: load_it( savehelp ); break; } } #define S( a ) #a #define LIBVERSION( a, b ) S( a ) "." S( b ) char mainhelp[ ][ 80 ] = { " ", "@C4@M@b@cForm Designer", " ", "@C4@b@cVersion: " LIBVERSION( FL_VERSION, FL_REVISION ) "." FL_FIXLEVEL, "@C4@b@cWritten by T.C. Zhao & Mark Overmars", "@-", " ", "The Form Designer ('fdesign') is a program for interactively designing", "dialogue forms for use with the Forms Library. The prgram is very simple", "to use. Press the buttons below to get help on the different topics.", " ", "For more info on fdesign and xforms, see the complete documentation or", "visit the XForms home and project pages:", " ", "@f@b@chttp://xforms-toolkit.org/", "and", "@f@b@chttp://savannah.nongnu.org/projects/xforms/", "" }; char generalhelp[ ][ 80 ] = { " ", "@l@b@cGeneral Information", " ", "@bAdd a form", "To add a form use the 'New Form' entry in the 'Form' menu. You will", "be prompted for a name. After the form is created you can start ", "adding objects such as buttons etc., to this form.", " ", "@bAdding Objects", "To add an object to a form select what kind of object to add by clicking", "on that objects class in the 'Object classes' browser in the control", "panel. If you now click the left mouse button (keep it pressed) in the", "form, a rubber band will appear. The size of the rubber band determines", "the size of the object you're creating. Once a satifactory size is found,", "release the left mouse button. You can change its size, position and", "attributes a well as clone it afterwards as needed.", " ", "@bDeleting a form", "Use the 'Delete Form' entry in the 'Form' menu to delete the current", "form. You will have to acknowledge the deletion.", " ", "@bChanging the name of a form", "This can be achieved via the 'Form Name' entry in the 'Form' menu after", "selecting the form you want to change).", " ", "@bChanging the size of a form", "You either can simply resize the window showing the form or you can use", "the 'Resize Form' entry in the 'Form' menu to get a popup-window which", "allows you to enter the precise width and height of the current form.", " ", "@bAligning objects", "When you click on the 'Align' button a new popup window gets shown. Now", "select an object (or a group of objects) and press one of the buttons in", "the new window to align it/them left, horizontal centers, right, etc. It", "is also possible to put equal distances between objects. With this form", "you can also set the 'snap value' which tells fdesign about the number of", "pixels to which values are rounded when positioning or resizing objects", "in your forms.", " ", "@bConfiguration", "The following resources can be used to select where to place the various", "forms that control the operation of fdesign", " ", "@fformDesgin.geometry", "This resource controls the placement and size of the working area", " ", "@fcontrol.geometry", "This resource controls the placement of the control panel", " ", "@fattributes.geometry", "This resource controls the placement of Attributes panel, activated by", "double-clicking on the object or by pressing F1", " ", "@fattributes.background", "This resource controls the background color of the Attributes panel", " ", "@falign.geometry", "This resource controls the placement of the align dialog", " ", "@fxformsHeader", "This resource informs the fdesign to emit a header other than forms.h", " ", "@fcompensate", "This resource (bool) informs the fdesign to emit font size compensation", "code", " ", "The most useful xforms resource are", "@ffdesign.XForm*FontSize", "and", "@ffdesign.XForm*PupFontSize", " ", "" }; char mousehelp[ ][80] = { " ", "@l@b@cUsing the Mouse", " ", "The mouse is used to add objects, select objects and move them around", "or scale them. Sometimes, holding down the key influences the", "action taken.", " ", "@bLeft Mouse Button", "When an object class is selected in the Object class browser, dragging", "with the left mouse button is used to add an object to a form. In normal", "operation, i.e., wjen not adding objects, the left mouse is used to", "select, move or scale objects. When you click on an object, the object", "is selected, indicated by a red outline with 4 small knobs on the", "corners. To select more than one object, draw a box by dragging the", "mouse. All objects that fall within the box are selected. Alternatively,", "clicking on an object with the key pressed will add it to the", "selection. To move objects, select them first then drag them around.", "To scale an object, drag the scale knobs on the red selection outline.", " ", "Double clicking on an object will select it and, at the same time, bring", "up the form for changing its properties.", " " "Dragging a selected object with the key pressed causes a copy of", "that object to be made (cloned) and moved. The cloned object will have", "exactly the same attributes as the original object except for object name", "and shortcut", " ", "@bRight Mouse Button", "Single clicks with the right mouse button also select an object. But", "a double click deletes it (a copy is still kept in the copy-and-paste", "buffer, so the last object deleted can be added again to the form by", "pasting it into the form).", "" }; char keyhelp[ ][ 80 ] = { " ", "@l@b@cCursor Keys", " ", "The arrow keys can be used to move the current selection. If ", "is pressed, the selection will be scaled instead. To adjust the number", "of pixels to move (or increment), 0-9 can be used with 0 meaning", "10 pixels.", " ", "@l@b@cFunction Keys", " ", "The function keys are used to perform certain actions on the current", "selection. You can either use the function keys on the keyboard or", "the corresponding buttons on the screen.", " ", "@bF1 Attributes", "Change the attributes of the current selection. This only works if the", "objects in the selection are all of the same class. When only one object", "is selected, also its label, name, callback etc. can be changed.", " ", "@bF2 Lower selection", "Lowers the objects in the current selection, i.e., places them below all", "other objects on the form.", " ", "@bF3 Raise selection", "Raises all objects in the selection, i.e., places them on top of all", "other objects in the form.", " ", "@bF4 Select all", "Puts all objects in a selection.", " ", "@bF5 Show selection", "Makes all objects in the current selection visible. You can first use", "F4 to select all objects.", " ", "@bF6 Hide selection", "Hides all objects in the current selection. Use F5 to make them", "visible again.", " ", "@bF7 Group selection", "Places all objects in the selection in a group. If the objects are", "already part of a group, they are removed from the old group. Groups", "that become empty this way are discarded. You will be asked to provide a", "name for the group. This must be the C-name under which the group is", "known to the application program.", " ", "@bF8 Ungroup selection", "Takes all objects in the current selection out of their groups. Empty", "groups will be discarded.", " ", "@bF9 Copy selection to buffer", "Copies the objects in the current selection to the buffer. They can", "later be added to the same or another form using the operation paste.", " ", "@bF10 Paste buffer into form", "Pastes the objects in the buffer (placed there by the last copy or cut", "operation) into the form. You have to indicate the position by clicking", "in the form window. The pasted objects will form the new selection.", " ", "@bF11", "Selects the next object and wraps around if the currently selected", "obbject is the last object in the form. has the same functionality", " ", "@bF12 Cut selection into the buffer", "Deletes the current selection. The deleted objects will be placed in", "the copy-and-paste buffer and can be pasted back into the form (or", "another form) later.", " ", "@l@b@c Other Keys", " ", "@btstart/stop Testing", "Pressing 't' in the main window is the same as clicking on the button", "labeled 'Test'. If the form is already being tested, pressing 't' stops", "testing.", " ", "@bs Save the forms", "Depending on the options selected, pressing 's' will save the current", "set of forms to disk.", " ", "@bEsc Exit", "Quit form designer", "" }; char grouphelp[ ][ 80 ] = { " ", "@l@b@cGroups", " ", "The Form Designer has a simple mechanism for dealing with groups inside", "forms. To create a group of objects, select all of them, using the right", "mouse button, and press key . The group name you indicate is added", "to the list of groups. Whenever you select all elements in a group the", "group name is shown in red. You can also select or deselect all elements", "in a group by pressing the mouse on the group name. Groups whose", "elements get deleted automatically disappear.", " ", "@bAdding an object to a group", "It is not possible to directly add an object to an existing group. You", "should first select the group and the new object and next press to", "create a new group. The old group will be removed and a new group,", "including the new object, will be created. You will have to type in the", "group name again.", " ", "@bChanging the name of a group", "To change the name of a group, select it (and deselect the others) and", "press the button labeled 'Group Name' below the list of groups.", "" }; char savehelp[ ][ 80 ] = { " ", "@l@b@cSaving and Loading", " ", "To save the current set of forms, use the 'Save As' entry in the 'File'", "menu. A file selector will appear in which you can enter the name under", "which to save the form. This name should end with '.fd'. At least three", "files will be generated: .c, .h and .fd. See the", "documentation for their purpose.", " ", "A new set of forms can be loaded using the 'Open' entry in the 'File'", "menu. It is also possible to merge the new forms with the current set", "using the 'Merge' entry.", " ", "" }; char testhelp[ ][ 80 ] = { " ", "@l@b@cTesting Forms", " ", "To test the current form press the button labeled 'Test Form'. The form", "will be centered on the screen and in the top right corner a new form", "will appear. Now you can play with the form. In the browser the objects", "are shown that will be returned to the application program or the callback", "routines that will be called. In this way you can verify whether each", "object has got a name or callback routine associated with it. To stop", "testing press the button labeled 'Stop Testing'.", " ", "Note that changes you make to the objects, e.g. filling in an input field,", "will not be saved when saving the forms.", "" }; /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fdesign.man0000664000175000017500000001237512244217405013523 00000000000000.\" .\" Man page for Forms Designer .\" Use the following command to generate viewable man page .\" tbl fdesign.1 | {nt}roff -man .\" .\" ul | more -fsk to view .\" .\" .TH FDESIGN 1L "November 2013" "Version 1.2.0" "Forms Library" .SH NAME fdesign \- Forms Library User Interface Designer .\" .\" setup .de Cr .ie n (c) .el \(co .. .SH SYNOPSIS .if n fdesign .if t \{ .B fdesign \} [-xformoptions] [-options] [files] .SH DESCRIPTION .I fdesign is a GUI builder that helps in the construction of graphical user interface in a WYSIWYG ("what you see is what you get") way by allowing the user to directly manipulate various objects, such as buttons, sliders and menus etc. Once a satisfactory UI is constructed, the user can save the composed interface into a set of external files. Files with the extension '.fd' contain all information about the objects and can be read in again by .IR fdesign . The files with C code and header files when compiled and linked against the .BR "Forms Library" , generate code that at run-time constructs the exact same interface as the ones seen within .IR fdesign . A variety of output languages is possible via external filters. As of this writing, C, perl, ada95, Fortran, pascal, and PostScript output filters are known to exist. .SH OPTIONS .I fdesign accepts all standard .B Forms Library command line options as well as the following: .TP 6 .B \-help Prints a brief summary of all command line options. This option does not require a connection to the X server. .TP .B \-version Prints the current version of .I fdesign and exits. .TP .BI \-geometry " geom" Specifies the prefered size and location of main working area in which the UI is to be constructed. .TP .BI \-convert " fdfile-list" This option prevents .I fdesign from attempting to make a connection to the X server. The file list following this flag is converted to C code directly. .TP .BI \-dir " destdir" output any converted files in \fIdestdir\fR. .TP .BI \-unit " pixel|point|mm|cp|cmm" selects the unit of measure for object geometries. For non-pixel unit, the interface created is screen resolution independent and may be desirable for many applications. Note that for typical screens, .I point (about 1/72 inch) and .I mm may be too coarse and subject to round-off errors. Use .I cp (centi-point, 100th of a point) and .I cmm (centi-mm) instead. .TP .B \-altformat selects an alternative format for the generated C code where global variables are used for the UI components. .TP .B \-main requests the output of main program template. .TP .B \-callback requests the output of callback function template. .TP .B \-compensate requests the emission of font/server resolution variation compensation code. .TP .BI \-I " headerfile" uses an alternative header file instead of the default forms.h in the output C code. .TP .B \-lax requests relaxed C syntax checking. .TP .B \-ps This option specifies that instead of emitting the c code for the user interface, PostScript code should be emitted. .TP .B \-ada This option requests ada95 code output .TP .B \-perl This option requests perl code output. .TP .B \-fortran This option requests Fortran code output. .TP .B \-pascal This option requests pascal code output. .TP .B \-nocode suppresses the output of UI code. Only the .fd file is written. .PP The most useful .B Forms Library command line options are .TP .BI \-display " host:dpy" This option specifies the X server to connect. .TP .BI \-flversion This option prints the version string of the .BR "Forms Library" , with which fdesign was build. .TP .BI \-name " appname" This option specifies the application name under which resources are to be obtained, instead of the executable name. .I appname should not contain . or *. .IR fdesign . .SH RESOURCES The program understands all of the .BR "Forms Library" 's resource names and classes as well as the following .TP 8 control.geometry (class Control.Geometry) specifies the geometry of the control panel. Currently the size is ignored. .TP unit (Unit) specifies the default unit of measure. Default is pixel. .TP attributes.geometry (class Attributes.Geometry) specifies the geometry of the object attributes panel. Currently the size is ignored. .TP align.geometry (class Align.Geometry) specifies the geometry of the object align panel. Currently the size is ignored. .TP xformsHeader (class XFormsHeader) specifies the header filename generated in the output C code. Default is forms.h .TP filter (class Filter) specifies post-processing filter (an external executable name). .TP language (class Language) specifies target language name. .PP Among the standard .B Forms Library resources, the following are most useful .TP xform.fontsize (class XFORM.FontSize) specifies the font size used for most object labels. .TP xform.pupfontsize (class XFORM.PupFontSize) specifies the font size used in pop-up menus. .TP xform.browserFontSize (class XFORM.BrowserFontSize) specifies the font size used for the text inside a browser. .SH SEE ALSO xforms(5), fd2ps(1L) .SH AUTHOR Copyright .Cr 1996-2002 T.C. Zhao and Mark Overmars .br Since 2002: GNU Lesser General Public License .br Maintainers: Jean-Marc Lasgouttes, Angus Leeming and Jens Thoms Toerring .SH HOME PAGE http://xforms-toolkit.org .br http://savannah.nongnu.org/projects/xforms/ xforms-1.2.4/fdesign/fd_rubber.c0000644000175000017500000002116112253056020013466 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fd_rubber.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * This file is part of the Form Designer. * * Someday, we'll have to re-write all of these so it fits with * X event handling better. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "fd_main.h" extern void color( unsigned long ); extern GC fd_gc, fd_xorgc, fd_copygc; extern Colormap fd_colormap; extern Display *fd_display; /**** ROUNDING *****/ static double xmin = 0.0, ymin = 0.0, width = 1280.0, height = 1024.0; static double stepsize = 10.0; /* Step size (for alignment) */ /*************************************** * Sets the step size ***************************************/ void set_step_size( double size ) { stepsize = size < 1.0 ? 1.0 : size; } /*************************************** * Returns the step size ***************************************/ double get_step_size( void ) { return stepsize; } /*************************************** * Sets the bounding box. ***************************************/ void set_bounding_box( double x, double y, double w, double h ) { xmin = x; ymin = y; width = w; height = h; } /*************************************** * Rounds the box size to the step size and inside the bounding box ***************************************/ static void round_size( double * x, double * y, double * w, double * h ) { if ( *w > width ) *w = width; if ( *h > height ) *h = height; if ( stepsize > 0.0 ) { int t = *w / stepsize + 0.5; if ( *w >= 0.0 ) *w = stepsize * t; else *w = stepsize * ( t - 1 ); t = *h / stepsize + 0.5; *h = stepsize * t; if ( *h >= 0.0 ) *h = stepsize * t; else *h = stepsize * ( t - 1 ); } if ( *x + *w > xmin + width ) *w = xmin + width - *x; if ( *y + *h > ymin + height ) *h = ymin + height - *y; if ( *x + *w < xmin ) *w = xmin - *x; if ( *y + *h < ymin ) *h = ymin - *y; if ( *w >= 0.0f && *w < stepsize ) *w = stepsize; if ( *h >= 0.0 && *h < stepsize ) *h = stepsize; if ( *w < 0.0 && *w > -stepsize ) *w = -stepsize; if ( *h < 0.0 && *h > -stepsize ) *h = -stepsize; } /*************************************** * Rounds the position to the stepsize and inside the bounding box ***************************************/ static void round_position( double * x, double * y, double * w, double * h ) { if ( *w > width ) *w = width; if ( *h > height ) *h = height; if ( stepsize > 0.0 ) { int t = *x / stepsize + 0.5; *x = stepsize * t; t = *y / stepsize + 0.5; *y = stepsize * t; } if ( *x < xmin ) *x = xmin; if ( *y < ymin ) *y = ymin; if ( *x + *w > xmin + width ) *x = xmin + width - *w; if ( *y + *h > ymin + height ) *y = ymin + height - *h; } /**** DRAWING ****/ /*************************************** * Draws a box ***************************************/ static void show_box( double x, double y, double w, double h ) { XSetFunction( fd_display, fd_gc, GXxor ); color( fd_col ^ fd_black ); rect( x, y, x + w - 1, y + h - 1 ); XSetFunction( fd_display, fd_gc, GXcopy ); } #define hide_box show_box /**** THE ACTUAL ROUTINES ****/ /*************************************** * Whether we should stop ***************************************/ static int ready( void ) { XEvent xev; if ( fl_check_forms( ) == FL_EVENT ) { fl_XNextEvent( &xev ); fli_xevent_name( "ready:", &xev ); return ( xev.type == ButtonRelease || ( is_pasting && xev.type == KeyPress ) ); } fl_msleep( 10 ); return 0; } /*************************************** * Returns the position of the mouse in world coordinates ***************************************/ void get_mouse_pos( double * xx, double * yy ) { FL_Coord x, y; unsigned int kmask; fl_get_win_mouse( main_window, &x, &y, &kmask ); *xx = x; *yy = y; } /*************************************** * Drag a box around until the user releases a mouse button ***************************************/ void move_box( double * x, double * y, double * w, double * h, int offset ) { double oldx = *x, oldy = *y, oldw = *w, oldh = *h; double xoff, yoff; if ( offset ) { get_mouse_pos( &xoff, &yoff ); xoff -= *x; yoff -= *y; } else { xoff = *w / 2.0; yoff = *h / 2.0; } show_box( *x, *y, *w, *h ); while ( ! ready( ) ) { get_mouse_pos( x, y ); *x -= xoff; *y -= yoff; round_position( x, y, w, h ); if ( *x != oldx || *y != oldy ) { hide_box( oldx, oldy, oldw, oldh ); show_box( *x, *y, *w, *h ); if ( fd_trackgeometry ) show_geometry( *x, *y, *w, *h ); oldx = *x; oldy = *y; oldw = *w; oldh = *h; } } hide_box( oldx, oldy, *w, *h ); } /*************************************** * Scales a box until the user releases a mouse button ***************************************/ void scale_box( double * x, double * y, double * w, double * h ) { double oldw = 1.0, oldh = 1.0; round_position( x, y, w, h ); while ( ! ready( ) ) { get_mouse_pos( w, h ); *w -= *x; *h -= *y; round_size( x, y, w, h ); if ( *w != oldw || *h != oldh ) { if ( fd_trackgeometry ) show_geometry( *x, *y, *w, *h ); hide_box( *x - 1, *y - 1, oldw, oldh ); show_box( *x - 1, *y - 1, *w, *h ); oldw = *w; oldh = *h; } } hide_box( *x - 1, *y - 1, oldw, oldh ); if ( *w < 0.0 ) { *x += *w; *w = - *w; } if ( *h < 0.0 ) { *y += *h; *h = - *h; } } /*************************************** ***************************************/ void color( unsigned long n ) { static unsigned long oldcol; if ( fd_gc && oldcol != n ) { XSetForeground( fd_display, fd_gc, n ); oldcol = n; } } /*************************************** ***************************************/ void rectf( FL_Coord x1, FL_Coord y1, FL_Coord x2, FL_Coord y2 ) { int x = x1, y = y1, w = x2 - x1, h = y2 - y1; fli_canonicalize_rect( &x, &y, &w, &h ); XFillRectangle( fd_display, main_window, fd_gc, x, y, w, h ); } /*************************************** ***************************************/ void rect( FL_Coord x1, FL_Coord y1, FL_Coord x2, FL_Coord y2 ) { FL_Coord x = x1, y = y1, w = x2 - x1, h = y2 - y1; fli_canonicalize_rect( &x, &y, &w, &h ); XDrawRectangle( fd_display, main_window, fd_gc, x, y, w, h ); } /*************************************** ***************************************/ void fd_clear( int x, int y, int w, int h ) { static GC blk_gc; if ( main_window && w > 0 && h > 0 ) { if ( ! blk_gc ) { blk_gc = XCreateGC( fd_display, main_window, 0, 0 ); XSetForeground( fd_display, blk_gc, fd_black ); } XFillRectangle( fd_display, main_window, blk_gc, x, y, w, h ); } } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fd_forms.c0000664000175000017500000005277412353623325013364 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fd_forms.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * This file is part of the Forms Designer. * * It contains the routines that maintain the collection of * forms on which the program is working. It contains the callback * routines to add forms, change their name, remove them ,etc. * It also contains the routine to draw them and the basic routines * for loading and saving forms. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "fd_main.h" static FRM *forms = NULL; /* The list of forms */ static int fnumb = 0; /* number of forms */ FL_FORM *cur_form = NULL; /* The current form */ /*************************************** * Returns the number of the form ***************************************/ static int get_form_numb( FL_FORM * form ) { int i; for ( i = 0; i < fnumb; i++ ) if ( forms[ i ].form == form ) return i; return -1; } /*************************************** ***************************************/ const char * get_form_name( FL_FORM * form ) { int i; for ( i = 0; i < fnumb; i++ ) if ( forms[ i ].form == form ) return *forms[ i ].fname ? forms[ i ].fname : NULL; return NULL; } /*************************************** * Sets the current form to 'numb' or to NULL when 'numb' is -1 ***************************************/ static void set_form( int numb ) { if ( numb == -1 ) { cur_form = NULL; fl_deselect_browser( fd_control->formbrowser ); } else { cur_form = forms[ numb ].form; set_bounding_box( 0, 0, cur_form->w, cur_form->h ); fl_select_browser_line( fd_control->formbrowser, numb + 1 ); fl_winstepsize( main_window, 1, 1 ); fl_winresize( main_window, cur_form->w, cur_form->h ); if ( fl_display ) XSync( fl_display, 0 ); } fl_deselect_browser( fd_control->objectbrowser ); reset_pallette( ); cur_class = -1; clear_selection( ); fillin_groups( ); redraw_the_form( 1 ); } /*************************************** * Change the current forms background. Called when the main window is resized ***************************************/ void reshape_form_background( FL_Coord neww, FL_Coord newh ) { if ( cur_form && cur_form->first ) { cur_form->w_hr = cur_form->w = cur_form->first->next->w = cur_form->first->next->fr1 = cur_form->first->next->fl2 = neww; cur_form->h_hr = cur_form->h = cur_form->first->next->h = cur_form->first->next->fb1 = cur_form->first->next->ft2 = newh; set_bounding_box( 0, 0, neww, newh ); } } /**** CALLBACK ROUTINES ****/ /*************************************** * Callback routine that is called when the user selects another form * to work on. ***************************************/ void form_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { set_form( fl_get_browser( fd_control->formbrowser ) - 1 ); } /*************************************** * Callback routine called when the user adds a form. ***************************************/ void addform_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { double w = 0, h = 0; FL_Coord xx, yy; static int form_seq; const char *s; const char *sp; FRM *new_forms; int cc = cur_class; static int busy = 0; if ( busy ) return; else busy = 1; new_forms = fl_realloc( forms, ( fnumb + 1 ) * sizeof *forms ); if ( ! new_forms ) { fl_show_alert( "Too many forms", "Running out of memory for forms", NULL, 0 ); busy = 0; return; } else forms = new_forms; /* Make old form invisible */ set_form( -1 ); /* Get boundary */ fl_get_win_size( main_window, &xx, &yy ); set_bounding_box( 0, 0, xx, yy ); w = xx; h = yy; get_new_form_name: if ( ! ( s = fl_show_input( "Enter form name (must be usable as " "a C variable):", "" ) ) || ! *s ) { busy = 0; return; } if ( ! isascii( ( unsigned char ) *s ) || ! ( isalpha( ( unsigned char ) *s ) || *s == '_' ) ) { fl_show_alert( "Error", "Invalid C identifier for form name:", s, 0 ); goto get_new_form_name; } for ( sp = s + 1; *sp; sp++ ) if ( ! isascii( ( unsigned char ) *sp ) || ! ( isalnum( ( unsigned char ) *sp ) || *sp == '_' ) ) { fl_show_alert( "Error", "Invalid C identifier for form name:", s, 0 ); goto get_new_form_name; } /* Create the form */ cur_form = forms[ fnumb ].form = fl_bgn_form( FL_NO_BOX, w, h ); fl_end_form( ); add_an_object( FL_BOX, FL_FLAT_BOX, 0, 0, w, h ); fl_set_form_dblbuffer( cur_form, 1 ); /* Get form name and add it */ strcpy( forms[ fnumb ].fname, s ); if ( ! forms[ fnumb ].fname[ 0 ] ) sprintf( forms[ fnumb ].fname, "form%d", form_seq++ ); fl_add_browser_line( fd_control->formbrowser, forms[ fnumb ].fname ); /* Finish off */ set_form( fnumb++ ); changed = FL_TRUE; if ( cc >= 0 ) select_object_by_class( cc ); busy = 0; } /*************************************** * Callback routine invoked when the user wants to change the name * of the current form ***************************************/ void changename_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { int fn = get_form_numb( cur_form ); const char *s, *cn; int i; FL_OBJECT *o; if ( cur_form == NULL || fn == -1 ) return; get_changed_form_name: if ( ! ( s = fl_show_input( "Enter form name (must be usable as " "a C variable):", forms[ fn ].fname ) ) || ! *s ) return; if ( ! is_valid_c_name( s ) ) { fl_show_alert( "Error", "Invalid C identifier for form name:", s, 0 ); goto get_changed_form_name; } for ( i = 0; i < fnumb; i++ ) { if ( i == fn ) continue; if ( ! strcmp( forms[ i ].fname, s ) ) { fl_show_alert( "Error", "New name is already in use for another " "form", NULL, 0 ); goto get_changed_form_name; } } for ( o = forms[ fn ].form->first; o; o = o->next ) if ( ( cn = get_object_c_name( o ) ) && ! strcmp( s, cn ) ) { fl_show_alert( "Error", "New name is already used for one of the ", "forms objects", 0 ); goto get_changed_form_name; } fli_sstrcpy( forms[ fn ].fname, s, MAX_VAR_LEN ); fl_replace_browser_line( fd_control->formbrowser, fn + 1, forms[ fn ].fname ); changed = FL_TRUE; } /*************************************** * Callback routine invoked when the user wants to change the forms size ***************************************/ void changesize_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { FL_OBJECT *retobj; int fn = get_form_numb( cur_form ); if ( cur_form == NULL || fn == -1 ) return; /* While this form is shown no other should be operational (the user still can resize the forms window, that will automatically set the width and height spinners) */ fl_deactivate_all_forms( ); /* Set up the width and height spinner objects to show the sizes of the current form */ fl_set_spinner_value( fd_resize->width, cur_form->w ); fl_set_spinner_value( fd_resize->height, cur_form->h ); fl_show_form( fd_resize->resize, FL_PLACE_HOTSPOT, FL_TRANSIENT, "Form size" ); fl_update_display( 0 ); fl_winfocus( fd_resize->resize->window ); /* Loop until user clicks the "Dismiss" button */ while ( ( retobj = fl_do_only_forms( ) ) != fd_resize->quit ) { int w; int h; if ( retobj != fd_resize->set_size ) continue; /* User has clicked on the "Set new size" button */ w = FL_nint( fl_get_spinner_value( fd_resize->width ) ); h = FL_nint( fl_get_spinner_value( fd_resize->height ) ); fl_set_spinner_value( fd_resize->width, w ); fl_set_spinner_value( fd_resize->height, h ); if ( w == cur_form->w && h == cur_form->h ) continue; XResizeWindow( flx->display, main_window, w, h ); if ( cur_form && ( cur_form->w > w || cur_form->h > h ) ) { reshape_form_background( w, h ); redraw_the_form( 1 ); } changed = FL_TRUE; } fl_hide_form( fd_resize->resize ); fl_activate_all_forms( ); } /*************************************** * Callback routine for deleting a form ***************************************/ void deleteform_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { int i, fn = get_form_numb( cur_form ); if ( cur_form == NULL || fn == -1 ) return; if ( ! fl_show_question( "Delete current form?", 1 ) ) return; fl_delete_browser_line( fd_control->formbrowser, fn + 1 ); for ( i = fn; i < fnumb - 1; i++ ) forms[ i ] = forms[ i + 1 ]; fnumb--; set_form( -1 ); changed = FL_TRUE; } /**** DRAWING FORMS ****/ /*************************************** * Redraws the form in main window. 'back' indicates whether the background * should be redrawn (when not double-buffering). This avoids flashing. ***************************************/ void redraw_the_form( int back ) { if ( main_window == 0 ) return; fl_winset( main_window ); /* It's possible to have a NULL cur_form, e.g. when adding */ if ( back && ! cur_form ) fd_clear( 0, 0, winw + 1, winh + 1 ); if ( cur_form != NULL ) { cur_form->window = main_window; cur_form->visible = 1; fl_set_form_dblbuffer( cur_form, 1 ); fl_redraw_form( cur_form ); cur_form->window = 0; cur_form->visible = 0; draw_selbox( ); } } /**** LOADING AND SAVING ****/ int fd_magic; /*************************************** ***************************************/ char * append_fd_suffix( const char * fn ) { size_t l = strlen( fn ); char *fname = fl_malloc( l + 4 ); strcpy( fname, fn ); if ( l < 3 || strcmp( fname + l - 3, ".fd" ) ) strcat( fname, ".fd" ); return fname; } /*************************************** * Reads in the very first part of a .fd file ***************************************/ static int load_fd_header( void ) { char *p; int nforms = -1; /* Line with "magic" number must come first, followed by some boilerplate text */ if ( ff_read( "%k", &p ) <= 0 || strcmp( p, "Magic" ) || ff_read( "%d", &fd_magic ) <= 0 || ( fd_magic != MAGIC2 && fd_magic != MAGIC3 && fd_magic != MAGIC4 && fd_magic != MAGIC5 && fd_magic != MAGIC6 ) ) return ff_err( "Wrong type of file" ); if ( fd_magic < MAGIC6 ) { char *tmp = ff_get_filename_copy( ); if ( ! fdopt.conv_only ) fl_show_alert_f( 0, "Warning:\fFile %s\nwas created with an older " "fdesign version,\nthe new output file may not be " "compatible.", tmp ); else M_warn( "", "Warning: File %s was created with an older fdesign " "version, the new output file may not be compatible", tmp ); fli_safe_free( tmp ); } if ( ff_read( "Internal Form Definition File" ) < 0 || ff_read( "(do not change)" ) < 0 ) return ff_err( "Invalid format of file" ); /* Now follows a set of keyword/value pairs. The key "Name" marks the end of the header and the start of the first form definition */ while ( 1 ) { if ( ff_read( "%k", &p ) <= 0 ) return ff_err( "Invalid format of file" ); if ( ! strcmp( p, "Number of forms" ) ) { if ( ff_read( "%d", &nforms ) <= 0 ) return ff_err( "Expected number of forms" ); if ( nforms <= 0 ) return ff_err( "Invalid number of forms" ); } else if ( ! strcmp( p, "Unit of measure" ) ) { if ( ff_read( "%x", &fdopt.unit ) < 0 ) return ff_err( "Expected valid unit of measure" ); fli_cntl.coordUnit = fdopt.unit; /* make_obj uses this */ } else if ( ! strcmp( p, "SnapGrid" ) || ! strcmp( p, "Snap" ) ) { int snap_size; if ( ff_read( "%d", &snap_size ) < 0 ) return ff_err( "Expected snap size" ); if ( snap_size < 0 ) return ff_err( "Invalid snap size" ); set_snap_size( snap_size, 1 ); } else if ( ! strcmp( p, "Border Width" ) ) { int bw; if ( ff_read( "%d", &bw ) < 0 ) return ff_err( "Expected border width" ); if ( bw != FL_BOUND_WIDTH ) fl_set_border_width( fd_bwidth = bw ); } else if ( ! strcmp( p, "Name" ) ) { if ( nforms < 0 ) return ff_err( "Number of forms is missing" ); return nforms; } else return ff_err( "Invalid format of file" ); } return ff_err( "Invalid format of file" ); } /*************************************** * Loads or merges a file with form definitions ***************************************/ int load_forms( int merge, const char * str ) { int i, saved_unit = fdopt.unit, r, nforms; FRM *new_forms; char *fname; /* Try to open the .fd file */ if ( ff_get_fd_file( str, merge ) < 0 ) return -1; if ( ! merge ) { fnumb = 0; fl_clear_browser( fd_control->formbrowser ); } /* Try to read the header of the file (must indicate that there's at least one form */ if ( ( nforms = load_fd_header( ) ) <= 0 ) return -1; if ( ! ( new_forms = fl_realloc( forms, ( fnumb + nforms ) * sizeof *forms ) ) ) return ff_err( "Can't load file, running out of memory" ); forms = new_forms; fname = ff_get_filename_copy( ); /* Now read in all forms - we have already read in the "Name:" key that starts a new form */ r = FF_AT_START_OF_FORM; for ( i = 0; i < nforms && r == FF_AT_START_OF_FORM; i++ ) { char *p; /* First thing to read is the name of the form (which must not be an empty string) */ if ( ff_read( "%v", &p ) < 1 ) { fl_free( fname ); return ff_err( "Failed to read expected form name" ); } if ( ! p || ! *p ) { fli_safe_free( p ); return ff_err( "Expected name of the form" ); } fli_sstrcpy( forms[ fnumb ].fname, p, sizeof forms[ fnumb ].fname ); fli_safe_free( p ); /* Having gotten the name read all the remaining information. We then should either end up at the start of a new form or at the end of the file */ if ( ( r = read_form( ) ) == FF_AT_START_OF_FORM || r == FF_AT_END_OF_FILE ) { forms[ fnumb ].form = cur_form; fl_add_browser_line( fd_control->formbrowser, forms[ fnumb ].fname ); fnumb++; } } /* Check if we're really at the end of the file and as many forms have been found as we were led to expect */ if ( r == FF_AT_START_OF_FORM ) { fl_free( fname ); return ff_err( "More forms found than expected" ); } else if ( r != FF_READ_FAILURE && i < nforms ) { ff_err( "Less forms found than expected" ); fl_free( fname ); return -1; } /* Everything's dandy and we're done with the file */ ff_close( ); set_form( fnumb > 0 ? 0 : -1 ); fli_safe_free( loadedfile ); if ( ! merge ) { loadedfile = rel2abs( fname ); changed = FL_FALSE; } else changed = FL_TRUE; fl_free( fname ); /* Reset active coordinate system to pixel */ fli_cntl.coordUnit = FL_COORD_PIXEL; /* Force output to use the same unit as used in the input when converting directly. The reason is that we don't know the screen DPI. */ if ( ! fdopt.conv_only ) fdopt.unit = saved_unit; fd_magic = 0; return 0; } /*************************************** * Saves the form definitions, returns whether saved ***************************************/ int save_forms( const char *str ) { int i, snap; FILE *fp; char fname[ 1024 ], filename[ 1024 ]; Conv *conv; fl_use_fselector( SAVE_FSELECTOR ); /* Get the filename if necessary */ if ( ! str || ! * str ) { char *dir = NULL; if ( loadedfile && strchr( loadedfile, '/' ) ) { dir = fl_strdup( loadedfile ); *strrchr( dir, '/' ) = '\0'; } else dir = fl_strdup( "" ); str = fl_show_fselector( "Filename to save forms to", dir, "*.fd", "" ); fl_free( dir ); } if ( ! str ) return 0; /* cancel */ if ( ! *str ) { fl_show_alert( "Warning", "No forms were saved.", "", 0 ); return 0; } /* Remove .fd if required */ strcpy( filename, str ); i = strlen( filename ) - 1; if ( ! strcmp( filename + i - 2, ".fd" ) ) filename[ i - 2 ] = '\0'; strcpy( fname, filename ); /* In simple convert mode (i.e. not migrate) there's no need to (re)save the .fd file */ if ( fdopt.conv_only == 1 ) goto emit_code; /* Make the .fd file */ strcat( fname, ".fd" ); make_backup( fname ); if ( ( fp = fopen( fname, "w" ) ) == 0 ) { fl_show_alert_f( 1, "Error\fCannot open file\n%s\nfor writing", fname ); return 0; } snap = get_step_size( ) + 0.1; fprintf( fp, "Magic: %d\n\n" "Internal Form Definition File\n" " (do not change)\n\n" "Number of forms: %d\n" "Unit of measure: %s\n", MAGIC6, fnumb, unit_name( fdopt.unit ) ); if ( fd_bwidth != FL_BOUND_WIDTH && fd_bwidth ) fprintf( fp, "Border Width: %d\n", fd_bwidth ); if ( snap != 10 ) fprintf( fp, "SnapGrid: %d\n", snap ); for ( i = 0; i < fnumb; i++ ) write_form( fp, forms[ i ].form, forms[ i ].fname ); fprintf( fp, "\n==============================\n%s\n", main_name ); fclose( fp ); emit_code: /* If no code is desired, return */ if ( ! fdopt.emit_code ) return 1; conv = convertor + fdopt.language; /* Some converter works on the c code */ if ( conv->need_c_code ) convertor[ FD_C ].convert( filename, forms, fnumb ); if ( conv->convert ) return conv->convert( filename, forms, fnumb ); else if ( conv->extern_convertor ) { char cmdbuf[ 1024 ]; char optbuf[ 512 ]; int status; *optbuf = '\0'; if ( fdopt.emit_main ) strcat( optbuf, "-main " ); if ( fdopt.emit_cb ) strcat( optbuf, "-callback " ); if ( fdopt.altformat ) strcat( optbuf, "-altformat " ); if ( fdopt.compensate ) strcat( optbuf, "-compensate " ); if ( fdopt.output_dir ) { strcat( optbuf, "-dir " ); strcat( optbuf, fdopt.output_dir ); } sprintf( cmdbuf, "%s %s%s", conv->extern_convertor, optbuf, filename ); M_warn( "Convert", "Executing %s", cmdbuf ); if ( fdopt.conv_only ) { if ( ( status = system( cmdbuf ) ) ) M_err( "Output", "Error executing %s\n", cmdbuf ); } else { fl_clear_command_log( ); if ( ( status = fl_exe_command( cmdbuf, 1 ) ) ) { fl_addto_command_log( "\nerror executing " ); fl_addto_command_log( cmdbuf ); fl_show_command_log( FL_FULLBORDER ); } } return status == 0; } else { fprintf( stderr, "Convertor %s for %s not found\n", conv->extern_convertor, conv->lang_name ); return 0; } return 1; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_xyplot.h0000664000175000017500000000215412244217405013613 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifndef SP_XYPLOT_H_ #define SP_XYPLOT_H_ FL_FORM * xyplot_create_spec_form( void ); void xyplot_adjust_spec_form( FL_OBJECT * obj ); void xyplot_fill_in_spec_form( FL_OBJECT * obj ); void xyplot_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ); void xyplot_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ); #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fd_control.c0000664000175000017500000006031112353623325013700 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fd_control.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Form designer Control panel handling */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "fd_main.h" #include "fd/ui_theforms.h" #include "private/pmenu.h" #include "private/pchoice.h" /* All control panel menus, File Object Options etc. have this * common structures */ typedef struct { const char * entry; /* label */ const char * sc; /* shortcut */ void ( * callback )( FL_OBJECT *, /* callback functions */ long ); int n; /* func_cb parameter */ int * p; /* binary value */ } MenuEntry; extern void exit_cb( FL_OBJECT *, long ); extern void saveforms_cb( FL_OBJECT *, long ); /**** FileMenu ******{*/ static MenuEntry fmenu[ ] = { { " Open", "Oo#o", loadforms_cb, 0, 0 }, { " Merge", "Mm#m", mergeforms_cb, 0, 0 }, { " Save", "Ss#s", saveforms_cb, 0, 0 }, { " Save As %l", "Aa#a", saveforms_as_cb, 0, 0 }, { " Exit", "Ee#e", exit_cb, 0, 0 } }; #define NFM ( sizeof fmenu / sizeof *fmenu ) /*************************************** ***************************************/ void filemenu_callback( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { int n = fl_get_menu( ob ) - 1; if ( n >= 0 && fmenu[ n ].callback ) fmenu[ n ].callback( 0, 0 ); } /*************************************** * Exit the program ***************************************/ void exit_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { if ( changed ) { int rep; fl_set_choices_shortcut( "Ss#s", "Ee#e", "Rr#r" ); rep = fl_show_choice( "WARNING", "", "Changes have not been saved.", 3, "Save", "Exit", "Return", 1 ); if ( ( rep == 1 && ! save_forms( NULL ) ) || rep == 3 ) return; } fl_finish( ); exit( 0 ); } /*************************************** * Merge a set of forms with the current ones. ***************************************/ void mergeforms_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { load_forms( FL_TRUE, NULL ); } /*************************************** * Save the current set of forms. ***************************************/ void saveforms_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { changed = ! save_forms( loadedfile); } /*************************************** ***************************************/ void saveforms_as_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { changed = ! save_forms( NULL ); } /*************************************** * Load a new set of forms from a file ***************************************/ void loadforms_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { if ( changed && fl_show_question( "Forms have been changed!\n" "Should I save them?", 1 ) && ! save_forms( NULL ) ) return; load_forms( FL_FALSE, NULL ); } /***** End of FileMenu *****/ /* Group Menu entry */ static MenuEntry gmenu[ ] = { { "New group", "Nn#n", NULL, 7, 0 }, { "Delete Group", "Dd#d", NULL, 8, 0 }, { "Rename Group", "Rr#r", changegroupname_cb, 0, 0 } }; #define NGM ( sizeof gmenu / sizeof *gmenu ) /*************************************** ***************************************/ void groupmenu_callback( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { int n = fl_get_menu( ob ) - 1; if ( n >= 0 ) { if ( gmenu[ n ].callback ) gmenu[ n ].callback( 0, 0 ); else func_cb( 0, gmenu[ n ].n ); } } /* Object menu entry */ static MenuEntry obmenu[ ] = { { "Object Attributes", "Oo#o", 0, 1, 0 }, { "Lower Object", "Ll#l", 0, 2, 0 }, { "Raise Object", "Rr#r", 0, 3, 0 }, { "Show Object", "Ss#s", 0, 5, 0 }, { "Hide Object", "Hh#h", 0, 6, 0 }, { "Cut Object", "Cc#c", 0, 12, 0 }, { "Paste Object", "Pp#p", 0, 10, 0 } }; #define NOBM ( sizeof obmenu / sizeof *obmenu ) /*************************************** ***************************************/ void objectmenu_callback( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { int n = fl_get_menu( ob ) - 1; if ( n >= 0 ) func_cb( 0, obmenu[ n ].n ); } /* form menu entry */ static MenuEntry fmmenu[ ] = { { "New Form", "Nn#n", addform_cb, 0, 0 }, { "Delete Form", "Dd#d", deleteform_cb, 0, 0 }, { "Rename Form", "Rr#r", changename_cb, 0, 0 }, { "Resize Form", "Ss#s", changesize_cb, 0, 0 } }; #define NFMM ( sizeof fmmenu / sizeof *fmmenu ) /*************************************** ***************************************/ void formmenu_callback( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { int n = fl_get_menu( ob ) - 1; if ( n >= 0 && fmmenu[ n ].callback ) fmmenu[ n ].callback( 0, 0 ); } /* Option menu */ static MenuEntry opmenu[ ] = { { "Track Geometry", "Gg#g", 0, 0, &fd_trackgeometry }, { "Show Pallette", "Pp#p", 0, 0, &fd_show_palette }, { "Emit %s UI code", "Ee#e", 0, 0, &fdopt.emit_code }, { "Emit Callback", "Cc#c", 0, 0, &fdopt.emit_cb }, { "Emit Main", "Mm#m", 0, 0, &fdopt.emit_main }, { "Alt Format", "Aa#a", 0, 0, &fdopt.altformat }, { "FS Compensate ", "Ff#f", 0, 0, &fdopt.compensate } }; #define NOPM ( sizeof opmenu / sizeof *opmenu ) /*************************************** ***************************************/ void optionmenu_callback( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { int n = fl_get_menu( ob ) - 1; char buf[ 32 ]; if ( n >= 0 ) { *opmenu[ n ].p = ! *opmenu[ n ].p; sprintf( buf, "%s%%%c", opmenu[ n ].entry, *opmenu[ n ].p ? 'B' : 'b' ); fl_replace_menu_item( fd_control->optionmenu, n + 1, buf ); ( fd_show_palette ? show_pallette : hide_pallette )( ); } } /*************************************** ***************************************/ void reset_pallette_menu_status( void) { fl_set_menu_item_mode( fd_control->optionmenu, 2, FL_PUP_BOX ); fd_show_palette = 0; } /*************************************** ***************************************/ static void deactivate_control( FL_FORM * form FL_UNUSED_ARG, void * data FL_UNUSED_ARG ) { fl_set_object_lcolor( fd_control->title, FL_SLATEBLUE ); fl_set_object_lcolor( fd_control->menubar_group, FL_INACTIVE ); fl_set_object_lcolor( fd_control->shortcut_group, FL_INACTIVE ); fl_set_object_lcolor( fd_control->fkey_group, FL_INACTIVE ); } /*************************************** ***************************************/ static void activate_control( FL_FORM * form FL_UNUSED_ARG, void * data FL_UNUSED_ARG ) { fl_set_object_lcolor( fd_control->title, FL_BLUE ); fl_set_object_lcolor( fd_control->menubar_group, FL_BLACK ); fl_set_object_lcolor( fd_control->shortcut_group, FL_BLACK ); fl_set_object_lcolor( fd_control->fkey_group, FL_BLACK ); } /*************************************** * Initialize the control panel by filling in the menu entries ***************************************/ void control_init( FD_control * ui ) { static int control_initialized; MenuEntry *m, *me; char buf[ 32 ]; int i; if ( control_initialized ) return; control_initialized = 1; #ifdef __sgi fl_set_object_lsize( ui->filemenu, FL_SMALL_SIZE ); fl_set_object_lsize( ui->formmenu, FL_SMALL_SIZE ); fl_set_object_lsize( ui->groupmenu, FL_SMALL_SIZE ); fl_set_object_lsize( ui->objectmenu, FL_SMALL_SIZE ); fl_set_object_lsize( ui->optionmenu, FL_SMALL_SIZE ); #endif fl_set_form_atdeactivate( ui->control, deactivate_control, ui ); fl_set_form_atactivate( ui->control, activate_control, ui ); fl_set_object_dblbuffer( ui->seltype, 1 ); fl_set_object_dblbuffer( ui->selname, 1 ); fl_set_object_dblbuffer( ui->selcb, 1 ); fl_set_object_dblbuffer( ui->sizestatus, 1 ); fl_set_object_dblbuffer( ui->oristatus, 1 ); /* File menu */ for ( m = fmenu, me = m + NFM, i = 1; m < me; m++, i++ ) { fl_addto_menu( ui->filemenu, m->entry ); fl_set_menu_item_shortcut( ui->filemenu, i, m->sc ); } /* Form menu */ for ( m = fmmenu, me = m + NFMM, i = 1; m < me; m++, i++ ) { fl_addto_menu( ui->formmenu, m->entry ); fl_set_menu_item_shortcut( ui->formmenu, i, m->sc ); } /* Group menu */ for ( m = gmenu, me = m + NGM, i = 1; m < me; m++, i++ ) { fl_addto_menu( ui->groupmenu, m->entry ); fl_set_menu_item_shortcut( ui->groupmenu, i, m->sc ); } /* Object menu */ for ( m = obmenu, me = m + NOBM, i = 1; m < me; m++, i++ ) { fl_addto_menu( ui->objectmenu, m->entry ); fl_set_menu_item_shortcut( ui->objectmenu, i, m->sc ); } /* Option menu. all are binary items */ for ( m = opmenu, me = m + NOPM, i = 1; m < me; m++, i++ ) { if ( strncmp( m->entry, "Emit %s", 7 ) == 0 ) { static char tmpbuf[ 128 ]; sprintf( tmpbuf, m->entry, convertor[ fdopt.language ].lang_name ); m->entry = tmpbuf; } sprintf( buf, "%s%%%c", m->entry, * ( m->p ) ? 'B' : 'b' ); fl_addto_menu( ui->optionmenu, buf ); fl_set_menu_item_shortcut( ui->optionmenu, i, m->sc ); } } /* Misc. service routines */ /*************************************** ***************************************/ void show_geometry( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h ) { char buf[ 128 ]; static FL_Coord lx = -1, ly, lw = -1, lh; /* Canonicalize rectangle */ if ( w < 0 ) { x += w; w = -w; } if ( h < 0 ) { y += h; h = -h; } if ( x != lx || y != ly ) { sprintf( buf, "%dx%d", x, y ); fl_set_object_label( fd_control->oristatus, buf ); lx = x; ly = y; } if ( w != lw || h != lh ) { sprintf( buf, "%dx%d", w, h ); fl_set_object_label( fd_control->sizestatus, buf ); lw = w; lh = h; } } /*************************************** ***************************************/ void show_selmessage( FL_OBJECT * sel[ ], int n ) { char objname[ MAX_VAR_LEN ], cbname[ MAX_VAR_LEN ], argname[ MAX_VAR_LEN ]; char buf[ MAX_VAR_LEN ]; get_object_name( sel[ 0 ], objname, cbname, argname ); *buf = '\0'; if ( n == 1 ) sprintf( buf, "%s", find_type_name( sel[ 0 ]->objclass, sel[ 0 ]->type ) ); else { int cnt = n, i; for ( i = 0; i < n; i++ ) if ( sel[ i ]->objclass == FL_BEGIN_GROUP || sel[ i ]->objclass == FL_END_GROUP ) cnt--; sprintf( buf, "%d object selected", cnt ); } fl_set_object_label( fd_control->seltype, buf ); if ( n == 1 ) sprintf( buf, "%s", *objname ? objname : "" ); else *buf = '\0'; fl_set_object_label( fd_control->selname, buf ); if ( n == 1 ) { if ( * cbname ) sprintf( buf, "%s(%s)", cbname, argname ); else strcpy( buf, "" ); } else *buf = '\0'; fl_set_object_label( fd_control->selcb, buf ); } /********* Callback routines for the control panel ***************/ /* * Form designer itself does not use resource settings, but when testing * the newly created forms, resources are turned on. At the moment we * only allow button label size to be changed */ FL_FORM *thetestform; typedef struct { int x, y, w, h; } GEOM; static short *osize = NULL; static GEOM *oldgeom = NULL; static FL_Coord formw, formh; /* original form size */ /*************************************** ***************************************/ static void fix_button_label_size( FL_FORM * form, int save ) { FL_OBJECT *ob; int i; if ( fd_buttonLabelSize == 0 ) return; if ( save ) { for ( i = 0, ob = form->first; ob; ob = ob->next ) if ( ob->objclass == FL_BUTTON ) i++; osize = fl_realloc( osize, i * sizeof *osize ); } for ( i = 0, ob = form->first; ob; ob = ob->next ) { if ( ob->objclass == FL_BUTTON ) { if ( save ) { osize[ i++ ] = ob->lsize; if ( ob->lsize == FL_NORMAL_FONT ) ob->lsize = fd_buttonLabelSize; } else ob->lsize = osize[ i++ ]; } } if ( ! save ) fli_safe_free( osize ); } /*************************************** ***************************************/ static void fix_menu_etc( FL_FORM * form, int save ) { FL_OBJECT *ob; int i; for ( ob = form->first; ob; ob = ob->next ) { if ( ob->objclass != FL_MENU && ob->objclass != FL_CHOICE && ob->objclass != FL_BROWSER && ! ISBUTTON( ob->objclass ) ) continue; if ( ob->objclass == FL_MENU ) { FLI_MENU_SPEC *sp = ob->spec; if ( save ) { if ( sp->numitems > 0 ) for ( i = 1; i <= sp->numitems; i++ ) fli_safe_free( sp->cb[ i ] ); else { fl_addto_menu( ob, "menuitem 1" ); fl_addto_menu( ob, "menuitem 2" ); fl_addto_menu( ob, "menuitem 3" ); fl_addto_menu( ob, "menuitem 4" ); } } else { SuperSPEC *ssp = get_superspec( ob ); if ( sp->numitems == ssp->nlines ) for ( i = 1; i <= sp->numitems; i++ ) if ( ssp->callback[ i ] ) sp->cb[ i ] = ( FL_PUP_CB ) fl_strdup( ssp->callback[ i ] ); else sp->cb[ i ] = NULL; else fl_clear_menu( ob ); } } else if ( ob->objclass == FL_CHOICE ) { FLI_CHOICE_SPEC *sp = ob->spec; if ( save ) { if ( sp->numitems == 0 ) { fl_addto_choice( ob, "choice 1" ); fl_addto_choice( ob, "choice 2" ); fl_addto_choice( ob, "choice 3" ); fl_addto_choice( ob, "choice 4" ); } } else { SuperSPEC *ssp = get_superspec( ob ); if ( sp->numitems != ssp->nlines ) fl_clear_choice( ob ); } } else if ( ob->objclass == FL_BROWSER ) { int nlines = fl_get_browser_maxline( ob ); if ( save ) { if ( nlines == 0 ) { char buf[ 100 ]; for ( i = 0; i < 20; i++ ) { sprintf( buf, "browser line %d", i + 1 ); fl_add_browser_line( ob, buf ); } } } else { SuperSPEC *ssp = get_superspec( ob ); if ( nlines != ssp->nlines ) fl_clear_browser( ob ); } } else if ( ISBUTTON( ob->objclass ) ) { if ( save ) ob->u_ldata = ( ( FL_BUTTON_SPEC * ) ob->spec )->val; else ( ( FL_BUTTON_SPEC * ) ob->spec )->val = ob->u_ldata; } } } /*************************************** * Start a test of the current form ***************************************/ void test_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { int i; FL_OBJECT *ob; GEOM *p; int resizeable; if ( cur_form == NULL ) return; fl_deactivate_form( fd_control->control ); thetestform = cur_form; /* During test, accumulation error might result. Save the old size */ formw = cur_form->w; formh = cur_form->h; for ( i = 0, ob = cur_form->first; ob; ob = ob->next, i++ ) /* empty */ ; p = oldgeom = fl_realloc( oldgeom, i * sizeof *p ); for ( ob = cur_form->first; ob; ob = ob->next, i++, p++ ) { if ( ! ob->parent ) spec_to_superspec( ob ); p->x = ob->x; p->y = ob->y; p->w = ob->w; p->h = ob->h; } /* Change button label size to the one requested */ fix_button_label_size( thetestform, 1 ); fix_menu_etc( thetestform, 1 ); cur_form = NULL; redraw_the_form( 1 ); fl_clear_browser( fd_test->browser ); resizeable = strstr( get_placement( thetestform ), "FREE" ) != NULL; if ( resizeable ) { fl_set_form_minsize( thetestform, formw >= 10 ? formw / 2 : formw, formh >= 10 ? formh / 2 : formh ); fl_set_form_maxsize( thetestform, fl_scrw, fl_scrh ); } else { fl_set_form_minsize( thetestform, formw, formh ); fl_set_form_maxsize( thetestform, formw, formh ); } fl_show_form( thetestform, resizeable ? FL_PLACE_CENTERFREE : FL_PLACE_CENTER, FL_FULLBORDER, "Test Form" ); fl_show_form( fd_test->test, FL_PLACE_POSITION | FL_PLACE_FREE, FL_FULLBORDER, "Test" ); } /*************************************** * Ends a testing session ***************************************/ void stoptest_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { FL_OBJECT *ob; GEOM *p = oldgeom; if ( thetestform == NULL ) return; fl_hide_form( fd_test->test ); fl_hide_form( thetestform ); fix_button_label_size( thetestform, 0 ); fix_menu_etc( thetestform, 0 ); cur_form = thetestform; thetestform = NULL; fl_set_form_size( cur_form, formw, formh ); for ( ob = cur_form->first; ob; ob = ob->next, p++ ) { if ( ! ob->parent ) superspec_to_spec( ob ); ob->x = p->x; ob->y = p->y; ob->w = p->w; ob->h = p->h; } fli_safe_free( oldgeom ); redraw_the_form( 0 ); fl_activate_form( fd_control->control ); } /*************************************** * Shows the align form ***************************************/ void align_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { if ( fd_align->align->visible ) fl_hide_form( fd_align->align ); else { fl_show_form( fd_align->align, FL_PLACE_MOUSE, FL_FULLBORDER, "Alignments" ); XRaiseWindow( flx->display, fd_align->align->window ); } } /*************************************** * Stop showing the align window ***************************************/ void exitalign_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { fl_hide_form( fd_align->align ); } /*************************************** * Does some alignment action ***************************************/ void doalign_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg ) { if ( fd_align->vdata ) free_dupped_selection( fd_align->vdata ); fd_align->vdata = dup_selection( ); align_selection( arg ); } /*************************************** ***************************************/ void undoalign_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { if ( fd_align->vdata ) { set_selection( fd_align->vdata ); /* Only allow undo once */ free_dupped_selection( fd_align->vdata ); fd_align->vdata = NULL; } } /*************************************** ***************************************/ void snap_cb( FL_OBJECT * obj, long arg FL_UNUSED_ARG ) { set_step_size( fl_get_counter_value( obj ) ); } /***** End of alignment stuff */ /*************************************** * The user pressed one of the function keys while in the main form ***************************************/ void func_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg ) { switch ( arg ) { case 1: change_selection( ); redraw_the_form( 0 ); break; case 2: lower_selection( ); redraw_the_form( 0 ); break; case 3: raise_selection( ); redraw_the_form( 0 ); break; case 4: select_all( ); redraw_the_form( 0 ); break; case 5: show_selection( ); redraw_the_form( 0 ); break; case 6: hide_selection( ); redraw_the_form( 0 ); break; case 7: group_selection( ); break; case 8: flatten_selection( ); break; case 9: copy_selection( ); break; case 10: paste_selection( ); redraw_the_form( 0 ); break; case 11: next_selection( ); break; case 12: cut_selection( ); redraw_the_form( 0 ); break; } } /*************************************** ***************************************/ static void draw_centering_symbol( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle, FL_COLOR col ) { int delta = 4; if ( angle == 0 || angle == 180 ) { fl_draw_symbol( "@->", x, y, w / 2 + delta, h, col ); fl_draw_symbol( "@<-", x + w / 2 - delta, y, w / 2 + delta, h, col ); } else { fl_draw_symbol( "@2->", x, y + 1, w, h / 2 + delta, col ); fl_draw_symbol( "@8->", x, y + h / 2 - delta - 1, w, h / 2 + delta - 1, col ); } } /*************************************** ***************************************/ void init_align( void ) { fl_add_symbol( "-><-", draw_centering_symbol, 0 ); fl_set_object_label( fd_align->hcenter, "@-><-" ); fl_set_object_label( fd_align->vcenter, "@8-><-" ); fl_set_object_helper( fd_align->left, "Flush left" ); fl_set_object_helper( fd_align->hcenter, "Center horizontally" ); fl_set_object_helper( fd_align->hequal, "Equal horizontal distance" ); fl_set_object_helper( fd_align->right, "Flush right" ); fl_set_object_helper( fd_align->top, "Flush top" ); fl_set_object_helper( fd_align->bottom, "Flush bottom" ); fl_set_object_helper( fd_align->vcenter, "Center vertically" ); fl_set_object_helper( fd_align->vequal, "Equal vertical distance" ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_dial.c0000664000175000017500000001743212253056113013162 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file sp_dial.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Settting dial class specific attributes. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "fd_main.h" #include "fd_spec.h" #include "sp_dial.h" #include "private/pdial.h" #include "spec/dial_spec.h" static FD_dialattrib * dial_attrib; static FL_OBJECT * curobj; #define VN( a ) { a, #a } static FLI_VN_PAIR dial_dir[ ] = { VN( FL_DIAL_CW ), VN( FL_DIAL_CCW ), { -1, NULL } }; /*************************************** ***************************************/ int get_direction_value( const char * s ) { return fli_get_vn_value( dial_dir, s ); } /*************************************** ***************************************/ FL_FORM * dial_create_spec_form( void ) { if ( dial_attrib ) return dial_attrib->dialattrib; dial_attrib = create_form_dialattrib( ); fl_addto_choice( dial_attrib->dir, dial_dir[ 0 ].name ); fl_addto_choice( dial_attrib->dir, dial_dir[ 1 ].name ); setup_how_return_menu( dial_attrib->returnsetting ); fl_set_menu_item_mode( dial_attrib->returnsetting, 5, FL_PUP_BOX | FL_PUP_GRAY ); fl_set_menu_item_mode( dial_attrib->returnsetting, 6, FL_PUP_BOX | FL_PUP_GRAY ); return dial_attrib->dialattrib; } /*************************************** ***************************************/ void dial_fill_in_spec_form( FL_OBJECT * obj ) { FLI_DIAL_SPEC *sp = obj->spec; curobj = obj; set_finput_value( dial_attrib->minval, sp->min, -1 ); set_finput_value( dial_attrib->maxval, sp->max, -1 ); set_finput_value( dial_attrib->initialval, sp->val, -1 ); set_finput_value( dial_attrib->thetai, sp->thetai, -1 ); set_finput_value( dial_attrib->thetaf, sp->thetaf, -1 ); set_finput_value( dial_attrib->step, sp->step, -1 ); fl_set_choice_text( dial_attrib->dir, fli_get_vn_name( dial_dir, sp->direction ) ); reset_how_return_menu( dial_attrib->returnsetting, curobj->how_return ); } /*************************************** ***************************************/ void dial_reread_spec_form( FL_OBJECT * obj ) { double r1, r2; int dir = fl_get_choice( dial_attrib->dir ) - 1; if ( get_checked_float( fl_get_input( dial_attrib->minval ), &r1 ) && get_checked_float( fl_get_input( dial_attrib->maxval ), &r2 ) ) fl_set_dial_bounds( obj, r1, r2 ); if ( get_checked_float( fl_get_input( dial_attrib->initialval ), &r1 ) ) fl_set_dial_value( obj, r1 ); if ( get_checked_float( fl_get_input( dial_attrib->thetai ), &r1 ) && get_checked_float( fl_get_input( dial_attrib->thetaf ), &r2 ) ) fl_set_dial_angles( obj, r1, r2 ); if ( get_checked_float( fl_get_input( dial_attrib->step ), &r1 ) ) fl_set_dial_step( obj, r1 ); if ( dir >= 0 ) fl_set_dial_direction( obj, dial_dir[ dir ].val ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void dial_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = fl_create_dial( obj->type, 0, 0, 0, 0, "" ); FLI_DIAL_SPEC *sp = obj->spec, *defsp = defobj->spec; if ( sp->min != defsp->min || sp->max != defsp->max ) fprintf( fp, " bounds: %g %g\n", sp->min, sp->max ); if ( sp->thetai != defsp->thetai || sp->thetaf != defsp->thetaf ) fprintf( fp, " angles: %g %g\n", sp->thetai, sp->thetaf ); if ( sp->val != defsp->val ) fprintf( fp, " value: %g\n", sp->val ); if ( sp->step != defsp->step ) fprintf( fp, " step: %g\n", sp->step ); if ( sp->direction != defsp->direction ) fprintf( fp, " dir: %s\n", fli_get_vn_name( dial_dir, sp->direction ) ); fl_free_object( defobj ); } /*************************************** ***************************************/ void dial_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = fl_create_dial( obj->type, 0, 0, 0, 0, "" ); FLI_DIAL_SPEC *sp = obj->spec, *defsp = defobj->spec; if ( sp->min != defsp->min || sp->max != defsp->max ) fprintf( fp, " fl_set_dial_bounds( obj, %g, %g );\n", sp->min, sp->max ); if ( sp->thetai != defsp->thetai || sp->thetaf != defsp->thetaf ) fprintf( fp, " fl_set_dial_angles( obj, %g, %g );\n", sp->thetai, sp->thetaf ); if ( sp->val != defsp->val ) fprintf( fp, " fl_set_dial_value( obj, %g );\n", sp->val ); if ( sp->step != defsp->step ) fprintf( fp, " fl_set_dial_step( obj, %g );\n", sp->step ); if ( sp->direction != defsp->direction ) fprintf( fp, " fl_set_dial_direction( obj, %s );\n", fli_get_vn_name( dial_dir, sp->direction ) ); fl_free_object( defobj ); } /*************************************** ***************************************/ void dial_minmax_change( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_set_dial_bounds( curobj, get_finput_value( dial_attrib->minval ), get_finput_value( dial_attrib->maxval ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void dial_thetachange_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_set_dial_angles( curobj, get_finput_value( dial_attrib->thetai ), get_finput_value( dial_attrib->thetaf )); redraw_the_form( 0 ); } /*************************************** ***************************************/ void dial_stepchange_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_set_dial_step( curobj, get_finput_value( dial_attrib->step ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void dial_initialvalue_change( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_set_dial_value( curobj, get_finput_value( dial_attrib->initialval ) ); redraw_the_form( 0 ); } /*************************************** * direction change ***************************************/ void dir_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { int dir = fl_get_choice( dial_attrib->dir ) - 1; if ( dir >= 0 ) { fl_set_dial_direction( dial_attrib->vdata, dial_dir[ dir ].val ); redraw_the_form( 0 ); } } /*************************************** ***************************************/ void dial_returnsetting_change( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { handle_how_return_changes( dial_attrib->returnsetting, curobj ); } #include "spec/dial_spec.c" /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fd_main.c0000664000175000017500000007403212353623325013151 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fd_main.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * This is the main module of the Form Designer, a program that * helps you to design form in a fully interactive way. It * automatically generates the corresponding C-code. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "fd_main.h" #include "fd/ui_theforms.h" #include "xpm/fd_logo.xpm" #include #include #include #if defined( __EMX__ ) || defined( WIN32 ) #define strcasecmp stricmp #endif #if defined __VMS && __VMS_VER < 70000000 extern int strcasecmp( const char *, const char * ); #endif /*************************************** * Info about the program ***************************************/ #define S( a ) #a #define LIBVERSION( a, b ) S( a ) "." S( b ) static const char *fd_version[ ] = { "fdesign (FORM Designer) " LIBVERSION( FL_VERSION, FL_REVISION ) "." FL_FIXLEVEL, "Copyright (c) 1996-2002 by T.C. Zhao and Mark Overmars", "GNU Lesser General Public License sinc 2002", NULL }; /*************************************** ***************************************/ static void print_version( int die ) { const char **p = fd_version; for ( ; *p; p++ ) fprintf( stderr, "%s\n", *p ); if ( die ) exit( 0 ); } char xform_header[ 128 ] = "forms.h"; char glcanvas_header[ 128 ] = "glcanvas.h"; long main_window = 0; /* The main screen window */ FL_Coord winw, winh; /* Various options of the program */ FD_Opt fdopt; Conv convertor[ MAX_CONVERTOR + 1 ]; int fd_cntlborder; int fd_bwidth; int is_pasting; int fd_trackgeometry = 1; int fd_show_palette; int fd_buttonLabelSize; int fd_helpfontsize = 14; int fd_align_fontsize = FL_TINY_SIZE; int fd_type_fontsize = FL_TINY_SIZE; int no_selection = 0; GC fd_gc; Colormap fd_colormap; unsigned long fd_red, fd_black, fd_white, fd_col; Display * fd_display; int changed = FL_FALSE; /* whether something has changed. */ char main_name[ MAX_VAR_LEN ]; /* name of the main calling routine */ char * loadedfile; /*************************************** * Lets the user add some object to the form ***************************************/ static void add_something( void ) { FL_OBJECT *obj; double xx, yy, ww = 0.0, hh = 0.0; if ( ! cur_form ) return; fl_winset( main_window ); get_mouse_pos( &xx, &yy ); scale_box( &xx, &yy, &ww, &hh ); if ( ww < 5.0 || hh < 5.0 ) return; obj = add_an_object( cur_class, -1, xx, yy, ww, hh ); clear_selection( ); addto_selection( obj ); changed = FL_TRUE; /* Reset the object type selection */ fl_deselect_browser( fd_control->objectbrowser ); reset_pallette( ); cur_class = -1; } /*************************************** * Changes the main calling name. ***************************************/ void mainname_cb( FL_OBJECT * obj FL_UNUSED_ARG, long arg FL_UNUSED_ARG ) { const char *s; if ( ! ( s = fl_show_input( "Main creation routine name:", main_name ) ) ) return; if ( *s ) strcpy( main_name, s ); else strcpy( main_name, "create_the_forms" ); changed = FL_TRUE; } /*************************************** ***************************************/ static int double_click( const XEvent * xev ) { static Time lasttime; static unsigned int lastbut; static int lastx, lasty; int dblclk, x = xev->xbutton.x, y = xev->xbutton.y; dblclk = xev->xbutton.button == lastbut && xev->xbutton.time - lasttime < FL_CLICK_TIMEOUT && lastx == x && lasty == y; lasttime = xev->xbutton.time; lastbut = xev->xbutton.button; lastx = x; lasty = y; return dblclk; } /*************************************** * Handle mouse click inside the working window ***************************************/ static int handle_click( XEvent * xev, void * p FL_UNUSED_ARG ) { int dblclk = double_click( xev ); /* If no form exists yet ask the user to create it */ if ( ! cur_form ) { addform_cb( NULL, 0 ); return 0; } if ( no_selection ) return 0; if ( dblclk ) { if ( xev->xbutton.button == 3 ) cut_selection( ); else if ( xev->xbutton.button == 1 && cur_class < 0 ) change_selection( ); redraw_the_form( 0 ); return 0; } if ( xev->xbutton.button == 1 && cur_class >= 0 ) { XEvent ev; XNextEvent( fl_display, &ev ); if ( ev.type == MotionNotify ) add_something( ); } else if ( xev->xbutton.button == 3 && cur_class >= 0 ) { cur_class = -1; fl_deselect_browser( fd_control->objectbrowser ); select_pallette_entry( cur_class ); } else if ( is_pasting ) /* empty */; else if ( within_selection( xev->xbutton.x, xev->xbutton.y ) && xev->xbutton.button != 3 ) { XEvent ev; XNextEvent( fl_display, &ev ); if ( ev.type == MotionNotify ) handle_move( xev ); else if ( ev.type == ButtonRelease ) handle_select( &ev ); } else handle_select( xev ); redraw_the_form( 0 ); return 0; } /*************************************** ***************************************/ static void handle_keypress( const XKeyEvent * xev ) { KeySym keysym; char keybuf[ 128 ]; int stp = get_snap_size( ); int shift = ShiftIsDown( xev->state ); XLookupString( ( XKeyEvent * ) xev, keybuf, sizeof keybuf, &keysym, 0 ); if ( keysym >= XK_F1 && keysym <= XK_F12 ) func_cb( 0, keysym - XK_F1 + 1 ); else if ( IsRight( keysym ) ) ( shift ? resize_selection : move_selection )( stp, 0 ); else if ( IsLeft( keysym ) ) ( shift ? resize_selection : move_selection )( -stp, 0 ); else if ( IsUp( keysym ) ) ( shift ? resize_selection : move_selection )( 0, -stp ); else if ( IsDown( keysym ) ) ( shift ? resize_selection : move_selection )( 0, stp ); else if ( keysym == XK_Escape ) exit_cb( 0, 0 ); else if ( keysym == XK_t || keysym == XK_T ) ( fd_test->test->visible ? stoptest_cb : test_cb )( 0, 0 ); else if ( keysym == XK_s || keysym == XK_S ) saveforms_as_cb( 0, 0 ); else if ( IsTab( keysym ) ) ( shift ? prev_selection : next_selection )( ); else if ( keysym >= '0' && keysym <= '9' ) { if ( ( stp = keysym - '0' ) == 0 ) stp = 10; set_snap_size( stp, 1 ); } } /*************************************** * Process events on the main window. Since rubber band was implemented * badly, can't use buttonpress callback ***************************************/ static void process_xevent( void ) { XEvent xev; fl_XNextEvent( &xev ); fli_xevent_name( "fd_main", &xev ); fl_winset( main_window ); switch ( xev.type ) { case KeyPress: handle_keypress( ( XKeyEvent * ) & xev ); break; } } /*************************************** * The main event handling loop. ***************************************/ static void main_loop( void ) { FL_OBJECT *obj; char str[ 3 * MAX_VAR_LEN + 20 ], name[ MAX_VAR_LEN ]; char cbname[ MAX_VAR_LEN ], argname[ MAX_VAR_LEN ]; while ( 1 ) { obj = fl_do_forms( ); /* Check whether we're just testing a form */ if ( thetestform != NULL && obj != FL_EVENT ) { get_object_name( obj, name, cbname, argname ); if ( ! *name ) strcpy( name, "" ); if ( ! *cbname ) sprintf( str, "Called: %s( %s, %s );", cbname, name, argname ); else sprintf( str, "Returned: %s", name ); fl_addto_browser( fd_test->browser, str ); } if ( obj == FL_EVENT ) process_xevent( ); } } #define DEFGeom "320x250+150+420" /* working area geometry */ #define DEFcntlGeom "+150+1" /* control panel position */ #define DEFattribGeom "+210+25" /* Attributes panel position */ #define DEFtestGeom "-275+2" /* Test panel position */ #define DEFalignGeom "-1+1" /* align panel position */ #define DEFhelpGeom "-1+1" /* Help panel position */ static FL_CMD_OPT fd_cmdopt[ ] = { { "-geometry", "*geometry", XrmoptionSepArg, NULL }, { "-border", ".XForm.Border", XrmoptionNoArg, "1" }, { "-convert", ".convert", XrmoptionNoArg, "1" }, { "-dir", ".dir", XrmoptionSepArg, NULL }, { "-unit", "*unit", XrmoptionSepArg, NULL }, { "-altformat", "*altformat", XrmoptionNoArg, "1" }, { "-I", "*xformHeader", XrmoptionSepArg, NULL }, { "-G", "*glcanvasHeader", XrmoptionSepArg, NULL }, { "-main", "*main", XrmoptionNoArg, "1" }, { "-callback", "*callback", XrmoptionNoArg, "1" }, { "-lax", "*lax", XrmoptionNoArg, "1" }, { "-nocode", "*nocode", XrmoptionNoArg, "0" }, { "-version", ".fdversion", XrmoptionNoArg, "1" }, { "-compensate", ".compensate", XrmoptionNoArg, "1" }, { "-ada", ".language", XrmoptionNoArg, "ada95" }, { "-ada95", ".language", XrmoptionNoArg, "ada95" }, { "-perl", ".language", XrmoptionNoArg, "perl" }, { "-python", ".language", XrmoptionNoArg, "python" }, { "-fortran", ".language", XrmoptionNoArg, "fortran" }, { "-pascal", ".language", XrmoptionNoArg, "pascal" }, { "-scm", ".language", XrmoptionNoArg, "scm" }, { "-ps", ".language", XrmoptionNoArg, "ps" }, { "-filter", ".filter", XrmoptionSepArg, NULL }, { "-migrate", ".migrate", XrmoptionNoArg, "1" }, { "-help", ".help", XrmoptionNoArg, "1" } }; #define Ncopt ( sizeof fd_cmdopt / sizeof *fd_cmdopt ) /* resources */ #define NG 64 static char fdgeom[ NG ] = DEFGeom; static char fdcntlgeom[ NG ] = DEFcntlGeom; static char fdattribgeom[ NG ] = DEFattribGeom; static char fdtestgeom[ NG ] = DEFtestGeom; static char fdaligngeom[ NG ] = DEFalignGeom; static char fdhelpgeom[ NG ] = DEFhelpGeom; static char fd_attrib_col[ NG ]; static char fd_sunit[ 32 ]; static char fd_slanguage[ 32 ]; static char fd_sfilter[ 32 ]; static FL_resource fdres[ ] = { { "formDesign.geometry", "Geometry", FL_STRING, fdgeom, 0, NG }, { "workingArea.geometry", "Geometry", FL_STRING, fdgeom, 0, NG }, { "control.geometry", "Control.Geometry", FL_STRING, fdcntlgeom, 0, NG }, { "attributes.geometry", "Attributes.Geometry", FL_STRING, fdattribgeom, 0, NG }, { "attributes.background", "Attributes.Background", FL_STRING, fd_attrib_col, 0, NG }, { "test.geometry", "Test.Geometry", FL_STRING, fdtestgeom, 0, NG }, { "help.geometry", "Help.Geometry", FL_STRING, fdhelpgeom, 0, NG }, { "align.geometry", "Align.Geometry", FL_STRING, fdaligngeom, 0, NG }, { "control.border", "XForm.Border", FL_BOOL, &fd_cntlborder, "0", 0 }, { "convert", "Convert", FL_BOOL, &fdopt.conv_only, "0", 0 }, { "migrate", "Migrate", FL_BOOL, &fdopt.conv_only, "0", 0 }, { "compensate", "Compensate", FL_BOOL, &fdopt.compensate, "0", 0 }, { "unit", "Unit", FL_STRING, fd_sunit, "pixel", 30 }, { "language", "Language", FL_STRING, fd_slanguage, "C", 30 }, { "filter", "Filter", FL_STRING, fd_sfilter, 0, 30 }, { "xformHeader", "XFormHeader", FL_STRING, xform_header, "forms.h", 128 }, { "glcanvasHeader", "GLCanvasHeader", FL_STRING, glcanvas_header, "glcanvas.h", 128 }, { "altformat", "AltFormat", FL_BOOL, &fdopt.altformat, "0", 0 }, { "helpFontSize", "HelpFontSize", FL_INT, &fd_helpfontsize, "12", 0 }, { "nocode", "NoCode", FL_BOOL, &fdopt.emit_code, "1", 0 }, { "main", "Main", FL_BOOL, &fdopt.emit_main, "0", 0 }, { "callback", "Callback", FL_BOOL, &fdopt.emit_cb, "0", 0 }, { "lax", "Lax", FL_BOOL, &fdopt.lax, "0", 0 }, }; #define Nropt ( sizeof fdres / sizeof *fdres ) char *helps[ ] = { "-help this message", "-display host:dpy display name", "-name appname change app name", "-border add border to control panel", "-unit {mm|point|pixel|cp|cmm} unit of measure. Default pixel", "-nocode supress code generation", "-main emit main program template", "-callback emit callback stubs", "-altformat select alternative output format", "-compensate emit font/server compensation code", "-lax go easy on syntax checking", "-I headername alternate header file (forms.h default)", "-G glcanvas headername alternate glcanvas header file (glcanvas.h default)", "-convert file-list convert .fd to code non-interactively", "-migrate file-list convert & migrate .fd list non-interactively", "-dir destdir output any generated files in destdir", "-geometry geom initial working area geometry", 0, }; /*************************************** ***************************************/ static void usage( char * s, int die ) { char **q = helps; Conv *cv = convertor; fprintf( stderr, "usage: %s: [options] [file.fd]\n", s ); fprintf( stderr, " where options are\n" ); for ( ; *q; q++ ) fprintf( stderr, " %s\n", *q ); fprintf( stderr, " Language Options\n " ); for ( cv += 2; cv->lang_name; cv++ ) fprintf( stderr, "-%s ", cv->lang_name ); fprintf( stderr, "\n -filter f filter name" ); fprintf( stderr, "\n\n See also the online Help for resources info\n" ); if ( die ) exit( 1 ); } /*************************************** ***************************************/ static int lang_val( const char *s ) { int i; for ( i = 1; i < MAX_CONVERTOR; i++ ) if ( strcasecmp( s, convertor[ i ].lang_name ) == 0 || strncmp( s, convertor[ i ].lang_name, 3 ) == 0 ) return i; return FD_C; } static int ignored_fake_configure; /*************************************** ***************************************/ static int handle_configure( XEvent * xev, void * p FL_UNUSED_ARG ) { /* Some window managers sends bogus configure events. Make a note of it */ if ( xev->xconfigure.send_event ) ignored_fake_configure = winw != xev->xconfigure.width && winh != xev->xconfigure.height; else { winw = xev->xconfigure.width; winh = xev->xconfigure.height; if ( cur_form && ( cur_form->w > winw || cur_form->h > winh ) ) { reshape_form_background( winw, winh ); redraw_the_form( 1 ); } if ( fd_resize->resize->visible ) { fl_set_spinner_value( fd_resize->width, winw ); fl_set_spinner_value( fd_resize->height, winh ); } changed = FL_TRUE; } return 1; } /*************************************** ***************************************/ static int handle_expose( XEvent * xev, void * p FL_UNUSED_ARG ) { if ( xev->xexpose.count == 0 ) { M_warn( "FD_Expose", "" ); /* If we have ignored a previous configure event, need the window size might not be correct. Re-read */ if ( ignored_fake_configure ) fl_get_winsize( main_window, &winw, &winh ); /* Change form background size */ if ( cur_form && ( cur_form->w != winw || cur_form->h != winh ) ) reshape_form_background( winw, winh ); redraw_the_form( 1 ); ignored_fake_configure = 0; return 1; } return 0; } /*************************************** * Need the ability to convert/help without requiring an X connection. ***************************************/ static void pre_connect( int argc, char * argv[ ] ) { int i, s; static char filter[ 128 ]; for ( i = 1; i < argc && *argv[ i ] == '-'; i++ ) { if ( strncmp( argv[ i ] + 1, "help", 1 ) == 0 ) usage( argv[ 0 ], 1 ); else if ( strncmp( argv[ i ] + 1, "version", 4 ) == 0 ) print_version( 1 ); else if ( strncmp( argv[ i ] + 1, "altformat", 3 ) == 0 ) fdopt.altformat = 1; else if ( strncmp( argv[ i ] + 1, "callback", 3 ) == 0 ) fdopt.emit_cb = 1; else if ( strncmp( argv[ i ] + 1, "compensate", 4 ) == 0 ) fdopt.compensate = 1; else if ( strncmp( argv[ i ] + 1, "main", 3 ) == 0 ) fdopt.emit_main = 1; else if ( strncmp( argv[ i ] + 1, "noc", 3 ) == 0 ) fdopt.emit_code = 0; else if ( strncmp( argv[ i ] + 1, "unit", 4 ) == 0 && i + 1 < argc ) fdopt.unit = unit_val( argv[ ++i ] ); else if ( strncmp( argv[ i ] + 1, "filter", 4 ) == 0 && i + 1 < argc ) strcpy( filter, argv[ ++i ] ); else if ( strncmp( argv[ i ], "-I", 2 ) == 0 ) { if ( argv[ i ][ 2 ] != '\0' ) strcpy( xform_header, argv[ i ] + 2 ); else if ( i + 1 < argc ) strcpy( xform_header, argv[ ++i ] ); } else if ( strcmp( argv[ i ], "-G" ) == 0 && i + 1 < argc ) strcpy( glcanvas_header, argv[ ++i ] ); else if ( strcmp( argv[ i ], "-bw" ) == 0 && i + 1 < argc ) fd_bwidth = atoi( argv[ ++i ] ); else if ( strncmp( argv[ i ] + 1, "convert", 1 ) == 0 ) { fli_no_connection = 1; fli_internal_init( ); fdopt.conv_only = 1; } else if ( strncmp( argv[ i ] + 1, "migrate", 1 ) == 0 ) { fli_no_connection = 1; fli_internal_init( ); fdopt.conv_only = 2; } else if ( strncmp( argv[ i ] + 1, "dir", 3 ) == 0 && i + 1 < argc ) { fdopt.output_dir = malloc( strlen( argv[ ++i ] ) + 1 ); strcpy( fdopt.output_dir, argv[ i ] ); } else if ( strncmp( argv[ i ] + 1, "lang", 4 ) == 0 && i + 1 < argc ) fdopt.language = lang_val( argv[ ++i ] ); else fdopt.language = lang_val( argv[ i ] + 1 ); } if ( fdopt.language < FD_C || fdopt.language > FD_EXP ) fdopt.language = FD_C; if ( filter[ 0 ] ) convertor[ fdopt.language ].extern_convertor = filter; if ( convertor[ fdopt.language ].init ) convertor[ fdopt.language ].init( ); /* No need to check for C syntax if not C program */ if ( fdopt.language != FD_C ) fdopt.lax = 1; if ( ! fdopt.conv_only ) return; fli_set_app_name( argv[ 0 ], "Fdesign" ); /* resource routine needs it */ fli_init_context( ); create_the_forms( ); init_classes( ); fl_dpi = 96; if ( i > argc - 1 ) { if ( fdopt.conv_only == 1 ) fprintf( stderr, "'-convert' requires argument(s)\n" ); else fprintf( stderr, "'-migrate' requires argument(s)\n" ); usage( argv[ 0 ], 1 ); } for ( s = i; s < argc; s++ ) { reset_object_list( ); if ( load_forms( FL_FALSE, argv[ s ] ) < 0 ) { fprintf( stderr, "Unable to load '%s'\n", argv[ s ] ); exit( 1 ); } if ( ! save_forms( argv[ s ] ) ) { fprintf( stderr, "Unable to convert '%s'\n", argv[ s ] ); exit( 1 ); } } exit( 0 ); } /*************************************** ***************************************/ static int parse_geometry( const char * gstr, int * x, int * y, unsigned int * w, unsigned int * h ) { int s; s = XParseGeometry( ( char * ) gstr, x, y, w, h ); if ( s & XValue && s & XNegative ) *x = fl_scrw - FL_abs( *x ); if ( s & YValue && s & YNegative ) *y = fl_scrh - FL_abs( *y ); return s; } #include /*************************************** ***************************************/ static void interrupted( int s FL_UNUSED_ARG, void * data FL_UNUSED_ARG ) { exit_cb( 0, 0 ); } /*************************************** * Default action for delete window client message ***************************************/ static int delete_handler( FL_FORM * form FL_UNUSED_ARG, void * data FL_UNUSED_ARG ) { if ( changed && fl_show_question( "Changes have not been saved\n" "Save them now ?", 1 ) && ! save_forms( NULL ) ) return FL_IGNORE; exit( 0 ); return 0; /* shut up compiler */ } /*************************************** * Always output perl code in altformat ***************************************/ static void perl_init( void ) { fdopt.altformat = 1; } /*************************************** ***************************************/ static void initialize( void ) { fdopt.conv_only = 0; fdopt.language = FD_C; fdopt.emit_code = 1; convertor[ FD_EXP ].lang_name = "exp"; convertor[ MAX_CONVERTOR ].lang_name = NULL; convertor[ FD_C ].lang_name = "C"; convertor[ FD_C ].convert = C_output; convertor[ FD_ADA95 ].lang_name = "ada"; convertor[ FD_ADA95 ].extern_convertor = "flc2ada"; convertor[ FD_ADA95 ].need_c_code = 1; convertor[ FD_PASCAL ].lang_name = "pascal"; convertor[ FD_PASCAL ].extern_convertor = "fd2pascal"; convertor[ FD_PS ].lang_name = "ps"; convertor[ FD_PS ].extern_convertor = "fd2ps"; convertor[ FD_PERL ].lang_name = "perl"; convertor[ FD_PERL ].need_c_code = 1; convertor[ FD_PERL ].extern_convertor = "fd2perl"; convertor[ FD_PERL ].init = perl_init; convertor[ FD_PYTHON ].lang_name = "python"; convertor[ FD_PYTHON ].extern_convertor = "fd2python"; convertor[ FD_FORTRAN ].lang_name = "fortran"; convertor[ FD_FORTRAN ].extern_convertor = "fd2fortran"; convertor[ FD_SCM ].lang_name = "scm"; convertor[ FD_SCM ].extern_convertor = "fd2scm"; } /*************************************** ***************************************/ static int ignore_close( FL_FORM *a FL_UNUSED_ARG, void *b FL_UNUSED_ARG ) { return FL_IGNORE; } /*************************************** ***************************************/ int main( int argc, char * argv[ ] ) { unsigned int w = 0, h = 0; int x = 0, y = 0, s, version, revision; FL_IOPT cntl; unsigned int mask; char *tmp = NULL; /* Before doing anything, check to make sure the library is made correctly */ if ( FL_INCLUDE_VERSION != fl_library_version( &version, &revision ) ) { fprintf( stderr, "Library and header mismatch\n" ); fprintf( stderr, " Header Version:%d.%d.%s\n", FL_VERSION, FL_REVISION, FL_FIXLEVEL ); fprintf( stderr, " Library version:%d.%d\n", version, revision ); } initialize( ); /* For conversion, version and usage help, we don't need a connection. pre_connect will exit in such circumstances. */ pre_connect( argc, argv ); /* Force fdesign to come up in default visual */ cntl.vclass = FL_DefaultVisual; cntl.doubleBuffer = 0; cntl.browserFontSize = FL_NORMAL_FONT; mask = FL_PDVisual | FL_PDDouble | FL_PDBrowserFontSize; cntl.sharedColormap = 1; mask |= FL_PDSharedMap; fl_set_defaults( mask, &cntl ); if ( ! ( fd_display = fl_initialize( &argc, argv, 0, fd_cmdopt, Ncopt ) ) ) exit( 1 ); fl_get_app_resources( fdres, Nropt ); fl_add_signal_callback( SIGINT, interrupted, 0 ); if ( argv[ 1 ] && argv[ 1 ][ 0 ] == '-' ) { fprintf( stderr, " Unknown option: %s\n", argv[ 1 ] ); usage( argv[ 0 ], 1 ); } fli_cntl.coordUnit = FL_COORD_PIXEL; fdopt.unit = unit_val( fd_sunit ); fdopt.language = lang_val( fd_slanguage ); if ( *fd_sfilter ) convertor[ fdopt.language ].extern_convertor = fd_sfilter; /* No need to check for C syntax if not C program */ if ( fdopt.language != FD_C ) fdopt.lax = 1; if ( convertor[ fdopt.language ].init ) convertor[ fdopt.language ].init( ); fd_bwidth = fli_cntl.borderWidth; M_warn( "fdesign", "UNIT=%s BW=%d", unit_name( fdopt.unit ), fd_bwidth ); create_the_forms( ); fl_set_atclose( delete_handler, 0 ); /* Must suspend user requested button label font throughout fdesign and enable it only when testing */ fd_buttonLabelSize = fli_cntl.buttonFontSize; fli_cntl.buttonFontSize = 0; /* Initialize stuff */ init_classes( ); fl_set_counter_bounds( fd_align->snapobj, 1.0, 500.0 ); fl_set_counter_step( fd_align->snapobj, 1.0, 5.0 ); fl_set_counter_value( fd_align->snapobj, 10.0 ); fl_set_counter_precision( fd_align->snapobj, 0 ); fl_set_form_atclose( fd_align->align, ignore_close, NULL ); fl_set_spinner_bounds( fd_resize->width, 1, SHRT_MAX ); fl_set_spinner_bounds( fd_resize->height, 1, SHRT_MAX ); fl_set_form_atclose( fd_resize->resize, ignore_close, NULL ); fl_set_form_atclose( fd_attrib->attrib, ignore_close, NULL ); fl_set_form_atclose( fd_attrib->attrib, ignore_close, NULL ); fl_set_form_atclose( fd_test->test, ignore_close, NULL ); fl_set_form_atclose( fd_help->helpform, ignore_close, NULL ); thetestform = NULL; strcpy( main_name, "create_the_forms" ); /* Load files */ /* If only one argument is given and the file does not exist, we can assume that the intention is to create a new file so we don't bother to try to load it */ if ( argc >= 2 && access( tmp = append_fd_suffix( argv[ argc - 1 ] ), R_OK ) == 0 ) { for ( s = 1; s < argc; s++ ) if ( load_forms( s == 1 ? FL_FALSE : FL_TRUE, argv[ s ] ) < 0 ) break; } else { select_object_by_class( FL_BUTTON ); select_pallette_entry( FL_BUTTON ); } fli_safe_free( tmp ); /* Do auto-naming for single file only */ if ( argc == 2 ) loadedfile = rel2abs( argv[ 1 ] ); /* See if color change */ if ( fd_attrib_col[ 0 ] ) { long c = FL_FREE_COL1 - 10; fl_mapcolor_name( c, fd_attrib_col ); modify_attrib_basic_color( c, c ); } parse_geometry( fdcntlgeom, &x, &y, &w, &h ); fl_set_form_position( fd_control->control, x, y ); fl_set_app_mainform( fd_control->control ); fli_set_form_icon_data( fd_control->control, fd_logo_pixels ); fl_show_form( fd_control->control, FL_PLACE_GEOMETRY, ( 1 || fd_cntlborder ) ? FL_FULLBORDER : FL_TRANSIENT, "Control" ); /* Other geometries */ parse_geometry( fdattribgeom, &x, &y, &w, &h ); fl_set_form_position( fd_attrib->attrib, x, y ); parse_geometry( fdtestgeom, &x, &y, &w, &h ); fl_set_form_position( fd_test->test, x, y ); parse_geometry( fdaligngeom, &x, &y, &w, &h ); fl_set_form_position( fd_align->align, x, y ); parse_geometry( fdhelpgeom, &x, &y, &w, &h ); fl_set_form_position( fd_help->helpform, x, y ); s = parse_geometry( fdgeom, &x, &y, &w, &h ); if ( s & XValue || s & YValue ) fl_winposition( x, y ); if ( s & WidthValue && s & HeightValue ) fl_initial_winsize( w, h ); /* If a form is already loaded, use that size */ if ( cur_form ) { y -= cur_form->h - h; w = cur_form->w; h = cur_form->h; fl_initial_wingeometry( x, y, w, h ); } winw = w; winh = h; fd_colormap = fl_state[ fl_vmode ].colormap; fd_white = fl_get_flcolor( FL_WHITE ); fd_red = fl_get_flcolor( FL_RED ); fd_black = fl_get_flcolor( FL_BLACK ); fd_col = fl_get_flcolor( FL_COL1 ); main_window = fli_cmap_winopen( fl_root, fd_colormap, "Form Design" ); fl_set_fselector_transient( 1 ); fl_add_event_callback( main_window, Expose, handle_expose, 0 ); fl_add_event_callback( main_window, ConfigureNotify, handle_configure, 0 ); fl_add_event_callback( main_window, ButtonPress, handle_click, 0 ); fl_addto_selected_xevent( main_window, ButtonMotionMask | PointerMotionHintMask ); fl_addto_selected_xevent( main_window, ButtonReleaseMask ); redraw_the_form( 1 ); /* GC is valid only after at least one window is created */ fd_gc = fl_state[ fl_vmode ].gc[ 8 ]; main_loop( ); return 0; } /*************************************** ***************************************/ void set_snap_size( int n, int cb ) { fl_set_counter_value( fd_align->snapobj, n > 0 ? n : 5 ); if ( cb ) fl_call_object_callback( fd_align->snapobj ); } /*************************************** ***************************************/ int get_snap_size( void ) { return 0.01 + fl_get_counter_value( fd_align->snapobj ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_pixmap.c0000664000175000017500000002436012253056146013553 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file sp_pixmap.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Settting pixmap/bitmap class specific attributes. Should * be absorbed into button class. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "fd_main.h" #include "fd_spec.h" #include "fd_iconinfo.h" #include #include "sp_pixmap.h" #include "spec/pixmap_spec.h" static FD_pixmapattrib *px_attrib; static FL_OBJECT * curobj; static FL_OBJECT * create_default_pixmap( FL_OBJECT * obj ); static void get_data_name( FL_OBJECT * obj, IconInfo * inf ); /*************************************** ***************************************/ FL_FORM * pixmap_create_spec_form( void ) { if ( px_attrib ) return px_attrib->pixmapattrib; px_attrib = create_form_pixmapattrib( ); fl_addto_choice( px_attrib->pixalign, align_name( FL_ALIGN_CENTER, 0 ) ); fl_addto_choice( px_attrib->pixalign, align_name( FL_ALIGN_TOP, 0 ) ); fl_addto_choice( px_attrib->pixalign, align_name( FL_ALIGN_BOTTOM, 0 ) ); fl_addto_choice( px_attrib->pixalign, align_name( FL_ALIGN_LEFT, 0 ) ); fl_addto_choice( px_attrib->pixalign, align_name( FL_ALIGN_RIGHT, 0 ) ); fl_show_object( px_attrib->pixalign ); fl_set_input_return( px_attrib->filename, FL_RETURN_END ); return px_attrib->pixmapattrib; } /*************************************** ***************************************/ void pixmap_adjust_spec_form( FL_OBJECT * obj ) { curobj = obj; if ( obj->objclass == FL_PIXMAP ) { fl_show_object( px_attrib->pixalign ); fl_set_object_label( px_attrib->frame, "Pixmap Attributes" ); } else { fl_hide_object( px_attrib->pixalign ); fl_set_object_label( px_attrib->frame, "Bitmap Attributes" ); } } /*************************************** ***************************************/ void pixmap_fill_in_spec_form( FL_OBJECT * obj ) { IconInfo *info = get_iconinfo( obj ); fl_set_button( px_attrib->use_data, info->use_data ); fl_set_button( px_attrib->fullpath, info->fullpath ); fl_set_choice_text( px_attrib->pixalign, align_name( info->align, 0 ) ); fl_set_input( px_attrib->filename, info->filename ); } /*************************************** ***************************************/ void pixmap_reread_spec_form( FL_OBJECT * obj FL_UNUSED_ARG ) { if ( curobj ) { pixmap_filename_change( px_attrib->filename, 0 ); redraw_the_form( 0 ); } } /*************************************** ***************************************/ void pixmap_restore_spec( FL_OBJECT * obj ) { IconInfo *info = get_iconinfo( obj ); if ( *info->filename ) { if ( obj->objclass == FL_PIXMAP ) fl_set_pixmap_file( obj, info->filename ); else fl_set_bitmap_file( obj, info->filename ); } else { /* Show the default broken image link image */ if ( obj->objclass == FL_PIXMAP ) set_testing_pixmap( obj ); else set_testing_bitmap( obj ); } if ( obj->objclass == FL_PIXMAP ) fl_set_pixmap_align( obj, info->align, info->dx, info->dy ); } /*************************************** ***************************************/ void pixmap_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = create_default_pixmap( obj ); IconInfo *info = get_iconinfo( obj ), *definfo; get_superspec( defobj ); definfo = get_iconinfo( defobj ); get_data_name( obj, info ); if ( *info->filename ) { fprintf( fp, " file: %s\n", info->filename ); fprintf( fp, " fullpath: %d\n", info->fullpath ); } if ( *info->data && *info->filename ) fprintf( fp, " data: %s\n", info->data ); if ( *info->width ) fprintf( fp, " width: %s\n", info->width ); if ( *info->height ) fprintf( fp, " height: %s\n", info->height ); if ( info->align != definfo->align ) fprintf( fp, " align: %s\n", align_name( fl_to_inside_lalign( info->align ), 0 ) ); free_iconinfo( defobj ); free_superspec( defobj ); fl_free_object( defobj ); } /*************************************** ***************************************/ void pixmap_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = create_default_pixmap( obj ); IconInfo *info = get_iconinfo( obj ), *definfo; get_superspec( defobj ); definfo = get_iconinfo( defobj ); if ( *info->filename && ! info->use_data ) fprintf( fp, " fl_set_%s_file( obj, \"%s\" );\n", obj->objclass == FL_PIXMAP ? "pixmap" : "bitmap", info->filename ); if ( *info->data && info->use_data && *info->filename ) { if ( obj->objclass == FL_PIXMAP ) fprintf( fp, " fl_set_pixmap_data( obj, %s );\n", info->data ); else fprintf( fp, " fl_set_bitmap_data( obj, %s, %s, " "( unsigned char * ) %s );\n", info->width, info->height, info->data ); } if ( obj->objclass == FL_PIXMAP && info->align != definfo->align ) fprintf( fp, " fl_set_pixmap_align( obj, %s, %d, %d );\n", align_name( fl_to_inside_lalign(info->align ), 1 ), info->dx, info->dy ); free_iconinfo( defobj ); free_superspec( defobj ); fl_free_object( defobj ); } /*************************************** ***************************************/ void pixmap_emit_spec_header( FILE * fp, FL_OBJECT * obj ) { IconInfo *info = get_iconinfo( obj ); if ( info->use_data && *info->data && *info->filename ) { const char *fn = info->fullpath ? info->filename : file_tail( info->filename ); if ( ! is_duplicate_info( fn ) ) fprintf( fp, "#include \"%s\"\n", fn ); } } /*************************************** ***************************************/ void pixmapusedata_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { get_iconinfo( curobj )->use_data = fl_get_button( obj ); } /*************************************** ***************************************/ void pixmapfullpath_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { get_iconinfo( curobj )->fullpath = fl_get_button( obj ); } /*************************************** ***************************************/ void pixmap_filename_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { IconInfo *info = get_iconinfo( curobj ); strcpy( info->filename, fl_get_input( obj ) ); if ( *info->filename ) ( curobj->objclass == FL_PIXMAP ? fl_set_pixmap_file : fl_set_bitmap_file ) ( curobj, info->filename ); else { if ( obj->objclass == FL_PIXMAP ) set_testing_pixmap( obj ); else set_testing_bitmap( obj ); } redraw_the_form( 0 ); } /*************************************** ***************************************/ void pixmaplookfor_pixmapfile_cb( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { const char *fn; char buf[ 2048 ]; char *cwd; fl_use_fselector( XPM_FSELECTOR ); fl_set_fselector_placement( FL_PLACE_MOUSE ); if ( curobj->objclass == FL_PIXMAP ) fn = fl_show_fselector( "XPM file", "", "*.xpm", "" ); else fn = fl_show_fselector( "XBM file", "", "*.xbm", "" ); if ( ! fn ) return; cwd = fli_getcwd( buf, sizeof buf - 2 ); if ( cwd && strstr( fn, cwd ) ) fn += strlen( cwd ) + 1; fl_set_input( px_attrib->filename, fn ); fl_call_object_callback( px_attrib->filename ); } /*************************************** ***************************************/ void pixmapalign_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { IconInfo *info = get_iconinfo( curobj ); info->align = fl_to_inside_lalign( align_val( fl_get_choice_text( obj ) ) ); fl_set_pixmap_align( curobj, info->align, info->dx, info->dy ); redraw_the_form( 0 ); } /*************************************** ***************************************/ static FL_OBJECT * create_default_pixmap( FL_OBJECT * obj ) { FL_OBJECT *defobj = NULL; /* Create a default object */ if ( obj->objclass == FL_PIXMAP ) defobj = fl_create_pixmap( obj->type, 0, 0, 0, 0, "" ); else defobj = fl_create_bitmapbutton( obj->type, 0, 0, 0, 0, "" ); return defobj; } /*************************************** ***************************************/ static void get_data_name( FL_OBJECT * ob, IconInfo * info ) { FILE *fp; *info->data = '\0'; *info->width = '\0'; *info->height = '\0'; if ( ! info->use_data || ! *info->filename ) return; if ( ( fp = fopen( info->filename, "r" ) ) ) { if ( ob->objclass == FL_PIXMAP ) get_xpm_stuff( info->data, fp ); else get_xbm_stuff( info, fp ); fclose( fp ); } if ( ! fp || ! *info->data ) { fprintf( stderr, "Can't open or read %s\n", info->filename ); *info->filename = '\0'; } } #include "spec/pixmap_spec.c" /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_counter.c0000664000175000017500000001612612253056105013730 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file sp_counter.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Settting counter class specific attributes. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "fd_main.h" #include "fd_spec.h" #include "sp_counter.h" #include "private/pcounter.h" #include "private/pvaluator.h" #include "spec/counter_spec.h" static FD_counterattrib * cnt_attrib; static FL_OBJECT * curobj; /*************************************** ***************************************/ FL_FORM * counter_create_spec_form( void ) { if ( cnt_attrib ) return cnt_attrib->counterattrib; cnt_attrib = create_form_counterattrib( ); setup_how_return_menu( cnt_attrib->returnsetting ); fl_set_menu_item_mode( cnt_attrib->returnsetting, 5, FL_PUP_BOX | FL_PUP_GRAY ); fl_set_menu_item_mode( cnt_attrib->returnsetting, 6, FL_PUP_BOX | FL_PUP_GRAY ); fl_set_counter_precision( cnt_attrib->prec, 0 ); fl_set_counter_step( cnt_attrib->prec, 1, 2 ); fl_set_counter_bounds( cnt_attrib->prec, 0, DBL_DIG ); return cnt_attrib->counterattrib; } /*************************************** ***************************************/ void counter_adjust_spec_form( FL_OBJECT * obj ) { curobj = obj; if ( obj->type == FL_SIMPLE_COUNTER ) fl_hide_object( cnt_attrib->step2 ); } /*************************************** ***************************************/ void counter_fill_in_spec_form( FL_OBJECT * obj ) { FLI_COUNTER_SPEC *sp = obj->spec; fl_set_counter_value( cnt_attrib->prec, sp->prec ); set_finput_value( cnt_attrib->minval, sp->min, sp->prec ); set_finput_value( cnt_attrib->maxval, sp->max, sp->prec ); set_finput_value( cnt_attrib->initialval, sp->val, sp->prec ); set_finput_value( cnt_attrib->step1, sp->sstep, sp->prec ); set_finput_value( cnt_attrib->step2, sp->lstep, sp->prec ); reset_how_return_menu( cnt_attrib->returnsetting, curobj->how_return ); } /*************************************** ***************************************/ void counter_reread_spec_form( FL_OBJECT * obj ) { double r1, r2; if ( get_checked_float( fl_get_input( cnt_attrib->minval ), &r1 ) && get_checked_float( fl_get_input( cnt_attrib->maxval ), &r2 ) ) fl_set_counter_bounds( obj, r1, r2 ); if ( get_checked_float( fl_get_input( cnt_attrib->initialval ), &r1 ) ) fl_set_counter_value( obj, r1 ); if ( get_checked_float( fl_get_input( cnt_attrib->step1 ), &r1 ) && get_checked_float( fl_get_input( cnt_attrib->step2 ), &r2 ) ) fl_set_counter_step( obj, r1, r2 ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void counter_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = fl_create_counter( obj->type, 0, 0, 0, 0, "" ); FLI_COUNTER_SPEC *sp = obj->spec, *defsp = defobj->spec; if ( sp->min != defsp->min || sp->max != defsp->max ) fprintf( fp, " bounds: %.*f %.*f\n", sp->prec, sp->min, sp->prec, sp->max ); if ( sp->prec != defsp->prec ) fprintf( fp, " precision: %d\n", sp->prec ); if ( sp->val != defsp->val ) fprintf( fp, " value: %.*f\n", sp->prec, sp->val ); if ( sp->sstep != defsp->sstep ) fprintf( fp, " sstep: %.*f\n", sp->prec, sp->sstep ); if ( sp->lstep != defsp->lstep ) fprintf( fp, " lstep: %.*f\n", sp->prec, sp->lstep ); fl_free_object( defobj ); } /*************************************** ***************************************/ void counter_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = fl_create_counter( obj->type, 0, 0, 0, 0, "" ); FLI_COUNTER_SPEC *sp = obj->spec, *defsp = defobj->spec; if ( sp->prec != defsp->prec ) fprintf( fp, " fl_set_counter_precision( obj, %d );\n", sp->prec ); if ( sp->min != defsp->min || sp->max != defsp->max ) fprintf( fp, " fl_set_counter_bounds( obj, %.*f, %.*f );\n", sp->prec, sp->min, sp->prec, sp->max ); if ( sp->val != defsp->val ) fprintf( fp, " fl_set_counter_value( obj, %.*f );\n", sp->prec, sp->val ); if ( sp->sstep != defsp->sstep || sp->lstep != defsp->lstep ) fprintf( fp, " fl_set_counter_step( obj, %.*f, %.*f );\n", sp->prec, sp->sstep, sp->prec, sp->lstep ); fl_free_object( defobj ); } /*************************************** ***************************************/ void cnt_precision_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { fl_set_counter_precision( curobj, fl_get_counter_value( obj ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void cnt_minmax_change( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_set_counter_bounds( curobj, get_finput_value( cnt_attrib->minval ), get_finput_value( cnt_attrib->maxval ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void cnt_stepchange_cb( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_set_counter_step( curobj, get_finput_value( cnt_attrib->step1 ), get_finput_value( cnt_attrib->step2 ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void cnt_initialvalue_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { FLI_COUNTER_SPEC *sp = curobj->spec; set_finput_value( obj, get_finput_value( obj ), sp->prec ); fl_set_counter_value( curobj, get_finput_value( obj ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void cnt_returnsetting_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { handle_how_return_changes( obj, curobj ); } #include "spec/counter_spec.c" /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_freeobj.h0000664000175000017500000000266012251334550013671 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifndef SP_FREEOBJ_H_ #define SP_FREEOBJ_H_ void freeobj_change_type( FL_OBJECT * obj, int new_type ); FL_FORM * freeobj_create_spec_form( void ); void freeobj_adjust_spec_form( FL_OBJECT * obj ); void freeobj_fill_in_spec_form( FL_OBJECT * obj ); void freeobj_reread_spec_form( FL_OBJECT * obj ); void freeobj_restore_spec( FL_OBJECT * obj ); void freeobj_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ); int noop_handle( FL_OBJECT * obj, int e, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int k FL_UNUSED_ARG, void * xev FL_UNUSED_ARG ); #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_twheel.c0000664000175000017500000001345712353623325013552 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file sp_twheel.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Settting twheel class specific attributes. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "fd_main.h" #include "fd_spec.h" #include "sp_twheel.h" #include "private/ptwheel.h" #include "private/pvaluator.h" #include "spec/twheel_spec.h" static FD_twheelattrib * twheel_attrib; FL_OBJECT * curobj; /*************************************** ***************************************/ FL_FORM * thwheel_create_spec_form( void ) { if ( twheel_attrib ) return twheel_attrib->twheelattrib; twheel_attrib = create_form_twheelattrib( ); setup_how_return_menu( twheel_attrib->returnsetting ); fl_set_menu_item_mode( twheel_attrib->returnsetting, 5, FL_PUP_BOX | FL_PUP_GRAY ); fl_set_menu_item_mode( twheel_attrib->returnsetting, 6, FL_PUP_BOX | FL_PUP_GRAY ); return twheel_attrib->twheelattrib; } /*************************************** ***************************************/ void twheel_fill_in_spec_form( FL_OBJECT * obj ) { FLI_THUMBWHEEL_SPEC *sp = obj->spec; curobj = obj; set_finput_value( twheel_attrib->minval, sp->min, -1 ); set_finput_value( twheel_attrib->maxval, sp->max, -1 ); set_finput_value( twheel_attrib->initial_val, sp->val, -1 ); set_finput_value( twheel_attrib->step, sp->step, 3 ); reset_how_return_menu( twheel_attrib->returnsetting, obj->how_return ); } /*************************************** ***************************************/ void twheel_reread_spec_form( FL_OBJECT * obj ) { double r1, r2; if ( get_checked_float( fl_get_input( twheel_attrib->minval ), &r1 ) && get_checked_float( fl_get_input( twheel_attrib->maxval ), &r2 ) ) fl_set_thumbwheel_bounds( obj, r1, r2 ); if ( get_checked_float( fl_get_input( twheel_attrib->initial_val ), &r1 ) ) fl_set_thumbwheel_value( obj, r1 ); if ( get_checked_float( fl_get_input( twheel_attrib->step ), &r1 ) ) fl_set_thumbwheel_step( obj, r1 ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void twheel_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = fl_create_thumbwheel( obj->type, 0, 0, 0, 0, "" ); FLI_THUMBWHEEL_SPEC *sp = obj->spec, *defsp = defobj->spec; if ( sp->min != defsp->min || sp->max != defsp->max ) fprintf( fp, " bounds: %g %g\n", sp->min, sp->max ); if ( sp->val != defsp->val ) fprintf( fp, " value: %g\n", sp->val ); if ( sp->ldelta != defsp->ldelta || sp->rdelta != defsp->rdelta ) fprintf( fp, " increment: %g %g\n", sp->ldelta, sp->rdelta ); if ( sp->slsize != defsp->slsize ) fprintf( fp, " slsize: %.2f\n", sp->slsize ); if ( sp->step != defsp->step ) fprintf( fp, " step: %g\n", sp->step ); fl_free_object( defobj ); } /*************************************** ***************************************/ void twheel_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = fl_create_thumbwheel( obj->type, 0, 0, 0, 0, "" ); FLI_THUMBWHEEL_SPEC *sp = obj->spec, *defsp = defobj->spec; if ( sp->min != defsp->min || sp->max != defsp->max ) fprintf( fp, " fl_set_thumbwheel_bounds( obj, %g, %g );\n", sp->min, sp->max ); if ( sp->val != defsp->val ) fprintf( fp, " fl_set_thumbwheel_value( obj, %g );\n", sp->val ); if ( sp->step != defsp->step ) fprintf( fp, " fl_set_thumbwheel_step( obj, %g );\n", sp->step ); fl_free_object( defobj ); } /*************************************** ***************************************/ void twheel_minmax_change( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_set_thumbwheel_bounds( curobj, get_finput_value( twheel_attrib->minval ), get_finput_value( twheel_attrib->maxval ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void twheel_step_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { fl_set_thumbwheel_step( curobj, get_finput_value( obj ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void twheel_initialvalue_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { fl_set_thumbwheel_value( curobj, get_finput_value( obj ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void twheel_returnsetting_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { handle_how_return_changes( obj, curobj ); } #include "spec/twheel_spec.c" /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_button.c0000664000175000017500000004405312353623325013571 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file sp_button.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Settting button class specific attributes. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "fd_main.h" #include "fd_spec.h" #include "fd_iconinfo.h" #include "spec/button_spec.h" static FD_buttonattrib *bt_attrib = NULL; static FL_OBJECT * curobj = NULL; static FL_OBJECT * create_default_button( FL_OBJECT * ob ); static void get_data_name( FL_OBJECT *, IconInfo * ); #define IsIconButton( obj ) \ ( ( obj )->objclass == FL_BITMAPBUTTON \ || ( obj )->objclass == FL_PIXMAPBUTTON ) /*************************************** ***************************************/ FL_FORM * button_create_spec_form( void ) { if ( bt_attrib ) return bt_attrib->buttonattrib; bt_attrib = create_form_buttonattrib( ); fl_addto_choice( bt_attrib->pixalign, align_name( FL_ALIGN_CENTER, 0 ) ); fl_addto_choice( bt_attrib->pixalign, align_name( FL_ALIGN_TOP, 0 ) ); fl_addto_choice( bt_attrib->pixalign, align_name( FL_ALIGN_BOTTOM, 0 ) ); fl_addto_choice( bt_attrib->pixalign, align_name( FL_ALIGN_LEFT, 0 ) ); fl_addto_choice( bt_attrib->pixalign, align_name( FL_ALIGN_RIGHT, 0 ) ); fl_set_input_return( bt_attrib->filename, FL_RETURN_END ); fl_set_input_return( bt_attrib->focus_filename, FL_RETURN_END ); return bt_attrib->buttonattrib; } /*************************************** ***************************************/ void button_adjust_spec_form( FL_OBJECT * obj ) { curobj = obj; if ( obj->type == FL_PUSH_BUTTON || obj->type == FL_RADIO_BUTTON ) fl_show_object( bt_attrib->initialval ); else fl_hide_object( bt_attrib->initialval ); if ( IsIconButton( obj ) ) { fl_show_object( bt_attrib->filename ); fl_show_object( bt_attrib->browse ); fl_show_object( bt_attrib->use_data ); fl_show_object( bt_attrib->fullpath ); if ( obj->objclass == FL_PIXMAPBUTTON ) { fl_show_object( bt_attrib->pixalign ); fl_show_object( bt_attrib->showfocus ); fl_show_object( bt_attrib->focus_filename ); fl_show_object( bt_attrib->browse2 ); } } else { fl_hide_object( bt_attrib->filename ); fl_hide_object( bt_attrib->focus_filename ); fl_hide_object( bt_attrib->browse ); fl_hide_object( bt_attrib->browse2 ); fl_hide_object( bt_attrib->use_data ); fl_hide_object( bt_attrib->fullpath ); } if ( obj->objclass != FL_PIXMAPBUTTON ) { fl_hide_object( bt_attrib->pixalign ); fl_hide_object( bt_attrib->showfocus ); fl_hide_object( bt_attrib->focus_filename ); fl_hide_object( bt_attrib->browse2 ); } } /*************************************** ***************************************/ void button_fill_in_spec_form( FL_OBJECT * obj ) { FL_BUTTON_SPEC *sp = obj->spec; IconInfo *info = get_iconinfo( obj ); fl_set_button( bt_attrib->react_left, sp->react_to[ 0 ] ); fl_set_button( bt_attrib->react_middle, sp->react_to[ 1 ] ); fl_set_button( bt_attrib->react_right, sp->react_to[ 2 ] ); fl_set_button( bt_attrib->react_up, sp->react_to[ 3 ] ); fl_set_button( bt_attrib->react_down, sp->react_to[ 4 ] ); fl_set_button( bt_attrib->initialval, sp->val ); if ( info ) { fl_set_button( bt_attrib->use_data, info->use_data ); fl_set_button( bt_attrib->fullpath, info->fullpath ); fl_set_button( bt_attrib->showfocus, info->show_focus ); fl_set_choice_text( bt_attrib->pixalign, align_name( info->align, 0 ) ); fl_set_input( bt_attrib->filename, info->filename ); fl_set_input( bt_attrib->focus_filename, info->focus_filename ); } } /*************************************** ***************************************/ void button_reread_spec_form( FL_OBJECT * obj ) { if ( ! IsIconButton( obj ) || ! curobj ) return; iconbutton_filename_change( bt_attrib->filename, 0 ); if ( obj->objclass == FL_PIXMAPBUTTON ) focusiconbutton_filename_change( bt_attrib->focus_filename, 0 ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void button_restore_spec( FL_OBJECT * obj ) { IconInfo *info; if ( ! IsIconButton( obj ) ) return; info = get_iconinfo( obj ); if ( *info->filename ) { if ( obj->objclass == FL_PIXMAPBUTTON ) fl_set_pixmapbutton_file( obj, info->filename ); else fl_set_bitmapbutton_file( obj, info->filename ); } else { /* Show the default broken image link image */ if ( obj->objclass == FL_PIXMAPBUTTON ) set_testing_pixmap( obj ); else set_testing_bitmap( obj ); } if ( obj->objclass == FL_PIXMAPBUTTON ) { if ( *info->focus_filename ) fl_set_pixmapbutton_focus_file( obj, info->focus_filename ); fl_set_pixmap_align( obj, fl_to_inside_lalign( info->align ), info->dx, info->dy ); } } /*************************************** ***************************************/ void button_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = defobj = create_default_button( obj ); FL_BUTTON_SPEC *sp = obj->spec, *defsp = defobj->spec; IconInfo *info, *definfo; if ( memcmp( sp->react_to, defsp->react_to, sizeof sp->react_to ) ) { unsigned int rt = ( sp->react_to[ 0 ] & 1 ) | ( sp->react_to[ 1 ] & 2 ) | ( sp->react_to[ 2 ] & 4 ) | ( sp->react_to[ 3 ] & 8 ) | ( sp->react_to[ 4 ] & 16 ); fprintf( fp, " mbuttons: %u\n", rt ); } if ( sp->val != defsp->val ) fprintf( fp, " value: %d\n", sp->val ); if ( ! IsIconButton( obj ) ) { fl_free_object( defobj ); return; } info = get_iconinfo( obj ); spec_to_superspec( defobj ); definfo = get_iconinfo( defobj ); get_data_name( obj, info ); if ( *info->filename ) { fprintf( fp, " file: %s\n", info->filename ); if ( *info->focus_filename ) fprintf( fp, " focus_file: %s\n", info->focus_filename ); fprintf( fp, " fullpath: %d\n", info->fullpath ); } if ( obj->objclass == FL_PIXMAPBUTTON && info->align != definfo->align ) fprintf( fp, " align: %s\n", align_name( info->align | FL_ALIGN_INSIDE, 0 ) ); if ( info->show_focus != definfo->show_focus ) fprintf( fp, " focus: %d\n", info->show_focus ); if ( *info->data && *info->filename ) { fprintf( fp, " data: %s\n", info->data ); if ( *info->focus_data ) fprintf( fp, " focus_data: %s\n", info->focus_data ); } if ( *info->width ) fprintf( fp, " width: %s\n", info->width ); if ( *info->height ) fprintf( fp, " height: %s\n", info->height ); free_iconinfo( defobj ); free_superspec( defobj ); fl_free_object( defobj ); } /*************************************** ***************************************/ void button_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = defobj = create_default_button( obj ); FL_BUTTON_SPEC *sp = obj->spec, *defsp = defobj->spec; IconInfo *info, *definfo; if ( sp->val != defsp->val ) fprintf( fp, " fl_set_button( obj, %d );\n", sp->val ); if ( memcmp( sp->react_to, defsp->react_to, sizeof sp->react_to ) ) { unsigned int rt = ( sp->react_to[ 0 ] & 1 ) | ( sp->react_to[ 1 ] & 2 ) | ( sp->react_to[ 2 ] & 4 ) | ( sp->react_to[ 3 ] & 8 ) | ( sp->react_to[ 4 ] & 16 ); fprintf( fp, " fl_set_button_mouse_buttons( obj, %u );\n", rt ); } if ( ! IsIconButton( obj ) ) { fl_free_object( defobj ); return; } info = get_iconinfo( obj ); spec_to_superspec( defobj ); definfo = get_iconinfo( defobj ); if ( obj->objclass == FL_PIXMAPBUTTON && info->align != definfo->align ) fprintf( fp, " fl_set_pixmapbutton_align( obj, %s, %d, %d );\n", align_name( info->align | FL_ALIGN_INSIDE, 1 ), info->dx, info->dy ); if ( *info->filename && ! info->use_data ) { fprintf( fp, " fl_set_%sbutton_file( obj, \"%s\" );\n", obj->objclass == FL_PIXMAPBUTTON ? "pixmap" : "bitmap", info->filename ); if ( obj->objclass == FL_PIXMAPBUTTON && *info->focus_filename ) fprintf( fp, " fl_set_pixmapbutton_focus_file( obj, \"%s\" );\n", info->focus_filename ); } if ( *info->data && info->use_data && *info->filename ) { if ( obj->objclass == FL_PIXMAPBUTTON ) { fprintf( fp, " fl_set_pixmapbutton_data( obj, %s );\n", info->data ); if ( *info->focus_filename ) fprintf( fp, " fl_set_pixmapbutton_focus_data( obj, %s );\n", info->focus_data ); } else fprintf( fp, " fl_set_bitmapbutton_data( obj, %s, %s, " "( unsigned char * ) %s );\n", info->width, info->height, info->data ); } if ( obj->objclass == FL_PIXMAPBUTTON && info->show_focus != definfo->show_focus ) fprintf( fp, " fl_set_pixmapbutton_focus_outline( obj, %d );\n", info->show_focus ); free_iconinfo( defobj ); free_superspec( defobj ); fl_free_object( defobj ); } /*************************************** ***************************************/ void button_emit_spec_header( FILE * fp, FL_OBJECT * obj ) { IconInfo *info; if ( ! IsIconButton( obj ) ) return; info = get_iconinfo( obj ); if ( info->use_data && *info->data && *info->filename ) { const char *fn = info->fullpath ? info->filename : file_tail( info->filename ); if ( ! is_duplicate_info( fn ) ) fprintf( fp, "#include \"%s\"\n", fn ); if ( obj->objclass == FL_PIXMAPBUTTON && *info->focus_filename ) { fn = info->fullpath ? info->focus_filename : file_tail( info->focus_filename ); if ( ! is_duplicate_info( fn ) ) fprintf( fp, "#include \"%s\"\n", fn ); } } } /*************************************** ***************************************/ void usedata_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { get_iconinfo( curobj )->use_data = fl_get_button( obj ); } /*************************************** ***************************************/ void fullpath_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { get_iconinfo( curobj )->fullpath = fl_get_button( ob ); } /*************************************** ***************************************/ void react_to_button( FL_OBJECT * obj, long data ) { unsigned int mb; fl_get_button_mouse_buttons( curobj, &mb ); if ( fl_get_button( obj ) ) mb |= 1 << data; else mb &= ~ ( 1 << data ); fl_set_button_mouse_buttons( curobj, mb ); } /*************************************** ***************************************/ void initialval_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { fl_set_button( curobj, fl_get_button( obj ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void showfocus_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { IconInfo *info = get_iconinfo( curobj ); info->show_focus = fl_get_button( obj ); fl_set_pixmapbutton_focus_outline( curobj, info->show_focus ); } /*************************************** ***************************************/ void iconbutton_filename_change( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { IconInfo *info = get_iconinfo( curobj ); strcpy( info->filename, fl_get_input( ob ) ); if ( *info->filename ) { ( curobj->objclass == FL_PIXMAPBUTTON ? fl_set_pixmapbutton_file : fl_set_bitmapbutton_file ) ( curobj, info->filename ); } else { if ( curobj->objclass == FL_PIXMAPBUTTON ) { fl_free_pixmap_pixmap( curobj ); set_testing_pixmap( curobj ); } else set_testing_bitmap( curobj ); } redraw_the_form( 0 ); } /*************************************** ***************************************/ void focusiconbutton_filename_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { IconInfo *info = get_iconinfo( curobj ); strcpy( info->focus_filename, fl_get_input( obj ) ); if ( *info->focus_filename ) fl_set_pixmapbutton_focus_file( curobj, info->focus_filename ); } /*************************************** ***************************************/ void pixalign_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { IconInfo *info = get_iconinfo( curobj ); const char *s = fl_get_choice_text( obj ); if ( ! s ) return; info->align = align_val( s ); /* Don't allow outside align */ fl_set_pixmap_align( curobj, fl_to_inside_lalign( info->align ), info->dx, info->dy ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void lookfor_pixmapfile_cb( FL_OBJECT * ob FL_UNUSED_ARG, long data ) { const char *fn; const char * def = data ? ( ( FL_BUTTON_STRUCT * ) curobj->spec )->focus_filename : ( ( FL_BUTTON_STRUCT * ) curobj->spec )->filename; char buf[ 2048 ]; char *cwd; fl_use_fselector( XPM_FSELECTOR ); fl_set_fselector_placement( FL_PLACE_MOUSE ); if ( curobj->objclass == FL_PIXMAPBUTTON ) fn = fl_show_fselector( "XPM file", "", "*.xpm", def ); else fn = fl_show_fselector( "XBM file", "", "*.xbm", def ); if ( ! fn ) return; cwd = fli_getcwd( buf, sizeof buf - 2 ); if ( cwd && strstr( fn, cwd ) ) fn += strlen( cwd ) + 1; ob = data ? bt_attrib->focus_filename : bt_attrib->filename; fl_set_input( ob, fn ); fl_call_object_callback( ob ); } /*************************************** ***************************************/ static FL_OBJECT * create_default_button( FL_OBJECT * ob ) { FL_OBJECT *defobj = NULL; /* Create a default object */ if ( ob->objclass == FL_BUTTON ) defobj = fl_create_button( ob->type, 0, 0, 0, 0, "" ); else if ( ob->objclass == FL_BITMAPBUTTON ) defobj = fl_create_bitmapbutton( ob->type, 0, 0, 0, 0, "" ); else if ( ob->objclass == FL_PIXMAPBUTTON ) defobj = fl_create_pixmapbutton( ob->type, 0, 0, 0, 0, "" ); else if ( ob->objclass == FL_ROUNDBUTTON ) defobj = fl_create_roundbutton( ob->type, 0, 0, 0, 0, "" ); else if ( ob->objclass == FL_LABELBUTTON ) defobj = fl_create_labelbutton( ob->type, 0, 0, 0, 0, "" ); else if ( ob->objclass == FL_LIGHTBUTTON ) defobj = fl_create_lightbutton( ob->type, 0, 0, 0, 0, "" ); else if ( ob->objclass == FL_CHECKBUTTON ) defobj = fl_create_checkbutton( ob->type, 0, 0, 0, 0, "" ); else if ( ob->objclass == FL_ROUND3DBUTTON ) defobj = fl_create_round3dbutton( ob->type, 0, 0, 0, 0, "" ); else fprintf( stderr, "Unknown Button Class: %d\n", ob->objclass ); return defobj; } /*************************************** ***************************************/ static void get_data_name( FL_OBJECT * obj, IconInfo * info ) { FILE *fp; if ( ! info->use_data ) return; if ( *info->filename ) { if ( ( fp = fopen( info->filename, "r" ) ) ) { if ( obj->objclass == FL_PIXMAPBUTTON ) get_xpm_stuff( info->data, fp ); else get_xbm_stuff( info, fp ); fclose( fp ); } if ( ! fp || ! *info->data ) { fprintf( stderr, "Can't open or read '%s'\n", info->filename ); *info->filename = '\0'; } } if ( obj->objclass != FL_PIXMAPBUTTON || ! *info->focus_filename ) return; if ( ( fp = fopen( info->focus_filename, "r" ) ) ) { get_xpm_stuff( info->focus_data, fp ); fclose( fp ); } if ( ! fp || ! *info->focus_data ) { fprintf( stderr, "Can't open or read focusfile '%s'\n", info->focus_filename ); *info->focus_filename = '\0'; } } #include "spec/button_spec.c" /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_slider.h0000664000175000017500000000233212244217405013534 00000000000000/* * * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifndef SP_SLIDER_H_ #define SP_SLIDER_H_ #include "include/forms.h" #include FL_FORM * slider_create_spec_form( void ); void slider_adjust_spec_form( FL_OBJECT * obj ); void slider_fill_in_spec_form( FL_OBJECT * obj ); void slider_reread_spec_form( FL_OBJECT * obj ); void slider_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ); void slider_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ); #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fd_spec.c0000664000175000017500000013546712353623325013171 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fd_spec.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Driver for setting object specific info */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "fd_main.h" #include "fd_spec.h" #include "fd_iconinfo.h" #include "sp_slider.h" #include "sp_counter.h" #include "sp_spinner.h" #include "sp_dial.h" #include "sp_positioner.h" #include "sp_twheel.h" #include "sp_button.h" #include "sp_pixmap.h" #include "sp_scrollbar.h" #include "sp_browser.h" #include "sp_choice.h" #include "sp_menu.h" #include "sp_xyplot.h" #include "sp_freeobj.h" #define MAXOBJCLASS 9 typedef struct { /* List of object classes this entry is for */ int objclass[ MAXOBJCLASS ]; /* Function to be called for changing the objects type */ void ( * change_type )( FL_OBJECT *, int ); /* Function for creating the form for editing the specific object attributes */ FL_FORM * ( * create_spec_form )( void ); /* Function for adjustments of the form for e.g. the objects type */ void ( * adjust_spec_form )( FL_OBJECT * ); /* Function for setting up the form with the objects attributes */ void ( * fill_in_spec_form )( FL_OBJECT * ); /* Function for setting up the object attributes according to the forms data */ void ( * reread_spec_form )( FL_OBJECT * ); /* Object specific code to be run when object got restored */ void ( * restore_spec )( FL_OBJECT * ); /* Function for emitting code for the fd file for the object */ void ( * emit_spec_fd_code )( FILE *, FL_OBJECT * ); /* Function for emitting C code for the object */ void ( * emit_spec_c_code )( FILE *, FL_OBJECT * ); /* Function for emitting header code for the object */ void ( * emit_spec_header )( FILE *, FL_OBJECT * ); /* */ void ( * emit_spec_global_header )( FILE *, FL_OBJECT * ); } ObjSPEC; static ObjSPEC objspec[ ] = { { { FL_SLIDER, FL_VALSLIDER }, NULL, slider_create_spec_form, slider_adjust_spec_form, slider_fill_in_spec_form, slider_reread_spec_form, NULL, slider_emit_spec_fd_code, slider_emit_spec_c_code, NULL, NULL }, { { FL_COUNTER }, NULL, counter_create_spec_form, counter_adjust_spec_form, counter_fill_in_spec_form, counter_reread_spec_form, NULL, counter_emit_spec_fd_code, counter_emit_spec_c_code, NULL, NULL }, { { FL_SPINNER }, spinner_change_type, spinner_create_spec_form, spinner_adjust_spec_form, spinner_fill_in_spec_form, spinner_reread_spec_form, NULL, spinner_emit_spec_fd_code, spinner_emit_spec_c_code, NULL, NULL }, { { FL_DIAL }, NULL, dial_create_spec_form, NULL, dial_fill_in_spec_form, dial_reread_spec_form, NULL, dial_emit_spec_fd_code, dial_emit_spec_c_code, NULL, NULL }, { { FL_POSITIONER }, NULL, positioner_create_spec_form, NULL, positioner_fill_in_spec_form, positioner_reread_spec_form, NULL, positioner_emit_spec_fd_code, positioner_emit_spec_c_code, NULL, NULL }, { { FL_THUMBWHEEL }, NULL, thwheel_create_spec_form, NULL, twheel_fill_in_spec_form, twheel_reread_spec_form, NULL, twheel_emit_spec_fd_code, twheel_emit_spec_c_code, NULL, NULL }, { { FL_PIXMAPBUTTON, FL_BITMAPBUTTON, FL_BUTTON, FL_CHECKBUTTON, FL_SCROLLBUTTON, FL_ROUNDBUTTON, FL_LIGHTBUTTON, FL_ROUND3DBUTTON, FL_LABELBUTTON }, NULL, button_create_spec_form, button_adjust_spec_form, button_fill_in_spec_form, button_reread_spec_form, button_restore_spec, button_emit_spec_fd_code, button_emit_spec_c_code, button_emit_spec_header, NULL }, { { FL_PIXMAP, FL_BITMAP }, NULL, pixmap_create_spec_form, pixmap_adjust_spec_form, pixmap_fill_in_spec_form, pixmap_reread_spec_form, pixmap_restore_spec, pixmap_emit_spec_fd_code, pixmap_emit_spec_c_code, pixmap_emit_spec_header, NULL }, { { FL_SCROLLBAR }, NULL, scrollbar_create_spec_form, scrollbar_adjust_spec_form, scrollbar_fill_in_spec_form, scrollbar_reread_spec_form, NULL, scrollbar_emit_spec_fd_code, scrollbar_emit_spec_c_code, NULL, NULL }, { { FL_BROWSER }, NULL, browser_create_spec_form, NULL, browser_fill_in_spec_form, NULL, NULL, browser_emit_spec_fd_code, browser_emit_spec_c_code, NULL, NULL }, { { FL_CHOICE }, NULL, choice_create_spec_form, NULL, choice_fill_in_spec_form, NULL, NULL, choice_emit_spec_fd_code, choice_emit_spec_c_code, NULL, NULL }, { { FL_MENU }, NULL, menu_create_spec_form, NULL, menu_fill_in_spec_form, NULL, NULL, menu_emit_spec_fd_code, menu_emit_spec_c_code, menu_emit_spec_header, menu_emit_spec_global_header }, { { FL_XYPLOT }, NULL, xyplot_create_spec_form, xyplot_adjust_spec_form, xyplot_fill_in_spec_form, NULL, NULL, xyplot_emit_spec_fd_code, xyplot_emit_spec_c_code, NULL, NULL }, { { FL_FREE }, NULL, freeobj_create_spec_form, freeobj_adjust_spec_form, freeobj_fill_in_spec_form, freeobj_reread_spec_form, freeobj_restore_spec, freeobj_emit_spec_fd_code, NULL, NULL, NULL } }; /*************************************** * Find the entry in the list of classes for the objects class ***************************************/ static ObjSPEC * find_entry( FL_OBJECT * ob ) { size_t i; for ( i = 0; i < sizeof objspec / sizeof *objspec; i++ ) { int *cls = objspec[ i ].objclass; for ( ; *cls > 0; cls++ ) if ( *cls == ob->objclass ) return objspec + i; } return NULL; } /*************************************** ***************************************/ /*************************************** * Returns the form to be shown for the "Spec" tab folder ***************************************/ void spec_change_type( FL_OBJECT * obj, int new_type ) { ObjSPEC *spec = find_entry( obj ); FL_OBJECT * defobj; if ( obj->type == new_type ) return; /* Different types may have different default box types. If the user obviously didn't change the box type (i.e. expects the default) make sure that the box type is the default for the object type we switch to. */ defobj = find_class_default( obj->objclass, new_type ); if ( defobj && defobj->boxtype == obj->boxtype ) obj->boxtype = defobj->boxtype; if ( spec && spec->change_type ) spec->change_type( obj, new_type ); else obj->type = new_type; } /*************************************** * Returns the form to be shown for the "Spec" tab folder (or NULL If none * exists) ***************************************/ FL_FORM * create_spec_form( FL_OBJECT * obj ) { ObjSPEC *spec = find_entry( obj ); return ( spec && spec->create_spec_form ) ? spec->create_spec_form( ) : NULL; } /*************************************** * Prepare the form for the object specific attributes for becoming shown * - the form may need adjustments because e.g. the objects type has been * changed and then the form content also have to be modified. Then fill * in all the objects attributes. ***************************************/ void prepare_spec_form( FL_OBJECT * obj ) { ObjSPEC *spec = find_entry( obj ); if ( ! spec ) return; /* The form may need some modification,. e.g because the objects type has been changed */ if ( spec->adjust_spec_form ) spec->adjust_spec_form( obj ); /* Fill in the current settings of the objects attributes into the form */ if ( spec->fill_in_spec_form ) spec->fill_in_spec_form( obj ); } /*************************************** * When switching back to the "Generic" form or on end of editing * an input field may not have been processed yet, thus reread all * input fields in the form for the object specific attributes (and * make sure the object gets shown with the potentially modified * attributes). ***************************************/ void reread_spec_form( FL_OBJECT * obj ) { ObjSPEC *spec = find_entry( obj ); if ( spec && spec->reread_spec_form ) { spec->reread_spec_form( obj ); redraw_the_form( 0 ); } } /*************************************** ***************************************/ void restore_spec( FL_OBJECT * obj ) { ObjSPEC *spec = find_entry( obj ); if ( spec && spec->restore_spec ) { spec->restore_spec( obj ); redraw_the_form( 0 ); } } /*************************************** * Function called for writing out object class specific * information for an object to an .fd file ***************************************/ void save_objclass_spec_info( FILE * fp, FL_OBJECT * obj ) { ObjSPEC *spec = find_entry( obj ); if ( spec && spec->emit_spec_fd_code ) spec->emit_spec_fd_code( fp, obj ); } /*************************************** * Function called for writing out object class specific * information for an object to a .c file ***************************************/ void emit_objclass_spec_info( FILE * fp, FL_OBJECT * obj ) { ObjSPEC *spec = find_entry( obj ); if ( spec && spec->emit_spec_c_code ) spec->emit_spec_c_code( fp, obj ); } /*************************************** * Emit (file scope) variable code ***************************************/ void emit_objclass_spec_header( FILE * fp, FL_OBJECT * obj ) { ObjSPEC *spec = find_entry( obj ); if ( spec && spec->emit_spec_header ) spec->emit_spec_header( fp, obj ); } /*************************************** * Emit global variable declarations ***************************************/ void emit_objclass_spec_global( FILE * fp, FL_OBJECT * obj ) { ObjSPEC *spec = find_entry( obj ); if ( spec && spec->emit_spec_global_header ) spec->emit_spec_global_header( fp, obj ); } /*************************************** ***************************************/ static int ff_read_sp_bounds( FL_OBJECT * obj, SuperSPEC * sp ) { int r; if ( ( obj->objclass == FL_SPINNER && ( r = ff_read( "%F%F", &sp->dmin, &sp->dmax ) ) < 0 ) || ( obj->objclass != FL_SPINNER && ( r = ff_read( "%F%F", &sp->min, &sp->max ) ) < 0 ) ) return ff_err( "Can't read expected object bounds" ); if ( r == 0 ) return ff_err( "\"bounds\" key with no or invalid values" ); else if ( r == 1 ) return ff_err( "\"bounds\" key with only one (valid) value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_precision( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; if ( ( r = ff_read( "%d", &sp->prec ) ) < 0 ) return ff_err( "Can't read expected object precision" ); if ( r == 0 ) return ff_err( "\"precision\" key with no or invalid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_increment( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; if ( ( r = ff_read( "%F%F", &sp->ldelta, &sp->rdelta) ) < 0 ) return ff_err( "Can't read expected object increment values" ); if ( r == 0 ) return ff_err( "\"increment\" key with no or invalid values" ); else if ( r == 1 ) return ff_err( "\"increment\" key with only one valid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_value( FL_OBJECT * obj, SuperSPEC * sp ) { int r; if ( ISBUTTON( obj->objclass ) || ISCHOICE( obj->objclass ) ) { if ( ( r = ff_read( "%d", &sp->int_val ) ) < 0 ) return ff_err( "Can't read expected object value" ); if ( ISBUTTON( obj->objclass ) ) fl_set_button( obj, sp->int_val ); } else if ( obj->objclass == FL_SPINNER ) { if ( ( r = ff_read( "%F", &sp->dval ) ) < 0 ) return ff_err( "Can't read expected object value" ); } else if ( ( r = ff_read( "%F", &sp->val ) ) < 0 ) return ff_err( "Can't read expected object value" ); if ( r == 0 ) return ff_err( "\"value\" key with no or invalid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_slsize( FL_OBJECT * ob FL_UNUSED_ARG, SuperSPEC * sp ) { int r; if ( ( r = ff_read( "%F", &sp->slsize ) ) < 0 ) return ff_err( "Can't read expected object slider size" ); if ( r == 0 ) return ff_err( "\"slsize\" key with no or invalid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_step( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; if ( ( obj->objclass == FL_SPINNER && ( r = ff_read( "%F", &sp->dstep ) ) < 0 ) || ( obj->objclass != FL_SPINNER && ( r = ff_read( "%F", &sp->step ) ) < 0 ) ) return ff_err( "Can't read expected object step" ); if ( r == 0 ) return ff_err( "\"step\" key with no or invalid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_h_pref( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; char *p; int i; if ( ( r = ff_read( "%v", &p ) ) < 0 ) return ff_err( "Can't read expected object h_pref" ); if ( r == 0 ) return ff_err( "\"h_pref\" key with no or invalid value" ); i = get_scrollbar_pref_value( p ); fli_safe_free( p ); if ( i < 0 ) return ff_err( "Invalid value for \"h_pref\" key" ); sp->h_pref = i; return 0; } /*************************************** ***************************************/ static int ff_read_sp_v_pref( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; char *p; int i; if ( ( r = ff_read( "%v", &p ) ) < 0 ) return ff_err( "Can't read expected object v_pref" ); if ( r == 0 ) return ff_err( "\"v_pref\" key with no or invalid value" ); i = get_scrollbar_pref_value( p ); fli_safe_free( p ); if ( i < 0 ) return ff_err( "Invalid value for \"v_pref\" key" ); sp->v_pref = i; return 0; } /*************************************** ***************************************/ static int ff_read_sp_sstep( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; if ( ( r = ff_read( "%F", &sp->sstep ) ) < 0 ) return ff_err( "Can't read expected object small step" ); if ( r == 0 ) return ff_err( "\"sstep\" key with no or invalid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_lstep( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; if ( ( r = ff_read( "%F", &sp->lstep ) ) < 0 ) return ff_err( "Can't read expected object large step" ); if ( r == 0 ) return ff_err( "\"lstep\" key with no or invalid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_xbounds( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; if ( ( r = ff_read( "%F%F", &sp->xmin, &sp->xmax ) ) < 0 ) return ff_err( "Can't read expected object xbounds" ); if ( r == 0 ) return ff_err( "\"xbounds\" key with no or invalid values" ); else if ( r == 1 ) return ff_err( "\"xbounds\" key with only one valid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_ybounds( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; if ( ( r = ff_read( "%F%F", &sp->ymin, &sp->ymax ) ) < 0 ) return ff_err( "Can't read expected object ybounds" ); if ( r == 0 ) return ff_err( "\"ybounds\" key with no or invalid values" ); else if ( r == 1 ) return ff_err( "\"ybounds\" key with only one valid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_xvalue( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; if ( ( r = ff_read( "%F", &sp->xval ) ) < 0 ) return ff_err( "Can't read expected object xvalue" ); if ( r == 0 ) return ff_err( "\"xvalue\" key with no or invalid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_yvalue( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; if ( ( r = ff_read( "%F", &sp->yval ) ) < 0 ) return ff_err( "Can't read expected object yvalue" ); if ( r == 0 ) return ff_err( "\"yvalue\" key with no or invalid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_xstep( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; if ( ( r = ff_read( "%F", &sp->xstep ) ) < 0 ) return ff_err( "Can't read expected object xstep" ); if ( r == 0 ) return ff_err( "\"xstep\" key with no or invalid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_ystep( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; if ( ( r = ff_read( "%F", &sp->ystep ) ) < 0 ) return ff_err( "Can't read expected object ystep" ); if ( r == 0 ) return ff_err( "\"ystep\" key with no or invalid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_angles( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; if ( ( r = ff_read( "%F%F", &sp->thetai, &sp->thetaf ) ) < 0 ) return ff_err( "Can't read expected object angles" ); if ( r == 0 ) return ff_err( "\"angles\" key with no or invalid values" ); else if ( r == 1 ) return ff_err( "\"angles\" key with only one valid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_mbuttons( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; if ( ( r = ff_read( "%d", &sp->mbuttons ) ) < 0 ) return ff_err( "Can't read expected object mbuttons setting" ); if ( r == 0 ) return ff_err( "\"mbuttons\" key with no or invalid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_initial_val( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; if ( ( r = ff_read( "%F", &sp->val ) ) < 0 ) return ff_err( "Can't read expected object initial value" ); if ( r == 0 ) return ff_err( "\"initial_val\" key with no or invalid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_content( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { char *p; if ( ff_read( "%S", &p ) < 0 ) return ff_err( "Can't read expected object content" ); ++sp->nlines; sp->content = fl_realloc( sp->content, ( sp->nlines + 1 ) * sizeof *sp->content ); sp->shortcut = fl_realloc( sp->shortcut, ( sp->nlines + 1 ) * sizeof *sp->shortcut ); sp->callback = fl_realloc( sp->callback, ( sp->nlines + 1 ) * sizeof *sp->callback ); sp->mode = fl_realloc( sp->mode, ( sp->nlines + 1 ) * sizeof *sp->mode ); sp->mval = fl_realloc( sp->mval, ( sp->nlines + 1 ) * sizeof *sp->mval ); sp->content[ sp->nlines ] = p; sp->shortcut[ sp->nlines ] = NULL; sp->callback[ sp->nlines ] = NULL; sp->mode[ sp->nlines ] = 0; sp->mval[ sp->nlines ] = sp->nlines; return 0; } /*************************************** ***************************************/ static int ff_read_sp_mode( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; char *p; int i; if ( ( r = ff_read( "%v", &p ) ) < 0 ) return ff_err( "Can't read expected object mode" ); if ( r == 0 ) return ff_err( "\"mode\" key with no or invalid value" ); i = get_pupmode_value( p ); fli_safe_free( p ); if ( i < 0 ) return ff_err( "Invalid value for \"mode\" key" ); sp->mode[ sp->nlines ] = i; return 0; } /*************************************** ***************************************/ static int ff_read_sp_shortcut( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { char *p; if ( ff_read( "%s", &p) < 0 ) return ff_err( "Can't read expected object shortcut" ); sp->shortcut[ sp->nlines ] = p; return 0; } /*************************************** ***************************************/ static int ff_read_sp_callback( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { char *p; if ( ff_read( "%v", &p) < 0 ) return ff_err( "Can't read expected object callback" ); sp->callback[ sp->nlines ] = p; return 0; } /*************************************** ***************************************/ static int ff_read_sp_id( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; if ( ( r = ff_read( "%d", sp->mval + sp->nlines ) ) < 0 ) return ff_err( "Can't read expected object id" ); if ( r == 0 ) return ff_err( "\"id\" key with no or invalid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_file( FL_OBJECT * obj, SuperSPEC * sp FL_UNUSED_ARG ) { char *p; IconInfo *info = get_iconinfo( obj ); if ( ! info ) return ff_err( "Invalid \"file\" attribute for object type found" ); if ( ff_read( "%S", &p ) < 0 ) return ff_err( "Can't read expected object \"file\" attribute" ); if ( strlen( p ) >= sizeof info->filename ) return ff_err( "Filename for \"file\" key too long" ); strcpy( info->filename, p ); fli_safe_free( p ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_focus_file( FL_OBJECT * obj, SuperSPEC * sp FL_UNUSED_ARG ) { char *p; IconInfo *info = get_iconinfo( obj ); if ( ! info ) return ff_err( "Invalid \"focus\" attribute for object type found" ); if ( ff_read( "%S", &p ) < 0 ) return ff_err( "Can't read expected object \"focus\" attribute" ); if ( strlen( p ) >= sizeof info->focus_filename ) return ff_err( "Filename for \"focus_file\" key too long" ); strcpy( info->focus_filename, p ); fli_safe_free( p ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_handler( FL_OBJECT * obj, SuperSPEC * sp FL_UNUSED_ARG ) { int r; char *p; if ( ( r = ff_read( "%v", &p ) ) < 0 ) return ff_err( "Can't read expected object handler" ); if ( r == 0 ) return ff_err( "\"handler\" key with no or invalid value" ); obj->c_vdata = p; return 0; } /*************************************** ***************************************/ static int ff_read_sp_data( FL_OBJECT * obj, SuperSPEC * sp FL_UNUSED_ARG ) { char *p; IconInfo *info = get_iconinfo( obj ); if ( ! info ) return ff_err( "Invalid data structrure for object type found" ); if ( ff_read( "%v", &p ) < 0 ) return ff_err( "Can't read expected object data attribute" ); strcpy( info->data, p ); fli_safe_free( p ); if ( *info->data ) info->use_data = 1; return 0; } /*************************************** ***************************************/ static int ff_read_sp_focus_data( FL_OBJECT * obj, SuperSPEC * sp FL_UNUSED_ARG ) { char *p; IconInfo *info = get_iconinfo( obj ); if ( ! info ) return ff_err( "Invalid \"focus_data\" attribute for object type " "found" ); if ( ff_read( "%v", &p ) < 0 ) return ff_err( "Can't read expected object \"focus_data\" attribute" ); strcpy( info->focus_data, p ); fli_safe_free( p ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_fullpath( FL_OBJECT * obj, SuperSPEC * sp FL_UNUSED_ARG ) { int r; IconInfo *info = get_iconinfo( obj ); if ( ! info ) return ff_err( "Invalid \"fullpath\" attribute for object type found" ); if ( ( r = ff_read( "%d", &info->fullpath) ) < 0 ) return ff_err( "Can't read expected object \"fullpath\" attribute" ); if ( r == 0 ) return ff_err( "\"fullpath\" key with no or invalid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_width( FL_OBJECT * obj, SuperSPEC * sp FL_UNUSED_ARG ) { char *p; IconInfo *info = get_iconinfo( obj ); if ( ! info ) return ff_err( "Invalid \"width\" attribute for object type found" ); if ( ff_read( "%v", &p ) < 0 ) return ff_err( "Can't read expected object \"width\" attribute" ); strcpy( info->width, p ); fli_safe_free( p ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_height( FL_OBJECT * obj, SuperSPEC * sp FL_UNUSED_ARG ) { char *p; IconInfo *info = get_iconinfo( obj ); if ( ! info ) return ff_err( "Invalid \"height\" attribute for object type found" ); if ( ff_read( "%v", &p ) < 0 ) return ff_err( "Can't read expected object \"height\" attribute" ); strcpy( info->height, p ); fli_safe_free( p ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_align( FL_OBJECT * obj, SuperSPEC * sp ) { int r; IconInfo *info = get_iconinfo( obj ); int align; if ( ( r = ff_read( "%a", &align ) ) < 0 ) return ff_err( "Can't read expected object align attribute" ); align &= ~FL_ALIGN_INSIDE; if ( r == 0 ) return ff_err( "Invalid value for \"align\" attribute" ); if ( info ) info->align = align; else sp->align = align; return 0; } /*************************************** ***************************************/ static int ff_read_sp_struct( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; if ( ( r = ff_read( "%d", &sp->new_menuapi ) ) < 0 ) return ff_err( "Can't read expected object struct attribute" ); if ( r == 0 ) return ff_err( "\"struct\" key with no or invalid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_global( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; if ( ( r = ff_read( "%d", &sp->global_scope ) ) < 0 ) return ff_err( "Can't read expected object global attribute" ); if ( r == 0 ) return ff_err( "\"global\" key with no or invalid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_focus( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; if ( ( r = ff_read( "%d", &sp->show_focus ) ) < 0 ) return ff_err( "Can't read expected object focus attribute" ); if ( r == 0 ) return ff_err( "\"focus\" key with no or invalid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_xtics( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; if ( ( r = ff_read( "%d%d", &sp->xmajor, &sp->xminor ) ) < 0 ) return ff_err( "Can't read expected object xtics values" ); if ( r == 0 ) return ff_err( "\"xtics\" key with no or invalid values" ); else if ( r == 1 ) return ff_err( "\"xtics\" key with only one valid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_ytics( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; if ( ( r = ff_read( "%d%d", &sp->ymajor, &sp->yminor ) ) < 0 ) return ff_err( "Can't read expected object ytics values" ); if ( r == 0 ) return ff_err( "\"ytics\" key with no or invalid values" ); else if ( r == 1 ) return ff_err( "\"ytics\" key with only one valid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_xscale( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; char *p; int xscale; if ( ( r = ff_read( "%h%f", &p, &sp->xbase ) ) < 0 ) return ff_err( "Can't read expected object xscale values" ); if ( r == 0 ) return ff_err( "\"xscale\" key with no or invalid values" ); xscale = get_scale_value( p ); fli_safe_free( p ); if ( xscale < 0 ) return ff_err( "Invalid value for first value for \"xscale\" key" ); sp->xscale = xscale; if ( r == 1 ) return ff_err( "\"xscale\" key with only one valid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_yscale( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; char *p; int yscale; if ( ( r = ff_read( "%h%f", &p, &sp->ybase ) ) < 0 ) return ff_err( "Can't read expected object yscale values" ); if ( r == 0 ) return ff_err( "\"yscale\" key with no or invalid values" ); yscale = get_scale_value( p ); fli_safe_free( p ); if ( yscale < 0 ) return ff_err( "Invalid value for first value for \"yscale\" key" ); sp->yscale = yscale; if ( r == 1 ) return ff_err( "\"yscale\" key with only one valid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_grid( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; char *p1, *p2; int g; if ( ( r = ff_read( "%v%v", &p1, &p2) ) < 0 ) return ff_err( "Can't read expected object grid attribute" ); if ( r == 0 ) return ff_err( "\"grid\" key with no or invalid values" ); g = get_grid_value( p1 ); fli_safe_free( p1 ); if ( g < 0 ) return ff_err( "Invalid first value for \"grid\" key" ); sp->xgrid = g; if ( r != 2 ) return ff_err( "\"grid\" key with only one valid value" ); g = get_grid_value( p2 ); fli_safe_free( p2 ); if ( g < 0 ) return ff_err( "Invalid second value for \"grid\" key" ); sp->ygrid = g; return 0; } /*************************************** ***************************************/ static int ff_read_sp_gridstyle( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; char *p; int g; if ( ( r = ff_read( "%v", &p ) ) < 0 ) return ff_err( "Can't read expected object gridstyle attribute" ); if ( r == 0 ) return ff_err( "\"gridstyle\" key with no or invalid value" ); g = get_linestyle_value( p ); fli_safe_free( p ); if ( g < 0 ) return ff_err( "Invalid value for \"gridstyle\" key" ); sp->grid_linestyle = g; return 0; } /*************************************** ***************************************/ static int ff_read_sp_markactive( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; if ( ( r = ff_read( "%d", &sp->mark_active ) ) < 0 ) return ff_err( "Can't read expected object markactive attribute" ); if ( r == 0 ) return ff_err( "\"markactive\" key with no or invalid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_sp_dir( FL_OBJECT * obj FL_UNUSED_ARG, SuperSPEC * sp ) { int r; char *p; int dir; if ( ( r = ff_read( "%v", &p ) ) < 0 ) return ff_err( "Can't read expected object dir attribute" ); if ( r == 0 ) return ff_err( "\"dir\" key with no or invalid value" ); dir = get_direction_value( p ); fli_safe_free( p ); if ( dir < 0 ) return ff_err( "Invalid value for \"dir\" key" ); sp->direction = dir; return 0; } /*************************************** * Duplication of code in fd_file.c since in older versions * the return setting was considered an object specific * attribute while now all objects have it ***************************************/ static int ff_read_sp_return( FL_OBJECT * obj, SuperSPEC * sp FL_UNUSED_ARG ) { int r; char *return_name; int ret; if ( ( r = ff_read( "%s", &return_name ) ) < 0 ) return ff_err( "Can't read expected object return" ); if ( r == 0 ) return ff_err( "\"return\" key with no or invalid value" ); ret = get_how_return_val( return_name ); fli_safe_free( return_name ); if ( ret == -1 ) return ff_err( "Invalid value for \"return\" key" ); fl_set_object_return( obj, ret ); return 0; } /*************************************** ***************************************/ typedef int ( * spec_attr_func )( FL_OBJECT *, SuperSPEC * ); typedef struct { const char * name; spec_attr_func func; } spec_attr_handlers; static spec_attr_handlers attr_array[ ] = { { "bounds", ff_read_sp_bounds }, { "precision", ff_read_sp_precision }, { "increment", ff_read_sp_increment }, { "value", ff_read_sp_value }, { "slsize", ff_read_sp_slsize }, { "step", ff_read_sp_step }, { "h_pref", ff_read_sp_h_pref }, { "v_pref", ff_read_sp_v_pref }, { "sstep", ff_read_sp_sstep }, { "lstep", ff_read_sp_lstep }, { "xbounds", ff_read_sp_xbounds }, { "ybounds", ff_read_sp_ybounds }, { "xvalue", ff_read_sp_xvalue }, { "yvalue", ff_read_sp_yvalue }, { "xstep", ff_read_sp_xstep }, { "ystep", ff_read_sp_ystep }, { "angles", ff_read_sp_angles }, { "mbuttons", ff_read_sp_mbuttons }, { "initial_val", ff_read_sp_initial_val }, { "content", ff_read_sp_content }, { "mode", ff_read_sp_mode }, { "shortcut", ff_read_sp_shortcut }, { "callback", ff_read_sp_callback }, { "id", ff_read_sp_id }, { "file", ff_read_sp_file }, { "focus_file", ff_read_sp_focus_file }, { "handler", ff_read_sp_handler }, { "data", ff_read_sp_data }, { "focus_data", ff_read_sp_focus_data }, { "fullpath", ff_read_sp_fullpath }, { "width", ff_read_sp_width }, { "height", ff_read_sp_height }, { "align", ff_read_sp_align }, { "struct", ff_read_sp_struct }, { "global", ff_read_sp_global }, { "focus", ff_read_sp_focus }, { "xtics", ff_read_sp_xtics }, { "ytics", ff_read_sp_ytics }, { "xscale", ff_read_sp_xscale }, { "yscale", ff_read_sp_yscale }, { "grid", ff_read_sp_grid }, { "gridstyle", ff_read_sp_gridstyle }, { "markactive", ff_read_sp_markactive }, { "dir", ff_read_sp_dir }, { "return", ff_read_sp_return } }; /*************************************** * If we don't know what to do with object specific informations skip them. * This way we (hopefully) remain compatible with later versions ***************************************/ static int skip_spec_info( char * key ) { char *rest, *p; int r; /* Skip everything up to either the start of the next form or object or the end of the file */ do { fli_safe_free( key ); if ( ff_read( "%s", &rest ) < 0 ) return ff_err( "Failed to read from file" ); fli_safe_free( rest ); if ( ( r = ff_read( "%k", &key ) ) < 0 ) return ff_err( "Failed to read from file" ); } while ( r != 0 && strcmp( key, "Name" ) && strcmp( key, "class" ) ); /* Check if we arrived at the start of a form or class */ if ( ! strcmp( key, "Name" ) ) { fli_safe_free( key ); return FF_AT_START_OF_FORM; } else if ( ! strcmp( key, "class" ) ) { fli_safe_free( key ); return FF_AT_START_OF_OBJECT; } /* Otherwise we now have to look for the name of the main function */ if ( ff_read( "%v", &p ) < 1 ) return ff_err( "Expected main function name, not found here" ); else { fli_sstrcpy( main_name, p, MAX_VAR_LEN ); fli_safe_free( p ); } return FF_AT_END_OF_FILE; } /*************************************** * Function for reading in object specific information ***************************************/ int load_objclass_spec_info( FL_OBJECT * obj, char * key ) { int r; size_t i; char *p; SuperSPEC *sp = get_superspec( obj ); if ( ! find_entry( obj ) ) return skip_spec_info( key ); /* Loop until no more object specific key is found. Note: when we arrive here the first key already has been read in! */ do { for ( i = 0; i < sizeof attr_array / sizeof *attr_array; i++ ) if ( ! strcmp( key, attr_array[ i ].name ) ) { fli_safe_free( key ); if ( attr_array[ i ].func( obj, sp ) == FF_READ_FAILURE ) return FF_READ_FAILURE; break; } /* An unexpected key has read, give up */ if ( i >= sizeof attr_array / sizeof *attr_array ) { char *tmp = fl_malloc( strlen( "Read invalid object specific " "key: " ) + strlen( key ) + 1 ); if ( tmp ) { sprintf( tmp, "Read invalid object specific key: %s", key ); ff_err( tmp ); fl_free( tmp ); } fli_safe_free( key ); return FF_READ_FAILURE; } fli_safe_free( key ); if ( ( r = ff_read( "%k", &key ) ) < 0 ) return ff_err( "Failed to read from file" ); } while ( r != 0 && strcmp( key, "Name" ) && strcmp( key, "class" ) ); superspec_to_spec( obj ); restore_spec( obj ); /* Check if we should be at the last line of the file and then read name of main function */ if ( r == 0 ) { if ( ff_read( "%v", &p ) < 1 ) return ff_err( "Expected main function name, not found here" ); else { fli_sstrcpy( main_name, p, MAX_VAR_LEN ); fli_safe_free( p ); } return FF_AT_END_OF_FILE; } /* Otherwise we should be at start of new object... */ if ( ! strcmp( key, "class" ) ) { fli_safe_free( key ); return FF_AT_START_OF_OBJECT; } /* ...or start of new form */ fli_safe_free( key ); return FF_AT_START_OF_FORM; } /* Utilities */ /*************************************** ***************************************/ void set_finput_value( FL_OBJECT * ob, double f, int prec) { char buf[ 64 ]; if ( prec > 20 ) prec = 20; if ( prec >= 0 ) { if ( fabs( f ) < 1.0e38 && fabs( f ) > 1.0e-38 ) sprintf( buf, "%.*f", prec, f ); else sprintf( buf, "%.*g", prec, f ); } else sprintf( buf, "%g", f ); fl_set_input( ob, buf ); } /*************************************** ***************************************/ int get_checked_float( const char * str, double * r ) { char *eptr; if ( ! str || ! r || ! *str ) return 0; *r = strtod( str, &eptr ); return ! *eptr && ! ( ( *r == HUGE_VAL || *r == -HUGE_VAL ) && errno == ERANGE ); } /*************************************** ***************************************/ int get_checked_int( const char * str, int * r ) { char *eptr; if ( ! str || ! r || ! *str ) return 0; *r = strtol( str, &eptr, 10 ); return ! *eptr && *r <= INT_MAX && *r >= INT_MIN; } /*************************************** ***************************************/ double get_finput_value( FL_OBJECT * ob ) { double f = 0; const char *s = fl_get_input( ob ); if ( s && *s ) sscanf( s, "%lf", &f ); return f; } /* scrollbar preference settings */ #define VN( v ) { v, #v } static FLI_VN_PAIR scrbpref[ ] = { VN( FL_OFF ), VN( FL_ON ), VN( FL_AUTO ), { -1, NULL } }; /* must be in the same order as the above */ /*************************************** ***************************************/ const char * get_scrollbar_pref_string( void ) { return "Off|On|Auto "; } /*************************************** ***************************************/ const char * get_scrollbar_pref_name( int a ) { return fli_get_vn_name( scrbpref, a ); } /*************************************** ***************************************/ int get_scrollbar_pref_value( const char * s ) { return fli_get_vn_value( scrbpref, s ); } /* xyplot scale */ static FLI_VN_PAIR scale_vn[ ] = { VN( FL_LINEAR ), VN( FL_LOG ), { -1, NULL } }; /*************************************** ***************************************/ const char * get_scale_name( int a ) { return fli_get_vn_name( scale_vn, a ); } /*************************************** ***************************************/ int get_scale_value( const char * s ) { return fli_get_vn_value( scale_vn, s ); } /*************************************** ***************************************/ const char * get_scale_string( void ) { return "Linear|Log"; } /* xyplot grid */ static FLI_VN_PAIR grid_vn[ ] = { VN( FL_GRID_NONE ), VN( FL_GRID_MAJOR ), VN( FL_GRID_MINOR ), { -1, NULL } }; /*************************************** ***************************************/ const char * get_grid_name( int a ) { return fli_get_vn_name( grid_vn, a ); } /*************************************** ***************************************/ int get_grid_value( const char * s ) { return fli_get_vn_value( grid_vn, s ); } /*************************************** ***************************************/ const char * get_grid_string( void ) { return "None|Major|Minor"; } /* Line style string stuff */ static FLI_VN_PAIR linestyle[ ] = { VN( FL_SOLID ), VN( FL_USERDASH ), VN( FL_USERDOUBLEDASH ), VN( FL_DOT ), VN( FL_DOTDASH ), VN( FL_DASH ), VN( FL_LONGDASH ), { -1, NULL } }; /*************************************** ***************************************/ const char * get_linestyle_string( void ) { return "Solid|UserDash|DoubleDash|Dot|DotDash|Dash|LongDash"; } /*************************************** ***************************************/ const char * get_linestyle_name( int a ) { return fli_get_vn_name( linestyle, a ); } /*************************************** ***************************************/ int get_linestyle_value( const char * s ) { return fli_get_vn_value( linestyle, s ); } /* popup mode */ static FLI_VN_PAIR pupmode[ ] = { VN( FL_PUP_NONE ), VN( FL_PUP_GRAY ), VN( FL_PUP_BOX ), VN( FL_PUP_CHECK ), VN( FL_PUP_RADIO ), { -1, NULL } }; /*************************************** ***************************************/ const char * get_pupmode_string( void ) { return "PUP_NONE|PUP_GRAY|PUP_BOX|PUP_CHECK|PUP_RADIO"; } /*************************************** ***************************************/ const char * get_pupmode_name( int a ) { return fli_get_vn_name( pupmode, a ); } /*************************************** ***************************************/ int get_pupmode_value( const char * s ) { char buf[ 32 ]; strcpy( buf, s ); if ( *buf != 'F' ) strcat( strcpy( buf, "FL_" ), s ); return fli_get_vn_value( pupmode, buf ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_counter.h0000664000175000017500000000227412244217405013736 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifndef SP_COUNTER_H_ #define SP_COUNTER_H_ FL_FORM * counter_create_spec_form( void ); void counter_adjust_spec_form( FL_OBJECT * obj ); void counter_fill_in_spec_form( FL_OBJECT * obj ); void counter_reread_spec_form( FL_OBJECT * obj ); void counter_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ); void counter_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ); #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_scrollbar.c0000664000175000017500000001731612253056162014241 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file sp_scrollbar.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Settting slider class specific attributes. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "fd_main.h" #include "fd_spec.h" #include "sp_scrollbar.h" #include "spec/scrollbar_spec.h" #include "private/pscrollbar.h" static FD_scrollbarattrib *scb_attrib; static FL_OBJECT * curobj; /*************************************** ***************************************/ FL_FORM * scrollbar_create_spec_form( void ) { if ( scb_attrib ) return scb_attrib->scrollbarattrib; scb_attrib = create_form_scrollbarattrib( ); setup_how_return_menu( scb_attrib->returnsetting ); fl_set_menu_item_mode( scb_attrib->returnsetting, 5, FL_PUP_BOX | FL_PUP_GRAY ); fl_set_menu_item_mode( scb_attrib->returnsetting, 6, FL_PUP_BOX | FL_PUP_GRAY ); return scb_attrib->scrollbarattrib; } /*************************************** ***************************************/ #define is_vert( t ) ( t == FL_VERT_SCROLLBAR \ || t == FL_VERT_NICE_SCROLLBAR \ || t == FL_VERT_THIN_SCROLLBAR ) void scrollbar_adjust_spec_form( FL_OBJECT * obj ) { curobj = obj; if ( is_vert( obj->type ) ) { fl_set_object_label( scb_attrib->minval, "Value at top" ); fl_set_object_label( scb_attrib->maxval, "Value at bottom" ); } else { fl_set_object_label( scb_attrib->minval, "Value at left" ); fl_set_object_label( scb_attrib->maxval, "Value at right" ); } } /*************************************** ***************************************/ void scrollbar_fill_in_spec_form( FL_OBJECT * obj ) { double r1, r2; fl_get_scrollbar_bounds( obj, &r1, &r2 ); set_finput_value( scb_attrib->minval, r1, -1 ); set_finput_value( scb_attrib->maxval, r2, -1 ); set_finput_value( scb_attrib->initial_val, fl_get_scrollbar_value( obj ), -1 ); set_finput_value( scb_attrib->slsize, fl_get_scrollbar_size( obj ), 2 ); fl_get_scrollbar_increment( obj, &r1, &r2 ); set_finput_value( scb_attrib->ldelta, r1, -1 ); set_finput_value( scb_attrib->rdelta, r2, -1 ); reset_how_return_menu( scb_attrib->returnsetting, obj->how_return ); } /*************************************** ***************************************/ void scrollbar_reread_spec_form( FL_OBJECT * obj ) { double r1, r2; if ( get_checked_float( fl_get_input( scb_attrib->minval ), &r1 ) && get_checked_float( fl_get_input( scb_attrib->maxval ), &r2 ) ) fl_set_scrollbar_bounds( obj, r1, r2 ); if ( get_checked_float( fl_get_input( scb_attrib->initial_val ), &r1 ) ) fl_set_scrollbar_value( obj, r1 ); if ( get_checked_float( fl_get_input( scb_attrib->slsize ), &r1 ) ) fl_set_scrollbar_size( obj, r1 ); if ( get_checked_float( fl_get_input( scb_attrib->ldelta ), &r1 ) && get_checked_float( fl_get_input( scb_attrib->ldelta ), &r2 ) ) fl_set_scrollbar_increment( obj, r1, r2 ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void scrollbar_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = fl_create_scrollbar( obj->type, 0, 0, 0, 0, "" ); double r1, r2, def_r1, def_r2; fl_get_scrollbar_bounds( obj, &r1, &r2 ); fl_get_scrollbar_bounds( defobj, &def_r1, &def_r2 ); if ( r1 != def_r1 || r2 != def_r2 ) fprintf( fp, " bounds: %g %g\n", r1, r2 ); r1 = fl_get_scrollbar_value( obj ); def_r1 = fl_get_scrollbar_value( defobj ); if ( r1 != def_r1 ) fprintf( fp, " value: %g\n", r1 ); r1 = fl_get_scrollbar_size( obj ); def_r1 = fl_get_scrollbar_size( defobj ); if ( r1 != def_r1 ) fprintf( fp, " slsize: %.2f\n", r1 ); fl_get_scrollbar_increment( obj, &r1, &r2 ); fl_get_scrollbar_increment( defobj, &def_r1, &def_r2 ); if ( r1 != def_r1 || r2 != def_r2 ) fprintf( fp, " increment: %g %g\n", r1, r2 ); } /*************************************** ***************************************/ void scrollbar_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = fl_create_scrollbar( obj->type, 0, 0, 0, 0, "" ); double r1, r2, def_r1, def_r2; fl_get_scrollbar_bounds( obj, &r1, &r2 ); fl_get_scrollbar_bounds( defobj, &def_r1, &def_r2 ); if ( r1 != def_r1 || r2 != def_r2 ) fprintf( fp, " fl_set_scrollbar_bounds( obj, %g, %g );\n", r1, r2 ); r1 = fl_get_scrollbar_value( obj ); def_r1 = fl_get_scrollbar_value( defobj ); if ( r1 != def_r1 ) fprintf( fp, " fl_set_scrollbar_value( obj, %g );\n", r1 ); r1 = fl_get_scrollbar_size( obj ); def_r1 = fl_get_scrollbar_size( defobj ); if ( r1 != def_r1 ) fprintf( fp, " fl_set_scrollbar_size( obj, %.2f );\n", r1 ); fl_get_scrollbar_increment( obj, &r1, &r2 ); fl_get_scrollbar_increment( defobj, &def_r1, &def_r2 ); if ( r1 != def_r1 || r2 != def_r2 ) fprintf( fp, " fl_set_scrollbar_increment( obj, %g, %g );\n", r1, r2 ); } /*************************************** ***************************************/ void scb_minmax_change( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { double min = get_finput_value( scb_attrib->minval ); double max = get_finput_value( scb_attrib->maxval ); fl_set_scrollbar_bounds( curobj, min, max ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void scb_delta_change( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { double ldelta = get_finput_value( scb_attrib->ldelta ); double rdelta = get_finput_value( scb_attrib->rdelta ); fl_set_scrollbar_increment( curobj, ldelta, rdelta ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void scb_slsize_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { double slsize = get_finput_value( obj ); fl_set_scrollbar_size( curobj, slsize ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void scb_initialvalue_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { double val = get_finput_value( obj ); fl_set_scrollbar_value( curobj, val ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void scb_returnsetting_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { handle_how_return_changes( obj, curobj ); } #include "spec/scrollbar_spec.c" /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fd_file.c0000664000175000017500000005772412353623325013155 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fd_file.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * This file is part of the Form Designer. * * It contains the routines to save and load forms in the internal * format used by the form designer. This is readable ASCII. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "fd_main.h" #include "fd_spec.h" #include #include /* Writes an obj description to a file. Note externally the coordinate * system always starts from lower-left corner of the screen */ #if 0 #define OBJ_Y( ob ) ( ob->form->h - ob->y - ob->h ) #else #define OBJ_Y( ob ) obj->y #endif static int read_dummy_box( void ); static int read_dummy_type( void ); /*************************************** ***************************************/ static void save_object( FILE * fp, FL_OBJECT * obj ) { char name[ MAX_VAR_LEN ], cbname[ MAX_VAR_LEN ], argname[ MAX_VAR_LEN ]; char *label; double sc = get_conversion_factor( ); FL_OBJECT *defobj, fake_obj; if ( obj->parent ) return; defobj = find_class_default( obj->objclass, obj->type ); get_object_name( obj, name, cbname, argname ); fprintf( fp, "\n--------------------\n" ); fprintf( fp, "class: %s\n", class_name( obj->objclass ) ); if ( obj->objclass != FL_BEGIN_GROUP && obj->objclass != FL_END_GROUP ) { fprintf( fp, "type: FL_%s\n", find_type_name( obj->objclass, obj->type ) ); fake_obj.x = obj->x; fake_obj.y = obj->y; fake_obj.w = obj->w; fake_obj.h = obj->h; fli_scale_object( &fake_obj, sc, sc ); fprintf( fp, "box: %d %d %d %d\n", fake_obj.x, fake_obj.y, fake_obj.w, fake_obj.h ); fprintf( fp, "boxtype: %s\n", boxtype_name( obj->boxtype ) ); fprintf( fp, "colors: %s %s\n", fli_query_colorname( obj->col1 ), fli_query_colorname( obj->col2 ) ); fprintf( fp, "alignment: %s\n", align_name( obj->align, 0 ) ); fprintf( fp, "style: %s\n", style_name( obj->lstyle ) ); fprintf( fp, "size: %s\n", lsize_name( obj->lsize ) ); fprintf( fp, "lcol: %s\n", fli_query_colorname( obj->lcol ) ); label = get_label( obj, 0 ); fprintf( fp, "label: %s\n", label ); fl_free( label ); fprintf( fp, "shortcut: %s\n", get_shortcut_string( obj ) ); fprintf( fp, "resize: %s\n", resize_name( obj->resize ) ); fprintf( fp, "gravity: %s %s\n", gravity_name( obj->nwgravity ), gravity_name( obj->segravity ) ); } if ( ( obj->objclass != FL_END_GROUP && obj->objclass != FL_BEGIN_GROUP ) || *name ) fprintf( fp, "name: %s\n", name ); if ( obj->objclass != FL_BEGIN_GROUP && obj->objclass != FL_END_GROUP ) { fprintf( fp, "callback: %s\n", cbname ); fprintf( fp, "argument: %s\n", argname ); if ( ! defobj || obj->how_return != defobj->how_return ) fprintf( fp, "return: %s\n", get_how_return_name( obj->how_return, 0 ) ); save_objclass_spec_info( fp, obj ); } } /* * X version changed color systemtically, need to do a translation * from old fd files on the fly */ typedef struct { int oldval, newval; } Trantable; static Trantable tcolor[ ] = { { 0, FL_BLACK }, { 1, FL_RED }, { 2, FL_GREEN }, { 3, FL_YELLOW }, { 4, FL_BLUE }, { 5, FL_MAGENTA }, { 6, FL_CYAN }, { 7, FL_WHITE }, { 8, FL_BOTTOM_BCOL }, /* approx */ { 9, FL_INDIANRED }, { 10, FL_PALEGREEN }, { 11, FL_PALEGREEN }, { 12, FL_SLATEBLUE }, { 35, FL_RIGHT_BCOL }, { 36, FL_RIGHT_BCOL }, /* approx */ { 37, FL_RIGHT_BCOL }, /* approx */ { 40, FL_BOTTOM_BCOL }, { 47, FL_COL1 }, { 49, FL_MCOL }, { 51, FL_TOP_BCOL }, { 55, FL_LEFT_BCOL } }; static Trantable tclass[ ] = { { 1, FL_BOX }, { 2, FL_TEXT }, { 3, FL_BITMAP }, { 4, FL_CHART }, { 11, FL_BUTTON }, { 12, FL_LIGHTBUTTON }, { 13, FL_ROUNDBUTTON }, { 21, FL_SLIDER }, { 22, FL_DIAL }, { 23, FL_POSITIONER }, { 24, FL_VALSLIDER }, { 25, FL_COUNTER }, { 31, FL_INPUT }, { 41, FL_MENU }, { 42, FL_CHOICE }, { 61, FL_CLOCK }, { 62, FL_TIMER }, { 71, FL_BROWSER }, { 101, FL_FREE }, { 10000, FL_BEGIN_GROUP }, { 20000, FL_END_GROUP } }; static Trantable talign[] = { { 0, FL_ALIGN_TOP }, { 1, FL_ALIGN_BOTTOM }, { 2, FL_ALIGN_LEFT }, { 3, FL_ALIGN_RIGHT }, { 4, FL_ALIGN_CENTER } }; static Trantable tbtype[ ] = { { 0, FL_NO_BOX }, { 1, FL_UP_BOX }, { 2, FL_DOWN_BOX }, { 3, FL_FLAT_BOX }, { 4, FL_BORDER_BOX }, { 5, FL_SHADOW_BOX }, { 6, FL_FRAME_BOX }, { 7, FL_ROUNDED_BOX }, { 8, FL_RFLAT_BOX }, { 9, FL_RSHADOW_BOX } }; /*************************************** ***************************************/ static int do_trans( Trantable * tab, int n, int old ) { Trantable *p = tab, *q; for ( q = p + n; p < q; p++ ) if ( p->oldval == old ) return p->newval; return old; } #define new_class( o ) do_trans( tclass, sizeof tclass / sizeof *tclass, ( o ) ) #define new_color( o ) do_trans( tcolor, sizeof tcolor / sizeof *tcolor, ( o ) ) #define new_align( o ) do_trans( talign, sizeof talign / sizeof *talign, ( o ) ) #define new_btype( o ) do_trans( tbtype, sizeof tbtype / sizeof *tbtype, ( o ) ) /*************************************** ***************************************/ static int ff_read_boxtype( FL_OBJECT * obj ) { int r; if ( ( r = ff_read( "%b", &obj->boxtype ) ) < 0 ) return ff_err( "Can't read expected object boxtype" ); if ( r == 0 ) return ff_err( "\"boxtype\" key without value" ); if ( fd_magic == MAGIC2 ) obj->boxtype = new_btype( obj->boxtype ); return 0; } /*************************************** ***************************************/ static int ff_read_colors( FL_OBJECT * obj ) { int r; if ( ( r = ff_read( "%c%c", &obj->col1, &obj->col2 ) ) < 0 ) return ff_err( "Can't read expected object colors" ); if ( r != 2 ) return ff_err( "\"colors\" key without two object colors" ); if ( fd_magic == MAGIC2 ) { obj->col1 = new_color( obj->col1 ); obj->col2 = new_color( obj->col2 ); } return 0; } /*************************************** ***************************************/ static int ff_read_alignment( FL_OBJECT * obj ) { int r; if ( ( r = ff_read( "%a", &obj->align ) ) < 0 ) return ff_err( "Can't read expected object alignment" ); if ( r == 0 ) return ff_err( "\"alignment\" key without or invalid value" ); if ( fd_magic == MAGIC2 ) obj->align = new_align( obj->align ); return 0; } /*************************************** ***************************************/ static int ff_read_lstyle( FL_OBJECT * obj ) { int r; if ( ( r = ff_read( "%p", &obj->lstyle ) ) < 0 ) return ff_err( "Can't read expected object label style" ); if ( r == 0 ) return ff_err( "\"style\" key without or invalid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_lsize( FL_OBJECT * obj ) { int r; if ( ( r = ff_read( "%q", &obj->lsize ) ) < 0 ) return ff_err( "Can't read expected object label size" ); if ( r == 0 ) return ff_err( "\"size\" key without or invalid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_lcolor( FL_OBJECT * obj ) { int r; if ( ( r = ff_read( "%c", &obj->lcol ) ) < 0 ) return ff_err( "Can't read expected object label color" ); if ( r == 0 ) return ff_err( "\"lcol\" key without or invalid value" ); if ( fd_magic == MAGIC2 ) obj->lcol = new_color( obj->lcol ); return 0; } /*************************************** ***************************************/ static int ff_read_resize( FL_OBJECT * obj ) { int r; if ( ( r = ff_read( "%r", &obj->resize ) ) < 0 ) return ff_err( "Can't read expected object resize value" ); if ( r == 0 ) return ff_err( "\"resize\" key without or invalid value" ); return 0; } /*************************************** ***************************************/ static int ff_read_label( FL_OBJECT * obj ) { int r; char *label; if ( ( r = ff_read( "%S", &label ) ) < 0 ) return ff_err( "Can't read expected object label" ); if ( r == 1 ) { set_label( obj, label ); fli_safe_free( label ); } return 0; } /*************************************** ***************************************/ static int ff_read_shortcut( FL_OBJECT * obj ) { int r; char *shortcut; if ( ( r = ff_read( "%s", &shortcut ) ) < 0 ) return ff_err( "Can't read expected object shortcut" ); if ( r == 1 ) { set_shortcut( obj, shortcut ); fli_safe_free( shortcut ); } return 0; } /*************************************** ***************************************/ static int ff_read_callback( FL_OBJECT * obj ) { int r; char *cbname; if ( ( r = ff_read( "%v", &cbname ) ) < 0 ) return ff_err( "Can't read expected object callback" ); if ( r == 1 ) { set_object_name( obj, NULL, cbname, NULL ); fli_safe_free( cbname ); } return 0; } /*************************************** ***************************************/ static int ff_read_name( FL_OBJECT * obj ) { int r; char *name; if ( ( r = ff_read( "%s", &name ) ) < 0 ) return ff_err( "Can't read expected object name" ); if ( r == 1 ) { set_object_name( obj, name, NULL, NULL ); fli_safe_free( name ); } return 0; } /*************************************** ***************************************/ static int ff_read_gravity( FL_OBJECT * obj ) { int r; if ( ( r = ff_read( "%g%g", &obj->nwgravity, &obj->segravity ) ) < 0 ) return ff_err( "Can't read expected object gravity values" ); if ( r != 2 ) { if ( r == 0 ) ff_err( "\"gravity\" key without valid values" ); if ( r == 1 ) ff_err( "\"gravity\" key with only one valid value" ); return FF_READ_FAILURE; } return 0; } /*************************************** ***************************************/ static int ff_read_argument( FL_OBJECT * obj ) { int r; char *arg; if ( ( r = ff_read( "%s", &arg ) ) < 0 ) return ff_err( "Can't read expected object callback argument" ); if ( r == 1 ) { set_object_name( obj, NULL, NULL, arg ); fli_safe_free( arg ); } return 0; } /*************************************** ***************************************/ static int ff_read_return( FL_OBJECT * obj ) { int r; char *return_name; int ret; if ( ( r = ff_read( "%s", &return_name ) ) < 0 ) return ff_err( "Can't read expected object return" ); if ( r == 0 ) return ff_err( "\"return\" key with no or invalid value" ); ret = get_how_return_val( return_name ); fli_safe_free( return_name ); if ( ret == -1 ) return ff_err( "Invalid value for \"return\" key" ); fl_set_object_return( obj, ret ); return 0; } /*************************************** ***************************************/ typedef int ( * obj_attr_func )( FL_OBJECT * ); typedef struct { const char * name; obj_attr_func func; } obj_attr_handlers; static obj_attr_handlers attr_array[ ] = { { "boxtype", ff_read_boxtype }, { "colors", ff_read_colors }, { "alignment", ff_read_alignment }, { "style", ff_read_lstyle }, { "lstyle", ff_read_lstyle }, { "size", ff_read_lsize }, { "lsize", ff_read_lsize }, { "lcol", ff_read_lcolor }, { "resize", ff_read_resize }, { "label", ff_read_label }, { "shortcut", ff_read_shortcut }, { "callback", ff_read_callback }, { "name", ff_read_name }, { "gravity", ff_read_gravity }, { "argument", ff_read_argument }, { "return", ff_read_return } }; /*************************************** * Reads all information from a .fd file until it's * detected that there's either a new form or object * or the last line of the file has been reached. * When called the first key for an object, "class:" * already has been read from the file. ***************************************/ static int load_object( void ) { int objclass; char *type_name; int type = 0; FL_Coord x = 0, y = 0, w = 0, h = 0; char *key = NULL, *p; FL_OBJECT *obj; int r; /* Start with trying to read the minmal information needed. First we want the object class */ if ( ! ff_read( "%o", &objclass ) < 0 ) return ff_err( "Expected object class" ); if ( fd_magic == MAGIC2 ) objclass = new_class( objclass ); /* Next we need the object type. normally this is a string except for pseudo-objects that start and end a group */ if ( objclass != FL_BEGIN_GROUP && objclass != FL_END_GROUP ) { if ( ff_read( "%k%t", &key, &type_name ) < 2 || strcmp( key, "type" ) ) { fl_free( key ); return ff_err( "Expected object type" ); } fl_free( key ); if ( ( type = find_type_value( objclass, type_name ) ) < 0 ) { char *tmp = fl_malloc( strlen( "Invalid type for object class: " ) + strlen( type_name ) + 1 ); if ( tmp ) { sprintf( tmp, "Invalid type for object class: %s", type_name ); ff_err( tmp ); fl_free( tmp ); } fl_free( type_name ); return FF_READ_FAILURE; } fl_free( type_name ); /* As the third entry the size of the object (following the "box" key) is required, exceptions are the pseudo-objectst that start and end a group, they may have less values */ if ( ( r = ff_read( "%k%D%D%U%U", &key, &x, &y, &w, &h ) ) < 5 || strcmp( key, "box" ) ) { fl_free( key ); if ( r == 0 ) ff_err( "Expected object box size" ); else { char *tmp = fl_malloc( strlen( "Expected object box sizes as " "4 values, found only" ) + 20 ); if ( tmp ) { sprintf( tmp, "Expected object box sizes as 4 " "values, found only %d", r - 1 ); ff_err( tmp ); fl_free( tmp ); } } return FF_READ_FAILURE; } fl_free( key ); } if ( cur_form && fd_magic < MAGIC4 ) y = cur_form->h - y - h; /* Create the new object */ if ( ! ( obj = add_an_object( objclass, type, x, y, w, h ) ) ) return ff_err( "Failed to create an object" ); /* Now read the optional attributes, order is irrelevant except that all general object attributes must come before those specific to the type of the object and here we only look for the general ones */ while ( 1 ) { size_t i; if ( ( r = ff_read( "%k", &key ) ) < 0 ) return ff_err( "Failed to read expected key" ); /* The pseudo-objects FL_BEGIN_GROUP and FL_END_GROUP may have a 'type' and 'box' field we didn't check for yet - what they contain is actually irrelevant but we must read them if present */ if ( r == 1 && ( objclass == FL_BEGIN_GROUP || objclass == FL_END_GROUP ) ) { if ( ! strcmp( key, "type" ) ) { fli_safe_free( key ); if ( read_dummy_type( ) == FF_READ_FAILURE ) return FF_READ_FAILURE; else continue; } if ( ! strcmp( key, "box" ) ) { fli_safe_free( key ); if ( read_dummy_box( ) == FF_READ_FAILURE ) return FF_READ_FAILURE; else continue; } } if ( r == 0 || ! strcmp( key, "Name" ) || ! strcmp( key, "class" ) ) break; for ( i = 0; i < sizeof attr_array / sizeof *attr_array; i++ ) if ( ! strcmp( key, attr_array[ i ].name ) ) { fli_safe_free( key ); if ( attr_array[ i ].func( obj ) == FF_READ_FAILURE ) return FF_READ_FAILURE; break; } if ( i == sizeof attr_array / sizeof *attr_array ) break; fli_safe_free( key ); } /* Some extra adjustments for spinner objects (this is an evel hack but avoiding it would require a complete change of how fdesign works) */ if ( obj->objclass == FL_SPINNER ) { FL_OBJECT *subobj = fl_get_spinner_input( obj ); subobj->col1 = obj->col1; subobj->col2 = obj->col2; subobj->lstyle = obj->lstyle; subobj->lsize = obj->lsize; } /* If the key read isn't "Name" or "class" (indicating the start of the next form or object) it must be an object specific key */ if ( r == 1 && strcmp( key, "Name" ) && strcmp( key, "class" ) ) r = load_objclass_spec_info( obj, key ); else { /* If a key could be read continue, otherwise this must be (nearly) the end of the file and the name of the main function must be readable (or something is wrong) */ if ( r == 1 ) r = ! strcmp( key, "class" ) ? FF_AT_START_OF_OBJECT : FF_AT_START_OF_FORM; else { if ( ff_read( "%v", &p ) < 1 ) return ff_err( "Expected main function name, not found here" ); fli_sstrcpy( main_name, p, MAX_VAR_LEN ); fli_safe_free( p ); r = FF_AT_END_OF_FILE; } fli_safe_free( key ); } fli_handle_object( obj, FL_ATTRIB, 0, 0, 0, NULL, 0 ); return r; } /*************************************** * Function for reading the 'type' of a FL_BEGIN_GROUP or FL_END_GROUP * pseudo-object (which alsways is an int with value 0) ***************************************/ static int read_dummy_type( void ) { int type; if ( ff_read( "%d", &type ) < 0 || type != 0 ) return ff_err( "Expected object type" ); return 0; } /*************************************** * Function for reading the box size of a FL_BEGIN_GROUP or FL_END_GROUP * pseudo-object, we can expect either 1 or 4 FL_COORD values ***************************************/ static int read_dummy_box( void ) { int r; FL_COORD dummy; r = ff_read( "%D%D%U%U", &dummy, &dummy, &dummy, &dummy ); if ( r != 1 && r != 4 ) return ff_err( "Expected object box size with 1 or 4 valid values" ); return 0; } /*************************************** * Saves a form definition to the file ***************************************/ void write_form( FILE * fp, FL_FORM * form, char fname[ ] ) { int obj_cnt; FL_OBJECT *obj; fprintf( fp, "\n=============== FORM ===============\n" "Name: %s\n" "Width: %d\n" "Height: %d\n", fname, convert_u( form->w ), convert_u( form->h ) ); /* Print the number of objects in the form (don't count those that are subobjects) */ for ( obj_cnt = 0, obj = form->first->next; obj; obj = obj->next ) if ( ! obj->parent ) obj_cnt++; fprintf( fp, "Number of Objects: %d\n", obj_cnt ); /* Print all objects */ for ( obj = form->first->next; obj; obj = obj->next ) save_object( fp, obj ); } /*************************************** * Reads all information about a form from an .fd file until * it's detected that a new form starts or the last line of * the file has been reached. When we arrive here the "Name:" * key as well as the name of the form itself already have been * read in. We return when we detect that a new form starts * (due to the "Mame:" key or the last line of the file should * have been reached. ***************************************/ int read_form( void ) { char *key; float w = -1.0, h = -1.0; int num_objects = -1; int r; int i; /* Try to read information pertinent to the form (name already has been read in) until the first key for an object in the form ("class:") is found */ while ( 1 ) { if ( ff_read( "%k", &key ) < 1 ) return ff_err( "Invalid format of file" ); if ( ! strcmp( key, "class" ) ) { fli_safe_free( key ); break; } else if ( ! strcmp( key, "Width" ) ) { fli_safe_free( key ); if ( ff_read( "%f", &w ) < 1 ) return ff_err( "Can't read expected form width" ); if ( w < 0.0 ) return ff_err( "Invalid negative form width" ); } else if ( ! strcmp( key, "Height" ) ) { fli_safe_free( key ); if ( ff_read( "%f", &h ) < 1 ) return ff_err( "Can't read expected form height" ); if ( h < 0.0 ) return ff_err( "Invalid negative form height" ); } else if ( ! strcmp( key, "Number of Objects" ) ) { fli_safe_free( key ); if ( ff_read( "%d", &num_objects ) < 1 ) return ff_err( "Can't read expected number of objects in " "form" ); if ( num_objects <= 0 ) return ff_err( "Invalid number of objects, must be at " "least 1" ); } } /* Before continuing with reading the form's objects check that at least width, height and number of objects in form were found */ if ( w < 0.0 ) return ff_err( "Width of form not found" ); if ( h < 0.0 ) return ff_err( "Height of form not found" ); if ( num_objects < 0 ) return ff_err( "Number of objects in form not found" ); /* Create the new form */ cur_form = fl_bgn_form( FL_NO_BOX, ( FL_Coord ) w, ( FL_Coord ) h ); fl_end_form( ); /* Read all objects until next form starts or end file seems to have been reached */ r = FF_AT_START_OF_OBJECT; for ( i = 0; i < num_objects && r == FF_AT_START_OF_OBJECT; i++ ) r = load_object( ); if ( r == FF_READ_FAILURE ) return FF_READ_FAILURE; if ( r == FF_AT_START_OF_OBJECT ) return ff_err( "More objects found than expected" ); if ( i < num_objects ) return ff_err( "Less objects found than expected" ); return r; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_choice.c0000664000175000017500000002433112253056075013506 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file sp_choice.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Settting choice class specific attributes. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "fd_main.h" #include "fd_spec.h" #include "sp_choice.h" #include "private/pchoice.h" #include "spec/choice_spec.h" static FD_choiceattrib *choice_attrib; static FL_OBJECT * curobj; /*************************************** ***************************************/ FL_FORM * choice_create_spec_form( void ) { if ( choice_attrib ) return choice_attrib->choiceattrib; choice_attrib = create_form_choiceattrib( ); fl_addto_choice( choice_attrib->mode, get_pupmode_string( ) ); fl_addto_choice( choice_attrib->scope, "local|global" ); fl_set_choice_item_mode( choice_attrib->mode, 3, FL_PUP_GRAY ); fl_set_choice_item_mode( choice_attrib->mode, 4, FL_PUP_GRAY ); fl_set_choice_item_mode( choice_attrib->mode, 5, FL_PUP_GRAY ); fl_addto_choice( choice_attrib->align, align_name( FL_ALIGN_CENTER, 0 ) ); fl_addto_choice( choice_attrib->align, align_name( FL_ALIGN_TOP, 0 ) ); fl_addto_choice( choice_attrib->align, align_name( FL_ALIGN_BOTTOM, 0 ) ); fl_addto_choice( choice_attrib->align, align_name( FL_ALIGN_LEFT, 0 ) ); fl_addto_choice( choice_attrib->align, align_name( FL_ALIGN_RIGHT, 0 ) ); fl_set_browser_dblclick_callback( choice_attrib->content_br, change_choice_item_cb, 0 ); return choice_attrib->choiceattrib; } /*************************************** ***************************************/ void choice_fill_in_spec_form( FL_OBJECT * obj ) { FLI_CHOICE_SPEC *sp = obj->spec; SuperSPEC *ssp = get_superspec( obj ); int i; curobj = obj; fl_freeze_form( choice_attrib->content_br->form ); fl_set_button( choice_attrib->new_menuapi, ssp->new_menuapi ); fl_set_counter_value( choice_attrib->val, sp->val ); fl_set_choice_text( choice_attrib->align, align_name( sp->align, 0 ) ); fl_set_choice( choice_attrib->scope, ssp->global_scope + 1 ); fl_clear_browser( choice_attrib->content_br ); for ( i = 1; i <= sp->numitems; i++ ) fl_add_browser_line( choice_attrib->content_br, sp->items[ i ] ); fl_set_counter_bounds( choice_attrib->val, 1, sp->numitems >= 1 ? sp->numitems : 1 ); fl_unfreeze_form( choice_attrib->content_br->form ); } /*************************************** ***************************************/ void choice_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = fl_create_choice( obj->type, 0, 0, 0, 0, "" ); FLI_CHOICE_SPEC *sp = obj->spec, *defsp = defobj->spec; SuperSPEC *ssp = get_superspec( obj ), *defssp = get_superspec( defobj ); int i; /* Create a default object */ if ( sp->align != defsp->align ) fprintf( fp, " align: %s\n", align_name( sp->align, 0 ) ); if ( ssp->new_menuapi != defssp->new_menuapi ) fprintf( fp, " struct: %d\n", ssp->new_menuapi ); for ( i = 1; i <= sp->numitems; i++ ) { fprintf( fp, " content: %s\n", sp->items[ i ] ); if ( sp->mode[ i ] != defsp->mode[ i ] ) fprintf( fp, " mode: %s\n", get_pupmode_name( sp->mode[ i ] ) ); if ( sp->shortcut[ i ] && *sp->shortcut[ i ] ) fprintf( fp, " shortcut: %s\n", sp->shortcut[ i ] ); } if ( sp->val != defsp->val ) fprintf( fp, " value: %d\n", sp->val ); free_superspec( defobj ); fl_free_object( defobj ); } /*************************************** ***************************************/ void choice_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = fl_create_choice( obj->type, 0, 0, 0, 0, "" ); FLI_CHOICE_SPEC *sp = obj->spec, *defsp = defobj->spec; SuperSPEC *ssp = get_superspec( obj ); if ( sp->align != defsp->align ) fprintf( fp, " fl_set_choice_align( obj, %s );\n", align_name( sp->align, 1 ) ); if ( sp->numitems >= 1 ) { if ( ssp->new_menuapi ) fprintf( fp, " fl_set_choice_entries( obj, %s );\n", ssp->misc_char ); else { int i; for ( i = 1; i <= sp->numitems; i++ ) { fprintf( fp, " fl_addto_choice( obj, \"%s\" );\n", sp->items[ i ] ); if ( sp->mode[ i ] != defsp->mode[ i ] ) fprintf( fp, " fl_set_choice_item_mode( obj, %d, " "%s );\n", i, get_pupmode_name( sp->mode[ i ] ) ); if ( sp->shortcut[ i ] && *sp->shortcut[ i ] ) fprintf( fp, " fl_set_choice_item_shortcut( obj, %d, " "\"%s\" );\n", i, sp->shortcut[ i ] ); } } if ( sp->val != defsp->val ) fprintf( fp, " fl_set_choice( obj, %d );\n", sp->val ); } fl_free_object( defobj ); } /*************************************** * Callbacks and freeobj handles for form choiceattrib ***************************************/ void add_choice_item_cb( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { const char *s = fl_get_input( choice_attrib->input ); const char *sc = fl_get_input( choice_attrib->shortcut ); const char *mode = fl_get_choice_text( choice_attrib->mode ); int i; if ( ! s || ! *s ) return; fl_addto_browser( choice_attrib->content_br, s ); i = fl_addto_choice( curobj, s ); fl_set_choice_item_shortcut( curobj, i, sc ); fl_set_choice_item_mode( curobj, i, get_pupmode_value( mode ) ); if ( fl_get_button( choice_attrib->auto_clear ) ) clear_choice_field_cb( choice_attrib->auto_clear, 0 ); redraw_the_form( 0 ); fl_set_counter_bounds( choice_attrib->val, 1, fl_get_choice_maxitems( curobj ) ); } /*************************************** ***************************************/ void replace_choice_item_cb( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { int i = fl_get_browser( choice_attrib->content_br ); const char *s = fl_get_input( choice_attrib->input ); const char *sc = fl_get_input( choice_attrib->shortcut ); const char *mode = fl_get_choice_text( choice_attrib->mode ); if ( ! *s || i <= 0 ) return; fl_replace_browser_line( choice_attrib->content_br, i, s ); fl_replace_choice( curobj, i, s ); fl_set_choice_item_shortcut( curobj, i, sc ); fl_set_choice_item_mode( curobj, i, get_pupmode_value( mode ) ); if ( fl_get_button( choice_attrib->auto_clear ) ) clear_choice_field_cb( choice_attrib->auto_clear, 0 ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void delete_choice_item_cb( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { int i = fl_get_browser( choice_attrib->content_br ); if ( i <= 0 ) return; fl_delete_browser_line( choice_attrib->content_br, i ); fl_delete_choice( curobj, i ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void change_choice_item_cb( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { int i = fl_get_browser( choice_attrib->content_br ); FLI_CHOICE_SPEC *sp = curobj->spec; if ( i <= 0 ) return; fl_set_input( choice_attrib->input, fl_get_browser_line( choice_attrib->content_br, i ) ); if ( sp->shortcut[ i ] ) fl_set_input( choice_attrib->shortcut, sp->shortcut[ i ] ); fl_set_choice_text( choice_attrib->mode, get_pupmode_name( sp->mode[ i ] ) + 3 ); } /*************************************** ***************************************/ void clear_choice_field_cb( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_set_input( choice_attrib->input, "" ); fl_set_input( choice_attrib->shortcut, "" ); fl_set_choice( choice_attrib->mode, 1 ); } /*************************************** ***************************************/ void choice_align_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { fl_set_choice_align( curobj, align_val( fl_get_choice_text( obj ) ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void choice_val_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { fl_set_choice( curobj, FL_nint( fl_get_counter_value( obj ) ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void use_struct_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { ( ( SuperSPEC * ) curobj->u_vdata )->new_menuapi = fl_get_button( obj ); } /*************************************** ***************************************/ void choiceentry_scope_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { ( ( SuperSPEC * ) curobj->u_vdata )->global_scope = ( fl_get_choice( obj ) - 1 ) > 0; } #include "spec/choice_spec.c" /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_util.c0000664000175000017500000001725312253056217013234 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "fd_main.h" /*************************************** * Returns a string suitable to be passed to fl_set_menu() which then * initializes the menu for selection of the return type of an object. * In the calling code some of the entries typically must be disabled, * which can be done with a call of fl_set_menu_item_mode() with the * menu object as the first, the menu item number as the second and * 'FL_PUP_BOX | FL_PUP_GRAY' as the third argument. ***************************************/ void setup_how_return_menu( FL_OBJECT * obj ) { fl_set_menu( obj, "Never%b|" /* menu item 1 */ "End & Changed%b|" /* menu item 2 */ "Whenever Changed%b|" /* menu item 3 */ "At End%b|" /* menu item 4 */ "On Selection%b|" /* menu item 5 */ "On Deselection%b|" /* menu item 6 */ "Always%b" ); /* menu item 7 */ } /*************************************** * Sets the check boxes of the menu entries of a menu as set up with * the string returned by set_up_how_return_menu() (see above) according * to the return settings of an object. ***************************************/ void reset_how_return_menu( FL_OBJECT * menu, unsigned int how_return ) { int i; unsigned int modes[ 8 ]; for ( i = 1; i <= 7; i++ ) { modes[ i ] = fl_get_menu_item_mode( menu, i ) & FL_PUP_GRAY; fl_set_menu_item_mode( menu, i, modes[ i ] | FL_PUP_BOX ); } if ( how_return == FL_RETURN_NONE ) fl_set_menu_item_mode( menu, 1, modes[ 1 ] | FL_PUP_BOX | FL_PUP_CHECK ); else if ( how_return == FL_RETURN_ALWAYS ) fl_set_menu_item_mode( menu, 7, modes[ 7 ] | FL_PUP_BOX | FL_PUP_CHECK ); else { if ( how_return & FL_RETURN_END_CHANGED ) fl_set_menu_item_mode( menu, 2, modes[ 2 ] | FL_PUP_BOX | FL_PUP_CHECK ); if ( how_return & FL_RETURN_CHANGED ) fl_set_menu_item_mode( menu, 3, modes[ 3 ] | FL_PUP_BOX | FL_PUP_CHECK ); if ( how_return & FL_RETURN_END ) fl_set_menu_item_mode( menu, 4, modes[ 4 ] | FL_PUP_BOX | FL_PUP_CHECK ); if ( how_return & FL_RETURN_SELECTION ) fl_set_menu_item_mode( menu, 5, modes[ 5 ] | FL_PUP_BOX | FL_PUP_CHECK ); if ( how_return & FL_RETURN_DESELECTION ) fl_set_menu_item_mode( menu, 6, modes[ 6 ] | FL_PUP_BOX | FL_PUP_CHECK ); } } /*************************************** ***************************************/ void handle_how_return_changes( FL_OBJECT * menu, FL_OBJECT * target ) { int hr = FL_RETURN_NONE; if ( fl_get_menu_item_mode( menu, 1 ) & FL_PUP_CHECK && target->how_return != FL_RETURN_NONE ) /* empty */ ; else if ( fl_get_menu_item_mode( menu, 7 ) & FL_PUP_CHECK && target->how_return != FL_RETURN_ALWAYS ) hr = FL_RETURN_ALWAYS; else { if ( fl_get_menu_item_mode( menu, 2 ) & FL_PUP_CHECK && ! ( target->how_return & FL_RETURN_END_CHANGED ) ) hr = FL_RETURN_END_CHANGED; else { if ( fl_get_menu_item_mode( menu, 3 ) & FL_PUP_CHECK ) hr |= FL_RETURN_CHANGED; if ( fl_get_menu_item_mode( menu, 4 ) & FL_PUP_CHECK ) hr |= FL_RETURN_END; } if ( fl_get_menu_item_mode( menu, 5 ) & FL_PUP_CHECK ) hr |= FL_RETURN_SELECTION; if ( fl_get_menu_item_mode( menu, 6 ) & FL_PUP_CHECK ) hr |= FL_RETURN_DESELECTION; } fl_set_object_return( target, hr ); reset_how_return_menu( menu, hr ); } /*************************************** ***************************************/ #define VN( v ) { v, #v } static FLI_VN_PAIR howreturn[ ] = { VN( FL_RETURN_NONE ), VN( FL_RETURN_END_CHANGED ), VN( FL_RETURN_CHANGED ), VN( FL_RETURN_END ), VN( FL_RETURN_SELECTION ), VN( FL_RETURN_DESELECTION ), VN( FL_RETURN_ALWAYS ), { -1, NULL } }; /*************************************** ***************************************/ int get_how_return_val( const char * s ) { char *tmp = fl_strdup( s ), *p = strtok( tmp, "|" ), *st; int val = 0; while ( p ) { while ( *p && isspace( ( unsigned char ) *p ) ) p++; st = p; while ( *p && ! isspace( ( unsigned char ) *p ) ) p++; *p = '\0'; if ( ! strcmp( st, "FL_RETURN_NONE" ) ) { val = FL_RETURN_NONE; break; } else if ( ! strcmp( st, "FL_RETURN_ALWAYS" ) ) { val = FL_RETURN_ALWAYS; break; } else if ( ! strcmp( st, "FL_RETURN_END_CHANGED" ) ) { val |= FL_RETURN_END_CHANGED; val &= ~ ( FL_RETURN_CHANGED | FL_RETURN_END ); } else if ( ! strcmp( st, "FL_RETURN_CHANGED" ) ) { val |= FL_RETURN_CHANGED; val &= ~ FL_RETURN_END_CHANGED; } else if ( ! strcmp( st, "FL_RETURN_END" ) ) { val |= FL_RETURN_END; val &= ~ FL_RETURN_END_CHANGED; } else if ( ! strcmp( st, "FL_RETURN_SELECTION" ) ) val |= FL_RETURN_SELECTION; else if ( ! strcmp( st, "FL_RETURN_DESELECTION" ) ) val |= FL_RETURN_DESELECTION; val |= fli_get_vn_value( howreturn, st ); p = strtok( NULL, "|" ); } fli_safe_free( tmp ); return val; } /*************************************** * Returns a string suitable for output in a C file (with 'withspaces' * set to 1) or a .fd file (with 'withspaces' set to 0) of the return * setting of an object as passed as the first argument. ***************************************/ const char * get_how_return_name( unsigned int how_return, int with_spaces ) { static char buf[ 256 ]; FLI_VN_PAIR *hr = howreturn; if ( how_return == FL_RETURN_ALWAYS ) return "FL_RETURN_ALWAYS"; if ( how_return == FL_RETURN_NONE ) return "FL_RETURN_NONE"; *buf = '\0'; while ( ( ++hr )->val != ( int ) FL_RETURN_ALWAYS ) { if ( how_return & hr->val ) strcat( strcat( buf, with_spaces ? " | " : "|" ), hr->name ); } return buf + ( with_spaces ? 3 : 1 ); } /*************************************** ***************************************/ const char * file_tail( const char * full ) { char *p; if ( ( p = strrchr( full, '/' ) ) ) return p + 1; return full; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_dial.h0000664000175000017500000000220212244217405013157 00000000000000/* * * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifndef SP_DIAL_H_ #define SP_DIAL_H_ #include "include/forms.h" #include FL_FORM * dial_create_spec_form( void ); void dial_fill_in_spec_form( FL_OBJECT * obj ); void dial_reread_spec_form( FL_OBJECT * obj ); void dial_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ); void dial_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ); #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fd_spec.h0000664000175000017500000000372012244217405013155 00000000000000/* * * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifndef FD_SPEC_H_ #define FD_SPEC_H_ void spec_change_type( FL_OBJECT * obj, int new_type ); FL_FORM * create_spec_form( FL_OBJECT * obj ); void prepare_spec_form( FL_OBJECT * obj ); void reread_spec_form( FL_OBJECT * obj ); void restore_spec( FL_OBJECT * obj ); void set_finput_value( FL_OBJECT *, double, int ); int get_checked_float( const char * str, double * r ); int get_checked_int( const char *, int * ); double get_finput_value( FL_OBJECT * ); const char * get_scrollbar_pref_name( int ); int get_scrollbar_pref_value( const char * ); const char * get_scrollbar_pref_string( void ); const char * get_scale_name( int ); int get_scale_value( const char * ); const char * get_scale_string( void ); const char * get_grid_name( int ); int get_grid_value( const char * ); const char * get_grid_string( void ); const char * get_linestyle_name( int ); int get_linestyle_value( const char * ); const char * get_linestyle_string( void ); const char * get_pupmode_name( int ); int get_pupmode_value( const char * ); const char * get_pupmode_string( void ); int get_direction_value( const char * ); #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_menu.c0000664000175000017500000003650212253056140013214 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file sp_menu.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Setting menu class specific attributes. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "fd_main.h" #include "fd_spec.h" #include "sp_menu.h" #include "private/pmenu.h" #include "spec/menu_spec.h" static FD_menuattrib *menu_attrib; static FL_OBJECT *curobj; static const char * int_out( FL_OBJECT * ob, double val, int prec ); static char * get_pupentry_name( FL_OBJECT * obj ); /*************************************** ***************************************/ FL_FORM * menu_create_spec_form( void ) { if ( menu_attrib ) return menu_attrib->menuattrib; menu_attrib = create_form_menuattrib( ); fl_addto_choice( menu_attrib->mode, get_pupmode_string( ) ); fl_addto_choice( menu_attrib->scope, "local|global" ); fl_set_choice_item_shortcut( menu_attrib->mode, 1, "Nn#N" ); fl_set_choice_item_shortcut( menu_attrib->mode, 1, "Gg#G" ); fl_set_choice_item_shortcut( menu_attrib->mode, 1, "Bb#B" ); fl_set_choice_item_shortcut( menu_attrib->mode, 1, "Cc#C" ); fl_set_choice_item_shortcut( menu_attrib->mode, 1, "Rr#R" ); fl_set_browser_dblclick_callback( menu_attrib->content_br, change_menu_item_cb, 0 ); return menu_attrib->menuattrib; } /*************************************** ***************************************/ void menu_fill_in_spec_form( FL_OBJECT * obj ) { FLI_MENU_SPEC *sp = obj->spec; SuperSPEC *ssp = get_superspec( obj ); int i; int mval = sp->numitems + 1; curobj = obj; fl_freeze_form( menu_attrib->content_br->form ); fl_set_button( menu_attrib->new_menuapi, ssp->new_menuapi ); fl_clear_browser( menu_attrib->content_br ); for ( i = 1; i <= sp->numitems; i++ ) { fl_add_browser_line( menu_attrib->content_br, sp->items[ i ] ); if ( sp->mval[ i ] >= mval ) mval = sp->mval[ i ] + 1; } fl_set_choice( menu_attrib->scope, ssp->global_scope + 1 ); if ( ssp->new_menuapi ) fl_hide_object( menu_attrib->id ); else fl_show_object( menu_attrib->id ); fl_set_counter_filter( menu_attrib->id, int_out ); fl_set_counter_value( menu_attrib->id, sp->numitems + 1 ); fl_unfreeze_form( menu_attrib->content_br->form ); } /*************************************** ***************************************/ void menu_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = fl_create_menu( obj->type, 0, 0, 0, 0, "" ); FLI_MENU_SPEC *sp = obj->spec, *defsp = defobj->spec; SuperSPEC *ssp = get_superspec( obj ), *defssp = get_superspec( defobj ); int i; if ( ssp->new_menuapi != defssp->new_menuapi ) fprintf( fp, " struct: %d\n", ssp->new_menuapi ); if ( ssp->global_scope != defssp->global_scope ) fprintf( fp, " global: %d\n", ssp->global_scope ); for ( i = 1; i <= sp->numitems; i++ ) { if ( sp->items[ i ] ) fprintf( fp, " content: %s\n", sp->items[ i ] ); fprintf( fp, " id: %d\n", sp->mval[ i ] ); if ( sp->mode[ i ] != defsp->mode[ i ] ) fprintf( fp, " mode: %s\n", get_pupmode_name(sp->mode[ i ] ) ); if ( sp->shortcut[ i ] && *sp->shortcut[ i ] ) fprintf( fp, " shortcut: %s\n", sp->shortcut[ i ] ); if ( ssp->callback && ssp->callback[ i ] ) fprintf( fp, " callback: %s\n", ssp->callback[ i ] ); } free_superspec( defobj ); fl_free_object( defobj ); } /*************************************** ***************************************/ void menu_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj; FLI_MENU_SPEC *sp = obj->spec, *defsp; SuperSPEC *ssp; if ( sp->numitems == 0 ) return; /* Create a default object */ defobj = fl_create_menu( obj->type, 0, 0, 0, 0, "" ); defsp = defobj->spec; ssp = get_superspec( obj ); if ( ssp->new_menuapi ) fprintf( fp, " fl_set_menu_entries( obj, %s );\n", ssp->misc_char ); else { int i; for ( i = 1; i <= sp->numitems; i++ ) { fprintf( fp, " fl_addto_menu( obj, \"%s\" );\n", sp->items[ i ] ); if ( sp->mode[ i ] != defsp->mode[ i ] ) fprintf(fp, " fl_set_menu_item_mode( obj, %d, %s );\n", i, get_pupmode_name( sp->mode[ i ] ) ); if ( sp->shortcut[ i ] && *sp->shortcut[ i ] ) fprintf( fp, " fl_set_menu_item_shortcut( obj, %d, \"%s\" );\n", i, sp->shortcut[ i ] ); if ( ssp->callback[ i ] && *ssp->callback[ i ] ) fprintf( fp, " fl_set_menu_item_callback( obj, %d, %s );\n", i, ssp->callback[ i ] ); if ( sp->mval[ i ] != i ) fprintf( fp, " fl_set_menu_item_id( obj, %d, %d );\n", i, sp->mval[ i ] ); } } fl_free_object( defobj ); } /*************************************** * emit things that are needed before code emission (file scope) ***************************************/ void menu_emit_spec_header( FILE * fp, FL_OBJECT * obj ) { FLI_MENU_SPEC *sp = obj->spec; SuperSPEC *ssp = get_superspec( obj ); int i; if ( ! ssp->new_menuapi || sp->numitems <= 0 ) return; get_pupentry_name( obj ); fprintf( fp, "\n%sFL_PUP_ENTRY %s[ ] = {\n", ssp->global_scope ? "" : "static ", ssp->misc_char ); fprintf( fp, " /* itemtext callback shortcut mode */\n" ); for ( i = 1; i <= sp->numitems; i++ ) fprintf( fp, " { \"%s\", %s, \"%s\", %s, { 0, 0 } },\n", sp->items[ i ], ( ssp->callback[ i ] && *ssp->callback[ i ] ) ? ( char * ) ssp->callback[ i ] : "NULL", sp->shortcut[ i ] ? sp->shortcut[ i ] : "", get_pupmode_name( sp->mode[ i ] ) ); /* sentinel */ fprintf( fp, " { NULL, 0, NULL, 0, { 0, 0 } }\n};\n\n"); } /*************************************** * emit header info that is global in nature ***************************************/ void menu_emit_spec_global_header( FILE * fp, FL_OBJECT * obj ) { FLI_MENU_SPEC *sp = obj->spec; SuperSPEC *ssp = get_superspec( obj ); if ( ! ssp->new_menuapi || sp->numitems <= 0 || ! ssp->global_scope ) return; get_pupentry_name( obj ); fprintf( fp, "extern FL_PUP_ENTRY %s[ ];\n", ssp->misc_char ); } /*************************************** * Emit menu item callback prototypes or function definitions ***************************************/ void menu_emit_item_callback_headers( FILE * fn, FL_OBJECT * obj, int code ) { FLI_MENU_SPEC *sp = obj->spec; SuperSPEC *ssp = get_superspec( obj ); int i; if ( ssp->new_menuapi || sp->numitems <= 0 ) return; for ( i = 1; i <= sp->numitems; i++ ) { if ( ! ssp->callback[ i ] ) continue; if ( ! code ) fprintf( fn, "int %s( int );\n", ssp->callback[ i ] ); else { fprintf( fn, "/***************************************\n" " ***************************************/\n\n" ); fprintf( fn, "int %s( int menu_item_ID )\n{\n", ssp->callback[ i ] ); fprintf( fn, " /* fill-in code for menu item callback */\n\n" " return menu_item_ID;\n}\n\n\n" ); } } } /*************************************** ***************************************/ static const char * int_out( FL_OBJECT * ob FL_UNUSED_ARG, double val, int prec FL_UNUSED_ARG ) { static char buf[ 20 ]; sprintf( buf, "%d", FL_nint( val ) ); return buf; } /*************************************** * create a name for the [menu|choice]_entry API and hang it off * sp->misc_char ***************************************/ static char * get_pupentry_name( FL_OBJECT * obj ) { static int n = 0; char pupname[ 128 ], *p; char objname[ 128 ], cbname[ 128 ], argname[ 128 ]; FLI_MENU_SPEC *sp = obj->spec; SuperSPEC *ssp = get_superspec( obj ); int i; if ( ! ssp->new_menuapi || sp->numitems <= 0 ) return ""; if ( ssp->misc_char && *ssp->misc_char ) return ssp->misc_char; get_object_name( obj, objname, cbname, argname ); if ( *objname ) sprintf( pupname, "fdmenu_%s_%d", objname, n ); else if ( *obj->label ) sprintf( pupname, "fdmenu_%s_%d", obj->label, n ); else sprintf( pupname, "fdmenu_%d", n ); n++; /* Get rid of illegal chars */ for ( i = 0, p = pupname; *p; p++ ) if ( isalnum( ( unsigned char ) *p ) || *p == '_' ) pupname[ i++ ] = *p; pupname[ i++ ] = '\0'; fli_safe_free ( ssp->misc_char ); ssp->misc_char = fl_strdup( pupname ); return ssp->misc_char; } /* * attributes callbacks */ /*************************************** * callbacks and freeobj handles for form choiceattrib ***************************************/ void add_menu_item_cb( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { FLI_MENU_SPEC *sp = curobj->spec; int i, k; const char *s = fl_get_input( menu_attrib->input ); const char *sc = fl_get_input( menu_attrib->shortcut ); const char *mode = fl_get_choice_text( menu_attrib->mode ); const char *item_cb = fl_get_input( menu_attrib->item_cb ); int mval = fl_get_counter_value( menu_attrib->id ); if ( ! s || ! *s ) return; fl_addto_browser( menu_attrib->content_br, s ); i = fl_addto_menu( curobj, s ); k = sp->mval[ i ]; fl_set_menu_item_shortcut( curobj, k, sc ); fl_set_menu_item_mode( curobj, k, get_pupmode_value( mode ) ); fli_safe_free( sp->cb[ i ] ); if ( item_cb && *item_cb ) fl_set_menu_item_callback( curobj, k, ( FL_PUP_CB ) fl_strdup( item_cb ) ); if ( k != mval ) fl_set_menu_item_id( curobj, i, mval ); if ( fl_get_button( menu_attrib->auto_clear ) ) clear_menu_field_cb( menu_attrib->auto_clear, 0 ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void replace_menu_item_cb( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { FLI_MENU_SPEC *sp = curobj->spec; int i = fl_get_browser( menu_attrib->content_br ); const char *s = fl_get_input( menu_attrib->input ); const char *sc = fl_get_input( menu_attrib->shortcut ); const char *mode = fl_get_choice_text( menu_attrib->mode ); const char *item_cb = fl_get_input( menu_attrib->item_cb ); int mval = fl_get_counter_value( menu_attrib->id ); int k; if ( ! *s || i <= 0 ) return; fl_replace_browser_line( menu_attrib->content_br, i, s ); k = sp->mval[ i ]; fl_replace_menu_item( curobj, k, s ); fl_set_menu_item_shortcut( menu_attrib->vdata, k, sc ); fl_set_menu_item_mode( curobj, k, get_pupmode_value( mode ) ); fli_safe_free( sp->cb[ i ] ); if ( item_cb && *item_cb ) fl_set_menu_item_callback( curobj, k, ( FL_PUP_CB ) fl_strdup( item_cb ) ); if ( k != mval ) fl_set_menu_item_id( curobj, i, mval ); if ( fl_get_button( menu_attrib->auto_clear ) ) clear_menu_field_cb( menu_attrib->auto_clear, 0 ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void delete_menu_item_cb( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { FLI_MENU_SPEC *sp = curobj->spec; int i = fl_get_browser( menu_attrib->content_br ); if ( i <= 0 ) return; fl_delete_browser_line( menu_attrib->content_br, i ); fli_safe_free( sp->cb[ i ] ); fl_delete_menu_item( curobj, sp->mval[ i ] ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void change_menu_item_cb( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { int i = fl_get_browser( menu_attrib->content_br ); FLI_MENU_SPEC *sp = curobj->spec; if ( i <= 0 ) return; fl_set_input( menu_attrib->input, fl_get_browser_line( menu_attrib->content_br, i ) ); if ( sp->shortcut[ i ] ) fl_set_input( menu_attrib->shortcut, sp->shortcut[ i ] ); fl_set_choice_text( menu_attrib->mode, get_pupmode_name( sp->mode[ i ] ) + 3 ); if ( sp->cb[ i ] ) fl_set_input( menu_attrib->item_cb, ( char * ) sp->cb[ i ] ); else fl_set_input( menu_attrib->item_cb, "" ); fl_set_counter_value( menu_attrib->id, sp->mval[ i ] ); } /*************************************** ***************************************/ void clear_menu_field_cb( FL_OBJECT * obj FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { int i; FLI_MENU_SPEC *sp = curobj->spec; int mval = sp->numitems + 1; fl_set_input( menu_attrib->input, "" ); fl_set_input( menu_attrib->shortcut, "" ); fl_set_choice( menu_attrib->mode, 1 ); fl_set_input( menu_attrib->item_cb, "" ); for ( i = 1; i <= sp->numitems; i++ ) if ( sp->mval[ i ] >= mval ) mval = sp->mval[ i ] + 1; fl_set_counter_value( menu_attrib->id, mval ); } /*************************************** ***************************************/ void new_menuapi_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { SuperSPEC * ssp = curobj->u_vdata; ssp->new_menuapi = fl_get_button( obj ); if ( ssp->new_menuapi ) fl_hide_object( menu_attrib->id ); else fl_show_object( menu_attrib->id ); } /*************************************** ***************************************/ void menuentry_scope_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { ( ( SuperSPEC * ) curobj->u_vdata )->global_scope = ( fl_get_choice( obj ) - 1 ) > 0; } #include "spec/menu_spec.c" /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/sp_spinner.h0000664000175000017500000000243112244217405013730 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifndef SP_SPINNER_H_ #define SP_SPINNER_H_ void spinner_change_type( FL_OBJECT * obj, int new_type ); FL_FORM * spinner_create_spec_form( void ); void spinner_adjust_spec_form( FL_OBJECT * obj ); void spinner_fill_in_spec_form( FL_OBJECT * obj ); void spinner_reread_spec_form( FL_OBJECT * obj ); void spinner_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ); void spinner_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ); #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fd_fake.c0000664000175000017500000001772612353623325013142 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fd_fake.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. *. * Fdesign is not capable of handing real canvas classes. Here * we use frame/box classes to simulate the appearance of a canvas */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "fd_main.h" #include "private/pcanvas.h" /*************************************** ***************************************/ static int handle_simu_canvas( FL_OBJECT * ob, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { int ftype; switch ( event ) { case FL_DRAW: fl_draw_box( FL_FLAT_BOX, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); ftype = fli_boxtype2frametype( ob->boxtype ); fl_draw_frame( ftype, ob->x, ob->y, ob->w, ob->h, ob->col2, ob->bw ); fl_draw_text( ob->align, ob->x, ob->y, ob->w, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); break; case FL_DRAWLABEL: if ( ! fl_is_center_lalign( ob->align ) ) fl_draw_text( ob->align, ob->x, ob->y, ob->w, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); break; } return 0; } /*************************************** ***************************************/ FL_OBJECT * fl_create_simu_canvas( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob; FLI_CANVAS_SPEC *sp; ob = fl_make_object( FL_CANVAS, type, x, y, w, h, label, handle_simu_canvas ); ob->boxtype = FL_CANVAS_BOXTYPE; ob->col1 = FL_NoColor; ob->col2 = FL_BLACK; ob->lcol = FL_LCOL; ob->align = FL_ALIGN_CENTER; ob->active = 0; ob->spec = sp = fl_calloc( 1, sizeof *sp ); return ob; } /*************************************** ***************************************/ FL_OBJECT * fl_add_simu_canvas( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob; ob = fl_create_simu_canvas( type, x, y, w, h, label ); fl_add_object( fl_current_form, ob ); return ob; } /*************************************** * glcanvas ***************************************/ FL_OBJECT * fl_create_simu_glcanvas( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob; FLI_CANVAS_SPEC *sp; ob = fl_make_object( FL_GLCANVAS, type, x, y, w, h, label, handle_simu_canvas ); ob->boxtype = FL_CANVAS_BOXTYPE; ob->col1 = FL_NoColor; ob->col2 = FL_BLACK; ob->lcol = FL_LCOL; ob->align = FL_ALIGN_CENTER; ob->active = 0; ob->spec = sp = fl_calloc( 1, sizeof *sp ); return ob; } /*************************************** ***************************************/ FL_OBJECT * fl_add_simu_glcanvas( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob; ob = fl_create_simu_glcanvas( type, x, y, w, h, label ); fl_add_object( fl_current_form, ob ); return ob; } /*************************************** * fake tabfolder ***************************************/ static int handle_tabfolder( FL_OBJECT * ob, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { if ( event == FL_DRAW ) { fl_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); fl_draw_object_label( ob ); } return 0; } /*************************************** ***************************************/ FL_OBJECT * fl_create_ntabfolder( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob; ob = fl_make_object( FL_NTABFOLDER, type, x, y, w, h, label, handle_tabfolder ); ob->boxtype = FL_UP_BOX; ob->resize = FL_RESIZE_NONE; ob->col1 = FL_COL1; ob->col2 = FL_COL1; ob->align = FL_ALIGN_LEFT_TOP; return ob; } /*************************************** ***************************************/ FL_OBJECT * fl_add_ntabfolder( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob = fl_create_ntabfolder( type, x, y, w, h, label ); fl_add_object( fl_current_form, ob ); return ob; } /*************************************** * fake formbrowser ***************************************/ static int handle_formbrowser( FL_OBJECT * ob, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { if ( event == FL_DRAW ) { fl_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); fl_draw_object_label( ob ); } return 0; } /*************************************** ***************************************/ FL_OBJECT * fl_create_nformbrowser( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob; ob = fl_make_object( FL_FORMBROWSER, type, x, y, w, h, label, handle_formbrowser ); ob->boxtype = FL_DOWN_BOX; ob->resize = FL_RESIZE_NONE; ob->col1 = FL_COL1; ob->col2 = FL_COL1; ob->align = FL_ALIGN_BOTTOM; return ob; } /*************************************** ***************************************/ FL_OBJECT * fl_add_nformbrowser( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob = fl_create_nformbrowser( type, x, y, w, h, label ); fl_add_object( fl_current_form, ob ); return ob; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/spec/0000775000175000017500000000000012353624653012421 500000000000000xforms-1.2.4/fdesign/spec/pixmap_spec.h0000664000175000017500000000155512252416033015015 00000000000000/* Header file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #ifndef FD_pixmapattrib_h_ #define FD_pixmapattrib_h_ #include "../lib/include/forms.h" /* Callbacks, globals and object handlers */ void pixmap_filename_change( FL_OBJECT *, long ); void pixmapalign_change( FL_OBJECT *, long ); void pixmaplookfor_pixmapfile_cb( FL_OBJECT *, long ); void pixmapusedata_change( FL_OBJECT *, long ); void pixmapfullpath_cb( FL_OBJECT *, long ); /* Forms and Objects */ typedef struct { FL_FORM * pixmapattrib; void * vdata; char * cdata; long ldata; FL_OBJECT * background; FL_OBJECT * frame; FL_OBJECT * filename; FL_OBJECT * pixalign; FL_OBJECT * browse; FL_OBJECT * use_data; FL_OBJECT * fullpath; } FD_pixmapattrib; FD_pixmapattrib * create_form_pixmapattrib( void ); #endif /* FD_pixmapattrib_h_ */ xforms-1.2.4/fdesign/spec/scrollbar_spec.c0000664000175000017500000000452512252416033015475 00000000000000/* Form definition file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #include #include "scrollbar_spec.h" /*************************************** ***************************************/ FD_scrollbarattrib * create_form_scrollbarattrib( void ) { FL_OBJECT *obj; FD_scrollbarattrib *fdui = ( FD_scrollbarattrib * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->scrollbarattrib = fl_bgn_form( FL_NO_BOX, 525, 280 ); fdui->background = obj = fl_add_box( FL_FLAT_BOX, 0, 0, 525, 280, "" ); obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 20, 15, 470, 245, "Scrollbar Attributes" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); fdui->minval = obj = fl_add_input( FL_FLOAT_INPUT, 190, 45, 82, 25, "Value at bottom/left" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, scb_minmax_change, 0 ); fdui->maxval = obj = fl_add_input( FL_FLOAT_INPUT, 190, 74, 82, 25, "Value at top/right" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, scb_minmax_change, 0 ); fdui->returnsetting = obj = fl_add_menu( FL_PULLDOWN_MENU, 310, 110, 143, 24, "Return Setting" ); fl_set_object_boxtype( obj, FL_UP_BOX ); fl_set_object_callback( obj, scb_returnsetting_change, 0 ); fdui->initial_val = obj = fl_add_input( FL_FLOAT_INPUT, 190, 114, 82, 25, "Initial Value" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, scb_initialvalue_change, 0 ); fdui->slsize = obj = fl_add_input( FL_FLOAT_INPUT, 190, 153, 82, 26, "Scrollbar Size" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, scb_slsize_change, 0 ); fdui->ldelta = obj = fl_add_input( FL_FLOAT_INPUT, 191, 195, 82, 25, "Leftmouse Increment" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, scb_delta_change, 0 ); fdui->rdelta = obj = fl_add_input( FL_FLOAT_INPUT, 191, 225, 82, 25, "Rightmouse Increment" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, scb_delta_change, 0 ); fl_end_form( ); fdui->scrollbarattrib->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } xforms-1.2.4/fdesign/spec/scrollbar_spec.fd0000664000175000017500000000656012244507241015650 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL Border Width: -1 =============== FORM =============== Name: scrollbarattrib Width: 525 Height: 280 Number of Objects: 9 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 525 280 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: background callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 20 15 470 245 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_BOLD_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Scrollbar Attributes shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 190 45 82 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Value at bottom/left shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: minval callback: scb_minmax_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 190 74 82 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Value at top/right shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: maxval callback: scb_minmax_change argument: 0 -------------------- class: FL_MENU type: FL_PULLDOWN_MENU box: 310 110 143 24 boxtype: FL_UP_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Return Setting shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: returnsetting callback: scb_returnsetting_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 190 114 82 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Initial Value shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: initial_val callback: scb_initialvalue_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 190 153 82 26 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Scrollbar Size shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: slsize callback: scb_slsize_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 191 195 82 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Leftmouse Increment shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: ldelta callback: scb_delta_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 191 225 82 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Rightmouse Increment shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: rdelta callback: scb_delta_change argument: 0 ============================== create_the_forms xforms-1.2.4/fdesign/spec/spinner_spec.h0000664000175000017500000000155512252416033015175 00000000000000/* Header file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #ifndef FD_spinnerattrib_h_ #define FD_spinnerattrib_h_ #include "../lib/include/forms.h" /* Callbacks, globals and object handlers */ void spn_precision_cb( FL_OBJECT *, long ); void spn_minmax_change( FL_OBJECT *, long ); void spn_returnsetting_change( FL_OBJECT *, long ); void spn_initialvalue_change( FL_OBJECT *, long ); void spn_stepchange_cb( FL_OBJECT *, long ); /* Forms and Objects */ typedef struct { FL_FORM * spinnerattrib; void * vdata; char * cdata; long ldata; FL_OBJECT * background; FL_OBJECT * prec; FL_OBJECT * minval; FL_OBJECT * maxval; FL_OBJECT * returnsetting; FL_OBJECT * initialval; FL_OBJECT * step; } FD_spinnerattrib; FD_spinnerattrib * create_form_spinnerattrib( void ); #endif /* FD_spinnerattrib_h_ */ xforms-1.2.4/fdesign/spec/Makefile.in0000664000175000017500000002606612353624173014415 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/common.am subdir = fdesign/spec ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FL_FIXLEVEL = @FL_FIXLEVEL@ FL_REVISION = @FL_REVISION@ FL_VERSION = @FL_VERSION@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIB = @JPEG_LIB@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ TEXI2DVI = @TEXI2DVI@ TEXI2DVI_NEEDS_PDF = @TEXI2DVI_NEEDS_PDF@ TEXI2HTML = @TEXI2HTML@ VERSION = @VERSION@ XMKMF = @XMKMF@ XPM_LIB = @XPM_LIB@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign DISTCLEANFILES = *.orig *.rej *~ *.bak core makelog MAINTAINERCLEANFILES = $(srcdir)/Makefile.in makelog AM_INSTALL_DATA_FLAGS = $(INSTALL) -m 644 -D EXTRA_DIST = browser_spec.c \ browser_spec.fd \ browser_spec.h \ button_spec.c \ button_spec.fd \ button_spec.h \ choice_spec.c \ choice_spec.fd \ choice_spec.h \ counter_spec.c \ counter_spec.fd \ counter_spec.h \ dial_spec.c \ dial_spec.fd \ dial_spec.h \ freeobj_spec.c \ freeobj_spec.fd \ freeobj_spec.h \ menu_spec.c \ menu_spec.fd \ menu_spec.h \ pixmap_spec.c \ pixmap_spec.fd \ pixmap_spec.h \ positioner_spec.c \ positioner_spec.fd \ positioner_spec.h \ scrollbar_spec.c \ scrollbar_spec.fd \ scrollbar_spec.h \ slider_spec.c \ slider_spec.fd \ slider_spec.h \ spinner_spec.c \ spinner_spec.fd \ spinner_spec.h \ twheel_spec.c \ twheel_spec.fd \ twheel_spec.h \ xyplot_spec.c \ xyplot_spec.fd \ xyplot_spec.h \ Readme all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/common.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign fdesign/spec/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign fdesign/spec/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/common.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: xforms-1.2.4/fdesign/spec/slider_spec.h0000664000175000017500000000176212252416033015001 00000000000000/* Header file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #ifndef FD_sliderattrib_h_ #define FD_sliderattrib_h_ #include "../lib/include/forms.h" /* Callbacks, globals and object handlers */ void adjust_precision( FL_OBJECT *, long ); void minmax_change( FL_OBJECT *, long ); void returnsetting_change( FL_OBJECT *, long ); void initialvalue_change( FL_OBJECT *, long ); void slsize_change( FL_OBJECT *, long ); void step_change( FL_OBJECT *, long ); void increment_change( FL_OBJECT *, long ); /* Forms and Objects */ typedef struct { FL_FORM * sliderattrib; void * vdata; char * cdata; long ldata; FL_OBJECT * background; FL_OBJECT * prec; FL_OBJECT * minval; FL_OBJECT * maxval; FL_OBJECT * returnsetting; FL_OBJECT * initial_val; FL_OBJECT * slsize; FL_OBJECT * step; FL_OBJECT * ldelta; FL_OBJECT * rdelta; } FD_sliderattrib; FD_sliderattrib * create_form_sliderattrib( void ); #endif /* FD_sliderattrib_h_ */ xforms-1.2.4/fdesign/spec/xyplot_spec.c0000664000175000017500000000703712252416033015052 00000000000000/* Form definition file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #include #include "xyplot_spec.h" /*************************************** ***************************************/ FD_xyplotattrib * create_form_xyplotattrib( void ) { FL_OBJECT *obj; FD_xyplotattrib *fdui = ( FD_xyplotattrib * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->xyplotattrib = fl_bgn_form( FL_NO_BOX, 520, 270 ); obj = fl_add_box( FL_FLAT_BOX, 0, 0, 520, 270, "" ); obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 10, 20, 500, 240, "XYPlot Attributes" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); fdui->xgrid = obj = fl_add_choice( FL_NORMAL_CHOICE2, 70, 60, 85, 23, "XGrid" ); fl_set_object_callback( obj, grid_change_cb, 0 ); fdui->ygrid = obj = fl_add_choice( FL_NORMAL_CHOICE2, 70, 90, 85, 23, "YGrid" ); fl_set_object_callback( obj, grid_change_cb, 0 ); fdui->xscale = obj = fl_add_choice( FL_NORMAL_CHOICE2, 70, 170, 85, 23, "XScale" ); fl_set_object_callback( obj, xscale_change_cb, 0 ); fdui->yscale = obj = fl_add_choice( FL_NORMAL_CHOICE2, 70, 210, 85, 23, "YScale" ); fl_set_object_callback( obj, yscale_change_cb, 0 ); fdui->ymajor = obj = fl_add_counter( FL_NORMAL_COUNTER, 370, 160, 115, 20, "YMajor" ); fl_set_object_callback( obj, ymajorminor_change_cb, 0 ); fl_set_counter_precision( obj, 0 ); fl_set_counter_bounds( obj, -1, 20 ); fl_set_counter_value( obj, 1 ); fl_set_counter_step( obj, 1, 2 ); fdui->yminor = obj = fl_add_counter( FL_NORMAL_COUNTER, 370, 200, 115, 20, "YMinor" ); fl_set_object_callback( obj, ymajorminor_change_cb, 0 ); fl_set_counter_precision( obj, 0 ); fl_set_counter_bounds( obj, 0, 10 ); fl_set_counter_value( obj, 1 ); fl_set_counter_step( obj, 1, 2 ); fdui->xmajor = obj = fl_add_counter( FL_NORMAL_COUNTER, 370, 70, 115, 20, "XMajor" ); fl_set_object_callback( obj, xmajorminor_change_cb, 0 ); fl_set_counter_precision( obj, 0 ); fl_set_counter_bounds( obj, -1, 20 ); fl_set_counter_value( obj, 1 ); fl_set_counter_step( obj, 1, 2 ); fdui->xminor = obj = fl_add_counter( FL_NORMAL_COUNTER, 370, 110, 115, 20, "XMinor" ); fl_set_object_callback( obj, xmajorminor_change_cb, 0 ); fl_set_counter_precision( obj, 0 ); fl_set_counter_bounds( obj, 0, 10 ); fl_set_counter_value( obj, 1 ); fl_set_counter_step( obj, 1, 2 ); fdui->xbase = obj = fl_add_input( FL_FLOAT_INPUT, 160, 170, 39, 23, "xbase" ); fl_set_object_lalign( obj, FL_ALIGN_RIGHT ); fl_set_object_callback( obj, xscale_change_cb, 0 ); fdui->ybase = obj = fl_add_input( FL_FLOAT_INPUT, 158, 210, 39, 23, "ybase" ); fl_set_object_lalign( obj, FL_ALIGN_RIGHT ); fl_set_object_callback( obj, yscale_change_cb, 0 ); fdui->how_return = obj = fl_add_menu( FL_PULLDOWN_MENU, 193, 29, 150, 22, "Return Setting" ); fl_set_object_boxtype( obj, FL_UP_BOX ); fl_set_object_callback( obj, xyplot_returnsetting_change, 0 ); fdui->gridstyle = obj = fl_add_choice( FL_NORMAL_CHOICE2, 70, 120, 85, 23, "Style" ); fl_set_object_callback( obj, gridstyle_change_cb, 0 ); fdui->mark_active = obj = fl_add_checkbutton( FL_PUSH_BUTTON, 230, 80, 100, 25, "MarkActive" ); fl_set_object_callback( obj, markactive_change_cb, 0 ); fl_end_form( ); fdui->xyplotattrib->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } xforms-1.2.4/fdesign/spec/choice_spec.c0000664000175000017500000000715012252416033014741 00000000000000/* Form definition file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #include #include "choice_spec.h" /*************************************** ***************************************/ FD_choiceattrib * create_form_choiceattrib( void ) { FL_OBJECT *obj; FD_choiceattrib *fdui = ( FD_choiceattrib * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->choiceattrib = fl_bgn_form( FL_NO_BOX, 520, 270 ); obj = fl_add_box( FL_FLAT_BOX, 0, 0, 520, 270, "" ); obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 15, 20, 480, 230, "Choice Attributes" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 25, 80, 190, 120, "Item Attributes" ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 225, 82, 111, 140, "Action" ); fdui->content_br = obj = fl_add_browser( FL_HOLD_BROWSER, 353, 85, 120, 140, "CurrentItems:" ); fl_set_object_lalign( obj, FL_ALIGN_LEFT_TOP ); fdui->input = obj = fl_add_input( FL_NORMAL_INPUT, 35, 107, 170, 25, "EditItem" ); fl_set_input_shortcut( obj, "#E", 1 ); fl_set_object_lalign( obj, FL_ALIGN_LEFT_TOP ); obj = fl_add_button( FL_NORMAL_BUTTON, 235, 97, 84, 26, "Add" ); fl_set_button_shortcut( obj, "#A", 1 ); fl_set_object_callback( obj, add_choice_item_cb, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 235, 158, 84, 24, "Delete" ); fl_set_button_shortcut( obj, "#D", 1 ); fl_set_object_callback( obj, delete_choice_item_cb, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 235, 187, 84, 24, "Change" ); fl_set_button_shortcut( obj, "#C", 1 ); fl_set_object_callback( obj, change_choice_item_cb, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 115, 207, 82, 24, "ClearField" ); fl_set_button_shortcut( obj, "#F", 1 ); fl_set_object_callback( obj, clear_choice_field_cb, 0 ); fdui->auto_clear = obj = fl_add_checkbutton( FL_PUSH_BUTTON, 30, 205, 24, 27, "AutoClear" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_button( obj, 1 ); obj = fl_add_button( FL_NORMAL_BUTTON, 235, 127, 84, 26, "Replace" ); fl_set_button_shortcut( obj, "#R", 1 ); fl_set_object_callback( obj, replace_choice_item_cb, 0 ); fdui->mode = obj = fl_add_choice( FL_NORMAL_CHOICE2, 106, 155, 98, 25, "Mode" ); fl_set_object_shortcut( obj, "#M", 1 ); fl_set_object_lalign( obj, FL_ALIGN_LEFT_TOP ); fdui->shortcut = obj = fl_add_input( FL_NORMAL_INPUT, 35, 155, 70, 25, "Shortcut" ); fl_set_input_shortcut( obj, "#S", 1 ); fl_set_object_lalign( obj, FL_ALIGN_LEFT_TOP ); fdui->align = obj = fl_add_choice( FL_NORMAL_CHOICE2, 45, 39, 150, 24, "" ); fl_set_object_callback( obj, choice_align_cb, 0 ); fdui->val = obj = fl_add_counter( FL_NORMAL_COUNTER, 365, 42, 100, 18, "Initial Choice" ); fl_set_object_lalign( obj, FL_ALIGN_TOP ); fl_set_object_callback( obj, choice_val_cb, 0 ); fl_set_counter_precision( obj, 0 ); fl_set_counter_value( obj, 1 ); fl_set_counter_step( obj, 1, 2 ); fdui->new_menuapi = obj = fl_add_checkbutton( FL_PUSH_BUTTON, 210, 39, 70, 25, "Use Struct" ); fl_set_button_shortcut( obj, "#U", 1 ); fl_set_object_callback( obj, use_struct_cb, 0 ); fdui->scope = obj = fl_add_choice( FL_NORMAL_CHOICE2, 290, 40, 65, 22, "" ); fl_set_object_callback( obj, choiceentry_scope_cb, 0 ); fl_end_form( ); fdui->choiceattrib->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } xforms-1.2.4/fdesign/spec/button_spec.h0000664000175000017500000000244112252416033015025 00000000000000/* Header file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #ifndef FD_buttonattrib_h_ #define FD_buttonattrib_h_ #include "../lib/include/forms.h" /* Callbacks, globals and object handlers */ void initialval_change( FL_OBJECT *, long ); void iconbutton_filename_change( FL_OBJECT *, long ); void pixalign_change( FL_OBJECT *, long ); void showfocus_change( FL_OBJECT *, long ); void lookfor_pixmapfile_cb( FL_OBJECT *, long ); void usedata_change( FL_OBJECT *, long ); void fullpath_cb( FL_OBJECT *, long ); void focusiconbutton_filename_change( FL_OBJECT *, long ); void react_to_button( FL_OBJECT *, long ); /* Forms and Objects */ typedef struct { FL_FORM * buttonattrib; void * vdata; char * cdata; long ldata; FL_OBJECT * background; FL_OBJECT * initialval; FL_OBJECT * filename; FL_OBJECT * pixalign; FL_OBJECT * showfocus; FL_OBJECT * browse; FL_OBJECT * use_data; FL_OBJECT * fullpath; FL_OBJECT * focus_filename; FL_OBJECT * browse2; FL_OBJECT * mbuttons_label; FL_OBJECT * react_left; FL_OBJECT * react_middle; FL_OBJECT * react_right; FL_OBJECT * react_up; FL_OBJECT * react_down; } FD_buttonattrib; FD_buttonattrib * create_form_buttonattrib( void ); #endif /* FD_buttonattrib_h_ */ xforms-1.2.4/fdesign/spec/counter_spec.c0000664000175000017500000000452012252416033015164 00000000000000/* Form definition file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #include #include "counter_spec.h" /*************************************** ***************************************/ FD_counterattrib * create_form_counterattrib( void ) { FL_OBJECT *obj; FD_counterattrib *fdui = ( FD_counterattrib * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->counterattrib = fl_bgn_form( FL_NO_BOX, 540, 280 ); fdui->background = obj = fl_add_box( FL_FLAT_BOX, 0, 0, 540, 280, "" ); obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 25, 20, 485, 235, "Counter Attributes" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); fdui->prec = obj = fl_add_counter( FL_NORMAL_COUNTER, 60, 150, 145, 23, "Precision" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lalign( obj, FL_ALIGN_TOP ); fl_set_object_callback( obj, cnt_precision_cb, 0 ); fdui->minval = obj = fl_add_input( FL_FLOAT_INPUT, 340, 52, 92, 24, "Counter Min" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, cnt_minmax_change, 0 ); fdui->maxval = obj = fl_add_input( FL_FLOAT_INPUT, 340, 87, 92, 24, "Counter Max" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, cnt_minmax_change, 0 ); fdui->returnsetting = obj = fl_add_menu( FL_PULLDOWN_MENU, 61, 70, 138, 24, "Return Setting" ); fl_set_object_boxtype( obj, FL_UP_BOX ); fl_set_object_callback( obj, cnt_returnsetting_change, 0 ); fdui->initialval = obj = fl_add_input( FL_FLOAT_INPUT, 340, 122, 92, 24, "Initial Value" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, cnt_initialvalue_change, 0 ); fdui->step1 = obj = fl_add_input( FL_FLOAT_INPUT, 340, 157, 92, 24, "Sml.Step Size" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, cnt_stepchange_cb, 0 ); fdui->step2 = obj = fl_add_input( FL_FLOAT_INPUT, 340, 192, 92, 24, "Lg. Step Size" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, cnt_stepchange_cb, 1 ); fl_end_form( ); fdui->counterattrib->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } xforms-1.2.4/fdesign/spec/xyplot_spec.fd0000664000175000017500000001320112244507302015210 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL Border Width: -1 =============== FORM =============== Name: xyplotattrib Width: 520 Height: 270 Number of Objects: 15 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 520 270 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 10 20 500 240 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_BOLD_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: XYPlot Attributes shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 70 60 85 23 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: XGrid shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: xgrid callback: grid_change_cb argument: 0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 70 90 85 23 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: YGrid shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: ygrid callback: grid_change_cb argument: 0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 70 170 85 23 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: XScale shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: xscale callback: xscale_change_cb argument: 0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 70 210 85 23 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: YScale shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: yscale callback: yscale_change_cb argument: 0 -------------------- class: FL_COUNTER type: FL_NORMAL_COUNTER box: 370 160 115 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: YMajor shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: ymajor callback: ymajorminor_change_cb argument: 0 bounds: -1 20 precision: 0 value: 1 sstep: 1 lstep: 2 -------------------- class: FL_COUNTER type: FL_NORMAL_COUNTER box: 370 200 115 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: YMinor shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: yminor callback: ymajorminor_change_cb argument: 0 bounds: 0 10 precision: 0 value: 1 sstep: 1 lstep: 2 -------------------- class: FL_COUNTER type: FL_NORMAL_COUNTER box: 370 70 115 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: XMajor shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: xmajor callback: xmajorminor_change_cb argument: 0 bounds: -1 20 precision: 0 value: 1 sstep: 1 lstep: 2 -------------------- class: FL_COUNTER type: FL_NORMAL_COUNTER box: 370 110 115 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: XMinor shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: xminor callback: xmajorminor_change_cb argument: 0 bounds: 0 10 precision: 0 value: 1 sstep: 1 lstep: 2 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 160 170 39 23 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_RIGHT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: xbase shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: xbase callback: xscale_change_cb argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 158 210 39 23 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_RIGHT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: ybase shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: ybase callback: yscale_change_cb argument: 0 -------------------- class: FL_MENU type: FL_PULLDOWN_MENU box: 193 29 150 22 boxtype: FL_UP_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Return Setting shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: how_return callback: xyplot_returnsetting_change argument: 0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 70 120 85 23 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Style shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: gridstyle callback: gridstyle_change_cb argument: 0 -------------------- class: FL_CHECKBUTTON type: FL_PUSH_BUTTON box: 230 80 100 25 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: MarkActive shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: mark_active callback: markactive_change_cb argument: 0 ============================== create_the_forms xforms-1.2.4/fdesign/spec/button_spec.c0000664000175000017500000000710412252416033015021 00000000000000/* Form definition file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #include #include "button_spec.h" /*************************************** ***************************************/ FD_buttonattrib * create_form_buttonattrib( void ) { FL_OBJECT *obj; FD_buttonattrib *fdui = ( FD_buttonattrib * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->buttonattrib = fl_bgn_form( FL_NO_BOX, 540, 280 ); fdui->background = obj = fl_add_box( FL_FLAT_BOX, 0, 0, 540, 280, "" ); obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 50, 20, 490, 240, "Button Attributes" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lstyle( obj, FL_TIMESBOLD_STYLE ); fdui->initialval = obj = fl_add_checkbutton( FL_PUSH_BUTTON, 160, 60, 30, 30, "Initially Set" ); fl_set_object_lalign( obj, FL_ALIGN_LEFT ); fl_set_object_callback( obj, initialval_change, 0 ); fdui->filename = obj = fl_add_input( FL_NORMAL_INPUT, 160, 130, 210, 25, "Icon File" ); fl_set_object_callback( obj, iconbutton_filename_change, 0 ); fdui->pixalign = obj = fl_add_choice( FL_NORMAL_CHOICE2, 280, 80, 155, 25, "" ); fl_set_object_callback( obj, pixalign_change, 0 ); fdui->showfocus = obj = fl_add_checkbutton( FL_PUSH_BUTTON, 160, 90, 30, 30, "Show Focus" ); fl_set_object_lalign( obj, FL_ALIGN_LEFT ); fl_set_object_callback( obj, showfocus_change, 0 ); fl_set_button( obj, 1 ); fdui->browse = obj = fl_add_button( FL_NORMAL_BUTTON, 370, 130, 66, 25, "Browse ...." ); fl_set_button_shortcut( obj, "#B", 1 ); fl_set_object_callback( obj, lookfor_pixmapfile_cb, 0 ); fdui->use_data = obj = fl_add_checkbutton( FL_PUSH_BUTTON, 220, 210, 30, 30, "'#include' image file" ); fl_set_object_lalign( obj, FL_ALIGN_LEFT ); fl_set_object_callback( obj, usedata_change, 0 ); fdui->fullpath = obj = fl_add_checkbutton( FL_PUSH_BUTTON, 360, 210, 30, 30, "Use full path" ); fl_set_object_lalign( obj, FL_ALIGN_LEFT ); fl_set_object_callback( obj, fullpath_cb, 0 ); fdui->focus_filename = obj = fl_add_input( FL_NORMAL_INPUT, 160, 170, 210, 25, "Focus icon File" ); fl_set_object_callback( obj, focusiconbutton_filename_change, 0 ); fdui->browse2 = obj = fl_add_button( FL_NORMAL_BUTTON, 370, 170, 66, 25, "Browse ...." ); fl_set_object_callback( obj, lookfor_pixmapfile_cb, 1 ); fdui->mbuttons_label = obj = fl_add_text( FL_NORMAL_TEXT, 60, 40, 100, 20, "Mouse buttons" ); fl_set_object_lalign( obj, FL_ALIGN_CENTER ); fdui->react_left = obj = fl_add_roundbutton( FL_PUSH_BUTTON, 160, 40, 20, 20, "Left" ); fl_set_object_callback( obj, react_to_button, 0 ); fl_set_button( obj, 1 ); fdui->react_middle = obj = fl_add_roundbutton( FL_PUSH_BUTTON, 210, 40, 20, 20, "Middle" ); fl_set_object_callback( obj, react_to_button, 1 ); fl_set_button( obj, 1 ); fdui->react_right = obj = fl_add_roundbutton( FL_PUSH_BUTTON, 280, 40, 20, 20, "Right" ); fl_set_object_callback( obj, react_to_button, 2 ); fl_set_button( obj, 1 ); fdui->react_up = obj = fl_add_roundbutton( FL_PUSH_BUTTON, 340, 40, 20, 20, "Up" ); fl_set_object_callback( obj, react_to_button, 3 ); fl_set_button( obj, 1 ); fdui->react_down = obj = fl_add_roundbutton( FL_PUSH_BUTTON, 390, 40, 20, 20, "Down" ); fl_set_object_callback( obj, react_to_button, 4 ); fl_set_button( obj, 1 ); fl_end_form( ); fdui->buttonattrib->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } xforms-1.2.4/fdesign/spec/browser_spec.h0000664000175000017500000000167712252416033015207 00000000000000/* Header file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #ifndef FD_browserattrib_h_ #define FD_browserattrib_h_ #include "../lib/include/forms.h" /* Callbacks, globals and object handlers */ void add_item_cb( FL_OBJECT *, long ); void delete_item_cb( FL_OBJECT *, long ); void insert_cb( FL_OBJECT *, long ); void hscb_pref_cb( FL_OBJECT *, long ); void vscb_pref_cb( FL_OBJECT *, long ); void br_returnsetting_change( FL_OBJECT *, long ); void clear_field_cb( FL_OBJECT *, long ); void replace_item_cb( FL_OBJECT *, long ); /* Forms and Objects */ typedef struct { FL_FORM * browserattrib; void * vdata; char * cdata; long ldata; FL_OBJECT * content_br; FL_OBJECT * input; FL_OBJECT * hscb_pref; FL_OBJECT * vscb_pref; FL_OBJECT * returnsetting; FL_OBJECT * auto_clear; } FD_browserattrib; FD_browserattrib * create_form_browserattrib( void ); #endif /* FD_browserattrib_h_ */ xforms-1.2.4/fdesign/spec/pixmap_spec.fd0000664000175000017500000000527212246454064015170 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL Border Width: -1 =============== FORM =============== Name: pixmapattrib Width: 540 Height: 280 Number of Objects: 7 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 540 280 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: background callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 20 20 490 240 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_TIMESBOLD_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Pixmap Attributes shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: frame callback: argument: -------------------- class: FL_INPUT type: FL_NORMAL_INPUT box: 160 113 210 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Bitmap/Pixmap File shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: filename callback: pixmap_filename_change argument: 0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 282 60 155 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: pixalign callback: pixmapalign_change argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 372 113 66 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Browse .... shortcut: #B resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: browse callback: pixmaplookfor_pixmapfile_cb argument: 0 -------------------- class: FL_CHECKBUTTON type: FL_PUSH_BUTTON box: 215 155 30 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: '#include' image file shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: use_data callback: pixmapusedata_change argument: 0 -------------------- class: FL_CHECKBUTTON type: FL_PUSH_BUTTON box: 355 155 30 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Use full path shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: fullpath callback: pixmapfullpath_cb argument: 0 ============================== create_the_forms xforms-1.2.4/fdesign/spec/counter_spec.h0000664000175000017500000000160512252416033015172 00000000000000/* Header file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #ifndef FD_counterattrib_h_ #define FD_counterattrib_h_ #include "../lib/include/forms.h" /* Callbacks, globals and object handlers */ void cnt_precision_cb( FL_OBJECT *, long ); void cnt_minmax_change( FL_OBJECT *, long ); void cnt_returnsetting_change( FL_OBJECT *, long ); void cnt_initialvalue_change( FL_OBJECT *, long ); void cnt_stepchange_cb( FL_OBJECT *, long ); /* Forms and Objects */ typedef struct { FL_FORM * counterattrib; void * vdata; char * cdata; long ldata; FL_OBJECT * background; FL_OBJECT * prec; FL_OBJECT * minval; FL_OBJECT * maxval; FL_OBJECT * returnsetting; FL_OBJECT * initialval; FL_OBJECT * step1; FL_OBJECT * step2; } FD_counterattrib; FD_counterattrib * create_form_counterattrib( void ); #endif /* FD_counterattrib_h_ */ xforms-1.2.4/fdesign/spec/menu_spec.fd0000664000175000017500000001444712244507201014630 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL Border Width: -1 =============== FORM =============== Name: menuattrib Width: 520 Height: 270 Number of Objects: 18 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 520 270 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 15 20 480 230 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_BOLD_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Menu Attributes shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 25 65 190 170 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Item Attributes shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 225 67 111 140 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Action shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BROWSER type: FL_HOLD_BROWSER box: 353 70 120 140 boxtype: FL_DOWN_BOX colors: FL_WHITE FL_YELLOW alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: CurrentItems: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: content_br callback: argument: -------------------- class: FL_INPUT type: FL_NORMAL_INPUT box: 35 90 170 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: EditItem shortcut: #E resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input callback: argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 235 82 84 26 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Add shortcut: #A resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: add_menu_item_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 235 143 84 24 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Delete shortcut: #D resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: delete_menu_item_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 235 172 84 24 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Change shortcut: #C resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: change_menu_item_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 320 220 82 24 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: ClearField shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: clear_menu_field_cb argument: 0 -------------------- class: FL_CHECKBUTTON type: FL_PUSH_BUTTON box: 230 220 24 27 boxtype: FL_NO_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: AutoClear shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: auto_clear callback: argument: value: 1 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 235 112 84 26 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Replace shortcut: #R resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: replace_menu_item_cb argument: 0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 106 133 98 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Mode shortcut: #M resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: mode callback: argument: 0 -------------------- class: FL_INPUT type: FL_NORMAL_INPUT box: 35 133 70 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Shortcut shortcut: #S resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: shortcut callback: argument: 0 -------------------- class: FL_INPUT type: FL_NORMAL_INPUT box: 35 176 170 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Callback shortcut: #B resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: item_cb callback: argument: 0 -------------------- class: FL_CHECKBUTTON type: FL_PUSH_BUTTON box: 280 21 35 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Use Struct shortcut: #U resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: new_menuapi callback: new_menuapi_cb argument: 0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 365 25 75 22 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: scope callback: menuentry_scope_cb argument: 0 -------------------- class: FL_COUNTER type: FL_NORMAL_COUNTER box: 90 210 110 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: MenuID shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: id callback: argument: 0 bounds: 1.0 1000000.0 value: 1.0 sstep: 1.0 lstep: 10.0 ============================== create_the_forms xforms-1.2.4/fdesign/spec/positioner_spec.c0000664000175000017500000000556412252416033015711 00000000000000/* Form definition file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #include #include "positioner_spec.h" /*************************************** ***************************************/ FD_posattrib * create_form_posattrib( void ) { FL_OBJECT *obj; FD_posattrib *fdui = ( FD_posattrib * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->posattrib = fl_bgn_form( FL_NO_BOX, 540, 280 ); fdui->background = obj = fl_add_box( FL_FLAT_BOX, 0, 0, 540, 280, "" ); obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 30, 20, 475, 235, "Positioner Attributes" ); fl_set_object_lsize( obj, FL_MEDIUM_SIZE ); fl_set_object_lstyle( obj, FL_TIMESBOLD_STYLE ); fdui->returnsetting = obj = fl_add_menu( FL_PULLDOWN_MENU, 195, 55, 138, 24, "Return Setting" ); fl_set_object_boxtype( obj, FL_UP_BOX ); fl_set_object_callback( obj, pos_returnsetting_change, 0 ); fdui->xminval = obj = fl_add_input( FL_FLOAT_INPUT, 170, 95, 92, 24, "Xmin(left)" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, pos_xminmax_change, 0 ); fdui->xmaxval = obj = fl_add_input( FL_FLOAT_INPUT, 170, 131, 92, 24, "Xmax(right)" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, pos_xminmax_change, 0 ); fdui->initialxval = obj = fl_add_input( FL_FLOAT_INPUT, 170, 168, 92, 24, "Initial XValue" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, pos_initialxvalue_change, 0 ); fdui->xstep = obj = fl_add_input( FL_FLOAT_INPUT, 170, 205, 92, 24, "X StepSize" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, pos_xstepchange_cb, 0 ); fdui->yminval = obj = fl_add_input( FL_FLOAT_INPUT, 275, 95, 92, 24, "Ymin(bottom)" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lalign( obj, FL_ALIGN_RIGHT ); fl_set_object_callback( obj, pos_yminmax_change, 0 ); fdui->ymaxval = obj = fl_add_input( FL_FLOAT_INPUT, 275, 131, 92, 24, "Ymax(top)" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lalign( obj, FL_ALIGN_RIGHT ); fl_set_object_callback( obj, pos_yminmax_change, 0 ); fdui->initialyval = obj = fl_add_input( FL_FLOAT_INPUT, 275, 168, 92, 24, "Initial YValue" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lalign( obj, FL_ALIGN_RIGHT ); fl_set_object_callback( obj, pos_initialyvalue_change, 0 ); fdui->ystep = obj = fl_add_input( FL_FLOAT_INPUT, 275, 205, 92, 24, "YStepSize" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lalign( obj, FL_ALIGN_RIGHT ); fl_set_object_callback( obj, pos_ystepchange_cb, 0 ); fl_end_form( ); fdui->posattrib->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } xforms-1.2.4/fdesign/spec/spinner_spec.c0000664000175000017500000000422012252416033015160 00000000000000/* Form definition file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #include #include "spinner_spec.h" /*************************************** ***************************************/ FD_spinnerattrib * create_form_spinnerattrib( void ) { FL_OBJECT *obj; FD_spinnerattrib *fdui = ( FD_spinnerattrib * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->spinnerattrib = fl_bgn_form( FL_NO_BOX, 540, 280 ); fdui->background = obj = fl_add_box( FL_FLAT_BOX, 0, 0, 540, 280, " " ); obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 25, 20, 485, 235, " Spinner Attributes" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); fdui->prec = obj = fl_add_counter( FL_SIMPLE_COUNTER, 65, 170, 135, 25, " Precision" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lalign( obj, FL_ALIGN_TOP ); fl_set_object_callback( obj, spn_precision_cb, 0 ); fdui->minval = obj = fl_add_input( FL_FLOAT_INPUT, 340, 60, 92, 24, "Spinner Min." ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, spn_minmax_change, 0 ); fdui->maxval = obj = fl_add_input( FL_FLOAT_INPUT, 340, 100, 92, 24, "Spinner Max." ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, spn_minmax_change, 0 ); fdui->returnsetting = obj = fl_add_menu( FL_PULLDOWN_MENU, 60, 80, 138, 24, " Return Setting" ); fl_set_object_boxtype( obj, FL_UP_BOX ); fl_set_object_callback( obj, spn_returnsetting_change, 0 ); fdui->initialval = obj = fl_add_input( FL_FLOAT_INPUT, 340, 150, 92, 24, "Initial Value" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, spn_initialvalue_change, 0 ); fdui->step = obj = fl_add_input( FL_FLOAT_INPUT, 340, 200, 92, 24, "Step size" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, spn_stepchange_cb, 0 ); fl_end_form( ); fdui->spinnerattrib->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } xforms-1.2.4/fdesign/spec/slider_spec.c0000664000175000017500000000543412252416033014774 00000000000000/* Form definition file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #include #include "slider_spec.h" /*************************************** ***************************************/ FD_sliderattrib * create_form_sliderattrib( void ) { FL_OBJECT *obj; FD_sliderattrib *fdui = ( FD_sliderattrib * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->sliderattrib = fl_bgn_form( FL_NO_BOX, 540, 280 ); fdui->background = obj = fl_add_box( FL_FLAT_BOX, 0, 0, 540, 280, "" ); obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 30, 20, 470, 240, "Slider Attributes" ); fl_set_object_lsize( obj, FL_MEDIUM_SIZE ); fl_set_object_lstyle( obj, FL_TIMESBOLD_STYLE ); fdui->prec = obj = fl_add_counter( FL_NORMAL_COUNTER, 335, 135, 114, 23, "Precision" ); fl_set_object_lalign( obj, FL_ALIGN_TOP ); fl_set_object_callback( obj, adjust_precision, 0 ); fl_set_counter_precision( obj, 0 ); fl_set_counter_bounds( obj, 0, 0 ); fl_set_counter_step( obj, 0, 0 ); fdui->minval = obj = fl_add_input( FL_FLOAT_INPUT, 205, 41, 82, 25, "Value at bottom/left" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, minmax_change, 0 ); fdui->maxval = obj = fl_add_input( FL_FLOAT_INPUT, 205, 72, 82, 25, "Value at top/right" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, minmax_change, 0 ); fdui->returnsetting = obj = fl_add_menu( FL_PULLDOWN_MENU, 325, 80, 143, 24, "Return Setting" ); fl_set_object_boxtype( obj, FL_UP_BOX ); fl_set_object_callback( obj, returnsetting_change, 0 ); fdui->initial_val = obj = fl_add_input( FL_FLOAT_INPUT, 205, 104, 82, 25, "Initial Value" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, initialvalue_change, 0 ); fdui->slsize = obj = fl_add_input( FL_FLOAT_INPUT, 205, 136, 82, 25, "Slider Size" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, slsize_change, 0 ); fdui->step = obj = fl_add_input( FL_FLOAT_INPUT, 205, 166, 82, 25, "StepSize" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, step_change, 0 ); fdui->ldelta = obj = fl_add_input( FL_FLOAT_INPUT, 205, 196, 82, 25, "Leftmouse Increment" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, increment_change, 0 ); fdui->rdelta = obj = fl_add_input( FL_FLOAT_INPUT, 205, 226, 82, 25, "Rightmouse Increment" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, increment_change, 0 ); fl_end_form( ); fdui->sliderattrib->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } xforms-1.2.4/fdesign/spec/positioner_spec.fd0000664000175000017500000001003312244507226016051 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL Border Width: -1 =============== FORM =============== Name: posattrib Width: 540 Height: 280 Number of Objects: 11 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 540 280 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: background callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 30 20 475 235 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_TIMESBOLD_STYLE size: FL_MEDIUM_SIZE lcol: FL_BLACK label: Positioner Attributes shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_MENU type: FL_PULLDOWN_MENU box: 195 55 138 24 boxtype: FL_UP_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Return Setting shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: returnsetting callback: pos_returnsetting_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 170 95 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Xmin(left) shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: xminval callback: pos_xminmax_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 170 131 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Xmax(right) shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: xmaxval callback: pos_xminmax_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 170 168 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Initial XValue shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: initialxval callback: pos_initialxvalue_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 170 205 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: X StepSize shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: xstep callback: pos_xstepchange_cb argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 275 95 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_RIGHT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Ymin(bottom) shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: yminval callback: pos_yminmax_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 275 131 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_RIGHT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Ymax(top) shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: ymaxval callback: pos_yminmax_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 275 168 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_RIGHT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Initial YValue shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: initialyval callback: pos_initialyvalue_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 275 205 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_RIGHT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: YStepSize shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: ystep callback: pos_ystepchange_cb argument: 0 ============================== create_the_forms xforms-1.2.4/fdesign/spec/spinner_spec.fd0000664000175000017500000000577212244507261015351 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL Border Width: -1 SnapGrid: 5 =============== FORM =============== Name: spinnerattrib Width: 540 Height: 280 Number of Objects: 8 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 540 280 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: background callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 25 20 485 235 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_BOLD_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Spinner Attributes shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_COUNTER type: FL_SIMPLE_COUNTER box: 65 170 135 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_TOP style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Precision shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: prec callback: spn_precision_cb argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 340 60 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Spinner Min. shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: minval callback: spn_minmax_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 340 100 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Spinner Max. shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: maxval callback: spn_minmax_change argument: 0 -------------------- class: FL_MENU type: FL_PULLDOWN_MENU box: 60 80 138 24 boxtype: FL_UP_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Return Setting shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: returnsetting callback: spn_returnsetting_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 340 150 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Initial Value shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: initialval callback: spn_initialvalue_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 340 200 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Step size shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: step callback: spn_stepchange_cb argument: 0 ============================== create_the_forms xforms-1.2.4/fdesign/spec/twheel_spec.h0000664000175000017500000000145712252416033015010 00000000000000/* Header file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #ifndef FD_twheelattrib_h_ #define FD_twheelattrib_h_ #include "../lib/include/forms.h" /* Callbacks, globals and object handlers */ void twheel_minmax_change( FL_OBJECT *, long ); void twheel_returnsetting_change( FL_OBJECT *, long ); void twheel_initialvalue_change( FL_OBJECT *, long ); void twheel_step_change( FL_OBJECT *, long ); /* Forms and Objects */ typedef struct { FL_FORM * twheelattrib; void * vdata; char * cdata; long ldata; FL_OBJECT * background; FL_OBJECT * minval; FL_OBJECT * maxval; FL_OBJECT * returnsetting; FL_OBJECT * initial_val; FL_OBJECT * step; } FD_twheelattrib; FD_twheelattrib * create_form_twheelattrib( void ); #endif /* FD_twheelattrib_h_ */ xforms-1.2.4/fdesign/spec/slider_spec.fd0000664000175000017500000001007412244507252015144 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL Border Width: -1 =============== FORM =============== Name: sliderattrib Width: 540 Height: 280 Number of Objects: 11 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 540 280 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: background callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 30 20 470 240 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_TIMESBOLD_STYLE size: FL_MEDIUM_SIZE lcol: FL_BLACK label: Slider Attributes shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_COUNTER type: FL_NORMAL_COUNTER box: 335 135 114 23 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Precision shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: prec callback: adjust_precision argument: 0 bounds: 0 0 precision: 0 sstep: 0 lstep: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 205 41 82 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Value at bottom/left shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: minval callback: minmax_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 205 72 82 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Value at top/right shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: maxval callback: minmax_change argument: 0 -------------------- class: FL_MENU type: FL_PULLDOWN_MENU box: 325 80 143 24 boxtype: FL_UP_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Return Setting shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: returnsetting callback: returnsetting_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 205 104 82 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Initial Value shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: initial_val callback: initialvalue_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 205 136 82 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Slider Size shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: slsize callback: slsize_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 205 166 82 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: StepSize shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: step callback: step_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 205 196 82 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Leftmouse Increment shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: ldelta callback: increment_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 205 226 82 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Rightmouse Increment shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: rdelta callback: increment_change argument: 0 ============================== create_the_forms xforms-1.2.4/fdesign/spec/freeobj_spec.fd0000664000175000017500000000243212244507076015301 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL Border Width: -1 =============== FORM =============== Name: freeobjattrib Width: 540 Height: 280 Number of Objects: 3 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 540 280 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: background callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 20 20 490 240 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_BOLD_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Free Object Attributes shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_INPUT type: FL_NORMAL_INPUT box: 145 110 280 30 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Freeobject Handler shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: hname callback: handler_name_change_cb argument: 0 ============================== create_the_forms xforms-1.2.4/fdesign/spec/twheel_spec.fd0000664000175000017500000000524612244507271015160 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL Border Width: -1 =============== FORM =============== Name: twheelattrib Width: 540 Height: 280 Number of Objects: 7 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 540 280 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: background callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 30 20 470 240 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_TIMESBOLD_STYLE size: FL_MEDIUM_SIZE lcol: FL_BLACK label: Thumbwheel Attributes shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 210 80 82 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Minimum Value shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: minval callback: twheel_minmax_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 210 111 82 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Maximum Value shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: maxval callback: twheel_minmax_change argument: 0 -------------------- class: FL_MENU type: FL_PULLDOWN_MENU box: 320 90 143 24 boxtype: FL_UP_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Return Setting shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: returnsetting callback: twheel_returnsetting_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 210 143 82 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Initial Value shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: initial_val callback: twheel_initialvalue_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 210 175 82 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: StepSize shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: step callback: twheel_step_change argument: 0 ============================== create_the_forms xforms-1.2.4/fdesign/spec/browser_spec.c0000664000175000017500000000622212252416033015171 00000000000000/* Form definition file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #include #include "browser_spec.h" /*************************************** ***************************************/ FD_browserattrib * create_form_browserattrib( void ) { FL_OBJECT *obj; FD_browserattrib *fdui = ( FD_browserattrib * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->browserattrib = fl_bgn_form( FL_NO_BOX, 520, 270 ); obj = fl_add_box( FL_FLAT_BOX, 0, 0, 520, 270, "" ); obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 15, 20, 480, 230, "Browser Attributes" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 225, 57, 111, 140, "Action" ); fdui->content_br = obj = fl_add_browser( FL_HOLD_BROWSER, 353, 55, 120, 150, "Current Items:" ); fl_set_object_lalign( obj, FL_ALIGN_LEFT_TOP ); fdui->input = obj = fl_add_input( FL_NORMAL_INPUT, 35, 67, 170, 25, "EditItem" ); fl_set_object_lalign( obj, FL_ALIGN_LEFT_TOP ); obj = fl_add_button( FL_NORMAL_BUTTON, 235, 72, 84, 26, "Add" ); fl_set_button_shortcut( obj, "#A", 1 ); fl_set_object_callback( obj, add_item_cb, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 235, 133, 84, 24, "Delete" ); fl_set_button_shortcut( obj, "#D", 1 ); fl_set_object_callback( obj, delete_item_cb, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 235, 162, 84, 24, "Insert" ); fl_set_button_shortcut( obj, "#I", 1 ); fl_set_object_callback( obj, insert_cb, 0 ); fdui->hscb_pref = obj = fl_add_choice( FL_NORMAL_CHOICE2, 95, 175, 90, 24, "" ); fl_set_object_shortcut( obj, "#H", 1 ); fl_set_object_callback( obj, hscb_pref_cb, 0 ); fdui->vscb_pref = obj = fl_add_choice( FL_NORMAL_CHOICE2, 95, 147, 90, 24, "" ); fl_set_object_shortcut( obj, "#V", 1 ); fl_set_object_callback( obj, vscb_pref_cb, 0 ); fdui->returnsetting = obj = fl_add_menu( FL_PULLDOWN_MENU, 140, 210, 138, 24, "Return Setting" ); fl_set_object_boxtype( obj, FL_UP_BOX ); fl_set_object_callback( obj, br_returnsetting_change, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 120, 101, 82, 24, "ClearField" ); fl_set_button_shortcut( obj, "#L", 1 ); fl_set_object_callback( obj, clear_field_cb, 0 ); fdui->auto_clear = obj = fl_add_checkbutton( FL_PUSH_BUTTON, 35, 99, 24, 27, "AutoClear" ); fl_set_button_shortcut( obj, "#U", 1 ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_button( obj, 1 ); obj = fl_add_button( FL_NORMAL_BUTTON, 235, 102, 84, 26, "Replace" ); fl_set_button_shortcut( obj, "#R", 1 ); fl_set_object_callback( obj, replace_item_cb, 0 ); obj = fl_add_box( FL_NO_BOX, 33, 176, 62, 22, "H\010Scrollbar" ); fl_set_object_lalign( obj, FL_ALIGN_RIGHT | FL_ALIGN_INSIDE ); obj = fl_add_box( FL_NO_BOX, 32, 148, 62, 22, "V\010Scrollbar" ); fl_set_object_lalign( obj, FL_ALIGN_RIGHT | FL_ALIGN_INSIDE ); fl_end_form( ); fdui->browserattrib->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } xforms-1.2.4/fdesign/spec/choice_spec.fd0000664000175000017500000001447512244507033015122 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL Border Width: -1 =============== FORM =============== Name: choiceattrib Width: 520 Height: 270 Number of Objects: 18 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 520 270 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 15 20 480 230 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_BOLD_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Choice Attributes shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 25 80 190 120 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Item Attributes shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 225 82 111 140 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Action shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BROWSER type: FL_HOLD_BROWSER box: 353 85 120 140 boxtype: FL_DOWN_BOX colors: FL_WHITE FL_YELLOW alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: CurrentItems: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: content_br callback: argument: -------------------- class: FL_INPUT type: FL_NORMAL_INPUT box: 35 107 170 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: EditItem shortcut: #E resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input callback: argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 235 97 84 26 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Add shortcut: #A resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: add_choice_item_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 235 158 84 24 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Delete shortcut: #D resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: delete_choice_item_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 235 187 84 24 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Change shortcut: #C resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: change_choice_item_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 115 207 82 24 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: ClearField shortcut: #F resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: clear_choice_field_cb argument: 0 -------------------- class: FL_CHECKBUTTON type: FL_PUSH_BUTTON box: 30 205 24 27 boxtype: FL_NO_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: AutoClear shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: auto_clear callback: argument: value: 1 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 235 127 84 26 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Replace shortcut: #R resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: replace_choice_item_cb argument: 0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 106 155 98 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Mode shortcut: #M resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: mode callback: argument: 0 -------------------- class: FL_INPUT type: FL_NORMAL_INPUT box: 35 155 70 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Shortcut shortcut: #S resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: shortcut callback: argument: 0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 45 39 150 24 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: align callback: choice_align_cb argument: 0 -------------------- class: FL_COUNTER type: FL_NORMAL_COUNTER box: 365 42 100 18 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Initial Choice shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: val callback: choice_val_cb argument: 0 precision: 0 value: 1 sstep: 1 lstep: 2 -------------------- class: FL_CHECKBUTTON type: FL_PUSH_BUTTON box: 210 39 70 25 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Use Struct shortcut: #U resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: new_menuapi callback: use_struct_cb argument: 0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 290 40 65 22 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: scope callback: choiceentry_scope_cb argument: 0 ============================== create_the_forms xforms-1.2.4/fdesign/spec/freeobj_spec.c0000664000175000017500000000212012252416033015113 00000000000000/* Form definition file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #include #include "freeobj_spec.h" /*************************************** ***************************************/ FD_freeobjattrib * create_form_freeobjattrib( void ) { FL_OBJECT *obj; FD_freeobjattrib *fdui = ( FD_freeobjattrib * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->freeobjattrib = fl_bgn_form( FL_NO_BOX, 540, 280 ); fdui->background = obj = fl_add_box( FL_FLAT_BOX, 0, 0, 540, 280, "" ); obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 20, 20, 490, 240, "Free Object Attributes" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); fdui->hname = obj = fl_add_input( FL_NORMAL_INPUT, 145, 110, 280, 30, "Freeobject Handler" ); fl_set_object_callback( obj, handler_name_change_cb, 0 ); fl_end_form( ); fdui->freeobjattrib->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } xforms-1.2.4/fdesign/spec/counter_spec.fd0000664000175000017500000000650512244507044015344 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL Border Width: -1 =============== FORM =============== Name: counterattrib Width: 540 Height: 280 Number of Objects: 9 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 540 280 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: background callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 25 20 485 235 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_BOLD_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Counter Attributes shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_COUNTER type: FL_NORMAL_COUNTER box: 60 150 145 23 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_TOP style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Precision shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: prec callback: cnt_precision_cb argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 340 52 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Counter Min shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: minval callback: cnt_minmax_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 340 87 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Counter Max shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: maxval callback: cnt_minmax_change argument: 0 -------------------- class: FL_MENU type: FL_PULLDOWN_MENU box: 61 70 138 24 boxtype: FL_UP_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Return Setting shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: returnsetting callback: cnt_returnsetting_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 340 122 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Initial Value shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: initialval callback: cnt_initialvalue_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 340 157 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Sml.Step Size shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: step1 callback: cnt_stepchange_cb argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 340 192 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Lg. Step Size shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: step2 callback: cnt_stepchange_cb argument: 1 ============================== create_the_forms xforms-1.2.4/fdesign/spec/menu_spec.h0000664000175000017500000000173112252416033014457 00000000000000/* Header file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #ifndef FD_menuattrib_h_ #define FD_menuattrib_h_ #include "../lib/include/forms.h" /* Callbacks, globals and object handlers */ void add_menu_item_cb( FL_OBJECT *, long ); void delete_menu_item_cb( FL_OBJECT *, long ); void change_menu_item_cb( FL_OBJECT *, long ); void clear_menu_field_cb( FL_OBJECT *, long ); void replace_menu_item_cb( FL_OBJECT *, long ); void new_menuapi_cb( FL_OBJECT *, long ); void menuentry_scope_cb( FL_OBJECT *, long ); /* Forms and Objects */ typedef struct { FL_FORM * menuattrib; void * vdata; char * cdata; long ldata; FL_OBJECT * content_br; FL_OBJECT * input; FL_OBJECT * auto_clear; FL_OBJECT * mode; FL_OBJECT * shortcut; FL_OBJECT * item_cb; FL_OBJECT * new_menuapi; FL_OBJECT * scope; FL_OBJECT * id; } FD_menuattrib; FD_menuattrib * create_form_menuattrib( void ); #endif /* FD_menuattrib_h_ */ xforms-1.2.4/fdesign/spec/button_spec.fd0000664000175000017500000001427312246453500015200 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL Border Width: -1 =============== FORM =============== Name: buttonattrib Width: 540 Height: 280 Number of Objects: 17 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 540 280 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: background callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 50 20 490 240 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_TIMESBOLD_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Button Attributes shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_CHECKBUTTON type: FL_PUSH_BUTTON box: 160 60 30 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Initially Set shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: initialval callback: initialval_change argument: 0 -------------------- class: FL_INPUT type: FL_NORMAL_INPUT box: 160 130 210 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Icon File shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: filename callback: iconbutton_filename_change argument: 0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 280 80 155 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: pixalign callback: pixalign_change argument: 0 -------------------- class: FL_CHECKBUTTON type: FL_PUSH_BUTTON box: 160 90 30 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Show Focus shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: showfocus callback: showfocus_change argument: 0 value: 1 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 370 130 66 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Browse .... shortcut: #B resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: browse callback: lookfor_pixmapfile_cb argument: 0 -------------------- class: FL_CHECKBUTTON type: FL_PUSH_BUTTON box: 220 210 30 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: '#include' image file shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: use_data callback: usedata_change argument: 0 -------------------- class: FL_CHECKBUTTON type: FL_PUSH_BUTTON box: 360 210 30 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Use full path shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: fullpath callback: fullpath_cb argument: 0 -------------------- class: FL_INPUT type: FL_NORMAL_INPUT box: 160 170 210 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Focus icon File shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: focus_filename callback: focusiconbutton_filename_change argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 370 170 66 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Browse .... shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: browse2 callback: lookfor_pixmapfile_cb argument: 1 -------------------- class: FL_TEXT type: FL_NORMAL_TEXT box: 60 40 100 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Mouse buttons shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: mbuttons_label callback: argument: -------------------- class: FL_ROUNDBUTTON type: FL_PUSH_BUTTON box: 160 40 20 20 boxtype: FL_NO_BOX colors: FL_MCOL FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Left shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: react_left callback: react_to_button argument: 0 value: 1 -------------------- class: FL_ROUNDBUTTON type: FL_PUSH_BUTTON box: 210 40 20 20 boxtype: FL_NO_BOX colors: FL_MCOL FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Middle shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: react_middle callback: react_to_button argument: 1 value: 1 -------------------- class: FL_ROUNDBUTTON type: FL_PUSH_BUTTON box: 280 40 20 20 boxtype: FL_NO_BOX colors: FL_MCOL FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Right shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: react_right callback: react_to_button argument: 2 value: 1 -------------------- class: FL_ROUNDBUTTON type: FL_PUSH_BUTTON box: 340 40 20 20 boxtype: FL_NO_BOX colors: FL_MCOL FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Up shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: react_up callback: react_to_button argument: 3 value: 1 -------------------- class: FL_ROUNDBUTTON type: FL_PUSH_BUTTON box: 390 40 20 20 boxtype: FL_NO_BOX colors: FL_MCOL FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Down shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: react_down callback: react_to_button argument: 4 value: 1 ============================== create_the_forms xforms-1.2.4/fdesign/spec/dial_spec.fd0000664000175000017500000000725312244507053014577 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL Border Width: -1 =============== FORM =============== Name: dialattrib Width: 540 Height: 280 Number of Objects: 10 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 540 280 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: background callback: argument: -------------------- class: FL_MENU type: FL_PULLDOWN_MENU box: 305 90 138 24 boxtype: FL_UP_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Return Setting shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: returnsetting callback: dial_returnsetting_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 195 45 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Dial Min shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: minval callback: dial_minmax_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 195 77 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: DialMax shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: maxval callback: dial_minmax_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 195 109 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Initial Value shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: initialval callback: dial_initialvalue_change argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 195 141 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Dial Step shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: step callback: dial_stepchange_cb argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 195 173 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Min. Angle shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: thetai callback: dial_thetachange_cb argument: 0 -------------------- class: FL_INPUT type: FL_FLOAT_INPUT box: 195 205 92 24 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Max. Angle shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: thetaf callback: dial_thetachange_cb argument: 1 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 306 155 134 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Direction shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: dir callback: dir_cb argument: 0 -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 30 15 480 240 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_TIMESBOLD_STYLE + FL_EMBOSSED_STYLE size: FL_MEDIUM_SIZE lcol: FL_DARKVIOLET label: Dial Attributes shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: ============================== create_the_forms xforms-1.2.4/fdesign/spec/xyplot_spec.h0000664000175000017500000000220012252416033015042 00000000000000/* Header file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #ifndef FD_xyplotattrib_h_ #define FD_xyplotattrib_h_ #include "../lib/include/forms.h" /* Callbacks, globals and object handlers */ void grid_change_cb( FL_OBJECT *, long ); void xscale_change_cb( FL_OBJECT *, long ); void yscale_change_cb( FL_OBJECT *, long ); void ymajorminor_change_cb( FL_OBJECT *, long ); void xmajorminor_change_cb( FL_OBJECT *, long ); void xyplot_returnsetting_change( FL_OBJECT *, long ); void gridstyle_change_cb( FL_OBJECT *, long ); void markactive_change_cb( FL_OBJECT *, long ); /* Forms and Objects */ typedef struct { FL_FORM * xyplotattrib; void * vdata; char * cdata; long ldata; FL_OBJECT * xgrid; FL_OBJECT * ygrid; FL_OBJECT * xscale; FL_OBJECT * yscale; FL_OBJECT * ymajor; FL_OBJECT * yminor; FL_OBJECT * xmajor; FL_OBJECT * xminor; FL_OBJECT * xbase; FL_OBJECT * ybase; FL_OBJECT * how_return; FL_OBJECT * gridstyle; FL_OBJECT * mark_active; } FD_xyplotattrib; FD_xyplotattrib * create_form_xyplotattrib( void ); #endif /* FD_xyplotattrib_h_ */ xforms-1.2.4/fdesign/spec/positioner_spec.h0000664000175000017500000000201412252416033015701 00000000000000/* Header file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #ifndef FD_posattrib_h_ #define FD_posattrib_h_ #include "../lib/include/forms.h" /* Callbacks, globals and object handlers */ void pos_returnsetting_change( FL_OBJECT *, long ); void pos_xminmax_change( FL_OBJECT *, long ); void pos_initialxvalue_change( FL_OBJECT *, long ); void pos_xstepchange_cb( FL_OBJECT *, long ); void pos_yminmax_change( FL_OBJECT *, long ); void pos_initialyvalue_change( FL_OBJECT *, long ); void pos_ystepchange_cb( FL_OBJECT *, long ); /* Forms and Objects */ typedef struct { FL_FORM * posattrib; void * vdata; char * cdata; long ldata; FL_OBJECT * background; FL_OBJECT * returnsetting; FL_OBJECT * xminval; FL_OBJECT * xmaxval; FL_OBJECT * initialxval; FL_OBJECT * xstep; FL_OBJECT * yminval; FL_OBJECT * ymaxval; FL_OBJECT * initialyval; FL_OBJECT * ystep; } FD_posattrib; FD_posattrib * create_form_posattrib( void ); #endif /* FD_posattrib_h_ */ xforms-1.2.4/fdesign/spec/browser_spec.fd0000664000175000017500000001307512244507005015345 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL Border Width: -1 =============== FORM =============== Name: browserattrib Width: 520 Height: 270 Number of Objects: 16 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 520 270 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 15 20 480 230 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_BOLD_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Browser Attributes shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 225 57 111 140 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Action shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BROWSER type: FL_HOLD_BROWSER box: 353 55 120 150 boxtype: FL_DOWN_BOX colors: FL_WHITE FL_YELLOW alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Current Items: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: content_br callback: argument: -------------------- class: FL_INPUT type: FL_NORMAL_INPUT box: 35 67 170 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: EditItem shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input callback: argument: -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 235 72 84 26 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Add shortcut: #A resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: add_item_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 235 133 84 24 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Delete shortcut: #D resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: delete_item_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 235 162 84 24 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Insert shortcut: #I resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: insert_cb argument: 0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 95 175 90 24 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: #H resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: hscb_pref callback: hscb_pref_cb argument: 0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE2 box: 95 147 90 24 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: #V resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: vscb_pref callback: vscb_pref_cb argument: 0 -------------------- class: FL_MENU type: FL_PULLDOWN_MENU box: 140 210 138 24 boxtype: FL_UP_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Return Setting shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: returnsetting callback: br_returnsetting_change argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 120 101 82 24 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: ClearField shortcut: #L resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: clear_field_cb argument: 0 -------------------- class: FL_CHECKBUTTON type: FL_PUSH_BUTTON box: 35 99 24 27 boxtype: FL_NO_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: AutoClear shortcut: #U resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: auto_clear callback: argument: value: 1 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 235 102 84 26 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Replace shortcut: #R resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: replace_item_cb argument: 0 -------------------- class: FL_BOX type: FL_NO_BOX box: 33 176 62 22 boxtype: FL_NO_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_RIGHT|FL_ALIGN_INSIDE style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: H\010Scrollbar shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FL_NO_BOX box: 32 148 62 22 boxtype: FL_NO_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_RIGHT|FL_ALIGN_INSIDE style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: V\010Scrollbar shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: ============================== create_the_forms xforms-1.2.4/fdesign/spec/twheel_spec.c0000664000175000017500000000364712252416033015006 00000000000000/* Form definition file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #include #include "twheel_spec.h" /*************************************** ***************************************/ FD_twheelattrib * create_form_twheelattrib( void ) { FL_OBJECT *obj; FD_twheelattrib *fdui = ( FD_twheelattrib * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->twheelattrib = fl_bgn_form( FL_NO_BOX, 540, 280 ); fdui->background = obj = fl_add_box( FL_FLAT_BOX, 0, 0, 540, 280, "" ); obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 30, 20, 470, 240, "Thumbwheel Attributes" ); fl_set_object_lsize( obj, FL_MEDIUM_SIZE ); fl_set_object_lstyle( obj, FL_TIMESBOLD_STYLE ); fdui->minval = obj = fl_add_input( FL_FLOAT_INPUT, 210, 80, 82, 25, "Minimum Value" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, twheel_minmax_change, 0 ); fdui->maxval = obj = fl_add_input( FL_FLOAT_INPUT, 210, 111, 82, 25, "Maximum Value" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, twheel_minmax_change, 0 ); fdui->returnsetting = obj = fl_add_menu( FL_PULLDOWN_MENU, 320, 90, 143, 24, "Return Setting" ); fl_set_object_boxtype( obj, FL_UP_BOX ); fl_set_object_callback( obj, twheel_returnsetting_change, 0 ); fdui->initial_val = obj = fl_add_input( FL_FLOAT_INPUT, 210, 143, 82, 25, "Initial Value" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, twheel_initialvalue_change, 0 ); fdui->step = obj = fl_add_input( FL_FLOAT_INPUT, 210, 175, 82, 25, "StepSize" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, twheel_step_change, 0 ); fl_end_form( ); fdui->twheelattrib->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } xforms-1.2.4/fdesign/spec/scrollbar_spec.h0000664000175000017500000000163012252416033015474 00000000000000/* Header file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #ifndef FD_scrollbarattrib_h_ #define FD_scrollbarattrib_h_ #include "../lib/include/forms.h" /* Callbacks, globals and object handlers */ void scb_minmax_change( FL_OBJECT *, long ); void scb_returnsetting_change( FL_OBJECT *, long ); void scb_initialvalue_change( FL_OBJECT *, long ); void scb_slsize_change( FL_OBJECT *, long ); void scb_delta_change( FL_OBJECT *, long ); /* Forms and Objects */ typedef struct { FL_FORM * scrollbarattrib; void * vdata; char * cdata; long ldata; FL_OBJECT * background; FL_OBJECT * minval; FL_OBJECT * maxval; FL_OBJECT * returnsetting; FL_OBJECT * initial_val; FL_OBJECT * slsize; FL_OBJECT * ldelta; FL_OBJECT * rdelta; } FD_scrollbarattrib; FD_scrollbarattrib * create_form_scrollbarattrib( void ); #endif /* FD_scrollbarattrib_h_ */ xforms-1.2.4/fdesign/spec/pixmap_spec.c0000664000175000017500000000353612252416033015011 00000000000000/* Form definition file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #include #include "pixmap_spec.h" /*************************************** ***************************************/ FD_pixmapattrib * create_form_pixmapattrib( void ) { FL_OBJECT *obj; FD_pixmapattrib *fdui = ( FD_pixmapattrib * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->pixmapattrib = fl_bgn_form( FL_NO_BOX, 540, 280 ); fdui->background = obj = fl_add_box( FL_FLAT_BOX, 0, 0, 540, 280, "" ); fdui->frame = obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 20, 20, 490, 240, "Pixmap Attributes" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lstyle( obj, FL_TIMESBOLD_STYLE ); fdui->filename = obj = fl_add_input( FL_NORMAL_INPUT, 160, 113, 210, 25, "Bitmap/Pixmap File" ); fl_set_object_callback( obj, pixmap_filename_change, 0 ); fdui->pixalign = obj = fl_add_choice( FL_NORMAL_CHOICE2, 282, 60, 155, 25, "" ); fl_set_object_callback( obj, pixmapalign_change, 0 ); fdui->browse = obj = fl_add_button( FL_NORMAL_BUTTON, 372, 113, 66, 25, "Browse ...." ); fl_set_button_shortcut( obj, "#B", 1 ); fl_set_object_callback( obj, pixmaplookfor_pixmapfile_cb, 0 ); fdui->use_data = obj = fl_add_checkbutton( FL_PUSH_BUTTON, 215, 155, 30, 30, "'#include' image file" ); fl_set_object_lalign( obj, FL_ALIGN_LEFT ); fl_set_object_callback( obj, pixmapusedata_change, 0 ); fdui->fullpath = obj = fl_add_checkbutton( FL_PUSH_BUTTON, 355, 155, 30, 30, "Use full path" ); fl_set_object_lalign( obj, FL_ALIGN_LEFT ); fl_set_object_callback( obj, pixmapfullpath_cb, 0 ); fl_end_form( ); fdui->pixmapattrib->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } xforms-1.2.4/fdesign/spec/dial_spec.c0000664000175000017500000000500512252416033014415 00000000000000/* Form definition file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #include #include "dial_spec.h" /*************************************** ***************************************/ FD_dialattrib * create_form_dialattrib( void ) { FL_OBJECT *obj; FD_dialattrib *fdui = ( FD_dialattrib * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->dialattrib = fl_bgn_form( FL_NO_BOX, 540, 280 ); fdui->background = obj = fl_add_box( FL_FLAT_BOX, 0, 0, 540, 280, "" ); fdui->returnsetting = obj = fl_add_menu( FL_PULLDOWN_MENU, 305, 90, 138, 24, "Return Setting" ); fl_set_object_boxtype( obj, FL_UP_BOX ); fl_set_object_callback( obj, dial_returnsetting_change, 0 ); fdui->minval = obj = fl_add_input( FL_FLOAT_INPUT, 195, 45, 92, 24, "Dial Min" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, dial_minmax_change, 0 ); fdui->maxval = obj = fl_add_input( FL_FLOAT_INPUT, 195, 77, 92, 24, "DialMax" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, dial_minmax_change, 0 ); fdui->initialval = obj = fl_add_input( FL_FLOAT_INPUT, 195, 109, 92, 24, "Initial Value" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, dial_initialvalue_change, 0 ); fdui->step = obj = fl_add_input( FL_FLOAT_INPUT, 195, 141, 92, 24, "Dial Step" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, dial_stepchange_cb, 0 ); fdui->thetai = obj = fl_add_input( FL_FLOAT_INPUT, 195, 173, 92, 24, "Min. Angle" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, dial_thetachange_cb, 0 ); fdui->thetaf = obj = fl_add_input( FL_FLOAT_INPUT, 195, 205, 92, 24, "Max. Angle" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, dial_thetachange_cb, 1 ); fdui->dir = obj = fl_add_choice( FL_NORMAL_CHOICE2, 306, 155, 134, 25, "Direction" ); fl_set_object_lalign( obj, FL_ALIGN_TOP ); fl_set_object_callback( obj, dir_cb, 0 ); obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 30, 15, 480, 240, "Dial Attributes" ); fl_set_object_lcolor( obj, FL_DARKVIOLET ); fl_set_object_lsize( obj, FL_MEDIUM_SIZE ); fl_set_object_lstyle( obj, FL_TIMESBOLD_STYLE + FL_EMBOSSED_STYLE ); fl_end_form( ); fdui->dialattrib->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } xforms-1.2.4/fdesign/spec/menu_spec.c0000664000175000017500000000704512252416033014456 00000000000000/* Form definition file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #include #include "menu_spec.h" /*************************************** ***************************************/ FD_menuattrib * create_form_menuattrib( void ) { FL_OBJECT *obj; FD_menuattrib *fdui = ( FD_menuattrib * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->menuattrib = fl_bgn_form( FL_NO_BOX, 520, 270 ); obj = fl_add_box( FL_FLAT_BOX, 0, 0, 520, 270, "" ); obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 15, 20, 480, 230, "Menu Attributes" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 25, 65, 190, 170, "Item Attributes" ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 225, 67, 111, 140, "Action" ); fdui->content_br = obj = fl_add_browser( FL_HOLD_BROWSER, 353, 70, 120, 140, "CurrentItems:" ); fl_set_object_lalign( obj, FL_ALIGN_LEFT_TOP ); fdui->input = obj = fl_add_input( FL_NORMAL_INPUT, 35, 90, 170, 25, "EditItem" ); fl_set_input_shortcut( obj, "#E", 1 ); fl_set_object_lalign( obj, FL_ALIGN_LEFT_TOP ); obj = fl_add_button( FL_NORMAL_BUTTON, 235, 82, 84, 26, "Add" ); fl_set_button_shortcut( obj, "#A", 1 ); fl_set_object_callback( obj, add_menu_item_cb, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 235, 143, 84, 24, "Delete" ); fl_set_button_shortcut( obj, "#D", 1 ); fl_set_object_callback( obj, delete_menu_item_cb, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 235, 172, 84, 24, "Change" ); fl_set_button_shortcut( obj, "#C", 1 ); fl_set_object_callback( obj, change_menu_item_cb, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 320, 220, 82, 24, "ClearField" ); fl_set_object_callback( obj, clear_menu_field_cb, 0 ); fdui->auto_clear = obj = fl_add_checkbutton( FL_PUSH_BUTTON, 230, 220, 24, 27, "AutoClear" ); fl_set_object_color( obj, FL_COL1, FL_BLUE ); fl_set_button( obj, 1 ); obj = fl_add_button( FL_NORMAL_BUTTON, 235, 112, 84, 26, "Replace" ); fl_set_button_shortcut( obj, "#R", 1 ); fl_set_object_callback( obj, replace_menu_item_cb, 0 ); fdui->mode = obj = fl_add_choice( FL_NORMAL_CHOICE2, 106, 133, 98, 25, "Mode" ); fl_set_object_shortcut( obj, "#M", 1 ); fl_set_object_lalign( obj, FL_ALIGN_LEFT_TOP ); fdui->shortcut = obj = fl_add_input( FL_NORMAL_INPUT, 35, 133, 70, 25, "Shortcut" ); fl_set_input_shortcut( obj, "#S", 1 ); fl_set_object_lalign( obj, FL_ALIGN_LEFT_TOP ); fdui->item_cb = obj = fl_add_input( FL_NORMAL_INPUT, 35, 176, 170, 25, "Callback" ); fl_set_input_shortcut( obj, "#B", 1 ); fl_set_object_lalign( obj, FL_ALIGN_LEFT_TOP ); fdui->new_menuapi = obj = fl_add_checkbutton( FL_PUSH_BUTTON, 280, 21, 35, 30, "Use Struct" ); fl_set_button_shortcut( obj, "#U", 1 ); fl_set_object_callback( obj, new_menuapi_cb, 0 ); fdui->scope = obj = fl_add_choice( FL_NORMAL_CHOICE2, 365, 25, 75, 22, "" ); fl_set_object_callback( obj, menuentry_scope_cb, 0 ); fdui->id = obj = fl_add_counter( FL_NORMAL_COUNTER, 90, 210, 110, 20, "MenuID" ); fl_set_object_lalign( obj, FL_ALIGN_LEFT ); fl_set_counter_bounds( obj, 1.0, 1000000.0 ); fl_set_counter_value( obj, 1.0 ); fl_set_counter_step( obj, 1.0, 10.0 ); fl_end_form( ); fdui->menuattrib->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } xforms-1.2.4/fdesign/spec/Makefile.am0000644000175000017500000000145412252416601014365 00000000000000include $(top_srcdir)/config/common.am EXTRA_DIST = browser_spec.c \ browser_spec.fd \ browser_spec.h \ button_spec.c \ button_spec.fd \ button_spec.h \ choice_spec.c \ choice_spec.fd \ choice_spec.h \ counter_spec.c \ counter_spec.fd \ counter_spec.h \ dial_spec.c \ dial_spec.fd \ dial_spec.h \ freeobj_spec.c \ freeobj_spec.fd \ freeobj_spec.h \ menu_spec.c \ menu_spec.fd \ menu_spec.h \ pixmap_spec.c \ pixmap_spec.fd \ pixmap_spec.h \ positioner_spec.c \ positioner_spec.fd \ positioner_spec.h \ scrollbar_spec.c \ scrollbar_spec.fd \ scrollbar_spec.h \ slider_spec.c \ slider_spec.fd \ slider_spec.h \ spinner_spec.c \ spinner_spec.fd \ spinner_spec.h \ twheel_spec.c \ twheel_spec.fd \ twheel_spec.h \ xyplot_spec.c \ xyplot_spec.fd \ xyplot_spec.h \ Readme xforms-1.2.4/fdesign/spec/freeobj_spec.h0000664000175000017500000000106212252416033015124 00000000000000/* Header file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #ifndef FD_freeobjattrib_h_ #define FD_freeobjattrib_h_ #include "../lib/include/forms.h" /* Callbacks, globals and object handlers */ void handler_name_change_cb( FL_OBJECT *, long ); /* Forms and Objects */ typedef struct { FL_FORM * freeobjattrib; void * vdata; char * cdata; long ldata; FL_OBJECT * background; FL_OBJECT * hname; } FD_freeobjattrib; FD_freeobjattrib * create_form_freeobjattrib( void ); #endif /* FD_freeobjattrib_h_ */ xforms-1.2.4/fdesign/spec/dial_spec.h0000664000175000017500000000166012252416033014425 00000000000000/* Header file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #ifndef FD_dialattrib_h_ #define FD_dialattrib_h_ #include "../lib/include/forms.h" /* Callbacks, globals and object handlers */ void dial_returnsetting_change( FL_OBJECT *, long ); void dial_minmax_change( FL_OBJECT *, long ); void dial_initialvalue_change( FL_OBJECT *, long ); void dial_stepchange_cb( FL_OBJECT *, long ); void dial_thetachange_cb( FL_OBJECT *, long ); void dir_cb( FL_OBJECT *, long ); /* Forms and Objects */ typedef struct { FL_FORM * dialattrib; void * vdata; char * cdata; long ldata; FL_OBJECT * background; FL_OBJECT * returnsetting; FL_OBJECT * minval; FL_OBJECT * maxval; FL_OBJECT * initialval; FL_OBJECT * step; FL_OBJECT * thetai; FL_OBJECT * thetaf; FL_OBJECT * dir; } FD_dialattrib; FD_dialattrib * create_form_dialattrib( void ); #endif /* FD_dialattrib_h_ */ xforms-1.2.4/fdesign/spec/choice_spec.h0000664000175000017500000000210512252416033014741 00000000000000/* Header file generated by fdesign on Thu Dec 12 21:27:07 2013 */ #ifndef FD_choiceattrib_h_ #define FD_choiceattrib_h_ #include "../lib/include/forms.h" /* Callbacks, globals and object handlers */ void add_choice_item_cb( FL_OBJECT *, long ); void delete_choice_item_cb( FL_OBJECT *, long ); void change_choice_item_cb( FL_OBJECT *, long ); void clear_choice_field_cb( FL_OBJECT *, long ); void replace_choice_item_cb( FL_OBJECT *, long ); void choice_align_cb( FL_OBJECT *, long ); void choice_val_cb( FL_OBJECT *, long ); void use_struct_cb( FL_OBJECT *, long ); void choiceentry_scope_cb( FL_OBJECT *, long ); /* Forms and Objects */ typedef struct { FL_FORM * choiceattrib; void * vdata; char * cdata; long ldata; FL_OBJECT * content_br; FL_OBJECT * input; FL_OBJECT * auto_clear; FL_OBJECT * mode; FL_OBJECT * shortcut; FL_OBJECT * align; FL_OBJECT * val; FL_OBJECT * new_menuapi; FL_OBJECT * scope; } FD_choiceattrib; FD_choiceattrib * create_form_choiceattrib( void ); #endif /* FD_choiceattrib_h_ */ xforms-1.2.4/fdesign/spec/Readme0000664000175000017500000000042712252416466013463 00000000000000To recreate the .c and .h files from the .fd files use the command fdesign -convert -I \"../lib/include/forms.h\" *.fd This makes sure that the newest version of the forms.h file is included instead of an already installed forms.h file (typically /usr/local/include/forms.h). xforms-1.2.4/fdesign/sp_positioner.c0000664000175000017500000001755512253056155014460 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file sp_positioner.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Settting counter class specific attributes. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "fd_main.h" #include "fd_spec.h" #include "sp_positioner.h" #include "private/ppositioner.h" #include "spec/positioner_spec.h" static FD_posattrib * pos_attrib; static FL_OBJECT * curobj; /*************************************** ***************************************/ FL_FORM * positioner_create_spec_form( void ) { if ( pos_attrib ) return pos_attrib->posattrib; pos_attrib = create_form_posattrib( ); setup_how_return_menu( pos_attrib->returnsetting ); fl_set_menu_item_mode( pos_attrib->returnsetting, 5, FL_PUP_BOX | FL_PUP_GRAY ); fl_set_menu_item_mode( pos_attrib->returnsetting, 6, FL_PUP_BOX | FL_PUP_GRAY ); return pos_attrib->posattrib; } /*************************************** ***************************************/ void positioner_fill_in_spec_form( FL_OBJECT * obj ) { FLI_POSITIONER_SPEC *sp = obj->spec; curobj = obj; set_finput_value( pos_attrib->xminval, sp->xmin, -1 ); set_finput_value( pos_attrib->xmaxval, sp->xmax, -1 ); set_finput_value( pos_attrib->yminval, sp->ymin, -1 ); set_finput_value( pos_attrib->ymaxval, sp->ymax, -1 ); set_finput_value( pos_attrib->initialxval, sp->xval, -1 ); set_finput_value( pos_attrib->initialyval, sp->yval, -1 ); set_finput_value( pos_attrib->xstep, sp->xstep, -1 ); set_finput_value( pos_attrib->ystep, sp->ystep, -1 ); reset_how_return_menu( pos_attrib->returnsetting, obj->how_return ); } /*************************************** ***************************************/ void positioner_reread_spec_form( FL_OBJECT * obj ) { double r1, r2; if ( get_checked_float( fl_get_input( pos_attrib->xminval ), &r1 ) && get_checked_float( fl_get_input( pos_attrib->xmaxval ), &r2 ) ) fl_set_positioner_xbounds( obj, r1, r2 ); if ( get_checked_float( fl_get_input( pos_attrib->yminval ), &r1 ) && get_checked_float( fl_get_input( pos_attrib->ymaxval ), &r2 ) ) fl_set_positioner_ybounds( obj, r1, r2 ); if ( get_checked_float( fl_get_input( pos_attrib->initialxval ), &r1 ) ) fl_set_positioner_xvalue( obj, r1 ); if ( get_checked_float( fl_get_input( pos_attrib->initialyval ), &r1 ) ) fl_set_positioner_yvalue( obj, r1 ); if ( get_checked_float( fl_get_input( pos_attrib->xstep ), &r1 ) ) fl_set_positioner_xstep( obj, r1 ); if ( get_checked_float( fl_get_input( pos_attrib->ystep ), &r1 ) ) fl_set_positioner_ystep( obj, r1 ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void positioner_emit_spec_fd_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = fl_create_positioner( obj->type, 0, 0, 0, 0, "" ); FLI_POSITIONER_SPEC *sp = obj->spec, *defsp = defobj->spec; if ( sp->xmin != defsp->xmin || sp->xmax != defsp->xmax ) fprintf( fp, " xbounds: %g %g\n", sp->xmin, sp->xmax ); if ( sp->ymin != defsp->ymin || sp->ymax != defsp->ymax ) fprintf( fp, " ybounds: %g %g\n", sp->ymin, sp->ymax ); if ( sp->xval != defsp->xval ) fprintf( fp, " xvalue: %g\n", sp->xval ); if ( sp->yval != defsp->yval ) fprintf( fp, " yvalue: %g\n", sp->yval ); if ( sp->xstep != defsp->xstep ) fprintf( fp, " xstep: %g\n", sp->xstep ); if ( sp->ystep != defsp->ystep ) fprintf( fp, " ystep: %g\n", sp->ystep ); fl_free_object( defobj ); } /*************************************** ***************************************/ void positioner_emit_spec_c_code( FILE * fp, FL_OBJECT * obj ) { FL_OBJECT *defobj = fl_create_positioner( obj->type, 0, 0, 0, 0, "" ); FLI_POSITIONER_SPEC *sp = obj->spec, *defsp = defobj->spec; if ( sp->xmin != defsp->xmin || sp->xmax != defsp->xmax ) fprintf( fp, " fl_set_positioner_xbounds( obj, %g, %g );\n", sp->xmin, sp->xmax ); if ( sp->ymin != defsp->ymin || sp->ymax != defsp->ymax ) fprintf( fp, " fl_set_positioner_ybounds( obj, %g, %g );\n", sp->ymin, sp->ymax ); if ( sp->xval != defsp->xval ) fprintf( fp, " fl_set_positioner_xvalue( obj, %g );\n", sp->xval ); if ( sp->yval != defsp->yval ) fprintf( fp, " fl_set_positioner_yvalue( obj, %g );\n", sp->yval ); if ( sp->xstep != defsp->xstep ) fprintf( fp, " fl_set_positioner_xstep( obj, %g );\n", sp->xstep ); if ( sp->ystep != defsp->ystep ) fprintf( fp, " fl_set_positioner_ystep( obj, %g );\n", sp->ystep ); fl_free_object( defobj ); } /*************************************** ***************************************/ void pos_xminmax_change( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_set_positioner_xbounds( curobj, get_finput_value( pos_attrib->xminval ), get_finput_value( pos_attrib->xmaxval ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void pos_yminmax_change( FL_OBJECT * ob FL_UNUSED_ARG, long data FL_UNUSED_ARG ) { fl_set_positioner_ybounds( curobj, get_finput_value( pos_attrib->yminval ), get_finput_value( pos_attrib->ymaxval ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void pos_xstepchange_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { fl_set_positioner_xstep( curobj, get_finput_value( obj ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void pos_ystepchange_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { fl_set_positioner_ystep( curobj, get_finput_value( obj ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void pos_initialxvalue_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { fl_set_positioner_xvalue( curobj, get_finput_value( obj ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void pos_initialyvalue_change( FL_OBJECT * obj, long data FL_UNUSED_ARG) { fl_set_positioner_yvalue( curobj, get_finput_value( obj ) ); redraw_the_form( 0 ); } /*************************************** ***************************************/ void pos_returnsetting_change( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { handle_how_return_changes( obj, curobj ); } #include "spec/positioner_spec.c" /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/Makefile.am0000664000175000017500000000223312353623325013436 00000000000000include $(top_srcdir)/config/common.am CLEANFILES = fdesign.1 EXTRA_DIST = Readme fdesign.man SUBDIRS = fd spec xpm man_MANS = fdesign.1 fdesign.1: cp -p $(srcdir)/fdesign.man fdesign.1 INCLUDES = -I./xpm $(X_CFLAGS) bin_PROGRAMS = fdesign fdesign_LDADD = $(top_srcdir)/lib/libforms.la $(X_LIBS) $(X_PRE_LIBS) $(XPM_LIB) -lX11 $(LIBS) $(X_EXTRA_LIBS) fdesign_SOURCES = \ fd_attribs.c \ fd_control.c \ fd_fake.c \ fd_file.c \ fd_file_fun.c \ fd_forms.c \ fd_groups.c \ fd_help.c \ fd_help.h \ fd_initforms.c \ fd_main.c \ fd_main.h \ fd_names.c \ fd_objects.c \ fd_pallette.c \ fd_printC.c \ fd_rubber.c \ fd_select.c \ fd_spec.c \ fd_spec.h \ fd_super.c \ fd_iconinfo.c \ fd_iconinfo.h \ fd_util.c \ sp_browser.c \ sp_browser.h \ sp_button.c \ sp_button.h \ sp_choice.c \ sp_choice.h \ sp_counter.c \ sp_counter.h \ sp_spinner.c \ sp_spinner.h \ sp_dial.c \ sp_dial.h \ sp_freeobj.c \ sp_freeobj.h \ sp_menu.c \ sp_menu.h \ sp_pixmap.c \ sp_pixmap.h \ sp_positioner.c \ sp_positioner.h \ sp_scrollbar.c \ sp_scrollbar.h \ sp_slider.c \ sp_slider.h \ sp_twheel.c \ sp_twheel.h \ sp_xyplot.c \ sp_xyplot.h \ sp_util.c xforms-1.2.4/fdesign/fd_super.c0000664000175000017500000004135012353623325013360 00000000000000/* * This file is part of XForms. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fd_super.c * * This file is part of XForms package * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * translation between superspec and spec */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "fd_main.h" #include "fd_spec.h" #include "private/pslider.h" #include "private/pbrowser.h" #include "private/ppositioner.h" #include "private/pcounter.h" #include "private/pspinner.h" #include "private/pscrollbar.h" #include "private/pdial.h" #include "private/pxyplot.h" #include "private/pchoice.h" #include "private/pmenu.h" #include "private/pinput.h" /*************************************** ***************************************/ SuperSPEC * get_superspec( FL_OBJECT * ob ) { SuperSPEC *sp = ob->u_vdata; return sp ? sp : spec_to_superspec( ob ); } /*************************************** ***************************************/ SuperSPEC * spec_to_superspec( FL_OBJECT * obj ) { SuperSPEC *ssp; int i; int n; if ( ! obj->u_vdata ) { obj->u_vdata = ssp = fl_calloc( 1, sizeof *ssp ); ssp->content = NULL; ssp->shortcut = NULL; ssp->callback = NULL; ssp->mode = NULL; ssp->mval = NULL; ssp->misc_char = NULL; ssp->new_menuapi = 0; ssp->nlines = 0; } else ssp = obj->u_vdata; if ( obj->objclass == FL_BROWSER ) { FLI_BROWSER_SPEC *sp = obj->spec; ssp->h_pref = sp->h_pref; ssp->v_pref = sp->v_pref; for ( i = 1; i <= ssp->nlines; i++ ) fl_free( ssp->content[ i ] ); n = ssp->nlines = fl_get_browser_maxline( obj ); ssp->content = fl_realloc( ssp->content, ( n + 1 ) * sizeof *ssp->content ); for ( i = 1; i <= n; i++ ) ssp->content[ i ] = fl_strdup( fl_get_browser_line( obj, i ) ); } else if ( obj->objclass == FL_CHOICE ) { FLI_CHOICE_SPEC *sp = obj->spec; for ( i = 1; i <= ssp->nlines; i++ ) { fl_free( ssp->content[ i ] ); fl_free( ssp->shortcut[ i ] ); } n = ssp->nlines = sp->numitems; ssp->content = fl_realloc( ssp->content, ( n + 1 ) * sizeof *ssp->content ); ssp->shortcut = fl_realloc( ssp->shortcut, ( n + 1 ) * sizeof *ssp->shortcut ); ssp->mode = fl_realloc( ssp->mode, ( n + 1 ) * sizeof *ssp->mode ); ssp->align = sp->align; ssp->int_val = sp->val; for ( i = 1; i <= n; i++ ) { ssp->content[ i ] = fl_strdup( fl_get_choice_item_text( obj, i ) ); if ( sp->shortcut[ i ] ) ssp->shortcut[ i ] = fl_strdup( sp->shortcut[ i ] ); else ssp->shortcut[ i ] = NULL; } memcpy( ssp->mode, sp->mode, ( n + 1 ) * sizeof *ssp->mode ); } else if ( obj->objclass == FL_MENU ) { FLI_MENU_SPEC *sp = obj->spec; for ( i = 1; i <= ssp->nlines; i++ ) { fl_free( ssp->content[ i ] ); fl_free( ssp->shortcut[ i ] ); fl_free( ssp->callback[ i ] ); } n = ssp->nlines = sp->numitems; ssp->content = fl_realloc( ssp->content, ( n + 1 ) * sizeof *ssp->content ); ssp->shortcut = fl_realloc( ssp->shortcut, ( n + 1 ) * sizeof *ssp->shortcut ); ssp->callback = fl_realloc( ssp->callback, ( n + 1 ) * sizeof *ssp->callback ); ssp->mode = fl_realloc( ssp->mode, ( n + 1 ) * sizeof *ssp->mode ); ssp->mval = fl_realloc( ssp->mval, ( n + 1 ) * sizeof *ssp->mval ); for ( i = 1; i <= n; i++ ) { ssp->content[ i ] = fl_strdup( fl_get_menu_item_text( obj, sp->mval[ i ] ) ); if ( sp->shortcut[ i ] ) ssp->shortcut[ i ] = fl_strdup( sp->shortcut[ i ] ); else ssp->shortcut[ i ] = NULL; if ( sp->cb[ i ] ) ssp->callback[ i ] = fl_strdup( ( char * ) sp->cb[ i ] ); else ssp->callback[ i ] = NULL; } memcpy( ssp->mode, sp->mode, ( n + 1 ) * sizeof *ssp->mode ); memcpy( ssp->mval, sp->mval, ( n + 1 ) * sizeof *ssp->mval ); } else if ( obj->objclass == FL_SLIDER || obj->objclass == FL_VALSLIDER || obj->objclass == FL_THUMBWHEEL ) { FLI_SLIDER_SPEC *sp = obj->spec; ssp->val = sp->val; ssp->min = sp->min; ssp->max = sp->max; ssp->step = sp->step; ssp->prec = sp->prec; ssp->ldelta = sp->ldelta; ssp->rdelta = sp->rdelta; ssp->slsize = sp->slsize; } else if ( ISBUTTON( obj->objclass ) || obj->objclass == FL_PIXMAP || obj->objclass == FL_BITMAP ) { FL_BUTTON_SPEC *sp = obj->spec; ssp->mbuttons = 0; for ( i = 0; i < 5; i++ ) if ( sp->react_to[ i ] ) ssp->mbuttons |= 1 << i; ssp->int_val = sp->val; } else if ( obj->objclass == FL_POSITIONER ) { FLI_POSITIONER_SPEC *sp = obj->spec; ssp->xstep = sp->xstep; ssp->ystep = sp->ystep; ssp->xmin = sp->xmin; ssp->xmax = sp->xmax; ssp->xval = sp->xval; ssp->ymin = sp->ymin; ssp->ymax = sp->ymax; ssp->yval = sp->yval; } else if ( obj->objclass == FL_COUNTER ) { FLI_COUNTER_SPEC *sp = obj->spec; ssp->val = sp->val; ssp->lstep = sp->lstep; ssp->sstep = sp->sstep; ssp->min = sp->min; ssp->max = sp->max; ssp->prec = sp->prec; } else if ( obj->objclass == FL_DIAL ) { FLI_DIAL_SPEC *sp = obj->spec; ssp->min = sp->min; ssp->max = sp->max; ssp->val = sp->val; ssp->step = sp->step; ssp->thetai = sp->thetai; ssp->thetaf = sp->thetaf; ssp->direction = sp->direction; } else if ( obj->objclass == FL_XYPLOT ) { FLI_XYPLOT_SPEC *sp = obj->spec; ssp->xmajor = sp->xmajor; ssp->xminor = sp->xminor; ssp->ymajor = sp->ymajor; ssp->yminor = sp->yminor; ssp->xscale = sp->xscale; ssp->yscale = sp->yscale; ssp->xgrid = sp->xgrid; ssp->ygrid = sp->ygrid; ssp->grid_linestyle = sp->grid_linestyle; ssp->xbase = sp->xbase; ssp->ybase = sp->ybase; ssp->mark_active = sp->mark_active; } else if ( obj->objclass == FL_SCROLLBAR ) { FLI_SCROLLBAR_SPEC *scbsp = obj->spec; FLI_SLIDER_SPEC *sp = scbsp->slider->spec; ssp->val = sp->val; ssp->min = sp->min; ssp->max = sp->max; ssp->prec = sp->prec; ssp->step = sp->step; ssp->slsize = sp->slsize; ssp->ldelta = sp->ldelta; ssp->rdelta = sp->rdelta; } else if ( obj->objclass == FL_SPINNER ) { FLI_SPINNER_SPEC *sp = obj->spec; ssp->val = fl_get_spinner_value( obj ); fl_get_spinner_bounds( obj, &ssp->min, &ssp->max ); ssp->step = fl_get_spinner_step( obj ); ssp->prec = fl_get_spinner_precision( obj ); ssp->orient = sp->orient; } return ssp; } /*************************************** ***************************************/ void * superspec_to_spec( FL_OBJECT * obj ) { void *v = obj->spec; SuperSPEC *ssp = obj->u_vdata; int i = 0; if ( ! ssp ) return v; if ( obj->objclass == FL_BROWSER ) { FLI_BROWSER_SPEC *sp = obj->spec; fl_clear_browser( obj ); sp->h_pref = ssp->h_pref; sp->v_pref = ssp->v_pref; for ( i = 1; i <= ssp->nlines; i++ ) fl_addto_browser( obj, ssp->content[ i ] ); } else if ( obj->objclass == FL_CHOICE ) { fl_clear_choice( obj ); ( ( FLI_CHOICE_SPEC * ) obj->spec)->align = ssp->align; for ( i = 1; i <= ssp->nlines; i++ ) { fl_addto_choice( obj, ssp->content[ i ] ); if ( ssp->shortcut[ i ] ) fl_set_choice_item_shortcut( obj, i, ssp->shortcut[ i ] ); fl_set_choice_item_mode( obj, i, ssp->mode[ i ] ); } if ( ssp->nlines >= ssp->int_val ) fl_set_choice( obj, ssp->int_val ); } else if ( obj->objclass == FL_MENU ) { fl_clear_menu( obj ); for ( i = 1; i <= ssp->nlines; i++ ) { fl_addto_menu( obj, ssp->content[ i ] ); if ( ssp->shortcut[ i ] ) fl_set_menu_item_shortcut( obj, i, ssp->shortcut[ i ] ); if ( ssp->callback[ i ] ) fl_set_menu_item_callback( obj, i, ( FL_PUP_CB ) fl_strdup( ssp->callback[ i ] ) ); fl_set_menu_item_mode( obj, i, ssp->mode[ i ] ); if ( ssp->mval[ i ] != i ) fl_set_menu_item_id( obj, i, ssp->mval[ i ] ); } } else if ( obj->objclass == FL_SLIDER || obj->objclass == FL_VALSLIDER || obj->objclass == FL_THUMBWHEEL) { FLI_SLIDER_SPEC *sp = obj->spec; sp->val = ssp->val; sp->min = ssp->min; sp->max = ssp->max; sp->step = ssp->step; sp->prec = ssp->prec; sp->ldelta = ssp->ldelta; sp->rdelta = ssp->rdelta; sp->slsize = ssp->slsize; } else if ( ISBUTTON( obj->objclass ) || obj->objclass == FL_PIXMAP || obj->objclass == FL_BITMAP ) { FL_BUTTON_SPEC *sp = obj->spec; for ( i = 0; i < 5; i++ ) sp->react_to[ i ] = ( ssp->mbuttons & ( 1 << i ) ) != 0; if ( ISBUTTON( obj->objclass ) ) fl_set_button_mouse_buttons( obj, ssp->mbuttons ); sp->val = ssp->int_val; if ( ISBUTTON( obj->objclass ) ) fl_set_button( obj, sp->val ); } else if ( obj->objclass == FL_POSITIONER ) { FLI_POSITIONER_SPEC *sp = obj->spec; sp->xstep = ssp->xstep; sp->ystep = ssp->ystep; sp->xmin = ssp->xmin; sp->xmax = ssp->xmax; sp->xval = ssp->xval; sp->ymin = ssp->ymin; sp->ymax = ssp->ymax; sp->yval = ssp->yval; } else if ( obj->objclass == FL_COUNTER ) { FLI_COUNTER_SPEC *sp = obj->spec; sp->val = ssp->val; sp->sstep = ssp->sstep; sp->lstep = ssp->lstep; sp->min = ssp->min; sp->max = ssp->max; sp->prec = ssp->prec; } else if ( obj->objclass == FL_SPINNER ) { FLI_SPINNER_SPEC *sp = obj->spec; fl_set_spinner_value( obj, ssp->val ); fl_set_spinner_bounds( obj, ssp->min, ssp->max ); fl_set_spinner_step( obj, ssp->step ); fl_set_spinner_precision( obj, ssp->prec ); sp->orient = ssp->orient; } else if ( obj->objclass == FL_DIAL ) { FLI_DIAL_SPEC *sp = obj->spec; sp->min = ssp->min; sp->max = ssp->max; sp->val = ssp->val; sp->step = ssp->step; sp->thetai = ssp->thetai; sp->thetaf = ssp->thetaf; sp->direction = ssp->direction; } else if ( obj->objclass == FL_XYPLOT ) { FLI_XYPLOT_SPEC *sp = obj->spec; sp->xmajor = ssp->xmajor; sp->xminor = ssp->xminor; sp->ymajor = ssp->ymajor; sp->yminor = ssp->yminor; sp->xscale = ssp->xscale; sp->yscale = ssp->yscale; sp->xgrid = ssp->xgrid; sp->ygrid = ssp->ygrid; sp->xbase = ssp->xbase; sp->ybase = ssp->ybase; sp->grid_linestyle = ssp->grid_linestyle; sp->mark_active = ssp->mark_active; } else if ( obj->objclass == FL_SCROLLBAR ) { FLI_SCROLLBAR_SPEC *scbsp = obj->spec; FLI_SLIDER_SPEC *sp = scbsp->slider->spec; sp->val = ssp->val; sp->min = ssp->min; sp->max = ssp->max; sp->prec = ssp->prec; sp->step = ssp->step; sp->slsize = ssp->slsize; sp->ldelta = ssp->ldelta; sp->rdelta = ssp->rdelta; } else if ( obj->objclass == FL_SLIDER ) { FLI_SPINNER_SPEC *sp = obj->spec; ssp->val = fl_get_spinner_value( obj ); fl_get_spinner_bounds( obj, &ssp->min, &ssp->max ); ssp->step = fl_get_spinner_step( obj ); ssp->prec = fl_get_spinner_precision( obj ); ssp->orient = sp->orient; } else if ( obj->objclass == FL_INPUT ) { /* Simply reset some attributes of the object to the defaults - this makes only sense when, during testing, text was entered into the input field and new we need to get rid of it */ FLI_INPUT_SPEC *sp = obj->spec; sp->position = -1; sp->endrange = -1; sp->lines = sp->ypos = 1; *sp->str = '\0'; } return v; } /*************************************** ***************************************/ void copy_superspec( FL_OBJECT * target, FL_OBJECT * src ) { SuperSPEC *t = fl_malloc( sizeof *t ), *s = get_superspec( src ); int i; t->mode = NULL; t->content = NULL;; t->shortcut = NULL; t->callback = NULL; t->misc_char = NULL; *t = *s; t->content = NULL; t->shortcut = NULL; t->callback = NULL; t->mode = NULL; t->mval = NULL; /* Take care of pointers in the SuperSPEC */ if ( s->nlines ) { int cnt = s->nlines + 1; t->content = s->content ? fl_malloc( cnt * sizeof * t->content) : NULL; t->shortcut = s->shortcut ? fl_malloc( cnt * sizeof *t->shortcut ) : NULL; t->callback = s->callback ? fl_malloc( cnt * sizeof *t->callback ) : NULL; t->mode = s->mode ? fl_malloc( cnt * sizeof *t->mode ) : NULL; t->mval = s->mval ? fl_malloc( cnt * sizeof *t->mval ) : NULL; } for ( i = 1; i <= s->nlines; i++ ) { if ( t->content ) t->content[ i ] = s->content[ i ] ? fl_strdup( s->content[ i ] ) : NULL; if ( t->shortcut ) t->shortcut[ i ] = s->shortcut[ i ] ? fl_strdup( s->shortcut[ i ] ) : NULL; if ( t->callback ) t->callback[ i ] = s->callback[ i ] ? fl_strdup( s->callback[ i ] ) : NULL; } if ( t->mode ) memcpy( t->mode, s->mode, ( s->nlines + 1 ) * sizeof *t->mode ); if ( t->mval ) memcpy( t->mval, s->mval, ( s->nlines + 1 ) * sizeof *t->mval ); if ( t->misc_char ) t->misc_char = fl_strdup( s->misc_char ); free_superspec( target ); target->u_vdata = t; } /*************************************** ***************************************/ void free_superspec( FL_OBJECT * obj ) { SuperSPEC *ssp = obj->u_vdata; int i; if ( ! ssp ) return; for ( i = 1; i <= ssp->nlines; ++i ) { if ( ssp->content ) fl_free( ssp->content[ i ] ); if ( ssp->shortcut ) fl_free( ssp->shortcut[ i ] ); if ( ssp->callback ) fl_free( ssp->callback[ i ] ); } fl_free( ssp->misc_char ); fl_free( ssp->mode ); fl_free( ssp->mval ); fl_free( ssp->content ); fl_free( ssp->shortcut ); fl_free( ssp->callback ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/fdesign/fd/0000775000175000017500000000000012353624653012060 500000000000000xforms-1.2.4/fdesign/fd/Makefile.in0000664000175000017500000002476412353624173014057 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/common.am subdir = fdesign/fd ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FL_FIXLEVEL = @FL_FIXLEVEL@ FL_REVISION = @FL_REVISION@ FL_VERSION = @FL_VERSION@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIB = @JPEG_LIB@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ TEXI2DVI = @TEXI2DVI@ TEXI2DVI_NEEDS_PDF = @TEXI2DVI_NEEDS_PDF@ TEXI2HTML = @TEXI2HTML@ VERSION = @VERSION@ XMKMF = @XMKMF@ XPM_LIB = @XPM_LIB@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign DISTCLEANFILES = *.orig *.rej *~ *.bak core makelog MAINTAINERCLEANFILES = $(srcdir)/Makefile.in makelog AM_INSTALL_DATA_FLAGS = $(INSTALL) -m 644 -D INCLUDE = $(top_srcdir)/lib/include EXTRA_DIST = \ pallette.c \ pallette.fd \ pallette.h \ ui_attrib.c \ ui_attrib.fd \ ui_attrib.h \ ui_theforms.c \ ui_theforms.fd \ ui_theforms.h \ Readme all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/common.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign fdesign/fd/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign fdesign/fd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/common.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: xforms-1.2.4/fdesign/fd/ui_theforms.h0000664000175000017500000000534312252416175014476 00000000000000/* Header file generated by fdesign on Thu Dec 12 21:28:45 2013 */ #ifndef FD_control_h_ #define FD_control_h_ #include "../lib/include/forms.h" /* Callbacks, globals and object handlers */ void func_cb( FL_OBJECT *, long ); void form_cb( FL_OBJECT *, long ); void group_cb( FL_OBJECT *, long ); void object_cb( FL_OBJECT *, long ); void align_cb( FL_OBJECT *, long ); void test_cb( FL_OBJECT *, long ); void help_cb( FL_OBJECT *, long ); void optionmenu_callback( FL_OBJECT *, long ); void filemenu_callback( FL_OBJECT *, long ); void formmenu_callback( FL_OBJECT *, long ); void objectmenu_callback( FL_OBJECT *, long ); void groupmenu_callback( FL_OBJECT *, long ); void doalign_cb( FL_OBJECT *, long ); void snap_cb( FL_OBJECT *, long ); void undoalign_cb( FL_OBJECT *, long ); void exitalign_cb( FL_OBJECT *, long ); void stoptest_cb( FL_OBJECT *, long ); void clearlog_cb( FL_OBJECT *, long ); void showhelp_cb( FL_OBJECT *, long ); void exithelp_cb( FL_OBJECT *, long ); /* Forms and Objects */ typedef struct { FL_FORM * control; void * vdata; char * cdata; long ldata; FL_OBJECT * title; FL_OBJECT * seltype; FL_OBJECT * oristatus; FL_OBJECT * fkey_group; FL_OBJECT * formbrowser; FL_OBJECT * groupbrowser; FL_OBJECT * sizestatus; FL_OBJECT * objectbrowser; FL_OBJECT * shortcut_group; FL_OBJECT * menubar_group; FL_OBJECT * optionmenu; FL_OBJECT * filemenu; FL_OBJECT * formmenu; FL_OBJECT * objectmenu; FL_OBJECT * groupmenu; FL_OBJECT * selname; FL_OBJECT * selcb; } FD_control; FD_control * create_form_control( void ); typedef struct { FL_FORM * align; void * vdata; char * cdata; long ldata; FL_OBJECT * left; FL_OBJECT * hcenter; FL_OBJECT * right; FL_OBJECT * hequal; FL_OBJECT * snapobj; FL_OBJECT * bottom; FL_OBJECT * vcenter; FL_OBJECT * top; FL_OBJECT * vequal; FL_OBJECT * undo; FL_OBJECT * dismiss; } FD_align; FD_align * create_form_align( void ); typedef struct { FL_FORM * test; void * vdata; char * cdata; long ldata; FL_OBJECT * browser; FL_OBJECT * stoptesting; } FD_test; FD_test * create_form_test( void ); typedef struct { FL_FORM * helpform; void * vdata; char * cdata; long ldata; FL_OBJECT * browser; FL_OBJECT * vbutt; } FD_helpform; FD_helpform * create_form_helpform( void ); typedef struct { FL_FORM * resize; void * vdata; char * cdata; long ldata; FL_OBJECT * width; FL_OBJECT * height; FL_OBJECT * quit; FL_OBJECT * set_size; } FD_resize; FD_resize * create_form_resize( void ); #endif /* FD_control_h_ */ xforms-1.2.4/fdesign/fd/ui_attrib.fd0000664000175000017500000002345212353623325014276 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 2 Unit of measure: FL_COORD_PIXEL Border Width: -1 SnapGrid: 1 =============== FORM =============== Name: attrib Width: 540 Height: 346 Number of Objects: 5 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 540 346 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: background callback: argument: -------------------- class: FL_BUTTON type: FL_RETURN_BUTTON box: 464 315 70 25 boxtype: FL_UP_BOX colors: FL_CHARTREUSE FL_GREEN alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Accept shortcut: ^M resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: readyobj callback: argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 338 315 70 25 boxtype: FL_UP_BOX colors: FL_TOMATO FL_RED alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Cancel shortcut: #C^[ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: cancelobj callback: argument: -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 6 315 70 25 boxtype: FL_UP_BOX colors: FL_ANTIQUEWHITE FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Undo shortcut: #R resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: restoreobj callback: restore_cb argument: 0 -------------------- class: FL_TABFOLDER type: FL_TOP_TABFOLDER box: 5 5 530 300 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: attrib_folder callback: folder_switch_cb argument: 0 =============== FORM =============== Name: generic_attrib Width: 534 Height: 278 Number of Objects: 25 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 534 278 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: background callback: argument: -------------------- class: FL_BEGIN_GROUP name: generic_group -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 235 120 185 137 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Misc. shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: text[2] callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 235 15 185 95 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Font shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: text[1] callback: argument: -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 10 15 212 242 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Basic Attributes shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: text[0] callback: argument: -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE box: 69 31 143 25 boxtype: FL_SHADOW_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Type shortcut: #T resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: typeobj callback: apply_cb argument: 0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE box: 69 61 143 25 boxtype: FL_SHADOW_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: BoxType shortcut: #B resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: boxobj callback: apply_cb argument: 0 -------------------- class: FL_INPUT type: FL_NORMAL_INPUT box: 69 121 143 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_TOP_BCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Name shortcut: #N resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: nameobj callback: validate_cvar_name_cb argument: 0 -------------------- class: FL_INPUT type: FL_NORMAL_INPUT box: 69 151 143 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_TOP_BCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Callback shortcut: #K resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: cbnameobj callback: validate_cvar_name_cb argument: 1 -------------------- class: FL_INPUT type: FL_NORMAL_INPUT box: 69 181 143 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_TOP_BCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Argument shortcut: #M resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: argobj callback: argument: -------------------- class: FL_INPUT type: FL_NORMAL_INPUT box: 69 211 143 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_TOP_BCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Shortcut shortcut: #H resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: scobj callback: apply_cb argument: 0 -------------------- class: FL_INPUT type: FL_NORMAL_INPUT box: 69 91 143 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_TOP_BCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Label shortcut: #L resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: labelobj callback: apply_cb argument: 0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE box: 278 24 131 25 boxtype: FL_SHADOW_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Font shortcut: #F resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: fontobj callback: apply_cb argument: 0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE box: 278 51 131 25 boxtype: FL_SHADOW_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Style shortcut: #Y resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: styleobj callback: apply_cb argument: 0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE box: 278 78 131 25 boxtype: FL_SHADOW_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Size shortcut: #Z resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: sizeobj callback: apply_cb argument: 0 -------------------- class: FL_LABELFRAME type: FL_ENGRAVED_FRAME box: 431 80 89 150 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Color shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: text[3] callback: argument: -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 440 191 70 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: LabelColor shortcut: #O resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: lcolobj callback: setcolor_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 440 111 70 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Color1 shortcut: #1 resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: col1obj callback: setcolor_cb argument: 1 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 440 151 70 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Color 2 shortcut: #2 resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: col2obj callback: setcolor_cb argument: 2 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE box: 305 130 108 23 boxtype: FL_SHADOW_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: LabelAlign shortcut: #G resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: align callback: apply_cb argument: 0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE box: 305 182 108 23 boxtype: FL_SHADOW_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: NW Gravity shortcut: #W resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: nwgravity callback: argument: 0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE box: 305 206 108 23 boxtype: FL_SHADOW_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: SE Gravity shortcut: #E resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: segravity callback: argument: 0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE box: 305 154 108 23 boxtype: FL_SHADOW_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: In/Out shortcut: #U resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: inside callback: apply_cb argument: 0 -------------------- class: FL_CHOICE type: FL_NORMAL_CHOICE box: 305 230 108 23 boxtype: FL_SHADOW_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Resize shortcut: #I resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: resize callback: argument: 0 -------------------- class: FL_END_GROUP ============================== create_the_forms xforms-1.2.4/fdesign/fd/ui_attrib.h0000664000175000017500000000272312353623325014132 00000000000000/* Header file generated by fdesign on Thu Dec 12 21:28:45 2013 */ #ifndef FD_attrib_h_ #define FD_attrib_h_ #include "../lib/include/forms.h" /* Callbacks, globals and object handlers */ void restore_cb( FL_OBJECT *, long ); void folder_switch_cb( FL_OBJECT *, long ); void apply_cb( FL_OBJECT *, long ); void validate_cvar_name_cb( FL_OBJECT *, long ); void setcolor_cb( FL_OBJECT *, long ); /* Forms and Objects */ typedef struct { FL_FORM * attrib; void * vdata; char * cdata; long ldata; FL_OBJECT * background; FL_OBJECT * readyobj; FL_OBJECT * cancelobj; FL_OBJECT * restoreobj; FL_OBJECT * attrib_folder; } FD_attrib; FD_attrib * create_form_attrib( void ); typedef struct { FL_FORM * generic_attrib; void * vdata; char * cdata; long ldata; FL_OBJECT * background; FL_OBJECT * generic_group; FL_OBJECT * typeobj; FL_OBJECT * boxobj; FL_OBJECT * nameobj; FL_OBJECT * cbnameobj; FL_OBJECT * argobj; FL_OBJECT * scobj; FL_OBJECT * labelobj; FL_OBJECT * fontobj; FL_OBJECT * styleobj; FL_OBJECT * sizeobj; FL_OBJECT * lcolobj; FL_OBJECT * col1obj; FL_OBJECT * col2obj; FL_OBJECT * align; FL_OBJECT * nwgravity; FL_OBJECT * segravity; FL_OBJECT * inside; FL_OBJECT * resize; FL_OBJECT * text[ 4 ]; } FD_generic_attrib; FD_generic_attrib * create_form_generic_attrib( void ); #endif /* FD_attrib_h_ */ xforms-1.2.4/fdesign/fd/ui_theforms.fd0000664000175000017500000005631112251732337014641 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 5 Unit of measure: FL_COORD_PIXEL Border Width: -1 SnapGrid: 1 =============== FORM =============== Name: control Width: 495 Height: 320 Number of Objects: 40 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 495 320 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_FRAME type: FL_UP_FRAME box: 2 2 495 28 boxtype: FL_NO_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: FL_UP_BOX box: 370 35 121 255 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_TEXT type: FL_NORMAL_TEXT box: 353 0 126 23 boxtype: FL_NO_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_MEDIUM_SIZE lcol: FL_BLUE label: Form Designer shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: title callback: argument: -------------------- class: FL_TEXT type: FL_NORMAL_TEXT box: 5 295 135 20 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_LEFT_TOP|FL_ALIGN_INSIDE style: FL_BOLD_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: seltype callback: argument: -------------------- class: FL_TEXT type: FL_NORMAL_TEXT box: 385 295 50 20 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: oristatus callback: argument: -------------------- class: FL_FRAME type: FL_ENGRAVED_FRAME box: 5 65 360 225 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BEGIN_GROUP name: fkey_group -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 375 40 55 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: F1\nattribs shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: func_cb argument: 1 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 430 40 56 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: F2\nlower shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: func_cb argument: 2 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 375 80 55 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: F3\nraise shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: func_cb argument: 3 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 430 80 56 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: F4\nall shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: func_cb argument: 4 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 375 120 55 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: F5\nshow shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: func_cb argument: 5 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 430 120 56 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: F6\nhide shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: func_cb argument: 6 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 375 160 55 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: F7\ngroup shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: func_cb argument: 7 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 430 160 56 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: F8\nungroup shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: func_cb argument: 8 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 375 200 55 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: F9\ncopy shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: func_cb argument: 9 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 430 200 56 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: F10\npaste shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: func_cb argument: 10 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 375 240 55 45 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: F11\nselect shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: func_cb argument: 11 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 430 240 56 45 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: F12\ncut shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: func_cb argument: 12 -------------------- class: FL_END_GROUP -------------------- class: FL_BROWSER type: FL_HOLD_BROWSER box: 15 90 185 100 boxtype: FL_DOWN_BOX colors: FL_WHITE FL_CYAN alignment: FL_ALIGN_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Forms shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: formbrowser callback: form_cb argument: 0 -------------------- class: FL_BROWSER type: FL_MULTI_BROWSER box: 15 210 185 75 boxtype: FL_DOWN_BOX colors: FL_WHITE FL_CYAN alignment: FL_ALIGN_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Groups shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: groupbrowser callback: group_cb argument: 0 -------------------- class: FL_TEXT type: FL_NORMAL_TEXT box: 440 295 50 20 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: sizestatus callback: argument: -------------------- class: FL_TEXT type: FL_NORMAL_TEXT box: 346 16 149 16 boxtype: FL_NO_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: (c) T.C. Zhao & Mark Overmars shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BROWSER type: FL_DESELECTABLE_HOLD_BROWSER box: 210 90 145 195 boxtype: FL_DOWN_BOX colors: FL_WHITE FL_CYAN alignment: FL_ALIGN_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Object classes shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: objectbrowser callback: object_cb argument: 0 -------------------- class: FL_BEGIN_GROUP name: shortcut_group -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 5 35 50 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Align shortcut: ^A resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: align_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 65 35 50 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Test shortcut: ^T resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: test_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 315 35 50 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Help shortcut: ^H resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: help_cb argument: 0 -------------------- class: FL_END_GROUP -------------------- class: FL_BEGIN_GROUP name: menubar_group -------------------- class: FL_MENU type: FL_PULLDOWN_MENU box: 255 5 60 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Options shortcut: ^P resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: optionmenu callback: optionmenu_callback argument: 0 -------------------- class: FL_MENU type: FL_PULLDOWN_MENU box: 7 4 35 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: File shortcut: ^F resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: filemenu callback: filemenu_callback argument: 0 -------------------- class: FL_MENU type: FL_PULLDOWN_MENU box: 58 4 40 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Form shortcut: ^M resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: formmenu callback: formmenu_callback argument: 0 -------------------- class: FL_MENU type: FL_PULLDOWN_MENU box: 180 4 53 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Object shortcut: ^O resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: objectmenu callback: objectmenu_callback argument: 0 -------------------- class: FL_MENU type: FL_PULLDOWN_MENU box: 115 4 48 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Group shortcut: ^G resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: groupmenu callback: groupmenu_callback argument: 0 -------------------- class: FL_END_GROUP -------------------- class: FL_TEXT type: FL_NORMAL_TEXT box: 145 295 105 20 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE style: FL_BOLD_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: selname callback: argument: -------------------- class: FL_TEXT type: FL_NORMAL_TEXT box: 255 295 125 20 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE style: FL_BOLD_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: selcb callback: argument: =============== FORM =============== Name: align Width: 286 Height: 126 Number of Objects: 13 -------------------- class: FL_BOX type: FL_UP_BOX box: 0 0 286 126 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_FRAME type: FL_ENGRAVED_FRAME box: 10 10 265 75 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 15 15 36 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLUE label: @#<- shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: left callback: doalign_cb argument: FD_LEFT -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 53 15 36 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLUE label: @#<-> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: hcenter callback: doalign_cb argument: FD_HCENTER -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 91 15 36 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLUE label: @#-> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: right callback: doalign_cb argument: FD_RIGHT -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 130 15 35 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: H. E shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: hequal callback: doalign_cb argument: FD_HEQUAL -------------------- class: FL_COUNTER type: FL_NORMAL_COUNTER box: 15 93 130 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_BLUE alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: snapobj callback: snap_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 15 50 36 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLUE label: @#2-> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: bottom callback: doalign_cb argument: FD_BOTTOM -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 53 50 36 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLUE label: @#8<-> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: vcenter callback: doalign_cb argument: FD_VCENTER -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 91 50 36 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLUE label: @#8-> shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: top callback: doalign_cb argument: FD_TOP -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 130 50 35 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: V.E shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: vequal callback: doalign_cb argument: FD_VEQUAL -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 190 35 70 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Undo shortcut: Uu^U resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: undo callback: undoalign_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 195 95 70 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Dismiss shortcut: Dd^D resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: dismiss callback: exitalign_cb argument: 0 =============== FORM =============== Name: test Width: 272 Height: 291 Number of Objects: 4 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 272 291 boxtype: FL_FLAT_BOX colors: FL_INDIANRED FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BROWSER type: FL_NORMAL_BROWSER box: 6 22 259 224 boxtype: FL_DOWN_BOX colors: FL_WHITE FL_YELLOW alignment: FL_ALIGN_TOP style: FL_BOLD_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Object Returned shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthWest FL_SouthEast name: browser callback: argument: -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 134 254 80 26 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Stop Testing shortcut: Ss^S resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: stoptesting callback: stoptest_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 45 254 80 26 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Clear Log shortcut: Cc^C resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: callback: clearlog_cb argument: 0 =============== FORM =============== Name: helpform Width: 536 Height: 321 Number of Objects: 10 -------------------- class: FL_BOX type: FL_UP_BOX box: 0 0 536 321 boxtype: FL_UP_BOX colors: FL_SLATEBLUE FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BROWSER type: FL_NORMAL_BROWSER box: 14 16 505 260 boxtype: FL_DOWN_BOX colors: FL_WHITE FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: browser callback: argument: -------------------- class: FL_BUTTON type: FL_RADIO_BUTTON box: 14 286 61 26 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Version shortcut: Vv^V resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: vbutt callback: showhelp_cb argument: HELP_VERSION -------------------- class: FL_BUTTON type: FL_RADIO_BUTTON box: 75 286 61 26 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: General shortcut: Gg^G resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: showhelp_cb argument: HELP_GENERAL -------------------- class: FL_BUTTON type: FL_RADIO_BUTTON box: 136 286 61 26 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Mouse shortcut: Mm^M resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: showhelp_cb argument: HELP_MOUSE -------------------- class: FL_BUTTON type: FL_RADIO_BUTTON box: 197 286 61 26 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Keyboard shortcut: Kk^K resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: showhelp_cb argument: HELP_KEYBOARD -------------------- class: FL_BUTTON type: FL_RADIO_BUTTON box: 258 286 61 26 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Group shortcut: pP^P resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: showhelp_cb argument: HELP_GROUP -------------------- class: FL_BUTTON type: FL_RADIO_BUTTON box: 319 286 61 26 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Testing shortcut: Tt^T resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: showhelp_cb argument: HELP_TEST -------------------- class: FL_BUTTON type: FL_RADIO_BUTTON box: 380 286 61 26 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Saving shortcut: Ss^S resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: showhelp_cb argument: HELP_SAVE -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 471 286 50 26 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Close shortcut: Cc^C resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: exithelp_cb argument: 0 =============== FORM =============== Name: resize Width: 250 Height: 180 Number of Objects: 7 -------------------- class: FL_BOX type: FL_UP_BOX box: 0 0 250 180 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_FRAME type: FL_ENGRAVED_FRAME box: 20 40 210 85 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_TEXT type: FL_NORMAL_TEXT box: 35 10 170 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE style: FL_BOLD_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Size of current form: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_SPINNER type: FL_INT_SPINNER box: 105 55 90 24 boxtype: FL_NO_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Width: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: width callback: argument: return: FL_RETURN_END_CHANGED -------------------- class: FL_SPINNER type: FL_INT_SPINNER box: 105 90 90 24 boxtype: FL_NO_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Height: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: height callback: argument: return: FL_RETURN_END_CHANGED -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 20 140 80 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Dismiss shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: quit callback: argument: -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 120 140 110 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Set new size shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: set_size callback: argument: ============================== create_the_forms xforms-1.2.4/fdesign/fd/ui_attrib.c0000664000175000017500000001525712353623325014133 00000000000000/* Form definition file generated by fdesign on Thu Dec 12 21:28:45 2013 */ #include #include "ui_attrib.h" /*************************************** ***************************************/ FD_attrib * create_form_attrib( void ) { FL_OBJECT *obj; FD_attrib *fdui = ( FD_attrib * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->attrib = fl_bgn_form( FL_NO_BOX, 540, 346 ); fdui->background = obj = fl_add_box( FL_FLAT_BOX, 0, 0, 540, 346, "" ); fdui->readyobj = obj = fl_add_button( FL_RETURN_BUTTON, 464, 315, 70, 25, "Accept" ); fl_set_object_color( obj, FL_CHARTREUSE, FL_GREEN ); fdui->cancelobj = obj = fl_add_button( FL_NORMAL_BUTTON, 338, 315, 70, 25, "Cancel" ); fl_set_button_shortcut( obj, "#C^[", 1 ); fl_set_object_color( obj, FL_TOMATO, FL_RED ); fdui->restoreobj = obj = fl_add_button( FL_NORMAL_BUTTON, 6, 315, 70, 25, "Undo" ); fl_set_button_shortcut( obj, "#R", 1 ); fl_set_object_color( obj, FL_ANTIQUEWHITE, FL_YELLOW ); fl_set_object_callback( obj, restore_cb, 0 ); fdui->attrib_folder = obj = fl_add_tabfolder( FL_TOP_TABFOLDER, 5, 5, 530, 300, "" ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); fl_set_object_resize( obj, FL_RESIZE_ALL ); fl_set_object_callback( obj, folder_switch_cb, 0 ); fl_end_form( ); fdui->attrib->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } /*************************************** ***************************************/ FD_generic_attrib * create_form_generic_attrib( void ) { FL_OBJECT *obj; FD_generic_attrib *fdui = ( FD_generic_attrib * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->generic_attrib = fl_bgn_form( FL_NO_BOX, 534, 278 ); fdui->background = obj = fl_add_box( FL_FLAT_BOX, 0, 0, 534, 278, "" ); fdui->generic_group = fl_bgn_group( ); fdui->text[2] = obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 235, 120, 185, 137, "Misc." ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); fdui->text[1] = obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 235, 15, 185, 95, "Font" ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); fdui->text[0] = obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 10, 15, 212, 242, "Basic Attributes" ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); fdui->typeobj = obj = fl_add_choice( FL_NORMAL_CHOICE, 69, 31, 143, 25, "Type" ); fl_set_object_shortcut( obj, "#T", 1 ); fl_set_object_boxtype( obj, FL_SHADOW_BOX ); fl_set_object_callback( obj, apply_cb, 0 ); fdui->boxobj = obj = fl_add_choice( FL_NORMAL_CHOICE, 69, 61, 143, 25, "BoxType" ); fl_set_object_shortcut( obj, "#B", 1 ); fl_set_object_boxtype( obj, FL_SHADOW_BOX ); fl_set_object_callback( obj, apply_cb, 0 ); fdui->nameobj = obj = fl_add_input( FL_NORMAL_INPUT, 69, 121, 143, 25, "Name" ); fl_set_input_shortcut( obj, "#N", 1 ); fl_set_object_color( obj, FL_COL1, FL_TOP_BCOL ); fl_set_object_callback( obj, validate_cvar_name_cb, 0 ); fdui->cbnameobj = obj = fl_add_input( FL_NORMAL_INPUT, 69, 151, 143, 25, "Callback" ); fl_set_input_shortcut( obj, "#K", 1 ); fl_set_object_color( obj, FL_COL1, FL_TOP_BCOL ); fl_set_object_callback( obj, validate_cvar_name_cb, 1 ); fdui->argobj = obj = fl_add_input( FL_NORMAL_INPUT, 69, 181, 143, 25, "Argument" ); fl_set_input_shortcut( obj, "#M", 1 ); fl_set_object_color( obj, FL_COL1, FL_TOP_BCOL ); fdui->scobj = obj = fl_add_input( FL_NORMAL_INPUT, 69, 211, 143, 25, "Shortcut" ); fl_set_input_shortcut( obj, "#H", 1 ); fl_set_object_color( obj, FL_COL1, FL_TOP_BCOL ); fl_set_object_callback( obj, apply_cb, 0 ); fdui->labelobj = obj = fl_add_input( FL_NORMAL_INPUT, 69, 91, 143, 25, "Label" ); fl_set_input_shortcut( obj, "#L", 1 ); fl_set_object_color( obj, FL_COL1, FL_TOP_BCOL ); fl_set_object_callback( obj, apply_cb, 0 ); fdui->fontobj = obj = fl_add_choice( FL_NORMAL_CHOICE, 278, 24, 131, 25, "Font" ); fl_set_object_shortcut( obj, "#F", 1 ); fl_set_object_boxtype( obj, FL_SHADOW_BOX ); fl_set_object_callback( obj, apply_cb, 0 ); fdui->styleobj = obj = fl_add_choice( FL_NORMAL_CHOICE, 278, 51, 131, 25, "Style" ); fl_set_object_shortcut( obj, "#Y", 1 ); fl_set_object_boxtype( obj, FL_SHADOW_BOX ); fl_set_object_callback( obj, apply_cb, 0 ); fdui->sizeobj = obj = fl_add_choice( FL_NORMAL_CHOICE, 278, 78, 131, 25, "Size" ); fl_set_object_shortcut( obj, "#Z", 1 ); fl_set_object_boxtype( obj, FL_SHADOW_BOX ); fl_set_object_callback( obj, apply_cb, 0 ); fdui->text[3] = obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 431, 80, 89, 150, "Color" ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); fdui->lcolobj = obj = fl_add_button( FL_NORMAL_BUTTON, 440, 191, 70, 20, "LabelColor" ); fl_set_button_shortcut( obj, "#O", 1 ); fl_set_object_lalign( obj, FL_ALIGN_TOP ); fl_set_object_callback( obj, setcolor_cb, 0 ); fdui->col1obj = obj = fl_add_button( FL_NORMAL_BUTTON, 440, 111, 70, 20, "Color1" ); fl_set_button_shortcut( obj, "#1", 1 ); fl_set_object_lalign( obj, FL_ALIGN_TOP ); fl_set_object_callback( obj, setcolor_cb, 1 ); fdui->col2obj = obj = fl_add_button( FL_NORMAL_BUTTON, 440, 151, 70, 20, "Color 2" ); fl_set_button_shortcut( obj, "#2", 1 ); fl_set_object_lalign( obj, FL_ALIGN_TOP ); fl_set_object_callback( obj, setcolor_cb, 2 ); fdui->align = obj = fl_add_choice( FL_NORMAL_CHOICE, 305, 130, 108, 23, "LabelAlign" ); fl_set_object_shortcut( obj, "#G", 1 ); fl_set_object_boxtype( obj, FL_SHADOW_BOX ); fl_set_object_callback( obj, apply_cb, 0 ); fdui->nwgravity = obj = fl_add_choice( FL_NORMAL_CHOICE, 305, 182, 108, 23, "NW Gravity" ); fl_set_object_shortcut( obj, "#W", 1 ); fl_set_object_boxtype( obj, FL_SHADOW_BOX ); fdui->segravity = obj = fl_add_choice( FL_NORMAL_CHOICE, 305, 206, 108, 23, "SE Gravity" ); fl_set_object_shortcut( obj, "#E", 1 ); fl_set_object_boxtype( obj, FL_SHADOW_BOX ); fdui->inside = obj = fl_add_choice( FL_NORMAL_CHOICE, 305, 154, 108, 23, "In/Out" ); fl_set_object_shortcut( obj, "#U", 1 ); fl_set_object_boxtype( obj, FL_SHADOW_BOX ); fl_set_object_callback( obj, apply_cb, 0 ); fdui->resize = obj = fl_add_choice( FL_NORMAL_CHOICE, 305, 230, 108, 23, "Resize" ); fl_set_object_shortcut( obj, "#I", 1 ); fl_set_object_boxtype( obj, FL_SHADOW_BOX ); fl_end_group( ); fl_end_form( ); fdui->generic_attrib->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } xforms-1.2.4/fdesign/fd/pallette.h0000664000175000017500000000313012252416175013754 00000000000000/* Header file generated by fdesign on Thu Dec 12 21:28:45 2013 */ #ifndef FD_pmain_h_ #define FD_pmain_h_ #include "../lib/include/forms.h" /* Callbacks, globals and object handlers */ void dismiss_pallete( FL_OBJECT *, long ); void pallette_entry_callback( FL_OBJECT *, long ); void pallette_entry_callback( FL_OBJECT *, long ); void pallette_entry_callback( FL_OBJECT *, long ); void pallette_entry_callback( FL_OBJECT *, long ); void pallette_entry_callback( FL_OBJECT *, long ); /* Forms and Objects */ typedef struct { FL_FORM * pmain; void * vdata; char * cdata; long ldata; FL_OBJECT * folder; } FD_pmain; FD_pmain * create_form_pmain( void ); typedef struct { FL_FORM * buttform; void * vdata; char * cdata; long ldata; } FD_buttform; FD_buttform * create_form_buttform( void ); typedef struct { FL_FORM * staticform; void * vdata; char * cdata; long ldata; } FD_staticform; FD_staticform * create_form_staticform( void ); typedef struct { FL_FORM * valuatorform; void * vdata; char * cdata; long ldata; } FD_valuatorform; FD_valuatorform * create_form_valuatorform( void ); typedef struct { FL_FORM * choiceform; void * vdata; char * cdata; long ldata; } FD_choiceform; FD_choiceform * create_form_choiceform( void ); typedef struct { FL_FORM * miscform; void * vdata; char * cdata; long ldata; } FD_miscform; FD_miscform * create_form_miscform( void ); #endif /* FD_pmain_h_ */ xforms-1.2.4/fdesign/fd/pallette.c0000664000175000017500000003244212353623325013756 00000000000000/* Form definition file generated by fdesign on Thu Dec 12 21:28:45 2013 */ #include #include "pallette.h" /*************************************** ***************************************/ FD_pmain * create_form_pmain( void ) { FL_OBJECT *obj; FD_pmain *fdui = ( FD_pmain * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->pmain = fl_bgn_form( FL_NO_BOX, 380, 210 ); obj = fl_add_box( FL_FLAT_BOX, 0, 0, 380, 210, "" ); fdui->folder = obj = fl_add_tabfolder( FL_TOP_TABFOLDER, 5, 5, 370, 175, "" ); fl_set_object_resize( obj, FL_RESIZE_ALL ); obj = fl_add_button( FL_NORMAL_BUTTON, 311, 183, 62, 23, " Dismiss " ); fl_set_object_callback( obj, dismiss_pallete, 0 ); fl_end_form( ); fdui->pmain->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } #include "butt.xpm" #include "lightb.xpm" #include "roundb.xpm" #include "r3dbut.xpm" #include "check.xpm" #include "picture.xbm" #include "xconq.xpm" /*************************************** ***************************************/ FD_buttform * create_form_buttform( void ) { FL_OBJECT *obj; FD_buttform *fdui = ( FD_buttform * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->buttform = fl_bgn_form( FL_NO_BOX, 360, 150 ); obj = fl_add_box( FL_FLAT_BOX, 0, 0, 360, 150, "" ); obj = fl_add_frame( FL_ENGRAVED_FRAME, 10, 10, 345, 130, "" ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 15, 15, 70, 40, "Button" ); fl_set_button_shortcut( obj, "B#B", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_BUTTON ); fl_set_pixmapbutton_data( obj, butt_pixels ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 101, 15, 70, 40, "LightButton" ); fl_set_button_shortcut( obj, "L#L", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_LIGHTBUTTON ); fl_set_pixmapbutton_data( obj, lightb_pixels ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 188, 15, 70, 40, "RoundButton" ); fl_set_button_shortcut( obj, "R#R", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_ROUNDBUTTON ); fl_set_pixmapbutton_data( obj, roundb_pixels ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 275, 15, 70, 40, "Round3DButton" ); fl_set_button_shortcut( obj, "3#3", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_ROUND3DBUTTON ); fl_set_pixmapbutton_align( obj, FL_ALIGN_TOP | FL_ALIGN_INSIDE, 0, 0 ); fl_set_pixmapbutton_data( obj, r3dbut_pixels ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 58, 80, 70, 40, "CheckButton" ); fl_set_button_shortcut( obj, "C#C", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_CHECKBUTTON ); fl_set_pixmapbutton_data( obj, check_pixels ); obj = fl_add_bitmapbutton( FL_RADIO_BUTTON, 145, 80, 70, 40, "BitmapButton" ); fl_set_button_shortcut( obj, "B#B", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_BITMAPBUTTON ); fl_set_bitmapbutton_data( obj, picture_width, picture_height, ( unsigned char * ) picture_bits ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 231, 80, 70, 40, "PixmapButton" ); fl_set_button_shortcut( obj, "P#P", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_PIXMAPBUTTON ); fl_set_pixmapbutton_data( obj, xconq ); fl_end_form( ); fdui->buttform->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } #include "box.xpm" #include "text.xpm" #include "frame.xpm" #include "chart.xpm" #include "clock.xpm" #include "picture1.xbm" #include "xconq1.xpm" /*************************************** ***************************************/ FD_staticform * create_form_staticform( void ) { FL_OBJECT *obj; FD_staticform *fdui = ( FD_staticform * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->staticform = fl_bgn_form( FL_NO_BOX, 360, 150 ); obj = fl_add_box( FL_FLAT_BOX, 0, 0, 360, 150, "" ); obj = fl_add_frame( FL_ENGRAVED_FRAME, 10, 10, 345, 130, "" ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 30, 20, 65, 40, "Box" ); fl_set_button_shortcut( obj, "B#B", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_BOX ); fl_set_pixmapbutton_data( obj, box_pixels ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 110, 20, 65, 40, "Text" ); fl_set_button_shortcut( obj, "T#T", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_TEXT ); fl_set_pixmapbutton_data( obj, text_pixels ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 190, 20, 65, 40, "Frame" ); fl_set_button_shortcut( obj, "F#F", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_LABELFRAME ); fl_set_pixmapbutton_data( obj, frame_pixels ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 270, 20, 65, 40, "Chart" ); fl_set_button_shortcut( obj, "C#C", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_CHART ); fl_set_pixmapbutton_data( obj, chart_pixels ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 30, 80, 65, 40, "Clock" ); fl_set_button_shortcut( obj, "o#O", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_CLOCK ); fl_set_pixmapbutton_data( obj, clock_pixels ); obj = fl_add_bitmapbutton( FL_RADIO_BUTTON, 110, 80, 65, 40, "Bitmap" ); fl_set_button_shortcut( obj, "B#B", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_BITMAP ); fl_set_bitmapbutton_data( obj, picture1_width, picture1_height, ( unsigned char * ) picture1_bits ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 210, 80, 65, 40, "Pixmap" ); fl_set_button_shortcut( obj, "P#P", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_PIXMAP ); fl_set_pixmapbutton_data( obj, xconq1 ); fl_end_form( ); fdui->staticform->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } #include "sld.xpm" #include "scb.xpm" #include "dial.xpm" #include "cnt.xpm" #include "pos.xpm" #include "vals.xpm" #include "twheel.xpm" /*************************************** ***************************************/ FD_valuatorform * create_form_valuatorform( void ) { FL_OBJECT *obj; FD_valuatorform *fdui = ( FD_valuatorform * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->valuatorform = fl_bgn_form( FL_NO_BOX, 360, 150 ); obj = fl_add_box( FL_FLAT_BOX, 0, 0, 360, 150, "" ); obj = fl_add_frame( FL_ENGRAVED_FRAME, 10, 8, 345, 130, "" ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 30, 16, 70, 40, "Slider" ); fl_set_button_shortcut( obj, "S#S", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_SLIDER ); fl_set_pixmapbutton_data( obj, sld_pixels ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 183, 16, 70, 40, "Scrollbar" ); fl_set_button_shortcut( obj, "b#B", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_SCROLLBAR ); fl_set_pixmapbutton_data( obj, scb_pixels ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 260, 16, 70, 40, "Dial" ); fl_set_button_shortcut( obj, "D#D", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_DIAL ); fl_set_pixmapbutton_data( obj, dial_pixels ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 30, 76, 70, 40, "Counter" ); fl_set_button_shortcut( obj, "C#C", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_COUNTER ); fl_set_pixmapbutton_data( obj, cnt_pixels ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 105, 76, 70, 40, "Positioner" ); fl_set_button_shortcut( obj, "P#P", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_POSITIONER ); fl_set_pixmapbutton_data( obj, pos_pixels ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 106, 16, 70, 40, "Valslider" ); fl_set_button_shortcut( obj, "#V", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_VALSLIDER ); fl_set_pixmapbutton_data( obj, vals_pixels ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 185, 76, 70, 40, "Thumbwheel" ); fl_set_button_shortcut( obj, "t#T", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_THUMBWHEEL ); fl_set_pixmapbutton_data( obj, twheel ); fl_end_form( ); fdui->valuatorform->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } #include "menu.xpm" #include "choice.xpm" #include "br.xpm" /*************************************** ***************************************/ FD_choiceform * create_form_choiceform( void ) { FL_OBJECT *obj; FD_choiceform *fdui = ( FD_choiceform * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->choiceform = fl_bgn_form( FL_NO_BOX, 360, 150 ); obj = fl_add_box( FL_FLAT_BOX, 0, 0, 360, 150, "" ); obj = fl_add_frame( FL_ENGRAVED_FRAME, 10, 10, 345, 130, "" ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 30, 20, 60, 60, "Menu" ); fl_set_button_shortcut( obj, "M#M", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_MENU ); fl_set_pixmapbutton_data( obj, menu_pixels ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 100, 20, 60, 60, "Choice" ); fl_set_button_shortcut( obj, "C#C", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_CHOICE ); fl_set_pixmapbutton_data( obj, choice_pixels ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 170, 20, 60, 60, "Browser" ); fl_set_button_shortcut( obj, "B#B", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_BROWSER ); fl_set_pixmapbutton_data( obj, br_pixels ); fl_end_form( ); fdui->choiceform->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } #include "timer.xpm" #include "xyplot.xpm" #include "glcan.xpm" #include "tab.xpm" /*************************************** ***************************************/ FD_miscform * create_form_miscform( void ) { FL_OBJECT *obj; FD_miscform *fdui = ( FD_miscform * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->miscform = fl_bgn_form( FL_NO_BOX, 360, 150 ); obj = fl_add_box( FL_FLAT_BOX, 0, 0, 360, 150, "" ); obj = fl_add_frame( FL_ENGRAVED_FRAME, 10, 10, 345, 130, "" ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 30, 16, 70, 45, "Timer" ); fl_set_button_shortcut( obj, "T#T", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_TIMER ); fl_set_pixmapbutton_data( obj, timer_pixels ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 103, 16, 70, 45, "XYPlot" ); fl_set_button_shortcut( obj, "X#X", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_XYPLOT ); fl_set_pixmapbutton_data( obj, xyplot_pixels ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 176, 16, 70, 45, "Canvas" ); fl_set_button_shortcut( obj, "C#C", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_CANVAS ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 250, 16, 70, 45, "GLCanvas" ); fl_set_button_shortcut( obj, "G#G", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_GLCANVAS ); fl_set_pixmapbutton_data( obj, glcan_pixels ); obj = fl_add_pixmapbutton( FL_RADIO_BUTTON, 30, 82, 70, 40, "Tabfolder" ); fl_set_button_shortcut( obj, "f#F", 1 ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_callback( obj, pallette_entry_callback, FL_NTABFOLDER ); fl_set_pixmapbutton_data( obj, tabfolder_pixels ); fl_end_form( ); fdui->miscform->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } xforms-1.2.4/fdesign/fd/ui_theforms.c0000664000175000017500000003514712252416175014476 00000000000000/* Form definition file generated by fdesign on Thu Dec 12 21:28:45 2013 */ #include #include "ui_theforms.h" /*************************************** ***************************************/ FD_control * create_form_control( void ) { FL_OBJECT *obj; FD_control *fdui = ( FD_control * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->control = fl_bgn_form( FL_NO_BOX, 495, 320 ); obj = fl_add_box( FL_FLAT_BOX, 0, 0, 495, 320, "" ); obj = fl_add_frame( FL_UP_FRAME, 2, 2, 495, 28, "" ); fl_set_object_color( obj, FL_COL1, FL_COL1 ); obj = fl_add_box( FL_UP_BOX, 370, 35, 121, 255, "" ); fdui->title = obj = fl_add_text( FL_NORMAL_TEXT, 353, 0, 126, 23, "Form Designer" ); fl_set_object_boxtype( obj, FL_NO_BOX ); fl_set_object_lcolor( obj, FL_BLUE ); fl_set_object_lsize( obj, FL_MEDIUM_SIZE ); fl_set_object_lalign( obj, FL_ALIGN_CENTER ); fdui->seltype = obj = fl_add_text( FL_NORMAL_TEXT, 5, 295, 135, 20, "" ); fl_set_object_boxtype( obj, FL_DOWN_BOX ); fl_set_object_color( obj, FL_COL1, FL_COL1 ); fl_set_object_lsize( obj, FL_TINY_SIZE ); fl_set_object_lalign( obj, FL_ALIGN_LEFT_TOP | FL_ALIGN_INSIDE ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); fdui->oristatus = obj = fl_add_text( FL_NORMAL_TEXT, 385, 295, 50, 20, "" ); fl_set_object_boxtype( obj, FL_DOWN_BOX ); fl_set_object_color( obj, FL_COL1, FL_COL1 ); fl_set_object_lsize( obj, FL_TINY_SIZE ); fl_set_object_lalign( obj, FL_ALIGN_CENTER ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); obj = fl_add_frame( FL_ENGRAVED_FRAME, 5, 65, 360, 225, "" ); fdui->fkey_group = fl_bgn_group( ); obj = fl_add_button( FL_NORMAL_BUTTON, 375, 40, 55, 40, "F1\nattribs" ); fl_set_object_callback( obj, func_cb, 1 ); obj = fl_add_button( FL_NORMAL_BUTTON, 430, 40, 56, 40, "F2\nlower" ); fl_set_object_callback( obj, func_cb, 2 ); obj = fl_add_button( FL_NORMAL_BUTTON, 375, 80, 55, 40, "F3\nraise" ); fl_set_object_callback( obj, func_cb, 3 ); obj = fl_add_button( FL_NORMAL_BUTTON, 430, 80, 56, 40, "F4\nall" ); fl_set_object_callback( obj, func_cb, 4 ); obj = fl_add_button( FL_NORMAL_BUTTON, 375, 120, 55, 40, "F5\nshow" ); fl_set_object_callback( obj, func_cb, 5 ); obj = fl_add_button( FL_NORMAL_BUTTON, 430, 120, 56, 40, "F6\nhide" ); fl_set_object_callback( obj, func_cb, 6 ); obj = fl_add_button( FL_NORMAL_BUTTON, 375, 160, 55, 40, "F7\ngroup" ); fl_set_object_callback( obj, func_cb, 7 ); obj = fl_add_button( FL_NORMAL_BUTTON, 430, 160, 56, 40, "F8\nungroup" ); fl_set_object_callback( obj, func_cb, 8 ); obj = fl_add_button( FL_NORMAL_BUTTON, 375, 200, 55, 40, "F9\ncopy" ); fl_set_object_callback( obj, func_cb, 9 ); obj = fl_add_button( FL_NORMAL_BUTTON, 430, 200, 56, 40, "F10\npaste" ); fl_set_object_callback( obj, func_cb, 10 ); obj = fl_add_button( FL_NORMAL_BUTTON, 375, 240, 55, 45, "F11\nselect" ); fl_set_object_callback( obj, func_cb, 11 ); obj = fl_add_button( FL_NORMAL_BUTTON, 430, 240, 56, 45, "F12\ncut" ); fl_set_object_callback( obj, func_cb, 12 ); fl_end_group( ); fdui->formbrowser = obj = fl_add_browser( FL_HOLD_BROWSER, 15, 90, 185, 100, "Forms" ); fl_set_object_color( obj, FL_WHITE, FL_CYAN ); fl_set_object_lalign( obj, FL_ALIGN_TOP ); fl_set_object_callback( obj, form_cb, 0 ); fdui->groupbrowser = obj = fl_add_browser( FL_MULTI_BROWSER, 15, 210, 185, 75, "Groups" ); fl_set_object_color( obj, FL_WHITE, FL_CYAN ); fl_set_object_lalign( obj, FL_ALIGN_TOP ); fl_set_object_callback( obj, group_cb, 0 ); fdui->sizestatus = obj = fl_add_text( FL_NORMAL_TEXT, 440, 295, 50, 20, "" ); fl_set_object_boxtype( obj, FL_DOWN_BOX ); fl_set_object_color( obj, FL_COL1, FL_COL1 ); fl_set_object_lsize( obj, FL_TINY_SIZE ); fl_set_object_lalign( obj, FL_ALIGN_CENTER ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); obj = fl_add_text( FL_NORMAL_TEXT, 346, 16, 149, 16, "(c) T.C. Zhao & Mark Overmars" ); fl_set_object_boxtype( obj, FL_NO_BOX ); fl_set_object_lsize( obj, FL_TINY_SIZE ); fl_set_object_lalign( obj, FL_ALIGN_CENTER ); fdui->objectbrowser = obj = fl_add_browser( FL_DESELECTABLE_HOLD_BROWSER, 210, 90, 145, 195, "Object classes" ); fl_set_object_color( obj, FL_WHITE, FL_CYAN ); fl_set_object_lalign( obj, FL_ALIGN_TOP ); fl_set_object_callback( obj, object_cb, 0 ); fdui->shortcut_group = fl_bgn_group( ); obj = fl_add_button( FL_NORMAL_BUTTON, 5, 35, 50, 25, "Align" ); fl_set_button_shortcut( obj, "^A", 1 ); fl_set_object_callback( obj, align_cb, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 65, 35, 50, 25, "Test" ); fl_set_button_shortcut( obj, "^T", 1 ); fl_set_object_callback( obj, test_cb, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 315, 35, 50, 25, "Help" ); fl_set_button_shortcut( obj, "^H", 1 ); fl_set_object_callback( obj, help_cb, 0 ); fl_end_group( ); fdui->menubar_group = fl_bgn_group( ); fdui->optionmenu = obj = fl_add_menu( FL_PULLDOWN_MENU, 255, 5, 60, 20, "Options" ); fl_set_object_shortcut( obj, "^P", 1 ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, optionmenu_callback, 0 ); fdui->filemenu = obj = fl_add_menu( FL_PULLDOWN_MENU, 7, 4, 35, 20, "File" ); fl_set_object_shortcut( obj, "^F", 1 ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, filemenu_callback, 0 ); fdui->formmenu = obj = fl_add_menu( FL_PULLDOWN_MENU, 58, 4, 40, 20, "Form" ); fl_set_object_shortcut( obj, "^M", 1 ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, formmenu_callback, 0 ); fdui->objectmenu = obj = fl_add_menu( FL_PULLDOWN_MENU, 180, 4, 53, 20, "Object" ); fl_set_object_shortcut( obj, "^O", 1 ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, objectmenu_callback, 0 ); fdui->groupmenu = obj = fl_add_menu( FL_PULLDOWN_MENU, 115, 4, 48, 20, "Group" ); fl_set_object_shortcut( obj, "^G", 1 ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_callback( obj, groupmenu_callback, 0 ); fl_end_group( ); fdui->selname = obj = fl_add_text( FL_NORMAL_TEXT, 145, 295, 105, 20, "" ); fl_set_object_boxtype( obj, FL_DOWN_BOX ); fl_set_object_color( obj, FL_COL1, FL_COL1 ); fl_set_object_lsize( obj, FL_TINY_SIZE ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); fdui->selcb = obj = fl_add_text( FL_NORMAL_TEXT, 255, 295, 125, 20, "" ); fl_set_object_boxtype( obj, FL_DOWN_BOX ); fl_set_object_color( obj, FL_COL1, FL_COL1 ); fl_set_object_lsize( obj, FL_TINY_SIZE ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); fl_end_form( ); fdui->control->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } /*************************************** ***************************************/ FD_align * create_form_align( void ) { FL_OBJECT *obj; FD_align *fdui = ( FD_align * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->align = fl_bgn_form( FL_NO_BOX, 286, 126 ); obj = fl_add_box( FL_UP_BOX, 0, 0, 286, 126, "" ); obj = fl_add_frame( FL_ENGRAVED_FRAME, 10, 10, 265, 75, "" ); fdui->left = obj = fl_add_button( FL_NORMAL_BUTTON, 15, 15, 36, 30, "@#<-" ); fl_set_object_lcolor( obj, FL_BLUE ); fl_set_object_callback( obj, doalign_cb, FD_LEFT ); fdui->hcenter = obj = fl_add_button( FL_NORMAL_BUTTON, 53, 15, 36, 30, "@#<->" ); fl_set_object_lcolor( obj, FL_BLUE ); fl_set_object_callback( obj, doalign_cb, FD_HCENTER ); fdui->right = obj = fl_add_button( FL_NORMAL_BUTTON, 91, 15, 36, 30, "@#->" ); fl_set_object_lcolor( obj, FL_BLUE ); fl_set_object_callback( obj, doalign_cb, FD_RIGHT ); fdui->hequal = obj = fl_add_button( FL_NORMAL_BUTTON, 130, 15, 35, 30, "H. E" ); fl_set_object_callback( obj, doalign_cb, FD_HEQUAL ); fdui->snapobj = obj = fl_add_counter( FL_NORMAL_COUNTER, 15, 93, 130, 25, "" ); fl_set_object_lalign( obj, FL_ALIGN_CENTER ); fl_set_object_callback( obj, snap_cb, 0 ); fdui->bottom = obj = fl_add_button( FL_NORMAL_BUTTON, 15, 50, 36, 30, "@#2->" ); fl_set_object_lcolor( obj, FL_BLUE ); fl_set_object_callback( obj, doalign_cb, FD_BOTTOM ); fdui->vcenter = obj = fl_add_button( FL_NORMAL_BUTTON, 53, 50, 36, 30, "@#8<->" ); fl_set_object_lcolor( obj, FL_BLUE ); fl_set_object_callback( obj, doalign_cb, FD_VCENTER ); fdui->top = obj = fl_add_button( FL_NORMAL_BUTTON, 91, 50, 36, 30, "@#8->" ); fl_set_object_lcolor( obj, FL_BLUE ); fl_set_object_callback( obj, doalign_cb, FD_TOP ); fdui->vequal = obj = fl_add_button( FL_NORMAL_BUTTON, 130, 50, 35, 30, "V.E" ); fl_set_object_callback( obj, doalign_cb, FD_VEQUAL ); fdui->undo = obj = fl_add_button( FL_NORMAL_BUTTON, 190, 35, 70, 25, "Undo" ); fl_set_button_shortcut( obj, "Uu^U", 1 ); fl_set_object_callback( obj, undoalign_cb, 0 ); fdui->dismiss = obj = fl_add_button( FL_NORMAL_BUTTON, 195, 95, 70, 25, "Dismiss" ); fl_set_button_shortcut( obj, "Dd^D", 1 ); fl_set_object_callback( obj, exitalign_cb, 0 ); fl_end_form( ); fdui->align->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } /*************************************** ***************************************/ FD_test * create_form_test( void ) { FL_OBJECT *obj; FD_test *fdui = ( FD_test * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->test = fl_bgn_form( FL_NO_BOX, 272, 291 ); obj = fl_add_box( FL_FLAT_BOX, 0, 0, 272, 291, "" ); fl_set_object_color( obj, FL_INDIANRED, FL_COL1 ); fdui->browser = obj = fl_add_browser( FL_NORMAL_BROWSER, 6, 22, 259, 224, "Object Returned" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lalign( obj, FL_ALIGN_TOP ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); fl_set_object_gravity( obj, FL_NorthWest, FL_SouthEast ); fdui->stoptesting = obj = fl_add_button( FL_NORMAL_BUTTON, 134, 254, 80, 26, "Stop Testing" ); fl_set_button_shortcut( obj, "Ss^S", 1 ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); fl_set_object_resize( obj, FL_RESIZE_NONE ); fl_set_object_gravity( obj, FL_SouthEast, FL_SouthEast ); fl_set_object_callback( obj, stoptest_cb, 0 ); obj = fl_add_button( FL_NORMAL_BUTTON, 45, 254, 80, 26, "Clear Log" ); fl_set_button_shortcut( obj, "Cc^C", 1 ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); fl_set_object_resize( obj, FL_RESIZE_NONE ); fl_set_object_gravity( obj, FL_SouthEast, FL_SouthEast ); fl_set_object_callback( obj, clearlog_cb, 0 ); fl_end_form( ); fdui->test->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } /*************************************** ***************************************/ FD_helpform * create_form_helpform( void ) { FL_OBJECT *obj; FD_helpform *fdui = ( FD_helpform * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->helpform = fl_bgn_form( FL_NO_BOX, 536, 321 ); obj = fl_add_box( FL_UP_BOX, 0, 0, 536, 321, "" ); fl_set_object_color( obj, FL_SLATEBLUE, FL_COL1 ); fdui->browser = obj = fl_add_browser( FL_NORMAL_BROWSER, 14, 16, 505, 260, "" ); fdui->vbutt = obj = fl_add_button( FL_RADIO_BUTTON, 14, 286, 61, 26, "Version" ); fl_set_button_shortcut( obj, "Vv^V", 1 ); fl_set_object_callback( obj, showhelp_cb, HELP_VERSION ); obj = fl_add_button( FL_RADIO_BUTTON, 75, 286, 61, 26, "General" ); fl_set_button_shortcut( obj, "Gg^G", 1 ); fl_set_object_callback( obj, showhelp_cb, HELP_GENERAL ); obj = fl_add_button( FL_RADIO_BUTTON, 136, 286, 61, 26, "Mouse" ); fl_set_button_shortcut( obj, "Mm^M", 1 ); fl_set_object_callback( obj, showhelp_cb, HELP_MOUSE ); obj = fl_add_button( FL_RADIO_BUTTON, 197, 286, 61, 26, "Keyboard" ); fl_set_button_shortcut( obj, "Kk^K", 1 ); fl_set_object_callback( obj, showhelp_cb, HELP_KEYBOARD ); obj = fl_add_button( FL_RADIO_BUTTON, 258, 286, 61, 26, "Group" ); fl_set_button_shortcut( obj, "pP^P", 1 ); fl_set_object_callback( obj, showhelp_cb, HELP_GROUP ); obj = fl_add_button( FL_RADIO_BUTTON, 319, 286, 61, 26, "Testing" ); fl_set_button_shortcut( obj, "Tt^T", 1 ); fl_set_object_callback( obj, showhelp_cb, HELP_TEST ); obj = fl_add_button( FL_RADIO_BUTTON, 380, 286, 61, 26, "Saving" ); fl_set_button_shortcut( obj, "Ss^S", 1 ); fl_set_object_callback( obj, showhelp_cb, HELP_SAVE ); obj = fl_add_button( FL_NORMAL_BUTTON, 471, 286, 50, 26, "Close" ); fl_set_button_shortcut( obj, "Cc^C", 1 ); fl_set_object_callback( obj, exithelp_cb, 0 ); fl_end_form( ); fdui->helpform->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } /*************************************** ***************************************/ FD_resize * create_form_resize( void ) { FL_OBJECT *obj; FD_resize *fdui = ( FD_resize * ) fl_malloc( sizeof *fdui ); int old_bw = fl_get_border_width( ); fl_set_border_width( -1 ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->resize = fl_bgn_form( FL_NO_BOX, 250, 180 ); obj = fl_add_box( FL_UP_BOX, 0, 0, 250, 180, "" ); obj = fl_add_frame( FL_ENGRAVED_FRAME, 20, 40, 210, 85, "" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); obj = fl_add_text( FL_NORMAL_TEXT, 35, 10, 170, 20, "Size of current form:" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_lstyle( obj, FL_BOLD_STYLE ); fdui->width = obj = fl_add_spinner( FL_INT_SPINNER, 105, 55, 90, 24, "Width: " ); fl_set_object_return( obj, FL_RETURN_END_CHANGED ); fdui->height = obj = fl_add_spinner( FL_INT_SPINNER, 105, 90, 90, 24, "Height: " ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_set_object_return( obj, FL_RETURN_END_CHANGED ); fl_set_object_lsize( fl_get_spinner_input( obj ), FL_NORMAL_SIZE ); fdui->quit = obj = fl_add_button( FL_NORMAL_BUTTON, 20, 140, 80, 25, "Dismiss" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fdui->set_size = obj = fl_add_button( FL_NORMAL_BUTTON, 120, 140, 110, 25, "Set new size" ); fl_set_object_lsize( obj, FL_NORMAL_SIZE ); fl_end_form( ); fdui->resize->fdui = fdui; fl_set_border_width( old_bw ); return fdui; } xforms-1.2.4/fdesign/fd/pallette.fd0000664000175000017500000004203112353623325014120 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 6 Unit of measure: FL_COORD_PIXEL Border Width: -1 =============== FORM =============== Name: pmain Width: 380 Height: 210 Number of Objects: 3 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 380 210 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_TABFOLDER type: FL_TOP_TABFOLDER box: 5 5 370 175 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_LEFT_TOP style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: folder callback: argument: -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 311 183 62 23 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Dismiss shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: dismiss_pallete argument: 0 =============== FORM =============== Name: buttform Width: 360 Height: 150 Number of Objects: 9 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 360 150 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_FRAME type: FL_ENGRAVED_FRAME box: 10 10 345 130 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 15 15 70 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Button shortcut: B#B resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_BUTTON file: ../xpm/butt.xpm fullpath: 0 data: butt_pixels -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 101 15 70 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: LightButton shortcut: L#L resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_LIGHTBUTTON file: ../xpm/lightb.xpm fullpath: 0 data: lightb_pixels -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 188 15 70 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: RoundButton shortcut: R#R resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_ROUNDBUTTON file: ../xpm/roundb.xpm fullpath: 0 data: roundb_pixels -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 275 15 70 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Round3DButton shortcut: 3#3 resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_ROUND3DBUTTON file: ../xpm/r3dbut.xpm fullpath: 0 align: FL_ALIGN_TOP|FL_ALIGN_INSIDE data: r3dbut_pixels -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 58 80 70 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: CheckButton shortcut: C#C resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_CHECKBUTTON file: ../xpm/check.xpm fullpath: 0 data: check_pixels -------------------- class: FL_BITMAPBUTTON type: FL_RADIO_BUTTON box: 145 80 70 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: BitmapButton shortcut: B#B resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_BITMAPBUTTON file: ../xpm/picture.xbm fullpath: 0 data: picture_bits width: picture_width height: picture_height -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 231 80 70 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: PixmapButton shortcut: P#P resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_PIXMAPBUTTON file: ../xpm/xconq.xpm fullpath: 0 data: xconq =============== FORM =============== Name: staticform Width: 360 Height: 150 Number of Objects: 9 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 360 150 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_FRAME type: FL_ENGRAVED_FRAME box: 10 10 345 130 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 30 20 65 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Box shortcut: B#B resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_BOX file: ../xpm/box.xpm fullpath: 0 data: box_pixels -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 110 20 65 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Text shortcut: T#T resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_TEXT file: ../xpm/text.xpm fullpath: 0 data: text_pixels -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 190 20 65 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Frame shortcut: F#F resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_LABELFRAME file: ../xpm/frame.xpm fullpath: 0 data: frame_pixels -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 270 20 65 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Chart shortcut: C#C resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_CHART file: ../xpm/chart.xpm fullpath: 0 data: chart_pixels -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 30 80 65 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Clock shortcut: o#O resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_CLOCK file: ../xpm/clock.xpm fullpath: 0 data: clock_pixels -------------------- class: FL_BITMAPBUTTON type: FL_RADIO_BUTTON box: 110 80 65 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Bitmap shortcut: B#B resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_BITMAP file: ../xpm/picture1.xbm fullpath: 0 data: picture1_bits width: picture1_width height: picture1_height -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 210 80 65 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Pixmap shortcut: P#P resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_PIXMAP file: ../xpm/xconq1.xpm fullpath: 0 data: xconq1 =============== FORM =============== Name: valuatorform Width: 360 Height: 150 Number of Objects: 9 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 360 150 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_FRAME type: FL_ENGRAVED_FRAME box: 10 8 345 130 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 30 16 70 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Slider shortcut: S#S resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_SLIDER file: ../xpm/sld.xpm fullpath: 0 data: sld_pixels -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 183 16 70 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Scrollbar shortcut: b#B resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_SCROLLBAR file: ../xpm/scb.xpm fullpath: 0 data: scb_pixels -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 260 16 70 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Dial shortcut: D#D resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_DIAL file: ../xpm/dial.xpm fullpath: 0 data: dial_pixels -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 30 76 70 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Counter shortcut: C#C resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_COUNTER file: ../xpm/cnt.xpm fullpath: 0 data: cnt_pixels -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 105 76 70 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Positioner shortcut: P#P resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_POSITIONER file: ../xpm/pos.xpm fullpath: 0 data: pos_pixels -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 106 16 70 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Valslider shortcut: #V resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_VALSLIDER file: ../xpm/vals.xpm fullpath: 0 data: vals_pixels -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 185 76 70 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Thumbwheel shortcut: t#T resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_THUMBWHEEL file: ../xpm/twheel.xpm fullpath: 0 data: twheel =============== FORM =============== Name: choiceform Width: 360 Height: 150 Number of Objects: 5 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 360 150 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_FRAME type: FL_ENGRAVED_FRAME box: 10 10 345 130 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 30 20 60 60 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Menu shortcut: M#M resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_MENU file: ../xpm/menu.xpm fullpath: 0 data: menu_pixels -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 100 20 60 60 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Choice shortcut: C#C resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_CHOICE file: ../xpm/choice.xpm fullpath: 0 data: choice_pixels -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 170 20 60 60 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Browser shortcut: B#B resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_BROWSER file: ../xpm/br.xpm fullpath: 0 data: br_pixels =============== FORM =============== Name: miscform Width: 360 Height: 150 Number of Objects: 7 -------------------- class: FL_BOX type: FL_FLAT_BOX box: 0 0 360 150 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_FRAME type: FL_ENGRAVED_FRAME box: 10 10 345 130 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 30 16 70 45 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Timer shortcut: T#T resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_TIMER file: ../xpm/timer.xpm fullpath: 0 data: timer_pixels -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 103 16 70 45 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: XYPlot shortcut: X#X resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_XYPLOT file: ../xpm/xyplot.xpm fullpath: 0 data: xyplot_pixels -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 176 16 70 45 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Canvas shortcut: C#C resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_CANVAS -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 250 16 70 45 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: GLCanvas shortcut: G#G resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_GLCANVAS file: ../xpm/glcan.xpm fullpath: 0 data: glcan_pixels -------------------- class: FL_PIXMAPBUTTON type: FL_RADIO_BUTTON box: 30 82 70 40 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Tabfolder shortcut: f#F resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: pallette_entry_callback argument: FL_NTABFOLDER file: ../xpm/tab.xpm fullpath: 0 data: tabfolder_pixels ============================== create_the_forms xforms-1.2.4/fdesign/fd/Makefile.am0000644000175000017500000000036112252416555014030 00000000000000include $(top_srcdir)/config/common.am INCLUDE = $(top_srcdir)/lib/include EXTRA_DIST = \ pallette.c \ pallette.fd \ pallette.h \ ui_attrib.c \ ui_attrib.fd \ ui_attrib.h \ ui_theforms.c \ ui_theforms.fd \ ui_theforms.h \ Readme xforms-1.2.4/fdesign/fd/Readme0000664000175000017500000000042712353623325013116 00000000000000To recreate the .c and .h files from the .fd files use the command fdesign -convert -I \"../lib/include/forms.h\" *.fd This makes sure that the newest version of the forms.h file is included instead of an already installed forms.h file (typically /usr/local/include/forms.h). xforms-1.2.4/fdesign/Readme0000644000175000017500000000013211665175644012527 00000000000000 fdesign is the XForms GUI builder/designer. type fdesgin -help for brief help messages. xforms-1.2.4/config/0000775000175000017500000000000012353624652011314 500000000000000xforms-1.2.4/config/Makefile.in0000664000175000017500000002515612353624173013310 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/common.am config.guess config.sub depcomp \ install-sh ltmain.sh missing texinfo.tex subdir = config ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FL_FIXLEVEL = @FL_FIXLEVEL@ FL_REVISION = @FL_REVISION@ FL_VERSION = @FL_VERSION@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIB = @JPEG_LIB@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ TEXI2DVI = @TEXI2DVI@ TEXI2DVI_NEEDS_PDF = @TEXI2DVI_NEEDS_PDF@ TEXI2HTML = @TEXI2HTML@ VERSION = @VERSION@ XMKMF = @XMKMF@ XPM_LIB = @XPM_LIB@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign DISTCLEANFILES = *.orig *.rej *~ *.bak core makelog MAINTAINERCLEANFILES = $(srcdir)/Makefile.in makelog config.guess \ config.sub install-sh libtool.m4 ltmain.sh lt~obsolete.m4 \ ltoptions.m4 ltsugar.m4 ltversion.m4 depcomp missing AM_INSTALL_DATA_FLAGS = $(INSTALL) -m 644 -D EXTRA_DIST = common.am config.guess config.sub cygwin.m4 depcomp \ libtool.m4 ltmain.sh xformsinclude.m4 install-sh missing all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/common.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign config/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign config/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/common.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: xforms-1.2.4/config/install-sh0000755000175000017500000003325612353624173013245 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: xforms-1.2.4/config/libtool.m40000644000175000017500000106043412353624170013143 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file 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. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS xforms-1.2.4/config/config.guess0000755000175000017500000012743212353624173013561 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-02-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: xforms-1.2.4/config/cygwin.m40000644000175000017500000000306012253017316012763 00000000000000# Macro added for some Cygwin-specific support -*- sh -*- # @author@: Kayvan Sylvan AC_DEFUN([CHECK_WITH_CYGWIN], [ case $host_os in cygwin* | mingw* | pw32* ) if test "$GCC" = yes; then # Ensure MSVC-compatible struct packing convention. # Depends on GCC version. gcc2 uses -fnative-struct while # gcc3 uses -mms-bitfields. # msnative_struct='' AC_MSG_CHECKING([how to get MSVC-compatible struct packing]) case `$CC --version | sed -e 's,\..*,.,' -e q` in 2.) if $CC -v --help 2>/dev/null | grep fnative-struct > /dev/null; then msnative_struct='-fnative-struct' fi ;; *) if $CC -v --help 2>/dev/null | grep ms-bitfields > /dev/null; then msnative_struct='-mms-bitfields' fi ;; esac if test x"$msnative_struct" = x; then AC_MSG_RESULT([no way]) AC_MSG_WARN([produced libraries might be incompatible with MSVC libs]) else CXXFLAGS="$CXXFLAGS $msnative_struct" AC_MSG_RESULT([${msnative_struct}]) fi fi # Export all symbols to Win32 DLL using MinGW 2.0 ld. WIN32_LD_EXPORT_ALL_SYMBOLS='' AC_MSG_CHECKING([whether ld accepts --export-all-symbols]) if $LD --help 2>&1 | egrep 'export-all-symbols' > /dev/null; then WIN32_LD_EXPORT_ALL_SYMBOLS='-Wl,--export-all-symbols' AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi if test x"$WIN32_LD_EXPORT_ALL_SYMBOLS" != x; then LDFLAGS="$LDFLAGS $WIN32_LD_EXPORT_ALL_SYMBOLS" fi ;; esac ]) xforms-1.2.4/config/depcomp0000755000175000017500000004755612353624173012626 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2011-12-04.11; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, # 2011 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test "$stat" = 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/ \1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/ / G p }' >> "$depfile" rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: xforms-1.2.4/config/xformsinclude.m40000664000175000017500000002444612353623325014366 00000000000000dnl Some useful functions for xforms configure.in -*- sh -*- dnl Author: Jean-Marc Lasgouttes (lasgouttes@lyx.org) dnl Lars Gullik Bjønnes (larsbj@lyx.org) dnl Allan Rae (rae@lyx.org) dnl Jens Thoms Törring (jt@toerring.de) ### Check for version and warn when a development version is used dnl Usage XFORMS_CHECK_VERSION dnl Sets variables VERSION, FL_VERSION, FL_REVISION, FL_FIXLEVEL and dnl xforms_devel_version. AC_DEFUN([XFORMS_CHECK_VERSION],[ AC_SUBST(PACKAGE, $PACKAGE_NAME) AC_SUBST(VERSION, $PACKAGE_VERSION) [eval] `echo $PACKAGE_VERSION | sed -e 's/\(.*\)\.\(.*\)\.\(.*\)/FL_VERSION=\1; FL_REVISION=\2; FL_FIXLEVEL=\3/'` AC_SUBST(FL_VERSION) AC_SUBST(FL_REVISION) AC_SUBST(FL_FIXLEVEL) echo "configuring xforms version $VERSION" xforms_devel_version=no case $FL_REVISION in *[[13579]]) xforms_devel_version=yes AC_DEFINE(DEVEL_VERSION, 1, Define if you are building a development version of xforms) echo "WARNING: This is a development version. Expect bugs." ;; esac ]) dnl Usage XFORMS_CHECK_LIB_JPEG: Checks for jpeg library AC_DEFUN([XFORMS_CHECK_LIB_JPEG],[ ### Check for Jpeg library AC_CHECK_LIB(jpeg, jpeg_CreateDecompress, JPEG_LIB="-ljpeg", [XFORMS_LIB_ERROR(libjpeg,jpeg)]) AC_SUBST(JPEG_LIB) ]) dnl Usage XFORMS_PATH_XPM: Checks for xpm library and header AC_DEFUN([XFORMS_PATH_XPM],[ ### Check for Xpm library SAVE_LIBS="$LIBS" LIBS="$X_PRE_LIBS $LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" AC_CHECK_LIB(Xpm, XpmCreateBufferFromImage, XPM_LIB="-lXpm", [XFORMS_LIB_ERROR(libXpm,Xpm)]) AC_SUBST(XPM_LIB) LIBS="$SAVE_LIBS" ### Check for Xpm headers SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$X_CFLAGS $CPPFLAGS" xforms_cv_xpm_h_location="" AC_CHECK_HEADER(X11/xpm.h,[ ac_cv_header_xpm_h=yes xforms_cv_xpm_h_location=""],[ AC_CHECK_HEADER(xpm.h,[],[ XFORMS_LIB_ERROR(xpm.h,Xpm)])]) AC_DEFINE_UNQUOTED(XPM_H_LOCATION,$xforms_cv_xpm_h_location, [define this to the location of xpm.h to be used with #include, e.g. ]) CPPFLAGS="$SAVE_CPPFLAGS" ### Test for the header version if test $ac_cv_header_xpm_h = yes; then AC_CACHE_CHECK([xpm header version],xforms_cv_xpmversion, [ cat > conftest.$ac_ext <&5 | \ grep '^"%%%"' 2>/dev/null | \ sed -e 's/^"%%%"\(.*\)"%%%"/\1/' -e 's/ //g'` case "$xforms_cv_xpmr" in changequote(,) [0-9]) xformsxpmr_alpha=`echo $xforms_cv_xpmr |tr 123456789 abcdefghi` xformsxpmv_alpha=" (aka 3.$xforms_cv_xpmv$xformsxpmr_alpha)";; changequote([,]) *) ;; esac xforms_cv_xpmversion="$xforms_cv_xpmv.$xforms_cv_xpmr$xformsxpmv_alpha" rm -f conftest*]) XPM_VERSION=${xforms_cv_xpmversion} case "$xforms_cv_xpmr" in changequote(,) [789]|[0-9][0-9]*) ;; changequote([,]) *) XFORMS_WARNING([Version $xforms_cv_xpmversion of the Xpm library is a bit old. If you experience strange crashes with xforms, try to upgrade to at least version 4.7 (aka 3.4g). If you have installed a newer version of the library, check whether you have an old xpm.h header file in your include path.]);; esac fi]) dnl Macro tests if 'texi2dvi' is installed and usable. Also test for 'convert' dnl and checks if PNG files must be converted to PDF files. AC_DEFUN([XFORMS_CHECK_TEXI2DVI],[ AC_CHECK_PROGS(TEXI2DVI,[texi2dvi],no) export TEXI2DVI AC_CHECK_PROGS(CONVERT,[convert],no) export CONVERT dnl If 'texi2dvi' doesn't exist there' nothing we can do. Otherwise we need to dnl check if the installed version of 'texi2dvi' uses programs that can't deal dnl with PNG files (as some older versions did). For this we create a minimal dnl texi file that just contains an image and run 'texi2dvi' on it. If this dnl fails we check the log file for a line complaining about a missing image. dnl If such a line doesn't exist 'texi2dvi' must be broken in a way we can't dnl deal with. Otherwise we need to convert the PNF files to PDF. This in turn dnl requires 'convert'. If it doesn't exist we can't create the PD dnl documentation, otherwise we set a variable that tells us in the Makefile dnl that all PNG files have to be converted to PDF. if test $TEXI2DVI = "no" then XFORMS_WARNING([Unable to find application 'texi2dvi', PDF documentation won't be built]) else cat > texi2dvi_test.texi < /dev/null 2>&1; if test $? != 0; then grep "cannot find image file" texi2dvi_test.log > /dev/null 2>&1 if test $? = 0; then if test $CONVERT = "no"; then TEXI2DVI="no" XFORMS_WARNING(['texi2dvi' requires the 'convert' application but which doesn't exist, so PDF documentation won't be built]) else TEXI2DVI_NEEDS_PDF="yes" export TEXI2DVI_NEEDS_PDF fi else TEXI2DVI="no" XFORMS_WARNING([Unable to find a working application 'texi2dvi', PDF documentation won't be built]) fi fi rm -f texi2dvi_test.* fi AC_SUBST(TEXI2DVI) AC_SUBST(CONVERT) AC_SUBST(TEXI2DVI_NEEDS_PDF) ]) dnl Macro tests if texi2html is installed. dnl AC_DEFUN([XFORMS_CHECK_TEXI2HTML],[ AC_CHECK_PROGS(TEXI2HTML,[texi2html],no) export TEXI2HTML; if test $TEXI2HTML = "no" ; then XFORMS_WARNING([Unable to find a 'texi2html' application, HTML documentation won't be built]); fi AC_SUBST(TEXI2HTML) ]) dnl Usage: XFORMS_ERROR(message) Displays the warning "message" and sets the dnl flag xforms_error to yes. AC_DEFUN([XFORMS_ERROR],[ xforms_error_txt="$xforms_error_txt ** $1 " xforms_error=yes]) dnl Usage: XFORMS_WARNING(message) Displays the warning "message" and sets the dnl flag xforms_warning to yes. AC_DEFUN([XFORMS_WARNING],[ xforms_warning_txt="$xforms_warning_txt == $1 " xforms_warning=yes]) dnl Usage: XFORMS_LIB_ERROR(file,library) Displays an error message indication dnl that 'file' cannot be found because 'lib' may be uncorrectly installed. AC_DEFUN([XFORMS_LIB_ERROR],[ XFORMS_ERROR([Cannot find $1. Please check that the $2 library is correctly installed on your system.])]) dnl Usage: XFORMS_CHECK_ERRORS Displays a warning message if a XFORMS_ERROR dnl has occured previously. AC_DEFUN([XFORMS_CHECK_ERRORS],[ if test x$xforms_error = xyes; then cat </dev/null`" = SunOS && uname -r | grep '^5' >/dev/null; then if test $ac_cv_cxx_compiler_gnu = yes ; then $1="${$1} -Wl[,]-R$2" else $1="${$1} -R$2" fi fi]) dnl Usage: XFORMS_ADD_INC_DIR(var-name,dir) Adds a -I directive to variable dnl var-name. AC_DEFUN([XFORMS_ADD_INC_DIR],[$1="${$1} -I$2 "]) dnl this is used by the macro below to general a proper config.h.in entry m4_define([XFORMS_AH_CHECK_DECL], [AH_TEMPLATE(AS_TR_CPP(HAVE_DECL_$1), [Define if you have the prototype for function `$1'])]) dnl Check things are declared in headers to avoid errors or warnings. dnl Called like XFORMS_CHECK_DECL(function, header1 header2...) dnl Defines HAVE_DECL_{FUNCTION} AC_DEFUN([XFORMS_CHECK_DECL], [XFORMS_AH_CHECK_DECL($1) for ac_header in $2 do AC_MSG_CHECKING([if $1 is declared by header $ac_header]) AC_EGREP_HEADER($1, $ac_header, [AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_DECL_$1)) break], [AC_MSG_RESULT(no)]) done]) xforms-1.2.4/config/config.sub0000755000175000017500000010517612353624173013225 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-02-10' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: xforms-1.2.4/config/texinfo.tex0000644000175000017500000115375112253017322013432 00000000000000% texinfo.tex -- TeX macros to handle Texinfo files. % % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % \def\texinfoversion{2012-01-03.09} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, % 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. % % This texinfo.tex file is free software: you can redistribute it and/or % modify it under the terms of the GNU General Public License as % published by the Free Software Foundation, either version 3 of the % License, or (at your option) any later version. % % This texinfo.tex file 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, see . % % As a special exception, when this file is read by TeX when processing % a Texinfo source document, you may use the result without % restriction. (This has been our intent since Texinfo was invented.) % % Please try the latest version of texinfo.tex before submitting bug % reports; you can get the latest version from: % http://www.gnu.org/software/texinfo/ (the Texinfo home page), or % ftp://tug.org/tex/texinfo.tex % (and all CTAN mirrors, see http://www.ctan.org). % The texinfo.tex in any given distribution could well be out % of date, so if that's what you're using, please check. % % Send bug reports to bug-texinfo@gnu.org. Please include including a % complete document in each bug report with which we can reproduce the % problem. Patches are, of course, greatly appreciated. % % To process a Texinfo manual with TeX, it's most reliable to use the % texi2dvi shell script that comes with the distribution. For a simple % manual foo.texi, however, you can get away with this: % tex foo.texi % texindex foo.?? % tex foo.texi % tex foo.texi % dvips foo.dvi -o # or whatever; this makes foo.ps. % The extra TeX runs get the cross-reference information correct. % Sometimes one run after texindex suffices, and sometimes you need more % than two; texi2dvi does it as many times as necessary. % % It is possible to adapt texinfo.tex for other languages, to some % extent. You can get the existing language-specific files from the % full Texinfo distribution. % % The GNU Texinfo home page is http://www.gnu.org/software/texinfo. \message{Loading texinfo [version \texinfoversion]:} % If in a .fmt file, print the version number % and turn on active characters that we couldn't do earlier because % they might have appeared in the input file name. \everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} \chardef\other=12 % We never want plain's \outer definition of \+ in Texinfo. % For @tex, we can use \tabalign. \let\+ = \relax % Save some plain tex macros whose names we will redefine. \let\ptexb=\b \let\ptexbullet=\bullet \let\ptexc=\c \let\ptexcomma=\, \let\ptexdot=\. \let\ptexdots=\dots \let\ptexend=\end \let\ptexequiv=\equiv \let\ptexexclam=\! \let\ptexfootnote=\footnote \let\ptexgtr=> \let\ptexhat=^ \let\ptexi=\i \let\ptexindent=\indent \let\ptexinsert=\insert \let\ptexlbrace=\{ \let\ptexless=< \let\ptexnewwrite\newwrite \let\ptexnoindent=\noindent \let\ptexplus=+ \let\ptexraggedright=\raggedright \let\ptexrbrace=\} \let\ptexslash=\/ \let\ptexstar=\* \let\ptext=\t \let\ptextop=\top {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode % If this character appears in an error message or help string, it % starts a new line in the output. \newlinechar = `^^J % Use TeX 3.0's \inputlineno to get the line number, for better error % messages, but if we're using an old version of TeX, don't do anything. % \ifx\inputlineno\thisisundefined \let\linenumber = \empty % Pre-3.0. \else \def\linenumber{l.\the\inputlineno:\space} \fi % Set up fixed words for English if not already set. \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi \ifx\putworderror\undefined \gdef\putworderror{error}\fi \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi \ifx\putwordin\undefined \gdef\putwordin{in}\fi \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi \ifx\putwordof\undefined \gdef\putwordof{of}\fi \ifx\putwordon\undefined \gdef\putwordon{on}\fi \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi % \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi % \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi % Since the category of space is not known, we have to be careful. \chardef\spacecat = 10 \def\spaceisspace{\catcode`\ =\spacecat} % sometimes characters are active, so we need control sequences. \chardef\ampChar = `\& \chardef\colonChar = `\: \chardef\commaChar = `\, \chardef\dashChar = `\- \chardef\dotChar = `\. \chardef\exclamChar= `\! \chardef\hashChar = `\# \chardef\lquoteChar= `\` \chardef\questChar = `\? \chardef\rquoteChar= `\' \chardef\semiChar = `\; \chardef\slashChar = `\/ \chardef\underChar = `\_ % Ignore a token. % \def\gobble#1{} % The following is used inside several \edef's. \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} % Hyphenation fixes. \hyphenation{ Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script ap-pen-dix bit-map bit-maps data-base data-bases eshell fall-ing half-way long-est man-u-script man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces spell-ing spell-ings stand-alone strong-est time-stamp time-stamps which-ever white-space wide-spread wrap-around } % Margin to add to right of even pages, to left of odd pages. \newdimen\bindingoffset \newdimen\normaloffset \newdimen\pagewidth \newdimen\pageheight % For a final copy, take out the rectangles % that mark overfull boxes (in case you have decided % that the text looks ok even though it passes the margin). % \def\finalout{\overfullrule=0pt } % Sometimes it is convenient to have everything in the transcript file % and nothing on the terminal. We don't just call \tracingall here, % since that produces some useless output on the terminal. We also make % some effort to order the tracing commands to reduce output in the log % file; cf. trace.sty in LaTeX. % \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% \def\loggingall{% \tracingstats2 \tracingpages1 \tracinglostchars2 % 2 gives us more in etex \tracingparagraphs1 \tracingoutput1 \tracingmacros2 \tracingrestores1 \showboxbreadth\maxdimen \showboxdepth\maxdimen \ifx\eTeXversion\thisisundefined\else % etex gives us more logging \tracingscantokens1 \tracingifs1 \tracinggroups1 \tracingnesting2 \tracingassigns1 \fi \tracingcommands3 % 3 gives us more in etex \errorcontextlines16 }% % @errormsg{MSG}. Do the index-like expansions on MSG, but if things % aren't perfect, it's not the end of the world, being an error message, % after all. % \def\errormsg{\begingroup \indexnofonts \doerrormsg} \def\doerrormsg#1{\errmessage{#1}} % add check for \lastpenalty to plain's definitions. If the last thing % we did was a \nobreak, we don't want to insert more space. % \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount \removelastskip\penalty-50\smallskip\fi\fi} \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount \removelastskip\penalty-100\medskip\fi\fi} \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount \removelastskip\penalty-200\bigskip\fi\fi} % Do @cropmarks to get crop marks. % \newif\ifcropmarks \let\cropmarks = \cropmarkstrue % % Dimensions to add cropmarks at corners. % Added by P. A. MacKay, 12 Nov. 1986 % \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines \newdimen\cornerlong \cornerlong=1pc \newdimen\cornerthick \cornerthick=.3pt \newdimen\topandbottommargin \topandbottommargin=.75in % Output a mark which sets \thischapter, \thissection and \thiscolor. % We dump everything together because we only have one kind of mark. % This works because we only use \botmark / \topmark, not \firstmark. % % A mark contains a subexpression of the \ifcase ... \fi construct. % \get*marks macros below extract the needed part using \ifcase. % % Another complication is to let the user choose whether \thischapter % (\thissection) refers to the chapter (section) in effect at the top % of a page, or that at the bottom of a page. The solution is % described on page 260 of The TeXbook. It involves outputting two % marks for the sectioning macros, one before the section break, and % one after. I won't pretend I can describe this better than DEK... \def\domark{% \toks0=\expandafter{\lastchapterdefs}% \toks2=\expandafter{\lastsectiondefs}% \toks4=\expandafter{\prevchapterdefs}% \toks6=\expandafter{\prevsectiondefs}% \toks8=\expandafter{\lastcolordefs}% \mark{% \the\toks0 \the\toks2 \noexpand\or \the\toks4 \the\toks6 \noexpand\else \the\toks8 }% } % \topmark doesn't work for the very first chapter (after the title % page or the contents), so we use \firstmark there -- this gets us % the mark with the chapter defs, unless the user sneaks in, e.g., % @setcolor (or @url, or @link, etc.) between @contents and the very % first @chapter. \def\gettopheadingmarks{% \ifcase0\topmark\fi \ifx\thischapter\empty \ifcase0\firstmark\fi \fi } \def\getbottomheadingmarks{\ifcase1\botmark\fi} \def\getcolormarks{\ifcase2\topmark\fi} % Avoid "undefined control sequence" errors. \def\lastchapterdefs{} \def\lastsectiondefs{} \def\prevchapterdefs{} \def\prevsectiondefs{} \def\lastcolordefs{} % Main output routine. \chardef\PAGE = 255 \output = {\onepageout{\pagecontents\PAGE}} \newbox\headlinebox \newbox\footlinebox % \onepageout takes a vbox as an argument. Note that \pagecontents % does insertions, but you have to call it yourself. \def\onepageout#1{% \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi % \ifodd\pageno \advance\hoffset by \bindingoffset \else \advance\hoffset by -\bindingoffset\fi % % Do this outside of the \shipout so @code etc. will be expanded in % the headline as they should be, not taken literally (outputting ''code). \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% % {% % Have to do this stuff outside the \shipout because we want it to % take effect in \write's, yet the group defined by the \vbox ends % before the \shipout runs. % \indexdummies % don't expand commands in the output. \normalturnoffactive % \ in index entries must not stay \, e.g., if % the page break happens to be in the middle of an example. % We don't want .vr (or whatever) entries like this: % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} % "\acronym" won't work when it's read back in; % it needs to be % {\code {{\tt \backslashcurfont }acronym} \shipout\vbox{% % Do this early so pdf references go to the beginning of the page. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi % \ifcropmarks \vbox to \outervsize\bgroup \hsize = \outerhsize \vskip-\topandbottommargin \vtop to0pt{% \line{\ewtop\hfil\ewtop}% \nointerlineskip \line{% \vbox{\moveleft\cornerthick\nstop}% \hfill \vbox{\moveright\cornerthick\nstop}% }% \vss}% \vskip\topandbottommargin \line\bgroup \hfil % center the page within the outer (page) hsize. \ifodd\pageno\hskip\bindingoffset\fi \vbox\bgroup \fi % \unvbox\headlinebox \pagebody{#1}% \ifdim\ht\footlinebox > 0pt % Only leave this space if the footline is nonempty. % (We lessened \vsize for it in \oddfootingyyy.) % The \baselineskip=24pt in plain's \makefootline has no effect. \vskip 24pt \unvbox\footlinebox \fi % \ifcropmarks \egroup % end of \vbox\bgroup \hfil\egroup % end of (centering) \line\bgroup \vskip\topandbottommargin plus1fill minus1fill \boxmaxdepth = \cornerthick \vbox to0pt{\vss \line{% \vbox{\moveleft\cornerthick\nsbot}% \hfill \vbox{\moveright\cornerthick\nsbot}% }% \nointerlineskip \line{\ewbot\hfil\ewbot}% }% \egroup % \vbox from first cropmarks clause \fi }% end of \shipout\vbox }% end of group with \indexdummies \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi } \newinsert\margin \dimen\margin=\maxdimen \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} {\catcode`\@ =11 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi % marginal hacks, juha@viisa.uucp (Juha Takala) \ifvoid\margin\else % marginal info is present \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi \dimen@=\dp#1\relax \unvbox#1\relax \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi \ifr@ggedbottom \kern-\dimen@ \vfil \fi} } % Here are the rules for the cropmarks. Note that they are % offset so that the space between them is truly \outerhsize or \outervsize % (P. A. MacKay, 12 November, 1986) % \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} \def\nstop{\vbox {\hrule height\cornerthick depth\cornerlong width\cornerthick}} \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} \def\nsbot{\vbox {\hrule height\cornerlong depth\cornerthick width\cornerthick}} % Parse an argument, then pass it to #1. The argument is the rest of % the input line (except we remove a trailing comment). #1 should be a % macro which expects an ordinary undelimited TeX argument. % \def\parsearg{\parseargusing{}} \def\parseargusing#1#2{% \def\argtorun{#2}% \begingroup \obeylines \spaceisspace #1% \parseargline\empty% Insert the \empty token, see \finishparsearg below. } {\obeylines % \gdef\parseargline#1^^M{% \endgroup % End of the group started in \parsearg. \argremovecomment #1\comment\ArgTerm% }% } % First remove any @comment, then any @c comment. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} % Each occurrence of `\^^M' or `\^^M' is replaced by a single space. % % \argremovec might leave us with trailing space, e.g., % @end itemize @c foo % This space token undergoes the same procedure and is eventually removed % by \finishparsearg. % \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% \def\temp{#3}% \ifx\temp\empty % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp: \let\temp\finishparsearg \else \let\temp\argcheckspaces \fi % Put the space token in: \temp#1 #3\ArgTerm } % If a _delimited_ argument is enclosed in braces, they get stripped; so % to get _exactly_ the rest of the line, we had to prevent such situation. % We prepended an \empty token at the very beginning and we expand it now, % just before passing the control to \argtorun. % (Similarly, we have to think about #3 of \argcheckspacesY above: it is % either the null string, or it ends with \^^M---thus there is no danger % that a pair of braces would be stripped. % % But first, we have to remove the trailing space token. % \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} % \parseargdef\foo{...} % is roughly equivalent to % \def\foo{\parsearg\Xfoo} % \def\Xfoo#1{...} % % Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my % favourite TeX trick. --kasal, 16nov03 \def\parseargdef#1{% \expandafter \doparseargdef \csname\string#1\endcsname #1% } \def\doparseargdef#1#2{% \def#2{\parsearg#1}% \def#1##1% } % Several utility definitions with active space: { \obeyspaces \gdef\obeyedspace{ } % Make each space character in the input produce a normal interword % space in the output. Don't allow a line break at this space, as this % is used only in environments like @example, where each line of input % should produce a line of output anyway. % \gdef\sepspaces{\obeyspaces\let =\tie} % If an index command is used in an @example environment, any spaces % therein should become regular spaces in the raw index file, not the % expansion of \tie (\leavevmode \penalty \@M \ ). \gdef\unsepspaces{\let =\space} } \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} % Define the framework for environments in texinfo.tex. It's used like this: % % \envdef\foo{...} % \def\Efoo{...} % % It's the responsibility of \envdef to insert \begingroup before the % actual body; @end closes the group after calling \Efoo. \envdef also % defines \thisenv, so the current environment is known; @end checks % whether the environment name matches. The \checkenv macro can also be % used to check whether the current environment is the one expected. % % Non-false conditionals (@iftex, @ifset) don't fit into this, so they % are not treated as environments; they don't open a group. (The % implementation of @end takes care not to call \endgroup in this % special case.) % At run-time, environments start with this: \def\startenvironment#1{\begingroup\def\thisenv{#1}} % initialize \let\thisenv\empty % ... but they get defined via ``\envdef\foo{...}'': \long\def\envdef#1#2{\def#1{\startenvironment#1#2}} \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} % Check whether we're in the right environment: \def\checkenv#1{% \def\temp{#1}% \ifx\thisenv\temp \else \badenverr \fi } % Environment mismatch, #1 expected: \def\badenverr{% \errhelp = \EMsimple \errmessage{This command can appear only \inenvironment\temp, not \inenvironment\thisenv}% } \def\inenvironment#1{% \ifx#1\empty outside of any environment% \else in environment \expandafter\string#1% \fi } % @end foo executes the definition of \Efoo. % But first, it executes a specialized version of \checkenv % \parseargdef\end{% \if 1\csname iscond.#1\endcsname \else % The general wording of \badenverr may not be ideal. \expandafter\checkenv\csname#1\endcsname \csname E#1\endcsname \endgroup \fi } \newhelp\EMsimple{Press RETURN to continue.} % Be sure we're in horizontal mode when doing a tie, since we make space % equivalent to this in @example-like environments. Otherwise, a space % at the beginning of a line will start with \penalty -- and % since \penalty is valid in vertical mode, we'd end up putting the % penalty on the vertical list instead of in the new paragraph. {\catcode`@ = 11 % Avoid using \@M directly, because that causes trouble % if the definition is written into an index file. \global\let\tiepenalty = \@M \gdef\tie{\leavevmode\penalty\tiepenalty\ } } % @: forces normal size whitespace following. \def\:{\spacefactor=1000 } % @* forces a line break. \def\*{\hfil\break\hbox{}\ignorespaces} % @/ allows a line break. \let\/=\allowbreak % @. is an end-of-sentence period. \def\.{.\spacefactor=\endofsentencespacefactor\space} % @! is an end-of-sentence bang. \def\!{!\spacefactor=\endofsentencespacefactor\space} % @? is an end-of-sentence query. \def\?{?\spacefactor=\endofsentencespacefactor\space} % @frenchspacing on|off says whether to put extra space after punctuation. % \def\onword{on} \def\offword{off} % \parseargdef\frenchspacing{% \def\temp{#1}% \ifx\temp\onword \plainfrenchspacing \else\ifx\temp\offword \plainnonfrenchspacing \else \errhelp = \EMsimple \errmessage{Unknown @frenchspacing option `\temp', must be on|off}% \fi\fi } % @w prevents a word break. Without the \leavevmode, @w at the % beginning of a paragraph, when TeX is still in vertical mode, would % produce a whole line of output instead of starting the paragraph. \def\w#1{\leavevmode\hbox{#1}} % @group ... @end group forces ... to be all on one page, by enclosing % it in a TeX vbox. We use \vtop instead of \vbox to construct the box % to keep its height that of a normal line. According to the rules for % \topskip (p.114 of the TeXbook), the glue inserted is % max (\topskip - \ht (first item), 0). If that height is large, % therefore, no glue is inserted, and the space between the headline and % the text is small, which looks bad. % % Another complication is that the group might be very large. This can % cause the glue on the previous page to be unduly stretched, because it % does not have much material. In this case, it's better to add an % explicit \vfill so that the extra space is at the bottom. The % threshold for doing this is if the group is more than \vfilllimit % percent of a page (\vfilllimit can be changed inside of @tex). % \newbox\groupbox \def\vfilllimit{0.7} % \envdef\group{% \ifnum\catcode`\^^M=\active \else \errhelp = \groupinvalidhelp \errmessage{@group invalid in context where filling is enabled}% \fi \startsavinginserts % \setbox\groupbox = \vtop\bgroup % Do @comment since we are called inside an environment such as % @example, where each end-of-line in the input causes an % end-of-line in the output. We don't want the end-of-line after % the `@group' to put extra space in the output. Since @group % should appear on a line by itself (according to the Texinfo % manual), we don't worry about eating any user text. \comment } % % The \vtop produces a box with normal height and large depth; thus, TeX puts % \baselineskip glue before it, and (when the next line of text is done) % \lineskip glue after it. Thus, space below is not quite equal to space % above. But it's pretty close. \def\Egroup{% % To get correct interline space between the last line of the group % and the first line afterwards, we have to propagate \prevdepth. \endgraf % Not \par, as it may have been set to \lisppar. \global\dimen1 = \prevdepth \egroup % End the \vtop. % \dimen0 is the vertical size of the group's box. \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox % \dimen2 is how much space is left on the page (more or less). \dimen2 = \pageheight \advance\dimen2 by -\pagetotal % if the group doesn't fit on the current page, and it's a big big % group, force a page break. \ifdim \dimen0 > \dimen2 \ifdim \pagetotal < \vfilllimit\pageheight \page \fi \fi \box\groupbox \prevdepth = \dimen1 \checkinserts } % % TeX puts in an \escapechar (i.e., `@') at the beginning of the help % message, so this ends up printing `@group can only ...'. % \newhelp\groupinvalidhelp{% group can only be used in environments such as @example,^^J% where each line of input produces a line of output.} % @need space-in-mils % forces a page break if there is not space-in-mils remaining. \newdimen\mil \mil=0.001in \parseargdef\need{% % Ensure vertical mode, so we don't make a big box in the middle of a % paragraph. \par % % If the @need value is less than one line space, it's useless. \dimen0 = #1\mil \dimen2 = \ht\strutbox \advance\dimen2 by \dp\strutbox \ifdim\dimen0 > \dimen2 % % Do a \strut just to make the height of this box be normal, so the % normal leading is inserted relative to the preceding line. % And a page break here is fine. \vtop to #1\mil{\strut\vfil}% % % TeX does not even consider page breaks if a penalty added to the % main vertical list is 10000 or more. But in order to see if the % empty box we just added fits on the page, we must make it consider % page breaks. On the other hand, we don't want to actually break the % page after the empty box. So we use a penalty of 9999. % % There is an extremely small chance that TeX will actually break the % page at this \penalty, if there are no other feasible breakpoints in % sight. (If the user is using lots of big @group commands, which % almost-but-not-quite fill up a page, TeX will have a hard time doing % good page breaking, for example.) However, I could not construct an % example where a page broke at this \penalty; if it happens in a real % document, then we can reconsider our strategy. \penalty9999 % % Back up by the size of the box, whether we did a page break or not. \kern -#1\mil % % Do not allow a page break right after this kern. \nobreak \fi } % @br forces paragraph break (and is undocumented). \let\br = \par % @page forces the start of a new page. % \def\page{\par\vfill\supereject} % @exdent text.... % outputs text on separate line in roman font, starting at standard page margin % This records the amount of indent in the innermost environment. % That's how much \exdent should take out. \newskip\exdentamount % This defn is used inside fill environments such as @defun. \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} % This defn is used inside nofill environments such as @example. \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount \leftline{\hskip\leftskip{\rm#1}}}} % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current % paragraph. For more general purposes, use the \margin insertion % class. WHICH is `l' or `r'. Not documented, written for gawk manual. % \newskip\inmarginspacing \inmarginspacing=1cm \def\strutdepth{\dp\strutbox} % \def\doinmargin#1#2{\strut\vadjust{% \nobreak \kern-\strutdepth \vtop to \strutdepth{% \baselineskip=\strutdepth \vss % if you have multiple lines of stuff to put here, you'll need to % make the vbox yourself of the appropriate size. \ifx#1l% \llap{\ignorespaces #2\hskip\inmarginspacing}% \else \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% \fi \null }% }} \def\inleftmargin{\doinmargin l} \def\inrightmargin{\doinmargin r} % % @inmargin{TEXT [, RIGHT-TEXT]} % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; % else use TEXT for both). % \def\inmargin#1{\parseinmargin #1,,\finish} \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \def\lefttext{#1}% have both texts \def\righttext{#2}% \else \def\lefttext{#1}% have only one text \def\righttext{#1}% \fi % \ifodd\pageno \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin \else \def\temp{\inleftmargin\lefttext}% \fi \temp } % @| inserts a changebar to the left of the current line. It should % surround any changed text. This approach does *not* work if the % change spans more than two lines of output. To handle that, we would % have adopt a much more difficult approach (putting marks into the main % vertical list for the beginning and end of each change). This command % is not documented, not supported, and doesn't work. % \def\|{% % \vadjust can only be used in horizontal mode. \leavevmode % % Append this vertical mode material after the current line in the output. \vadjust{% % We want to insert a rule with the height and depth of the current % leading; that is exactly what \strutbox is supposed to record. \vskip-\baselineskip % % \vadjust-items are inserted at the left edge of the type. So % the \llap here moves out into the left-hand margin. \llap{% % % For a thicker or thinner bar, change the `1pt'. \vrule height\baselineskip width1pt % % This is the space between the bar and the text. \hskip 12pt }% }% } % @include FILE -- \input text of FILE. % \def\include{\parseargusing\filenamecatcodes\includezzz} \def\includezzz#1{% \pushthisfilestack \def\thisfile{#1}% {% \makevalueexpandable % we want to expand any @value in FILE. \turnoffactive % and allow special characters in the expansion \indexnofonts % Allow `@@' and other weird things in file names. \wlog{texinfo.tex: doing @include of #1^^J}% \edef\temp{\noexpand\input #1 }% % % This trickery is to read FILE outside of a group, in case it makes % definitions, etc. \expandafter }\temp \popthisfilestack } \def\filenamecatcodes{% \catcode`\\=\other \catcode`~=\other \catcode`^=\other \catcode`_=\other \catcode`|=\other \catcode`<=\other \catcode`>=\other \catcode`+=\other \catcode`-=\other \catcode`\`=\other \catcode`\'=\other } \def\pushthisfilestack{% \expandafter\pushthisfilestackX\popthisfilestack\StackTerm } \def\pushthisfilestackX{% \expandafter\pushthisfilestackY\thisfile\StackTerm } \def\pushthisfilestackY #1\StackTerm #2\StackTerm {% \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% } \def\popthisfilestack{\errthisfilestackempty} \def\errthisfilestackempty{\errmessage{Internal error: the stack of filenames is empty.}} \def\thisfile{} % @center line % outputs that line, centered. % \parseargdef\center{% \ifhmode \let\next\centerH \else \let\next\centerV \fi \next{\hfil \ignorespaces#1\unskip \hfil}% } \def\centerH#1{% {% \hfil\break \advance\hsize by -\leftskip \advance\hsize by -\rightskip \line{#1}% \break }% } \def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}} % @sp n outputs n lines of vertical space \parseargdef\sp{\vskip #1\baselineskip} % @comment ...line which is ignored... % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment \def\comment{\begingroup \catcode`\^^M=\other% \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% \commentxxx} {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} \let\c=\comment % @paragraphindent NCHARS % We'll use ems for NCHARS, close enough. % NCHARS can also be the word `asis' or `none'. % We cannot feasibly implement @paragraphindent asis, though. % \def\asisword{asis} % no translation, these are keywords \def\noneword{none} % \parseargdef\paragraphindent{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \defaultparindent = 0pt \else \defaultparindent = #1em \fi \fi \parindent = \defaultparindent } % @exampleindent NCHARS % We'll use ems for NCHARS like @paragraphindent. % It seems @exampleindent asis isn't necessary, but % I preserve it to make it similar to @paragraphindent. \parseargdef\exampleindent{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \lispnarrowing = 0pt \else \lispnarrowing = #1em \fi \fi } % @firstparagraphindent WORD % If WORD is `none', then suppress indentation of the first paragraph % after a section heading. If WORD is `insert', then do indent at such % paragraphs. % % The paragraph indentation is suppressed or not by calling % \suppressfirstparagraphindent, which the sectioning commands do. % We switch the definition of this back and forth according to WORD. % By default, we suppress indentation. % \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} \def\insertword{insert} % \parseargdef\firstparagraphindent{% \def\temp{#1}% \ifx\temp\noneword \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent \else\ifx\temp\insertword \let\suppressfirstparagraphindent = \relax \else \errhelp = \EMsimple \errmessage{Unknown @firstparagraphindent option `\temp'}% \fi\fi } % Here is how we actually suppress indentation. Redefine \everypar to % \kern backwards by \parindent, and then reset itself to empty. % % We also make \indent itself not actually do anything until the next % paragraph. % \gdef\dosuppressfirstparagraphindent{% \gdef\indent{% \restorefirstparagraphindent \indent }% \gdef\noindent{% \restorefirstparagraphindent \noindent }% \global\everypar = {% \kern -\parindent \restorefirstparagraphindent }% } \gdef\restorefirstparagraphindent{% \global \let \indent = \ptexindent \global \let \noindent = \ptexnoindent \global \everypar = {}% } % @refill is a no-op. \let\refill=\relax % If working on a large document in chapters, it is convenient to % be able to disable indexing, cross-referencing, and contents, for test runs. % This is done with @novalidate (before @setfilename). % \newif\iflinks \linkstrue % by default we want the aux files. \let\novalidate = \linksfalse % @setfilename is done at the beginning of every texinfo file. % So open here the files we need to have open while reading the input. % This makes it possible to make a .fmt file for texinfo. \def\setfilename{% \fixbackslash % Turn off hack to swallow `\input texinfo'. \iflinks \tryauxfile % Open the new aux file. TeX will close it automatically at exit. \immediate\openout\auxfile=\jobname.aux \fi % \openindices needs to do some work in any case. \openindices \let\setfilename=\comment % Ignore extra @setfilename cmds. % % If texinfo.cnf is present on the system, read it. % Useful for site-wide @afourpaper, etc. \openin 1 texinfo.cnf \ifeof 1 \else \input texinfo.cnf \fi \closein 1 % \comment % Ignore the actual filename. } % Called from \setfilename. % \def\openindices{% \newindex{cp}% \newcodeindex{fn}% \newcodeindex{vr}% \newcodeindex{tp}% \newcodeindex{ky}% \newcodeindex{pg}% } % @bye. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} \message{pdf,} % adobe `portable' document format \newcount\tempnum \newcount\lnkcount \newtoks\filename \newcount\filenamelength \newcount\pgn \newtoks\toksA \newtoks\toksB \newtoks\toksC \newtoks\toksD \newbox\boxA \newcount\countA \newif\ifpdf \newif\ifpdfmakepagedest % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 % can be set). So we test for \relax and 0 as well as being undefined. \ifx\pdfoutput\thisisundefined \else \ifx\pdfoutput\relax \else \ifcase\pdfoutput \else \pdftrue \fi \fi \fi % PDF uses PostScript string constants for the names of xref targets, % for display in the outlines, and in other places. Thus, we have to % double any backslashes. Otherwise, a name like "\node" will be % interpreted as a newline (\n), followed by o, d, e. Not good. % % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and % related messages. The final outcome is that it is up to the TeX user % to double the backslashes and otherwise make the string valid, so % that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to % do this reliably, so we use it. % #1 is a control sequence in which to do the replacements, % which we \xdef. \def\txiescapepdf#1{% \ifx\pdfescapestring\relax % No primitive available; should we give a warning or log? % Many times it won't matter. \else % The expandable \pdfescapestring primitive escapes parentheses, % backslashes, and other special chars. \xdef#1{\pdfescapestring{#1}}% \fi } \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images with PDF output, and none of those formats could be found. (.eps cannot be supported due to the design of the PDF format; use regular TeX (DVI output) for that.)} \ifpdf % % Color manipulation macros based on pdfcolor.tex, % except using rgb instead of cmyk; the latter is said to render as a % very dark gray on-screen and a very dark halftone in print, instead % of actual black. \def\rgbDarkRed{0.50 0.09 0.12} \def\rgbBlack{0 0 0} % % k sets the color for filling (usual text, etc.); % K sets the color for stroking (thin rules, e.g., normal _'s). \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} % % Set color, and create a mark which defines \thiscolor accordingly, % so that \makeheadline knows which color to restore. \def\setcolor#1{% \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% \domark \pdfsetcolor{#1}% } % \def\maincolor{\rgbBlack} \pdfsetcolor{\maincolor} \edef\thiscolor{\maincolor} \def\lastcolordefs{} % \def\makefootline{% \baselineskip24pt \line{\pdfsetcolor{\maincolor}\the\footline}% } % \def\makeheadline{% \vbox to 0pt{% \vskip-22.5pt \line{% \vbox to8.5pt{}% % Extract \thiscolor definition from the marks. \getcolormarks % Typeset the headline with \maincolor, then restore the color. \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% }% \vss }% \nointerlineskip } % % \pdfcatalog{/PageMode /UseOutlines} % % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). \def\dopdfimage#1#2#3{% \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% % % pdftex (and the PDF format) support .pdf, .png, .jpg (among % others). Let's try in that order, PDF first since if % someone has a scalable image, presumably better to use that than a % bitmap. \let\pdfimgext=\empty \begingroup \openin 1 #1.pdf \ifeof 1 \openin 1 #1.PDF \ifeof 1 \openin 1 #1.png \ifeof 1 \openin 1 #1.jpg \ifeof 1 \openin 1 #1.jpeg \ifeof 1 \openin 1 #1.JPG \ifeof 1 \errhelp = \nopdfimagehelp \errmessage{Could not find image file #1 for pdf}% \else \gdef\pdfimgext{JPG}% \fi \else \gdef\pdfimgext{jpeg}% \fi \else \gdef\pdfimgext{jpg}% \fi \else \gdef\pdfimgext{png}% \fi \else \gdef\pdfimgext{PDF}% \fi \else \gdef\pdfimgext{pdf}% \fi \closein 1 \endgroup % % without \immediate, ancient pdftex seg faults when the same image is % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) \ifnum\pdftexversion < 14 \immediate\pdfimage \else \immediate\pdfximage \fi \ifdim \wd0 >0pt width \imagewidth \fi \ifdim \wd2 >0pt height \imageheight \fi \ifnum\pdftexversion<13 #1.\pdfimgext \else {#1.\pdfimgext}% \fi \ifnum\pdftexversion < 14 \else \pdfrefximage \pdflastximage \fi} % \def\pdfmkdest#1{{% % We have to set dummies so commands such as @code, and characters % such as \, aren't expanded when present in a section title. \indexnofonts \turnoffactive \makevalueexpandable \def\pdfdestname{#1}% \txiescapepdf\pdfdestname \safewhatsit{\pdfdest name{\pdfdestname} xyz}% }} % % used to mark target names; must be expandable. \def\pdfmkpgn#1{#1} % % by default, use a color that is dark enough to print on paper as % nearly black, but still distinguishable for online viewing. \def\urlcolor{\rgbDarkRed} \def\linkcolor{\rgbDarkRed} \def\endlink{\setcolor{\maincolor}\pdfendlink} % % Adding outlines to PDF; macros for calculating structure of outlines % come from Petr Olsak \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% \else \csname#1\endcsname \fi} \def\advancenumber#1{\tempnum=\expnumber{#1}\relax \advance\tempnum by 1 \expandafter\xdef\csname#1\endcsname{\the\tempnum}} % % #1 is the section text, which is what will be displayed in the % outline by the pdf viewer. #2 is the pdf expression for the number % of subentries (or empty, for subsubsections). #3 is the node text, % which might be empty if this toc entry had no corresponding node. % #4 is the page number % \def\dopdfoutline#1#2#3#4{% % Generate a link to the node text if that exists; else, use the % page number. We could generate a destination for the section % text in the case where a section has no node, but it doesn't % seem worth the trouble, since most documents are normally structured. \edef\pdfoutlinedest{#3}% \ifx\pdfoutlinedest\empty \def\pdfoutlinedest{#4}% \else \txiescapepdf\pdfoutlinedest \fi % % Also escape PDF chars in the display string. \edef\pdfoutlinetext{#1}% \txiescapepdf\pdfoutlinetext % \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% } % \def\pdfmakeoutlines{% \begingroup % Read toc silently, to get counts of subentries for \pdfoutline. \def\partentry##1##2##3##4{}% ignore parts in the outlines \def\numchapentry##1##2##3##4{% \def\thischapnum{##2}% \def\thissecnum{0}% \def\thissubsecnum{0}% }% \def\numsecentry##1##2##3##4{% \advancenumber{chap\thischapnum}% \def\thissecnum{##2}% \def\thissubsecnum{0}% }% \def\numsubsecentry##1##2##3##4{% \advancenumber{sec\thissecnum}% \def\thissubsecnum{##2}% }% \def\numsubsubsecentry##1##2##3##4{% \advancenumber{subsec\thissubsecnum}% }% \def\thischapnum{0}% \def\thissecnum{0}% \def\thissubsecnum{0}% % % use \def rather than \let here because we redefine \chapentry et % al. a second time, below. \def\appentry{\numchapentry}% \def\appsecentry{\numsecentry}% \def\appsubsecentry{\numsubsecentry}% \def\appsubsubsecentry{\numsubsubsecentry}% \def\unnchapentry{\numchapentry}% \def\unnsecentry{\numsecentry}% \def\unnsubsecentry{\numsubsecentry}% \def\unnsubsubsecentry{\numsubsubsecentry}% \readdatafile{toc}% % % Read toc second time, this time actually producing the outlines. % The `-' means take the \expnumber as the absolute number of % subentries, which we calculated on our first read of the .toc above. % % We use the node names as the destinations. \def\numchapentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% \def\numsecentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% \def\numsubsecentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% \def\numsubsubsecentry##1##2##3##4{% count is always zero \dopdfoutline{##1}{}{##3}{##4}}% % % PDF outlines are displayed using system fonts, instead of % document fonts. Therefore we cannot use special characters, % since the encoding is unknown. For example, the eogonek from % Latin 2 (0xea) gets translated to a | character. Info from % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. % % TODO this right, we have to translate 8-bit characters to % their "best" equivalent, based on the @documentencoding. Too % much work for too little return. Just use the ASCII equivalents % we use for the index sort strings. % \indexnofonts \setupdatafile % We can have normal brace characters in the PDF outlines, unlike % Texinfo index files. So set that up. \def\{{\lbracecharliteral}% \def\}{\rbracecharliteral}% \catcode`\\=\active \otherbackslash \input \tocreadfilename \endgroup } {\catcode`[=1 \catcode`]=2 \catcode`{=\other \catcode`}=\other \gdef\lbracecharliteral[{]% \gdef\rbracecharliteral[}]% ] % \def\skipspaces#1{\def\PP{#1}\def\D{|}% \ifx\PP\D\let\nextsp\relax \else\let\nextsp\skipspaces \ifx\p\space\else\addtokens{\filename}{\PP}% \advance\filenamelength by 1 \fi \fi \nextsp} \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax} \ifnum\pdftexversion < 14 \let \startlink \pdfannotlink \else \let \startlink \pdfstartlink \fi % make a live url in pdf output. \def\pdfurl#1{% \begingroup % it seems we really need yet another set of dummies; have not % tried to figure out what each command should do in the context % of @url. for now, just make @/ a no-op, that's the only one % people have actually reported a problem with. % \normalturnoffactive \def\@{@}% \let\/=\empty \makevalueexpandable % do we want to go so far as to use \indexnofonts instead of just % special-casing \var here? \def\var##1{##1}% % \leavevmode\setcolor{\urlcolor}% \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#1) >>}% \endgroup} \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} \def\maketoks{% \expandafter\poptoks\the\toksA|ENDTOKS|\relax \ifx\first0\adn0 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 \else \ifnum0=\countA\else\makelink\fi \ifx\first.\let\next=\done\else \let\next=\maketoks \addtokens{\toksB}{\the\toksD} \ifx\first,\addtokens{\toksB}{\space}\fi \fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next} \def\makelink{\addtokens{\toksB}% {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} \def\pdflink#1{% \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} \setcolor{\linkcolor}#1\endlink} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} \else % non-pdf mode \let\pdfmkdest = \gobble \let\pdfurl = \gobble \let\endlink = \relax \let\setcolor = \gobble \let\pdfsetcolor = \gobble \let\pdfmakeoutlines = \relax \fi % \ifx\pdfoutput \message{fonts,} % Change the current font style to #1, remembering it in \curfontstyle. % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in % italics, not bold italics. % \def\setfontstyle#1{% \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. \csname ten#1\endcsname % change the current font } % Select #1 fonts with the current style. % \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} \def\rm{\fam=0 \setfontstyle{rm}} \def\it{\fam=\itfam \setfontstyle{it}} \def\sl{\fam=\slfam \setfontstyle{sl}} \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} \def\tt{\fam=\ttfam \setfontstyle{tt}} % Unfortunately, we have to override this for titles and the like, since % in those cases "rm" is bold. Sigh. \def\rmisbold{\rm\def\curfontstyle{bf}} % Texinfo sort of supports the sans serif font style, which plain TeX does not. % So we set up a \sf. \newfam\sffam \def\sf{\fam=\sffam \setfontstyle{sf}} \let\li = \sf % Sometimes we call it \li, not \sf. % We don't need math for this font style. \def\ttsl{\setfontstyle{ttsl}} % Default leading. \newdimen\textleading \textleading = 13.2pt % Set the baselineskip to #1, and the lineskip and strut size % correspondingly. There is no deep meaning behind these magic numbers % used as factors; they just match (closely enough) what Knuth defined. % \def\lineskipfactor{.08333} \def\strutheightpercent{.70833} \def\strutdepthpercent {.29167} % % can get a sort of poor man's double spacing by redefining this. \def\baselinefactor{1} % \def\setleading#1{% \dimen0 = #1\relax \normalbaselineskip = \baselinefactor\dimen0 \normallineskip = \lineskipfactor\normalbaselineskip \normalbaselines \setbox\strutbox =\hbox{% \vrule width0pt height\strutheightpercent\baselineskip depth \strutdepthpercent \baselineskip }% } % PDF CMaps. See also LaTeX's t1.cmap. % % do nothing with this by default. \expandafter\let\csname cmapOT1\endcsname\gobble \expandafter\let\csname cmapOT1IT\endcsname\gobble \expandafter\let\csname cmapOT1TT\endcsname\gobble % if we are producing pdf, and we have \pdffontattr, then define cmaps. % (\pdffontattr was introduced many years ago, but people still run % older pdftex's; it's easy to conditionalize, so we do.) \ifpdf \ifx\pdffontattr\thisisundefined \else \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1-0) %%Title: (TeX-OT1-0 TeX OT1 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1) /Supplement 0 >> def /CMapName /TeX-OT1-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 8 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <23> <26> <0023> <28> <3B> <0028> <3F> <5B> <003F> <5D> <5E> <005D> <61> <7A> <0061> <7B> <7C> <2013> endbfrange 40 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <00660066> <0C> <00660069> <0D> <0066006C> <0E> <006600660069> <0F> <00660066006C> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <21> <0021> <22> <201D> <27> <2019> <3C> <00A1> <3D> <003D> <3E> <00BF> <5C> <201C> <5F> <02D9> <60> <2018> <7D> <02DD> <7E> <007E> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% % % \cmapOT1IT \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1IT-0) %%Title: (TeX-OT1IT-0 TeX OT1IT 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1IT) /Supplement 0 >> def /CMapName /TeX-OT1IT-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 8 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <25> <26> <0025> <28> <3B> <0028> <3F> <5B> <003F> <5D> <5E> <005D> <61> <7A> <0061> <7B> <7C> <2013> endbfrange 42 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <00660066> <0C> <00660069> <0D> <0066006C> <0E> <006600660069> <0F> <00660066006C> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <21> <0021> <22> <201D> <23> <0023> <24> <00A3> <27> <2019> <3C> <00A1> <3D> <003D> <3E> <00BF> <5C> <201C> <5F> <02D9> <60> <2018> <7D> <02DD> <7E> <007E> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1IT\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% % % \cmapOT1TT \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1TT-0) %%Title: (TeX-OT1TT-0 TeX OT1TT 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1TT) /Supplement 0 >> def /CMapName /TeX-OT1TT-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 5 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <21> <26> <0021> <28> <5F> <0028> <61> <7E> <0061> endbfrange 32 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <2191> <0C> <2193> <0D> <0027> <0E> <00A1> <0F> <00BF> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <20> <2423> <27> <2019> <60> <2018> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1TT\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% \fi\fi % Set the font macro #1 to the font named #2, adding on the % specified font prefix (normally `cm'). % #3 is the font's design size, #4 is a scale factor, #5 is the CMap % encoding (currently only OT1, OT1IT and OT1TT are allowed, pass % empty to omit). \def\setfont#1#2#3#4#5{% \font#1=\fontprefix#2#3 scaled #4 \csname cmap#5\endcsname#1% } % This is what gets called when #5 of \setfont is empty. \let\cmap\gobble % emacs-page end of cmaps % Use cm as the default font prefix. % To specify the font prefix, you must define \fontprefix % before you read in texinfo.tex. \ifx\fontprefix\thisisundefined \def\fontprefix{cm} \fi % Support font families that don't use the same naming scheme as CM. \def\rmshape{r} \def\rmbshape{bx} %where the normal face is bold \def\bfshape{b} \def\bxshape{bx} \def\ttshape{tt} \def\ttbshape{tt} \def\ttslshape{sltt} \def\itshape{ti} \def\itbshape{bxti} \def\slshape{sl} \def\slbshape{bxsl} \def\sfshape{ss} \def\sfbshape{ss} \def\scshape{csc} \def\scbshape{csc} % Definitions for a main text size of 11pt. This is the default in % Texinfo. % \def\definetextfontsizexi{% % Text fonts (11.2pt, magstep1). \def\textnominalsize{11pt} \edef\mainmagstep{\magstephalf} \setfont\textrm\rmshape{10}{\mainmagstep}{OT1} \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} \setfont\textbf\bfshape{10}{\mainmagstep}{OT1} \setfont\textit\itshape{10}{\mainmagstep}{OT1IT} \setfont\textsl\slshape{10}{\mainmagstep}{OT1} \setfont\textsf\sfshape{10}{\mainmagstep}{OT1} \setfont\textsc\scshape{10}{\mainmagstep}{OT1} \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep \def\textecsize{1095} % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstep1}{OT1} \setfont\deftt\ttshape{10}{\magstep1}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} \setfont\smallrm\rmshape{9}{1000}{OT1} \setfont\smalltt\ttshape{9}{1000}{OT1TT} \setfont\smallbf\bfshape{10}{900}{OT1} \setfont\smallit\itshape{9}{1000}{OT1IT} \setfont\smallsl\slshape{9}{1000}{OT1} \setfont\smallsf\sfshape{9}{1000}{OT1} \setfont\smallsc\scshape{10}{900}{OT1} \setfont\smallttsl\ttslshape{10}{900}{OT1TT} \font\smalli=cmmi9 \font\smallsy=cmsy9 \def\smallecsize{0900} % Fonts for small examples (8pt). \def\smallernominalsize{8pt} \setfont\smallerrm\rmshape{8}{1000}{OT1} \setfont\smallertt\ttshape{8}{1000}{OT1TT} \setfont\smallerbf\bfshape{10}{800}{OT1} \setfont\smallerit\itshape{8}{1000}{OT1IT} \setfont\smallersl\slshape{8}{1000}{OT1} \setfont\smallersf\sfshape{8}{1000}{OT1} \setfont\smallersc\scshape{10}{800}{OT1} \setfont\smallerttsl\ttslshape{10}{800}{OT1TT} \font\smalleri=cmmi8 \font\smallersy=cmsy8 \def\smallerecsize{0800} % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} \setfont\titleit\itbshape{10}{\magstep4}{OT1IT} \setfont\titlesl\slbshape{10}{\magstep4}{OT1} \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} \setfont\titlesf\sfbshape{17}{\magstep1}{OT1} \let\titlebf=\titlerm \setfont\titlesc\scbshape{10}{\magstep4}{OT1} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\titleecsize{2074} % Chapter (and unnumbered) fonts (17.28pt). \def\chapnominalsize{17pt} \setfont\chaprm\rmbshape{12}{\magstep2}{OT1} \setfont\chapit\itbshape{10}{\magstep3}{OT1IT} \setfont\chapsl\slbshape{10}{\magstep3}{OT1} \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT} \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT} \setfont\chapsf\sfbshape{17}{1000}{OT1} \let\chapbf=\chaprm \setfont\chapsc\scbshape{10}{\magstep3}{OT1} \font\chapi=cmmi12 scaled \magstep2 \font\chapsy=cmsy10 scaled \magstep3 \def\chapecsize{1728} % Section fonts (14.4pt). \def\secnominalsize{14pt} \setfont\secrm\rmbshape{12}{\magstep1}{OT1} \setfont\secit\itbshape{10}{\magstep2}{OT1IT} \setfont\secsl\slbshape{10}{\magstep2}{OT1} \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT} \setfont\secsf\sfbshape{12}{\magstep1}{OT1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep2}{OT1} \font\seci=cmmi12 scaled \magstep1 \font\secsy=cmsy10 scaled \magstep2 \def\sececsize{1440} % Subsection fonts (13.15pt). \def\ssecnominalsize{13pt} \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1} \setfont\ssecit\itbshape{10}{1315}{OT1IT} \setfont\ssecsl\slbshape{10}{1315}{OT1} \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT} \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT} \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{1315}{OT1} \font\sseci=cmmi12 scaled \magstephalf \font\ssecsy=cmsy10 scaled 1315 \def\ssececsize{1200} % Reduced fonts for @acro in text (10pt). \def\reducednominalsize{10pt} \setfont\reducedrm\rmshape{10}{1000}{OT1} \setfont\reducedtt\ttshape{10}{1000}{OT1TT} \setfont\reducedbf\bfshape{10}{1000}{OT1} \setfont\reducedit\itshape{10}{1000}{OT1IT} \setfont\reducedsl\slshape{10}{1000}{OT1} \setfont\reducedsf\sfshape{10}{1000}{OT1} \setfont\reducedsc\scshape{10}{1000}{OT1} \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT} \font\reducedi=cmmi10 \font\reducedsy=cmsy10 \def\reducedecsize{1000} \textleading = 13.2pt % line spacing for 11pt CM \textfonts % reset the current fonts \rm } % end of 11pt text font size definitions % Definitions to make the main text be 10pt Computer Modern, with % section, chapter, etc., sizes following suit. This is for the GNU % Press printing of the Emacs 22 manual. Maybe other manuals in the % future. Used with @smallbook, which sets the leading to 12pt. % \def\definetextfontsizex{% % Text fonts (10pt). \def\textnominalsize{10pt} \edef\mainmagstep{1000} \setfont\textrm\rmshape{10}{\mainmagstep}{OT1} \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} \setfont\textbf\bfshape{10}{\mainmagstep}{OT1} \setfont\textit\itshape{10}{\mainmagstep}{OT1IT} \setfont\textsl\slshape{10}{\mainmagstep}{OT1} \setfont\textsf\sfshape{10}{\mainmagstep}{OT1} \setfont\textsc\scshape{10}{\mainmagstep}{OT1} \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep \def\textecsize{1000} % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstephalf}{OT1} \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} \setfont\smallrm\rmshape{9}{1000}{OT1} \setfont\smalltt\ttshape{9}{1000}{OT1TT} \setfont\smallbf\bfshape{10}{900}{OT1} \setfont\smallit\itshape{9}{1000}{OT1IT} \setfont\smallsl\slshape{9}{1000}{OT1} \setfont\smallsf\sfshape{9}{1000}{OT1} \setfont\smallsc\scshape{10}{900}{OT1} \setfont\smallttsl\ttslshape{10}{900}{OT1TT} \font\smalli=cmmi9 \font\smallsy=cmsy9 \def\smallecsize{0900} % Fonts for small examples (8pt). \def\smallernominalsize{8pt} \setfont\smallerrm\rmshape{8}{1000}{OT1} \setfont\smallertt\ttshape{8}{1000}{OT1TT} \setfont\smallerbf\bfshape{10}{800}{OT1} \setfont\smallerit\itshape{8}{1000}{OT1IT} \setfont\smallersl\slshape{8}{1000}{OT1} \setfont\smallersf\sfshape{8}{1000}{OT1} \setfont\smallersc\scshape{10}{800}{OT1} \setfont\smallerttsl\ttslshape{10}{800}{OT1TT} \font\smalleri=cmmi8 \font\smallersy=cmsy8 \def\smallerecsize{0800} % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} \setfont\titleit\itbshape{10}{\magstep4}{OT1IT} \setfont\titlesl\slbshape{10}{\magstep4}{OT1} \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} \setfont\titlesf\sfbshape{17}{\magstep1}{OT1} \let\titlebf=\titlerm \setfont\titlesc\scbshape{10}{\magstep4}{OT1} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\titleecsize{2074} % Chapter fonts (14.4pt). \def\chapnominalsize{14pt} \setfont\chaprm\rmbshape{12}{\magstep1}{OT1} \setfont\chapit\itbshape{10}{\magstep2}{OT1IT} \setfont\chapsl\slbshape{10}{\magstep2}{OT1} \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT} \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT} \setfont\chapsf\sfbshape{12}{\magstep1}{OT1} \let\chapbf\chaprm \setfont\chapsc\scbshape{10}{\magstep2}{OT1} \font\chapi=cmmi12 scaled \magstep1 \font\chapsy=cmsy10 scaled \magstep2 \def\chapecsize{1440} % Section fonts (12pt). \def\secnominalsize{12pt} \setfont\secrm\rmbshape{12}{1000}{OT1} \setfont\secit\itbshape{10}{\magstep1}{OT1IT} \setfont\secsl\slbshape{10}{\magstep1}{OT1} \setfont\sectt\ttbshape{12}{1000}{OT1TT} \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT} \setfont\secsf\sfbshape{12}{1000}{OT1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep1}{OT1} \font\seci=cmmi12 \font\secsy=cmsy10 scaled \magstep1 \def\sececsize{1200} % Subsection fonts (10pt). \def\ssecnominalsize{10pt} \setfont\ssecrm\rmbshape{10}{1000}{OT1} \setfont\ssecit\itbshape{10}{1000}{OT1IT} \setfont\ssecsl\slbshape{10}{1000}{OT1} \setfont\ssectt\ttbshape{10}{1000}{OT1TT} \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT} \setfont\ssecsf\sfbshape{10}{1000}{OT1} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{1000}{OT1} \font\sseci=cmmi10 \font\ssecsy=cmsy10 \def\ssececsize{1000} % Reduced fonts for @acro in text (9pt). \def\reducednominalsize{9pt} \setfont\reducedrm\rmshape{9}{1000}{OT1} \setfont\reducedtt\ttshape{9}{1000}{OT1TT} \setfont\reducedbf\bfshape{10}{900}{OT1} \setfont\reducedit\itshape{9}{1000}{OT1IT} \setfont\reducedsl\slshape{9}{1000}{OT1} \setfont\reducedsf\sfshape{9}{1000}{OT1} \setfont\reducedsc\scshape{10}{900}{OT1} \setfont\reducedttsl\ttslshape{10}{900}{OT1TT} \font\reducedi=cmmi9 \font\reducedsy=cmsy9 \def\reducedecsize{0900} \divide\parskip by 2 % reduce space between paragraphs \textleading = 12pt % line spacing for 10pt CM \textfonts % reset the current fonts \rm } % end of 10pt text font size definitions % We provide the user-level command % @fonttextsize 10 % (or 11) to redefine the text font size. pt is assumed. % \def\xiword{11} \def\xword{10} \def\xwordpt{10pt} % \parseargdef\fonttextsize{% \def\textsizearg{#1}% %\wlog{doing @fonttextsize \textsizearg}% % % Set \globaldefs so that documents can use this inside @tex, since % makeinfo 4.8 does not support it, but we need it nonetheless. % \begingroup \globaldefs=1 \ifx\textsizearg\xword \definetextfontsizex \else \ifx\textsizearg\xiword \definetextfontsizexi \else \errhelp=\EMsimple \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} \fi\fi \endgroup } % In order for the font changes to affect most math symbols and letters, % we have to define the \textfont of the standard families. Since % texinfo doesn't allow for producing subscripts and superscripts except % in the main text, we don't bother to reset \scriptfont and % \scriptscriptfont (which would also require loading a lot more fonts). % \def\resetmathfonts{% \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf \textfont\ttfam=\tentt \textfont\sffam=\tensf } % The font-changing commands redefine the meanings of \tenSTYLE, instead % of just \STYLE. We do this because \STYLE needs to also set the % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire % \tenSTYLE to set the current font. % % Each font-changing command also sets the names \lsize (one size lower) % and \lllsize (three sizes lower). These relative commands are used in % the LaTeX logo and acronyms. % % This all needs generalizing, badly. % \def\textfonts{% \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl \def\curfontsize{text}% \def\lsize{reduced}\def\lllsize{smaller}% \resetmathfonts \setleading{\textleading}} \def\titlefonts{% \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy \let\tenttsl=\titlettsl \def\curfontsize{title}% \def\lsize{chap}\def\lllsize{subsec}% \resetmathfonts \setleading{27pt}} \def\titlefont#1{{\titlefonts\rmisbold #1}} \def\chapfonts{% \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl \def\curfontsize{chap}% \def\lsize{sec}\def\lllsize{text}% \resetmathfonts \setleading{19pt}} \def\secfonts{% \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl \def\curfontsize{sec}% \def\lsize{subsec}\def\lllsize{reduced}% \resetmathfonts \setleading{16pt}} \def\subsecfonts{% \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl \def\curfontsize{ssec}% \def\lsize{text}\def\lllsize{small}% \resetmathfonts \setleading{15pt}} \let\subsubsecfonts = \subsecfonts \def\reducedfonts{% \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy \let\tenttsl=\reducedttsl \def\curfontsize{reduced}% \def\lsize{small}\def\lllsize{smaller}% \resetmathfonts \setleading{10.5pt}} \def\smallfonts{% \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy \let\tenttsl=\smallttsl \def\curfontsize{small}% \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{10.5pt}} \def\smallerfonts{% \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy \let\tenttsl=\smallerttsl \def\curfontsize{smaller}% \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{9.5pt}} % Fonts for short table of contents. \setfont\shortcontrm\rmshape{12}{1000}{OT1} \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 \setfont\shortcontsl\slshape{12}{1000}{OT1} \setfont\shortconttt\ttshape{12}{1000}{OT1TT} % Define these just so they can be easily changed for other fonts. \def\angleleft{$\langle$} \def\angleright{$\rangle$} % Set the fonts to use with the @small... environments. \let\smallexamplefonts = \smallfonts % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample % can fit this many characters: % 8.5x11=86 smallbook=72 a4=90 a5=69 % If we use \scriptfonts (8pt), then we can fit this many characters: % 8.5x11=90+ smallbook=80 a4=90+ a5=77 % For me, subjectively, the few extra characters that fit aren't worth % the additional smallness of 8pt. So I'm making the default 9pt. % % By the way, for comparison, here's what fits with @example (10pt): % 8.5x11=71 smallbook=60 a4=75 a5=58 % --karl, 24jan03. % Set up the default fonts, so we can use them for creating boxes. % \definetextfontsizexi \message{markup,} % Check if we are currently using a typewriter font. Since all the % Computer Modern typewriter fonts have zero interword stretch (and % shrink), and it is reasonable to expect all typewriter fonts to have % this property, we can check that font parameter. % \def\ifmonospace{\ifdim\fontdimen3\font=0pt } % Markup style infrastructure. \defmarkupstylesetup\INITMACRO will % define and register \INITMACRO to be called on markup style changes. % \INITMACRO can check \currentmarkupstyle for the innermost % style and the set of \ifmarkupSTYLE switches for all styles % currently in effect. \newif\ifmarkupvar \newif\ifmarkupsamp \newif\ifmarkupkey %\newif\ifmarkupfile % @file == @samp. %\newif\ifmarkupoption % @option == @samp. \newif\ifmarkupcode \newif\ifmarkupkbd %\newif\ifmarkupenv % @env == @code. %\newif\ifmarkupcommand % @command == @code. \newif\ifmarkuptex % @tex (and part of @math, for now). \newif\ifmarkupexample \newif\ifmarkupverb \newif\ifmarkupverbatim \let\currentmarkupstyle\empty \def\setupmarkupstyle#1{% \csname markup#1true\endcsname \def\currentmarkupstyle{#1}% \markupstylesetup } \let\markupstylesetup\empty \def\defmarkupstylesetup#1{% \expandafter\def\expandafter\markupstylesetup \expandafter{\markupstylesetup #1}% \def#1% } % Markup style setup for left and right quotes. \defmarkupstylesetup\markupsetuplq{% \expandafter\let\expandafter \temp \csname markupsetuplq\currentmarkupstyle\endcsname \ifx\temp\relax \markupsetuplqdefault \else \temp \fi } \defmarkupstylesetup\markupsetuprq{% \expandafter\let\expandafter \temp \csname markupsetuprq\currentmarkupstyle\endcsname \ifx\temp\relax \markupsetuprqdefault \else \temp \fi } { \catcode`\'=\active \catcode`\`=\active \gdef\markupsetuplqdefault{\let`\lq} \gdef\markupsetuprqdefault{\let'\rq} \gdef\markupsetcodequoteleft{\let`\codequoteleft} \gdef\markupsetcodequoteright{\let'\codequoteright} \gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft} } \let\markupsetuplqcode \markupsetcodequoteleft \let\markupsetuprqcode \markupsetcodequoteright % \let\markupsetuplqexample \markupsetcodequoteleft \let\markupsetuprqexample \markupsetcodequoteright % \let\markupsetuplqsamp \markupsetcodequoteleft \let\markupsetuprqsamp \markupsetcodequoteright % \let\markupsetuplqverb \markupsetcodequoteleft \let\markupsetuprqverb \markupsetcodequoteright % \let\markupsetuplqverbatim \markupsetcodequoteleft \let\markupsetuprqverbatim \markupsetcodequoteright \let\markupsetuplqkbd \markupsetnoligaturesquoteleft % Allow an option to not use regular directed right quote/apostrophe % (char 0x27), but instead the undirected quote from cmtt (char 0x0d). % The undirected quote is ugly, so don't make it the default, but it % works for pasting with more pdf viewers (at least evince), the % lilypond developers report. xpdf does work with the regular 0x27. % \def\codequoteright{% \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax '% \else \char'15 \fi \else \char'15 \fi } % % and a similar option for the left quote char vs. a grave accent. % Modern fonts display ASCII 0x60 as a grave accent, so some people like % the code environments to do likewise. % \def\codequoteleft{% \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax % [Knuth] pp. 380,381,391 % \relax disables Spanish ligatures ?` and !` of \tt font. \relax`% \else \char'22 \fi \else \char'22 \fi } % Commands to set the quote options. % \parseargdef\codequoteundirected{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETtxicodequoteundirected\endcsname = t% \else\ifx\temp\offword \expandafter\let\csname SETtxicodequoteundirected\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}% \fi\fi } % \parseargdef\codequotebacktick{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETtxicodequotebacktick\endcsname = t% \else\ifx\temp\offword \expandafter\let\csname SETtxicodequotebacktick\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}% \fi\fi } % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. \def\noligaturesquoteleft{\relax\lq} % Count depth in font-changes, for error checks \newcount\fontdepth \fontdepth=0 % Font commands. % #1 is the font command (\sl or \it), #2 is the text to slant. % If we are in a monospaced environment, however, 1) always use \ttsl, % and 2) do not add an italic correction. \def\dosmartslant#1#2{% \ifusingtt {{\ttsl #2}\let\next=\relax}% {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}% \next } \def\smartslanted{\dosmartslant\sl} \def\smartitalic{\dosmartslant\it} % Output an italic correction unless \next (presumed to be the following % character) is such as not to need one. \def\smartitaliccorrection{% \ifx\next,% \else\ifx\next-% \else\ifx\next.% \else\ptexslash \fi\fi\fi \aftersmartic } % like \smartslanted except unconditionally uses \ttsl, and no ic. % @var is set to this for defun arguments. \def\ttslanted#1{{\ttsl #1}} % @cite is like \smartslanted except unconditionally use \sl. We never want % ttsl for book titles, do we? \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection} \def\aftersmartic{} \def\var#1{% \let\saveaftersmartic = \aftersmartic \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}% \smartslanted{#1}% } \let\i=\smartitalic \let\slanted=\smartslanted \let\dfn=\smartslanted \let\emph=\smartitalic % Explicit font changes: @r, @sc, undocumented @ii. \def\r#1{{\rm #1}} % roman font \def\sc#1{{\smallcaps#1}} % smallcaps font \def\ii#1{{\it #1}} % italic font % @b, explicit bold. Also @strong. \def\b#1{{\bf #1}} \let\strong=\b % @sansserif, explicit sans. \def\sansserif#1{{\sf #1}} % We can't just use \exhyphenpenalty, because that only has effect at % the end of a paragraph. Restore normal hyphenation at the end of the % group within which \nohyphenation is presumably called. % \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} \def\restorehyphenation{\hyphenchar\font = `- } % Set sfcode to normal for the chars that usually have another value. % Can't use plain's \frenchspacing because it uses the `\x notation, and % sometimes \x has an active definition that messes things up. % \catcode`@=11 \def\plainfrenchspacing{% \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m \def\endofsentencespacefactor{1000}% for @. and friends } \def\plainnonfrenchspacing{% \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 \def\endofsentencespacefactor{3000}% for @. and friends } \catcode`@=\other \def\endofsentencespacefactor{3000}% default % @t, explicit typewriter. \def\t#1{% {\tt \rawbackslash \plainfrenchspacing #1}% \null } % @samp. \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}} % definition of @key that produces a lozenge. Doesn't adjust to text size. %\setfont\keyrm\rmshape{8}{1000}{OT1} %\font\keysy=cmsy9 %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% % \vbox{\hrule\kern-0.4pt % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% % \kern-0.4pt\hrule}% % \kern-.06em\raise0.4pt\hbox{\angleright}}}} % definition of @key with no lozenge. If the current font is already % monospace, don't change it; that way, we respect @kbdinputstyle. But % if it isn't monospace, then use \tt. % \def\key#1{{\setupmarkupstyle{key}% \nohyphenation \ifmonospace\else\tt\fi #1}\null} % ctrl is no longer a Texinfo command. \def\ctrl #1{{\tt \rawbackslash \hat}#1} % @file, @option are the same as @samp. \let\file=\samp \let\option=\samp % @code is a modification of @t, % which makes spaces the same size as normal in the surrounding text. \def\tclose#1{% {% % Change normal interword space to be same as for the current font. \spaceskip = \fontdimen2\font % % Switch to typewriter. \tt % % But `\ ' produces the large typewriter interword space. \def\ {{\spaceskip = 0pt{} }}% % % Turn off hyphenation. \nohyphenation % \rawbackslash \plainfrenchspacing #1% }% \null % reset spacefactor to 1000 } % We *must* turn on hyphenation at `-' and `_' in @code. % Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. % Unfortunately, TeX uses one parameter (\hyphenchar) to control % both hyphenation at - and hyphenation within words. % We must therefore turn them both off (\tclose does that) % and arrange explicitly to hyphenate at a dash. % -- rms. { \catcode`\-=\active \catcode`\_=\active \catcode`\'=\active \catcode`\`=\active \global\let'=\rq \global\let`=\lq % default definitions % \global\def\code{\begingroup \setupmarkupstyle{code}% % The following should really be moved into \setupmarkupstyle handlers. \catcode\dashChar=\active \catcode\underChar=\active \ifallowcodebreaks \let-\codedash \let_\codeunder \else \let-\realdash \let_\realunder \fi \codex } } \def\codex #1{\tclose{#1}\endgroup} \def\realdash{-} \def\codedash{-\discretionary{}{}{}} \def\codeunder{% % this is all so @math{@code{var_name}+1} can work. In math mode, _ % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) % will therefore expand the active definition of _, which is us % (inside @code that is), therefore an endless loop. \ifusingtt{\ifmmode \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. \else\normalunderscore \fi \discretionary{}{}{}}% {\_}% } % An additional complication: the above will allow breaks after, e.g., % each of the four underscores in __typeof__. This is undesirable in % some manuals, especially if they don't have long identifiers in % general. @allowcodebreaks provides a way to control this. % \newif\ifallowcodebreaks \allowcodebreakstrue \def\keywordtrue{true} \def\keywordfalse{false} \parseargdef\allowcodebreaks{% \def\txiarg{#1}% \ifx\txiarg\keywordtrue \allowcodebreakstrue \else\ifx\txiarg\keywordfalse \allowcodebreaksfalse \else \errhelp = \EMsimple \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}% \fi\fi } % @uref (abbreviation for `urlref') takes an optional (comma-separated) % second argument specifying the text to display and an optional third % arg as text to display instead of (rather than in addition to) the url % itself. First (mandatory) arg is the url. % (This \urefnobreak definition isn't used now, leaving it for a while % for comparison.) \def\urefnobreak#1{\dourefnobreak #1,,,\finish} \def\dourefnobreak#1,#2,#3,#4\finish{\begingroup \unsepspaces \pdfurl{#1}% \setbox0 = \hbox{\ignorespaces #3}% \ifdim\wd0 > 0pt \unhbox0 % third arg given, show only that \else \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \ifpdf \unhbox0 % PDF: 2nd arg given, show only it \else \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url \fi \else \code{#1}% only url given, so show it \fi \fi \endlink \endgroup} % This \urefbreak definition is the active one. \def\urefbreak{\begingroup \urefcatcodes \dourefbreak} \let\uref=\urefbreak \def\dourefbreak#1{\urefbreakfinish #1,,,\finish} \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example \unsepspaces \pdfurl{#1}% \setbox0 = \hbox{\ignorespaces #3}% \ifdim\wd0 > 0pt \unhbox0 % third arg given, show only that \else \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \ifpdf \unhbox0 % PDF: 2nd arg given, show only it \else \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url \fi \else \urefcode{#1}% only url given, so show it \fi \fi \endlink \endgroup} % Allow line breaks around only a few characters (only). \def\urefcatcodes{% \catcode\ampChar=\active \catcode\dotChar=\active \catcode\hashChar=\active \catcode\questChar=\active \catcode\slashChar=\active } { \urefcatcodes % \global\def\urefcode{\begingroup \setupmarkupstyle{code}% \urefcatcodes \let&\urefcodeamp \let.\urefcodedot \let#\urefcodehash \let?\urefcodequest \let/\urefcodeslash \codex } % % By default, they are just regular characters. \global\def&{\normalamp} \global\def.{\normaldot} \global\def#{\normalhash} \global\def?{\normalquest} \global\def/{\normalslash} } % we put a little stretch before and after the breakable chars, to help % line breaking of long url's. The unequal skips make look better in % cmtt at least, especially for dots. \def\urefprestretch{\urefprebreak \hskip0pt plus.13em } \def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em } % \def\urefcodeamp{\urefprestretch \&\urefpoststretch} \def\urefcodedot{\urefprestretch .\urefpoststretch} \def\urefcodehash{\urefprestretch \#\urefpoststretch} \def\urefcodequest{\urefprestretch ?\urefpoststretch} \def\urefcodeslash{\futurelet\next\urefcodeslashfinish} { \catcode`\/=\active \global\def\urefcodeslashfinish{% \urefprestretch \slashChar % Allow line break only after the final / in a sequence of % slashes, to avoid line break between the slashes in http://. \ifx\next/\else \urefpoststretch \fi } } % One more complication: by default we'll break after the special % characters, but some people like to break before the special chars, so % allow that. Also allow no breaking at all, for manual control. % \parseargdef\urefbreakstyle{% \def\txiarg{#1}% \ifx\txiarg\wordnone \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak} \else\ifx\txiarg\wordbefore \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak} \else\ifx\txiarg\wordafter \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak} \else \errhelp = \EMsimple \errmessage{Unknown @urefbreakstyle setting `\txiarg'}% \fi\fi\fi } \def\wordafter{after} \def\wordbefore{before} \def\wordnone{none} \urefbreakstyle after % @url synonym for @uref, since that's how everyone uses it. % \let\url=\uref % rms does not like angle brackets --karl, 17may97. % So now @email is just like @uref, unless we are pdf. % %\def\email#1{\angleleft{\tt #1}\angleright} \ifpdf \def\email#1{\doemail#1,,\finish} \def\doemail#1,#2,#3\finish{\begingroup \unsepspaces \pdfurl{mailto:#1}% \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi \endlink \endgroup} \else \let\email=\uref \fi % @kbd is like @code, except that if the argument is just one @key command, % then @kbd has no effect. \def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}} % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), % `example' (@kbd uses ttsl only inside of @example and friends), % or `code' (@kbd uses normal tty font always). \parseargdef\kbdinputstyle{% \def\txiarg{#1}% \ifx\txiarg\worddistinct \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% \else\ifx\txiarg\wordexample \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% \else\ifx\txiarg\wordcode \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% \else \errhelp = \EMsimple \errmessage{Unknown @kbdinputstyle setting `\txiarg'}% \fi\fi\fi } \def\worddistinct{distinct} \def\wordexample{example} \def\wordcode{code} % Default is `distinct'. \kbdinputstyle distinct \def\xkey{\key} \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% \ifx\one\xkey\ifx\threex\three \key{#2}% \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi} % For @indicateurl, @env, @command quotes seem unnecessary, so use \code. \let\indicateurl=\code \let\env=\code \let\command=\code % @clicksequence{File @click{} Open ...} \def\clicksequence#1{\begingroup #1\endgroup} % @clickstyle @arrow (by default) \parseargdef\clickstyle{\def\click{#1}} \def\click{\arrow} % Typeset a dimension, e.g., `in' or `pt'. The only reason for the % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. % \def\dmn#1{\thinspace #1} % @l was never documented to mean ``switch to the Lisp font'', % and it is not used as such in any manual I can find. We need it for % Polish suppressed-l. --karl, 22sep96. %\def\l#1{{\li #1}\null} % @acronym for "FBI", "NATO", and the like. % We print this one point size smaller, since it's intended for % all-uppercase. % \def\acronym#1{\doacronym #1,,\finish} \def\doacronym#1,#2,#3\finish{% {\selectfonts\lsize #1}% \def\temp{#2}% \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% \fi \null % reset \spacefactor=1000 } % @abbr for "Comput. J." and the like. % No font change, but don't do end-of-sentence spacing. % \def\abbr#1{\doabbr #1,,\finish} \def\doabbr#1,#2,#3\finish{% {\plainfrenchspacing #1}% \def\temp{#2}% \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% \fi \null % reset \spacefactor=1000 } % @asis just yields its argument. Used with @table, for example. % \def\asis#1{#1} % @math outputs its argument in math mode. % % One complication: _ usually means subscripts, but it could also mean % an actual _ character, as in @math{@var{some_variable} + 1}. So make % _ active, and distinguish by seeing if the current family is \slfam, % which is what @var uses. { \catcode`\_ = \active \gdef\mathunderscore{% \catcode`\_=\active \def_{\ifnum\fam=\slfam \_\else\sb\fi}% } } % Another complication: we want \\ (and @\) to output a math (or tt) \. % FYI, plain.tex uses \\ as a temporary control sequence (for no % particular reason), but this is not advertised and we don't care. % % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} % \def\math{% \tex \mathunderscore \let\\ = \mathbackslash \mathactive % make the texinfo accent commands work in math mode \let\"=\ddot \let\'=\acute \let\==\bar \let\^=\hat \let\`=\grave \let\u=\breve \let\v=\check \let\~=\tilde \let\dotaccent=\dot $\finishmath } \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. % Some active characters (such as <) are spaced differently in math. % We have to reset their definitions in case the @math was an argument % to a command which sets the catcodes (such as @item or @section). % { \catcode`^ = \active \catcode`< = \active \catcode`> = \active \catcode`+ = \active \catcode`' = \active \gdef\mathactive{% \let^ = \ptexhat \let< = \ptexless \let> = \ptexgtr \let+ = \ptexplus \let' = \ptexquoteright } } % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. % Ignore unless FMTNAME == tex; then it is like @iftex and @tex, % except specified as a normal braced arg, so no newlines to worry about. % \def\outfmtnametex{tex} % \def\inlinefmt#1{\doinlinefmt #1,\finish} \def\doinlinefmt#1,#2,\finish{% \def\inlinefmtname{#1}% \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi } % For raw, must switch into @tex before parsing the argument, to avoid % setting catcodes prematurely. Doing it this way means that, for % example, @inlineraw{html, foo{bar} gets a parse error instead of being % ignored. But this isn't important because if people want a literal % *right* brace they would have to use a command anyway, so they may as % well use a command to get a left brace too. We could re-use the % delimiter character idea from \verb, but it seems like overkill. % \def\inlineraw{\tex \doinlineraw} \def\doinlineraw#1{\doinlinerawtwo #1,\finish} \def\doinlinerawtwo#1,#2,\finish{% \def\inlinerawname{#1}% \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi \endgroup % close group opened by \tex. } \message{glyphs,} % and logos. % @@ prints an @, as does @atchar{}. \def\@{\char64 } \let\atchar=\@ % @{ @} @lbracechar{} @rbracechar{} all generate brace characters. % Unless we're in typewriter, use \ecfont because the CM text fonts do % not have braces, and we don't want to switch into math. \def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}} \def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}} \let\{=\mylbrace \let\lbracechar=\{ \let\}=\myrbrace \let\rbracechar=\} \begingroup % Definitions to produce \{ and \} commands for indices, % and @{ and @} for the aux/toc files. \catcode`\{ = \other \catcode`\} = \other \catcode`\[ = 1 \catcode`\] = 2 \catcode`\! = 0 \catcode`\\ = \other !gdef!lbracecmd[\{]% !gdef!rbracecmd[\}]% !gdef!lbraceatcmd[@{]% !gdef!rbraceatcmd[@}]% !endgroup % @comma{} to avoid , parsing problems. \let\comma = , % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. \let\, = \ptexc \let\dotaccent = \ptexdot \def\ringaccent#1{{\accent23 #1}} \let\tieaccent = \ptext \let\ubaraccent = \ptexb \let\udotaccent = \d % Other special characters: @questiondown @exclamdown @ordf @ordm % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. \def\questiondown{?`} \def\exclamdown{!`} \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} % Dotless i and dotless j, used for accents. \def\imacro{i} \def\jmacro{j} \def\dotless#1{% \def\temp{#1}% \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi \else \errmessage{@dotless can be used only with i or j}% \fi\fi } % The \TeX{} logo, as in plain, but resetting the spacing so that a % period following counts as ending a sentence. (Idea found in latex.) % \edef\TeX{\TeX \spacefactor=1000 } % @LaTeX{} logo. Not quite the same results as the definition in % latex.ltx, since we use a different font for the raised A; it's most % convenient for us to use an explicitly smaller font, rather than using % the \scriptstyle font (since we don't reset \scriptstyle and % \scriptscriptstyle). % \def\LaTeX{% L\kern-.36em {\setbox0=\hbox{T}% \vbox to \ht0{\hbox{% \ifx\textnominalsize\xwordpt % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX. % Revert to plain's \scriptsize, which is 7pt. \count255=\the\fam $\fam\count255 \scriptstyle A$% \else % For 11pt, we can use our lllsize. \selectfonts\lllsize A% \fi }% \vss }}% \kern-.15em \TeX } % Some math mode symbols. \def\bullet{$\ptexbullet$} \def\geq{\ifmmode \ge\else $\ge$\fi} \def\leq{\ifmmode \le\else $\le$\fi} \def\minus{\ifmmode -\else $-$\fi} % @dots{} outputs an ellipsis using the current font. % We do .5em per period so that it has the same spacing in the cm % typewriter fonts as three actual period characters; on the other hand, % in other typewriter fonts three periods are wider than 1.5em. So do % whichever is larger. % \def\dots{% \leavevmode \setbox0=\hbox{...}% get width of three periods \ifdim\wd0 > 1.5em \dimen0 = \wd0 \else \dimen0 = 1.5em \fi \hbox to \dimen0{% \hskip 0pt plus.25fil .\hskip 0pt plus1fil .\hskip 0pt plus1fil .\hskip 0pt plus.5fil }% } % @enddots{} is an end-of-sentence ellipsis. % \def\enddots{% \dots \spacefactor=\endofsentencespacefactor } % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. % % Since these characters are used in examples, they should be an even number of % \tt widths. Each \tt character is 1en, so two makes it 1em. % \def\point{$\star$} \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}} \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}} \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}} % The @error{} command. % Adapted from the TeXbook's \boxit. % \newbox\errorbox % {\tentt \global\dimen0 = 3em}% Width of the box. \dimen2 = .55pt % Thickness of rules % The text. (`r' is open on the right, `e' somewhat less so on the left.) \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} % \setbox\errorbox=\hbox to \dimen0{\hfil \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. \advance\hsize by -2\dimen2 % Rules. \vbox{% \hrule height\dimen2 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. \kern3pt\vrule width\dimen2}% Space to right. \hrule height\dimen2} \hfil} % \def\error{\leavevmode\lower.7ex\copy\errorbox} % @pounds{} is a sterling sign, which Knuth put in the CM italic font. % \def\pounds{{\it\$}} % @euro{} comes from a separate font, depending on the current style. % We use the free feym* fonts from the eurosym package by Henrik % Theiling, which support regular, slanted, bold and bold slanted (and % "outlined" (blackboard board, sort of) versions, which we don't need). % It is available from http://www.ctan.org/tex-archive/fonts/eurosym. % % Although only regular is the truly official Euro symbol, we ignore % that. The Euro is designed to be slightly taller than the regular % font height. % % feymr - regular % feymo - slanted % feybr - bold % feybo - bold slanted % % There is no good (free) typewriter version, to my knowledge. % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. % Hmm. % % Also doesn't work in math. Do we need to do math with euro symbols? % Hope not. % % \def\euro{{\eurofont e}} \def\eurofont{% % We set the font at each command, rather than predefining it in % \textfonts and the other font-switching commands, so that % installations which never need the symbol don't have to have the % font installed. % % There is only one designed size (nominal 10pt), so we always scale % that to the current nominal size. % % By the way, simply using "at 1em" works for cmr10 and the like, but % does not work for cmbx10 and other extended/shrunken fonts. % \def\eurosize{\csname\curfontsize nominalsize\endcsname}% % \ifx\curfontstyle\bfstylename % bold: \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize \else % regular: \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize \fi \thiseurofont } % Glyphs from the EC fonts. We don't use \let for the aliases, because % sometimes we redefine the original macro, and the alias should reflect % the redefinition. % % Use LaTeX names for the Icelandic letters. \def\DH{{\ecfont \char"D0}} % Eth \def\dh{{\ecfont \char"F0}} % eth \def\TH{{\ecfont \char"DE}} % Thorn \def\th{{\ecfont \char"FE}} % thorn % \def\guillemetleft{{\ecfont \char"13}} \def\guillemotleft{\guillemetleft} \def\guillemetright{{\ecfont \char"14}} \def\guillemotright{\guillemetright} \def\guilsinglleft{{\ecfont \char"0E}} \def\guilsinglright{{\ecfont \char"0F}} \def\quotedblbase{{\ecfont \char"12}} \def\quotesinglbase{{\ecfont \char"0D}} % % This positioning is not perfect (see the ogonek LaTeX package), but % we have the precomposed glyphs for the most common cases. We put the % tests to use those glyphs in the single \ogonek macro so we have fewer % dummy definitions to worry about for index entries, etc. % % ogonek is also used with other letters in Lithuanian (IOU), but using % the precomposed glyphs for those is not so easy since they aren't in % the same EC font. \def\ogonek#1{{% \def\temp{#1}% \ifx\temp\macrocharA\Aogonek \else\ifx\temp\macrochara\aogonek \else\ifx\temp\macrocharE\Eogonek \else\ifx\temp\macrochare\eogonek \else \ecfont \setbox0=\hbox{#1}% \ifdim\ht0=1ex\accent"0C #1% \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}% \fi \fi\fi\fi\fi }% } \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A} \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a} \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E} \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e} % % Use the ec* fonts (cm-super in outline format) for non-CM glyphs. \def\ecfont{% % We can't distinguish serif/sans and italic/slanted, but this % is used for crude hacks anyway (like adding French and German % quotes to documents typeset with CM, where we lose kerning), so % hopefully nobody will notice/care. \edef\ecsize{\csname\curfontsize ecsize\endcsname}% \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% \ifx\curfontstyle\bfstylename % bold: \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize \else % regular: \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize \fi \thisecfont } % @registeredsymbol - R in a circle. The font for the R should really % be smaller yet, but lllsize is the best we can do for now. % Adapted from the plain.tex definition of \copyright. % \def\registeredsymbol{% $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% \hfil\crcr\Orb}}% }$% } % @textdegree - the normal degrees sign. % \def\textdegree{$^\circ$} % Laurent Siebenmann reports \Orb undefined with: % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 % so we'll define it if necessary. % \ifx\Orb\thisisundefined \def\Orb{\mathhexbox20D} \fi % Quotes. \chardef\quotedblleft="5C \chardef\quotedblright=`\" \chardef\quoteleft=`\` \chardef\quoteright=`\' \message{page headings,} \newskip\titlepagetopglue \titlepagetopglue = 1.5in \newskip\titlepagebottomglue \titlepagebottomglue = 2pc % First the title page. Must do @settitle before @titlepage. \newif\ifseenauthor \newif\iffinishedtitlepage % Do an implicit @contents or @shortcontents after @end titlepage if the % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. % \newif\ifsetcontentsaftertitlepage \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue \newif\ifsetshortcontentsaftertitlepage \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue \parseargdef\shorttitlepage{% \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}% \endgroup\page\hbox{}\page} \envdef\titlepage{% % Open one extra group, as we want to close it in the middle of \Etitlepage. \begingroup \parindent=0pt \textfonts % Leave some space at the very top of the page. \vglue\titlepagetopglue % No rule at page bottom unless we print one at the top with @title. \finishedtitlepagetrue % % Most title ``pages'' are actually two pages long, with space % at the top of the second. We don't want the ragged left on the second. \let\oldpage = \page \def\page{% \iffinishedtitlepage\else \finishtitlepage \fi \let\page = \oldpage \page \null }% } \def\Etitlepage{% \iffinishedtitlepage\else \finishtitlepage \fi % It is important to do the page break before ending the group, % because the headline and footline are only empty inside the group. % If we use the new definition of \page, we always get a blank page % after the title page, which we certainly don't want. \oldpage \endgroup % % Need this before the \...aftertitlepage checks so that if they are % in effect the toc pages will come out with page numbers. \HEADINGSon % % If they want short, they certainly want long too. \ifsetshortcontentsaftertitlepage \shortcontents \contents \global\let\shortcontents = \relax \global\let\contents = \relax \fi % \ifsetcontentsaftertitlepage \contents \global\let\contents = \relax \global\let\shortcontents = \relax \fi } \def\finishtitlepage{% \vskip4pt \hrule height 2pt width \hsize \vskip\titlepagebottomglue \finishedtitlepagetrue } % Macros to be used within @titlepage: \let\subtitlerm=\tenrm \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} \parseargdef\title{% \checkenv\titlepage \leftline{\titlefonts\rmisbold #1} % print a rule at the page bottom also. \finishedtitlepagefalse \vskip4pt \hrule height 4pt width \hsize \vskip4pt } \parseargdef\subtitle{% \checkenv\titlepage {\subtitlefont \rightline{#1}}% } % @author should come last, but may come many times. % It can also be used inside @quotation. % \parseargdef\author{% \def\temp{\quotation}% \ifx\thisenv\temp \def\quotationauthor{#1}% printed in \Equotation. \else \checkenv\titlepage \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi {\secfonts\rmisbold \leftline{#1}}% \fi } % Set up page headings and footings. \let\thispage=\folio \newtoks\evenheadline % headline on even pages \newtoks\oddheadline % headline on odd pages \newtoks\evenfootline % footline on even pages \newtoks\oddfootline % footline on odd pages % Now make TeX use those variables \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}} \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}\HEADINGShook} \let\HEADINGShook=\relax % Commands to set those variables. % For example, this is what @headings on does % @evenheading @thistitle|@thispage|@thischapter % @oddheading @thischapter|@thispage|@thistitle % @evenfooting @thisfile|| % @oddfooting ||@thisfile \def\evenheading{\parsearg\evenheadingxxx} \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} \def\evenheadingyyy #1\|#2\|#3\|#4\finish{% \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \def\oddheading{\parsearg\oddheadingxxx} \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} \def\oddheadingyyy #1\|#2\|#3\|#4\finish{% \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% \def\evenfooting{\parsearg\evenfootingxxx} \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} \def\evenfootingyyy #1\|#2\|#3\|#4\finish{% \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \def\oddfooting{\parsearg\oddfootingxxx} \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} \def\oddfootingyyy #1\|#2\|#3\|#4\finish{% \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% % % Leave some space for the footline. Hopefully ok to assume % @evenfooting will not be used by itself. \global\advance\pageheight by -12pt \global\advance\vsize by -12pt } \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} % @evenheadingmarks top \thischapter <- chapter at the top of a page % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page % % The same set of arguments for: % % @oddheadingmarks % @evenfootingmarks % @oddfootingmarks % @everyheadingmarks % @everyfootingmarks \def\evenheadingmarks{\headingmarks{even}{heading}} \def\oddheadingmarks{\headingmarks{odd}{heading}} \def\evenfootingmarks{\headingmarks{even}{footing}} \def\oddfootingmarks{\headingmarks{odd}{footing}} \def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1} \headingmarks{odd}{heading}{#1} } \def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1} \headingmarks{odd}{footing}{#1} } % #1 = even/odd, #2 = heading/footing, #3 = top/bottom. \def\headingmarks#1#2#3 {% \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname \global\expandafter\let\csname get#1#2marks\endcsname \temp } \everyheadingmarks bottom \everyfootingmarks bottom % @headings double turns headings on for double-sided printing. % @headings single turns headings on for single-sided printing. % @headings off turns them off. % @headings on same as @headings double, retained for compatibility. % @headings after turns on double-sided headings after this page. % @headings doubleafter turns on double-sided headings after this page. % @headings singleafter turns on single-sided headings after this page. % By default, they are off at the start of a document, % and turned `on' after @end titlepage. \def\headings #1 {\csname HEADINGS#1\endcsname} \def\headingsoff{% non-global headings elimination \evenheadline={\hfil}\evenfootline={\hfil}% \oddheadline={\hfil}\oddfootline={\hfil}% } \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting \HEADINGSoff % it's the default % When we turn headings on, set the page number to 1. % For double-sided printing, put current file name in lower left corner, % chapter name on inside top of right hand pages, document % title on inside top of left hand pages, and page numbers on outside top % edge of all pages. \def\HEADINGSdouble{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \let\contentsalignmacro = \chappager % For single-sided printing, chapter title goes across top left of page, % page number on top right. \def\HEADINGSsingle{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } \def\HEADINGSon{\HEADINGSdouble} \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} \let\HEADINGSdoubleafter=\HEADINGSafter \def\HEADINGSdoublex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} \def\HEADINGSsinglex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } % Subroutines used in generating headings % This produces Day Month Year style of output. % Only define if not already defined, in case a txi-??.tex file has set % up a different format (e.g., txi-cs.tex does this). \ifx\today\thisisundefined \def\today{% \number\day\space \ifcase\month \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec \fi \space\number\year} \fi % @settitle line... specifies the title of the document, for headings. % It generates no output of its own. \def\thistitle{\putwordNoTitle} \def\settitle{\parsearg{\gdef\thistitle}} \message{tables,} % Tables -- @table, @ftable, @vtable, @item(x). % default indentation of table text \newdimen\tableindent \tableindent=.8in % default indentation of @itemize and @enumerate text \newdimen\itemindent \itemindent=.3in % margin between end of table item and start of table text. \newdimen\itemmargin \itemmargin=.1in % used internally for \itemindent minus \itemmargin \newdimen\itemmax % Note @table, @ftable, and @vtable define @item, @itemx, etc., with % these defs. % They also define \itemindex % to index the item name in whatever manner is desired (perhaps none). \newif\ifitemxneedsnegativevskip \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} \def\internalBitem{\smallbreak \parsearg\itemzzz} \def\internalBitemx{\itemxpar \parsearg\itemzzz} \def\itemzzz #1{\begingroup % \advance\hsize by -\rightskip \advance\hsize by -\tableindent \setbox0=\hbox{\itemindicate{#1}}% \itemindex{#1}% \nobreak % This prevents a break before @itemx. % % If the item text does not fit in the space we have, put it on a line % by itself, and do not allow a page break either before or after that % line. We do not start a paragraph here because then if the next % command is, e.g., @kindex, the whatsit would get put into the % horizontal list on a line by itself, resulting in extra blank space. \ifdim \wd0>\itemmax % % Make this a paragraph so we get the \parskip glue and wrapping, % but leave it ragged-right. \begingroup \advance\leftskip by-\tableindent \advance\hsize by\tableindent \advance\rightskip by0pt plus1fil\relax \leavevmode\unhbox0\par \endgroup % % We're going to be starting a paragraph, but we don't want the % \parskip glue -- logically it's part of the @item we just started. \nobreak \vskip-\parskip % % Stop a page break at the \parskip glue coming up. However, if % what follows is an environment such as @example, there will be no % \parskip glue; then the negative vskip we just inserted would % cause the example and the item to crash together. So we use this % bizarre value of 10001 as a signal to \aboveenvbreak to insert % \parskip glue after all. Section titles are handled this way also. % \penalty 10001 \endgroup \itemxneedsnegativevskipfalse \else % The item text fits into the space. Start a paragraph, so that the % following text (if any) will end up on the same line. \noindent % Do this with kerns and \unhbox so that if there is a footnote in % the item text, it can migrate to the main vertical list and % eventually be printed. \nobreak\kern-\tableindent \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 \unhbox0 \nobreak\kern\dimen0 \endgroup \itemxneedsnegativevskiptrue \fi } \def\item{\errmessage{@item while not in a list environment}} \def\itemx{\errmessage{@itemx while not in a list environment}} % @table, @ftable, @vtable. \envdef\table{% \let\itemindex\gobble \tablecheck{table}% } \envdef\ftable{% \def\itemindex ##1{\doind {fn}{\code{##1}}}% \tablecheck{ftable}% } \envdef\vtable{% \def\itemindex ##1{\doind {vr}{\code{##1}}}% \tablecheck{vtable}% } \def\tablecheck#1{% \ifnum \the\catcode`\^^M=\active \endgroup \errmessage{This command won't work in this context; perhaps the problem is that we are \inenvironment\thisenv}% \def\next{\doignore{#1}}% \else \let\next\tablex \fi \next } \def\tablex#1{% \def\itemindicate{#1}% \parsearg\tabley } \def\tabley#1{% {% \makevalueexpandable \edef\temp{\noexpand\tablez #1\space\space\space}% \expandafter }\temp \endtablez } \def\tablez #1 #2 #3 #4\endtablez{% \aboveenvbreak \ifnum 0#1>0 \advance \leftskip by #1\mil \fi \ifnum 0#2>0 \tableindent=#2\mil \fi \ifnum 0#3>0 \advance \rightskip by #3\mil \fi \itemmax=\tableindent \advance \itemmax by -\itemmargin \advance \leftskip by \tableindent \exdentamount=\tableindent \parindent = 0pt \parskip = \smallskipamount \ifdim \parskip=0pt \parskip=2pt \fi \let\item = \internalBitem \let\itemx = \internalBitemx } \def\Etable{\endgraf\afterenvbreak} \let\Eftable\Etable \let\Evtable\Etable \let\Eitemize\Etable \let\Eenumerate\Etable % This is the counter used by @enumerate, which is really @itemize \newcount \itemno \envdef\itemize{\parsearg\doitemize} \def\doitemize#1{% \aboveenvbreak \itemmax=\itemindent \advance\itemmax by -\itemmargin \advance\leftskip by \itemindent \exdentamount=\itemindent \parindent=0pt \parskip=\smallskipamount \ifdim\parskip=0pt \parskip=2pt \fi % % Try typesetting the item mark that if the document erroneously says % something like @itemize @samp (intending @table), there's an error % right away at the @itemize. It's not the best error message in the % world, but it's better than leaving it to the @item. This means if % the user wants an empty mark, they have to say @w{} not just @w. \def\itemcontents{#1}% \setbox0 = \hbox{\itemcontents}% % % @itemize with no arg is equivalent to @itemize @bullet. \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi % \let\item=\itemizeitem } % Definition of @item while inside @itemize and @enumerate. % \def\itemizeitem{% \advance\itemno by 1 % for enumerations {\let\par=\endgraf \smallbreak}% reasonable place to break {% % If the document has an @itemize directly after a section title, a % \nobreak will be last on the list, and \sectionheading will have % done a \vskip-\parskip. In that case, we don't want to zero % parskip, or the item text will crash with the heading. On the % other hand, when there is normal text preceding the item (as there % usually is), we do want to zero parskip, or there would be too much % space. In that case, we won't have a \nobreak before. At least % that's the theory. \ifnum\lastpenalty<10000 \parskip=0in \fi \noindent \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% % \vadjust{\penalty 1200}}% not good to break after first line of item. \flushcr } % \splitoff TOKENS\endmark defines \first to be the first token in % TOKENS, and \rest to be the remainder. % \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% % Allow an optional argument of an uppercase letter, lowercase letter, % or number, to specify the first label in the enumerated list. No % argument is the same as `1'. % \envparseargdef\enumerate{\enumeratey #1 \endenumeratey} \def\enumeratey #1 #2\endenumeratey{% % If we were given no argument, pretend we were given `1'. \def\thearg{#1}% \ifx\thearg\empty \def\thearg{1}\fi % % Detect if the argument is a single token. If so, it might be a % letter. Otherwise, the only valid thing it can be is a number. % (We will always have one token, because of the test we just made. % This is a good thing, since \splitoff doesn't work given nothing at % all -- the first parameter is undelimited.) \expandafter\splitoff\thearg\endmark \ifx\rest\empty % Only one token in the argument. It could still be anything. % A ``lowercase letter'' is one whose \lccode is nonzero. % An ``uppercase letter'' is one whose \lccode is both nonzero, and % not equal to itself. % Otherwise, we assume it's a number. % % We need the \relax at the end of the \ifnum lines to stop TeX from % continuing to look for a . % \ifnum\lccode\expandafter`\thearg=0\relax \numericenumerate % a number (we hope) \else % It's a letter. \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax \lowercaseenumerate % lowercase letter \else \uppercaseenumerate % uppercase letter \fi \fi \else % Multiple tokens in the argument. We hope it's a number. \numericenumerate \fi } % An @enumerate whose labels are integers. The starting integer is % given in \thearg. % \def\numericenumerate{% \itemno = \thearg \startenumeration{\the\itemno}% } % The starting (lowercase) letter is in \thearg. \def\lowercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more lowercase letters in @enumerate; get a bigger alphabet}% \fi \char\lccode\itemno }% } % The starting (uppercase) letter is in \thearg. \def\uppercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more uppercase letters in @enumerate; get a bigger alphabet} \fi \char\uccode\itemno }% } % Call \doitemize, adding a period to the first argument and supplying the % common last two arguments. Also subtract one from the initial value in % \itemno, since @item increments \itemno. % \def\startenumeration#1{% \advance\itemno by -1 \doitemize{#1.}\flushcr } % @alphaenumerate and @capsenumerate are abbreviations for giving an arg % to @enumerate. % \def\alphaenumerate{\enumerate{a}} \def\capsenumerate{\enumerate{A}} \def\Ealphaenumerate{\Eenumerate} \def\Ecapsenumerate{\Eenumerate} % @multitable macros % Amy Hendrickson, 8/18/94, 3/6/96 % % @multitable ... @end multitable will make as many columns as desired. % Contents of each column will wrap at width given in preamble. Width % can be specified either with sample text given in a template line, % or in percent of \hsize, the current width of text on page. % Table can continue over pages but will only break between lines. % To make preamble: % % Either define widths of columns in terms of percent of \hsize: % @multitable @columnfractions .25 .3 .45 % @item ... % % Numbers following @columnfractions are the percent of the total % current hsize to be used for each column. You may use as many % columns as desired. % Or use a template: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item ... % using the widest term desired in each column. % Each new table line starts with @item, each subsequent new column % starts with @tab. Empty columns may be produced by supplying @tab's % with nothing between them for as many times as empty columns are needed, % ie, @tab@tab@tab will produce two empty columns. % @item, @tab do not need to be on their own lines, but it will not hurt % if they are. % Sample multitable: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item first col stuff @tab second col stuff @tab third col % @item % first col stuff % @tab % second col stuff % @tab % third col % @item first col stuff @tab second col stuff % @tab Many paragraphs of text may be used in any column. % % They will wrap at the width determined by the template. % @item@tab@tab This will be in third column. % @end multitable % Default dimensions may be reset by user. % @multitableparskip is vertical space between paragraphs in table. % @multitableparindent is paragraph indent in table. % @multitablecolmargin is horizontal space to be left between columns. % @multitablelinespace is space to leave between table items, baseline % to baseline. % 0pt means it depends on current normal line spacing. % \newskip\multitableparskip \newskip\multitableparindent \newdimen\multitablecolspace \newskip\multitablelinespace \multitableparskip=0pt \multitableparindent=6pt \multitablecolspace=12pt \multitablelinespace=0pt % Macros used to set up halign preamble: % \let\endsetuptable\relax \def\xendsetuptable{\endsetuptable} \let\columnfractions\relax \def\xcolumnfractions{\columnfractions} \newif\ifsetpercent % #1 is the @columnfraction, usually a decimal number like .5, but might % be just 1. We just use it, whatever it is. % \def\pickupwholefraction#1 {% \global\advance\colcount by 1 \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% \setuptable } \newcount\colcount \def\setuptable#1{% \def\firstarg{#1}% \ifx\firstarg\xendsetuptable \let\go = \relax \else \ifx\firstarg\xcolumnfractions \global\setpercenttrue \else \ifsetpercent \let\go\pickupwholefraction \else \global\advance\colcount by 1 \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a % separator; typically that is always in the input, anyway. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% \fi \fi \ifx\go\pickupwholefraction % Put the argument back for the \pickupwholefraction call, so % we'll always have a period there to be parsed. \def\go{\pickupwholefraction#1}% \else \let\go = \setuptable \fi% \fi \go } % multitable-only commands. % % @headitem starts a heading row, which we typeset in bold. % Assignments have to be global since we are inside the implicit group % of an alignment entry. \everycr resets \everytab so we don't have to % undo it ourselves. \def\headitemfont{\b}% for people to use in the template row; not changeable \def\headitem{% \checkenv\multitable \crcr \global\everytab={\bf}% can't use \headitemfont since the parsing differs \the\everytab % for the first item }% % % A \tab used to include \hskip1sp. But then the space in a template % line is not enough. That is bad. So let's go back to just `&' until % we again encounter the problem the 1sp was intended to solve. % --karl, nathan@acm.org, 20apr99. \def\tab{\checkenv\multitable &\the\everytab}% % @multitable ... @end multitable definitions: % \newtoks\everytab % insert after every tab. % \envdef\multitable{% \vskip\parskip \startsavinginserts % % @item within a multitable starts a normal row. % We use \def instead of \let so that if one of the multitable entries % contains an @itemize, we don't choke on the \item (seen as \crcr aka % \endtemplate) expanding \doitemize. \def\item{\crcr}% % \tolerance=9500 \hbadness=9500 \setmultitablespacing \parskip=\multitableparskip \parindent=\multitableparindent \overfullrule=0pt \global\colcount=0 % \everycr = {% \noalign{% \global\everytab={}% \global\colcount=0 % Reset the column counter. % Check for saved footnotes, etc. \checkinserts % Keeps underfull box messages off when table breaks over pages. %\filbreak % Maybe so, but it also creates really weird page breaks when the % table breaks over pages. Wouldn't \vfil be better? Wait until the % problem manifests itself, so it can be fixed for real --karl. }% }% % \parsearg\domultitable } \def\domultitable#1{% % To parse everything between @multitable and @item: \setuptable#1 \endsetuptable % % This preamble sets up a generic column definition, which will % be used as many times as user calls for columns. % \vtop will set a single line and will also let text wrap and % continue for many paragraphs if desired. \halign\bgroup &% \global\advance\colcount by 1 \multistrut \vtop{% % Use the current \colcount to find the correct column width: \hsize=\expandafter\csname col\the\colcount\endcsname % % In order to keep entries from bumping into each other % we will add a \leftskip of \multitablecolspace to all columns after % the first one. % % If a template has been used, we will add \multitablecolspace % to the width of each template entry. % % If the user has set preamble in terms of percent of \hsize we will % use that dimension as the width of the column, and the \leftskip % will keep entries from bumping into each other. Table will start at % left margin and final column will justify at right margin. % % Make sure we don't inherit \rightskip from the outer environment. \rightskip=0pt \ifnum\colcount=1 % The first column will be indented with the surrounding text. \advance\hsize by\leftskip \else \ifsetpercent \else % If user has not set preamble in terms of percent of \hsize % we will advance \hsize by \multitablecolspace. \advance\hsize by \multitablecolspace \fi % In either case we will make \leftskip=\multitablecolspace: \leftskip=\multitablecolspace \fi % Ignoring space at the beginning and end avoids an occasional spurious % blank line, when TeX decides to break the line at the space before the % box from the multistrut, so the strut ends up on a line by itself. % For example: % @multitable @columnfractions .11 .89 % @item @code{#} % @tab Legal holiday which is valid in major parts of the whole country. % Is automatically provided with highlighting sequences respectively % marking characters. \noindent\ignorespaces##\unskip\multistrut }\cr } \def\Emultitable{% \crcr \egroup % end the \halign \global\setpercentfalse } \def\setmultitablespacing{% \def\multistrut{\strut}% just use the standard line spacing % % Compute \multitablelinespace (if not defined by user) for use in % \multitableparskip calculation. We used define \multistrut based on % this, but (ironically) that caused the spacing to be off. % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. \ifdim\multitablelinespace=0pt \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip \global\advance\multitablelinespace by-\ht0 \fi % Test to see if parskip is larger than space between lines of % table. If not, do nothing. % If so, set to same dimension as multitablelinespace. \ifdim\multitableparskip>\multitablelinespace \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller % than skip between lines in the table. \fi% \ifdim\multitableparskip=0pt \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller % than skip between lines in the table. \fi} \message{conditionals,} % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, % @ifnotxml always succeed. They currently do nothing; we don't % attempt to check whether the conditionals are properly nested. But we % have to remember that they are conditionals, so that @end doesn't % attempt to close an environment group. % \def\makecond#1{% \expandafter\let\csname #1\endcsname = \relax \expandafter\let\csname iscond.#1\endcsname = 1 } \makecond{iftex} \makecond{ifnotdocbook} \makecond{ifnothtml} \makecond{ifnotinfo} \makecond{ifnotplaintext} \makecond{ifnotxml} % Ignore @ignore, @ifhtml, @ifinfo, and the like. % \def\direntry{\doignore{direntry}} \def\documentdescription{\doignore{documentdescription}} \def\docbook{\doignore{docbook}} \def\html{\doignore{html}} \def\ifdocbook{\doignore{ifdocbook}} \def\ifhtml{\doignore{ifhtml}} \def\ifinfo{\doignore{ifinfo}} \def\ifnottex{\doignore{ifnottex}} \def\ifplaintext{\doignore{ifplaintext}} \def\ifxml{\doignore{ifxml}} \def\ignore{\doignore{ignore}} \def\menu{\doignore{menu}} \def\xml{\doignore{xml}} % Ignore text until a line `@end #1', keeping track of nested conditionals. % % A count to remember the depth of nesting. \newcount\doignorecount \def\doignore#1{\begingroup % Scan in ``verbatim'' mode: \obeylines \catcode`\@ = \other \catcode`\{ = \other \catcode`\} = \other % % Make sure that spaces turn into tokens that match what \doignoretext wants. \spaceisspace % % Count number of #1's that we've seen. \doignorecount = 0 % % Swallow text until we reach the matching `@end #1'. \dodoignore{#1}% } { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. \obeylines % % \gdef\dodoignore#1{% % #1 contains the command name as a string, e.g., `ifinfo'. % % Define a command to find the next `@end #1'. \long\def\doignoretext##1^^M@end #1{% \doignoretextyyy##1^^M@#1\_STOP_}% % % And this command to find another #1 command, at the beginning of a % line. (Otherwise, we would consider a line `@c @ifset', for % example, to count as an @ifset for nesting.) \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% % % And now expand that command. \doignoretext ^^M% }% } \def\doignoreyyy#1{% \def\temp{#1}% \ifx\temp\empty % Nothing found. \let\next\doignoretextzzz \else % Found a nested condition, ... \advance\doignorecount by 1 \let\next\doignoretextyyy % ..., look for another. % If we're here, #1 ends with ^^M\ifinfo (for example). \fi \next #1% the token \_STOP_ is present just after this macro. } % We have to swallow the remaining "\_STOP_". % \def\doignoretextzzz#1{% \ifnum\doignorecount = 0 % We have just found the outermost @end. \let\next\enddoignore \else % Still inside a nested condition. \advance\doignorecount by -1 \let\next\doignoretext % Look for the next @end. \fi \next } % Finish off ignored text. { \obeylines% % Ignore anything after the last `@end #1'; this matters in verbatim % environments, where otherwise the newline after an ignored conditional % would result in a blank line in the output. \gdef\enddoignore#1^^M{\endgroup\ignorespaces}% } % @set VAR sets the variable VAR to an empty value. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. % % Since we want to separate VAR from REST-OF-LINE (which might be % empty), we can't just use \parsearg; we have to insert a space of our % own to delimit the rest of the line, and then take it out again if we % didn't need it. % We rely on the fact that \parsearg sets \catcode`\ =10. % \parseargdef\set{\setyyy#1 \endsetyyy} \def\setyyy#1 #2\endsetyyy{% {% \makevalueexpandable \def\temp{#2}% \edef\next{\gdef\makecsname{SET#1}}% \ifx\temp\empty \next{}% \else \setzzz#2\endsetzzz \fi }% } % Remove the trailing space \setxxx inserted. \def\setzzz#1 \endsetzzz{\next{#1}} % @clear VAR clears (i.e., unsets) the variable VAR. % \parseargdef\clear{% {% \makevalueexpandable \global\expandafter\let\csname SET#1\endcsname=\relax }% } % @value{foo} gets the text saved in variable foo. \def\value{\begingroup\makevalueexpandable\valuexxx} \def\valuexxx#1{\expandablevalue{#1}\endgroup} { \catcode`\- = \active \catcode`\_ = \active % \gdef\makevalueexpandable{% \let\value = \expandablevalue % We don't want these characters active, ... \catcode`\-=\other \catcode`\_=\other % ..., but we might end up with active ones in the argument if % we're called from @code, as @code{@value{foo-bar_}}, though. % So \let them to their normal equivalents. \let-\realdash \let_\normalunderscore } } % We have this subroutine so that we can handle at least some @value's % properly in indexes (we call \makevalueexpandable in \indexdummies). % The command has to be fully expandable (if the variable is set), since % the result winds up in the index file. This means that if the % variable's value contains other Texinfo commands, it's almost certain % it will fail (although perhaps we could fix that with sufficient work % to do a one-level expansion on the result, instead of complete). % \def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax {[No value for ``#1'']}% \message{Variable `#1', used in @value, is not set.}% \else \csname SET#1\endcsname \fi } % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. % % To get special treatment of `@end ifset,' call \makeond and the redefine. % \makecond{ifset} \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} \def\doifset#1#2{% {% \makevalueexpandable \let\next=\empty \expandafter\ifx\csname SET#2\endcsname\relax #1% If not set, redefine \next. \fi \expandafter }\next } \def\ifsetfail{\doignore{ifset}} % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been % defined with @set, or has been undefined with @clear. % % The `\else' inside the `\doifset' parameter is a trick to reuse the % above code: if the variable is not set, do nothing, if it is set, % then redefine \next to \ifclearfail. % \makecond{ifclear} \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} \def\ifclearfail{\doignore{ifclear}} % @dircategory CATEGORY -- specify a category of the dir file % which this file should belong to. Ignore this in TeX. \let\dircategory=\comment % @defininfoenclose. \let\definfoenclose=\comment \message{indexing,} % Index generation facilities % Define \newwrite to be identical to plain tex's \newwrite % except not \outer, so it can be used within macros and \if's. \edef\newwrite{\makecsname{ptexnewwrite}} % \newindex {foo} defines an index named foo. % It automatically defines \fooindex such that % \fooindex ...rest of line... puts an entry in the index foo. % It also defines \fooindfile to be the number of the output channel for % the file that accumulates this index. The file's extension is foo. % The name of an index should be no more than 2 characters long % for the sake of vms. % \def\newindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 % Open the file \fi \expandafter\xdef\csname#1index\endcsname{% % Define @#1index \noexpand\doindex{#1}} } % @defindex foo == \newindex{foo} % \def\defindex{\parsearg\newindex} % Define @defcodeindex, like @defindex except put all entries in @code. % \def\defcodeindex{\parsearg\newcodeindex} % \def\newcodeindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 \fi \expandafter\xdef\csname#1index\endcsname{% \noexpand\docodeindex{#1}}% } % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. % % @syncodeindex foo bar similar, but put all entries made for index foo % inside @code. % \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), % #3 the target index (bar). \def\dosynindex#1#2#3{% % Only do \closeout if we haven't already done it, else we'll end up % closing the target index. \expandafter \ifx\csname donesynindex#2\endcsname \relax % The \closeout helps reduce unnecessary open files; the limit on the % Acorn RISC OS is a mere 16 files. \expandafter\closeout\csname#2indfile\endcsname \expandafter\let\csname donesynindex#2\endcsname = 1 \fi % redefine \fooindfile: \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname \expandafter\let\csname#2indfile\endcsname=\temp % redefine \fooindex: \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% } % Define \doindex, the driver for all \fooindex macros. % Argument #1 is generated by the calling \fooindex macro, % and it is "foo", the name of the index. % \doindex just uses \parsearg; it calls \doind for the actual work. % This is because \doind is more useful to call from other macros. % There is also \dosubind {index}{topic}{subtopic} % which makes an entry in a two-level index such as the operation index. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} \def\singleindexer #1{\doind{\indexname}{#1}} % like the previous two, but they put @code around the argument. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} % Take care of Texinfo commands that can appear in an index entry. % Since there are some commands we want to expand, and others we don't, % we have to laboriously prevent expansion for those that we don't. % \def\indexdummies{% \escapechar = `\\ % use backslash in output files. \def\@{@}% change to @@ when we switch to @ as escape char in index files. \def\ {\realbackslash\space }% % % Need these unexpandable (because we define \tt as a dummy) % definitions when @{ or @} appear in index entry text. Also, more % complicated, when \tex is in effect and \{ is a \delimiter again. % We can't use \lbracecmd and \rbracecmd because texindex assumes % braces and backslashes are used only as delimiters. Perhaps we % should define @lbrace and @rbrace commands a la @comma. \def\{{{\tt\char123}}% \def\}{{\tt\char125}}% % % I don't entirely understand this, but when an index entry is % generated from a macro call, the \endinput which \scanmacro inserts % causes processing to be prematurely terminated. This is, % apparently, because \indexsorttmp is fully expanded, and \endinput % is an expandable command. The redefinition below makes \endinput % disappear altogether for that purpose -- although logging shows that % processing continues to some further point. On the other hand, it % seems \endinput does not hurt in the printed index arg, since that % is still getting written without apparent harm. % % Sample source (mac-idx3.tex, reported by Graham Percival to % help-texinfo, 22may06): % @macro funindex {WORD} % @findex xyz % @end macro % ... % @funindex commtest % % The above is not enough to reproduce the bug, but it gives the flavor. % % Sample whatsit resulting: % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} % % So: \let\endinput = \empty % % Do the redefinitions. \commondummies } % For the aux and toc files, @ is the escape character. So we want to % redefine everything using @ as the escape character (instead of % \realbackslash, still used for index files). When everything uses @, % this will be simpler. % \def\atdummies{% \def\@{@@}% \def\ {@ }% \let\{ = \lbraceatcmd \let\} = \rbraceatcmd % % Do the redefinitions. \commondummies \otherbackslash } % Called from \indexdummies and \atdummies. % \def\commondummies{% % % \definedummyword defines \#1 as \string\#1\space, thus effectively % preventing its expansion. This is used only for control words, % not control letters, because the \space would be incorrect for % control characters, but is needed to separate the control word % from whatever follows. % % For control letters, we have \definedummyletter, which omits the % space. % % These can be used both for control words that take an argument and % those that do not. If it is followed by {arg} in the input, then % that will dutifully get written to the index (or wherever). % \def\definedummyword ##1{\def##1{\string##1\space}}% \def\definedummyletter##1{\def##1{\string##1}}% \let\definedummyaccent\definedummyletter % \commondummiesnofonts % \definedummyletter\_% \definedummyletter\-% % % Non-English letters. \definedummyword\AA \definedummyword\AE \definedummyword\DH \definedummyword\L \definedummyword\O \definedummyword\OE \definedummyword\TH \definedummyword\aa \definedummyword\ae \definedummyword\dh \definedummyword\exclamdown \definedummyword\l \definedummyword\o \definedummyword\oe \definedummyword\ordf \definedummyword\ordm \definedummyword\questiondown \definedummyword\ss \definedummyword\th % % Although these internal commands shouldn't show up, sometimes they do. \definedummyword\bf \definedummyword\gtr \definedummyword\hat \definedummyword\less \definedummyword\sf \definedummyword\sl \definedummyword\tclose \definedummyword\tt % \definedummyword\LaTeX \definedummyword\TeX % % Assorted special characters. \definedummyword\arrow \definedummyword\bullet \definedummyword\comma \definedummyword\copyright \definedummyword\registeredsymbol \definedummyword\dots \definedummyword\enddots \definedummyword\entrybreak \definedummyword\equiv \definedummyword\error \definedummyword\euro \definedummyword\expansion \definedummyword\geq \definedummyword\guillemetleft \definedummyword\guillemetright \definedummyword\guilsinglleft \definedummyword\guilsinglright \definedummyword\leq \definedummyword\minus \definedummyword\ogonek \definedummyword\pounds \definedummyword\point \definedummyword\print \definedummyword\quotedblbase \definedummyword\quotedblleft \definedummyword\quotedblright \definedummyword\quoteleft \definedummyword\quoteright \definedummyword\quotesinglbase \definedummyword\result \definedummyword\textdegree % % We want to disable all macros so that they are not expanded by \write. \macrolist % \normalturnoffactive % % Handle some cases of @value -- where it does not contain any % (non-fully-expandable) commands. \makevalueexpandable } % \commondummiesnofonts: common to \commondummies and \indexnofonts. % \def\commondummiesnofonts{% % Control letters and accents. \definedummyletter\!% \definedummyaccent\"% \definedummyaccent\'% \definedummyletter\*% \definedummyaccent\,% \definedummyletter\.% \definedummyletter\/% \definedummyletter\:% \definedummyaccent\=% \definedummyletter\?% \definedummyaccent\^% \definedummyaccent\`% \definedummyaccent\~% \definedummyword\u \definedummyword\v \definedummyword\H \definedummyword\dotaccent \definedummyword\ogonek \definedummyword\ringaccent \definedummyword\tieaccent \definedummyword\ubaraccent \definedummyword\udotaccent \definedummyword\dotless % % Texinfo font commands. \definedummyword\b \definedummyword\i \definedummyword\r \definedummyword\sansserif \definedummyword\sc \definedummyword\slanted \definedummyword\t % % Commands that take arguments. \definedummyword\acronym \definedummyword\anchor \definedummyword\cite \definedummyword\code \definedummyword\command \definedummyword\dfn \definedummyword\dmn \definedummyword\email \definedummyword\emph \definedummyword\env \definedummyword\file \definedummyword\indicateurl \definedummyword\kbd \definedummyword\key \definedummyword\math \definedummyword\option \definedummyword\pxref \definedummyword\ref \definedummyword\samp \definedummyword\strong \definedummyword\tie \definedummyword\uref \definedummyword\url \definedummyword\var \definedummyword\verb \definedummyword\w \definedummyword\xref } % \indexnofonts is used when outputting the strings to sort the index % by, and when constructing control sequence names. It eliminates all % control sequences and just writes whatever the best ASCII sort string % would be for a given command (usually its argument). % \def\indexnofonts{% % Accent commands should become @asis. \def\definedummyaccent##1{\let##1\asis}% % We can just ignore other control letters. \def\definedummyletter##1{\let##1\empty}% % All control words become @asis by default; overrides below. \let\definedummyword\definedummyaccent % \commondummiesnofonts % % Don't no-op \tt, since it isn't a user-level command % and is used in the definitions of the active chars like <, >, |, etc. % Likewise with the other plain tex font commands. %\let\tt=\asis % \def\ { }% \def\@{@}% \def\_{\normalunderscore}% \def\-{}% @- shouldn't affect sorting % % Unfortunately, texindex is not prepared to handle braces in the % content at all. So for index sorting, we map @{ and @} to strings % starting with |, since that ASCII character is between ASCII { and }. \def\{{|a}% \def\}{|b}% % % Non-English letters. \def\AA{AA}% \def\AE{AE}% \def\DH{DZZ}% \def\L{L}% \def\OE{OE}% \def\O{O}% \def\TH{ZZZ}% \def\aa{aa}% \def\ae{ae}% \def\dh{dzz}% \def\exclamdown{!}% \def\l{l}% \def\oe{oe}% \def\ordf{a}% \def\ordm{o}% \def\o{o}% \def\questiondown{?}% \def\ss{ss}% \def\th{zzz}% % \def\LaTeX{LaTeX}% \def\TeX{TeX}% % % Assorted special characters. % (The following {} will end up in the sort string, but that's ok.) \def\arrow{->}% \def\bullet{bullet}% \def\comma{,}% \def\copyright{copyright}% \def\dots{...}% \def\enddots{...}% \def\equiv{==}% \def\error{error}% \def\euro{euro}% \def\expansion{==>}% \def\geq{>=}% \def\guillemetleft{<<}% \def\guillemetright{>>}% \def\guilsinglleft{<}% \def\guilsinglright{>}% \def\leq{<=}% \def\minus{-}% \def\point{.}% \def\pounds{pounds}% \def\print{-|}% \def\quotedblbase{"}% \def\quotedblleft{"}% \def\quotedblright{"}% \def\quoteleft{`}% \def\quoteright{'}% \def\quotesinglbase{,}% \def\registeredsymbol{R}% \def\result{=>}% \def\textdegree{o}% % \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax \else \indexlquoteignore \fi % % We need to get rid of all macros, leaving only the arguments (if present). % Of course this is not nearly correct, but it is the best we can do for now. % makeinfo does not expand macros in the argument to @deffn, which ends up % writing an index entry, and texindex isn't prepared for an index sort entry % that starts with \. % % Since macro invocations are followed by braces, we can just redefine them % to take a single TeX argument. The case of a macro invocation that % goes to end-of-line is not handled. % \macrolist } % Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us % ignore left quotes in the sort term. {\catcode`\`=\active \gdef\indexlquoteignore{\let`=\empty}} \let\indexbackslash=0 %overridden during \printindex. \let\SETmarginindex=\relax % put index entries in margin (undocumented)? % Most index entries go through here, but \dosubind is the general case. % #1 is the index name, #2 is the entry text. \def\doind#1#2{\dosubind{#1}{#2}{}} % Workhorse for all \fooindexes. % #1 is name of index, #2 is stuff to put there, #3 is subentry -- % empty if called from \doind, as we usually are (the main exception % is with most defuns, which call us directly). % \def\dosubind#1#2#3{% \iflinks {% % Store the main index entry text (including the third arg). \toks0 = {#2}% % If third arg is present, precede it with a space. \def\thirdarg{#3}% \ifx\thirdarg\empty \else \toks0 = \expandafter{\the\toks0 \space #3}% \fi % \edef\writeto{\csname#1indfile\endcsname}% % \safewhatsit\dosubindwrite }% \fi } % Write the entry in \toks0 to the index file: % \def\dosubindwrite{% % Put the index entry in the margin if desired. \ifx\SETmarginindex\relax\else \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% \fi % % Remember, we are within a group. \indexdummies % Must do this here, since \bf, etc expand at this stage \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now % so it will be output as is; and it will print as backslash. % % Process the index entry with all font commands turned off, to % get the string to sort by. {\indexnofonts \edef\temp{\the\toks0}% need full expansion \xdef\indexsorttmp{\temp}% }% % % Set up the complete index entry, with both the sort key and % the original text, including any font commands. We write % three arguments to \entry to the .?? file (four in the % subentry case), texindex reduces to two when writing the .??s % sorted result. \edef\temp{% \write\writeto{% \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% }% \temp } % Take care of unwanted page breaks/skips around a whatsit: % % If a skip is the last thing on the list now, preserve it % by backing up by \lastskip, doing the \write, then inserting % the skip again. Otherwise, the whatsit generated by the % \write or \pdfdest will make \lastskip zero. The result is that % sequences like this: % @end defun % @tindex whatever % @defun ... % will have extra space inserted, because the \medbreak in the % start of the @defun won't see the skip inserted by the @end of % the previous defun. % % But don't do any of this if we're not in vertical mode. We % don't want to do a \vskip and prematurely end a paragraph. % % Avoid page breaks due to these extra skips, too. % % But wait, there is a catch there: % We'll have to check whether \lastskip is zero skip. \ifdim is not % sufficient for this purpose, as it ignores stretch and shrink parts % of the skip. The only way seems to be to check the textual % representation of the skip. % % The following is almost like \def\zeroskipmacro{0.0pt} except that % the ``p'' and ``t'' characters have catcode \other, not 11 (letter). % \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} % \newskip\whatsitskip \newcount\whatsitpenalty % % ..., ready, GO: % \def\safewhatsit#1{% \ifhmode #1% \else % \lastskip and \lastpenalty cannot both be nonzero simultaneously. \whatsitskip = \lastskip \edef\lastskipmacro{\the\lastskip}% \whatsitpenalty = \lastpenalty % % If \lastskip is nonzero, that means the last item was a % skip. And since a skip is discardable, that means this % -\whatsitskip glue we're inserting is preceded by a % non-discardable item, therefore it is not a potential % breakpoint, therefore no \nobreak needed. \ifx\lastskipmacro\zeroskipmacro \else \vskip-\whatsitskip \fi % #1% % \ifx\lastskipmacro\zeroskipmacro % If \lastskip was zero, perhaps the last item was a penalty, and % perhaps it was >=10000, e.g., a \nobreak. In that case, we want % to re-insert the same penalty (values >10000 are used for various % signals); since we just inserted a non-discardable item, any % following glue (such as a \parskip) would be a breakpoint. For example: % % @deffn deffn-whatever % @vindex index-whatever % Description. % would allow a break between the index-whatever whatsit % and the "Description." paragraph. \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi \else % On the other hand, if we had a nonzero \lastskip, % this make-up glue would be preceded by a non-discardable item % (the whatsit from the \write), so we must insert a \nobreak. \nobreak\vskip\whatsitskip \fi \fi } % The index entry written in the file actually looks like % \entry {sortstring}{page}{topic} % or % \entry {sortstring}{page}{topic}{subtopic} % The texindex program reads in these files and writes files % containing these kinds of lines: % \initial {c} % before the first topic whose initial is c % \entry {topic}{pagelist} % for a topic that is used without subtopics % \primary {topic} % for the beginning of a topic that is used with subtopics % \secondary {subtopic}{pagelist} % for each subtopic. % Define the user-accessible indexing commands % @findex, @vindex, @kindex, @cindex. \def\findex {\fnindex} \def\kindex {\kyindex} \def\cindex {\cpindex} \def\vindex {\vrindex} \def\tindex {\tpindex} \def\pindex {\pgindex} \def\cindexsub {\begingroup\obeylines\cindexsub} {\obeylines % \gdef\cindexsub "#1" #2^^M{\endgroup % \dosubind{cp}{#2}{#1}}} % Define the macros used in formatting output of the sorted index material. % @printindex causes a particular index (the ??s file) to get printed. % It does not print any chapter heading (usually an @unnumbered). % \parseargdef\printindex{\begingroup \dobreak \chapheadingskip{10000}% % \smallfonts \rm \tolerance = 9500 \plainfrenchspacing \everypar = {}% don't want the \kern\-parindent from indentation suppression. % % See if the index file exists and is nonempty. % Change catcode of @ here so that if the index file contains % \initial {@} % as its first line, TeX doesn't complain about mismatched braces % (because it thinks @} is a control sequence). \catcode`\@ = 11 \openin 1 \jobname.#1s \ifeof 1 % \enddoublecolumns gets confused if there is no text in the index, % and it loses the chapter title and the aux file entries for the % index. The easiest way to prevent this problem is to make sure % there is some text. \putwordIndexNonexistent \else % % If the index file exists but is empty, then \openin leaves \ifeof % false. We have to make TeX try to read something from the file, so % it can discover if there is anything in it. \read 1 to \temp \ifeof 1 \putwordIndexIsEmpty \else % Index files are almost Texinfo source, but we use \ as the escape % character. It would be better to use @, but that's too big a change % to make right now. \def\indexbackslash{\backslashcurfont}% \catcode`\\ = 0 \escapechar = `\\ \begindoublecolumns \input \jobname.#1s \enddoublecolumns \fi \fi \closein 1 \endgroup} % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. \def\initial#1{{% % Some minor font changes for the special characters. \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt % % Remove any glue we may have, we'll be inserting our own. \removelastskip % % We like breaks before the index initials, so insert a bonus. \nobreak \vskip 0pt plus 3\baselineskip \penalty 0 \vskip 0pt plus -3\baselineskip % % Typeset the initial. Making this add up to a whole number of % baselineskips increases the chance of the dots lining up from column % to column. It still won't often be perfect, because of the stretch % we need before each entry, but it's better. % % No shrink because it confuses \balancecolumns. \vskip 1.67\baselineskip plus .5\baselineskip \leftline{\secbf #1}% % Do our best not to break after the initial. \nobreak \vskip .33\baselineskip plus .1\baselineskip }} % \entry typesets a paragraph consisting of the text (#1), dot leaders, and % then page number (#2) flushed to the right margin. It is used for index % and table of contents entries. The paragraph is indented by \leftskip. % % A straightforward implementation would start like this: % \def\entry#1#2{... % But this freezes the catcodes in the argument, and can cause problems to % @code, which sets - active. This problem was fixed by a kludge--- % ``-'' was active throughout whole index, but this isn't really right. % The right solution is to prevent \entry from swallowing the whole text. % --kasal, 21nov03 \def\entry{% \begingroup % % Start a new paragraph if necessary, so our assignments below can't % affect previous text. \par % % Do not fill out the last line with white space. \parfillskip = 0in % % No extra space above this paragraph. \parskip = 0in % % Do not prefer a separate line ending with a hyphen to fewer lines. \finalhyphendemerits = 0 % % \hangindent is only relevant when the entry text and page number % don't both fit on one line. In that case, bob suggests starting the % dots pretty far over on the line. Unfortunately, a large % indentation looks wrong when the entry text itself is broken across % lines. So we use a small indentation and put up with long leaders. % % \hangafter is reset to 1 (which is the value we want) at the start % of each paragraph, so we need not do anything with that. \hangindent = 2em % % When the entry text needs to be broken, just fill out the first line % with blank space. \rightskip = 0pt plus1fil % % A bit of stretch before each entry for the benefit of balancing % columns. \vskip 0pt plus1pt % % When reading the text of entry, convert explicit line breaks % from @* into spaces. The user might give these in long section % titles, for instance. \def\*{\unskip\space\ignorespaces}% \def\entrybreak{\hfil\break}% % % Swallow the left brace of the text (first parameter): \afterassignment\doentry \let\temp = } \def\entrybreak{\unskip\space\ignorespaces}% \def\doentry{% \bgroup % Instead of the swallowed brace. \noindent \aftergroup\finishentry % And now comes the text of the entry. } \def\finishentry#1{% % #1 is the page number. % % The following is kludged to not output a line of dots in the index if % there are no page numbers. The next person who breaks this will be % cursed by a Unix daemon. \setbox\boxA = \hbox{#1}% \ifdim\wd\boxA = 0pt \ % \else % % If we must, put the page number on a line of its own, and fill out % this line with blank space. (The \hfil is overwhelmed with the % fill leaders glue in \indexdotfill if the page number does fit.) \hfil\penalty50 \null\nobreak\indexdotfill % Have leaders before the page number. % % The `\ ' here is removed by the implicit \unskip that TeX does as % part of (the primitive) \par. Without it, a spurious underfull % \hbox ensues. \ifpdf \pdfgettoks#1.% \ \the\toksA \else \ #1% \fi \fi \par \endgroup } % Like plain.tex's \dotfill, except uses up at least 1 em. \def\indexdotfill{\cleaders \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill} \def\primary #1{\line{#1\hfil}} \newskip\secondaryindent \secondaryindent=0.5cm \def\secondary#1#2{{% \parfillskip=0in \parskip=0in \hangindent=1in \hangafter=1 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill \ifpdf \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. \else #2 \fi \par }} % Define two-column mode, which we use to typeset indexes. % Adapted from the TeXbook, page 416, which is to say, % the manmac.tex format used to print the TeXbook itself. \catcode`\@=11 \newbox\partialpage \newdimen\doublecolumnhsize \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns % Grab any single-column material above us. \output = {% % % Here is a possibility not foreseen in manmac: if we accumulate a % whole lot of material, we might end up calling this \output % routine twice in a row (see the doublecol-lose test, which is % essentially a couple of indexes with @setchapternewpage off). In % that case we just ship out what is in \partialpage with the normal % output routine. Generally, \partialpage will be empty when this % runs and this will be a no-op. See the indexspread.tex test case. \ifvoid\partialpage \else \onepageout{\pagecontents\partialpage}% \fi % \global\setbox\partialpage = \vbox{% % Unvbox the main output page. \unvbox\PAGE \kern-\topskip \kern\baselineskip }% }% \eject % run that output routine to set \partialpage % % Use the double-column output routine for subsequent pages. \output = {\doublecolumnout}% % % Change the page size parameters. We could do this once outside this % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 % format, but then we repeat the same computation. Repeating a couple % of assignments once per index is clearly meaningless for the % execution time, so we may as well do it in one place. % % First we halve the line length, less a little for the gutter between % the columns. We compute the gutter based on the line length, so it % changes automatically with the paper format. The magic constant % below is chosen so that the gutter has the same value (well, +-<1pt) % as it did when we hard-coded it. % % We put the result in a separate register, \doublecolumhsize, so we % can restore it in \pagesofar, after \hsize itself has (potentially) % been clobbered. % \doublecolumnhsize = \hsize \advance\doublecolumnhsize by -.04154\hsize \divide\doublecolumnhsize by 2 \hsize = \doublecolumnhsize % % Double the \vsize as well. (We don't need a separate register here, % since nobody clobbers \vsize.) \vsize = 2\vsize } % The double-column output routine for all double-column pages except % the last. % \def\doublecolumnout{% \splittopskip=\topskip \splitmaxdepth=\maxdepth % Get the available space for the double columns -- the normal % (undoubled) page height minus any material left over from the % previous page. \dimen@ = \vsize \divide\dimen@ by 2 \advance\dimen@ by -\ht\partialpage % % box0 will be the left-hand column, box2 the right. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ \onepageout\pagesofar \unvbox255 \penalty\outputpenalty } % % Re-output the contents of the output page -- any previous material, % followed by the two boxes we just split, in box0 and box2. \def\pagesofar{% \unvbox\partialpage % \hsize = \doublecolumnhsize \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% } % % All done with double columns. \def\enddoublecolumns{% % The following penalty ensures that the page builder is exercised % _before_ we change the output routine. This is necessary in the % following situation: % % The last section of the index consists only of a single entry. % Before this section, \pagetotal is less than \pagegoal, so no % break occurs before the last section starts. However, the last % section, consisting of \initial and the single \entry, does not % fit on the page and has to be broken off. Without the following % penalty the page builder will not be exercised until \eject % below, and by that time we'll already have changed the output % routine to the \balancecolumns version, so the next-to-last % double-column page will be processed with \balancecolumns, which % is wrong: The two columns will go to the main vertical list, with % the broken-off section in the recent contributions. As soon as % the output routine finishes, TeX starts reconsidering the page % break. The two columns and the broken-off section both fit on the % page, because the two columns now take up only half of the page % goal. When TeX sees \eject from below which follows the final % section, it invokes the new output routine that we've set after % \balancecolumns below; \onepageout will try to fit the two columns % and the final section into the vbox of \pageheight (see % \pagebody), causing an overfull box. % % Note that glue won't work here, because glue does not exercise the % page builder, unlike penalties (see The TeXbook, pp. 280-281). \penalty0 % \output = {% % Split the last of the double-column material. Leave it on the % current page, no automatic page break. \balancecolumns % % If we end up splitting too much material for the current page, % though, there will be another page break right after this \output % invocation ends. Having called \balancecolumns once, we do not % want to call it again. Therefore, reset \output to its normal % definition right away. (We hope \balancecolumns will never be % called on to balance too much material, but if it is, this makes % the output somewhat more palatable.) \global\output = {\onepageout{\pagecontents\PAGE}}% }% \eject \endgroup % started in \begindoublecolumns % % \pagegoal was set to the doubled \vsize above, since we restarted % the current page. We're now back to normal single-column % typesetting, so reset \pagegoal to the normal \vsize (after the % \endgroup where \vsize got restored). \pagegoal = \vsize } % % Called at the end of the double column material. \def\balancecolumns{% \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. \dimen@ = \ht0 \advance\dimen@ by \topskip \advance\dimen@ by-\baselineskip \divide\dimen@ by 2 % target to split to %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% \splittopskip = \topskip % Loop until we get a decent breakpoint. {% \vbadness = 10000 \loop \global\setbox3 = \copy0 \global\setbox1 = \vsplit3 to \dimen@ \ifdim\ht3>\dimen@ \global\advance\dimen@ by 1pt \repeat }% %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% \setbox0=\vbox to\dimen@{\unvbox1}% \setbox2=\vbox to\dimen@{\unvbox3}% % \pagesofar } \catcode`\@ = \other \message{sectioning,} % Chapters, sections, etc. % Let's start with @part. \outer\parseargdef\part{\partzzz{#1}} \def\partzzz#1{% \chapoddpage \null \vskip.3\vsize % move it down on the page a bit \begingroup \noindent \titlefonts\rmisbold #1\par % the text \let\lastnode=\empty % no node to associate with \writetocentry{part}{#1}{}% but put it in the toc \headingsoff % no headline or footline on the part page \chapoddpage \endgroup } % \unnumberedno is an oxymoron. But we count the unnumbered % sections so that we can refer to them unambiguously in the pdf % outlines by their "section number". We avoid collisions with chapter % numbers by starting them at 10000. (If a document ever has 10000 % chapters, we're in trouble anyway, I'm sure.) \newcount\unnumberedno \unnumberedno = 10000 \newcount\chapno \newcount\secno \secno=0 \newcount\subsecno \subsecno=0 \newcount\subsubsecno \subsubsecno=0 % This counter is funny since it counts through charcodes of letters A, B, ... \newcount\appendixno \appendixno = `\@ % % \def\appendixletter{\char\the\appendixno} % We do the following ugly conditional instead of the above simple % construct for the sake of pdftex, which needs the actual % letter in the expansion, not just typeset. % \def\appendixletter{% \ifnum\appendixno=`A A% \else\ifnum\appendixno=`B B% \else\ifnum\appendixno=`C C% \else\ifnum\appendixno=`D D% \else\ifnum\appendixno=`E E% \else\ifnum\appendixno=`F F% \else\ifnum\appendixno=`G G% \else\ifnum\appendixno=`H H% \else\ifnum\appendixno=`I I% \else\ifnum\appendixno=`J J% \else\ifnum\appendixno=`K K% \else\ifnum\appendixno=`L L% \else\ifnum\appendixno=`M M% \else\ifnum\appendixno=`N N% \else\ifnum\appendixno=`O O% \else\ifnum\appendixno=`P P% \else\ifnum\appendixno=`Q Q% \else\ifnum\appendixno=`R R% \else\ifnum\appendixno=`S S% \else\ifnum\appendixno=`T T% \else\ifnum\appendixno=`U U% \else\ifnum\appendixno=`V V% \else\ifnum\appendixno=`W W% \else\ifnum\appendixno=`X X% \else\ifnum\appendixno=`Y Y% \else\ifnum\appendixno=`Z Z% % The \the is necessary, despite appearances, because \appendixletter is % expanded while writing the .toc file. \char\appendixno is not % expandable, thus it is written literally, thus all appendixes come out % with the same letter (or @) in the toc without it. \else\char\the\appendixno \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} % Each @chapter defines these (using marks) as the number+name, number % and name of the chapter. Page headings and footings can use % these. @section does likewise. \def\thischapter{} \def\thischapternum{} \def\thischaptername{} \def\thissection{} \def\thissectionnum{} \def\thissectionname{} \newcount\absseclevel % used to calculate proper heading level \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count % @raisesections: treat @section as chapter, @subsection as section, etc. \def\raisesections{\global\advance\secbase by -1} \let\up=\raisesections % original BFox name % @lowersections: treat @chapter as section, @section as subsection, etc. \def\lowersections{\global\advance\secbase by 1} \let\down=\lowersections % original BFox name % we only have subsub. \chardef\maxseclevel = 3 % % A numbered section within an unnumbered changes to unnumbered too. % To achieve this, remember the "biggest" unnum. sec. we are currently in: \chardef\unnlevel = \maxseclevel % % Trace whether the current chapter is an appendix or not: % \chapheadtype is "N" or "A", unnumbered chapters are ignored. \def\chapheadtype{N} % Choose a heading macro % #1 is heading type % #2 is heading level % #3 is text for heading \def\genhead#1#2#3{% % Compute the abs. sec. level: \absseclevel=#2 \advance\absseclevel by \secbase % Make sure \absseclevel doesn't fall outside the range: \ifnum \absseclevel < 0 \absseclevel = 0 \else \ifnum \absseclevel > 3 \absseclevel = 3 \fi \fi % The heading type: \def\headtype{#1}% \if \headtype U% \ifnum \absseclevel < \unnlevel \chardef\unnlevel = \absseclevel \fi \else % Check for appendix sections: \ifnum \absseclevel = 0 \edef\chapheadtype{\headtype}% \else \if \headtype A\if \chapheadtype N% \errmessage{@appendix... within a non-appendix chapter}% \fi\fi \fi % Check for numbered within unnumbered: \ifnum \absseclevel > \unnlevel \def\headtype{U}% \else \chardef\unnlevel = 3 \fi \fi % Now print the heading: \if \headtype U% \ifcase\absseclevel \unnumberedzzz{#3}% \or \unnumberedseczzz{#3}% \or \unnumberedsubseczzz{#3}% \or \unnumberedsubsubseczzz{#3}% \fi \else \if \headtype A% \ifcase\absseclevel \appendixzzz{#3}% \or \appendixsectionzzz{#3}% \or \appendixsubseczzz{#3}% \or \appendixsubsubseczzz{#3}% \fi \else \ifcase\absseclevel \chapterzzz{#3}% \or \seczzz{#3}% \or \numberedsubseczzz{#3}% \or \numberedsubsubseczzz{#3}% \fi \fi \fi \suppressfirstparagraphindent } % an interface: \def\numhead{\genhead N} \def\apphead{\genhead A} \def\unnmhead{\genhead U} % @chapter, @appendix, @unnumbered. Increment top-level counter, reset % all lower-level sectioning counters to zero. % % Also set \chaplevelprefix, which we prepend to @float sequence numbers % (e.g., figures), q.v. By default (before any chapter), that is empty. \let\chaplevelprefix = \empty % \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz \def\chapterzzz#1{% % section resetting is \global in case the chapter is in a group, such % as an @include file. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\chapno by 1 % % Used for \float. \gdef\chaplevelprefix{\the\chapno.}% \resetallfloatnos % % \putwordChapter can contain complex things in translations. \toks0=\expandafter{\putwordChapter}% \message{\the\toks0 \space \the\chapno}% % % Write the actual heading. \chapmacro{#1}{Ynumbered}{\the\chapno}% % % So @section and the like are numbered underneath this chapter. \global\let\section = \numberedsec \global\let\subsection = \numberedsubsec \global\let\subsubsection = \numberedsubsubsec } \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz % \def\appendixzzz#1{% \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\appendixno by 1 \gdef\chaplevelprefix{\appendixletter.}% \resetallfloatnos % % \putwordAppendix can contain complex things in translations. \toks0=\expandafter{\putwordAppendix}% \message{\the\toks0 \space \appendixletter}% % \chapmacro{#1}{Yappendix}{\appendixletter}% % \global\let\section = \appendixsec \global\let\subsection = \appendixsubsec \global\let\subsubsection = \appendixsubsubsec } % normally unnmhead0 calls unnumberedzzz: \outer\parseargdef\unnumbered{\unnmhead0{#1}} \def\unnumberedzzz#1{% \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\unnumberedno by 1 % % Since an unnumbered has no number, no prefix for figures. \global\let\chaplevelprefix = \empty \resetallfloatnos % % This used to be simply \message{#1}, but TeX fully expands the % argument to \message. Therefore, if #1 contained @-commands, TeX % expanded them. For example, in `@unnumbered The @cite{Book}', TeX % expanded @cite (which turns out to cause errors because \cite is meant % to be executed, not expanded). % % Anyway, we don't want the fully-expanded definition of @cite to appear % as a result of the \message, we just want `@cite' itself. We use % \the to achieve this: TeX expands \the only once, % simply yielding the contents of . (We also do this for % the toc entries.) \toks0 = {#1}% \message{(\the\toks0)}% % \chapmacro{#1}{Ynothing}{\the\unnumberedno}% % \global\let\section = \unnumberedsec \global\let\subsection = \unnumberedsubsec \global\let\subsubsection = \unnumberedsubsubsec } % @centerchap is like @unnumbered, but the heading is centered. \outer\parseargdef\centerchap{% % Well, we could do the following in a group, but that would break % an assumption that \chapmacro is called at the outermost level. % Thus we are safer this way: --kasal, 24feb04 \let\centerparametersmaybe = \centerparameters \unnmhead0{#1}% \let\centerparametersmaybe = \relax } % @top is like @unnumbered. \let\top\unnumbered % Sections. % \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz \def\seczzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% } % normally calls appendixsectionzzz: \outer\parseargdef\appendixsection{\apphead1{#1}} \def\appendixsectionzzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% } \let\appendixsec\appendixsection % normally calls unnumberedseczzz: \outer\parseargdef\unnumberedsec{\unnmhead1{#1}} \def\unnumberedseczzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% } % Subsections. % % normally calls numberedsubseczzz: \outer\parseargdef\numberedsubsec{\numhead2{#1}} \def\numberedsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% } % normally calls appendixsubseczzz: \outer\parseargdef\appendixsubsec{\apphead2{#1}} \def\appendixsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Yappendix}% {\appendixletter.\the\secno.\the\subsecno}% } % normally calls unnumberedsubseczzz: \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} \def\unnumberedsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Ynothing}% {\the\unnumberedno.\the\secno.\the\subsecno}% } % Subsubsections. % % normally numberedsubsubseczzz: \outer\parseargdef\numberedsubsubsec{\numhead3{#1}} \def\numberedsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Ynumbered}% {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% } % normally appendixsubsubseczzz: \outer\parseargdef\appendixsubsubsec{\apphead3{#1}} \def\appendixsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Yappendix}% {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% } % normally unnumberedsubsubseczzz: \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} \def\unnumberedsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Ynothing}% {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% } % These macros control what the section commands do, according % to what kind of chapter we are in (ordinary, appendix, or unnumbered). % Define them by default for a numbered chapter. \let\section = \numberedsec \let\subsection = \numberedsubsec \let\subsubsection = \numberedsubsubsec % Define @majorheading, @heading and @subheading % NOTE on use of \vbox for chapter headings, section headings, and such: % 1) We use \vbox rather than the earlier \line to permit % overlong headings to fold. % 2) \hyphenpenalty is set to 10000 because hyphenation in a % heading is obnoxious; this forbids it. % 3) Likewise, headings look best if no \parindent is used, and % if justification is not attempted. Hence \raggedright. \def\majorheading{% {\advance\chapheadingskip by 10pt \chapbreak }% \parsearg\chapheadingzzz } \def\chapheading{\chapbreak \parsearg\chapheadingzzz} \def\chapheadingzzz#1{% {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\ptexraggedright \rmisbold #1\hfill}}% \bigskip \par\penalty 200\relax \suppressfirstparagraphindent } % @heading, @subheading, @subsubheading. \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} \suppressfirstparagraphindent} \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} \suppressfirstparagraphindent} \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} \suppressfirstparagraphindent} % These macros generate a chapter, section, etc. heading only % (including whitespace, linebreaking, etc. around it), % given all the information in convenient, parsed form. % Args are the skip and penalty (usually negative) \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} % Parameter controlling skip before chapter headings (if needed) \newskip\chapheadingskip % Define plain chapter starts, and page on/off switching for it. \def\chapbreak{\dobreak \chapheadingskip {-4000}} \def\chappager{\par\vfill\supereject} % Because \domark is called before \chapoddpage, the filler page will % get the headings for the next chapter, which is wrong. But we don't % care -- we just disable all headings on the filler page. \def\chapoddpage{% \chappager \ifodd\pageno \else \begingroup \headingsoff \null \chappager \endgroup \fi } \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} \def\CHAPPAGoff{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chapbreak \global\let\pagealignmacro=\chappager} \def\CHAPPAGon{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chappager \global\let\pagealignmacro=\chappager \global\def\HEADINGSon{\HEADINGSsingle}} \def\CHAPPAGodd{% \global\let\contentsalignmacro = \chapoddpage \global\let\pchapsepmacro=\chapoddpage \global\let\pagealignmacro=\chapoddpage \global\def\HEADINGSon{\HEADINGSdouble}} \CHAPPAGon % Chapter opening. % % #1 is the text, #2 is the section type (Ynumbered, Ynothing, % Yappendix, Yomitfromtoc), #3 the chapter number. % % To test against our argument. \def\Ynothingkeyword{Ynothing} \def\Yomitfromtockeyword{Yomitfromtoc} \def\Yappendixkeyword{Yappendix} % \def\chapmacro#1#2#3{% % Insert the first mark before the heading break (see notes for \domark). \let\prevchapterdefs=\lastchapterdefs \let\prevsectiondefs=\lastsectiondefs \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% \gdef\thissection{}}% % \def\temptype{#2}% \ifx\temptype\Ynothingkeyword \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% \gdef\thischapter{\thischaptername}}% \else\ifx\temptype\Yomitfromtockeyword \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% \gdef\thischapter{}}% \else\ifx\temptype\Yappendixkeyword \toks0={#1}% \xdef\lastchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\appendixletter}% % \noexpand\putwordAppendix avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thischapter{\noexpand\putwordAppendix{} \noexpand\thischapternum: \noexpand\thischaptername}% }% \else \toks0={#1}% \xdef\lastchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\the\chapno}% % \noexpand\putwordChapter avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thischapter{\noexpand\putwordChapter{} \noexpand\thischapternum: \noexpand\thischaptername}% }% \fi\fi\fi % % Output the mark. Pass it through \safewhatsit, to take care of % the preceding space. \safewhatsit\domark % % Insert the chapter heading break. \pchapsepmacro % % Now the second mark, after the heading break. No break points % between here and the heading. \let\prevchapterdefs=\lastchapterdefs \let\prevsectiondefs=\lastsectiondefs \domark % {% \chapfonts \rmisbold % % Have to define \lastsection before calling \donoderef, because the % xref code eventually uses it. On the other hand, it has to be called % after \pchapsepmacro, or the headline will change too soon. \gdef\lastsection{#1}% % % Only insert the separating space if we have a chapter/appendix % number, and don't print the unnumbered ``number''. \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unnchap}% \else\ifx\temptype\Yomitfromtockeyword \setbox0 = \hbox{}% contents like unnumbered, but no toc entry \def\toctype{omit}% \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% \def\toctype{app}% \else \setbox0 = \hbox{#3\enspace}% \def\toctype{numchap}% \fi\fi\fi % % Write the toc entry for this chapter. Must come before the % \donoderef, because we include the current node name in the toc % entry, and \donoderef resets it to empty. \writetocentry{\toctype}{#1}{#3}% % % For pdftex, we have to write out the node definition (aka, make % the pdfdest) after any page break, but before the actual text has % been typeset. If the destination for the pdf outline is after the % text, then jumping from the outline may wind up with the text not % being visible, for instance under high magnification. \donoderef{#2}% % % Typeset the actual heading. \nobreak % Avoid page breaks at the interline glue. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright \hangindent=\wd0 \centerparametersmaybe \unhbox0 #1\par}% }% \nobreak\bigskip % no page break after a chapter title \nobreak } % @centerchap -- centered and unnumbered. \let\centerparametersmaybe = \relax \def\centerparameters{% \advance\rightskip by 3\rightskip \leftskip = \rightskip \parfillskip = 0pt } % I don't think this chapter style is supported any more, so I'm not % updating it with the new noderef stuff. We'll see. --karl, 11aug03. % \def\setchapterstyle #1 {\csname CHAPF#1\endcsname} % \def\unnchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\ptexraggedright \rmisbold #1\hfill}}\bigskip \par\nobreak } \def\chfopen #1#2{\chapoddpage {\chapfonts \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% \par\penalty 5000 % } \def\centerchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt \hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak } \def\CHAPFopen{% \global\let\chapmacro=\chfopen \global\let\centerchapmacro=\centerchfopen} % Section titles. These macros combine the section number parts and % call the generic \sectionheading to do the printing. % \newskip\secheadingskip \def\secheadingbreak{\dobreak \secheadingskip{-1000}} % Subsection titles. \newskip\subsecheadingskip \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} % Subsubsection titles. \def\subsubsecheadingskip{\subsecheadingskip} \def\subsubsecheadingbreak{\subsecheadingbreak} % Print any size, any type, section title. % % #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is % the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the % section number. % \def\seckeyword{sec} % \def\sectionheading#1#2#3#4{% {% \checkenv{}% should not be in an environment. % % Switch to the right set of fonts. \csname #2fonts\endcsname \rmisbold % \def\sectionlevel{#2}% \def\temptype{#3}% % % Insert first mark before the heading break (see notes for \domark). \let\prevsectiondefs=\lastsectiondefs \ifx\temptype\Ynothingkeyword \ifx\sectionlevel\seckeyword \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% \gdef\thissection{\thissectionname}}% \fi \else\ifx\temptype\Yomitfromtockeyword % Don't redefine \thissection. \else\ifx\temptype\Yappendixkeyword \ifx\sectionlevel\seckeyword \toks0={#1}% \xdef\lastsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% % \noexpand\putwordSection avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thissection{\noexpand\putwordSection{} \noexpand\thissectionnum: \noexpand\thissectionname}% }% \fi \else \ifx\sectionlevel\seckeyword \toks0={#1}% \xdef\lastsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% % \noexpand\putwordSection avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thissection{\noexpand\putwordSection{} \noexpand\thissectionnum: \noexpand\thissectionname}% }% \fi \fi\fi\fi % % Go into vertical mode. Usually we'll already be there, but we % don't want the following whatsit to end up in a preceding paragraph % if the document didn't happen to have a blank line. \par % % Output the mark. Pass it through \safewhatsit, to take care of % the preceding space. \safewhatsit\domark % % Insert space above the heading. \csname #2headingbreak\endcsname % % Now the second mark, after the heading break. No break points % between here and the heading. \let\prevsectiondefs=\lastsectiondefs \domark % % Only insert the space after the number if we have a section number. \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unn}% \gdef\lastsection{#1}% \else\ifx\temptype\Yomitfromtockeyword % for @headings -- no section number, don't include in toc, % and don't redefine \lastsection. \setbox0 = \hbox{}% \def\toctype{omit}% \let\sectionlevel=\empty \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{#4\enspace}% \def\toctype{app}% \gdef\lastsection{#1}% \else \setbox0 = \hbox{#4\enspace}% \def\toctype{num}% \gdef\lastsection{#1}% \fi\fi\fi % % Write the toc entry (before \donoderef). See comments in \chapmacro. \writetocentry{\toctype\sectionlevel}{#1}{#4}% % % Write the node reference (= pdf destination for pdftex). % Again, see comments in \chapmacro. \donoderef{#3}% % % Interline glue will be inserted when the vbox is completed. % That glue will be a valid breakpoint for the page, since it'll be % preceded by a whatsit (usually from the \donoderef, or from the % \writetocentry if there was no node). We don't want to allow that % break, since then the whatsits could end up on page n while the % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000. \nobreak % % Output the actual section heading. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright \hangindent=\wd0 % zero if no section number \unhbox0 #1}% }% % Add extra space after the heading -- half of whatever came above it. % Don't allow stretch, though. \kern .5 \csname #2headingskip\endcsname % % Do not let the kern be a potential breakpoint, as it would be if it % was followed by glue. \nobreak % % We'll almost certainly start a paragraph next, so don't let that % glue accumulate. (Not a breakpoint because it's preceded by a % discardable item.) \vskip-\parskip % % This is purely so the last item on the list is a known \penalty > % 10000. This is so \startdefun can avoid allowing breakpoints after % section headings. Otherwise, it would insert a valid breakpoint between: % @section sec-whatever % @deffn def-whatever \penalty 10001 } \message{toc,} % Table of contents. \newwrite\tocfile % Write an entry to the toc file, opening it if necessary. % Called from @chapter, etc. % % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} % We append the current node name (if any) and page number as additional % arguments for the \{chap,sec,...}entry macros which will eventually % read this. The node name is used in the pdf outlines as the % destination to jump to. % % We open the .toc file for writing here instead of at @setfilename (or % any other fixed time) so that @contents can be anywhere in the document. % But if #1 is `omit', then we don't do anything. This is used for the % table of contents chapter openings themselves. % \newif\iftocfileopened \def\omitkeyword{omit}% % \def\writetocentry#1#2#3{% \edef\writetoctype{#1}% \ifx\writetoctype\omitkeyword \else \iftocfileopened\else \immediate\openout\tocfile = \jobname.toc \global\tocfileopenedtrue \fi % \iflinks {\atdummies \edef\temp{% \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% \temp }% \fi \fi % % Tell \shipout to create a pdf destination on each page, if we're % writing pdf. These are used in the table of contents. We can't % just write one on every page because the title pages are numbered % 1 and 2 (the page numbers aren't printed), and so are the first % two pages of the document. Thus, we'd have two destinations named % `1', and two named `2'. \ifpdf \global\pdfmakepagedesttrue \fi } % These characters do not print properly in the Computer Modern roman % fonts, so we must take special care. This is more or less redundant % with the Texinfo input format setup at the end of this file. % \def\activecatcodes{% \catcode`\"=\active \catcode`\$=\active \catcode`\<=\active \catcode`\>=\active \catcode`\\=\active \catcode`\^=\active \catcode`\_=\active \catcode`\|=\active \catcode`\~=\active } % Read the toc file, which is essentially Texinfo input. \def\readtocfile{% \setupdatafile \activecatcodes \input \tocreadfilename } \newskip\contentsrightmargin \contentsrightmargin=1in \newcount\savepageno \newcount\lastnegativepageno \lastnegativepageno = -1 % Prepare to read what we've written to \tocfile. % \def\startcontents#1{% % If @setchapternewpage on, and @headings double, the contents should % start on an odd page, unlike chapters. Thus, we maintain % \contentsalignmacro in parallel with \pagealignmacro. % From: Torbjorn Granlund \contentsalignmacro \immediate\closeout\tocfile % % Don't need to put `Contents' or `Short Contents' in the headline. % It is abundantly clear what they are. \chapmacro{#1}{Yomitfromtoc}{}% % \savepageno = \pageno \begingroup % Set up to handle contents files properly. \raggedbottom % Worry more about breakpoints than the bottom. \advance\hsize by -\contentsrightmargin % Don't use the full line length. % % Roman numerals for page numbers. \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi } % redefined for the two-volume lispref. We always output on % \jobname.toc even if this is redefined. % \def\tocreadfilename{\jobname.toc} % Normal (long) toc. % \def\contents{% \startcontents{\putwordTOC}% \openin 1 \tocreadfilename\space \ifeof 1 \else \readtocfile \fi \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \ifeof 1 \else \pdfmakeoutlines \fi \closein 1 \endgroup \lastnegativepageno = \pageno \global\pageno = \savepageno } % And just the chapters. \def\summarycontents{% \startcontents{\putwordShortTOC}% % \let\partentry = \shortpartentry \let\numchapentry = \shortchapentry \let\appentry = \shortchapentry \let\unnchapentry = \shortunnchapentry % We want a true roman here for the page numbers. \secfonts \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl \let\tt=\shortconttt \rm \hyphenpenalty = 10000 \advance\baselineskip by 1pt % Open it up a little. \def\numsecentry##1##2##3##4{} \let\appsecentry = \numsecentry \let\unnsecentry = \numsecentry \let\numsubsecentry = \numsecentry \let\appsubsecentry = \numsecentry \let\unnsubsecentry = \numsecentry \let\numsubsubsecentry = \numsecentry \let\appsubsubsecentry = \numsecentry \let\unnsubsubsecentry = \numsecentry \openin 1 \tocreadfilename\space \ifeof 1 \else \readtocfile \fi \closein 1 \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \endgroup \lastnegativepageno = \pageno \global\pageno = \savepageno } \let\shortcontents = \summarycontents % Typeset the label for a chapter or appendix for the short contents. % The arg is, e.g., `A' for an appendix, or `3' for a chapter. % \def\shortchaplabel#1{% % This space should be enough, since a single number is .5em, and the % widest letter (M) is 1em, at least in the Computer Modern fonts. % But use \hss just in case. % (This space doesn't include the extra space that gets added after % the label; that gets put in by \shortchapentry above.) % % We'd like to right-justify chapter numbers, but that looks strange % with appendix letters. And right-justifying numbers and % left-justifying letters looks strange when there is less than 10 % chapters. Have to read the whole toc once to know how many chapters % there are before deciding ... \hbox to 1em{#1\hss}% } % These macros generate individual entries in the table of contents. % The first argument is the chapter or section name. % The last argument is the page number. % The arguments in between are the chapter number, section number, ... % Parts, in the main contents. Replace the part number, which doesn't % exist, with an empty box. Let's hope all the numbers have the same width. % Also ignore the page number, which is conventionally not printed. \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}} \def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}} % % Parts, in the short toc. \def\shortpartentry#1#2#3#4{% \penalty-300 \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip \shortchapentry{{\bf #1}}{\numeralbox}{}{}% } % Chapters, in the main contents. \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} % % Chapters, in the short toc. % See comments in \dochapentry re vbox and related settings. \def\shortchapentry#1#2#3#4{% \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% } % Appendices, in the main contents. % Need the word Appendix, and a fixed-size box. % \def\appendixbox#1{% % We use M since it's probably the widest letter. \setbox0 = \hbox{\putwordAppendix{} M}% \hbox to \wd0{\putwordAppendix{} #1\hss}} % \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} % Unnumbered chapters. \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} % Sections. \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} \let\appsecentry=\numsecentry \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} % Subsections. \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} \let\appsubsecentry=\numsubsecentry \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} % And subsubsections. \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} \let\appsubsubsecentry=\numsubsubsecentry \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} % This parameter controls the indentation of the various levels. % Same as \defaultparindent. \newdimen\tocindent \tocindent = 15pt % Now for the actual typesetting. In all these, #1 is the text and #2 is the % page number. % % If the toc has to be broken over pages, we want it to be at chapters % if at all possible; hence the \penalty. \def\dochapentry#1#2{% \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip \begingroup \chapentryfonts \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup \nobreak\vskip .25\baselineskip plus.1\baselineskip } \def\dosecentry#1#2{\begingroup \secentryfonts \leftskip=\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} \def\dosubsecentry#1#2{\begingroup \subsecentryfonts \leftskip=2\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} \def\dosubsubsecentry#1#2{\begingroup \subsubsecentryfonts \leftskip=3\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} % We use the same \entry macro as for the index entries. \let\tocentry = \entry % Space between chapter (or whatever) number and the title. \def\labelspace{\hskip1em \relax} \def\dopageno#1{{\rm #1}} \def\doshortpageno#1{{\rm #1}} \def\chapentryfonts{\secfonts \rm} \def\secentryfonts{\textfonts} \def\subsecentryfonts{\textfonts} \def\subsubsecentryfonts{\textfonts} \message{environments,} % @foo ... @end foo. % @tex ... @end tex escapes into raw TeX temporarily. % One exception: @ is still an escape character, so that @end tex works. % But \@ or @@ will get a plain @ character. \envdef\tex{% \setupmarkupstyle{tex}% \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie \catcode `\%=14 \catcode `\+=\other \catcode `\"=\other \catcode `\|=\other \catcode `\<=\other \catcode `\>=\other \catcode`\`=\other \catcode`\'=\other \escapechar=`\\ % % ' is active in math mode (mathcode"8000). So reset it, and all our % other math active characters (just in case), to plain's definitions. \mathactive % \let\b=\ptexb \let\bullet=\ptexbullet \let\c=\ptexc \let\,=\ptexcomma \let\.=\ptexdot \let\dots=\ptexdots \let\equiv=\ptexequiv \let\!=\ptexexclam \let\i=\ptexi \let\indent=\ptexindent \let\noindent=\ptexnoindent \let\{=\ptexlbrace \let\+=\tabalign \let\}=\ptexrbrace \let\/=\ptexslash \let\*=\ptexstar \let\t=\ptext \expandafter \let\csname top\endcsname=\ptextop % outer \let\frenchspacing=\plainfrenchspacing % \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% \def\@{@}% } % There is no need to define \Etex. % Define @lisp ... @end lisp. % @lisp environment forms a group so it can rebind things, % including the definition of @end lisp (which normally is erroneous). % Amount to narrow the margins by for @lisp. \newskip\lispnarrowing \lispnarrowing=0.4in % This is the definition that ^^M gets inside @lisp, @example, and other % such environments. \null is better than a space, since it doesn't % have any width. \def\lisppar{\null\endgraf} % This space is always present above and below environments. \newskip\envskipamount \envskipamount = 0pt % Make spacing and below environment symmetrical. We use \parskip here % to help in doing that, since in @example-like environments \parskip % is reset to zero; thus the \afterenvbreak inserts no space -- but the % start of the next paragraph will insert \parskip. % \def\aboveenvbreak{{% % =10000 instead of <10000 because of a special case in \itemzzz and % \sectionheading, q.v. \ifnum \lastpenalty=10000 \else \advance\envskipamount by \parskip \endgraf \ifdim\lastskip<\envskipamount \removelastskip % it's not a good place to break if the last penalty was \nobreak % or better ... \ifnum\lastpenalty<10000 \penalty-50 \fi \vskip\envskipamount \fi \fi }} \let\afterenvbreak = \aboveenvbreak % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will % also clear it, so that its embedded environments do the narrowing again. \let\nonarrowing=\relax % @cartouche ... @end cartouche: draw rectangle w/rounded corners around % environment contents. \font\circle=lcircle10 \newdimen\circthick \newdimen\cartouter\newdimen\cartinner \newskip\normbskip\newskip\normpskip\newskip\normlskip \circthick=\fontdimen8\circle % \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth \def\ctr{{\hskip 6pt\circle\char'010}} \def\cbl{{\circle\char'012\hskip -6pt}} \def\cbr{{\hskip 6pt\circle\char'011}} \def\carttop{\hbox to \cartouter{\hskip\lskip \ctl\leaders\hrule height\circthick\hfil\ctr \hskip\rskip}} \def\cartbot{\hbox to \cartouter{\hskip\lskip \cbl\leaders\hrule height\circthick\hfil\cbr \hskip\rskip}} % \newskip\lskip\newskip\rskip \envdef\cartouche{% \ifhmode\par\fi % can't be in the midst of a paragraph. \startsavinginserts \lskip=\leftskip \rskip=\rightskip \leftskip=0pt\rightskip=0pt % we want these *outside*. \cartinner=\hsize \advance\cartinner by-\lskip \advance\cartinner by-\rskip \cartouter=\hsize \advance\cartouter by 18.4pt % allow for 3pt kerns on either % side, and for 6pt waste from % each corner char, and rule thickness \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip % Flag to tell @lisp, etc., not to narrow margin. \let\nonarrowing = t% % % If this cartouche directly follows a sectioning command, we need the % \parskip glue (backspaced over by default) or the cartouche can % collide with the section heading. \ifnum\lastpenalty>10000 \vskip\parskip \fi % \vbox\bgroup \baselineskip=0pt\parskip=0pt\lineskip=0pt \carttop \hbox\bgroup \hskip\lskip \vrule\kern3pt \vbox\bgroup \kern3pt \hsize=\cartinner \baselineskip=\normbskip \lineskip=\normlskip \parskip=\normpskip \vskip -\parskip \comment % For explanation, see the end of def\group. } \def\Ecartouche{% \ifhmode\par\fi \kern3pt \egroup \kern3pt\vrule \hskip\rskip \egroup \cartbot \egroup \checkinserts } % This macro is called at the beginning of all the @example variants, % inside a group. \newdimen\nonfillparindent \def\nonfillstart{% \aboveenvbreak \hfuzz = 12pt % Don't be fussy \sepspaces % Make spaces be word-separators rather than space tokens. \let\par = \lisppar % don't ignore blank lines \obeylines % each line of input is a line of output \parskip = 0pt % Turn off paragraph indentation but redefine \indent to emulate % the normal \indent. \nonfillparindent=\parindent \parindent = 0pt \let\indent\nonfillindent % \emergencystretch = 0pt % don't try to avoid overfull boxes \ifx\nonarrowing\relax \advance \leftskip by \lispnarrowing \exdentamount=\lispnarrowing \else \let\nonarrowing = \relax \fi \let\exdent=\nofillexdent } \begingroup \obeyspaces % We want to swallow spaces (but not other tokens) after the fake % @indent in our nonfill-environments, where spaces are normally % active and set to @tie, resulting in them not being ignored after % @indent. \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}% \gdef\nonfillindentcheck{% \ifx\temp % \expandafter\nonfillindentgobble% \else% \leavevmode\nonfillindentbox% \fi% }% \endgroup \def\nonfillindentgobble#1{\nonfillindent} \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}} % If you want all examples etc. small: @set dispenvsize small. % If you want even small examples the full size: @set dispenvsize nosmall. % This affects the following displayed environments: % @example, @display, @format, @lisp % \def\smallword{small} \def\nosmallword{nosmall} \let\SETdispenvsize\relax \def\setnormaldispenv{% \ifx\SETdispenvsize\smallword % end paragraph for sake of leading, in case document has no blank % line. This is redundant with what happens in \aboveenvbreak, but % we need to do it before changing the fonts, and it's inconvenient % to change the fonts afterward. \ifnum \lastpenalty=10000 \else \endgraf \fi \smallexamplefonts \rm \fi } \def\setsmalldispenv{% \ifx\SETdispenvsize\nosmallword \else \ifnum \lastpenalty=10000 \else \endgraf \fi \smallexamplefonts \rm \fi } % We often define two environments, @foo and @smallfoo. % Let's do it in one command. #1 is the env name, #2 the definition. \def\makedispenvdef#1#2{% \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}% \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}% \expandafter\let\csname E#1\endcsname \afterenvbreak \expandafter\let\csname Esmall#1\endcsname \afterenvbreak } % Define two environment synonyms (#1 and #2) for an environment. \def\maketwodispenvdef#1#2#3{% \makedispenvdef{#1}{#3}% \makedispenvdef{#2}{#3}% } % % @lisp: indented, narrowed, typewriter font; % @example: same as @lisp. % % @smallexample and @smalllisp: use smaller fonts. % Originally contributed by Pavel@xerox. % \maketwodispenvdef{lisp}{example}{% \nonfillstart \tt\setupmarkupstyle{example}% \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. \gobble % eat return } % @display/@smalldisplay: same as @lisp except keep current font. % \makedispenvdef{display}{% \nonfillstart \gobble } % @format/@smallformat: same as @display except don't narrow margins. % \makedispenvdef{format}{% \let\nonarrowing = t% \nonfillstart \gobble } % @flushleft: same as @format, but doesn't obey \SETdispenvsize. \envdef\flushleft{% \let\nonarrowing = t% \nonfillstart \gobble } \let\Eflushleft = \afterenvbreak % @flushright. % \envdef\flushright{% \let\nonarrowing = t% \nonfillstart \advance\leftskip by 0pt plus 1fill\relax \gobble } \let\Eflushright = \afterenvbreak % @raggedright does more-or-less normal line breaking but no right % justification. From plain.tex. \envdef\raggedright{% \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax } \let\Eraggedright\par \envdef\raggedleft{% \parindent=0pt \leftskip0pt plus2em \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt \hbadness=10000 % Last line will usually be underfull, so turn off % badness reporting. } \let\Eraggedleft\par \envdef\raggedcenter{% \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt \hbadness=10000 % Last line will usually be underfull, so turn off % badness reporting. } \let\Eraggedcenter\par % @quotation does normal linebreaking (hence we can't use \nonfillstart) % and narrows the margins. We keep \parskip nonzero in general, since % we're doing normal filling. So, when using \aboveenvbreak and % \afterenvbreak, temporarily make \parskip 0. % \makedispenvdef{quotation}{\quotationstart} % \def\quotationstart{% {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip \parindent=0pt % % @cartouche defines \nonarrowing to inhibit narrowing at next level down. \ifx\nonarrowing\relax \advance\leftskip by \lispnarrowing \advance\rightskip by \lispnarrowing \exdentamount = \lispnarrowing \else \let\nonarrowing = \relax \fi \parsearg\quotationlabel } % We have retained a nonzero parskip for the environment, since we're % doing normal filling. % \def\Equotation{% \par \ifx\quotationauthor\thisisundefined\else % indent a bit. \leftline{\kern 2\leftskip \sl ---\quotationauthor}% \fi {\parskip=0pt \afterenvbreak}% } \def\Esmallquotation{\Equotation} % If we're given an argument, typeset it in bold with a colon after. \def\quotationlabel#1{% \def\temp{#1}% \ifx\temp\empty \else {\bf #1: }% \fi } % LaTeX-like @verbatim...@end verbatim and @verb{...} % If we want to allow any as delimiter, % we need the curly braces so that makeinfo sees the @verb command, eg: % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org % % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. % % [Knuth] p.344; only we need to do the other characters Texinfo sets % active too. Otherwise, they get lost as the first character on a % verbatim line. \def\dospecials{% \do\ \do\\\do\{\do\}\do\$\do\&% \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% \do\<\do\>\do\|\do\@\do+\do\"% % Don't do the quotes -- if we do, @set txicodequoteundirected and % @set txicodequotebacktick will not have effect on @verb and % @verbatim, and ?` and !` ligatures won't get disabled. %\do\`\do\'% } % % [Knuth] p. 380 \def\uncatcodespecials{% \def\do##1{\catcode`##1=\other}\dospecials} % % Setup for the @verb command. % % Eight spaces for a tab \begingroup \catcode`\^^I=\active \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} \endgroup % \def\setupverb{% \tt % easiest (and conventionally used) font for verbatim \def\par{\leavevmode\endgraf}% \setupmarkupstyle{verb}% \tabeightspaces % Respect line breaks, % print special symbols as themselves, and % make each space count % must do in this order: \obeylines \uncatcodespecials \sepspaces } % Setup for the @verbatim environment % % Real tab expansion. \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount % % We typeset each line of the verbatim in an \hbox, so we can handle % tabs. The \global is in case the verbatim line starts with an accent, % or some other command that starts with a begin-group. Otherwise, the % entire \verbbox would disappear at the corresponding end-group, before % it is typeset. Meanwhile, we can't have nested verbatim commands % (can we?), so the \global won't be overwriting itself. \newbox\verbbox \def\starttabbox{\global\setbox\verbbox=\hbox\bgroup} % \begingroup \catcode`\^^I=\active \gdef\tabexpand{% \catcode`\^^I=\active \def^^I{\leavevmode\egroup \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab \divide\dimen\verbbox by\tabw \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox }% } \endgroup % start the verbatim environment. \def\setupverbatim{% \let\nonarrowing = t% \nonfillstart \tt % easiest (and conventionally used) font for verbatim % The \leavevmode here is for blank lines. Otherwise, we would % never \starttabox and the \egroup would end verbatim mode. \def\par{\leavevmode\egroup\box\verbbox\endgraf}% \tabexpand \setupmarkupstyle{verbatim}% % Respect line breaks, % print special symbols as themselves, and % make each space count. % Must do in this order: \obeylines \uncatcodespecials \sepspaces \everypar{\starttabbox}% } % Do the @verb magic: verbatim text is quoted by unique % delimiter characters. Before first delimiter expect a % right brace, after last delimiter expect closing brace: % % \def\doverb'{'#1'}'{#1} % % [Knuth] p. 382; only eat outer {} \begingroup \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] \endgroup % \def\verb{\begingroup\setupverb\doverb} % % % Do the @verbatim magic: define the macro \doverbatim so that % the (first) argument ends when '@end verbatim' is reached, ie: % % \def\doverbatim#1@end verbatim{#1} % % For Texinfo it's a lot easier than for LaTeX, % because texinfo's \verbatim doesn't stop at '\end{verbatim}': % we need not redefine '\', '{' and '}'. % % Inspired by LaTeX's verbatim command set [latex.ltx] % \begingroup \catcode`\ =\active \obeylines % % ignore everything up to the first ^^M, that's the newline at the end % of the @verbatim input line itself. Otherwise we get an extra blank % line in the output. \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% % We really want {...\end verbatim} in the body of the macro, but % without the active space; thus we have to use \xdef and \gobble. \endgroup % \envdef\verbatim{% \setupverbatim\doverbatim } \let\Everbatim = \afterenvbreak % @verbatiminclude FILE - insert text of file in verbatim environment. % \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} % \def\doverbatiminclude#1{% {% \makevalueexpandable \setupverbatim \indexnofonts % Allow `@@' and other weird things in file names. \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% \input #1 \afterenvbreak }% } % @copying ... @end copying. % Save the text away for @insertcopying later. % % We save the uninterpreted tokens, rather than creating a box. % Saving the text in a box would be much easier, but then all the % typesetting commands (@smallbook, font changes, etc.) have to be done % beforehand -- and a) we want @copying to be done first in the source % file; b) letting users define the frontmatter in as flexible order as % possible is very desirable. % \def\copying{\checkenv{}\begingroup\scanargctxt\docopying} \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} % \def\insertcopying{% \begingroup \parindent = 0pt % paragraph indentation looks wrong on title page \scanexp\copyingtext \endgroup } \message{defuns,} % @defun etc. \newskip\defbodyindent \defbodyindent=.4in \newskip\defargsindent \defargsindent=50pt \newskip\deflastargmargin \deflastargmargin=18pt \newcount\defunpenalty % Start the processing of @deffn: \def\startdefun{% \ifnum\lastpenalty<10000 \medbreak \defunpenalty=10003 % Will keep this @deffn together with the % following @def command, see below. \else % If there are two @def commands in a row, we'll have a \nobreak, % which is there to keep the function description together with its % header. But if there's nothing but headers, we need to allow a % break somewhere. Check specifically for penalty 10002, inserted % by \printdefunline, instead of 10000, since the sectioning % commands also insert a nobreak penalty, and we don't want to allow % a break between a section heading and a defun. % % As a further refinement, we avoid "club" headers by signalling % with penalty of 10003 after the very first @deffn in the % sequence (see above), and penalty of 10002 after any following % @def command. \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi % % Similarly, after a section heading, do not allow a break. % But do insert the glue. \medskip % preceded by discardable penalty, so not a breakpoint \fi % \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent } \def\dodefunx#1{% % First, check whether we are in the right environment: \checkenv#1% % % As above, allow line break if we have multiple x headers in a row. % It's not a great place, though. \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi % % And now, it's time to reuse the body of the original defun: \expandafter\gobbledefun#1% } \def\gobbledefun#1\startdefun{} % \printdefunline \deffnheader{text} % \def\printdefunline#1#2{% \begingroup % call \deffnheader: #1#2 \endheader % common ending: \interlinepenalty = 10000 \advance\rightskip by 0pt plus 1fil\relax \endgraf \nobreak\vskip -\parskip \penalty\defunpenalty % signal to \startdefun and \dodefunx % Some of the @defun-type tags do not enable magic parentheses, % rendering the following check redundant. But we don't optimize. \checkparencounts \endgroup } \def\Edefun{\endgraf\medbreak} % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; % the only thing remaining is to define \deffnheader. % \def\makedefun#1{% \expandafter\let\csname E#1\endcsname = \Edefun \edef\temp{\noexpand\domakedefun \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% \temp } % \domakedefun \deffn \deffnx \deffnheader % % Define \deffn and \deffnx, without parameters. % \deffnheader has to be defined explicitly. % \def\domakedefun#1#2#3{% \envdef#1{% \startdefun \doingtypefnfalse % distinguish typed functions from all else \parseargusing\activeparens{\printdefunline#3}% }% \def#2{\dodefunx#1}% \def#3% } \newif\ifdoingtypefn % doing typed function? \newif\ifrettypeownline % typeset return type on its own line? % @deftypefnnewline on|off says whether the return type of typed functions % are printed on their own line. This affects @deftypefn, @deftypefun, % @deftypeop, and @deftypemethod. % \parseargdef\deftypefnnewline{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETtxideftypefnnl\endcsname = \empty \else\ifx\temp\offword \expandafter\let\csname SETtxideftypefnnl\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @txideftypefnnl value `\temp', must be on|off}% \fi\fi } % Untyped functions: % @deffn category name args \makedefun{deffn}{\deffngeneral{}} % @deffn category class name args \makedefun{defop}#1 {\defopon{#1\ \putwordon}} % \defopon {category on}class name args \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } % \deffngeneral {subind}category name args % \def\deffngeneral#1#2 #3 #4\endheader{% % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. \dosubind{fn}{\code{#3}}{#1}% \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% } % Typed functions: % @deftypefn category type name args \makedefun{deftypefn}{\deftypefngeneral{}} % @deftypeop category class type name args \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} % \deftypeopon {category on}class type name args \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } % \deftypefngeneral {subind}category type name args % \def\deftypefngeneral#1#2 #3 #4 #5\endheader{% \dosubind{fn}{\code{#4}}{#1}% \doingtypefntrue \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } % Typed variables: % @deftypevr category type var args \makedefun{deftypevr}{\deftypecvgeneral{}} % @deftypecv category class type var args \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} % \deftypecvof {category of}class type var args \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } % \deftypecvgeneral {subind}category type var args % \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% \dosubind{vr}{\code{#4}}{#1}% \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } % Untyped variables: % @defvr category var args \makedefun{defvr}#1 {\deftypevrheader{#1} {} } % @defcv category class var args \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} % \defcvof {category of}class var args \def\defcvof#1#2 {\deftypecvof{#1}#2 {} } % Types: % @deftp category name args \makedefun{deftp}#1 #2 #3\endheader{% \doind{tp}{\code{#2}}% \defname{#1}{}{#2}\defunargs{#3\unskip}% } % Remaining @defun-like shortcuts: \makedefun{defun}{\deffnheader{\putwordDeffunc} } \makedefun{defmac}{\deffnheader{\putwordDefmac} } \makedefun{defspec}{\deffnheader{\putwordDefspec} } \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } \makedefun{defvar}{\defvrheader{\putwordDefvar} } \makedefun{defopt}{\defvrheader{\putwordDefopt} } \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } \makedefun{defmethod}{\defopon\putwordMethodon} \makedefun{deftypemethod}{\deftypeopon\putwordMethodon} \makedefun{defivar}{\defcvof\putwordInstanceVariableof} \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} % \defname, which formats the name of the @def (not the args). % #1 is the category, such as "Function". % #2 is the return type, if any. % #3 is the function name. % % We are followed by (but not passed) the arguments, if any. % \def\defname#1#2#3{% \par % Get the values of \leftskip and \rightskip as they were outside the @def... \advance\leftskip by -\defbodyindent % % Determine if we are typesetting the return type of a typed function % on a line by itself. \rettypeownlinefalse \ifdoingtypefn % doing a typed function specifically? % then check user option for putting return type on its own line: \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else \rettypeownlinetrue \fi \fi % % How we'll format the category name. Putting it in brackets helps % distinguish it from the body text that may end up on the next line % just below it. \def\temp{#1}% \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} % % Figure out line sizes for the paragraph shape. We'll always have at % least two. \tempnum = 2 % % The first line needs space for \box0; but if \rightskip is nonzero, % we need only space for the part of \box0 which exceeds it: \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip % % If doing a return type on its own line, we'll have another line. \ifrettypeownline \advance\tempnum by 1 \def\maybeshapeline{0in \hsize}% \else \def\maybeshapeline{}% \fi % % The continuations: \dimen2=\hsize \advance\dimen2 by -\defargsindent % % The final paragraph shape: \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2 % % Put the category name at the right margin. \noindent \hbox to 0pt{% \hfil\box0 \kern-\hsize % \hsize has to be shortened this way: \kern\leftskip % Intentionally do not respect \rightskip, since we need the space. }% % % Allow all lines to be underfull without complaint: \tolerance=10000 \hbadness=10000 \exdentamount=\defbodyindent {% % defun fonts. We use typewriter by default (used to be bold) because: % . we're printing identifiers, they should be in tt in principle. % . in languages with many accents, such as Czech or French, it's % common to leave accents off identifiers. The result looks ok in % tt, but exceedingly strange in rm. % . we don't want -- and --- to be treated as ligatures. % . this still does not fix the ?` and !` ligatures, but so far no % one has made identifiers using them :). \df \tt \def\temp{#2}% text of the return type \ifx\temp\empty\else \tclose{\temp}% typeset the return type \ifrettypeownline % put return type on its own line; prohibit line break following: \hfil\vadjust{\nobreak}\break \else \space % type on same line, so just followed by a space \fi \fi % no return type #3% output function name }% {\rm\enskip}% hskip 0.5 em of \tenrm % \boldbrax % arguments will be output next, if any. } % Print arguments in slanted roman (not ttsl), inconsistently with using % tt for the name. This is because literal text is sometimes needed in % the argument list (groff manual), and ttsl and tt are not very % distinguishable. Prevent hyphenation at `-' chars. % \def\defunargs#1{% % use sl by default (not ttsl), % tt for the names. \df \sl \hyphenchar\font=0 % % On the other hand, if an argument has two dashes (for instance), we % want a way to get ttsl. Let's try @var for that. \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}% #1% \sl\hyphenchar\font=45 } % We want ()&[] to print specially on the defun line. % \def\activeparens{% \catcode`\(=\active \catcode`\)=\active \catcode`\[=\active \catcode`\]=\active \catcode`\&=\active } % Make control sequences which act like normal parenthesis chars. \let\lparen = ( \let\rparen = ) % Be sure that we always have a definition for `(', etc. For example, % if the fn name has parens in it, \boldbrax will not be in effect yet, % so TeX would otherwise complain about undefined control sequence. { \activeparens \global\let(=\lparen \global\let)=\rparen \global\let[=\lbrack \global\let]=\rbrack \global\let& = \& \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} \gdef\magicamp{\let&=\amprm} } \newcount\parencount % If we encounter &foo, then turn on ()-hacking afterwards \newif\ifampseen \def\amprm#1 {\ampseentrue{\bf\ }} \def\parenfont{% \ifampseen % At the first level, print parens in roman, % otherwise use the default font. \ifnum \parencount=1 \rm \fi \else % The \sf parens (in \boldbrax) actually are a little bolder than % the contained text. This is especially needed for [ and ] . \sf \fi } \def\infirstlevel#1{% \ifampseen \ifnum\parencount=1 #1% \fi \fi } \def\bfafterword#1 {#1 \bf} \def\opnr{% \global\advance\parencount by 1 {\parenfont(}% \infirstlevel \bfafterword } \def\clnr{% {\parenfont)}% \infirstlevel \sl \global\advance\parencount by -1 } \newcount\brackcount \def\lbrb{% \global\advance\brackcount by 1 {\bf[}% } \def\rbrb{% {\bf]}% \global\advance\brackcount by -1 } \def\checkparencounts{% \ifnum\parencount=0 \else \badparencount \fi \ifnum\brackcount=0 \else \badbrackcount \fi } % these should not use \errmessage; the glibc manual, at least, actually % has such constructs (when documenting function pointers). \def\badparencount{% \message{Warning: unbalanced parentheses in @def...}% \global\parencount=0 } \def\badbrackcount{% \message{Warning: unbalanced square brackets in @def...}% \global\brackcount=0 } \message{macros,} % @macro. % To do this right we need a feature of e-TeX, \scantokens, % which we arrange to emulate with a temporary file in ordinary TeX. \ifx\eTeXversion\thisisundefined \newwrite\macscribble \def\scantokens#1{% \toks0={#1}% \immediate\openout\macscribble=\jobname.tmp \immediate\write\macscribble{\the\toks0}% \immediate\closeout\macscribble \input \jobname.tmp } \fi \def\scanmacro#1{\begingroup \newlinechar`\^^M \let\xeatspaces\eatspaces % % Undo catcode changes of \startcontents and \doprintindex % When called from @insertcopying or (short)caption, we need active % backslash to get it printed correctly. Previously, we had % \catcode`\\=\other instead. We'll see whether a problem appears % with macro expansion. --kasal, 19aug04 \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ % % ... and for \example: \spaceisspace % % The \empty here causes a following catcode 5 newline to be eaten as % part of reading whitespace after a control sequence. It does not % eat a catcode 13 newline. There's no good way to handle the two % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX % would then have different behavior). See the Macro Details node in % the manual for the workaround we recommend for macros and % line-oriented commands. % \scantokens{#1\empty}% \endgroup} \def\scanexp#1{% \edef\temp{\noexpand\scanmacro{#1}}% \temp } \newcount\paramno % Count of parameters \newtoks\macname % Macro name \newif\ifrecursive % Is it recursive? % List of all defined macros in the form % \definedummyword\macro1\definedummyword\macro2... % Currently is also contains all @aliases; the list can be split % if there is a need. \def\macrolist{} % Add the macro to \macrolist \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} \def\addtomacrolistxxx#1{% \toks0 = \expandafter{\macrolist\definedummyword#1}% \xdef\macrolist{\the\toks0}% } % Utility routines. % This does \let #1 = #2, with \csnames; that is, % \let \csname#1\endcsname = \csname#2\endcsname % (except of course we have to play expansion games). % \def\cslet#1#2{% \expandafter\let \csname#1\expandafter\endcsname \csname#2\endcsname } % Trim leading and trailing spaces off a string. % Concepts from aro-bend problem 15 (see CTAN). {\catcode`\@=11 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} \def\unbrace#1{#1} \unbrace{\gdef\trim@@@ #1 } #2@{#1} } % Trim a single trailing ^^M off a string. {\catcode`\^^M=\other \catcode`\Q=3% \gdef\eatcr #1{\eatcra #1Q^^MQ}% \gdef\eatcra#1^^MQ{\eatcrb#1Q}% \gdef\eatcrb#1Q#2Q{#1}% } % Macro bodies are absorbed as an argument in a context where % all characters are catcode 10, 11 or 12, except \ which is active % (as in normal texinfo). It is necessary to change the definition of \ % to recognize macro arguments; this is the job of \mbodybackslash. % % Non-ASCII encodings make 8-bit characters active, so un-activate % them to avoid their expansion. Must do this non-globally, to % confine the change to the current group. % % It's necessary to have hard CRs when the macro is executed. This is % done by making ^^M (\endlinechar) catcode 12 when reading the macro % body, and then making it the \newlinechar in \scanmacro. % \def\scanctxt{% used as subroutine \catcode`\"=\other \catcode`\+=\other \catcode`\<=\other \catcode`\>=\other \catcode`\@=\other \catcode`\^=\other \catcode`\_=\other \catcode`\|=\other \catcode`\~=\other \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi } \def\scanargctxt{% used for copying and captions, not macros. \scanctxt \catcode`\\=\other \catcode`\^^M=\other } \def\macrobodyctxt{% used for @macro definitions \scanctxt \catcode`\{=\other \catcode`\}=\other \catcode`\^^M=\other \usembodybackslash } \def\macroargctxt{% used when scanning invocations \scanctxt \catcode`\\=0 } % why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes" % for the single characters \ { }. Thus, we end up with the "commands" % that would be written @\ @{ @} in a Texinfo document. % % We already have @{ and @}. For @\, we define it here, and only for % this purpose, to produce a typewriter backslash (so, the @\ that we % define for @math can't be used with @macro calls): % \def\\{\normalbackslash}% % % We would like to do this for \, too, since that is what makeinfo does. % But it is not possible, because Texinfo already has a command @, for a % cedilla accent. Documents must use @comma{} instead. % % \anythingelse will almost certainly be an error of some kind. % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N % where N is the macro parameter number. % We define \csname macarg.\endcsname to be \realbackslash, so % \\ in macro replacement text gets you a backslash. % {\catcode`@=0 @catcode`@\=@active @gdef@usembodybackslash{@let\=@mbodybackslash} @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} } \expandafter\def\csname macarg.\endcsname{\realbackslash} \def\margbackslash#1{\char`\#1 } \def\macro{\recursivefalse\parsearg\macroxxx} \def\rmacro{\recursivetrue\parsearg\macroxxx} \def\macroxxx#1{% \getargs{#1}% now \macname is the macname and \argl the arglist \ifx\argl\empty % no arguments \paramno=0\relax \else \expandafter\parsemargdef \argl;% \if\paramno>256\relax \ifx\eTeXversion\thisisundefined \errhelp = \EMsimple \errmessage{You need eTeX to compile a file with macros with more than 256 arguments} \fi \fi \fi \if1\csname ismacro.\the\macname\endcsname \message{Warning: redefining \the\macname}% \else \expandafter\ifx\csname \the\macname\endcsname \relax \else \errmessage{Macro name \the\macname\space already defined}\fi \global\cslet{macsave.\the\macname}{\the\macname}% \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% \addtomacrolist{\the\macname}% \fi \begingroup \macrobodyctxt \ifrecursive \expandafter\parsermacbody \else \expandafter\parsemacbody \fi} \parseargdef\unmacro{% \if1\csname ismacro.#1\endcsname \global\cslet{#1}{macsave.#1}% \global\expandafter\let \csname ismacro.#1\endcsname=0% % Remove the macro name from \macrolist: \begingroup \expandafter\let\csname#1\endcsname \relax \let\definedummyword\unmacrodo \xdef\macrolist{\macrolist}% \endgroup \else \errmessage{Macro #1 not defined}% \fi } % Called by \do from \dounmacro on each macro. The idea is to omit any % macro definitions that have been changed to \relax. % \def\unmacrodo#1{% \ifx #1\relax % remove this \else \noexpand\definedummyword \noexpand#1% \fi } % This makes use of the obscure feature that if the last token of a % is #, then the preceding argument is delimited by % an opening brace, and that opening brace is not consumed. \def\getargs#1{\getargsxxx#1{}} \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} \def\getmacname#1 #2\relax{\macname={#1}} \def\getmacargs#1{\def\argl{#1}} % For macro processing make @ a letter so that we can make Texinfo private macro names. \edef\texiatcatcode{\the\catcode`\@} \catcode `@=11\relax % Parse the optional {params} list. Set up \paramno and \paramlist % so \defmacro knows what to do. Define \macarg.BLAH for each BLAH % in the params list to some hook where the argument si to be expanded. If % there are less than 10 arguments that hook is to be replaced by ##N where N % is the position in that list, that is to say the macro arguments are to be % defined `a la TeX in the macro body. % % That gets used by \mbodybackslash (above). % % We need to get `macro parameter char #' into several definitions. % The technique used is stolen from LaTeX: let \hash be something % unexpandable, insert that wherever you need a #, and then redefine % it to # just before using the token list produced. % % The same technique is used to protect \eatspaces till just before % the macro is used. % % If there are 10 or more arguments, a different technique is used, where the % hook remains in the body, and when macro is to be expanded the body is % processed again to replace the arguments. % % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the % argument N value and then \edef the body (nothing else will expand because of % the catcode regime underwhich the body was input). % % If you compile with TeX (not eTeX), and you have macros with 10 or more % arguments, you need that no macro has more than 256 arguments, otherwise an % error is produced. \def\parsemargdef#1;{% \paramno=0\def\paramlist{}% \let\hash\relax \let\xeatspaces\relax \parsemargdefxxx#1,;,% % In case that there are 10 or more arguments we parse again the arguments % list to set new definitions for the \macarg.BLAH macros corresponding to % each BLAH argument. It was anyhow needed to parse already once this list % in order to count the arguments, and as macros with at most 9 arguments % are by far more frequent than macro with 10 or more arguments, defining % twice the \macarg.BLAH macros does not cost too much processing power. \ifnum\paramno<10\relax\else \paramno0\relax \parsemmanyargdef@@#1,;,% 10 or more arguments \fi } \def\parsemargdefxxx#1,{% \if#1;\let\next=\relax \else \let\next=\parsemargdefxxx \advance\paramno by 1 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname {\xeatspaces{\hash\the\paramno}}% \edef\paramlist{\paramlist\hash\the\paramno,}% \fi\next} \def\parsemmanyargdef@@#1,{% \if#1;\let\next=\relax \else \let\next=\parsemmanyargdef@@ \edef\tempb{\eatspaces{#1}}% \expandafter\def\expandafter\tempa \expandafter{\csname macarg.\tempb\endcsname}% % Note that we need some extra \noexpand\noexpand, this is because we % don't want \the to be expanded in the \parsermacbody as it uses an % \xdef . \expandafter\edef\tempa {\noexpand\noexpand\noexpand\the\toks\the\paramno}% \advance\paramno by 1\relax \fi\next} % These two commands read recursive and nonrecursive macro bodies. % (They're different since rec and nonrec macros end differently.) % \catcode `\@\texiatcatcode \long\def\parsemacbody#1@end macro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% \long\def\parsermacbody#1@end rmacro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% \catcode `\@=11\relax \let\endargs@\relax \let\nil@\relax \def\nilm@{\nil@}% \long\def\nillm@{\nil@}% % This macro is expanded during the Texinfo macro expansion, not during its % definition. It gets all the arguments values and assigns them to macros % macarg.ARGNAME % % #1 is the macro name % #2 is the list of argument names % #3 is the list of argument values \def\getargvals@#1#2#3{% \def\macargdeflist@{}% \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion. \def\paramlist{#2,\nil@}% \def\macroname{#1}% \begingroup \macroargctxt \def\argvaluelist{#3,\nil@}% \def\@tempa{#3}% \ifx\@tempa\empty \setemptyargvalues@ \else \getargvals@@ \fi } % \def\getargvals@@{% \ifx\paramlist\nilm@ % Some sanity check needed here that \argvaluelist is also empty. \ifx\argvaluelist\nillm@ \else \errhelp = \EMsimple \errmessage{Too many arguments in macro `\macroname'!}% \fi \let\next\macargexpandinbody@ \else \ifx\argvaluelist\nillm@ % No more arguments values passed to macro. Set remaining named-arg % macros to empty. \let\next\setemptyargvalues@ \else % pop current arg name into \@tempb \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}% \expandafter\@tempa\expandafter{\paramlist}% % pop current argument value into \@tempc \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}% \expandafter\@tempa\expandafter{\argvaluelist}% % Here \@tempb is the current arg name and \@tempc is the current arg value. % First place the new argument macro definition into \@tempd \expandafter\macname\expandafter{\@tempc}% \expandafter\let\csname macarg.\@tempb\endcsname\relax \expandafter\def\expandafter\@tempe\expandafter{% \csname macarg.\@tempb\endcsname}% \edef\@tempd{\long\def\@tempe{\the\macname}}% \push@\@tempd\macargdeflist@ \let\next\getargvals@@ \fi \fi \next } \def\push@#1#2{% \expandafter\expandafter\expandafter\def \expandafter\expandafter\expandafter#2% \expandafter\expandafter\expandafter{% \expandafter#1#2}% } % Replace arguments by their values in the macro body, and place the result % in macro \@tempa \def\macvalstoargs@{% % To do this we use the property that token registers that are \the'ed % within an \edef expand only once. So we are going to place all argument % values into respective token registers. % % First we save the token context, and initialize argument numbering. \begingroup \paramno0\relax % Then, for each argument number #N, we place the corresponding argument % value into a new token list register \toks#N \expandafter\putargsintokens@\saveparamlist@,;,% % Then, we expand the body so that argument are replaced by their % values. The trick for values not to be expanded themselves is that they % are within tokens and that tokens expand only once in an \edef . \edef\@tempc{\csname mac.\macroname .body\endcsname}% % Now we restore the token stack pointer to free the token list registers % which we have used, but we make sure that expanded body is saved after % group. \expandafter \endgroup \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% } \def\macargexpandinbody@{% %% Define the named-macro outside of this group and then close this group. \expandafter \endgroup \macargdeflist@ % First the replace in body the macro arguments by their values, the result % is in \@tempa . \macvalstoargs@ % Then we point at the \norecurse or \gobble (for recursive) macro value % with \@tempb . \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname % Depending on whether it is recursive or not, we need some tailing % \egroup . \ifx\@tempb\gobble \let\@tempc\relax \else \let\@tempc\egroup \fi % And now we do the real job: \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}% \@tempd } \def\putargsintokens@#1,{% \if#1;\let\next\relax \else \let\next\putargsintokens@ % First we allocate the new token list register, and give it a temporary % alias \@tempb . \toksdef\@tempb\the\paramno % Then we place the argument value into that token list register. \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname \expandafter\@tempb\expandafter{\@tempa}% \advance\paramno by 1\relax \fi \next } % Save the token stack pointer into macro #1 \def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}} % Restore the token stack pointer from number in macro #1 \def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax} % newtoks that can be used non \outer . \def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi} % Tailing missing arguments are set to empty \def\setemptyargvalues@{% \ifx\paramlist\nilm@ \let\next\macargexpandinbody@ \else \expandafter\setemptyargvaluesparser@\paramlist\endargs@ \let\next\setemptyargvalues@ \fi \next } \def\setemptyargvaluesparser@#1,#2\endargs@{% \expandafter\def\expandafter\@tempa\expandafter{% \expandafter\def\csname macarg.#1\endcsname{}}% \push@\@tempa\macargdeflist@ \def\paramlist{#2}% } % #1 is the element target macro % #2 is the list macro % #3,#4\endargs@ is the list value \def\pop@#1#2#3,#4\endargs@{% \def#1{#3}% \def#2{#4}% } \long\def\longpop@#1#2#3,#4\endargs@{% \long\def#1{#3}% \long\def#2{#4}% } % This defines a Texinfo @macro. There are eight cases: recursive and % nonrecursive macros of zero, one, up to nine, and many arguments. % Much magic with \expandafter here. % \xdef is used so that macro definitions will survive the file % they're defined in; @include reads the file inside a group. % \def\defmacro{% \let\hash=##% convert placeholders to macro parameter chars \ifrecursive \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\scanmacro{\temp}}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup\noexpand\scanmacro{\temp}}% \else \ifnum\paramno<10\relax % at most 9 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\csname\the\macname xx\endcsname}% \expandafter\xdef\csname\the\macname xx\endcsname##1{% \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{\egroup\noexpand\scanmacro{\temp}}% \else % 10 or more \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\getargvals@{\the\macname}{\argl}% }% \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble \fi \fi \else \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \else % at most 9 \ifnum\paramno<10\relax \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \expandafter\noexpand\csname\the\macname xx\endcsname}% \expandafter\xdef\csname\the\macname xx\endcsname##1{% \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \else % 10 or more: \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\getargvals@{\the\macname}{\argl}% }% \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse \fi \fi \fi} \catcode `\@\texiatcatcode\relax \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} % \braceorline decides whether the next nonwhitespace character is a % {. If so it reads up to the closing }, if not, it reads the whole % line. Whatever was read is then fed to the next control sequence % as an argument (by \parsebrace or \parsearg). % \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} \def\braceorlinexxx{% \ifx\nchar\bgroup\else \expandafter\parsearg \fi \macnamexxx} % @alias. % We need some trickery to remove the optional spaces around the equal % sign. Make them active and then expand them all to nothing. % \def\alias{\parseargusing\obeyspaces\aliasxxx} \def\aliasxxx #1{\aliasyyy#1\relax} \def\aliasyyy #1=#2\relax{% {% \expandafter\let\obeyedspace=\empty \addtomacrolist{#1}% \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% }% \next } \message{cross references,} \newwrite\auxfile \newif\ifhavexrefs % True if xref values are known. \newif\ifwarnedxrefs % True if we warned once that they aren't known. % @inforef is relatively simple. \def\inforef #1{\inforefzzz #1,,,,**} \def\inforefzzz #1,#2,#3,#4**{% \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, node \samp{\ignorespaces#1{}}} % @node's only job in TeX is to define \lastnode, which is used in % cross-references. The @node line might or might not have commas, and % might or might not have spaces before the first comma, like: % @node foo , bar , ... % We don't want such trailing spaces in the node name. % \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} % % also remove a trailing comma, in case of something like this: % @node Help-Cross, , , Cross-refs \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} \let\nwnode=\node \let\lastnode=\empty % Write a cross-reference definition for the current node. #1 is the % type (Ynumbered, Yappendix, Ynothing). % \def\donoderef#1{% \ifx\lastnode\empty\else \setref{\lastnode}{#1}% \global\let\lastnode=\empty \fi } % @anchor{NAME} -- define xref target at arbitrary point. % \newcount\savesfregister % \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an % anchor), which consists of three parts: % 1) NAME-title - the current sectioning name taken from \lastsection, % or the anchor name. % 2) NAME-snt - section number and type, passed as the SNT arg, or % empty for anchors. % 3) NAME-pg - the page number. % % This is called from \donoderef, \anchor, and \dofloat. In the case of % floats, there is an additional part, which is not written here: % 4) NAME-lof - the text as it should appear in a @listoffloats. % \def\setref#1#2{% \pdfmkdest{#1}% \iflinks {% \atdummies % preserve commands, but don't expand them \edef\writexrdef##1##2{% \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef ##1}{##2}}% these are parameters of \writexrdef }% \toks0 = \expandafter{\lastsection}% \immediate \writexrdef{title}{\the\toks0 }% \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout }% \fi } % @xrefautosectiontitle on|off says whether @section(ing) names are used % automatically in xrefs, if the third arg is not explicitly specified. % This was provided as a "secret" @set xref-automatic-section-title % variable, now it's official. % \parseargdef\xrefautomaticsectiontitle{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETxref-automatic-section-title\endcsname = \empty \else\ifx\temp\offword \expandafter\let\csname SETxref-automatic-section-title\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @xrefautomaticsectiontitle value `\temp', must be on|off}% \fi\fi } % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is % the node name, #2 the name of the Info cross-reference, #3 the printed % node name, #4 the name of the Info file, #5 the name of the printed % manual. All but the node name can be omitted. % \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} \def\ref#1{\xrefX[#1,,,,,,,]} \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup \unsepspaces \def\printedmanual{\ignorespaces #5}% \def\printedrefname{\ignorespaces #3}% \setbox1=\hbox{\printedmanual\unskip}% \setbox0=\hbox{\printedrefname\unskip}% \ifdim \wd0 = 0pt % No printed node name was explicitly given. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax % Use the node name inside the square brackets. \def\printedrefname{\ignorespaces #1}% \else % Use the actual chapter/section title appear inside % the square brackets. Use the real section title if we have it. \ifdim \wd1 > 0pt % It is in another manual, so we don't have it. \def\printedrefname{\ignorespaces #1}% \else \ifhavexrefs % We know the real title if we have the xref values. \def\printedrefname{\refx{#1-title}{}}% \else % Otherwise just copy the Info node name. \def\printedrefname{\ignorespaces #1}% \fi% \fi \fi \fi % % Make link in pdf output. \ifpdf {\indexnofonts \turnoffactive % This expands tokens, so do it after making catcode changes, so _ % etc. don't get their TeX definitions. \getfilename{#4}% % \edef\pdfxrefdest{#1}% \txiescapepdf\pdfxrefdest % \leavevmode \startlink attr{/Border [0 0 0]}% \ifnum\filenamelength>0 goto file{\the\filename.pdf} name{\pdfxrefdest}% \else goto name{\pdfmkpgn{\pdfxrefdest}}% \fi }% \setcolor{\linkcolor}% \fi % % Float references are printed completely differently: "Figure 1.2" % instead of "[somenode], p.3". We distinguish them by the % LABEL-title being set to a magic string. {% % Have to otherify everything special to allow the \csname to % include an _ in the xref name, etc. \indexnofonts \turnoffactive \expandafter\global\expandafter\let\expandafter\Xthisreftitle \csname XR#1-title\endcsname }% \iffloat\Xthisreftitle % If the user specified the print name (third arg) to the ref, % print it instead of our usual "Figure 1.2". \ifdim\wd0 = 0pt \refx{#1-snt}{}% \else \printedrefname \fi % % if the user also gave the printed manual name (fifth arg), append % "in MANUALNAME". \ifdim \wd1 > 0pt \space \putwordin{} \cite{\printedmanual}% \fi \else % node/anchor (non-float) references. % % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not % insert empty discretionaries after hyphens, which means that it will % not find a line break at a hyphen in a node names. Since some manuals % are best written with fairly long node names, containing hyphens, this % is a loss. Therefore, we give the text of the node name again, so it % is as if TeX is seeing it for the first time. \ifdim \wd1 > 0pt \putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}% \else % _ (for example) has to be the character _ for the purposes of the % control sequence corresponding to the node, but it has to expand % into the usual \leavevmode...\vrule stuff for purposes of % printing. So we \turnoffactive for the \refx-snt, back on for the % printing, back off for the \refx-pg. {\turnoffactive % Only output a following space if the -snt ref is nonempty; for % @unnumbered and @anchor, it won't be. \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi }% % output the `[mynode]' via a macro so it can be overridden. \xrefprintnodename\printedrefname % % But we always want a comma and a space: ,\space % % output the `page 3'. \turnoffactive \putwordpage\tie\refx{#1-pg}{}% \fi \fi \endlink \endgroup} % This macro is called from \xrefX for the `[nodename]' part of xref % output. It's a separate macro only so it can be changed more easily, % since square brackets don't work well in some documents. Particularly % one that Bob is working on :). % \def\xrefprintnodename#1{[#1]} % Things referred to by \setref. % \def\Ynothing{} \def\Yomitfromtoc{} \def\Ynumbered{% \ifnum\secno=0 \putwordChapter@tie \the\chapno \else \ifnum\subsecno=0 \putwordSection@tie \the\chapno.\the\secno \else \ifnum\subsubsecno=0 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno \else \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno \fi\fi\fi } \def\Yappendix{% \ifnum\secno=0 \putwordAppendix@tie @char\the\appendixno{}% \else \ifnum\subsecno=0 \putwordSection@tie @char\the\appendixno.\the\secno \else \ifnum\subsubsecno=0 \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno \else \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno \fi\fi\fi } % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. % If its value is nonempty, SUFFIX is output afterward. % \def\refx#1#2{% {% \indexnofonts \otherbackslash \expandafter\global\expandafter\let\expandafter\thisrefX \csname XR#1\endcsname }% \ifx\thisrefX\relax % If not defined, say something at least. \angleleft un\-de\-fined\angleright \iflinks \ifhavexrefs {\toks0 = {#1}% avoid expansion of possibly-complex value \message{\linenumber Undefined cross reference `\the\toks0'.}}% \else \ifwarnedxrefs\else \global\warnedxrefstrue \message{Cross reference values unknown; you must run TeX again.}% \fi \fi \fi \else % It's defined, so just use it. \thisrefX \fi #2% Output the suffix in any case. } % This is the macro invoked by entries in the aux file. Usually it's % just a \def (we prepend XR to the control sequence name to avoid % collisions). But if this is a float type, we have more work to do. % \def\xrdef#1#2{% {% The node name might contain 8-bit characters, which in our current % implementation are changed to commands like @'e. Don't let these % mess up the control sequence name. \indexnofonts \turnoffactive \xdef\safexrefname{#1}% }% % \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref % % Was that xref control sequence that we just defined for a float? \expandafter\iffloat\csname XR\safexrefname\endcsname % it was a float, and we have the (safe) float type in \iffloattype. \expandafter\let\expandafter\floatlist \csname floatlist\iffloattype\endcsname % % Is this the first time we've seen this float type? \expandafter\ifx\floatlist\relax \toks0 = {\do}% yes, so just \do \else % had it before, so preserve previous elements in list. \toks0 = \expandafter{\floatlist\do}% \fi % % Remember this xref in the control sequence \floatlistFLOATTYPE, % for later use in \listoffloats. \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 {\safexrefname}}% \fi } % Read the last existing aux file, if any. No error if none exists. % \def\tryauxfile{% \openin 1 \jobname.aux \ifeof 1 \else \readdatafile{aux}% \global\havexrefstrue \fi \closein 1 } \def\setupdatafile{% \catcode`\^^@=\other \catcode`\^^A=\other \catcode`\^^B=\other \catcode`\^^C=\other \catcode`\^^D=\other \catcode`\^^E=\other \catcode`\^^F=\other \catcode`\^^G=\other \catcode`\^^H=\other \catcode`\^^K=\other \catcode`\^^L=\other \catcode`\^^N=\other \catcode`\^^P=\other \catcode`\^^Q=\other \catcode`\^^R=\other \catcode`\^^S=\other \catcode`\^^T=\other \catcode`\^^U=\other \catcode`\^^V=\other \catcode`\^^W=\other \catcode`\^^X=\other \catcode`\^^Z=\other \catcode`\^^[=\other \catcode`\^^\=\other \catcode`\^^]=\other \catcode`\^^^=\other \catcode`\^^_=\other % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. % in xref tags, i.e., node names. But since ^^e4 notation isn't % supported in the main text, it doesn't seem desirable. Furthermore, % that is not enough: for node names that actually contain a ^ % character, we would end up writing a line like this: 'xrdef {'hat % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first % argument, and \hat is not an expandable control sequence. It could % all be worked out, but why? Either we support ^^ or we don't. % % The other change necessary for this was to define \auxhat: % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter % and then to call \auxhat in \setq. % \catcode`\^=\other % % Special characters. Should be turned off anyway, but... \catcode`\~=\other \catcode`\[=\other \catcode`\]=\other \catcode`\"=\other \catcode`\_=\other \catcode`\|=\other \catcode`\<=\other \catcode`\>=\other \catcode`\$=\other \catcode`\#=\other \catcode`\&=\other \catcode`\%=\other \catcode`+=\other % avoid \+ for paranoia even though we've turned it off % % This is to support \ in node names and titles, since the \ % characters end up in a \csname. It's easier than % leaving it active and making its active definition an actual \ % character. What I don't understand is why it works in the *value* % of the xrdef. Seems like it should be a catcode12 \, and that % should not typeset properly. But it works, so I'm moving on for % now. --karl, 15jan04. \catcode`\\=\other % % Make the characters 128-255 be printing characters. {% \count1=128 \def\loop{% \catcode\count1=\other \advance\count1 by 1 \ifnum \count1<256 \loop \fi }% }% % % @ is our escape character in .aux files, and we need braces. \catcode`\{=1 \catcode`\}=2 \catcode`\@=0 } \def\readdatafile#1{% \begingroup \setupdatafile \input\jobname.#1 \endgroup} \message{insertions,} % including footnotes. \newcount \footnoteno % The trailing space in the following definition for supereject is % vital for proper filling; pages come out unaligned when you do a % pagealignmacro call if that space before the closing brace is % removed. (Generally, numeric constants should always be followed by a % space to prevent strange expansion errors.) \def\supereject{\par\penalty -20000\footnoteno =0 } % @footnotestyle is meaningful for Info output only. \let\footnotestyle=\comment {\catcode `\@=11 % % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% \let\indent=\ptexindent \let\noindent=\ptexnoindent \global\advance\footnoteno by \@ne \edef\thisfootno{$^{\the\footnoteno}$}% % % In case the footnote comes at the end of a sentence, preserve the % extra spacing after we do the footnote number. \let\@sf\empty \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi % % Remove inadvertent blank space before typesetting the footnote number. \unskip \thisfootno\@sf \dofootnote }% % Don't bother with the trickery in plain.tex to not require the % footnote text as a parameter. Our footnotes don't need to be so general. % % Oh yes, they do; otherwise, @ifset (and anything else that uses % \parseargline) fails inside footnotes because the tokens are fixed when % the footnote is read. --karl, 16nov96. % \gdef\dofootnote{% \insert\footins\bgroup % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. \hsize=\pagewidth \interlinepenalty\interfootnotelinepenalty \splittopskip\ht\strutbox % top baseline for broken footnotes \splitmaxdepth\dp\strutbox \floatingpenalty\@MM \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip \parindent\defaultparindent % \smallfonts \rm % % Because we use hanging indentation in footnotes, a @noindent appears % to exdent this text, so make it be a no-op. makeinfo does not use % hanging indentation so @noindent can still be needed within footnote % text after an @example or the like (not that this is good style). \let\noindent = \relax % % Hang the footnote text off the number. Use \everypar in case the % footnote extends for more than one paragraph. \everypar = {\hang}% \textindent{\thisfootno}% % % Don't crash into the line above the footnote text. Since this % expands into a box, it must come within the paragraph, lest it % provide a place where TeX can split the footnote. \footstrut % % Invoke rest of plain TeX footnote routine. \futurelet\next\fo@t } }%end \catcode `\@=11 % In case a @footnote appears in a vbox, save the footnote text and create % the real \insert just after the vbox finished. Otherwise, the insertion % would be lost. % Similarly, if a @footnote appears inside an alignment, save the footnote % text to a box and make the \insert when a row of the table is finished. % And the same can be done for other insert classes. --kasal, 16nov03. % Replace the \insert primitive by a cheating macro. % Deeper inside, just make sure that the saved insertions are not spilled % out prematurely. % \def\startsavinginserts{% \ifx \insert\ptexinsert \let\insert\saveinsert \else \let\checkinserts\relax \fi } % This \insert replacement works for both \insert\footins{foo} and % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. % \def\saveinsert#1{% \edef\next{\noexpand\savetobox \makeSAVEname#1}% \afterassignment\next % swallow the left brace \let\temp = } \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} \def\placesaveins#1{% \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname {\box#1}% } % eat @SAVE -- beware, all of them have catcode \other: { \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) \gdef\gobblesave @SAVE{} } % initialization: \def\newsaveins #1{% \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% \next } \def\newsaveinsX #1{% \csname newbox\endcsname #1% \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts \checksaveins #1}% } % initialize: \let\checkinserts\empty \newsaveins\footins \newsaveins\margin % @image. We use the macros from epsf.tex to support this. % If epsf.tex is not installed and @image is used, we complain. % % Check for and read epsf.tex up front. If we read it only at @image % time, we might be inside a group, and then its definitions would get % undone and the next image would fail. \openin 1 = epsf.tex \ifeof 1 \else % Do not bother showing banner with epsf.tex v2.7k (available in % doc/epsf.tex and on ctan). \def\epsfannounce{\toks0 = }% \input epsf.tex \fi \closein 1 % % We will only complain once about lack of epsf.tex. \newif\ifwarnednoepsf \newhelp\noepsfhelp{epsf.tex must be installed for images to work. It is also included in the Texinfo distribution, or you can get it from ftp://tug.org/tex/epsf.tex.} % \def\image#1{% \ifx\epsfbox\thisiundefined \ifwarnednoepsf \else \errhelp = \noepsfhelp \errmessage{epsf.tex not found, images will be ignored}% \global\warnednoepsftrue \fi \else \imagexxx #1,,,,,\finish \fi } % % Arguments to @image: % #1 is (mandatory) image filename; we tack on .eps extension. % #2 is (optional) width, #3 is (optional) height. % #4 is (ignored optional) html alt text. % #5 is (ignored optional) extension. % #6 is just the usual extra ignored arg for parsing stuff. \newif\ifimagevmode \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup \catcode`\^^M = 5 % in case we're inside an example \normalturnoffactive % allow _ et al. in names % If the image is by itself, center it. \ifvmode \imagevmodetrue \nobreak\medskip % Usually we'll have text after the image which will insert % \parskip glue, so insert it here too to equalize the space % above and below. \nobreak\vskip\parskip \nobreak \fi % % Leave vertical mode so that indentation from an enclosing % environment such as @quotation is respected. On the other hand, if % it's at the top level, we don't want the normal paragraph indentation. \noindent % % Output the image. \ifpdf \dopdfimage{#1}{#2}{#3}% \else % \epsfbox itself resets \epsf?size at each figure. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi \epsfbox{#1.eps}% \fi % \ifimagevmode \medskip \fi % space after the standalone image \endgroup} % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, % etc. We don't actually implement floating yet, we always include the % float "here". But it seemed the best name for the future. % \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} % There may be a space before second and/or third parameter; delete it. \def\eatcommaspace#1, {#1,} % #1 is the optional FLOATTYPE, the text label for this float, typically % "Figure", "Table", "Example", etc. Can't contain commas. If omitted, % this float will not be numbered and cannot be referred to. % % #2 is the optional xref label. Also must be present for the float to % be referable. % % #3 is the optional positioning argument; for now, it is ignored. It % will somehow specify the positions allowed to float to (here, top, bottom). % % We keep a separate counter for each FLOATTYPE, which we reset at each % chapter-level command. \let\resetallfloatnos=\empty % \def\dofloat#1,#2,#3,#4\finish{% \let\thiscaption=\empty \let\thisshortcaption=\empty % % don't lose footnotes inside @float. % % BEWARE: when the floats start float, we have to issue warning whenever an % insert appears inside a float which could possibly float. --kasal, 26may04 % \startsavinginserts % % We can't be used inside a paragraph. \par % \vtop\bgroup \def\floattype{#1}% \def\floatlabel{#2}% \def\floatloc{#3}% we do nothing with this yet. % \ifx\floattype\empty \let\safefloattype=\empty \else {% % the floattype might have accents or other special characters, % but we need to use it in a control sequence name. \indexnofonts \turnoffactive \xdef\safefloattype{\floattype}% }% \fi % % If label is given but no type, we handle that as the empty type. \ifx\floatlabel\empty \else % We want each FLOATTYPE to be numbered separately (Figure 1, % Table 1, Figure 2, ...). (And if no label, no number.) % \expandafter\getfloatno\csname\safefloattype floatno\endcsname \global\advance\floatno by 1 % {% % This magic value for \lastsection is output by \setref as the % XREFLABEL-title value. \xrefX uses it to distinguish float % labels (which have a completely different output format) from % node and anchor labels. And \xrdef uses it to construct the % lists of floats. % \edef\lastsection{\floatmagic=\safefloattype}% \setref{\floatlabel}{Yfloat}% }% \fi % % start with \parskip glue, I guess. \vskip\parskip % % Don't suppress indentation if a float happens to start a section. \restorefirstparagraphindent } % we have these possibilities: % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap % @float Foo,lbl & no caption: Foo 1.1 % @float Foo & @caption{Cap}: Foo: Cap % @float Foo & no caption: Foo % @float ,lbl & Caption{Cap}: 1.1: Cap % @float ,lbl & no caption: 1.1 % @float & @caption{Cap}: Cap % @float & no caption: % \def\Efloat{% \let\floatident = \empty % % In all cases, if we have a float type, it comes first. \ifx\floattype\empty \else \def\floatident{\floattype}\fi % % If we have an xref label, the number comes next. \ifx\floatlabel\empty \else \ifx\floattype\empty \else % if also had float type, need tie first. \appendtomacro\floatident{\tie}% \fi % the number. \appendtomacro\floatident{\chaplevelprefix\the\floatno}% \fi % % Start the printed caption with what we've constructed in % \floatident, but keep it separate; we need \floatident again. \let\captionline = \floatident % \ifx\thiscaption\empty \else \ifx\floatident\empty \else \appendtomacro\captionline{: }% had ident, so need a colon between \fi % % caption text. \appendtomacro\captionline{\scanexp\thiscaption}% \fi % % If we have anything to print, print it, with space before. % Eventually this needs to become an \insert. \ifx\captionline\empty \else \vskip.5\parskip \captionline % % Space below caption. \vskip\parskip \fi % % If have an xref label, write the list of floats info. Do this % after the caption, to avoid chance of it being a breakpoint. \ifx\floatlabel\empty \else % Write the text that goes in the lof to the aux file as % \floatlabel-lof. Besides \floatident, we include the short % caption if specified, else the full caption if specified, else nothing. {% \atdummies % % since we read the caption text in the macro world, where ^^M % is turned into a normal character, we have to scan it back, so % we don't write the literal three characters "^^M" into the aux file. \scanexp{% \xdef\noexpand\gtemp{% \ifx\thisshortcaption\empty \thiscaption \else \thisshortcaption \fi }% }% \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident \ifx\gtemp\empty \else : \gtemp \fi}}% }% \fi \egroup % end of \vtop % % place the captured inserts % % BEWARE: when the floats start floating, we have to issue warning % whenever an insert appears inside a float which could possibly % float. --kasal, 26may04 % \checkinserts } % Append the tokens #2 to the definition of macro #1, not expanding either. % \def\appendtomacro#1#2{% \expandafter\def\expandafter#1\expandafter{#1#2}% } % @caption, @shortcaption % \def\caption{\docaption\thiscaption} \def\shortcaption{\docaption\thisshortcaption} \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} \def\defcaption#1#2{\egroup \def#1{#2}} % The parameter is the control sequence identifying the counter we are % going to use. Create it if it doesn't exist and assign it to \floatno. \def\getfloatno#1{% \ifx#1\relax % Haven't seen this figure type before. \csname newcount\endcsname #1% % % Remember to reset this floatno at the next chap. \expandafter\gdef\expandafter\resetallfloatnos \expandafter{\resetallfloatnos #1=0 }% \fi \let\floatno#1% } % \setref calls this to get the XREFLABEL-snt value. We want an @xref % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we % first read the @float command. % \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% % Magic string used for the XREFLABEL-title value, so \xrefX can % distinguish floats from other xref types. \def\floatmagic{!!float!!} % #1 is the control sequence we are passed; we expand into a conditional % which is true if #1 represents a float ref. That is, the magic % \lastsection value which we \setref above. % \def\iffloat#1{\expandafter\doiffloat#1==\finish} % % #1 is (maybe) the \floatmagic string. If so, #2 will be the % (safe) float type for this float. We set \iffloattype to #2. % \def\doiffloat#1=#2=#3\finish{% \def\temp{#1}% \def\iffloattype{#2}% \ifx\temp\floatmagic } % @listoffloats FLOATTYPE - print a list of floats like a table of contents. % \parseargdef\listoffloats{% \def\floattype{#1}% floattype {% % the floattype might have accents or other special characters, % but we need to use it in a control sequence name. \indexnofonts \turnoffactive \xdef\safefloattype{\floattype}% }% % % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax \ifhavexrefs % if the user said @listoffloats foo but never @float foo. \message{\linenumber No `\safefloattype' floats to list.}% \fi \else \begingroup \leftskip=\tocindent % indent these entries like a toc \let\do=\listoffloatsdo \csname floatlist\safefloattype\endcsname \endgroup \fi } % This is called on each entry in a list of floats. We're passed the % xref label, in the form LABEL-title, which is how we save it in the % aux file. We strip off the -title and look up \XRLABEL-lof, which % has the text we're supposed to typeset here. % % Figures without xref labels will not be included in the list (since % they won't appear in the aux file). % \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} \def\listoffloatsdoentry#1-title\finish{{% % Can't fully expand XR#1-lof because it can contain anything. Just % pass the control sequence. On the other hand, XR#1-pg is just the % page number, and we want to fully expand that so we can get a link % in pdf output. \toksA = \expandafter{\csname XR#1-lof\endcsname}% % % use the same \entry macro we use to generate the TOC and index. \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% \writeentry }} \message{localization,} % For single-language documents, @documentlanguage is usually given very % early, just after @documentencoding. Single argument is the language % (de) or locale (de_DE) abbreviation. % { \catcode`\_ = \active \globaldefs=1 \parseargdef\documentlanguage{\begingroup \let_=\normalunderscore % normal _ character for filenames \tex % read txi-??.tex file in plain TeX. % Read the file by the name they passed if it exists. \openin 1 txi-#1.tex \ifeof 1 \documentlanguagetrywithoutunderscore{#1_\finish}% \else \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex \fi \closein 1 \endgroup % end raw TeX \endgroup} % % If they passed de_DE, and txi-de_DE.tex doesn't exist, % try txi-de.tex. % \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{% \openin 1 txi-#1.tex \ifeof 1 \errhelp = \nolanghelp \errmessage{Cannot read language file txi-#1.tex}% \else \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex \fi \closein 1 } }% end of special _ catcode % \newhelp\nolanghelp{The given language definition file cannot be found or is empty. Maybe you need to install it? Putting it in the current directory should work if nowhere else does.} % This macro is called from txi-??.tex files; the first argument is the % \language name to set (without the "\lang@" prefix), the second and % third args are \{left,right}hyphenmin. % % The language names to pass are determined when the format is built. % See the etex.log file created at that time, e.g., % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log. % % With TeX Live 2008, etex now includes hyphenation patterns for all % available languages. This means we can support hyphenation in % Texinfo, at least to some extent. (This still doesn't solve the % accented characters problem.) % \catcode`@=11 \def\txisetlanguage#1#2#3{% % do not set the language if the name is undefined in the current TeX. \expandafter\ifx\csname lang@#1\endcsname \relax \message{no patterns for #1}% \else \global\language = \csname lang@#1\endcsname \fi % but there is no harm in adjusting the hyphenmin values regardless. \global\lefthyphenmin = #2\relax \global\righthyphenmin = #3\relax } % Helpers for encodings. % Set the catcode of characters 128 through 255 to the specified number. % \def\setnonasciicharscatcode#1{% \count255=128 \loop\ifnum\count255<256 \global\catcode\count255=#1\relax \advance\count255 by 1 \repeat } \def\setnonasciicharscatcodenonglobal#1{% \count255=128 \loop\ifnum\count255<256 \catcode\count255=#1\relax \advance\count255 by 1 \repeat } % @documentencoding sets the definition of non-ASCII characters % according to the specified encoding. % \parseargdef\documentencoding{% % Encoding being declared for the document. \def\declaredencoding{\csname #1.enc\endcsname}% % % Supported encodings: names converted to tokens in order to be able % to compare them with \ifx. \def\ascii{\csname US-ASCII.enc\endcsname}% \def\latnine{\csname ISO-8859-15.enc\endcsname}% \def\latone{\csname ISO-8859-1.enc\endcsname}% \def\lattwo{\csname ISO-8859-2.enc\endcsname}% \def\utfeight{\csname UTF-8.enc\endcsname}% % \ifx \declaredencoding \ascii \asciichardefs % \else \ifx \declaredencoding \lattwo \setnonasciicharscatcode\active \lattwochardefs % \else \ifx \declaredencoding \latone \setnonasciicharscatcode\active \latonechardefs % \else \ifx \declaredencoding \latnine \setnonasciicharscatcode\active \latninechardefs % \else \ifx \declaredencoding \utfeight \setnonasciicharscatcode\active \utfeightchardefs % \else \message{Unknown document encoding #1, ignoring.}% % \fi % utfeight \fi % latnine \fi % latone \fi % lattwo \fi % ascii } % A message to be logged when using a character that isn't available % the default font encoding (OT1). % \def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} % Take account of \c (plain) vs. \, (Texinfo) difference. \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} % First, make active non-ASCII characters in order for them to be % correctly categorized when TeX reads the replacement text of % macros containing the character definitions. \setnonasciicharscatcode\active % % Latin1 (ISO-8859-1) character definitions. \def\latonechardefs{% \gdef^^a0{\tie} \gdef^^a1{\exclamdown} \gdef^^a2{\missingcharmsg{CENT SIGN}} \gdef^^a3{{\pounds}} \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} \gdef^^a5{\missingcharmsg{YEN SIGN}} \gdef^^a6{\missingcharmsg{BROKEN BAR}} \gdef^^a7{\S} \gdef^^a8{\"{}} \gdef^^a9{\copyright} \gdef^^aa{\ordf} \gdef^^ab{\guillemetleft} \gdef^^ac{$\lnot$} \gdef^^ad{\-} \gdef^^ae{\registeredsymbol} \gdef^^af{\={}} % \gdef^^b0{\textdegree} \gdef^^b1{$\pm$} \gdef^^b2{$^2$} \gdef^^b3{$^3$} \gdef^^b4{\'{}} \gdef^^b5{$\mu$} \gdef^^b6{\P} % \gdef^^b7{$^.$} \gdef^^b8{\cedilla\ } \gdef^^b9{$^1$} \gdef^^ba{\ordm} % \gdef^^bb{\guillemetright} \gdef^^bc{$1\over4$} \gdef^^bd{$1\over2$} \gdef^^be{$3\over4$} \gdef^^bf{\questiondown} % \gdef^^c0{\`A} \gdef^^c1{\'A} \gdef^^c2{\^A} \gdef^^c3{\~A} \gdef^^c4{\"A} \gdef^^c5{\ringaccent A} \gdef^^c6{\AE} \gdef^^c7{\cedilla C} \gdef^^c8{\`E} \gdef^^c9{\'E} \gdef^^ca{\^E} \gdef^^cb{\"E} \gdef^^cc{\`I} \gdef^^cd{\'I} \gdef^^ce{\^I} \gdef^^cf{\"I} % \gdef^^d0{\DH} \gdef^^d1{\~N} \gdef^^d2{\`O} \gdef^^d3{\'O} \gdef^^d4{\^O} \gdef^^d5{\~O} \gdef^^d6{\"O} \gdef^^d7{$\times$} \gdef^^d8{\O} \gdef^^d9{\`U} \gdef^^da{\'U} \gdef^^db{\^U} \gdef^^dc{\"U} \gdef^^dd{\'Y} \gdef^^de{\TH} \gdef^^df{\ss} % \gdef^^e0{\`a} \gdef^^e1{\'a} \gdef^^e2{\^a} \gdef^^e3{\~a} \gdef^^e4{\"a} \gdef^^e5{\ringaccent a} \gdef^^e6{\ae} \gdef^^e7{\cedilla c} \gdef^^e8{\`e} \gdef^^e9{\'e} \gdef^^ea{\^e} \gdef^^eb{\"e} \gdef^^ec{\`{\dotless i}} \gdef^^ed{\'{\dotless i}} \gdef^^ee{\^{\dotless i}} \gdef^^ef{\"{\dotless i}} % \gdef^^f0{\dh} \gdef^^f1{\~n} \gdef^^f2{\`o} \gdef^^f3{\'o} \gdef^^f4{\^o} \gdef^^f5{\~o} \gdef^^f6{\"o} \gdef^^f7{$\div$} \gdef^^f8{\o} \gdef^^f9{\`u} \gdef^^fa{\'u} \gdef^^fb{\^u} \gdef^^fc{\"u} \gdef^^fd{\'y} \gdef^^fe{\th} \gdef^^ff{\"y} } % Latin9 (ISO-8859-15) encoding character definitions. \def\latninechardefs{% % Encoding is almost identical to Latin1. \latonechardefs % \gdef^^a4{\euro} \gdef^^a6{\v S} \gdef^^a8{\v s} \gdef^^b4{\v Z} \gdef^^b8{\v z} \gdef^^bc{\OE} \gdef^^bd{\oe} \gdef^^be{\"Y} } % Latin2 (ISO-8859-2) character definitions. \def\lattwochardefs{% \gdef^^a0{\tie} \gdef^^a1{\ogonek{A}} \gdef^^a2{\u{}} \gdef^^a3{\L} \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} \gdef^^a5{\v L} \gdef^^a6{\'S} \gdef^^a7{\S} \gdef^^a8{\"{}} \gdef^^a9{\v S} \gdef^^aa{\cedilla S} \gdef^^ab{\v T} \gdef^^ac{\'Z} \gdef^^ad{\-} \gdef^^ae{\v Z} \gdef^^af{\dotaccent Z} % \gdef^^b0{\textdegree} \gdef^^b1{\ogonek{a}} \gdef^^b2{\ogonek{ }} \gdef^^b3{\l} \gdef^^b4{\'{}} \gdef^^b5{\v l} \gdef^^b6{\'s} \gdef^^b7{\v{}} \gdef^^b8{\cedilla\ } \gdef^^b9{\v s} \gdef^^ba{\cedilla s} \gdef^^bb{\v t} \gdef^^bc{\'z} \gdef^^bd{\H{}} \gdef^^be{\v z} \gdef^^bf{\dotaccent z} % \gdef^^c0{\'R} \gdef^^c1{\'A} \gdef^^c2{\^A} \gdef^^c3{\u A} \gdef^^c4{\"A} \gdef^^c5{\'L} \gdef^^c6{\'C} \gdef^^c7{\cedilla C} \gdef^^c8{\v C} \gdef^^c9{\'E} \gdef^^ca{\ogonek{E}} \gdef^^cb{\"E} \gdef^^cc{\v E} \gdef^^cd{\'I} \gdef^^ce{\^I} \gdef^^cf{\v D} % \gdef^^d0{\DH} \gdef^^d1{\'N} \gdef^^d2{\v N} \gdef^^d3{\'O} \gdef^^d4{\^O} \gdef^^d5{\H O} \gdef^^d6{\"O} \gdef^^d7{$\times$} \gdef^^d8{\v R} \gdef^^d9{\ringaccent U} \gdef^^da{\'U} \gdef^^db{\H U} \gdef^^dc{\"U} \gdef^^dd{\'Y} \gdef^^de{\cedilla T} \gdef^^df{\ss} % \gdef^^e0{\'r} \gdef^^e1{\'a} \gdef^^e2{\^a} \gdef^^e3{\u a} \gdef^^e4{\"a} \gdef^^e5{\'l} \gdef^^e6{\'c} \gdef^^e7{\cedilla c} \gdef^^e8{\v c} \gdef^^e9{\'e} \gdef^^ea{\ogonek{e}} \gdef^^eb{\"e} \gdef^^ec{\v e} \gdef^^ed{\'{\dotless{i}}} \gdef^^ee{\^{\dotless{i}}} \gdef^^ef{\v d} % \gdef^^f0{\dh} \gdef^^f1{\'n} \gdef^^f2{\v n} \gdef^^f3{\'o} \gdef^^f4{\^o} \gdef^^f5{\H o} \gdef^^f6{\"o} \gdef^^f7{$\div$} \gdef^^f8{\v r} \gdef^^f9{\ringaccent u} \gdef^^fa{\'u} \gdef^^fb{\H u} \gdef^^fc{\"u} \gdef^^fd{\'y} \gdef^^fe{\cedilla t} \gdef^^ff{\dotaccent{}} } % UTF-8 character definitions. % % This code to support UTF-8 is based on LaTeX's utf8.def, with some % changes for Texinfo conventions. It is included here under the GPL by % permission from Frank Mittelbach and the LaTeX team. % \newcount\countUTFx \newcount\countUTFy \newcount\countUTFz \gdef\UTFviiiTwoOctets#1#2{\expandafter \UTFviiiDefined\csname u8:#1\string #2\endcsname} % \gdef\UTFviiiThreeOctets#1#2#3{\expandafter \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} % \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} \gdef\UTFviiiDefined#1{% \ifx #1\relax \message{\linenumber Unicode char \string #1 not defined for Texinfo}% \else \expandafter #1% \fi } \begingroup \catcode`\~13 \catcode`\"12 \def\UTFviiiLoop{% \global\catcode\countUTFx\active \uccode`\~\countUTFx \uppercase\expandafter{\UTFviiiTmp}% \advance\countUTFx by 1 \ifnum\countUTFx < \countUTFy \expandafter\UTFviiiLoop \fi} \countUTFx = "C2 \countUTFy = "E0 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiTwoOctets\string~}} \UTFviiiLoop \countUTFx = "E0 \countUTFy = "F0 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiThreeOctets\string~}} \UTFviiiLoop \countUTFx = "F0 \countUTFy = "F4 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiFourOctets\string~}} \UTFviiiLoop \endgroup \begingroup \catcode`\"=12 \catcode`\<=12 \catcode`\.=12 \catcode`\,=12 \catcode`\;=12 \catcode`\!=12 \catcode`\~=13 \gdef\DeclareUnicodeCharacter#1#2{% \countUTFz = "#1\relax %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% \begingroup \parseXMLCharref \def\UTFviiiTwoOctets##1##2{% \csname u8:##1\string ##2\endcsname}% \def\UTFviiiThreeOctets##1##2##3{% \csname u8:##1\string ##2\string ##3\endcsname}% \def\UTFviiiFourOctets##1##2##3##4{% \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% \expandafter\expandafter\expandafter\expandafter \expandafter\expandafter\expandafter \gdef\UTFviiiTmp{#2}% \endgroup} \gdef\parseXMLCharref{% \ifnum\countUTFz < "A0\relax \errhelp = \EMsimple \errmessage{Cannot define Unicode char value < 00A0}% \else\ifnum\countUTFz < "800\relax \parseUTFviiiA,% \parseUTFviiiB C\UTFviiiTwoOctets.,% \else\ifnum\countUTFz < "10000\relax \parseUTFviiiA;% \parseUTFviiiA,% \parseUTFviiiB E\UTFviiiThreeOctets.{,;}% \else \parseUTFviiiA;% \parseUTFviiiA,% \parseUTFviiiA!% \parseUTFviiiB F\UTFviiiFourOctets.{!,;}% \fi\fi\fi } \gdef\parseUTFviiiA#1{% \countUTFx = \countUTFz \divide\countUTFz by 64 \countUTFy = \countUTFz \multiply\countUTFz by 64 \advance\countUTFx by -\countUTFz \advance\countUTFx by 128 \uccode `#1\countUTFx \countUTFz = \countUTFy} \gdef\parseUTFviiiB#1#2#3#4{% \advance\countUTFz by "#10\relax \uccode `#3\countUTFz \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} \endgroup \def\utfeightchardefs{% \DeclareUnicodeCharacter{00A0}{\tie} \DeclareUnicodeCharacter{00A1}{\exclamdown} \DeclareUnicodeCharacter{00A3}{\pounds} \DeclareUnicodeCharacter{00A8}{\"{ }} \DeclareUnicodeCharacter{00A9}{\copyright} \DeclareUnicodeCharacter{00AA}{\ordf} \DeclareUnicodeCharacter{00AB}{\guillemetleft} \DeclareUnicodeCharacter{00AD}{\-} \DeclareUnicodeCharacter{00AE}{\registeredsymbol} \DeclareUnicodeCharacter{00AF}{\={ }} \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} \DeclareUnicodeCharacter{00B4}{\'{ }} \DeclareUnicodeCharacter{00B8}{\cedilla{ }} \DeclareUnicodeCharacter{00BA}{\ordm} \DeclareUnicodeCharacter{00BB}{\guillemetright} \DeclareUnicodeCharacter{00BF}{\questiondown} \DeclareUnicodeCharacter{00C0}{\`A} \DeclareUnicodeCharacter{00C1}{\'A} \DeclareUnicodeCharacter{00C2}{\^A} \DeclareUnicodeCharacter{00C3}{\~A} \DeclareUnicodeCharacter{00C4}{\"A} \DeclareUnicodeCharacter{00C5}{\AA} \DeclareUnicodeCharacter{00C6}{\AE} \DeclareUnicodeCharacter{00C7}{\cedilla{C}} \DeclareUnicodeCharacter{00C8}{\`E} \DeclareUnicodeCharacter{00C9}{\'E} \DeclareUnicodeCharacter{00CA}{\^E} \DeclareUnicodeCharacter{00CB}{\"E} \DeclareUnicodeCharacter{00CC}{\`I} \DeclareUnicodeCharacter{00CD}{\'I} \DeclareUnicodeCharacter{00CE}{\^I} \DeclareUnicodeCharacter{00CF}{\"I} \DeclareUnicodeCharacter{00D0}{\DH} \DeclareUnicodeCharacter{00D1}{\~N} \DeclareUnicodeCharacter{00D2}{\`O} \DeclareUnicodeCharacter{00D3}{\'O} \DeclareUnicodeCharacter{00D4}{\^O} \DeclareUnicodeCharacter{00D5}{\~O} \DeclareUnicodeCharacter{00D6}{\"O} \DeclareUnicodeCharacter{00D8}{\O} \DeclareUnicodeCharacter{00D9}{\`U} \DeclareUnicodeCharacter{00DA}{\'U} \DeclareUnicodeCharacter{00DB}{\^U} \DeclareUnicodeCharacter{00DC}{\"U} \DeclareUnicodeCharacter{00DD}{\'Y} \DeclareUnicodeCharacter{00DE}{\TH} \DeclareUnicodeCharacter{00DF}{\ss} \DeclareUnicodeCharacter{00E0}{\`a} \DeclareUnicodeCharacter{00E1}{\'a} \DeclareUnicodeCharacter{00E2}{\^a} \DeclareUnicodeCharacter{00E3}{\~a} \DeclareUnicodeCharacter{00E4}{\"a} \DeclareUnicodeCharacter{00E5}{\aa} \DeclareUnicodeCharacter{00E6}{\ae} \DeclareUnicodeCharacter{00E7}{\cedilla{c}} \DeclareUnicodeCharacter{00E8}{\`e} \DeclareUnicodeCharacter{00E9}{\'e} \DeclareUnicodeCharacter{00EA}{\^e} \DeclareUnicodeCharacter{00EB}{\"e} \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}} \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} \DeclareUnicodeCharacter{00F0}{\dh} \DeclareUnicodeCharacter{00F1}{\~n} \DeclareUnicodeCharacter{00F2}{\`o} \DeclareUnicodeCharacter{00F3}{\'o} \DeclareUnicodeCharacter{00F4}{\^o} \DeclareUnicodeCharacter{00F5}{\~o} \DeclareUnicodeCharacter{00F6}{\"o} \DeclareUnicodeCharacter{00F8}{\o} \DeclareUnicodeCharacter{00F9}{\`u} \DeclareUnicodeCharacter{00FA}{\'u} \DeclareUnicodeCharacter{00FB}{\^u} \DeclareUnicodeCharacter{00FC}{\"u} \DeclareUnicodeCharacter{00FD}{\'y} \DeclareUnicodeCharacter{00FE}{\th} \DeclareUnicodeCharacter{00FF}{\"y} \DeclareUnicodeCharacter{0100}{\=A} \DeclareUnicodeCharacter{0101}{\=a} \DeclareUnicodeCharacter{0102}{\u{A}} \DeclareUnicodeCharacter{0103}{\u{a}} \DeclareUnicodeCharacter{0104}{\ogonek{A}} \DeclareUnicodeCharacter{0105}{\ogonek{a}} \DeclareUnicodeCharacter{0106}{\'C} \DeclareUnicodeCharacter{0107}{\'c} \DeclareUnicodeCharacter{0108}{\^C} \DeclareUnicodeCharacter{0109}{\^c} \DeclareUnicodeCharacter{0118}{\ogonek{E}} \DeclareUnicodeCharacter{0119}{\ogonek{e}} \DeclareUnicodeCharacter{010A}{\dotaccent{C}} \DeclareUnicodeCharacter{010B}{\dotaccent{c}} \DeclareUnicodeCharacter{010C}{\v{C}} \DeclareUnicodeCharacter{010D}{\v{c}} \DeclareUnicodeCharacter{010E}{\v{D}} \DeclareUnicodeCharacter{0112}{\=E} \DeclareUnicodeCharacter{0113}{\=e} \DeclareUnicodeCharacter{0114}{\u{E}} \DeclareUnicodeCharacter{0115}{\u{e}} \DeclareUnicodeCharacter{0116}{\dotaccent{E}} \DeclareUnicodeCharacter{0117}{\dotaccent{e}} \DeclareUnicodeCharacter{011A}{\v{E}} \DeclareUnicodeCharacter{011B}{\v{e}} \DeclareUnicodeCharacter{011C}{\^G} \DeclareUnicodeCharacter{011D}{\^g} \DeclareUnicodeCharacter{011E}{\u{G}} \DeclareUnicodeCharacter{011F}{\u{g}} \DeclareUnicodeCharacter{0120}{\dotaccent{G}} \DeclareUnicodeCharacter{0121}{\dotaccent{g}} \DeclareUnicodeCharacter{0124}{\^H} \DeclareUnicodeCharacter{0125}{\^h} \DeclareUnicodeCharacter{0128}{\~I} \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} \DeclareUnicodeCharacter{012A}{\=I} \DeclareUnicodeCharacter{012B}{\={\dotless{i}}} \DeclareUnicodeCharacter{012C}{\u{I}} \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} \DeclareUnicodeCharacter{0130}{\dotaccent{I}} \DeclareUnicodeCharacter{0131}{\dotless{i}} \DeclareUnicodeCharacter{0132}{IJ} \DeclareUnicodeCharacter{0133}{ij} \DeclareUnicodeCharacter{0134}{\^J} \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} \DeclareUnicodeCharacter{0139}{\'L} \DeclareUnicodeCharacter{013A}{\'l} \DeclareUnicodeCharacter{0141}{\L} \DeclareUnicodeCharacter{0142}{\l} \DeclareUnicodeCharacter{0143}{\'N} \DeclareUnicodeCharacter{0144}{\'n} \DeclareUnicodeCharacter{0147}{\v{N}} \DeclareUnicodeCharacter{0148}{\v{n}} \DeclareUnicodeCharacter{014C}{\=O} \DeclareUnicodeCharacter{014D}{\=o} \DeclareUnicodeCharacter{014E}{\u{O}} \DeclareUnicodeCharacter{014F}{\u{o}} \DeclareUnicodeCharacter{0150}{\H{O}} \DeclareUnicodeCharacter{0151}{\H{o}} \DeclareUnicodeCharacter{0152}{\OE} \DeclareUnicodeCharacter{0153}{\oe} \DeclareUnicodeCharacter{0154}{\'R} \DeclareUnicodeCharacter{0155}{\'r} \DeclareUnicodeCharacter{0158}{\v{R}} \DeclareUnicodeCharacter{0159}{\v{r}} \DeclareUnicodeCharacter{015A}{\'S} \DeclareUnicodeCharacter{015B}{\'s} \DeclareUnicodeCharacter{015C}{\^S} \DeclareUnicodeCharacter{015D}{\^s} \DeclareUnicodeCharacter{015E}{\cedilla{S}} \DeclareUnicodeCharacter{015F}{\cedilla{s}} \DeclareUnicodeCharacter{0160}{\v{S}} \DeclareUnicodeCharacter{0161}{\v{s}} \DeclareUnicodeCharacter{0162}{\cedilla{t}} \DeclareUnicodeCharacter{0163}{\cedilla{T}} \DeclareUnicodeCharacter{0164}{\v{T}} \DeclareUnicodeCharacter{0168}{\~U} \DeclareUnicodeCharacter{0169}{\~u} \DeclareUnicodeCharacter{016A}{\=U} \DeclareUnicodeCharacter{016B}{\=u} \DeclareUnicodeCharacter{016C}{\u{U}} \DeclareUnicodeCharacter{016D}{\u{u}} \DeclareUnicodeCharacter{016E}{\ringaccent{U}} \DeclareUnicodeCharacter{016F}{\ringaccent{u}} \DeclareUnicodeCharacter{0170}{\H{U}} \DeclareUnicodeCharacter{0171}{\H{u}} \DeclareUnicodeCharacter{0174}{\^W} \DeclareUnicodeCharacter{0175}{\^w} \DeclareUnicodeCharacter{0176}{\^Y} \DeclareUnicodeCharacter{0177}{\^y} \DeclareUnicodeCharacter{0178}{\"Y} \DeclareUnicodeCharacter{0179}{\'Z} \DeclareUnicodeCharacter{017A}{\'z} \DeclareUnicodeCharacter{017B}{\dotaccent{Z}} \DeclareUnicodeCharacter{017C}{\dotaccent{z}} \DeclareUnicodeCharacter{017D}{\v{Z}} \DeclareUnicodeCharacter{017E}{\v{z}} \DeclareUnicodeCharacter{01C4}{D\v{Z}} \DeclareUnicodeCharacter{01C5}{D\v{z}} \DeclareUnicodeCharacter{01C6}{d\v{z}} \DeclareUnicodeCharacter{01C7}{LJ} \DeclareUnicodeCharacter{01C8}{Lj} \DeclareUnicodeCharacter{01C9}{lj} \DeclareUnicodeCharacter{01CA}{NJ} \DeclareUnicodeCharacter{01CB}{Nj} \DeclareUnicodeCharacter{01CC}{nj} \DeclareUnicodeCharacter{01CD}{\v{A}} \DeclareUnicodeCharacter{01CE}{\v{a}} \DeclareUnicodeCharacter{01CF}{\v{I}} \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}} \DeclareUnicodeCharacter{01D1}{\v{O}} \DeclareUnicodeCharacter{01D2}{\v{o}} \DeclareUnicodeCharacter{01D3}{\v{U}} \DeclareUnicodeCharacter{01D4}{\v{u}} \DeclareUnicodeCharacter{01E2}{\={\AE}} \DeclareUnicodeCharacter{01E3}{\={\ae}} \DeclareUnicodeCharacter{01E6}{\v{G}} \DeclareUnicodeCharacter{01E7}{\v{g}} \DeclareUnicodeCharacter{01E8}{\v{K}} \DeclareUnicodeCharacter{01E9}{\v{k}} \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}} \DeclareUnicodeCharacter{01F1}{DZ} \DeclareUnicodeCharacter{01F2}{Dz} \DeclareUnicodeCharacter{01F3}{dz} \DeclareUnicodeCharacter{01F4}{\'G} \DeclareUnicodeCharacter{01F5}{\'g} \DeclareUnicodeCharacter{01F8}{\`N} \DeclareUnicodeCharacter{01F9}{\`n} \DeclareUnicodeCharacter{01FC}{\'{\AE}} \DeclareUnicodeCharacter{01FD}{\'{\ae}} \DeclareUnicodeCharacter{01FE}{\'{\O}} \DeclareUnicodeCharacter{01FF}{\'{\o}} \DeclareUnicodeCharacter{021E}{\v{H}} \DeclareUnicodeCharacter{021F}{\v{h}} \DeclareUnicodeCharacter{0226}{\dotaccent{A}} \DeclareUnicodeCharacter{0227}{\dotaccent{a}} \DeclareUnicodeCharacter{0228}{\cedilla{E}} \DeclareUnicodeCharacter{0229}{\cedilla{e}} \DeclareUnicodeCharacter{022E}{\dotaccent{O}} \DeclareUnicodeCharacter{022F}{\dotaccent{o}} \DeclareUnicodeCharacter{0232}{\=Y} \DeclareUnicodeCharacter{0233}{\=y} \DeclareUnicodeCharacter{0237}{\dotless{j}} \DeclareUnicodeCharacter{02DB}{\ogonek{ }} \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} \DeclareUnicodeCharacter{1E05}{\udotaccent{b}} \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}} \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}} \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}} \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}} \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}} \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}} \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}} \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}} \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}} \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}} \DeclareUnicodeCharacter{1E20}{\=G} \DeclareUnicodeCharacter{1E21}{\=g} \DeclareUnicodeCharacter{1E22}{\dotaccent{H}} \DeclareUnicodeCharacter{1E23}{\dotaccent{h}} \DeclareUnicodeCharacter{1E24}{\udotaccent{H}} \DeclareUnicodeCharacter{1E25}{\udotaccent{h}} \DeclareUnicodeCharacter{1E26}{\"H} \DeclareUnicodeCharacter{1E27}{\"h} \DeclareUnicodeCharacter{1E30}{\'K} \DeclareUnicodeCharacter{1E31}{\'k} \DeclareUnicodeCharacter{1E32}{\udotaccent{K}} \DeclareUnicodeCharacter{1E33}{\udotaccent{k}} \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}} \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}} \DeclareUnicodeCharacter{1E36}{\udotaccent{L}} \DeclareUnicodeCharacter{1E37}{\udotaccent{l}} \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}} \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}} \DeclareUnicodeCharacter{1E3E}{\'M} \DeclareUnicodeCharacter{1E3F}{\'m} \DeclareUnicodeCharacter{1E40}{\dotaccent{M}} \DeclareUnicodeCharacter{1E41}{\dotaccent{m}} \DeclareUnicodeCharacter{1E42}{\udotaccent{M}} \DeclareUnicodeCharacter{1E43}{\udotaccent{m}} \DeclareUnicodeCharacter{1E44}{\dotaccent{N}} \DeclareUnicodeCharacter{1E45}{\dotaccent{n}} \DeclareUnicodeCharacter{1E46}{\udotaccent{N}} \DeclareUnicodeCharacter{1E47}{\udotaccent{n}} \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}} \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}} \DeclareUnicodeCharacter{1E54}{\'P} \DeclareUnicodeCharacter{1E55}{\'p} \DeclareUnicodeCharacter{1E56}{\dotaccent{P}} \DeclareUnicodeCharacter{1E57}{\dotaccent{p}} \DeclareUnicodeCharacter{1E58}{\dotaccent{R}} \DeclareUnicodeCharacter{1E59}{\dotaccent{r}} \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}} \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}} \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}} \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}} \DeclareUnicodeCharacter{1E60}{\dotaccent{S}} \DeclareUnicodeCharacter{1E61}{\dotaccent{s}} \DeclareUnicodeCharacter{1E62}{\udotaccent{S}} \DeclareUnicodeCharacter{1E63}{\udotaccent{s}} \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}} \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}} \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}} \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}} \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}} \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}} \DeclareUnicodeCharacter{1E7C}{\~V} \DeclareUnicodeCharacter{1E7D}{\~v} \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}} \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}} \DeclareUnicodeCharacter{1E80}{\`W} \DeclareUnicodeCharacter{1E81}{\`w} \DeclareUnicodeCharacter{1E82}{\'W} \DeclareUnicodeCharacter{1E83}{\'w} \DeclareUnicodeCharacter{1E84}{\"W} \DeclareUnicodeCharacter{1E85}{\"w} \DeclareUnicodeCharacter{1E86}{\dotaccent{W}} \DeclareUnicodeCharacter{1E87}{\dotaccent{w}} \DeclareUnicodeCharacter{1E88}{\udotaccent{W}} \DeclareUnicodeCharacter{1E89}{\udotaccent{w}} \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}} \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}} \DeclareUnicodeCharacter{1E8C}{\"X} \DeclareUnicodeCharacter{1E8D}{\"x} \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}} \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}} \DeclareUnicodeCharacter{1E90}{\^Z} \DeclareUnicodeCharacter{1E91}{\^z} \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}} \DeclareUnicodeCharacter{1E93}{\udotaccent{z}} \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}} \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}} \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}} \DeclareUnicodeCharacter{1E97}{\"t} \DeclareUnicodeCharacter{1E98}{\ringaccent{w}} \DeclareUnicodeCharacter{1E99}{\ringaccent{y}} \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}} \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}} \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}} \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}} \DeclareUnicodeCharacter{1EBC}{\~E} \DeclareUnicodeCharacter{1EBD}{\~e} \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}} \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}} \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}} \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}} \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}} \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}} \DeclareUnicodeCharacter{1EF2}{\`Y} \DeclareUnicodeCharacter{1EF3}{\`y} \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}} \DeclareUnicodeCharacter{1EF8}{\~Y} \DeclareUnicodeCharacter{1EF9}{\~y} \DeclareUnicodeCharacter{2013}{--} \DeclareUnicodeCharacter{2014}{---} \DeclareUnicodeCharacter{2018}{\quoteleft} \DeclareUnicodeCharacter{2019}{\quoteright} \DeclareUnicodeCharacter{201A}{\quotesinglbase} \DeclareUnicodeCharacter{201C}{\quotedblleft} \DeclareUnicodeCharacter{201D}{\quotedblright} \DeclareUnicodeCharacter{201E}{\quotedblbase} \DeclareUnicodeCharacter{2022}{\bullet} \DeclareUnicodeCharacter{2026}{\dots} \DeclareUnicodeCharacter{2039}{\guilsinglleft} \DeclareUnicodeCharacter{203A}{\guilsinglright} \DeclareUnicodeCharacter{20AC}{\euro} \DeclareUnicodeCharacter{2192}{\expansion} \DeclareUnicodeCharacter{21D2}{\result} \DeclareUnicodeCharacter{2212}{\minus} \DeclareUnicodeCharacter{2217}{\point} \DeclareUnicodeCharacter{2261}{\equiv} }% end of \utfeightchardefs % US-ASCII character definitions. \def\asciichardefs{% nothing need be done \relax } % Make non-ASCII characters printable again for compatibility with % existing Texinfo documents that may use them, even without declaring a % document encoding. % \setnonasciicharscatcode \other \message{formatting,} \newdimen\defaultparindent \defaultparindent = 15pt \chapheadingskip = 15pt plus 4pt minus 2pt \secheadingskip = 12pt plus 3pt minus 2pt \subsecheadingskip = 9pt plus 2pt minus 2pt % Prevent underfull vbox error messages. \vbadness = 10000 % Don't be very finicky about underfull hboxes, either. \hbadness = 6666 % Following George Bush, get rid of widows and orphans. \widowpenalty=10000 \clubpenalty=10000 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're % using an old version of TeX, don't do anything. We want the amount of % stretch added to depend on the line length, hence the dependence on % \hsize. We call this whenever the paper size is set. % \def\setemergencystretch{% \ifx\emergencystretch\thisisundefined % Allow us to assign to \emergencystretch anyway. \def\emergencystretch{\dimen0}% \else \emergencystretch = .15\hsize \fi } % Parameters in order: 1) textheight; 2) textwidth; % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip; % 7) physical page height; 8) physical page width. % % We also call \setleading{\textleading}, so the caller should define % \textleading. The caller should also set \parskip. % \def\internalpagesizes#1#2#3#4#5#6#7#8{% \voffset = #3\relax \topskip = #6\relax \splittopskip = \topskip % \vsize = #1\relax \advance\vsize by \topskip \outervsize = \vsize \advance\outervsize by 2\topandbottommargin \pageheight = \vsize % \hsize = #2\relax \outerhsize = \hsize \advance\outerhsize by 0.5in \pagewidth = \hsize % \normaloffset = #4\relax \bindingoffset = #5\relax % \ifpdf \pdfpageheight #7\relax \pdfpagewidth #8\relax % if we don't reset these, they will remain at "1 true in" of % whatever layout pdftex was dumped with. \pdfhorigin = 1 true in \pdfvorigin = 1 true in \fi % \setleading{\textleading} % \parindent = \defaultparindent \setemergencystretch } % @letterpaper (the default). \def\letterpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % % If page is nothing but text, make it come out even. \internalpagesizes{607.2pt}{6in}% that's 46 lines {\voffset}{.25in}% {\bindingoffset}{36pt}% {11in}{8.5in}% }} % Use @smallbook to reset parameters for 7x9.25 trim size. \def\smallbook{{\globaldefs = 1 \parskip = 2pt plus 1pt \textleading = 12pt % \internalpagesizes{7.5in}{5in}% {-.2in}{0in}% {\bindingoffset}{16pt}% {9.25in}{7in}% % \lispnarrowing = 0.3in \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = .5cm }} % Use @smallerbook to reset parameters for 6x9 trim size. % (Just testing, parameters still in flux.) \def\smallerbook{{\globaldefs = 1 \parskip = 1.5pt plus 1pt \textleading = 12pt % \internalpagesizes{7.4in}{4.8in}% {-.2in}{-.4in}% {0pt}{14pt}% {9in}{6in}% % \lispnarrowing = 0.25in \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = .4cm }} % Use @afourpaper to print on European A4 paper. \def\afourpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % % Double-side printing via postscript on Laserjet 4050 % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. % To change the settings for a different printer or situation, adjust % \normaloffset until the front-side and back-side texts align. Then % do the same for \bindingoffset. You can set these for testing in % your texinfo source file like this: % @tex % \global\normaloffset = -6mm % \global\bindingoffset = 10mm % @end tex \internalpagesizes{673.2pt}{160mm}% that's 51 lines {\voffset}{\hoffset}% {\bindingoffset}{44pt}% {297mm}{210mm}% % \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = 5mm }} % Use @afivepaper to print on European A5 paper. % From romildo@urano.iceb.ufop.br, 2 July 2000. % He also recommends making @example and @lisp be small. \def\afivepaper{{\globaldefs = 1 \parskip = 2pt plus 1pt minus 0.1pt \textleading = 12.5pt % \internalpagesizes{160mm}{120mm}% {\voffset}{\hoffset}% {\bindingoffset}{8pt}% {210mm}{148mm}% % \lispnarrowing = 0.2in \tolerance = 800 \hfuzz = 1.2pt \contentsrightmargin = 0pt \defbodyindent = 2mm \tableindent = 12mm }} % A specific text layout, 24x15cm overall, intended for A4 paper. \def\afourlatex{{\globaldefs = 1 \afourpaper \internalpagesizes{237mm}{150mm}% {\voffset}{4.6mm}% {\bindingoffset}{7mm}% {297mm}{210mm}% % % Must explicitly reset to 0 because we call \afourpaper. \globaldefs = 0 }} % Use @afourwide to print on A4 paper in landscape format. \def\afourwide{{\globaldefs = 1 \afourpaper \internalpagesizes{241mm}{165mm}% {\voffset}{-2.95mm}% {\bindingoffset}{7mm}% {297mm}{210mm}% \globaldefs = 0 }} % @pagesizes TEXTHEIGHT[,TEXTWIDTH] % Perhaps we should allow setting the margins, \topskip, \parskip, % and/or leading, also. Or perhaps we should compute them somehow. % \parseargdef\pagesizes{\pagesizesyyy #1,,\finish} \def\pagesizesyyy#1,#2,#3\finish{{% \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi \globaldefs = 1 % \parskip = 3pt plus 2pt minus 1pt \setleading{\textleading}% % \dimen0 = #1\relax \advance\dimen0 by \voffset % \dimen2 = \hsize \advance\dimen2 by \normaloffset % \internalpagesizes{#1}{\hsize}% {\voffset}{\normaloffset}% {\bindingoffset}{44pt}% {\dimen0}{\dimen2}% }} % Set default to letter. % \letterpaper \message{and turning on texinfo input format.} \def^^L{\par} % remove \outer, so ^L can appear in an @comment % DEL is a comment character, in case @c does not suffice. \catcode`\^^? = 14 % Define macros to output various characters with catcode for normal text. \catcode`\"=\other \def\normaldoublequote{"} \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix \catcode`\+=\other \def\normalplus{+} \catcode`\<=\other \def\normalless{<} \catcode`\>=\other \def\normalgreater{>} \catcode`\^=\other \def\normalcaret{^} \catcode`\_=\other \def\normalunderscore{_} \catcode`\|=\other \def\normalverticalbar{|} \catcode`\~=\other \def\normaltilde{~} % This macro is used to make a character print one way in \tt % (where it can probably be output as-is), and another way in other fonts, % where something hairier probably needs to be done. % % #1 is what to print if we are indeed using \tt; #2 is what to print % otherwise. Since all the Computer Modern typewriter fonts have zero % interword stretch (and shrink), and it is reasonable to expect all % typewriter fonts to have this, we can check that font parameter. % \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} % Same as above, but check for italic font. Actually this also catches % non-italic slanted fonts since it is impossible to distinguish them from % italic fonts. But since this is only used by $ and it uses \sl anyway % this is not a problem. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} % Turn off all special characters except @ % (and those which the user can use as if they were ordinary). % Most of these we simply print from the \tt font, but for some, we can % use math or other variants that look better in normal text. \catcode`\"=\active \def\activedoublequote{{\tt\char34}} \let"=\activedoublequote \catcode`\~=\active \def~{{\tt\char126}} \chardef\hat=`\^ \catcode`\^=\active \def^{{\tt \hat}} \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} \let\realunder=_ % Subroutine for the previous macro. \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } \catcode`\|=\active \def|{{\tt\char124}} \chardef \less=`\< \catcode`\<=\active \def<{{\tt \less}} \chardef \gtr=`\> \catcode`\>=\active \def>{{\tt \gtr}} \catcode`\+=\active \def+{{\tt \char 43}} \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix % If a .fmt file is being used, characters that might appear in a file % name cannot be active until we have parsed the command line. % So turn them off again, and have \everyjob (or @setfilename) turn them on. % \otherifyactive is called near the end of this file. \def\otherifyactive{\catcode`+=\other \catcode`\_=\other} % Used sometimes to turn off (effectively) the active characters even after % parsing them. \def\turnoffactive{% \normalturnoffactive \otherbackslash } \catcode`\@=0 % \backslashcurfont outputs one backslash character in current font, % as in \char`\\. \global\chardef\backslashcurfont=`\\ \global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work % \realbackslash is an actual character `\' with catcode other, and % \doublebackslash is two of them (for the pdf outlines). {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} % In texinfo, backslash is an active character; it prints the backslash % in fixed width font. \catcode`\\=\active % @ for escape char from now on. % The story here is that in math mode, the \char of \backslashcurfont % ends up printing the roman \ from the math symbol font (because \char % in math mode uses the \mathcode, and plain.tex sets % \mathcode`\\="026E). It seems better for @backslashchar{} to always % print a typewriter backslash, hence we use an explicit \mathchar, % which is the decimal equivalent of "715c (class 7, e.g., use \fam; % ignored family value; char position "5C). We can't use " for the % usual hex value because it has already been made active. @def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} @let@backslashchar = @normalbackslash % @backslashchar{} is for user documents. % On startup, @fixbackslash assigns: % @let \ = @normalbackslash % \rawbackslash defines an active \ to do \backslashcurfont. % \otherbackslash defines an active \ to be a literal `\' character with % catcode other. We switch back and forth between these. @gdef@rawbackslash{@let\=@backslashcurfont} @gdef@otherbackslash{@let\=@realbackslash} % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of % the literal character `\'. % @def@normalturnoffactive{% @let"=@normaldoublequote @let$=@normaldollar %$ font-lock fix @let+=@normalplus @let<=@normalless @let>=@normalgreater @let\=@normalbackslash @let^=@normalcaret @let_=@normalunderscore @let|=@normalverticalbar @let~=@normaltilde @markupsetuplqdefault @markupsetuprqdefault @unsepspaces } % Make _ and + \other characters, temporarily. % This is canceled by @fixbackslash. @otherifyactive % If a .fmt file is being used, we don't want the `\input texinfo' to show up. % That is what \eatinput is for; after that, the `\' should revert to printing % a backslash. % @gdef@eatinput input texinfo{@fixbackslash} @global@let\ = @eatinput % On the other hand, perhaps the file did not have a `\input texinfo'. Then % the first `\' in the file would cause an error. This macro tries to fix % that, assuming it is called before the first `\' could plausibly occur. % Also turn back on active characters that might appear in the input % file name, in case not using a pre-dumped format. % @gdef@fixbackslash{% @ifx\@eatinput @let\ = @normalbackslash @fi @catcode`+=@active @catcode`@_=@active } % Say @foo, not \foo, in error messages. @escapechar = `@@ % These (along with & and #) are made active for url-breaking, so need % active definitions as the normal characters. @def@normaldot{.} @def@normalquest{?} @def@normalslash{/} % These look ok in all fonts, so just make them not special. % @hashchar{} gets its own user-level command, because of #line. @catcode`@& = @other @def@normalamp{&} @catcode`@# = @other @def@normalhash{#} @catcode`@% = @other @def@normalpercent{%} @let @hashchar = @normalhash @c Finally, make ` and ' active, so that txicodequoteundirected and @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we @c don't make ` and ' active, @code will not get them as active chars. @c Do this last of all since we use ` in the previous @catcode assignments. @catcode`@'=@active @catcode`@`=@active @markupsetuplqdefault @markupsetuprqdefault @c Local variables: @c eval: (add-hook 'write-file-hooks 'time-stamp) @c page-delimiter: "^\\\\message" @c time-stamp-start: "def\\\\texinfoversion{" @c time-stamp-format: "%:y-%02m-%02d.%02H" @c time-stamp-end: "}" @c End: @c vim:sw=2: @ignore arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 @end ignore xforms-1.2.4/config/missing0000755000175000017500000002415212353624173012633 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: xforms-1.2.4/config/common.am0000644000175000017500000000026312253017314013030 00000000000000AUTOMAKE_OPTIONS = foreign DISTCLEANFILES= *.orig *.rej *~ *.bak core makelog MAINTAINERCLEANFILES = $(srcdir)/Makefile.in makelog AM_INSTALL_DATA_FLAGS = $(INSTALL) -m 644 -D xforms-1.2.4/config/ltmain.sh0000644000175000017500000105204012353624170013047 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu1 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1ubuntu1" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 xforms-1.2.4/config/Makefile.am0000644000175000017500000000051512254562114013261 00000000000000include $(top_srcdir)/config/common.am EXTRA_DIST = common.am config.guess config.sub cygwin.m4 depcomp \ libtool.m4 ltmain.sh xformsinclude.m4 install-sh missing MAINTAINERCLEANFILES += config.guess config.sub install-sh libtool.m4 \ ltmain.sh lt~obsolete.m4 ltoptions.m4 ltsugar.m4 \ ltversion.m4 depcomp missing xforms-1.2.4/README.rpmbuild0000664000175000017500000000561112337325620012462 00000000000000This file contains information for people that want to build rpm packages for the XForms library and its documetation. 1) While the name this library is known as is 'xforms' (and has been so for at least 20 years) most distributions use a name starting with `libforms' - for the obvious reason that the most important part is a shared library. This requires a bit of tweaking to create a package with the correct name but which now is fully automated. 2) After having run ./configure --enable docs successfully create the rpm package with make rpmdist Should you start from the git repository use ./autogen.sh && ./configure --enable-docs (note that this requires the autoconf, automake and libtool packages to be installed). 3) Some build dependencies in `libforms.spec' may need a bit of tweaking. First of all the `mesa-libGL-devel' package, re- quired for building the GL forms library, seems to be spelt as `Mesa-libGL-devel' on, e.g., openSUSE 13.1. Then there are the dependencies for building the documentation. As I noticed some of the programs used for creating the documenation are provided by different packages on different distributions. E.g., `/usr/bin/texi2dvi' is in the `texinfo-tex' package on CentOS (which then automatically requires the `texinfo' package) while on openSUSE 13.1 it's from the `texinfo' package itself (and the dependeny on the `texinfo-tex' package is then probably superfluous) 4) Runing `make rpmdist' creates three packages with (in most cases) names of the form libforms-v-r.d.a.rpm libforms-devel-v-r.d.a.rpm libforms-doc-v-r.d.noarch.rpm where `v' is the version of the package, `r' its release number, `d' the distributions name and `a' the architecture the rpm package was build for (the third package for the documentation is architec- tureindependent, but note that due to a rpmbuild issue on systems with an older `rpmbuild' program it will also have a name of libforms-doc-v-r.d.a.rpm with `a' not being `noarch' but e.g. `x68_64'. 5) The resulting packages have been tested (on CentOS 6.5) with `rpmlint'. There were no errors, just a number of unavoidable warnings. These are mostly complaints from the spell-checker about the word `XForms', and then there's a larger number of warnings for the documentation package. All these result from the fact that `rpmbuild' and `rpmlint' don't expect anything else than `.info' files in the info directory. But this doesn't take into account that `emacs' in info mode is able to display images embeded in the info documentation - and they need to be stored somewhere below the info directory. But then `rpmlint' complains about them not being UTF-8 files and also wants them to be gzip'ed (which emacs' info mode unfortunately doesn't like...). All packages should be cleanly deinstallable. xforms-1.2.4/INSTALL0000644000175000017500000002600612260630642011013 00000000000000This file is derived from the Free Software Foundation documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile and install this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. The `configure' script accepts a lot of options that influence the build process and what gets built. E,g., unless `--enable-docs' is passed to it no documentation will generated. And to also build the demo programs please use `--enable-demos'. For a full list if all available options run `./confugure --help'. Running `configure' takes a while. While running it prints some messages telling which features it's checking for. 2. Type `make' to compile the package. You may invoke `make' with the `-j' option (and the number of process to run in parallel) to speed up the build process. 3. Type `make install' to install the programs and any data files and documentation. 4. Since new libaries have been installed it may be necessary to run `/sbin/ldconfig' (otherwise you may get complaints that the libforms library could not be found when e.g. trying to run fdesign). 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Limitations of build process ============================ If you build the package as a non-privileged user and then try to install it as the root user in an environment where the root user does not have write permissions in the users directories used in the build, like it can be the case on systems using NFS, installation will fail. The reason is that during the install stage the libformsGL and libflimage libraries need to be "relinked" (the versions created during the initial build process rely on the libforms library stored in the user directories and must be relinked to use the now globally available version of libforms). Unfortunately, no fix for this problem (i.e. forcing libtool to write the newly created shared libraries into a different directory than the user's) has been found yet. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note "Defining Variables" below for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automati- cally, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc will cause the specified gcc to be used as the C compiler (unless it is overridden in the site shell script). `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. Problems ======== When running `configure' you may receive either error messages or warnings at the end that tell you about problems encountered. Error messages are about programs or libraries that are necessary for building the XForms library. You need to locate and install these programs or libraries before running `configure' again and then compiling the library by running 'make'. Warnings don't indicate that the library can't be huild, just that one or more programs aren't available that are needed for building additional materiela like the documentation. You can disregard them or install the missing program(s) and run `configure' again. xforms-1.2.4/configure0000775000175000017500000162676412353624174011723 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for xforms 1.2.4. # # Report bugs to . # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software # Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: xforms-development@nongnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='xforms' PACKAGE_TARNAME='xforms' PACKAGE_VERSION='1.2.4' PACKAGE_STRING='xforms 1.2.4' PACKAGE_BUGREPORT='xforms-development@nongnu.org' PACKAGE_URL='' ac_unique_file="lib/forms.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS JPEG_LIB XPM_LIB X_EXTRA_LIBS X_LIBS X_PRE_LIBS X_CFLAGS XMKMF BUILD_GL_FALSE BUILD_GL_TRUE OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED LIBTOOL EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC BUILD_PDF_DOCS_FALSE BUILD_PDF_DOCS_TRUE BUILD_HTML_DOCS_FALSE BUILD_HTML_DOCS_TRUE TEXI2DVI_NEEDS_PDF CONVERT TEXI2DVI TEXI2HTML BUILD_DOCS_FALSE BUILD_DOCS_TRUE BUILD_DEMOS_FALSE BUILD_DEMOS_TRUE USE_CLASSIC_EDITKEYS_FALSE USE_CLASSIC_EDITKEYS_TRUE USE_BWC_BS_HACK_FALSE USE_BWC_BS_HACK_TRUE SO_VERSION MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_os target_vendor target_cpu target host_os host_vendor host_cpu host build_os build_vendor build_cpu build FL_FIXLEVEL FL_REVISION FL_VERSION VERSION PACKAGE target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_maintainer_mode enable_bwc_bs_hack enable_classic_editkeys enable_demos enable_docs enable_dependency_tracking enable_warnings enable_debug enable_optimization enable_shared enable_static with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock with_extra_lib with_extra_inc with_extra_prefix enable_gl with_x ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP XMKMF' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= 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=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=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 ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # 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 the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures xforms 1.2.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/xforms] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of xforms 1.2.4:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-bwc-bs-hack enable backward compatiblity hack for browser, scrollbar and tabfolder objects --enable-classic-editkeys enable backward compatiblity for behaviour of input edit keys --enable-demos Build demo programs --enable-docs build documentation (needs makeinfo) --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-warnings tell the compiler to display more warnings --enable-debug enable debug information --enable-optimization=value enable compiler optimisation default=-O --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-gl Do not build GL support library Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-extra-lib specify extra library directory --with-extra-inc specify extra include directory --with-extra-prefix specify extra lib+include directory --with-x use the X Window System Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF xforms configure 1.2.4 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## -------------------------------------------- ## ## Report this to xforms-development@nongnu.org ## ## -------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* 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_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by xforms $as_me 1.2.4, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in config "$srcdir"/config; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. PACKAGE=$PACKAGE_NAME VERSION=$PACKAGE_VERSION eval `echo $PACKAGE_VERSION | sed -e 's/\(.*\)\.\(.*\)\.\(.*\)/FL_VERSION=\1; FL_REVISION=\2; FL_FIXLEVEL=\3/'` echo "configuring xforms version $VERSION" xforms_devel_version=no case $FL_REVISION in *[13579]) xforms_devel_version=yes $as_echo "#define DEVEL_VERSION 1" >>confdefs.h echo "WARNING: This is a development version. Expect bugs." ;; esac # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } if ${ac_cv_target+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- ac_config_headers="$ac_config_headers lib/config.h" am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir 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. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # 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" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $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". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE=$PACKAGE_NAME VERSION=$PACKAGE_VERSION cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE ### This defines the version number of the installed .so files ### using libtool's versioning system. SO_VERSION="3:3:1" # Fix the value of the prefixes. test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Check if the bwc-bs-hack is to be used # Check whether --enable-bwc_bs_hack was given. if test "${enable_bwc_bs_hack+set}" = set; then : enableval=$enable_bwc_bs_hack; fi if test x$enable_bwc_bs_hack = xyes; then USE_BWC_BS_HACK_TRUE= USE_BWC_BS_HACK_FALSE='#' else USE_BWC_BS_HACK_TRUE='#' USE_BWC_BS_HACK_FALSE= fi # Check if old style edit keys are to be used # Check whether --enable-classic_editkeys was given. if test "${enable_classic_editkeys+set}" = set; then : enableval=$enable_classic_editkeys; fi if test x$enable_classic_editkeys = xyes; then USE_CLASSIC_EDITKEYS_TRUE= USE_CLASSIC_EDITKEYS_FALSE='#' else USE_CLASSIC_EDITKEYS_TRUE='#' USE_CLASSIC_EDITKEYS_FALSE= fi # Check if demos are to be build # Check whether --enable-demos was given. if test "${enable_demos+set}" = set; then : enableval=$enable_demos; fi if test x$enable_demos = xyes; then BUILD_DEMOS_TRUE= BUILD_DEMOS_FALSE='#' else BUILD_DEMOS_TRUE='#' BUILD_DEMOS_FALSE= fi # Check if docs are to be build # Check whether --enable-docs was given. if test "${enable_docs+set}" = set; then : enableval=$enable_docs; fi if test x$enable_docs = xyes; then BUILD_DOCS_TRUE= BUILD_DOCS_FALSE='#' else BUILD_DOCS_TRUE='#' BUILD_DOCS_FALSE= fi # If docs are to be built check for presence of texi2html and pdftex (or # similar), needed for building the html and pdf versions of the docs, # respectively if test BUILD_DOCS; then for ac_prog in texi2html do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_TEXI2HTML+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$TEXI2HTML"; then ac_cv_prog_TEXI2HTML="$TEXI2HTML" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_TEXI2HTML="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi TEXI2HTML=$ac_cv_prog_TEXI2HTML if test -n "$TEXI2HTML"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEXI2HTML" >&5 $as_echo "$TEXI2HTML" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$TEXI2HTML" && break done test -n "$TEXI2HTML" || TEXI2HTML="no" export TEXI2HTML; if test $TEXI2HTML = "no" ; then xforms_warning_txt="$xforms_warning_txt == Unable to find a 'texi2html' application, HTML documentation won't be built " xforms_warning=yes; fi for ac_prog in texi2dvi do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_TEXI2DVI+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$TEXI2DVI"; then ac_cv_prog_TEXI2DVI="$TEXI2DVI" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_TEXI2DVI="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi TEXI2DVI=$ac_cv_prog_TEXI2DVI if test -n "$TEXI2DVI"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEXI2DVI" >&5 $as_echo "$TEXI2DVI" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$TEXI2DVI" && break done test -n "$TEXI2DVI" || TEXI2DVI="no" export TEXI2DVI for ac_prog in convert do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CONVERT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CONVERT"; then ac_cv_prog_CONVERT="$CONVERT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CONVERT="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CONVERT=$ac_cv_prog_CONVERT if test -n "$CONVERT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CONVERT" >&5 $as_echo "$CONVERT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CONVERT" && break done test -n "$CONVERT" || CONVERT="no" export CONVERT if test $TEXI2DVI = "no" then xforms_warning_txt="$xforms_warning_txt == Unable to find application 'texi2dvi', PDF documentation won't be built " xforms_warning=yes else cat > texi2dvi_test.texi < /dev/null 2>&1; if test $? != 0; then grep "cannot find image file" texi2dvi_test.log > /dev/null 2>&1 if test $? = 0; then if test $CONVERT = "no"; then TEXI2DVI="no" xforms_warning_txt="$xforms_warning_txt == 'texi2dvi' requires the 'convert' application but which doesn't exist, so PDF documentation won't be built " xforms_warning=yes else TEXI2DVI_NEEDS_PDF="yes" export TEXI2DVI_NEEDS_PDF fi else TEXI2DVI="no" xforms_warning_txt="$xforms_warning_txt == Unable to find a working application 'texi2dvi', PDF documentation won't be built " xforms_warning=yes fi fi rm -f texi2dvi_test.* fi fi if test x$TEXI2HTML != xno; then BUILD_HTML_DOCS_TRUE= BUILD_HTML_DOCS_FALSE='#' else BUILD_HTML_DOCS_TRUE='#' BUILD_HTML_DOCS_FALSE= fi if test x$TEXI2DVI != x"no"; then BUILD_PDF_DOCS_TRUE= BUILD_PDF_DOCS_FALSE='#' else BUILD_PDF_DOCS_TRUE='#' BUILD_PDF_DOCS_FALSE= fi ### Check for programs DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # 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 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include /* 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; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; 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; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ### We might want to get or shut up warnings. # Check whether --enable-warnings was given. if test "${enable_warnings+set}" = set; then : enableval=$enable_warnings; else if test $xforms_devel_version = yes && test $ac_cv_c_compiler_gnu = yes ; then enable_warnings=yes; else enable_warnings=no; fi; fi if test x$enable_warnings = xyes ; then xforms_flags="$xforms_flags warnings" $as_echo "#define WITH_WARNINGS 1" >>confdefs.h fi ### We might want to disable debug # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; else if test $xforms_devel_version = yes && test $ac_cv_c_compiler_gnu = yes ; then enable_debug=yes; else enable_debug=no; fi; fi ### set up optimization # Check whether --enable-optimization was given. if test "${enable_optimization+set}" = set; then : enableval=$enable_optimization; else enable_optimization=yes; fi case $enable_optimization in yes) xforms_opt=-O;; no) xforms_opt=;; *) xforms_opt=${enable_optimization};; esac # set the debug flags correctly. if test x$GCC = xyes; then if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS else CFLAGS="$xforms_opt" if test x$enable_debug = xyes ; then CFLAGS="-g $CFLAGS" fi fi if test x$enable_warnings = xyes ; then CFLAGS="$CFLAGS -W -Wall" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi #### AC_PROG_RANLIB has become obsolete ### Check for special systems { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 $as_echo_n "checking for library containing strerror... " >&6; } if ${ac_cv_search_strerror+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strerror (); int main () { return strerror (); ; return 0; } _ACEOF for ac_lib in '' cposix; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_strerror=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_strerror+:} false; then : break fi done if ${ac_cv_search_strerror+:} false; then : else ac_cv_search_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 $as_echo "$ac_cv_search_strerror" >&6; } ac_res=$ac_cv_search_strerror if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h ### Check for some Cygwin-specific details. case $host_os in cygwin* | mingw* | pw32* ) if test "$GCC" = yes; then # Ensure MSVC-compatible struct packing convention. # Depends on GCC version. gcc2 uses -fnative-struct while # gcc3 uses -mms-bitfields. # msnative_struct='' { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get MSVC-compatible struct packing" >&5 $as_echo_n "checking how to get MSVC-compatible struct packing... " >&6; } case `$CC --version | sed -e 's,\..*,.,' -e q` in 2.) if $CC -v --help 2>/dev/null | grep fnative-struct > /dev/null; then msnative_struct='-fnative-struct' fi ;; *) if $CC -v --help 2>/dev/null | grep ms-bitfields > /dev/null; then msnative_struct='-mms-bitfields' fi ;; esac if test x"$msnative_struct" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no way" >&5 $as_echo "no way" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: produced libraries might be incompatible with MSVC libs" >&5 $as_echo "$as_me: WARNING: produced libraries might be incompatible with MSVC libs" >&2;} else CXXFLAGS="$CXXFLAGS $msnative_struct" { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${msnative_struct}" >&5 $as_echo "${msnative_struct}" >&6; } fi fi # Export all symbols to Win32 DLL using MinGW 2.0 ld. WIN32_LD_EXPORT_ALL_SYMBOLS='' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ld accepts --export-all-symbols" >&5 $as_echo_n "checking whether ld accepts --export-all-symbols... " >&6; } if $LD --help 2>&1 | egrep 'export-all-symbols' > /dev/null; then WIN32_LD_EXPORT_ALL_SYMBOLS='-Wl,--export-all-symbols' { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$WIN32_LD_EXPORT_ALL_SYMBOLS" != x; then LDFLAGS="$LDFLAGS $WIN32_LD_EXPORT_ALL_SYMBOLS" fi ;; esac # Work around a problem in automake 1.4: when invoking install-strip, # INSTALL_PROGRAM is changed to 'install -s', and since # INSTALL_SCRIPT==INSTALL_PROGRAM, we get errors with fileutils-4.0 # which returns an error condition when stripping fails. INSTALL_SCRIPT='${INSTALL}' ### Setup libtool case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: #AC_REQUIRE([AC_CANONICAL_HOST])_LT_SET_OPTION([LT_INIT],[win32-dll]) #AC_DIAGNOSE([obsolete],[AC_LIBTOOL_WIN32_DLL: Remove this warning and the call to _LT_SET_OPTION when you #put the `win32-dll' option into LT_INIT's first parameter.]) ### Add extra directories to check for libraries. # Check whether --with-extra-lib was given. if test "${with_extra_lib+set}" = set; then : withval=$with_extra_lib; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extra library directory" >&5 $as_echo_n "checking for extra library directory... " >&6; } if test -z "$with_extra_lib"; then if ${xforms_cv_extra_lib+:} false; then : $as_echo_n "(cached) " >&6 else xforms_cv_extra_lib=NONE fi else test "x$with_extra_lib" = xyes && with_extra_lib= xforms_cv_extra_lib="$with_extra_lib" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xforms_cv_extra_lib" >&5 $as_echo "$xforms_cv_extra_lib" >&6; } IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for dir in `eval "echo $xforms_cv_extra_lib"`; do if test ! "$dir" = NONE; then test ! -d "$dir" && as_fn_error $? "\"$dir\" is not a directory" "$LINENO" 5 xforms_ldflags="${xforms_ldflags} -L$dir" if test "`(uname) 2>/dev/null`" = SunOS && uname -r | grep '^5' >/dev/null; then if test $ac_cv_cxx_compiler_gnu = yes ; then xforms_ldflags="${xforms_ldflags} -Wl,-R$dir" else xforms_ldflags="${xforms_ldflags} -R$dir" fi fi fi done IFS=$ac_save_ifs test ! x"$xforms_ldflags" = x && LDFLAGS="$xforms_ldflags $LDFLAGS" ### Add extra directories to check for include files. # Check whether --with-extra-inc was given. if test "${with_extra_inc+set}" = set; then : withval=$with_extra_inc; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extra include directory" >&5 $as_echo_n "checking for extra include directory... " >&6; } if test -z "$with_extra_inc"; then if ${xforms_cv_extra_inc+:} false; then : $as_echo_n "(cached) " >&6 else xforms_cv_extra_inc=NONE fi else test "x$with_extra_inc" = xyes && with_extra_inc= xforms_cv_extra_inc="$with_extra_inc" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xforms_cv_extra_inc" >&5 $as_echo "$xforms_cv_extra_inc" >&6; } IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for dir in `eval "echo $xforms_cv_extra_inc"`; do if test ! "$dir" = NONE; then test ! -d "$dir" && as_fn_error $? "\"$dir\" is not a directory" "$LINENO" 5 xforms_cppflags="${xforms_cppflags} -I$dir " fi done IFS=$ac_save_ifs test ! x"$xforms_cppflags" = x && CPPFLAGS="$xforms_cppflags $CPPFLAGS" ### Add both includes and libraries # Check whether --with-extra-prefix was given. if test "${with_extra_prefix+set}" = set; then : withval=$with_extra_prefix; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extra lib+include directory" >&5 $as_echo_n "checking for extra lib+include directory... " >&6; } if test -z "$with_extra_prefix"; then if ${xforms_cv_extra_prefix+:} false; then : $as_echo_n "(cached) " >&6 else xforms_cv_extra_prefix=NONE fi else test "x$with_extra_prefix" = xyes && with_extra_prefix=${prefix} xforms_cv_extra_prefix="$with_extra_prefix" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xforms_cv_extra_prefix" >&5 $as_echo "$xforms_cv_extra_prefix" >&6; } IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for dir in `eval "echo $xforms_cv_extra_prefix"`; do if test ! "$dir" = NONE; then test ! -d "$dir" && as_fn_error $? "\"$dir\" is not a directory" "$LINENO" 5 CPPFLAGS="${CPPFLAGS} -I$dir/include " LDFLAGS="${LDFLAGS} -L$dir/lib" if test "`(uname) 2>/dev/null`" = SunOS && uname -r | grep '^5' >/dev/null; then if test $ac_cv_cxx_compiler_gnu = yes ; then LDFLAGS="${LDFLAGS} -Wl,-R$dir/lib" else LDFLAGS="${LDFLAGS} -R$dir/lib" fi fi fi done IFS=$ac_save_ifs # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* 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"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 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; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi # Checks for libraries. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5 $as_echo_n "checking for sin in -lm... " >&6; } if ${ac_cv_lib_m_sin+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sin (); int main () { return sin (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_sin=yes else ac_cv_lib_m_sin=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sin" >&5 $as_echo "$ac_cv_lib_m_sin" >&6; } if test "x$ac_cv_lib_m_sin" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fopen in -lc" >&5 $as_echo_n "checking for fopen in -lc... " >&6; } if ${ac_cv_lib_c_fopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char fopen (); int main () { return fopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_fopen=yes else ac_cv_lib_c_fopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_fopen" >&5 $as_echo "$ac_cv_lib_c_fopen" >&6; } if test "x$ac_cv_lib_c_fopen" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBC 1 _ACEOF LIBS="-lc $LIBS" fi # Checks for header files. for ac_header in sys/select.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" if test "x$ac_cv_header_sys_select_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_SELECT_H 1 _ACEOF fi done # Check whether we want to build the gl code # Check whether --enable-gl was given. if test "${enable_gl+set}" = set; then : enableval=$enable_gl; fi if test x$enable_gl != xno ; then ac_fn_c_check_header_mongrel "$LINENO" "GL/glx.h" "ac_cv_header_GL_glx_h" "$ac_includes_default" if test "x$ac_cv_header_GL_glx_h" = xyes; then : else enable_gl=no fi fi if test x$enable_gl != xno; then BUILD_GL_TRUE= BUILD_GL_FALSE='#' else BUILD_GL_TRUE='#' BUILD_GL_FALSE= fi # Check for X, XPM and JPEG { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 $as_echo_n "checking for X... " >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; then : withval=$with_x; fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : $as_echo_n "(cached) " >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl dylib la dll; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /usr/lib64 | /lib | /lib64) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R7/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R7 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R7/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R7 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # We can compile using X headers with no special include directory. ac_x_includes= else for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { XrmInitialize () ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else LIBS=$ac_save_LIBS for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib la dll; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 $as_echo "$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 $as_echo "libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. $as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 $as_echo_n "checking whether -R must be followed by a space... " >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else LIBS="$ac_xsave_LIBS -R $x_libraries" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 $as_echo "neither works" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_c_werror_flag=$ac_xsave_c_werror_flag LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_dnet_ntoa=yes else ac_cv_lib_dnet_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_stub_dnet_ntoa=yes else ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" if test "x$ac_cv_func_gethostbyname" = xyes; then : fi if test $ac_cv_func_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 $as_echo_n "checking for gethostbyname in -lbsd... " >&6; } if ${ac_cv_lib_bsd_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bsd_gethostbyname=yes else ac_cv_lib_bsd_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 $as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" if test "x$ac_cv_func_connect" = xyes; then : fi if test $ac_cv_func_connect = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 $as_echo_n "checking for connect in -lsocket... " >&6; } if ${ac_cv_lib_socket_connect+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_connect=yes else ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 $as_echo "$ac_cv_lib_socket_connect" >&6; } if test "x$ac_cv_lib_socket_connect" = xyes; then : X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" if test "x$ac_cv_func_remove" = xyes; then : fi if test $ac_cv_func_remove = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 $as_echo_n "checking for remove in -lposix... " >&6; } if ${ac_cv_lib_posix_remove+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); int main () { return remove (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_posix_remove=yes else ac_cv_lib_posix_remove=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 $as_echo "$ac_cv_lib_posix_remove" >&6; } if test "x$ac_cv_lib_posix_remove" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" if test "x$ac_cv_func_shmat" = xyes; then : fi if test $ac_cv_func_shmat = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 $as_echo_n "checking for shmat in -lipc... " >&6; } if ${ac_cv_lib_ipc_shmat+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); int main () { return shmat (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ipc_shmat=yes else ac_cv_lib_ipc_shmat=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 $as_echo "$ac_cv_lib_ipc_shmat" >&6; } if test "x$ac_cv_lib_ipc_shmat" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 $as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char IceConnectionNumber (); int main () { return IceConnectionNumber (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ICE_IceConnectionNumber=yes else ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 $as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then : X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi ### Check for Xpm library SAVE_LIBS="$LIBS" LIBS="$X_PRE_LIBS $LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XpmCreateBufferFromImage in -lXpm" >&5 $as_echo_n "checking for XpmCreateBufferFromImage in -lXpm... " >&6; } if ${ac_cv_lib_Xpm_XpmCreateBufferFromImage+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXpm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XpmCreateBufferFromImage (); int main () { return XpmCreateBufferFromImage (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xpm_XpmCreateBufferFromImage=yes else ac_cv_lib_Xpm_XpmCreateBufferFromImage=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xpm_XpmCreateBufferFromImage" >&5 $as_echo "$ac_cv_lib_Xpm_XpmCreateBufferFromImage" >&6; } if test "x$ac_cv_lib_Xpm_XpmCreateBufferFromImage" = xyes; then : XPM_LIB="-lXpm" else xforms_error_txt="$xforms_error_txt ** Cannot find libXpm. Please check that the Xpm library is correctly installed on your system. " xforms_error=yes fi LIBS="$SAVE_LIBS" ### Check for Xpm headers SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$X_CFLAGS $CPPFLAGS" xforms_cv_xpm_h_location="" ac_fn_c_check_header_mongrel "$LINENO" "X11/xpm.h" "ac_cv_header_X11_xpm_h" "$ac_includes_default" if test "x$ac_cv_header_X11_xpm_h" = xyes; then : ac_cv_header_xpm_h=yes xforms_cv_xpm_h_location="" else ac_fn_c_check_header_mongrel "$LINENO" "xpm.h" "ac_cv_header_xpm_h" "$ac_includes_default" if test "x$ac_cv_header_xpm_h" = xyes; then : else xforms_error_txt="$xforms_error_txt ** Cannot find xpm.h. Please check that the Xpm library is correctly installed on your system. " xforms_error=yes fi fi cat >>confdefs.h <<_ACEOF #define XPM_H_LOCATION $xforms_cv_xpm_h_location _ACEOF CPPFLAGS="$SAVE_CPPFLAGS" ### Test for the header version if test $ac_cv_header_xpm_h = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking xpm header version" >&5 $as_echo_n "checking xpm header version... " >&6; } if ${xforms_cv_xpmversion+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <&5 | \ grep '^"%%%"' 2>/dev/null | \ sed -e 's/^"%%%"\(.*\)"%%%"/\1/' -e 's/ //g'` case "$xforms_cv_xpmr" in [0-9]) xformsxpmr_alpha=`echo $xforms_cv_xpmr |tr 123456789 abcdefghi` xformsxpmv_alpha=" (aka 3.$xforms_cv_xpmv$xformsxpmr_alpha)";; *) ;; esac xforms_cv_xpmversion="$xforms_cv_xpmv.$xforms_cv_xpmr$xformsxpmv_alpha" rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xforms_cv_xpmversion" >&5 $as_echo "$xforms_cv_xpmversion" >&6; } XPM_VERSION=${xforms_cv_xpmversion} case "$xforms_cv_xpmr" in [789]|[0-9][0-9]*) ;; *) xforms_warning_txt="$xforms_warning_txt == Version $xforms_cv_xpmversion of the Xpm library is a bit old. If you experience strange crashes with xforms, try to upgrade to at least version 4.7 (aka 3.4g). If you have installed a newer version of the library, check whether you have an old xpm.h header file in your include path. " xforms_warning=yes;; esac fi ### Check for Jpeg library { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_CreateDecompress in -ljpeg" >&5 $as_echo_n "checking for jpeg_CreateDecompress in -ljpeg... " >&6; } if ${ac_cv_lib_jpeg_jpeg_CreateDecompress+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljpeg $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char jpeg_CreateDecompress (); int main () { return jpeg_CreateDecompress (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_jpeg_jpeg_CreateDecompress=yes else ac_cv_lib_jpeg_jpeg_CreateDecompress=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_CreateDecompress" >&5 $as_echo "$ac_cv_lib_jpeg_jpeg_CreateDecompress" >&6; } if test "x$ac_cv_lib_jpeg_jpeg_CreateDecompress" = xyes; then : JPEG_LIB="-ljpeg" else xforms_error_txt="$xforms_error_txt ** Cannot find libjpeg. Please check that the jpeg library is correctly installed on your system. " xforms_error=yes fi # Checks for library functions. { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_signal=int else ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF if test $ac_cv_type_signal = "void" ; then $as_echo "#define RETSIGTYPE_IS_VOID 1" >>confdefs.h fi for ac_func in snprintf strcasecmp strerror usleep nanosleep vsnprintf vasprintf sigaction do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in stdio.h do { $as_echo "$as_me:${as_lineno-$LINENO}: checking if snprintf is declared by header $ac_header" >&5 $as_echo_n "checking if snprintf is declared by header $ac_header... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$ac_header> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "snprintf" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_DECL_SNPRINTF 1 _ACEOF break else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f conftest* done for ac_header in stdio.h do { $as_echo "$as_me:${as_lineno-$LINENO}: checking if vsnprintf is declared by header $ac_header" >&5 $as_echo_n "checking if vsnprintf is declared by header $ac_header... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$ac_header> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "vsnprintf" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_DECL_VSNPRINTF 1 _ACEOF break else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f conftest* done for ac_header in stdio.h do { $as_echo "$as_me:${as_lineno-$LINENO}: checking if vasprintf is declared by header $ac_header" >&5 $as_echo_n "checking if vasprintf is declared by header $ac_header... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$ac_header> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "vasprintf" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_DECL_VASPRINTF 1 _ACEOF break else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f conftest* done for ac_header in signal.h do { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigaction is declared by header $ac_header" >&5 $as_echo_n "checking if sigaction is declared by header $ac_header... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$ac_header> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "sigaction" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_DECL_SIGACTION 1 _ACEOF break else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f conftest* done ### Emit some information on what just happened VERSION_INFO="Configuration:\n Host type: ${host} Special build flags: ${xforms_flags} C Compiler: ${CC} C Compiler flags: ${CFLAGS} Linker flags: ${LDFLAGS}\n" ## Some config.h stuff ### Finish the work. ac_config_files="$ac_config_files Makefile libforms.spec lib/include/AAA.h config/Makefile lib/Makefile lib/bitmaps/Makefile lib/fd/Makefile lib/include/Makefile lib/private/Makefile image/Makefile gl/Makefile fdesign/Makefile fdesign/fd/Makefile fdesign/spec/Makefile fdesign/xpm/Makefile fd2ps/Makefile fd2ps/test/Makefile demos/Makefile demos/fd/Makefile doc/Makefile doc/xforms_images/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_BWC_BS_HACK_TRUE}" && test -z "${USE_BWC_BS_HACK_FALSE}"; then as_fn_error $? "conditional \"USE_BWC_BS_HACK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_CLASSIC_EDITKEYS_TRUE}" && test -z "${USE_CLASSIC_EDITKEYS_FALSE}"; then as_fn_error $? "conditional \"USE_CLASSIC_EDITKEYS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_DEMOS_TRUE}" && test -z "${BUILD_DEMOS_FALSE}"; then as_fn_error $? "conditional \"BUILD_DEMOS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_DOCS_TRUE}" && test -z "${BUILD_DOCS_FALSE}"; then as_fn_error $? "conditional \"BUILD_DOCS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_HTML_DOCS_TRUE}" && test -z "${BUILD_HTML_DOCS_FALSE}"; then as_fn_error $? "conditional \"BUILD_HTML_DOCS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_PDF_DOCS_TRUE}" && test -z "${BUILD_PDF_DOCS_FALSE}"; then as_fn_error $? "conditional \"BUILD_PDF_DOCS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_GL_TRUE}" && test -z "${BUILD_GL_FALSE}"; then as_fn_error $? "conditional \"BUILD_GL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by xforms $as_me 1.2.4, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ xforms config.status 1.2.4 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "lib/config.h") CONFIG_HEADERS="$CONFIG_HEADERS lib/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "libforms.spec") CONFIG_FILES="$CONFIG_FILES libforms.spec" ;; "lib/include/AAA.h") CONFIG_FILES="$CONFIG_FILES lib/include/AAA.h" ;; "config/Makefile") CONFIG_FILES="$CONFIG_FILES config/Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "lib/bitmaps/Makefile") CONFIG_FILES="$CONFIG_FILES lib/bitmaps/Makefile" ;; "lib/fd/Makefile") CONFIG_FILES="$CONFIG_FILES lib/fd/Makefile" ;; "lib/include/Makefile") CONFIG_FILES="$CONFIG_FILES lib/include/Makefile" ;; "lib/private/Makefile") CONFIG_FILES="$CONFIG_FILES lib/private/Makefile" ;; "image/Makefile") CONFIG_FILES="$CONFIG_FILES image/Makefile" ;; "gl/Makefile") CONFIG_FILES="$CONFIG_FILES gl/Makefile" ;; "fdesign/Makefile") CONFIG_FILES="$CONFIG_FILES fdesign/Makefile" ;; "fdesign/fd/Makefile") CONFIG_FILES="$CONFIG_FILES fdesign/fd/Makefile" ;; "fdesign/spec/Makefile") CONFIG_FILES="$CONFIG_FILES fdesign/spec/Makefile" ;; "fdesign/xpm/Makefile") CONFIG_FILES="$CONFIG_FILES fdesign/xpm/Makefile" ;; "fd2ps/Makefile") CONFIG_FILES="$CONFIG_FILES fd2ps/Makefile" ;; "fd2ps/test/Makefile") CONFIG_FILES="$CONFIG_FILES fd2ps/test/Makefile" ;; "demos/Makefile") CONFIG_FILES="$CONFIG_FILES demos/Makefile" ;; "demos/fd/Makefile") CONFIG_FILES="$CONFIG_FILES demos/fd/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/xforms_images/Makefile") CONFIG_FILES="$CONFIG_FILES doc/xforms_images/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #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. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi # show version information echo printf "$VERSION_INFO" echo # Display a final warning if there has been a XFORMS_ERROR if test x$xforms_error = xyes; then cat < Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! xforms-1.2.4/doc/0000775000175000017500000000000012353624654010616 500000000000000xforms-1.2.4/doc/part6.texi0000644000175000017500000000014111665175511012455 00000000000000@node Part VI @unnumbered @emph{Part VI - Image Support API} @menu * Part VI Images:: @end menu xforms-1.2.4/doc/Makefile.in0000664000175000017500000007422112353624173012605 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/common.am $(xforms_TEXINFOS) subdir = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = INFO_DEPS = $(srcdir)/xforms.info TEXINFO_TEX = $(top_srcdir)/config/texinfo.tex am__TEXINFO_TEX_DIR = $(top_srcdir)/config DVIS = xforms.dvi PDFS = xforms.pdf PSS = xforms.ps HTMLS = xforms.html TEXINFOS = xforms.texi TEXI2PDF = $(TEXI2DVI) --pdf --batch MAKEINFOHTML = $(MAKEINFO) --html AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) DVIPS = dvips RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__installdirs = "$(DESTDIR)$(infodir)" am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FL_FIXLEVEL = @FL_FIXLEVEL@ FL_REVISION = @FL_REVISION@ FL_VERSION = @FL_VERSION@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIB = @JPEG_LIB@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ TEXI2DVI = @TEXI2DVI@ TEXI2DVI_NEEDS_PDF = @TEXI2DVI_NEEDS_PDF@ TEXI2HTML = @TEXI2HTML@ VERSION = @VERSION@ XMKMF = @XMKMF@ XPM_LIB = @XPM_LIB@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign DISTCLEANFILES = *.orig *.rej *~ *.bak core makelog MAINTAINERCLEANFILES = $(srcdir)/Makefile.in makelog AM_INSTALL_DATA_FLAGS = $(INSTALL) -m 644 -D EXTRA_DIST = xforms.css xforms.init # Set up which parts of the documentation are to be build (some may be # impossible to build since the required tools are unavailable) @BUILD_HTML_DOCS_TRUE@html_docs = xforms.html @BUILD_PDF_DOCS_TRUE@pdf_docs = xforms.pdf info_TEXINFOS = xforms.texi xforms_TEXINFOS = part0_preface.texi \ part1.texi \ part1_defining_forms.texi \ part1_doing_interaction.texi \ part1_free_objects.texi \ part1_getting_started.texi \ part1_goodies.texi \ part1_introduction.texi \ part2.texi \ part2_command_line.texi \ part2_creating_forms.texi \ part2_generating_hardcopies.texi \ part2_getting_started.texi \ part2_introduction.texi \ part2_language_filters.texi \ part2_saving_loading.texi \ part3.texi \ part3_buttons.texi \ part3_choice_objects.texi \ part3_container_objects.texi \ part3_deprecated_objects.texi \ part3_input_objects.texi \ part3_introduction.texi \ part3_other_objects.texi \ part3_popups.texi \ part3_static_objects.texi \ part3_valuator_objects.texi \ part4.texi \ part4_an_example.texi \ part4_drawing_objects.texi \ part4_events.texi \ part4_fl_object.texi \ part4_global_structure.texi \ part4_introduction.texi \ part4_new_buttons.texi \ part4_preemptive_handler.texi \ part5_dirty_tricks.texi \ part5_overview.texi \ part5_resources.texi \ part5.texi \ part5_trouble_shooting.texi \ part5_useful_functions.texi \ part6.texi \ part6_images.texi SUBDIRS = xforms_images all: all-recursive .SUFFIXES: .SUFFIXES: .dvi .html .info .pdf .ps .texi $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/common.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/common.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs .texi.info: restore=: && backupdir="$(am__leading_dot)am$$$$" && \ am__cwd=`pwd` && $(am__cd) $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $@ $<; \ then \ rc=0; \ $(am__cd) $(srcdir); \ else \ rc=$$?; \ $(am__cd) $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc $(srcdir)/xforms.info: xforms.texi $(xforms_TEXINFOS) xforms.dvi: xforms.texi $(xforms_TEXINFOS) xforms.pdf: xforms.texi $(xforms_TEXINFOS) xforms.html: xforms.texi $(xforms_TEXINFOS) .dvi.ps: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ $(DVIPS) -o $@ $< uninstall-dvi-am: @$(NORMAL_UNINSTALL) @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \ rm -f "$(DESTDIR)$(dvidir)/$$f"; \ done uninstall-html-am: @$(NORMAL_UNINSTALL) @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \ rm -rf "$(DESTDIR)$(htmldir)/$$f"; \ done uninstall-info-am: @$(PRE_UNINSTALL) @if test -d '$(DESTDIR)$(infodir)' && \ (install-info --version && \ install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \ done; \ else :; fi @$(NORMAL_UNINSTALL) @list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \ echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ else :; fi); \ done uninstall-pdf-am: @$(NORMAL_UNINSTALL) @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \ rm -f "$(DESTDIR)$(pdfdir)/$$f"; \ done uninstall-ps-am: @$(NORMAL_UNINSTALL) @list='$(PSS)'; test -n "$(psdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \ rm -f "$(DESTDIR)$(psdir)/$$f"; \ done dist-info: $(INFO_DEPS) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for base in $$list; do \ case $$base in \ $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$base; then d=.; else d=$(srcdir); fi; \ base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \ for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \ if test -f $$file; then \ relfile=`expr "$$file" : "$$d/\(.*\)"`; \ test -f "$(distdir)/$$relfile" || \ cp -p $$file "$(distdir)/$$relfile"; \ else :; fi; \ done; \ done mostlyclean-aminfo: -rm -rf xforms.aux xforms.cp xforms.cps xforms.fn xforms.fns xforms.ky \ xforms.kys xforms.log xforms.pg xforms.pgs xforms.tmp \ xforms.toc xforms.tp xforms.vr clean-aminfo: -test -z "xforms.dvi xforms.pdf xforms.ps xforms.html" \ || rm -rf xforms.dvi xforms.pdf xforms.ps xforms.html maintainer-clean-aminfo: @list='$(INFO_DEPS)'; for i in $$list; do \ i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-info check-am: all-am check: check-recursive all-am: Makefile $(INFO_DEPS) all-local installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(infodir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-aminfo clean-generic clean-libtool clean-local \ mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: $(DVIS) html: html-recursive html-am: $(HTMLS) info: info-recursive info-am: $(INFO_DEPS) install-data-am: install-data-local install-info-am install-dvi: install-dvi-recursive install-dvi-am: $(DVIS) @$(NORMAL_INSTALL) test -z "$(dvidir)" || $(MKDIR_P) "$(DESTDIR)$(dvidir)" @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \ done install-exec-am: install-html: install-html-recursive install-html-am: $(HTMLS) @$(NORMAL_INSTALL) test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)" @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \ for p in $$list; do \ if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ $(am__strip_dir) \ d2=$$d$$p; \ if test -d "$$d2"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \ $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \ else \ list2="$$list2 $$d2"; \ fi; \ done; \ test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \ done; } install-info: install-info-recursive install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) test -z "$(infodir)" || $(MKDIR_P) "$(DESTDIR)$(infodir)" @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ if test -f $$ifile; then \ echo "$$ifile"; \ else : ; fi; \ done; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done @$(POST_INSTALL) @am__run_installinfo=yes; \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) am__run_installinfo=no;; \ *) (install-info --version) >/dev/null 2>&1 \ || am__run_installinfo=no;; \ esac; \ if test $$am__run_installinfo = yes; then \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ done; \ else : ; fi install-man: install-pdf: install-pdf-recursive install-pdf-am: $(PDFS) @$(NORMAL_INSTALL) test -z "$(pdfdir)" || $(MKDIR_P) "$(DESTDIR)$(pdfdir)" @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done install-ps: install-ps-recursive install-ps-am: $(PSS) @$(NORMAL_INSTALL) test -z "$(psdir)" || $(MKDIR_P) "$(DESTDIR)$(psdir)" @list='$(PSS)'; test -n "$(psdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-aminfo \ maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-aminfo mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: $(PDFS) ps: ps-recursive ps-am: $(PSS) uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \ uninstall-local uninstall-pdf-am uninstall-ps-am .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am all-local check check-am clean clean-aminfo \ clean-generic clean-libtool clean-local ctags ctags-recursive \ dist-info distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-local install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-aminfo maintainer-clean-generic mostlyclean \ mostlyclean-aminfo mostlyclean-generic mostlyclean-libtool pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-dvi-am uninstall-html-am uninstall-info-am \ uninstall-local uninstall-pdf-am uninstall-ps-am all-local: $(html_docs) $(pdf_docs) install-data-local: @$(NORMAL_INSTALL) if [ -e xforms.pdf ]; then \ $(install_sh) -d $(DESTDIR)$(pdfdir); \ $(install_sh) -m 644 xforms.pdf $(DESTDIR)$(pdfdir); \ fi if [ -e xforms.html ]; then \ $(install_sh) -d $(DESTDIR)$(htmldir); \ $(install_sh) -m 644 xforms.html/*.html $(DESTDIR)$(htmldir); \ $(install_sh) -m 644 xforms.html/*.css $(DESTDIR)$(htmldir); \ fi uninstall-local: @$(NORMAL_UNINSTALL) rm -rf $(DESTDIR)$(htmldir)/xforms_images rm -rf $(DESTDIR)$(infodir)/xforms_images # Rule for creating the HTML documentation from the texi files - afterwards # all generated HTML files get copie to their own directory - the lower level # Makefile in 'xforms_images' will also copy the required figures into it .texi.html: $(TEXI2HTML) --init-file xforms.init xforms.texi /bin/mkdir -p xforms.html mv index.html xforms_*.html xforms.html cp -r xforms.css xforms.html cp -r xforms_images xforms.html .texi.pdf: if [ $(TEXI2DVI_NEEDS_PDF) = "yes" ]; then \ $(MAKE) -C xforms_images create_pdf_files; \ fi texi2dvi --pdf --batch xforms.texi .texi.dvi: if [ $(CONVERT) != "no" ]; then \ $(MAKE) -C xforms_images create_eps_files; fi $(TEXI2DVI) --batch xforms.texi clean-local: -rm -rf xforms.5 xforms.info* xforms.html *~ # 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: xforms-1.2.4/doc/xforms.info0000664000175000017500000015043512353624333012733 00000000000000This is xforms.info, produced by makeinfo version 4.13 from xforms.texi. INFO-DIR-SECTION Development START-INFO-DIR-ENTRY * XForms: (xforms). A Graphical user interface toolkit for X END-INFO-DIR-ENTRY  Indirect: xforms.info-1: 205 xforms.info-2: 303016 xforms.info-3: 603874 xforms.info-4: 904277  Tag Table: (Indirect) Node: Top205 Node: Preface3113 Node: Part I17216 Node: Part I Introduction17536 Ref: Part I Introduction-Footnote-121848 Node: Part I Getting Started21951 Node: Naming Conventions22452 Node: Some Examples23650 Node: Programming Model33027 Node: Part I Defining Forms34640 Node: Starting and Ending a Form Definition35694 Node: Boxes37051 Node: Texts40650 Node: Buttons42141 Node: Sliders47462 Node: ValSliders48798 Node: Input Fields49424 Node: Grouping Objects52211 Node: Hiding and Showing54354 Node: Deactivating and Triggering Objects55429 Node: Changing Attributes57009 Node: Color57452 Ref: FL_BLACK59382 Ref: FL_WHITE59534 Ref: FL_COL159625 Ref: FL_BOTTOM_BCOL59715 Ref: FL_RIGHT_BCOL59812 Ref: FL_MCOL59908 Ref: FL_LEFT_BCOL59998 Ref: FL_LIGHTER_COL160093 Ref: FL_DARKER_COL160191 Ref: FL_SLATEBLUE60288 Ref: FL_INDIANRED60383 Ref: FL_RED60479 Ref: FL_BLUE60568 Ref: FL_GREEN60658 Ref: FL_YELLOW60749 Ref: FL_MAGENTA60841 Ref: FL_CYAN60934 Ref: FL_TOMATO61024 Ref: FL_INACTIVE61116 Ref: FL_TOP_BCOL61210 Ref: FL_PALEGREEN61304 Ref: FL_DARKGOLD61399 Ref: FL_ORCHID61493 Ref: FL_DARKCYAN61585 Ref: FL_DARKTOMATO61679 Ref: FL_WHEAT61775 Ref: FL_DARKORANGE61866 Ref: FL_DEEPPINK61962 Ref: FL_CHARTREUSE62056 Ref: FL_DARKVIOLET62151 Ref: FL_SPRINGGREEN62247 Ref: FL_DODGERBLUE62344 Ref: FL_FREE_COL162440 Ref: FL_MAX_COLORS63291 Ref: fl_set_color_leak()66250 Ref: Color-Footnote-166793 Node: Bounding Boxes66895 Node: Label Attributes and Fonts69576 Ref: FL_TINY_SIZE70478 Ref: FL_SMALL_SIZE70482 Ref: FL_NORMAL_SIZE70522 Ref: FL_MEDIUM_SIZE70561 Ref: FL_LARGE_SIZE70600 Ref: FL_HUGE_SIZE70639 Ref: FL_NORMAL_STYLE71038 Ref: FL_BOLD_STYLE71050 Ref: FL_ITALIC_STYLE71101 Ref: FL_BOLDITALIC_STYLE71149 Ref: FL_FIXED_STYLE71197 Ref: FL_FIXEDBOLD_STYLE71264 Ref: FL_FIXEDITALIC_STYLE71301 Ref: FL_FIXEDBOLDITALIC_STYLE71339 Ref: FL_TIMES_STYLE71377 Ref: FL_TIMESBOLD_STYLE FL71437 Ref: FL_TIMESITALIC_STYLE71474 Ref: FL_TIMESBOLDITALIC_STYLE71512 Ref: FL_SHADOW_STYLE71550 Ref: FL_ENGRAVED_STYLE71610 Ref: FL_EMBOSSED_STYLE71675 Ref: fl_get_font_name()74398 Ref: fl_enumerate_fonts()75130 Ref: FL_ALIGN_LEFT76164 Ref: FL_ALIGN_RIGHT76189 Ref: FL_ALIGN_TOP76237 Ref: FL_ALIGN_BOTTOM76283 Ref: FL_ALIGN_CENTER76332 Ref: FL_ALIGN_RIGHT_BOTTOM76381 Ref: FL_ALIGN_LEFT_BOTTOM76440 Ref: FL_ALIGN_RIGHT_TOP76498 Ref: FL_ALIGN_LEFT_TOP76554 Ref: fl_to_inside_lalign()76829 Ref: FL_ALIGN_INSIDE77111 Ref: fl_to_outside_lalign()77217 Ref: fl_is_inside_lalign()77702 Ref: fl_is_outside_lalign()77702 Ref: fl_is_center_lalign()77702 Node: Tool Tips79453 Node: Redrawing81327 Node: Changing Many Attributes82263 Node: Symbols83683 Ref: fl_draw_symbol()87496 Ref: fl_add_symbol()88021 Ref: fl_delete_symbol()89505 Ref: Symbols-Footnote-189628 Node: Adding and Removing Objects89747 Node: Freeing Objects91658 Node: Part I Doing Interaction92414 Node: Displaying a Form92777 Ref: fl_update_display()93952 Ref: FL_PLACE_SIZE94673 Ref: FL_PLACE_POSITION94824 Ref: FL_PLACE_GEOMETRY94969 Ref: FL_PLACE_ASPECT95198 Ref: FL_PLACE_MOUSE95328 Ref: FL_PLACE_CENTER95565 Ref: FL_PLACE_FULLSCREEN95730 Ref: FL_PLACE_FREE95896 Ref: FL_PLACE_HOTSPOT96183 Ref: FL_PLACE_CENTERFREE96362 Ref: FL_PLACE_ICONIC96520 Ref: FL_FREE_SIZE96851 Ref: fl_set_form_hotspot()98581 Ref: fl_set_form_hotobject()98581 Ref: FL_FULLBORDER99114 Ref: FL_TRANSIENT99161 Ref: FL_NOBORDER99224 Ref: FL_RESIZE_NONE102515 Ref: FL_RESIZE_X102569 Ref: FL_RESIZE_Y102633 Ref: FL_RESIZE_ALL102695 Ref: FL_NoGravity103247 Ref: FL_NorthWest103397 Ref: FL_North103457 Ref: FL_NorthEast103510 Ref: FL_West103570 Ref: FL_East103623 Ref: FL_SouthWest103676 Ref: FL_South103736 Ref: FL_SouthEast103789 Ref: ForgetGravity103849 Ref: fl_for_all_objects()105370 Ref: FL_INVISIBLE107118 Ref: FL_VISIBLE107171 Ref: FL_BEING_HIDDEN107221 Ref: fl_set_atclose()107964 Ref: fl_set_form_atclose()108497 Ref: Displaying a Form-Footnote-1108896 Ref: Displaying a Form-Footnote-2109077 Ref: Displaying a Form-Footnote-3109180 Node: Simple Interaction109310 Ref: fl_set_object_return()112721 Ref: FL_RETURN_CHANGED112875 Ref: FL_RETURN_END113068 Ref: FL_RETURN_END_CHANGED113262 Ref: FL_RETURN_SELECTION113392 Ref: FL_RETURN_DESELECTION113504 Ref: FL_RETURN_ALWAYS113620 Ref: FL_RETURN_NONE113730 Ref: fl_get_object_return_state()115063 Node: Periodic Events and Non-blocking Interaction115708 Ref: FL_APPEVENT_CB117210 Ref: Periodic Events and Non-blocking Interaction-Footnote-1121958 Ref: Periodic Events and Non-blocking Interaction-Footnote-2122004 Node: Dealing With Multiple Windows122146 Ref: fl_XNextEvent()125695 Ref: fl_XPeekEvent()125695 Ref: fl_XEventsQueued()125695 Ref: fl_XPutbackEvent()125695 Ref: fl_mouse_button()128077 Ref: fl_print_xevent_name()130439 Node: Using Callback Functions130734 Ref: fl_addto_selected_xevent()137937 Ref: fl_remove_selected_xevent()137937 Node: Handling Other Input Sources141091 Ref: fl_add_io_callback()141637 Ref: fl_remove_io_callback()142745 Node: Part I Free Objects143077 Node: Free Object143975 Ref: fl_add_free()144135 Ref: Free Object-Footnote-1151920 Node: Example152035 Ref: Example-Footnote-1172678 Node: Part I Goodies172781 Node: Messages and Questions173175 Ref: fl_show_message()173414 Ref: fl_show_messages()173703 Ref: fl_show_messages_f()173917 Ref: fl_hide_message()174765 Ref: fl_show_oneliner()174909 Ref: fl_hide_oneliner()174909 Ref: fl_set_oneliner_color()175413 Ref: fl_set_oneliner_font()175546 Ref: fl_show_alert()175600 Ref: fl_hide_alert()175600 Ref: fl_show_alert_f()176032 Ref: fl_show_question()177505 Ref: fl_hide_question()177505 Ref: fl_show_choice()179059 Ref: fl_show_choices()179059 Ref: fl_set_choices_shortcut()179059 Ref: fl_hide_choice()179059 Ref: fl_set_goodies_font()180388 Ref: fl_show_input()180503 Ref: fl_hide_input()180503 Ref: fl_show_simple_input()181547 Node: Command Log182833 Ref: fl_exe_command()183392 Ref: fl_end_command()184966 Ref: fl_end_all_command()185368 Ref: fl_check_command()185539 Ref: fl_popen()186035 Ref: fl_pclose()186035 Ref: fl_show_command_log()186486 Ref: fl_hide_command_log()186486 Ref: fl_set_command_log_position()186871 Ref: fl_clear_command_log()187181 Ref: fl_addto_command_log()187307 Ref: fl_addto_command_log_f()187307 Ref: fl_get_command_log_fdstruct()187825 Node: Colormap188372 Ref: fl_show_colormap()188894 Node: Color Chooser189161 Ref: fl_show_color_chooser()189690 Node: File Selector190482 Ref: fl_show_fselector()190756 Ref: fl_hide_fselector()192345 Ref: fl_use_fselector()192758 Ref: fl_set_fselector_fontsize()192932 Ref: fl_set_fselector_fontstyle()192932 Ref: fl_set_fselector_title()193333 Ref: fl_invalidate_fselector_cache()193430 Ref: fl_disable_fselector_cache()193674 Ref: fl_set_fselector_callback()194699 Ref: fl_set_fselector_placement()195346 Ref: fl_set_fselector_border()195636 Ref: fl_get_directory()196242 Ref: fl_get_pattern()196242 Ref: fl_get_filename()196242 Ref: fl_set_directory()196479 Ref: fl_set_pattern()196479 Ref: fl_add_fselector_appbutton()196884 Ref: fl_remove_fselector_appbutton()197258 Ref: fl_refresh_fselector()197437 Ref: fl_get_fselector_form()197685 Ref: fl_get_fselector_fdstruct()197945 Ref: fl_set_fselector_filetype_marker()199103 Ref: fl_get_dirlist()200072 Ref: fl_free_dirlist()201469 Ref: fl_set_dirlist_filter()202583 Ref: fl_set_dirlist_filterdir()202892 Ref: fl_set_dirlist_sort()203226 Node: Part II204347 Node: Part II Introduction204732 Node: Part II Getting Started207388 Node: Part II Command Line Arguments213672 Node: Part II Creating Forms219137 Node: Creating and Changing Forms219643 Node: Adding Objects220671 Node: Selecting Objects221308 Node: Moving and Scaling222868 Node: Aligning Objects224093 Node: Raising and Lowering225877 Node: Setting Attributes227599 Node: Generic Attributes229196 Node: Basic Attributes229963 Node: Font231817 Node: Misc. Attributes232280 Node: Colors233615 Node: Object Specific Attributes234937 Node: Copy and Paste237016 Node: Groups238424 Node: Hiding and Showing Objects240703 Node: Testing Forms241630 Node: Part II Saving and Loading Forms242691 Ref: Part II Saving and Loading Forms-Footnote-1252857 Node: Part II Language Filters253010 Node: External Filters254527 Node: Command Line Arguments of the Filter255896 Node: Part II Generating Hardcopies256583 Node: Part III261421 Node: Part III Introduction261886 Node: Part III Static Objects266948 Node: Box Object267417 Node: Adding Box Objects267862 Ref: fl_add_box()268041 Node: Box Types268276 Ref: FL_UP_BOX268452 Ref: FL_DOWN_BOX268506 Ref: FL_FLAT_BOX268566 Ref: FL_BORDER_BOX268615 Ref: FL_FRAME_BOX268668 Ref: FL_SHADOW_BOX268724 Ref: FL_ROUNDED_BOX268772 Ref: FL_RFLAT_BOX268810 Ref: FL_RSHADOW_BOX268863 Ref: FL_OVAL_BOX268915 Ref: FL_NO_BOX268952 Node: Box Attributes269008 Node: Box Remarks269286 Node: Frame Object269530 Node: Adding Frame Objects270494 Ref: fl_add_frame()270685 Node: Frame Types271068 Node: Frame Attributes271678 Node: Frame Remarks272041 Node: LabelFrame Object272334 Node: Adding LabelFrame Objects272892 Ref: fl_add_labelframe()273113 Node: LabelFrame Types273670 Node: LabelFrame Attributes274310 Node: LabelFrames Remarks274704 Node: Text Object275042 Node: Adding Text Objects275432 Ref: fl_add_text()275617 Node: Text Types275861 Node: Text Attributes276057 Node: Text Remarks276697 Node: Bitmap Object277529 Node: Adding Bitmap Objects278010 Ref: fl_add_bitmap()278207 Node: Bitmap Types278472 Node: Bitmap Interaction278680 Node: Other Bitmap Routines279131 Ref: fl_set_bitmap_data()279359 Ref: fl_set_bitmap_file()279359 Ref: fl_read_bitmapfile()279871 Ref: fl_create_from_bitmapdata()279871 Node: Bitmap Attributes280495 Node: Bitmap Remarks281008 Node: Pixmap Object281169 Node: Adding Pixmap Objects281664 Ref: fl_add_pixmap()281857 Node: Pixmap Types282121 Node: Pixmap Interaction282329 Node: Other Pixmap Routines282780 Ref: fl_set_pixmap_file()283234 Ref: fl_set_pixmap_data()283234 Ref: fl_free_pixmap_pixmap()283760 Ref: fl_get_pixmap_pixmap()284061 Ref: fl_set_pixmap_pixmap()284384 Ref: fl_set_pixmap_align()284991 Node: Pixmap Attributes285419 Ref: fl_set_pixmap_colorcloseness()286052 Node: Pixmap Remarks286124 Ref: fl_read_pixmapfile()286321 Ref: fl_create_from_pixmapdata()287123 Ref: fl_free_pixmap()287829 Node: Clock Object288232 Node: Adding Clock Objects288705 Ref: fl_add_clock()288896 Node: Clock Types289119 Node: Clock Interaction289423 Node: Other Clock Routines289630 Ref: fl_get_clock()289918 Ref: fl_set_clock_adjustment()290247 Ref: fl_set_clock_ampm()290621 Node: Clock Attributes290679 Node: Clock Remarks291058 Node: Chart Object291288 Node: Adding Chart Objects292149 Ref: fl_add_chart()292343 Node: Chart Types292542 Node: Chart Interaction293489 Node: Other Chart Routines293696 Ref: fl_clear_chart()293999 Ref: fl_add_chart_value()294073 Ref: fl_set_chart_lstyle()294743 Ref: fl_set_chart_lsize()294743 Ref: fl_set_chart_lcolor()294743 Ref: fl_insert_chart_value()295113 Ref: fl_replace_chart_value()295563 Ref: fl_set_chart_bounds()296091 Ref: fl_get_chart_bounds()296304 Ref: fl_set_chart_autosize()296494 Ref: fl_set_chart_maxnumb()296766 Node: Chart Attributes296938 Ref: fl_set_chart_baseline()297281 Node: Chart Remarks297504 Node: Part III Button-like Objects297701 Node: Adding Button Objects299365 Ref: fl_add_button()299594 Ref: fl_add_lightbutton()299594 Ref: fl_add_roundbutton()299594 Ref: fl_add_round3dbutton()299594 Ref: fl_add_checkbutton()299594 Ref: fl_add_bitmapbutton()299594 Ref: fl_add_pixmapbutton()299594 Ref: fl_add_labelbutton()299594 Ref: fl_add_scrollbutton()299594 Ref: FL_BUTTON301301 Ref: FL_LIGHTBUTTON301345 Ref: FL_ROUNDBUTTON301473 Ref: FL_ROUND3DBUTTON301643 Ref: FL_CHECKBUTTON301752 Ref: FL_BITMAPBUTTON301936 Ref: FL_PIXMAPBUTTON302081 Ref: FL_LABELBUTTON302320 Ref: FL_SCROLLBARBUTTON302453 Node: Button Types303016 Ref: FL_NORMAL_BUTTON303233 Ref: FL_PUSH_BUTTON303355 Ref: FL_MENU_BUTTON303419 Ref: FL_TOUCH_BUTTON303510 Ref: FL_RADIO_BUTTON303595 Ref: FL_HIDDEN_BUTTON303670 Ref: FL_INOUT_BUTTON303720 Ref: FL_RETURN_BUTTON303789 Ref: FL_HIDDEN_RET_BUTTON303874 Node: Button Interaction305393 Node: Other Button Routines307619 Ref: fl_set_button()307937 Ref: fl_get_button()308663 Ref: fl_get_button_numb()308901 Ref: fl_set_button_mouse_buttons()309735 Ref: fl_get_button_mouse_buttons()310116 Ref: fl_set_button_shortcut()310578 Ref: fl_set_bitmapbutton_data()312464 Ref: fl_set_bitmapbutton_file()312464 Ref: fl_set_pixmapbutton_data()312754 Ref: fl_set_pixmapbutton_file()312754 Ref: fl_set_pixmapbutton_pixmap()312754 Ref: fl_free_pixmapbutton_pixmap()313498 Ref: fl_get_pixmapbutton_pixmap()313732 Ref: fl_set_pixmapbutton_align()313983 Ref: fl_set_pixmapbutton_focus_data()314614 Ref: fl_set_pixmapbutton_focus_file()314614 Ref: fl_set_pixmapbutton_focus_pixmap()314614 Ref: fl_set_pixmapbutton_focus_outline()315150 Ref: fl_free_pixmap_focus_pixmap()315366 Ref: Other Button Routines-Footnote-1315456 Node: Button Attributes315507 Node: Button Remarks316959 Node: Part III Valuator Objects317186 Node: Slider Object317633 Node: Adding Slider Objects318412 Ref: fl_add_slider()318610 Ref: fl_add_valslider()318752 Node: Slider Types319132 Ref: FL_VERT_SLIDER319338 Ref: FL_HOR_SLIDER319380 Ref: FL_VERT_FILL_SLIDER319423 Ref: FL_HOR_FILL_SLIDER319494 Ref: FL_VERT_NICE_SLIDER319564 Ref: FL_HOR_NICE_SLIDER319624 Ref: FL_VERT_BROWSER_SLIDER319685 Ref: FL_HOR_BROWSER_SLIDER319753 Ref: FL_VERT_PROGRESS_BAR319822 Ref: FL_HOR_PROGRESS_BAR319875 Node: Slider Interaction320192 Node: Other Slider Routines322275 Ref: fl_set_slider_value()322528 Ref: fl_set_slider_bounds()322528 Ref: fl_get_slider_value()323376 Ref: fl_get_slider_bounds()323376 Ref: fl_set_slider_mouse_buttons()323624 Ref: fl_get_slider_mouse_buttons()323913 Node: Slider Attributes324145 Ref: fl_set_slider_size()324757 Ref: fl_get_slider_size()325216 Ref: fl_set_slider_precision()325278 Ref: fl_set_slider_filter()325731 Node: Slider Remarks326346 Node: Scrollbar Object326661 Node: Adding Scrollbar Objects327659 Ref: fl_add_scrollbar()327858 Node: Scrollbar Types328160 Ref: FL_VERT_SCROLLBAR328386 Ref: FL_HOR_SCROLLBAR328434 Ref: FL_VERT_THIN_SCROLLBAR328483 Ref: FL_HOR_THIN_SCROLLBAR328554 Ref: FL_VERT_NICE_SCROLLBAR328626 Ref: FL_HOR_NICE_SCROLLBAR328702 Ref: FL_VERT_PLAIN_SCROLLBAR328779 Ref: FL_HOR_PLAIN_SCROLLBAR328843 Node: Scrollbar Interaction328910 Node: Other Scrollbar Routines330951 Ref: fl_set_scrollbar_value()331226 Ref: fl_set_scrollbar_bounds()331226 Ref: fl_get_scrollbar_value()332099 Ref: fl_get_scrollbar_bounds()332099 Ref: fl_set_scrollbar_increment()332438 Ref: fl_get_scrollbar_increment()333042 Ref: fl_get_scrollbar_repeat()333140 Ref: fl_set_scrollbar_repeat()333140 Node: Scrollbar Attributes333638 Ref: fl_set_scrollbar_size()334297 Ref: fl_get_scrollbar_size()334660 Node: Scrollbar Remarks334764 Node: Dial Object334971 Node: Adding Dial Objects335697 Ref: fl_add_dial()335866 Node: Dial Types336092 Ref: FL_NORMAL_DIAL336343 Ref: FL_LINE_DIAL336410 Ref: FL_FILL_DIAL336475 Node: Dial Interaction336544 Node: Other Dial Routines337533 Ref: fl_set_dial_value()337755 Ref: fl_set_dial_bounds()337755 Ref: fl_get_dial_value()338023 Ref: fl_get_dial_bounds()338023 Ref: fl_set_dial_angles()338328 Ref: fl_get_dial_angles()338705 Ref: fl_set_dial_crossover()338909 Ref: fl_set_dial_step()339178 Ref: fl_get_dial_step()339413 Ref: fl_set_dial_direction()339556 Ref: fl_get_dial_direction()339701 Node: Dial Attributes339751 Node: Dial Remarks340346 Node: Positioner Object340828 Node: Adding Positioner Objects341633 Ref: fl_add_positioner()341855 Node: Positioner Types342092 Ref: FL_NORMAL_POSITIONER342317 Ref: FL_OVERLAY_POSITIONER342371 Ref: FL_INVISIBLE_POSITIONER342438 Node: Positioner Interaction342901 Ref: fl_set_positioner_mouse_buttons()344246 Ref: fl_get_positioner_mouse_buttons()344622 Ref: fl_get_positioner_numb()345034 Node: Other Positioner Routines345313 Ref: fl_reset_positioner345877 Ref: fl_set_positioner_xbounds()346182 Ref: fl_set_positioner_ybounds()346182 Ref: FL_POSITIONER_VALIDATOR347030 Ref: fl_set_positioner_validator()347030 Ref: FL_POSITIONER_INVALID347462 Ref: FL_POSITIONER_VALID347602 Ref: FL_POSITIONER_REPLACED347758 Ref: fl_set_positioner_values()348707 Ref: fl_set_positioner_xvalue()348707 Ref: fl_set_positioner_yvalue()348707 Ref: fl_get_positioner_xvalue()349379 Ref: fl_get_positioner_yvalue()349379 Ref: fl_get_positioner_xbounds()349379 Ref: fl_get_positioner_ybounds()349379 Ref: fl_set_positioner_xstep()349789 Ref: fl_set_positioner_ystep()349789 Ref: fl_get_positioner_xstep()350061 Ref: fl_get_positioner_ystep()350061 Node: Positioner Attributes350920 Node: Positioners Remarks351428 Node: Counter Object351602 Node: Adding Counter Objects352545 Ref: fl_add_counter()352732 Node: Counter Types352966 Ref: FL_NORMAL_COUNTER353239 Ref: FL_SIMPLE_COUNTER353306 Node: Counter Interaction353372 Node: Other Counter Routines354688 Ref: fl_set_counter_value()354955 Ref: fl_set_counter_bounds()354955 Ref: fl_set_counter_step()354955 Ref: fl_get_counter_value()355871 Ref: fl_get_counter_bounds()355991 Ref: fl_get_counter_step()355991 Ref: fl_set_counter_precision()356257 Ref: fl_get_counter_precision()356373 Ref: fl_set_counter_filter()356591 Ref: fl_set_counter_repeat()357493 Ref: fl_set_counter_min_repeat()357586 Ref: fl_get_counter_repeat()357823 Ref: fl_get_counter_min_repeat()357823 Ref: fl_set_counter_speedjump()358301 Ref: fl_get_counter_speedjump()358649 Node: Counter Attributes358702 Node: Counter Remarks359126 Node: Spinner Object359319 Node: Adding Spinner Objects360292 Ref: fl_add_spinner()360479 Node: Spinner Types360730 Ref: FL_INT_SPINNER360989 Ref: FL_FLOAT_SPINNER361059 Node: Spinner Interaction361530 Node: Other Spinner Routines363044 Ref: fl_get_spinner_value()363284 Ref: fl_set_spinner_value()363284 Ref: fl_set_spinner_bounds()363785 Ref: fl_get_spinner_bounds()363785 Ref: fl_set_spinner_step()364425 Ref: fl_get_spinner_step()364425 Ref: fl_set_spinner_precision()364764 Ref: fl_get_spinner_precision()364764 Node: Spinner Attributes365084 Ref: fl_get_spinner_input()365953 Ref: fl_get_spinner_up_button()365953 Ref: fl_get_spinner_down_button()365953 Node: Thumbwheel Object366526 Node: Adding Thumbwheel Objects367308 Ref: fl_add_thumbwheel()367513 Node: Thumbwheel Types367757 Ref: FL_VERT_THUMBWHEEL368053 Ref: FL_HOR_THUMBWHEEL368103 Node: Thumbwheel Interaction368154 Node: Other Thumbwheel Routines370220 Ref: fl_set_thumbwheel_value()370501 Ref: fl_set_thumbwheel_bounds()370501 Ref: fl_get_thumbwheel_value()370781 Ref: fl_get_thumbwheel_bounds()370781 Ref: fl_set_thumbwheel_crossover()371232 Ref: fl_set_thumbwheel_step()371442 Ref: fl_get_thumbwheel_step()371673 Node: Thumbwheel Attributes371727 Node: Thumbwheel Remarks372004 Node: Part III Input Objects372216 Node: Adding Input Objects372890 Ref: fl_add_input()373111 Node: Input Types373351 Ref: FL_NORMAL_INPUT373554 Ref: FL_FLOAT_INPUT373625 Ref: FL_INT_INPUT373852 Ref: FL_DATE_INPUT374063 Ref: FL_MULTILINE_INPUT374185 Ref: FL_SECRET_INPUT374256 Ref: FL_HIDDEN_INPUT374398 Node: Input Interaction375207 Ref: fl_input_end_return_handling()380970 Ref: FL_INPUT_END_EVENT_ALWAYS381043 Ref: FL_INPUT_END_EVENT_CLASSIC381101 Ref: fl_set_input_maxchars()381485 Ref: FL_INPUT_VALIDATOR381999 Ref: fl_set_input_filter()381999 Ref: FL_VALID382267 Ref: FL_INVALID382267 Ref: FL_RINGBELL382267 Ref: fl_set_input_format()383847 Ref: fl_get_input_format()383847 Ref: fl_validate_input()384768 Ref: fl_set_input_mode()386017 Ref: FL_NORMAL_INPUT_MODE386041 Ref: FL_DOS_INPUT_MODE386126 Node: Other Input Routines386589 Ref: fl_set_input()386902 Ref: fl_set_input_f()386902 Ref: fl_get_input()387900 Ref: fl_set_input_selected()388488 Ref: fl_set_input_selected_range()388488 Ref: fl_get_input_selected_range()389256 Ref: fl_get_input_cursorpos()390135 Ref: fl_set_input_cursorpos()390846 Ref: fl_set_input_hscrollbar()391445 Ref: fl_set_input_vscrollbar()391445 Ref: fl_set_input_scroll()392075 Ref: fl_set_input_topline()392297 Ref: fl_set_input_xoffset()392494 Ref: fl_get_input_xoffset()392740 Ref: fl_set_input_cursor_visible()392907 Ref: fl_get_input_numberoflines()393031 Ref: fl_get_input_topline()393140 Ref: fl_get_input_screenlines()393254 Ref: fl_set_input_fieldchar()393459 Node: Input Attributes393567 Ref: fl_set_input_color()394025 Ref: fl_get_input_color()394244 Ref: fl_set_input_scrollbarsize()394470 Ref: fl_get_input_scrollbarsize()394747 Ref: FL_EditKeymap395561 Ref: fl_set_input_editkeymap()397060 Ref: fl_get_input_editkeymap()397747 Ref: FL_CONTROL_MASK398277 Ref: FL_ALT_MASK398334 Node: Input Remarks399440 Node: Part III Choice Objects399934 Node: Select Object400209 Node: Adding Select Objects401018 Ref: fl_add_select()401212 Ref: FL_NORMAL_SELECT401422 Ref: FL_MENU_SELECT401643 Ref: FL_DROPLIST_SELECT401868 Ref: fl_add_select_items()402259 Ref: fl_set_select_items()405920 Ref: fl_set_select_popup()407147 Node: Select Interaction407546 Ref: fl_set_select_policy()410923 Node: Other Select Routines411383 Ref: fl_get_select_item()411615 Ref: fl_get_select_item_by_value()412025 Ref: fl_get_select_item_by_label()412025 Ref: fl_get_select_item_by_label_f()412025 Ref: fl_get_select_item_by_text()412025 Ref: fl_get_select_item_by_text_f()412025 Ref: fl_set_select_item()413807 Ref: fl_delete_select_item()413978 Ref: fl_replace_select_item()414219 Ref: fl_insert_select_items()415202 Ref: fl_clear_select()415771 Node: Select Attributes416196 Ref: fl_set_select_text_color()416581 Ref: fl_get_select_text_color()416581 Ref: fl_set_select_text_align()416931 Ref: fl_get_select_text_align()416931 Ref: fl_set_select_text_font()417351 Ref: fl_get_select_text_font()417351 Ref: fl_get_select_popup()418362 Node: Select Remarks419718 Node: Nmenu Object419917 Node: Adding Nmenu Objects420590 Ref: fl_add_nmenu()420768 Ref: FL_NORMAL_NMENU420938 Ref: FL_NORMAL_TOUCH_NMENU421079 Ref: FL_BUTTON_NMENU421267 Ref: FL_BUTTON_TOUCH_NMENU421439 Ref: fl_add_nmenu_items()421741 Ref: fl_set_nmenu_items()422781 Ref: fl_set_nmenu_popup()426478 Node: Nmenu Interaction426617 Ref: fl_set_nmenu_policy()429195 Node: Other Nmenu Routines429631 Ref: fl_get_nmenu_item()429871 Ref: fl_get_nmenu_item_by_value()430378 Ref: fl_get_nmenu_item_by_label()430378 Ref: fl_get_nmenu_item_by_text()430378 Ref: fl_delete_nmenu_item()431484 Ref: fl_replace_nmenu_item()431616 Ref: fl_insert_nmenu_items()432011 Ref: fl_add_nmenu_items2()432841 Ref: fl_insert_nmenu_items2()432841 Ref: fl_replace_nmenu_items2()432841 Ref: fl_clear_nmenu()434096 Node: Nmenu Attributes434138 Ref: fl_set_nmenu_hl_text_color()434786 Ref: fl_get_nmenu_popup()435595 Node: Nmenu Remarks435891 Node: Browser Object436041 Node: Adding Browser Objects437084 Ref: fl_add_browser()437283 Node: Browser Types437514 Ref: FL_NORMAL_BROWSER437763 Ref: FL_SELECT_BROWSER437835 Ref: FL_HOLD_BROWSER437994 Ref: FL_DESELECTABLE_HOLD_BROWSER438109 Ref: FL_MULTI_BROWSER438226 Node: Browser Interaction438394 Node: Other Browser Routines442597 Ref: fl_clear_browser()442932 Ref: fl_add_browser_line()443016 Ref: fl_add_browser_line_f()443016 Ref: fl_addto_browser()443596 Ref: fl_addto_browser_f()443596 Ref: fl_addto_browser_chars()444054 Ref: fl_addto_browser_chars_f()444054 Ref: fl_insert_browser_line()444927 Ref: fl_insert_browser_line_f()444927 Ref: fl_delete_browser_line()445893 Ref: fl_replace_browser_line()445996 Ref: fl_replace_browser_line_f()445996 Ref: fl_get_browser_line()447445 Ref: fl_load_browser()447682 Ref: fl_select_browser_line()448234 Ref: fl_deselect_browser()448234 Ref: fl_deselect_browser_line()448234 Ref: fl_isselected_browser_line()448494 Ref: fl_get_browser_maxline()448571 Ref: fl_get_browser_screenlines()449139 Ref: fl_get_browser()449464 Ref: fl_get_browser_topline()449847 Ref: fl_show_browser_line()450042 Ref: fl_set_browser_dblclick_callback()450310 Ref: fl_set_browser_topline()450698 Ref: fl_set_browser_bottomline()450698 Ref: fl_set_browser_xoffset()451049 Ref: fl_set_browser_rel_xoffset()451049 Ref: fl_set_browser_yoffset()451049 Ref: fl_set_browser_rel_yoffset()451049 Ref: fl_get_browser_xoffset()451717 Ref: fl_get_browser_rel_xoffset()451717 Ref: fl_get_browser_yoffset()451717 Ref: fl_get_browser_rel_yoffset()451717 Ref: fl_get_browser_line_yoffset()452029 Node: Browser Attributes452300 Ref: fl_set_browser_fontsize()452802 Ref: fl_set_browser_fontstyle()452915 Ref: fl_set_browser_specialkey()455227 Ref: fl_set_browser_hscrollbar()455501 Ref: fl_set_browser_vscrollbar()455501 Ref: fl_set_browser_hscroll_callback()456303 Ref: fl_set_browser_vscroll_callback()456303 Ref: fl_set_browser_scrollbarsize()458022 Ref: fl_get_browser_dimension()458921 Ref: fl_get_browser_scrollbar_repeat()459355 Ref: fl_set_browser_scrollbar_repeat()459355 Node: Browser Remarks459898 Node: Part III Container Objects460568 Node: Folder Object460835 Node: Adding Folder Objects461562 Ref: fl_add_tabfolder()461762 Node: Folder Types462042 Ref: FL_TOP_TABFOLDER462237 Ref: FL_BOTTOM_TABFOLDER462290 Node: Folder Interaction462354 Ref: fl_get_active_folder()464057 Ref: fl_get_active_folder_number()464057 Ref: fl_get_active_folder_name()464057 Ref: fl_get_folder()464782 Ref: fl_get_folder_number()464782 Ref: fl_get_folder_name()464782 Node: Other Folder Routines465010 Ref: fl_addto_tabfolder()465245 Ref: fl_get_tabfolder_folder_bynumber()466787 Ref: fl_get_tabfolder_folder_byname()466787 Ref: fl_get_tabfolder_folder_byname_f()466787 Ref: fl_get_tabfolder_offset()467909 Ref: fl_set_tabfolder_offset()467909 Ref: fl_get_tabfolder_numfolders()468972 Ref: fl_delete_folder()469083 Ref: fl_delete_folder_bynumber()469083 Ref: fl_delete_folder_byname()469083 Ref: fl_delete_folder_byname_f()469083 Ref: fl_set_folder()469946 Ref: fl_set_folder_bynumber()469946 Ref: fl_set_folder_byname()469946 Ref: fl_set_folder_byname_f()469946 Ref: fl_get_folder_area()470627 Ref: fl_set_tabfolder_autofit()471364 Node: Folder Remarks471676 Ref: fl_set_default_tabfolder_corner()472025 Node: FormBrowser Object473276 Node: Adding FormBrowser Objects474140 Ref: fl_add_formbrowser()474387 Node: FormBrowser Types474680 Node: FormBrowser Interaction474953 Node: Other FormBrowser Routines476577 Ref: fl_addto_formbrowser()476840 Ref: fl_get_formbrowser_numforms()477662 Ref: fl_delete_formbrowser()478258 Ref: fl_delete_formbrowser_bynumber()478258 Ref: fl_replace_formbrowser()479127 Ref: fl_insert_formbrowser()479622 Ref: fl_find_formbrowser_form_number()479982 Ref: fl_get_formbrowser_form()480243 Ref: fl_set_formbrowser_hscrollbar()480475 Ref: fl_set_formbrowser_vscrollbar()480475 Ref: fl_set_formbrowser_scroll()480932 Ref: FL_SMOOTH_SCROLL481034 Ref: FL_JUMP_SCROLL481072 Ref: fl_get_formbrowser_topform()481241 Ref: fl_set_formbrowser_topform()481389 Ref: fl_set_formbrowser_topform_bynumber()481389 Ref: fl_get_formbrowser_area()481824 Ref: fl_set_formbrowser_xoffset()482148 Ref: fl_set_formbrowser_yoffset()482148 Ref: fl_get_formbrowser_xoffset()482716 Ref: fl_get_formbrowser_yoffset()482716 Node: FormBrowser Remarks482824 Node: Part III Other Objects483226 Node: Timer Object483493 Node: Adding Timer Objects484737 Ref: fl_add_timer()484928 Node: Timer Types485109 Node: Timer Interaction485558 Node: Other Timer Routines486320 Ref: fl_set_timer()486540 Ref: fl_get_timer()486733 Ref: fl_set_timer_countup()486992 Ref: fl_suspend_timer()487176 Ref: fl_resume_timer()487245 Ref: fl_set_timer_filter()487582 Node: Timer Attributes488060 Node: Timer Remarks488432 Node: XYPlot Object488984 Node: Adding XYPlot Objects489612 Ref: fl_add_xyplot()489813 Node: XYPlot Types490026 Ref: FL_NORMAL_XYPLOT490221 Ref: FL_SQUARE_XYPLOT490293 Ref: FL_CIRCLE_XYPLOT490376 Ref: FL_FILL_XYPLOT490459 Ref: FL_POINTS_XYPLOT490549 Ref: FL_LINEPOINTS_XYPLOT490608 Ref: FL_DASHED_XYPLOT490706 Ref: FL_DOTTED_XYPLOT490762 Ref: FL_DOTDASHED_XYPLOT490818 Ref: FL_IMPULSE_XYPLOT490884 Ref: FL_ACTIVE_XYPLOT490942 Ref: FL_EMPTY_XYPLOT491055 Node: XYPlot Interaction491465 Ref: fl_get_xyplot()493169 Ref: fl_set_xyplot_mark_active()493533 Ref: fl_set_xyplot_data()493684 Ref: fl_set_xyplot_data_double()493684 Ref: fl_set_xyplot_file()494741 Ref: fl_get_xyplot_data_size()495350 Ref: fl_get_xyplot_data()495350 Ref: fl_set_xyplot_inspect()495809 Node: Other XYPlot Routines496531 Ref: fl_set_xyplot_xtics()496861 Ref: fl_set_xyplot_ytics()496861 Ref: fl_set_xyplot_log_minor_xtics()497760 Ref: fl_set_xyplot_log_minor_ytics()497760 Ref: fl_set_xyplot_alphaxtics()498291 Ref: fl_set_xyplot_alphaytics()498291 Ref: fl_set_xyplot_xgrid()499684 Ref: fl_set_xyplot_ygrid()499684 Ref: fl_set_xyplot_grid_linestyle()500107 Ref: fl_set_xyplot_fixed_xaxis()500594 Ref: fl_set_xyplot_fixed_yaxis()500594 Ref: fl_set_xyplot_symbolsize()501396 Ref: fl_set_xyplot_symbol()501666 Ref: fl_set_xyplot_xbounds()503329 Ref: fl_set_xyplot_ybounds()503329 Ref: fl_get_xyplot_xbounds()503784 Ref: fl_get_xyplot_ybounds()503784 Ref: fl_replace_xyplot_point()503991 Ref: fl_add_xyplot_overlay()504259 Ref: fl_add_xyplot_overlay_file()504730 Ref: fl_set_xyplot_overlay_type()505068 Ref: fl_get_xyplot_overlay_data()505385 Ref: fl_get_xyplot_data_pointer()506028 Ref: fl_set_xyplot_maxoverlays()506489 Ref: fl_get_xyplot_numdata()506791 Ref: fl_insert_xyplot_data()506972 Ref: fl_delete_xyplot_overlay()507429 Ref: fl_add_xyplot_text()507694 Ref: fl_delete_xyplot_text()508432 Ref: fl_set_xyplot_key()508840 Ref: fl_set_xyplot_key_position()509078 Ref: fl_set_xyplot_keys()509446 Ref: fl_set_xyplot_key_font()509878 Ref: fl_set_xyplot_interpolate()510018 Ref: fl_set_xyplot_linewidth()510514 Ref: fl_set_xyplot_xscale()510836 Ref: fl_set_xyplot_yscale()510836 Ref: fl_clear_xyplot()511195 Ref: fl_get_xyplot_xmapping()511642 Ref: fl_get_xyplot_ymapping()511642 Ref: fl_xyplot_s2w()512208 Ref: fl_xyplot_w2s()512208 Ref: fl_get_xyplot_screen_area()512704 Ref: fl_get_xyplot_world_area()512704 Ref: fl_set_xyplot_mouse_buttons()513490 Ref: fl_get_xyplot_mouse_buttons()513787 Node: XYPlot Attributes514019 Node: XYPlot Remarks514577 Ref: fl_interpolate()514777 Node: Canvas Object515623 Node: Adding Canvas Objects517179 Ref: fl_add_canvas()517393 Node: Canvas Types517774 Node: Canvas Interaction518005 Ref: fl_add_canvas_handler()519010 Ref: fl_remove_canvas_handler()521712 Ref: fl_get_canvas_id()522206 Ref: FL_ObjWin()522303 Node: Other Canvas Routines523416 Ref: fl_set_canvas_attributes()523845 Ref: fl_set_canvas_colormap()524204 Ref: fl_get_canvas_colormap()524204 Ref: fl_set_canvas_visual()524204 Ref: fl_set_canvas_depth()524204 Ref: fl_get_canvas_depth()524204 Ref: fl_share_canvas_colormap()525361 Ref: fl_create_colormap()526095 Ref: fl_canvas_yield_to_shortcut()527108 Ref: fl_clear_canvas()527201 Node: Canvas Attributes527431 Node: OpenGL Canvas527926 Ref: fl_add_glcanvas()528346 Ref: fl_set_glcanvas_defaults()528849 Ref: fl_get_glcanvas_defaults()528998 Ref: fl_set_glcanvas_attributes()529162 Ref: fl_get_glcanvas_attributes()529444 Ref: fl_get_glcanvas_context()529636 Ref: fl_set_glcanvas_direct()529909 Ref: fl_activate_glcanvas()530480 Ref: fl_get_glcanvas_xvisualinfo()530682 Node: Part III Popups530805 Node: Adding Popups532145 Ref: fl_popup_add()532726 Ref: fl_popup_add_entries()533501 Ref: FL_POPUP_CB541631 Ref: FL_POPUP_RETURN543061 Ref: FL_POPUP_ENTRY546010 Ref: FL_POPUP_NORMAL546811 Ref: FL_POPUP_TOGGLE546880 Ref: FL_POPUP_RADIO546991 Ref: FL_POPUP_SUB547203 Ref: FL_POPUP_LINE547395 Ref: FL_POPUP_NONE547596 Ref: FL_POPUP_DISABLED547670 Ref: FL_POPUP_HIDDEN547800 Ref: FL_POPUP_CHECKED547886 Ref: fl_popup_entry_delete()549982 Ref: fl_popup_create()551543 Ref: FL_POPUP_ITEM551944 Ref: fl_popup_add_items()558752 Ref: fl_popup_insert_items()558752 Node: Popup Interaction559638 Ref: fl_popup_do()559859 Ref: fl_popup_set_policy()563549 Ref: FL_POPUP_NORMAL_SELECT563649 Ref: FL_POPUP_DRAG_SELECT563810 Ref: fl_popup_get_policy()564247 Node: Other Popup Routines565065 Ref: fl_popup_set_position()565415 Ref: fl_popup_get_size()565998 Ref: fl_popup_set_callback()566530 Ref: fl_popup_entry_set_callback()566892 Ref: fl_popup_entry_set_enter_callback()566892 Ref: fl_popup_entry_set_leave_callback()566892 Ref: fl_popup_entry_set_state()568159 Ref: fl_popup_entry_get_state()568159 Ref: fl_popup_entry_clear_state()569086 Ref: fl_popup_raise_clear_state()569086 Ref: fl_popup_toggle_clear_state()569086 Ref: fl_popup_entry_get_by_text()570256 Ref: fl_popup_entry_get_by_text_f()570256 Ref: fl_popup_entry_get_by_label()571211 Ref: fl_popup_entry_get_by_label_f()571211 Ref: fl_popup_entry_get_by_value()571889 Ref: fl_popup_entry_get_by_user_data()572111 Ref: fl_popup_entry_get_by_position()572461 Node: Popup Attributes572824 Ref: fl_popup_set_title()572972 Ref: fl_popup_set_title_f()572972 Ref: fl_popup_get_title()572972 Ref: fl_popup_get_title_font()573587 Ref: fl_popup_set_title_font()573587 Ref: fl_popup_entry_set_font()574222 Ref: fl_popup_get_min_width()574894 Ref: fl_popup_set_min_width()574894 Ref: fl_popup_get_bw()575424 Ref: fl_popup_set_bw()575424 Ref: fl_popup_set_cursor()575946 Ref: fl_popup_set_color()576513 Ref: fl_popup_get_color()576513 Ref: FL_POPUP_BACKGROUND_COLOR576734 Ref: FL_POPUP_HIGHLIGHT_COLOR576821 Ref: FL_POPUP_TITLE_COLOR576981 Ref: FL_POPUP_TEXT_COLOR577077 Ref: FL_POPUP_HIGHLIGHT_TEXT_COLOR577165 Ref: FL_POPUP_DISABLED_TEXT_COLOR577309 Ref: FL_POPUP_RADIO_COLOR577431 Ref: fl_popup_entry_set_text()577918 Ref: fl_popup_entry_set_shortcut()578230 Ref: fl_popup_entry_set_value()578480 Ref: fl_popup_entry_set_user_data()578678 Ref: fl_popup_entry_get_group()578914 Ref: fl_popup_entry_set_group()579226 Ref: fl_popup_entry_get_subpopup()579888 Ref: fl_popup_entry_set_subpopup()579888 Node: Part III Deprecated Objects580812 Node: Choice Object581296 Node: Adding Choice Objects582011 Ref: fl_add_choice()582211 Node: Choice Types582483 Ref: FL_NORMAL_CHOICE582678 Ref: FL_NORMAL_CHOICE2582739 Ref: FL_DROPLIST_CHOICE582818 Node: Choice Interaction582923 Node: Other Choice Routines584452 Ref: fl_addto_choice()584743 Ref: fl_addto_choice_f()584743 Ref: fl_delete_choice()585835 Ref: fl_clear_choice()585994 Ref: fl_replace_choice()586072 Ref: fl_replace_choice_f()586072 Ref: fl_get_choice()586419 Ref: fl_get_choice_text()586624 Ref: fl_get_choice_item_text()586805 Ref: fl_get_choice_maxitems()586943 Ref: fl_set_choice_item_mode()587064 Ref: fl_get_choice_item_mode()587275 Ref: fl_set_choice_entries()587443 Ref: fl_set_choice()588013 Ref: fl_set_choice_text()588013 Ref: fl_set_choice_text_f()588013 Node: Choice Attributes588714 Ref: fl_set_choice_align()589242 Ref: fl_set_choice_fontsize()589357 Ref: fl_set_choice_fontstyle()589475 Ref: fl_set_choice_align_bottom()590164 Node: Choice Remarks590520 Node: Menu Object590702 Node: Adding Menu Objects591445 Ref: fl_add_menu()591626 Node: Menu Types591822 Ref: FL_PUSH_MENU592005 Ref: FL_PULLDOWN_MENU592087 Ref: FL_TOUCH_MENU592173 Node: Menu Interaction593339 Node: Other Menu Routines594685 Ref: fl_set_menu()595236 Ref: fl_addto_menu()597065 Ref: fl_delete_menu_item()597331 Ref: fl_replace_menu_item()597331 Ref: fl_set_menu_entries()598513 Ref: fl_clear_menu()599689 Ref: fl_get_menu()599779 Ref: fl_get_menu_item_text()600713 Ref: fl_get_menu_text()600921 Ref: fl_get_menu_maxitems()601033 Ref: fl_set_menu_item_mode()601331 Ref: FL_PUP_NONE601701 Ref: FL_PUP_BOX601769 Ref: FL_PUP_RADIO601932 Ref: FL_PUP_GREY602132 Ref: FL_PUP_CHECK602274 Ref: fl_get_menu_item_mode()602549 Ref: fl_set_menu_item_callback()602760 Ref: fl_set_menu_item_shortcut()603311 Ref: fl_show_menu_symbol()603685 Node: Menu Attributes603874 Ref: fl_set_menu_popup()604697 Ref: fl_get_menu_popup()605163 Ref: fl_set_menu_notitle()605525 Node: Menu Remarks605578 Node: XPopup605893 Node: Creating XPopups606506 Ref: fl_newpup()606691 Ref: fl_defpup()606691 Ref: fl_addtopup()612843 Ref: fl_dopup()613279 Ref: fl_current_pup()615923 Ref: fl_freepup()616189 Ref: fl_setpup_entries()616300 Node: XPopup Interaction619946 Ref: fl_setpup_shortcut()620960 Ref: FL_PUP_CB622122 Ref: fl_setpup_itemcb()622122 Ref: fl_setpup_menucb()622122 Ref: fl_setpup_entercb()623421 Ref: fl_setpup_leavecb()623421 Ref: fl_setpup_submenu()624246 Node: Other XPopup Routines624795 Ref: fl_setpup_mode()625237 Ref: fl_getpup_mode()625686 Ref: fl_getpup_text()625965 Ref: fl_setpup_position()626324 Ref: fl_setpup_align_bottom()626960 Ref: fl_setpup_selection()627427 Ref: fl_getpup_items()627658 Node: XPopup Attributes627699 Ref: fl_setpup_title()627916 Ref: fl_setpup_title_f()627916 Ref: fl_setpup_default_fontsize()628378 Ref: fl_setpup_default_fontstyle()628378 Ref: fl_setpup_default_bw()628378 Ref: fl_setpup_default_cursor()628676 Ref: fl_setpup_cursor()628962 Ref: fl_setpup_shadow()629347 Ref: fl_setpup_bw()629585 Ref: fl_setpup_softedge()629585 Ref: fl_setpup_default_color()630038 Ref: fl_setpup_default_checkcolor()630377 Ref: fl_setpup_maxpups()630563 Ref: fl_showpup()630728 Ref: fl_hidepup()630728 Node: XPopup Remarks630963 Node: Part IV631330 Node: Part IV Introduction631746 Node: Part IV Global Structure634319 Ref: Part IV Global Structure-Footnote-1639281 Node: The Routine fl_add_NEW()639418 Ref: fl_malloc()640795 Ref: fl_calloc()640795 Ref: fl_realloc()640795 Ref: fl_free()640795 Ref: fl_strdup()641375 Node: Part IV Events642306 Ref: FL_DRAW642800 Ref: fl_get_real_object_window()645223 Ref: FL_DRAWLABEL645543 Ref: FL_ENTER645825 Ref: FL_LEAVE646367 Ref: FL_MOTION646482 Ref: FL_PUSH646687 Ref: FL_LEFT_MOUSE646917 Ref: FL_MIDDLE_MOUSE646992 Ref: FL_RIGHT_MOUSE647071 Ref: FL_SCROLLUP_MOUSE647148 Ref: FL_SCROLLDOWN_MOUSE647244 Ref: FL_RELEASE647344 Ref: FL_DBLCLICK647509 Ref: FL_TRPLCLICK647903 Ref: FL_FOCUS648175 Ref: FL_UNFOCUS648356 Ref: FL_KEYPRESS648418 Ref: FL_SHORTCUT648894 Ref: FL_STEP649036 Ref: FL_UPDATE649519 Ref: FL_ATTRIB650175 Ref: FL_FREEMEM650841 Ref: FL_OTHER651011 Node: Shortcuts651503 Ref: fl_set_object_shortcut()651900 Ref: fl_set_object_shortcutkey()653907 Ref: FL_KEY_NORMAL656338 Ref: FL_KEY_TAB656508 Ref: FL_KEY_SPECIAL656620 Ref: FL_KEY_ALL656798 Node: Part IV The Type FL_OBJECT657010 Ref: fl_make_object()672497 Ref: fl_add_child()674059 Ref: Part IV The Type FL_OBJECT-Footnote-1675867 Node: Part IV Drawing Objects675963 Node: General Remarks676402 Ref: FL_State677355 Ref: fl_default_window()678293 Ref: fl_get_form_vclass()679148 Ref: fl_get_vclass()679148 Ref: fl_get_display()680273 Ref: FL_FormDisplay()680295 Ref: fl_win_to_form()680847 Node: Color Handling680992 Ref: fl_get_pixel()681524 Ref: fl_color()681774 Ref: fl_bk_color()681870 Ref: fl_set_foreground()682021 Ref: fl_set_background()682021 Ref: fl_free_colors()682377 Ref: fl_free_pixels()682762 Ref: fl_mapcolor()682999 Ref: fl_mapcolorname()682999 Ref: fl_getmcolor()682999 Node: Mouse Handling683910 Ref: fl_get_form_mouse()684324 Ref: fl_get_win_mouse()684324 Ref: fl_get_mouse()684917 Ref: fl_set_mouse()685145 Node: Clipping685313 Ref: fl_set_clipping()685519 Ref: fl_is_clipped()686250 Ref: fl_get_clipping()686619 Ref: fl_unset_clipping()687182 Ref: fl_is_global_clipped()687339 Ref: fl_get_global_clipping()687339 Ref: fl_set_text_clipping()687639 Ref: fl_is_text_clipped()687639 Ref: fl_get_text_clipping()687639 Ref: fl_unset_text_clipping()687639 Ref: fl_set_gc_clipping()688029 Ref: fl_unset_gc_clipping()688029 Node: Getting the Size688561 Ref: fl_get_char_height()689241 Ref: fl_get_char_width()689241 Ref: fl_get_string_width()689892 Ref: fl_get_string_height()689892 Ref: fl_get_string_dimension()691094 Node: Font Handling691237 Ref: fl_get_fontstruct()691565 Node: Drawing Functions691979 Ref: fl_winset()692444 Ref: fl_winget()692444 Ref: fl_rectf()693094 Ref: fl_rect()693094 Ref: fl_rectbound()693545 Ref: fl_roundrectf()693734 Ref: fl_roundrect()693734 Ref: fl_polyf()694017 Ref: fl_polyl()694017 Ref: fl_polybound()694017 Ref: fl_ovalf()694801 Ref: fl_ovall()694801 Ref: fl_ovalbound()694801 Ref: fl_circ()695877 Ref: fl_circf()695877 Ref: fl_circbound()695877 Ref: fl_arc()696289 Ref: fl_arcf()696289 Ref: fl_pieslice()697030 Ref: fl_ovalarc(697597 Ref: fl_line()698175 Ref: fl_diagline()698401 Ref: fl_lines()698565 Ref: fl_point()698747 Ref: fl_points()698747 Ref: fl_linewidth()699484 Ref: fl_linestyle()699484 Ref: fl_dashedlinestyle()700395 Ref: fl_drawmode()701750 Ref: fl_get_linewidth()702503 Ref: fl_get_linestyle(()702503 Ref: fl_get_drawmode(()702503 Ref: fl_draw_box()702790 Ref: fl_draw_frame()703373 Ref: fl_draw_text()703653 Ref: fl_draw_text_beside()703653 Ref: fl_draw_text_cursor()705071 Ref: fl_get_align_xy()705801 Ref: fl_draw_object_label()706448 Ref: fl_draw_object_label_outside()706448 Node: Part IV An Example707620 Node: Part IV New Buttons712880 Ref: fl_create_generic_button()713986 Ref: fl_add_button_class()716892 Ref: Part IV New Buttons-Footnote-1727695 Node: Part IV Using a Pre-emptive Handler727778 Ref: fl_set_object_prehandler()729171 Ref: fl_set_object_posthandler()729171 Ref: FL_PREEMPT730296 Node: Part V731336 Node: Part V Overview of Main Functions731705 Node: Version Information732252 Ref: FL_VERSION732544 Ref: FL_REVISION732589 Ref: FL_INCLUDE_VERSION732626 Ref: fl_library_version()732771 Node: Initialization733459 Ref: fl_initialize()733647 Ref: fl_set_visualID()737183 Ref: fl_get_cmdline_args()737985 Ref: fl_set_defaults()738835 Ref: FL_IOPT738835 Ref: fl_get_coordunit()742065 Ref: fl_set_coordunit()742065 Ref: fl_set_border_width()742979 Ref: fl_get_border_width()743405 Ref: fl_set_scrollbar_type()743590 Ref: fl_flip_yorigin()744648 Ref: fl_set_tabstop()745810 Ref: fl_set_form_dblbuffer()746761 Ref: fl_set_object_dblbuffer()746761 Ref: fl_set_error_handler()747555 Ref: fl_set_error_logfp()748157 Ref: fl_show_errors()748583 Ref: fl_set_font_name()748824 Ref: fl_set_font_name_f()748824 Ref: fl_adjust_form_size()751732 Ref: fl_fit_object_label()753015 Ref: fl_set_icm_color()753949 Ref: fl_get_icm_color()754191 Ref: fl_finish()754712 Node: Creating Forms754880 Ref: fl_bgn_form()755093 Ref: fl_set_form_background_color()756224 Ref: fl_get_form_background_color()756224 Ref: fl_end_form()756695 Ref: fl_bgn_group()756885 Ref: fl_end_group()757132 Ref: fl_addto_form()758307 Ref: fl_addto_group()758307 Ref: fl_delete_object()758631 Ref: fl_add_object()758862 Ref: fl_free_object()759020 Ref: fl_free_form()759499 Node: Object Attributes759691 Ref: fl_get_object_objclass()760257 Ref: fl_get_object_type()760257 Ref: fl_set_object_color()760511 Ref: fl_get_object_color()760639 Ref: fl_set_object_boxtype()760750 Ref: fl_get_object_boxtype()761053 Ref: fl_set_object_bw()761265 Ref: fl_get_object_bw()761265 Ref: fl_set_object_position()761513 Ref: fl_get_object_position()761513 Ref: fl_move_object()761811 Ref: fl_set_object_size()762022 Ref: fl_get_object_size()762022 Ref: fl_set_object_geometry()762339 Ref: fl_get_object_geometry()762339 Ref: fl_get_object_bbox()763126 Ref: fl_get_object_component()763737 Ref: fl_set_object_lcolor()764641 Ref: fl_set_object_lsize()764641 Ref: fl_set_object_lstyle()764641 Ref: fl_set_object_lalign()764641 Ref: fl_set_object_label()764641 Ref: fl_set_object_label_f()764641 Ref: fl_get_object_lcolor()765115 Ref: fl_get_object_lsize()765115 Ref: fl_get_object_lstyle()765115 Ref: fl_get_object_lalign()765115 Ref: fl_get_object_label()765115 Ref: fl_set_object_helper()765428 Ref: fl_set_object_helper_f()765428 Ref: fl_set_tooltip_boxtype()766090 Ref: fl_set_tooltip_color()766090 Ref: fl_set_tooltip_font()766090 Ref: fl_set_object_resize()766719 Ref: fl_get_object_resize()766719 Ref: fl_set_object_gravity()766719 Ref: fl_get_object_gravity()766719 Ref: fl_freeze_form()767429 Ref: fl_unfreeze_form()767429 Ref: fl_freeze_all_forms()767800 Ref: fl_unfreeze_all_forms()767800 Ref: fl_set_object_automatic()768240 Ref: fl_object_is_automatic()768369 Ref: fl_set_object_dblclick()768520 Ref: fl_get_object_dblclick()768811 Ref: fl_hide_object()768949 Ref: fl_show_object()768949 Ref: fl_object_is_visible()769253 Ref: fl_trigger_object()769302 Ref: fl_set_focus_object()769431 Ref: fl_reset_focus_object()769991 Ref: fl_get_focus_object()770118 Ref: fl_set_object_callback()770184 Ref: fl_call_object_callback()770497 Ref: fl_set_form_callback()770641 Ref: fl_last_event()771101 Ref: fl_current_event()771358 Ref: FL_TRIGGER771487 Ref: FL_NOEVENT771715 Ref: fl_get_label_char_at_mouse)771962 Ref: fl_object_ps_dump()772650 Ref: flps_init()773848 Node: Doing Interaction775498 Ref: fl_show_form()775726 Ref: fl_show_form_f()775726 Ref: fl_set_app_mainform()780239 Ref: fl_get_app_mainform()780447 Ref: fl_set_app_nomainform()780912 Ref: fl_prepare_form_window()781349 Ref: fl_prepare_form_window_f()781349 Ref: fl_show_form_window()782012 Ref: fl_raise_form()782349 Ref: fl_lower_form()782446 Ref: fl_set_form_position()782663 Ref: fl_set_form_size()782663 Ref: fl_set_form_geometry()782663 Ref: fl_scale_form()782663 Ref: fl_get_decoration_sizes()783471 Ref: fl_form_is_iconified()783956 Ref: fl_set_form_minsize()784291 Ref: fl_set_form_maxsize()784291 Ref: fl_set_form_icon()784782 Ref: fl_set_form_title()785216 Ref: fl_set_form_title_f()785216 Ref: fl_hide_form()785532 Ref: fl_form_is_visible()785717 Ref: fl_do_forms()786024 Ref: fl_check_forms()786400 Ref: fl_do_only_forms()786713 Ref: fl_check_only_forms()786713 Ref: fl_activate_form()787080 Ref: fl_deactivate_form()787080 Ref: fl_deactivate_all_forms()787224 Ref: fl_activate_all_forms()787224 Ref: fl_form_is_activated()787351 Ref: fl_set_form_atactivate()787584 Ref: fl_set_form_atdeactivate()787584 Ref: fl_activate_object()788300 Ref: fl_deactivate_object()788300 Ref: fl_object_is_active()788557 Ref: fl_redraw_object()788605 Ref: fl_redraw_form()788965 Ref: fl_set_event_callback()789393 Ref: fl_add_event_callback()789698 Ref: fl_remove_event_callback()789698 Ref: fl_activate_event_callbacks()790546 Node: Signals790599 Ref: fl_add_signal_callback()791422 Ref: fl_remove_signal_callback()792667 Ref: fl_app_signal_direct()793728 Ref: fl_signal_caught()794222 Node: Idle Callbacks and Timeouts796023 Ref: fl_set_idle_callback()796479 Ref: fl_set_idle_delta()797238 Ref: fl_add_timeout()797948 Ref: fl_remove_timeout()798751 Node: Global Variables and Macros798998 Ref: FL_EVENT799276 Ref: fl_current_form799696 Ref: fl_display799787 Ref: fl_screen800259 Ref: fl_root800356 Ref: fl_vroot800420 Ref: fl_scrw800631 Ref: fl_scrh800631 Ref: fl_vmode800714 Ref: fl_state801160 Ref: fl_dpi801459 Ref: fl_get_dpi()801459 Ref: fl_visual801702 Ref: fl_get_visual()801702 Ref: fl_colormap801885 Ref: fl_get_colormap()801885 Ref: fl_ul_magic_char802070 Node: Part V Some Useful Functions802395 Node: Misc. Functions802677 Ref: fl_ringbell()802901 Ref: fl_whoami()803251 Ref: fl_now()803374 Ref: fl_gettime()803532 Ref: fl_mode_capable()803806 Ref: fl_get_visual_depth804335 Ref: fl_msleep()804381 Node: Windowing Support804519 Ref: fl_wincreate()805009 Ref: fl_winshow()805009 Ref: fl_winopen()805735 Ref: fl_winreparent()806550 Ref: fl_initial_winsize()807001 Ref: fl_winsize()807001 Ref: fl_initial_winstate()807633 Ref: fl_winminsize()808057 Ref: fl_winmaxsize()808057 Ref: fl_winposition()808757 Ref: fl_initial_wingeometry()809002 Ref: fl_wingeometry()809002 Ref: fl_winaspect()809430 Ref: fl_wintitle()809632 Ref: fl_wintitle_f()809632 Ref: fl_winicontitle()810044 Ref: fl_winicontitle_f()810044 Ref: fl_winicon()810205 Ref: fl_noborder()810410 Ref: fl_transient()810410 Ref: fl_winbackground()810561 Ref: fl_winstepsize()810710 Ref: fl_reset_winconstraints()811114 Ref: fl_get_winsize()811247 Ref: fl_get_winorigin()811247 Ref: fl_get_wingeometry()811247 Ref: fl_winresize()811709 Ref: fl_winmove()812119 Ref: fl_winreshape()812240 Ref: fl_iconify()812418 Ref: fl_winhide()812711 Ref: fl_winclose()812881 Ref: fl_winisvalid()813213 Ref: fl_winfocus()813559 Node: Cursors813656 Ref: fl_set_cursor()813867 Ref: fl_reset_cursor()814939 Ref: fl_set_cursor_color()815038 Ref: fl_create_bitmap_cursor()815387 Ref: fl_create_animated_cursor()816071 Node: Clipboard816928 Ref: fl_stuff_clipboard()818346 Ref: fl_request_clipboard()819449 Node: Part V Resources for Forms Library820936 Node: Current Support821791 Ref: fl_get_app_resources()823102 Ref: FL_RTYPE823763 Ref: FL_SHORT823764 Ref: FL_BOOL823799 Ref: FL_INT823843 Ref: FL_LONG823876 Ref: FL_FLOAT823911 Ref: FL_STRING823948 Ref: FL_NONE823987 Node: Resources Example827682 Ref: fl_get_resource()829208 Ref: fl_set_resource()830071 Node: Going Further830465 Node: Part V Dirty Tricks831947 Node: Interaction832604 Node: Form Events832764 Ref: fl_register_raw_callback()833263 Node: Object Events835906 Node: Other838008 Node: Part V Trouble Shooting838560 Node: Part VI840355 Node: Part VI Images840547 Node: The Basic Image Support API842216 Ref: flimage_load()843733 Ref: flimage_dump()843733 Ref: flimage_free()845383 Ref: flimage_display()845653 Ref: flimage_sdisplay()845653 Ref: flimage_is_supported()849950 Node: The FL_IMAGE Structure850160 Node: Supported image types858451 Ref: flimage_windowlevel()860927 Ref: flimage_type_name()861338 Ref: flimage_convert()861467 Node: Creating Images863193 Ref: flimage_alloc()863817 Ref: fl_get_matrix()865021 Ref: flimage_getmem()865021 Node: Supported Image Formats867473 Node: Built-in support868111 Ref: flimage_enable_bmp()869887 Ref: flimage_enable_pnm()869887 Ref: flimage_enable_genesis()869887 Ref: flimage_enable_fits()869887 Ref: flimage_enable_gif()869887 Ref: flimage_enable_gzip()869887 Ref: flimage_enable_jpeg()869887 Ref: flimage_enable_png()869887 Ref: flimage_enable_ps()869887 Ref: flimage_enable_sgi()869887 Ref: flimage_enable_tiff()869887 Ref: flimage_enable_xbm()869887 Ref: flimage_enable_xpm()869887 Ref: flimage_enable_xwd()869887 Ref: flimage_jpeg_output_options()870757 Ref: flimage_pnm_output_options()871109 Ref: flimage_gif_output_options()871375 Ref: flimage_ps_options()871663 Ref: Built-in support-Footnote-1873696 Node: Adding New Formats873854 Ref: flimage_add_format()874358 Ref: flimage_description_via_filter()881139 Ref: flimage_write_via_filter()881139 Node: Queries885323 Ref: flimage_get_number_of_formats()885664 Ref: flimage_get_format_info()885872 Node: Setup and Configuration887097 Ref: flimage_setup()887986 Ref: flimage_error()891028 Ref: flimage_open()892853 Ref: flimage_read()893056 Ref: flimage_close()893313 Ref: Setup and Configuration-Footnote-1893449 Node: Simple Image Processing893584 Node: Convolution894509 Ref: flimage_convolve()894704 Ref: flimage_convolvea()895218 Node: Tint895838 Ref: flimage_tint()896139 Ref: Tint-Footnote-1897180 Node: Rotation897268 Ref: flimage_rotate()897466 Node: Image Flipping899107 Ref: flimage_flip()899630 Node: Cropping899765 Ref: flimage_autocrop()899956 Ref: flimage_crop()899956 Ref: flimage_get_autocrop()901514 Node: Scaling901960 Ref: flimage_scale()902569 Node: Warping904277 Ref: flimage_warp()906980 Node: General Pixel Transformation909095 Ref: flimage_transform_pixels()909508 Node: Image Annotation910539 Node: Using Text Strings911003 Ref: flimage_add_text()911209 Ref: flimage_add_text_struct()912744 Ref: flimage_delete_all_text()913734 Node: Using Markers913916 Ref: flimage_add_marker()914243 Ref: flimage_add_marker_struct()914243 Ref: flimage_delete_all_markers()916237 Ref: flimage_define_marker()916466 Node: Pixelizing the Annotation917497 Ref: flimage_render_annotation()918286 Node: Write Your Own Routines919510 Node: Utilities920097 Node: Memory Allocation920413 Ref: fl_make_matrix()920681 Ref: fl_free_matrix()921855 Ref: flimage_dup()922387 Ref: flimage_to_pixmap()922655 Ref: flimage_from_pixmap()922655 Node: Color Quantization922993 Ref: flimage_select_octree_quantizer()924340 Ref: flimage_select_mediancut_quantizer()924438 Node: Remarks924736 Node: Index of Functions925721 Node: Index of Global Variables1037169 Node: Index of Constants1039365  End Tag Table xforms-1.2.4/doc/part4_an_example.texi0000644000175000017500000001166412342660530014651 00000000000000@node Part IV An Example @chapter An Example Let us work through an example of how to create a simple object class named @code{colorbox}. Assume that we want a class with the following behavior: it should normally be red. When the user presses the mouse on it it should turn blue. When the user releases the mouse button the object should turn red again and be returned to the application program. Further, the class module should keep a total count how many times the box got pushed. The first thing to do is to define some constants in a file named @file{colbox.h}. This file should at least contain the class number and one or more types: @example /* Class number must be between FL_USER_CLASS_START and FL_USER_CLASS_END */ #define FL_COLBOX (FL_USER_CLASS_START + 1) #define FL_NORMAL_COLBOX 0 /* The only type */ @end example Note that the type must start from zero onward. Normally it should also contain some defaults for the boxtype and label alignment etc. The include file also has to declare all the functions available for this object class. I.e., it should contain: @example extern FL_OBJECT *fl_create_colbox(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char *); extern FL_OBJECT *fl_add_colbox(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char *); extern int fl_get_colorbox(FL_OBJECT *); @end example Now we have to write a module @file{colbox.c} that contains the different routines. First of all we need routines to create an object of the new type and to add it to the current form. We also need to have a counter that keeps track of number of times the colbox is pushed. They would look as follows: @example typedef struct @{ int counter; /* no. of times pushed */ @} COLBOX_SPEC; FL_OBJECT *fl_create_colbox(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) @{ FL_OBJECT *obj; /* create a generic object class with an appropriate ID */ obj = fl_make_object(FL_COLBOX, type, x, y, w, h, label, handle_colbox); /* initialize some members */ obj->col1 = FL_RED; obj->col2 = FL_BLUE; /* create class specific structures and initialize */ obj->spec = fl_malloc(sizeof *obj->spec); obj->spec->counter = 0; return obj; @} FL_OBJECT *fl_add_colbox(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) @{ FL_OBJECT *obj = fl_create_colbox(type, x, y, w, h, label); fl_add_object(fl_current_form, obj); return obj; @} @end example The fields @code{col1} and @code{col2} are used to store the two colors red and blue such that the user can change them when required with the routine @code{@ref{fl_set_object_color()}}. What remains is to write the handling routine @code{handle_colbox()}. It has to react to three types of events: @code{FL_DRAW}, @code{FL_PUSH} and @code{FL_RELEASE}. Also, when the box is pushed, the counter should be incremented to keep a total count. Note that whether or not the mouse is pushed on the object is indicated in the field @code{obj->pushed}. Hence, when pushing and releasing the mouse the only thing that needs to be done is redrawing the object. This leads to the following piece of code: @example static int handle_colbox(FL_OBJECT *obj, int event, FL_Coord mx, FL_Coord my, int key, void *xev) @{ switch (event) @{ case FL_DRAW: /* Draw box */ fl_draw_box(obj->boxtype, obj->x,obj->y, obj->w, obj->h, obj->pushed ? obj->col2 : obj->col1, obj->bw); /* fall through */ case FL_DRAWLABEL: /* Draw label */ fl_draw_object_label(obj); break; case FL_PUSH: ((COLBOX_SPEC *) obj->spec)->counter++; fl_redraw_object(obj); break; case FL_RELEASE: fl_redraw_object(obj); return 1; /* report back to application! */ case FL_FREEMEM: fl_free(obj->spec); break; @} return 0; @} @end example That is the whole piece of code. Of course, since the @code{COLBOX_SPEC} structure is invisible outside of @file{colbox.c}, the following routine should be provided to return the total number of times the colbox was pushed: @example int fl_get_colbox(FL_OBJECT *obj) @{ if (!obj || obj->objclass != FL_COLBOX) @{ fprintf(stderr, "fl_get_colbox: Bad argument or wrong type); return -1; @} return ((COLBOX_SPEC *) obj->spec)->counter; @} @end example To use it, compile it into a file @file{colbox.o}. An application program that wants to use the new object class simply should include @file{colbox.h} and link with @file{colbox.o} when compiling the program. It can then use the routine @code{fl_add_colbox()} to add objects of the new type to a form. xforms-1.2.4/doc/part2.texi0000644000175000017500000000044511665175504012462 00000000000000@node Part II @unnumbered @emph{Part II - The Form Designer} @menu * Part II Introduction:: * Part II Getting Started:: * Part II Command Line Arguments:: * Part II Creating Forms:: * Part II Saving and Loading Forms:: * Part II Language Filters:: * Part II Generating Hardcopies:: @end menu xforms-1.2.4/doc/part2_generating_hardcopies.texi0000644000175000017500000001123612252532730017055 00000000000000@node Part II Generating Hardcopies @chapter Generating Hardcopies A variety of tools are available that can be used to turn your carefully constructed (and hopefully pleasing) user interfaces into printed hardcopies or something appropriate for inclusion in your program document. Most of these involves saving a snapshot of your interface on the screen into a file. Then this file is translated into something that a printer can understand, such as @code{PostScript}. Another approach is to design the printing capabilities into the objects themselves so the GUI is somewhat output device independent in that it can render to different devices and X or the printer is just one of the devices. While this approach works better than screen snapshot, in general, it bloats the library unnecessarily. It is our observation that most of the time when a hardcopy of the interface is desired, it is for use in the application documentation. Thus we believe that there are ways to meet the needs of wanting hardcopies without bloating the library. Of course, some object classes, such as xyplot, charts and possibly canvas (if vector graphics), that are dynamic in nature, probably should have some hardcopy output support in the library, but even then, the relevant code should only be loaded when these specific support is actually used. This fattening problem is becoming less troublesome as computers get faster and typically have more RAMs nowadays. @code{fd2ps} was designed to address the need of having a hardcopy of the interface for application documentation development. Basically, @code{fd2ps} is a translator that translates the Form Designer output directly into @code{PostScript} or @code{Encapsulated PostScript} in full vector graphics. The result is a small, maybe even editable, @code{PostScript} file that you can print on a printer or include into other documents. The translation can be done in two ways. One way is to simply give the Form Designer the command line option @code{-ps} to have it output @code{PostScript} directly. or you can run @code{fd2ps} stand alone using the command @example fd2ps fdfile @end example @noindent where @code{fdfile} is the Form Designer output with or without the @code{.fd} extension. The output is written into a file named @file{fdfile.ps}. @code{fd2ps} accepts the following command line options when run as a stand-alone program @ @table @code @item -h This option prints a brief help message. @item -p This option requests Portrait output. By default, the orientation is switched to landscape automatically if the output would not fit on the page. This option overrides the default. @item -l This option requests landscape orientation. @item -gray This option requests all colors be converted to gray levels. By default, @code{fd2ps} outputs colors as specified in the @code{.fd} file. @item -bw @i{width} This option specifies the object border width. By default, the border width specified in the @code{.fd} file is used. @item -dpi @i{res} This option specifies the screen resolution on which the user interface was designed. You can use this flag to enlarge or shrink the designed size by giving a DPI value smaller or larger than the actual screen resolution. The default DPI is 85. If the @code{.fd} file is specified in device independent unit (point, mm etc), this flag has no effect. Also this flag does not change text size. @item -G @i{gamma} This option specifies a value (gamma) that will be used to adjust the builtin colors. The larger the value the brighter the colors. The default gamma is 1. @item -rgb @i{file} The option specifies the path to the colorname database @file{rgb.txt}. (It is used in parsing the colornames in XPM file). The default is @file{/usr/lib/X11/rgb.txt}. The environment variable @code{RGBFile} can be used to change this default. @item -pw @i{width} This option changes the paper width used to center the GUI on a printed page. By default the width is that of US Letter (i.e., 8.5 inches) unless the environment variable @code{PAPER} is defined. @item -ph @i{height} This option changes the paper height used to center the output on the printed page. The default height is that of US Letter (i.e., 11 inches) unless the environment variable @code{PAPER} is defined. @item -paper @i{format} This option specifies one of the standard paper names (thus setting the paper width and height simultaneously). The current understood paper formats are @table @asis @item Letter 8.5 x 11 inch. @item Legal 8.5 x 14 inch @item A4 210 x 295mm @item B4 257 x 364mm @item B5 18 x 20 cm @item B 11 x 17 inch @item Note 4 x 5inch @end table The @code{fd2ps} program understands the environment variable @code{PAPER}, which should be one of the above paper names. @end table xforms-1.2.4/doc/part3_introduction.texi0000644000175000017500000001167212252533432015257 00000000000000@node Part III Introduction @chapter Introduction This part describes all different object classes that are available in the Forms Library. All available object classes are summarized in a table below. For each class there is a section in this document that describes it. The section starts with a short description of the object, followed by the routine(s) to add it to a form. For (almost) all classes this routine has the same form @example FL_OBJECT *fl_add_CLASS(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent Here @code{type} is the type of the object in its class. Most classes have many different types. They are described in the section. @code{x}, @code{y}, @code{w} and @code{h} give the left upper corner and the width and height of the bounding box of the object. @code{label} is the label that is placed inside or next to the object. For each object class the default placement of the label is described. When the label starts with the character @code{@@} the label is not printed but replaced by a symbol instead. For each object class there is also a routine @example FL_OBJECT *fl_create_CLASS(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent that only creates the object but does not put it in the form. This routine is useful for building hierarchical object classes. The routine is not described in the following sections. An important aspect of objects is how interaction is performed with them. First, there is the way in which the user interacts with the object, and second there's the question under which circumstances an object changes its state and how this is returned to the application program. All this is described in detail in the following sections. Object attributes can be divided into generic and object specific ones. For generic attributes (e.g., the object label size), the routines that change them always start with @code{fl_set_object_xxx()} where @code{xxx} is the name of the attribute. When a specific object is created and added to a form, it inherits many aspects of the generic object or initializes the object attributes to its needed defaults. Object classes can be roughly divided into static object classes (Box, Frame, LabelFrame, Text, Bitmap, Pixmap, Clock and Chart), Buttons, valuator objects classes (Slider, Scrollbar, Dial, Positioner, Counter, Thumbwheel), Inputs, choice object classes (Menu, Choice, Browser), container object classes (Tabbed Folder, Form Browser, Menu bar) and, finally, other object classes (Timer, XYPlot, Canvas, Popup). @table @asis @item Box Rectangular areas to visually group objects. @item Frame A box with an empty inside region. @item LabelFrame A frame with label on the frame. @item Text Simple one line labels. @item Bitmap Displays an X11 bitmap. @item Pixmap Displays a pixmap using the XPM library. @item Clock A clock. @item Chart Bar-charts, pie-charts, strip-charts, etc. @item Button Many different kinds and types of buttons that the user can push. @item Slider @itemx ValSlider Both vertical and horizontal sliders to let the user indicate some float value, possibly with a field showing the currently set value. @item Scrollbar Sliders plus two directional buttons. @item Dial A dial to let the user indicate a float value. @item Positioner Lets the user indicate an (x, y) position with the mouse. @item Counter A different way to let a user step through values. @item Thumbwheel Rolling a wheel to indicate float values. @item Input Lets the user type in an input string. @item Menu Both pop-up and drop-down menus can be created. @item Choice Can be used to let the user make a choice from a set of items. @item Browser A text browser with a slider. Can be used for making selections from sets of choices. @item Folder A (tabbed) folder is a compound object capable of holding multiple groups of objects. @item FormBrowser A browser you can drop forms into. @item Timer A timer that runs from a set time towards 0. Can e.g., be used to do default actions after some time has elapsed. @item XYPlot Shows simple 2D xy-plot from a tabulated function or a datafile. Data points can be interactively manipulated and retrieved. @item Canvas Canvases are managed plain X windows. It differs from a raw application window only in the way its geometry is managed, not in the way various interaction is set up. @item Popups Popup are mostly used by menus and choices, but they can also be used stand-alone to isplay context menus etc. @end table Thus, in the following sections, only the object specific routines are documented. Routines that set generic object attributes are documented in Part V. When appropriate, the effect of certain (generic) attributes of the objects on the specific object is discussed. In particular, it is described what effect the routine @code{@ref{fl_set_object_color()}} has on the appearance of the object. Also some remarks on possible boxtypes are made. xforms-1.2.4/doc/part5.texi0000644000175000017500000000036111665175506012464 00000000000000@node Part V @unnumbered @emph{Part V - General Informations} @menu * Part V Overview of Main Functions:: * Part V Some Useful Functions:: * Part V Resources for Forms Library:: * Part V Dirty Tricks:: * Part V Trouble Shooting:: @end menu xforms-1.2.4/doc/part1_free_objects.texi0000644000175000017500000007161612342660535015177 00000000000000@node Part I Free Objects @chapter Free Objects In some applications the standard object classes as provided by the Forms Library may not be enough for your task. There are three ways of solving this problem. First of all, the application program can also open its own window or use a canvas (the preferred way) in which it does interaction with the user). A second way is to add your own object classes (see Part IV). This is especially useful when your new type of objects is of general use. The third way is to add free objects to your form. Free objects are objects for which the application program handles the drawing and interaction. This chapter will give all the details needed to design and use free objects. @ifnottex @menu * Free Object:: Free Object * Example:: An Example @end menu @end ifnottex @node Free Object @section Free Object To add a free object to a form use the call @findex fl_add_free() @anchor{fl_add_free()} @example FL_OBJECT *fl_add_free(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label, int (*handle)()); @end example @noindent @code{type} indicates the type of free object, see below for a list and their meaning. @code{x}, @code{y}, @code{w} and @code{h} are the bounding box. The @code{label} is normally not drawn unless the @code{handle} routine takes care of this. @code{handle} is the routine that does the redrawing and handles the interaction with the free object. The application program must supply this routine. This routine @code{handle} is called by the library whenever an action has to be performed. The routine should have the form: @example int handle(FL_OBJECT *obj, int event, FL_Coord mx, FL_Coord my, int key, void *xev); @end example @noindent where @code{obj} is the object to which the event applies. @code{event} indicates what has to happen to the object. See below for a list of possible events. @code{mx} and @code{my} indicate the position of the mouse (only meaningful with mouse related events) relative to the form origin and @code{key} is the KeySym of the key typed in by the user (only for @code{FL_KEYPRESS} events). @code{xev} is the (cast) XEvent that causes the invocation of this handler. @code{event} and @code{xev->type} can both be used to obtain the event types. The routine should return whether the status of the object has changed, i.e., whether @code{@ref{fl_do_forms()}} or @code{@ref{fl_check_forms()}} should return this object. The following types of events exist for which the routine must take action: @table @code @tindex FL_DRAW @item FL_DRAW The object has to be redrawn. To figure out the size of the object you can use the fields @code{obj->x}, @code{obj->y}, @code{obj->w} and @code{obj->h}. Some other aspects might also influence the way the object has to be drawn. E.g., you might want to draw the object differently when the mouse is on top of it or when the mouse is pressed on it. This can be figured out as follows. The field @code{obj->belowmouse} indicates whether the object is below the mouse. The field @code{obj->pushed} indicates whether the object is currently being pushed with the mouse. Finally, @code{obj->focus} indicates whether input focus is directed towards this object. When required, the label should also be drawn. This label can be found in the field @code{obj->label}. The drawing should be done such that it works correctly in the visual/depth the current form is in. Complete information is available on the state of the current form as well as several routines that will help you to tackle the trickiest (also the most tedious) part of X programming. In particular, the return value of @code{@ref{fl_get_vclass()}} can be used as an index into a table of structures, @code{@ref{fl_state}[]}, from which all information about current active visual can be obtained. @xref{Part IV Drawing Objects, , Drawing Objects}, for details on drawing objects and the routines. @tindex FL_DRAWLABEL @item FL_DRAWLABEL This event is not always generated. It typically follows @code{FL_DRAW} and indicates the object label needs to be (re)drawn. You can ignore this event if (a) the object handler always draws the label upon receiving @code{FL_DRAW} or (b) the object label is not drawn at all@footnote{Label for free objects can't be drawn outside of the bounding box because of the clippings by the dispatcher.}. @tindex FL_ENTER @item FL_ENTER This event is sent when the mouse has entered the bounding box. This might require some action. Note that also the field @code{belowmouse} in the object is being set. If entering only changes the appearance redrawing the object normally suffices. Don't do this directly! Always redraw the object using the routine @code{fl_redraw_object()}. It will send an @code{FL_DRAW} event to the object but also does some other things (like setting window id's, taking care of double buffering and some other bookkeeping tasks). @tindex FL_LEAVE @item FL_LEAVE The mouse has left the bounding box. Again, normally a redraw is enough (or nothing at all). @tindex FL_MOTION @item FL_MOTION A motion event is sent between @code{FL_ENTER} and @code{FL_LEAVE} events when the mouse position changes on the object. The mouse position is given with the routine. @tindex FL_PUSH @item FL_PUSH The user has pushed a mouse button in the object. Normally this requires some action. @tindex FL_RELEASE @item FL_RELEASE The user has released the mouse button. This event is only sent if a @code{FL_PUSH} event was sent earlier. @tindex FL_DBLCLICK @item FL_DBLCLICK The user has pushed a mouse button twice within a certain time limit (@code{FL_CLICK_TIMEOUT}), which by default is about @w{400 msec}. @tindex FL_TRPLCLICK @item FL_TRPLCLICK The user has pushed a mouse button three times within a certain time window between each push. This event is sent after a @code{FL_DBLCLICK}, @code{FL_PUSH}, @code{FL_RELEASE} sequence. @tindex FL_UPDATE @item FL_UPDATE The mouse position has changed. This event is sent to an object between an @code{FL_PUSH} and an @code{FL_RELEASE} event (actually this event is sent periodically, even if mouse has not moved). The mouse position is given as the parameter @code{mx} and @code{my} and action can be taken based on the position. @tindex FL_FOCUS @item FL_FOCUS Input got focussed to this object. This event and the next two are only sent to a free object of type @code{FL_INPUT_FREE} (see below). @tindex FL_UNFOCUS @item FL_UNFOCUS Input is no longer focussed on this object. @tindex FL_KEYPRESS @item FL_KEYPRESS A key was pressed. The KeySym is given with the routine. This event only happens between @code{FL_FOCUS} and @code{FL_UNFOCUS} events. @tindex FL_STEP @item FL_STEP A step event is sent all the time (at most 50 times per second but often less because of time consuming redraw operations) to a free object of type @code{FL_CONTINUOUS_FREE} such that it can update its state or appearance. @tindex FL_SHORTCUT @item FL_SHORTCUT Hotkeys for the object have been triggered. Typically this should result in the returning of the free object. @tindex FL_FREEMEM @item FL_FREEMEM Upon receiving this event, the handler should free all object class specific memory allocated. @tindex FL_OTHER @item FL_OTHER Some other events typically caused by window manager events or inter-client events. All information regarding the details of the events is in @code{xev}. @end table @noindent Many of these events might make it necessary to (partially) redraw the object. Always do this using the routine @code{@ref{fl_redraw_object()}}. As indicated above not all events are sent to all free objects. It depends on their types. The following types exist (all objects are sent @code{FL_OTHER} when it occurs): @table @code @tindex FL_NORMAL_FREE @item FL_NORMAL_FREE The object will receive the events @code{FL_DRAW}, @code{FL_ENTER}, @code{FL_LEAVE}, @code{FL_MOTION}, @code{FL_PUSH}, @code{FL_RELEASE} and @code{FL_MOUSE}. @tindex FL_INACTIVE_FREE @item FL_INACTIVE_FREE The object only receives @code{FL_DRAW} events. This should be used for objects without interaction (e.g., a picture). @tindex FL_INPUT_FREE @item FL_INPUT_FREE Same as @code{FL_NORMAL_FREE} but the object also receives @code{FL_FOCUS}, @code{FL_UNFOCUS} and @code{FL_KEYPRESS} events. The @code{obj->wantkey} is by default set to @code{FL_KEY_NORMAL}, i.e., the free object will receive all normal keys (0-255) except @code{} and @code{} key. If you're interested in @code{} or @code{} key, you need to change @code{obj->wantkey} to @code{FL_KEY_TAB} or @code{FL_KEY_ALL}. @xref{Part IV Events, , Events}, for details. @tindex FL_CONTINUOUS_FREE @item FL_CONTINUOUS_FREE Same as @code{FL_NORMAL_FREE} but the object also receives @code{FL_STEP} events. This should be used for objects that change themselves continuously. @tindex FL_ALL_FREE @item FL_ALL_FREE The object receives all types of events. @end table See @file{free1.c} for a (terrible) example of the use of free objects. See also @file{freedraw.c}, which is a nicer example of the use of free objects. Free objects provide all the generality you want from the Forms Library. Because free objects behave a lot like new object classes it is recommended that you also read part IV of this documentation before designing free objects. @node Example @section An Example We conclude our discussion of the free object by examining a simple drawing program capable of drawing simple geometric figures like squares, circles, and triangles of various colors and sizes, and of course it also utilizes a free object. The basic UI consists of three logical parts. A drawing area onto which the squares etc. are to be drawn; a group of objects that control what figure to draw and with what size; and a group of objects that control the color with which the figure is to be drawn. The entire UI is designed interactively using the GUI builder @code{fdesign} with most objects having their own callbacks. @code{fdesign} writes two files, one is a header file containing forward declarations of callback functions and other function prototypes: @example #ifndef FD_drawfree_h_ #define FD_drawfree_h_ extern void change_color(FL_OBJECT *, long); extern void switch_figure(FL_OBJECT *, long); /* more callback declarations omitted */ typedef struct @{ FL_FORM * drawfree; FL_OBJECT * freeobj; FL_OBJECT * figgrp; FL_OBJECT * colgrp; FL_OBJECT * colorobj; FL_OBJECT * miscgrp; FL_OBJECT * sizegrp; FL_OBJECT * wsli; FL_OBJECT * hsli; FL_OBJECT * drobj[3]; void * vdata; long ldata; @} FD_drawfree; extern FD_drawfree *create_form_drawfree(void); #endif /* FD_drawfree_h_ */ @end example The other file contains the actual C-code that creates the form when compiled and executed. Since free objects are not directly supported by fdesign, a box was used as a stub for the location and size of the drawing area. After the C-code was generated, the box was changed manually to a free object by replacing @code{fl_add_box(FL_DOWN_BOX,...)} with @code{fl_add_free(FL_NORMAL_FREE,...)}. We list below the output generated by fdesign with some comments: @example FD_drawfree *create_form_drawfree(void) @{ FL_OBJECT *obj; FD_drawfree *fdui = fl_calloc(1, sizeof *fdui); fdui->drawfree = fl_bgn_form(FL_NO_BOX, 530, 490); obj = fl_add_box(FL_UP_BOX, 0, 0, 530, 490, ""); @end example @noindent This is almost always the same for any form definition: we allocate a structure that will hold all objects on the form as well as the form itself. In this case, the first object on the form is a box of type @code{FL_UP_BOX}. @example fdui->figgrp = fl_bgn_group(); obj = fl_add_button(FL_RADIO_BUTTON, 10, 60, 40, 40, "@@#circle"); fl_set_object_lcolor(obj,FL_YELLOW); fl_set_object_callback(obj, switch_figure, 0); obj = fl_add_button(FL_RADIO_BUTTON, 50, 60, 40, 40, "@@#square"); fl_set_object_lcolor(obj, FL_YELLOW); fl_set_object_callback(obj, switch_figure, 1); obj = fl_add_button(FL_RADIO_BUTTON, 90, 60, 40, 40, "@@#8*>"); fl_set_object_lcolor(obj, FL_YELLOW); fl_set_object_callback(obj, switch_figure, 2); fl_end_group(); @end example This creates three buttons that control what figures are to be drawn. Since figure selection is mutually exclusive, we use @code{RADIO_BUTTON} for this. Further, the three buttons are placed inside a group so that they won't interfere with other radio buttons on the same form. Notice that the callback function @code{switch_figure()} is bound to all three buttons but with different arguments. Thus the callback function can resolve the associated object via the callback function argument. In this case, 0 is used for circle, 1 for square and 2 for triangle. This association of a callback function with a piece of user data can often reduce the amount of code substantially, especially if you have a large group of objects that control similar things. The advantage will become clear as we proceed. Next we add three sliders to the form. By using appropriate colors for these sliding bars (red, green, blue), there is no need to label them. There's also no need to store their addresses as their callback routine @code{change_color()} will receive them automatically. @example fdui->colgrp = fl_bgn_group(); obj = fl_add_slider(FL_VERT_FILL_SLIDER, 25, 170, 30, 125, ""); fl_set_object_color(obj, FL_COL1, FL_RED); fl_set_object_callback(obj, change_color, 0); obj = fl_add_slider(FL_VERT_FILL_SLIDER, 55, 170, 30, 125, ""); fl_set_object_color(obj, FL_COL1, FL_GREEN); fl_set_object_callback(obj, change_color, 1); obj = fl_add_slider(FL_VERT_FILL_SLIDER, 85, 170, 30, 125, ""); fl_set_object_color(obj, FL_COL1, FL_BLUE); fl_set_object_callback(obj, change_color, 2); fdui->colorobj = obj = fl_add_box(FL_BORDER_BOX, 25, 140, 90, 25, ""); fl_set_object_color(obj, FL_FREE_COL1, FL_FREE_COL1); fl_end_group(); @end example Again, a single callback function, @code{change_color()}, is bound to all three sliders. In addition to the sliders, a box object is added to the form. This box is set to use the color indexed by @code{FL_FREE_COL1} and will be used to show visually what the current color setting looks like. This implies that in the @code{change_color()} callback function, the entry @code{FL_FREE_COL1} in the Forms Library's internal colormap will be changed. We also place all the color related objects inside a group even though they are not of radio buttons. This is to facilitate gravity settings which otherwise require setting the gravities of each individual object. Next we create our drawing area which is simply a free object of type @code{NORMAL_FREE} with a handler to be written @example obj = fl_add_frame(FL_DOWN_FRAME, 145, 30, 370, 405, ""); fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast); fdui->freeobj = obj = fl_add_free(FL_NORMAL_FREE, 145, 30, 370, 405, "", freeobject_handler); fl_set_object_boxtype(obj, FL_FLAT_BOX); fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast); @end example The frame is added for decoration purposes only. Although a free object with a down box would appear the same, the down box can be written over by the free object drawing while the free object can't draw on top of the frame since the frame is outside of the free object. Notice the gravity settings. This kind of setting maximizes the real estate of the free object when the form is resized. Next, we need to have control over the size of the object. For this, two sliders are added, using the same callback function but with different user data (0 and 1 in this case): @example fdui->sizegrp = fl_bgn_group(); fdui->wsli = obj = fl_add_valslider(FL_HOR_SLIDER, 15, 370, 120, 25, "Width"); fl_set_object_lalign(obj, FL_ALIGN_TOP); fl_set_object_callback(obj, change_size, 0); fdui->hsli = obj = fl_add_valslider(FL_HOR_SLIDER, 15, 55, 410,25, "Height"); fl_set_object_lalign(obj, FL_ALIGN_TOP); fl_set_object_callback(obj, change_size, 1); fl_end_group(); @end example The rest of the UI consists of some buttons the user can use to exit the program, elect to draw outlined instead of filled figures etc. The form definition ends with @code{@ref{fl_end_form()}}. The structure that holds the form as well as all the objects within it is returned to the caller: @example fdui->miscgrp = fl_bgn_group(); obj = fl_add_button(FL_NORMAL_BUTTON, 395, 445, 105, 30, "Quit"); fl_set_button_shortcut(obj, "Qq#q", 1); obj = fl_add_button(FL_NORMAL_BUTTON, 280, 445, 105, 30, "Refresh"); fl_set_object_callback(obj, refresh_cb, 0); obj = fl_add_button(FL_NORMAL_BUTTON, 165, 445, 105, 30, "Clear"); fl_set_object_callback(obj,clear_cb,0); fl_end_group(); obj = fl_add_checkbutton(FL_PUSH_BUTTON, 15, 25, 100, 35, "Outline"); fl_set_object_color(obj, FL_MCOL, FL_BLUE); fl_set_object_callback(obj, fill_cb, 0); fl_set_object_gravity(obj, FL_NorthWest, FL_NorthWest); fl_end_form(); return fdui; @} @end example After creating the UI we need to write the callback functions and the free object handler. The callback functions are relatively easy since each object is designed to perform a very specific task. Before we proceed to code the callback functions we first need to define the overall data structure that will be used to glue together the UI and the routines that do real work. The basic structure is the DrawFigure structure that holds the current drawing function as well as object attributes such as size and color: @example #define MAX_FIGURES 500 typedef void (*DrawFunc)(int /* fill */, int, int, int, int, /* x,y,w,h */ FL_COLOR /* color */ ); typedef struct @{ DrawFunc drawit; /* how to draw this figure */ int fill, /* is it to be filled? */ x, y, w, h; /* position and sizes */ int pc[3]; /* primary color R,G,B */ int newfig; /* indicate a new figure */ FL_COLOR col; /* color index */ @} DrawFigure; static DrawFigure saved_figure[MAX_FIGURES], *cur_fig; static FD_drawfree *drawui; int max_w = 30, /* max size of figures */ max_h = 30; @end example @noindent All changes to the figure attributes will be buffered in @code{cur_fig} and when the actual drawing command is issued (mouse click inside the free object), @code{cur_fig} is copied into @code{saved_figure} array buffer. Forms Library contains some low-level drawing routines that can draw and optionally fill arbitrary polygonal regions, so in principle, there is no need to use Xlib calls directly. To show how Xlib drawing routines are combined with Forms Library, we use Xlib routines to draw a triangle: @example void draw_triangle(int fill, int x, int y, int w, int h, FL_COLOR col) @{ XPoint xp[4]; GC gc = fl_state[fl_get_vclass()].gc[0]; Window win = fl_winget(); Display *disp = fl_get_display(); xp[0].x = x; xp[0].y = y + h - 1; xp[1].x = x + w / 2; xp[1].y = y; xp[2].x = x + w - 1; xp[2].y = y + h - 1; XSetForeground(disp, gc, fl_get_pixel(col)); if (fill) XFillPolygon(disp, win, gc, xp, 3, Nonconvex, Unsorted); else @{ xp[3].x = xp[0].x; xp[3].y = xp[0].y; XDrawLines(disp, win, gc, xp, 4, CoordModeOrigin); @} @} @end example @noindent Although more or less standard stuff, some explanation is in order. As you have probably guessed, @code{@ref{fl_winget()}} returns the current "active" window, defined to be the window the object receiving the dispatcher's messages (@code{FL_DRAW} etc.) belongs to@footnote{If @code{@ref{fl_winget()}} is called while not handling messages, the return value must be checked.}. Similarly the routine @code{@ref{fl_get_display()}} returns the current connection to the X server. Part IV has more details on the utility functions in the Forms Library. The array of structures @code{@ref{fl_state}[]} keeps much "inside" information on the state of the Forms Library. For simplicity, we choose to use the Forms Library's default GC. There is no fundamental reason that this has be so. We certainly can copy the default GC and change the foreground color in the copy. Of course unlike using the default GC directly, we might have to set the clip mask in the copy whereas the default GC always have the proper clip mask (in this case, to the bounding box of the free object). We use the Forms Library's built-in drawing routines to draw circles and rectangles. Then our drawing functions can be defined as follows: @example static DrawFunc drawfunc[] = @{ fl_oval, fl_rectangle, draw_triangle @}; @end example Switching what figure to draw is just changing the member @code{drawit} in @code{cur_fig}. By using the proper object callback argument, figure switching is achieved by the following callback routine that is bound to all figure buttons @example void switch_object(FL_OBJECT *obj, long which) @{ cur_fig->drawit = drawfunc[which]; @} @end example So this takes care of the drawing functions. Similarly, the color callback function can be written as follows @example void change_color(FL_OBJECT *obj, long which) @{ cur_fig->c[which] = 255 * fl_get_slider_value(obj); fl_mapcolor(cur_fig->col, cur_fig->c[0], cur_fig->c[1], cur_fig->c[2]); fl_mapcolor(FL_FREE_COL1, cur_fig->c[0], cur_fig->c[1], cur_fig->c[2]); fl_redraw_object(drawui->colorobj); @} @end example @noindent The first call of @code{@ref{fl_mapcolor()}} defines the RGB components for index @code{cur_fig->col} and the second @code{@ref{fl_mapcolor()}} call defines the RGB component for index @code{FL_FREE_COL1}, which is the color index used by @code{colorobj} that serves as current color visual feedback. Object size is taken care of in a similar fashion by using a callback function bound to both size sliders: @example void change_size(FL_OBJECT * obj, long which) @{ if (which == 0) cur_fig->w = fl_get_slider_value(obj); else cur_fig->h = fl_get_slider_value(obj); @} @end example Lastly, we toggle the fill/outline option by querying the state of the push button @example void outline_callback(FL_OBJECT *obj, long data) @{ cur_fig->fill = !fl_get_button(obj); @} @end example To clear the drawing area and delete all saved figures, a Clear button is provided with the following callback: @example void clear_cb(FL_OBJECT *obj, long notused) @{ saved_figure[0] = *cur_fig; /* copy attributes */ cur_fig = saved_figure; fl_redraw_object(drawui->freeobj); @} @end example To clear the drawing area and redraw all saved figures, a Refresh button is provided with the following callback: @example void refresh_cb(FL_OBJECT *obj, long notused) @{ fl_redraw_object(drawui->freeobj); @} @end example With all attributes and other services taken care of, it is time to write the free object handler. The user can issue a drawing command inside the free object by clicking either the left or right mouse button. @example int freeobject_handler(FL_OBJECT *obj, int event, FL_Coord mx, FL_Coord my, int key, void *xev) @{ DrawFigure *dr; switch (event) @{ case FL_DRAW: if (cur_fig->newfig == 1) cur_fig->drawit(cur_fig->fill, cur_fig->x + obj->x, cur_fig->y + obj->y, cur_fig->w, cur_fig->h, cur_fig->col); else @{ fl_draw_box(obj->boxtype, obj->x, obj->y, obj->w, obj->h, obj->col1, obj->bw); for (dr = saved_figure; dr < cur_fig; dr++) @{ fl_mapcolor(FL_FREE_COL1, dr->c[0], dr->c[1], dr->c[2]); dr->drawit(dr->fill,dr->x + obj->x, dr->y + obj->y, dr->w, dr->h, dr->col); @} @} cur_fig->newfig = 0; break; case FL_PUSH: if (key == FL_MIDDLE_MOUSE) break; cur_fig->x = mx - cur_fig->w / 2; cur_fig->y = my - cur_fig->h / 2; /* convert figure center to relative to the object*/ cur_fig->x -= obj->x; cur_fig->y -= obj->y; cur_fig->newfig = 1; fl_redraw_object(obj); *(cur_fig + 1) = *cur_fig; fl_mapcolor(cur_fig->col + 1, cur_fig->c[0], cur_fig->c[1], cur_fig->c[2] ); cur_fig++; cur_fig->col++; break; @} return FL_RETURN_NONE; @} @end example In this particular program, we are only interested in mouse clicks and redraw. The event dispatching routine cooks the X event and drives the handler via a set of events (messages). For a mouse click inside the free object, its handler is notified with an FL_PUSH together with the current mouse position mx, my. In addition, the driver also sets the clipping mask to the bounding box of the free object prior to sending @code{FL_DRAW}. Mouse position (always relative to the origin of the form) is directly usable in the drawing function. However, it is a good idea to convert the mouse position so it is relative to the origin of the free object if the position is to be used later. The reason for this is that the free object can be resized or moved in ways unknown to the handler and only the position relative to the free object is meaningful in these situations. It is tempting to call the drawing function in response to @code{FL_PUSH} since it is @code{FL_PUSH} that triggers the drawing. However, it is a (common) mistake to do this. The reason is that much bookkeeping is performed prior to sending @code{FL_DRAW}, such as clipping, double buffer preparation and possibly active window setting etc. All of these is not done if the message is anything else than @code{FL_DRAW}. So always use @code{@ref{fl_redraw_object()}} to draw unless it is a response to @code{FL_DRAW}. Internally @code{@ref{fl_redraw_object()}} calls the handler with @code{FL_DRAW} (after some bookkeeping), so we only need to mark @code{FL_PUSH} with a flag @code{newfig} and let the drawing part of the handler draw the newly added figure. @code{FL_DRAW} has two parts. One is simply to add a figure indicated by @code{newfig} being true and in this case, we only need to draw the figure that is being added. The other branch might be triggered as a response to damaged drawing area resulting from @code{Expose} event or as a response to @code{Refresh} command. We simply loop over all saved figures and (re)draw each of them. The only thing left to do is to initialize the program, which includes initial color and size, and initial drawing function. Since we will allow interactive resizing and also some of the objects on the form are not resizeable, we need to take care of the gravities. @example void draw_initialize(FD_drawfree *ui) @{ fl_set_form_minsize(ui->drawfree, 530, 490); fl_set_object_gravity(ui->colgrp, FL_West, FL_West); fl_set_object_gravity(ui->sizegrp, FL_SouthWest, FL_SouthWest); fl_set_object_gravity(ui->figgrp, FL_NorthWest, FL_NorthWest); fl_set_object_gravity(ui->miscgrp, FL_South, FL_South); fl_set_object_resize(ui->miscgrp, FL_RESIZE_NONE); cur_fig = saved_figure; cur_fig->pc[0] = cur_fig->pc[1] = cur_fig->pc[2] = 127; cur_fig->w = cur->fig->h = 30; cur_fig->drawit = fl_oval; cur_fig->col = FL_FREE_COL1 + 1; cur_fig->fill = 1; fl_set_button(ui->drobj[0], 1); /* show current selection */ fl_mapcolor(cur_fig->col, cur_fig->pc[0], cur->fig->pc[1], cur->fig->pc[2]); fl_mapcolor(FL_FREE_COL1, cur_fig->pc[0], cur->fig->pc[1], cur->fig->pc[2]); fl_set_slider_bounds(ui->wsli, 1, max_w); fl_set_slider_bounds(ui->hsli, 1, max_h); fl_set_slider_precision(ui->wsli, 0); fl_set_slider_precision(ui->hsli, 0); fl_set_slider_value(ui->wsli, cur_fig->w); fl_set_slider_value(ui->hsli, cur_fig->h); @} @end example With all the parts in place, the main program simply creates, initializes and shows the UI, then enters the main loop: @example int main(int argc, char *argv[]) @{ fl_initialize(&argc, argv, "FormDemo", 0, 0); drawui = create_form_drawfree(); draw_initialize(drawui); fl_show_form(drawui->drawfree, FL_PLACE_CENTER|FL_FREE_SIZE, FL_FULLBORDER, "Draw"); fl_do_forms(); return 0; @} @end example Since the only object that does not have a callback is the Quit button, @code{@ref{fl_do_forms()}} will return only if that button is pushed. Full source code to this simple drawing program can be found in @file{demos/freedraw.c}. xforms-1.2.4/doc/part2_creating_forms.texi0000664000175000017500000005252112252532666015547 00000000000000@node Part II Creating Forms @chapter Creating Forms @ifnottex @menu * Creating and Changing Forms:: * Adding Objects:: * Selecting Objects:: * Moving and Scaling:: * Aligning Objects:: * Raising and Lowering:: * Setting Attributes:: * Generic Attributes:: * Object Specific Attributes:: * Cut, Copy and Paste: Copy and Paste * Groups:: * Hiding and Showing Objects:: * Testing Forms:: @end menu @end ifnottex @node Creating and Changing Forms @section Creating and Changing Forms To create a new form use the "New Form" entry in the "Form" menu at the top. When asked for the new form's name enter a (unique) name that is a valid C identifier. The form is shown in the main window and objects can be added to it. There are two ways to change the size of a form. The easiest way is to simply change the size of the main window displaying the form and the form will resize itself to fit the new size. Otherwise you can use the "Resize Form" entry in the "Form" menu, in which case you can enter the width and height of the form manually. To change the name of the current visible form use the "Rename Form" entry in the "Form" menu. You will be prompted for the new form name. To delete a form use the "Delete Form" entry in the "Form" menu . The current form will be removed after a box asking you if you're sure had been shown. @node Adding Objects @section Adding Objects To add an object choose the class of the new object from the list of object classes in the middle of the control panel. Next drag the left mouse button within the main form. A rubber box outlining the size of the new object will appear. When the size is correct release the mouse button. Note that the position and size of the object is rounded to multiples of 10 pixels per default. How to change the default is described below in the context of alignments. @node Selecting Objects @section Selecting Objects To perform operations on objects that are already visible in the form, we first have to select them. Any mouse button can be used for selecting objects. Simply single-click on the object you want to select. A red outline will appear, indicating that the object is selected. Another way of selecting objects is to use the @code{} or @code{} keys or the button labeled @code{F11}, all of which iterates over the object list and selects the next object upon each press (the only object not selected this way is the backface object). It is also possible to select multiple objects. To this end draw a box by dragging the mouse around all the objects you want to select. All objects that lie fully inside the box will be selected. Each selected object will get a red outline and a red bounding box is drawn around all of them. To add objects to an already existing selection, hold down the @code{} key and press the left mouse button inside the object. You can remove objects from the selection by doing the same on an already selected object. It is possible to select all objects (except for the backface object) at once using the function key @code{}. One note on the backface of the form: Although this is a normal object it can not be treated in the same way as the other objects. It can be selected, but never in combination with other objects. Only changing its attributes is allowed. @node Moving and Scaling @section Moving and Scaling To move an object (or a collection of objects) to a new place, first select it (them) as described above. Next press the left mouse button inside the bounding box (not too near to one of the corners) and move the box to its new position. To scale the object or objects, pick up the bounding box near one of its corners (inside the red squares) and scale it by dragging the mouse. When holding the @code{} key while moving an object or group of objects, first a copy of the object(s) is made and the copy is moved. This allows for a very fast way of duplicating (cloning) objects on the form: First put one on the form, change the attributes as required and next copy it. For precise object movement the cursor keys can be used. Each press of the four directional cursors keys moves the selected object by 10 pixels per default. To change the step sizepress one of the numbers from 0 to 9 with 0 indicating 10 pixels. If the @code{} key is kept pressed down instead of moving the object its size is increased or decreased by the step size. @node Aligning Objects @section Aligning Objects Sometimes you have a number of objects and you want to align them in some way, e.g., centered or all starting at the same left position, etc. To this end press the button labeled "Align". A special form will appear in the top right corner. You can leave this form visible as long as you want. You can hide it using the button labeled "Dismiss" on the form or by clicking the "Align" button again. First select the objects you want to align. Next, press one of the alignment buttons in the form. The buttons in the top row have the following meaning: flush left, center horizontally, flush right, and make the objects have equal distances in horizontal direction (see below). The buttons in the bottom row mean: align to bottom, center vertically, align to top, and make all objects have the same vertical distance. Note that alignments are relative to the selection box, not to the form. Equal distance alignment means that between all the objects an equal sized gap is placed. The objects are kept in the same left to right or bottom to top order. @ifhtml @center @image{xforms_images/fd_align} @end ifhtml @ifnothtml @center @image{xforms_images/fd_align,9cm} @end ifnothtml The "Undo" button undoes the last alignment change. It is an undo with a depth of 1, i.e., you can only undo the last change and an undo after an undo will undo itself. Note however, that any modification to the selected objects invalidates the undo buffer. In the alignment form you can also indicate the "snapping size" when moving or resizing objects, using the counter at the bottom. Default snapping is 10 pixels. Snapping helps in making objects of the same size and aligning them nicely. @node Raising and Lowering @section Raising and Lowering The objects in a form are drawn in the order in which they are added. Sometimes this is undesirable. For example, you might decide at a later stage to put a box around some buttons. Because you add this box later it will be drawn over the buttons, thus hiding the buttons (if you put a framebox over a button, the button will be visible but appears to be inactive!). This is definitely not what you want. The Form Designer makes it possible to raise objects (bring them to the top) or lower them (put them at the bottom). So you can lower e.g., a box to move it under some buttons. Raising or lowering objects is very simple. First select the objects and next press the function key @code{} to lower the selection or @code{} to raise it. Another use of raising and lowering is to change the order in which input field receive focus via the @code{} key. Input fields focus order is the same as the order in which they were added to the form. This can become a problem if another input field is needed after the form is designed because this extra input field will always be the last among all input field on the form. Raising the objects becomes handy to solve this problem. What really happens when a object is raised is that the raised object becomes the last object added to the form. This means you can re-arrange the focus order by raising all input fields one by one in the exact order you want the focus order to be, and they will be added to the form in the order you raised them, thus the input focus order is what you intended. @node Setting Attributes @section Setting Attributes To set attributes like type, color, label, etc., of an object first select it (using the left mouse button) and next press the function key @code{} (or click on the button labeled "F1"). Also a double click (with the left mouse button) selects the object and opens up the form for changing the objects attributes. If only one object is selected you can change all its attributes, including its label, name, etc. It is also possible to change the attributes of multiple objects as long as they all are of the same object class. In this case you cannot change the labels, names, etc. because you probably want them to remain different for the different objects. The form for changing object attributes allows you to modify all the different settings. Before we continue, the organization of the attributes form and classification of attributes needs a little explanation. Attributes of an object are divided into two categories. The generic attributes are shared by all objects. These include type, colors, label, callback function etc. The other class of attributes are those that are specific to a particular object class, such as slider bounds, precision etc. When the attribute form is first shown, only the generic attributes are shown. Press on the tab rider "Spec" to get to a second form for the object class specific attributes (press the tab rider "Generic" to switch back to the generic attributes part). @node Generic Attributes @section Generic Attributes The form for setting generic attributes contains four fields for setting different groups of generic properties, discussed in the following. Once you are satisfied with the settings, press the button labeled "Accept" and the form will disappear. If you don't want to change the attributes after all press the button labeled "Cancel". You may also reset the values to what they were when you started editing them by clicking on the "Undo" button. @ifhtml @center @image{xforms_images/genattr} @end ifhtml @ifnothtml @center @image{xforms_images/genattr,15cm} @end ifnothtml @ifnottex @menu * Basic Attributes:: * Font:: * Misc. Attributes:: * Colors:: @end menu @end ifnottex @node Basic Attributes @subsection Basic Attributes The basic attributes include the type, boxtype, name, label string, the callback function with its arguments associated with the object and a shortcut. For most object classes several different types exist. The type of the object under consideration can be selected via a choice object. Most objects can also be drawn using different boxtypes. Normally, the default should do, but using the choice object labeled "BoxType" you can switch to a different box type (but note that not all choices may result in a different way the object is drawn and some may look rather ugly). Nearly all objects have a label that can be drawn at different positions within or outside of the object. The input field labeled "Label" lets you set the label string (it may also include return characters, i.e., @code{\n}, for line breaks). An object may have a name by which it can be accessed within the program. This name must be a valid C (or simple C++) variable identifier and can be set via the input field labeled "Name". You need to make sure that there are no objects with the same name! If instead of having e.g., the function @code{@ref{fl_do_forms()}} return when an object is triggered a callback may be invoked instead. You can set the name of the callback function in the input field labeled "Callback". Obviously, this must be a valid C or C++ function name. When a callback function is set you must also specify the argument passed to the callback function together with the object's address via the input field labeled "Argument". This normally will be a (long) integer (defaulting to 0 if not specified). Using this value it is e.g., possible to distinguish between different objects when all use the same callback function. @node Font @subsection Font In the field labeled "Font" you can set properties of the font to be used for the label of the object. You can select between different types of fonts, the style the label is drawn in (normal, shadowed, engraved or embossed) and the size of the font to be used. All three types of properties can be selected via choice objects. @node Misc. Attributes @subsection Misc. Attributes The field labeled "Misc. Attributes" allows the setting of a number of attributes that don't fit into any other category. First you can set the alignment of the object's label. It can be placed inside the object or outside of it and in 9 different positions. Use the choice objects labeled "Label/Align" and "In/Out" for this purpose. Another important property of an object is how it reacts if the size of the form it belongs to is changed. It may keep its original size or may be resized in x- or y-direction or both. The details are controlled via its resize and gravity properties as described in chapter 4. With the choice objects labeled "Resize" you can control if an object is to be resized in x- or y-direction or both or none. You may also specify if the object's upper left hand corner or its lower right hand corner is supposed to keep a fixed distance from the form's borders via the choice objects labeled "NW Gravity" and "SE Gravity". Please note that these properties aren't orthogonal, with the NWGravity and SEGravity overriding the resize property if necessary (also see the program @file{grav} in the @file{demo} directory that lets you experiment with these properties). @node Colors @subsection Colors Within the "Color" field you can set three colors for the object. The colors of the object itself are controlled via the buttons labeled "Color 1" and "Color 2", while the button labeled "LabelColor" is for setting the color the label is drawn in. Clicking on any of the three buttons will result in a new form being shown in which you can select one of the predefined colors from the internal colormap. You also can select one of the "free" colors but since these colors aren't set yet they will appear as black in the form for selecting the color. While it's rather obvious what the label color is, the meaning of "Color 1" and "Color 2" varies a bit with the class and type of the object. E.g., for (normal buttons the first color is the normal color of the button while the second one is the color it's drawn in while the button is pressed, while for a browser that allows selection the first color is the background color and the second color is the color selected lines are highlighted with. Since there are too many combinations of object classes and types to be discussed here comprehensively please refer to a following chapter where the exact properties of all objects are described in detail. @node Object Specific Attributes @section Object Specific Attributes Many objects have attributes that are specific to its object class, such as slider bounds, precision etc. You can access these attributes (if existent) via the tab rider labeled "Spec". In most cases the meaning of these attributes hopefully is self-explanatory (otherwise see the detailed description of the different object classes in Part III) and all changes made are shown immediately so you can see what effects the changes have on the object. Once satisfactory results have been achieved the press button labeled "Accept" to accept the settings (clicking on the tab rider "Generic" has the same effect). Two additional buttons, "Cancel" and "Restore", are available to cancel the changes (and quit the attribute settings form) and restore the defaults, respectively. One particular aspect of the pixmap/bitmap button initialization needs a little more explanation as the setting of button labeled "Use data" has no effect on the appearance of the button in fdesign but nonetheless affects the generated code. By default, the "Use data" button is off, indicating the pixmap/bitmap file specified is to be loaded dynamically at run time via @code{@ref{fl_set_pixmapbutton_file()}} (or the bitmap counterpart function). If "Use data" is on, the specified file and its associated data will be @code{#include}'d at compile time so the data becomes part of the code. Depending on the application setup, you may choose one method over the other. In general, including the data in the code will make the code slightly larger, but it avoids problems with finding the specified file at runtime. The button labeled "Full Path" only applies if "Use Data" is on. If "Full Path" is also on, the pixmap file will be @code{#include}'d using the full path, otherwise only the filename is used, presumably the compile process will take care of the path via the @code{-I} flag in some system dependent way. @node Copy and Paste @section Cut, Copy and Paste You can remove objects from the form by first selecting them and then pressing the @code{} function key or simply by double-clicking on it with the right mouse button. The object(s) will disappear but in fact will be saved in a buffer. You can put it back into the form (or in another form) by pasting, using @code{}. Note that only the last collection of deleted objects is saved in the buffer. It is also possible to put a copy of the selection (i.e., without removing the original object(s)) into the buffer using @code{}. The content of the bufer can now be put into the same or another form. This allows for a simple mechanism of making multiple copies of a set of objects and for moving information from one form to another. To clone the currently selected object, hold down the @code{} key and then drag the selected object to a new position. The cloned object will have exactly the same attributes as the original object except for its name and shortcut keys (would these also be cloned, the generated code would not be compilable or cause runtime misbehavior). When you copy objects belonging to a common group just the individual objects of the group will be copied, but they won't belong to a common group anymore. @node Groups @section Groups As described in the tutorial about the Forms Library, sets of radio buttons must be placed inside groups. Groups are also useful for other purposes. E.g., you can hide a group inside an application program with one command. Hence, the Form Designer has some mechanism to deal with groups. In the control panel there is a list of groups in the current form. As long as you don't have groups, this list will be empty. To create a group, select the objects that should become members of the group and press the function key @code{}. You will be prompted for the name of the group. This should be a legal C variable name (under which the group will be known to the application program) or should be left empty. This name will be added to the list. In this way you can create many groups. Note that each object can be member of only one group. So if you select it again and put it in a new group, it will be removed from its old group. Groups that become empty this way automatically disappear from the list. (When putting objects in a group they will be raised. This is unavoidable due to the structure of groups.) In the list of groups it is always indicated which groups are part of the current selection. (Only the groups that are fully contained in the selection are indicated, not those that are only partially contained in it.) It is also possible to add or delete groups in the current selection by pushing the mouse on their name in the list. A simple click on a groups name will select this group and deselect all objects not belonging to it. Clicking on a groups name while the @code{} key is pressed down adds the group to the cuurent selection. Note that there is no mechanism to add an object to a group directly. This can, however, be achieved using the following procedure: select the group and the new object and press @code{} to group them. The old group will be discarded and a new group will be created. You only have to type in the group name again. You can use the menu "Rename group" from the "Group" menu to change the name of a selected group. Only a single group may be selected when changing the name. @node Hiding and Showing Objects @section Hiding and Showing Objects Sometimes it is useful to temporarily hide some objects in your form, in particular when you have sets of overlapping objects. To this end, select the objects you want to hide and press @code{}. The objects (though still selected) are now invisible. To show them again press @code{}. A problem might occur here: when you press @code{} only the selected objects will be shown again. But once an object is invisible it can no longer be selected. Fortunately, you can always use @code{} to select all objects, including the invisible ones, and then press @code{}. A possibly better way is to first group the objects before hiding them. Now you can select them by pressing the mouse on the group name in the group browser and then 'unhide' them. @node Testing Forms @section Testing Forms To test the current form, press the button labeled "Test". The form will be displayed in the center of the screen anf a panel appears at the top right corner of the screen. This panel shows you the objects returned and callback routines invoked when working with the form. In this way you can verify whether the form behaves correctly and whether all objects have either callback routines or names (or both) associated with them. You can also resize the form (if the backface of the form allows resizing) to test the gravity and resizing behaviour. You can play with the form as long as you want. When ready, press the "Stop Testing" button. Note that any changes you made to the form while testing (including its size) do not show up when saving the form. E.g., filling in an input field or setting a slider does not mean that in the saved code the input field will be filled in or the slider's preset value. xforms-1.2.4/doc/part2_command_line.texi0000644000175000017500000001223012252532613015151 00000000000000@node Part II Command Line Arguments @chapter Command Line Arguments To start the Form Designer simply type @example fdesign [-xformoptions] [-fdesignoptions] [files[.fd]] @end example @noindent An initial window will be created and mapped. Depending on the window manager, you may have the option to interactively select where to place the window if the @code{-geometry} option is not given. Next the program places the control panel on the screen. You can move this panel, if required, to the place you want (you can also change the default placement of the control panel via resources). fdesign accepts all of the XForms command line options as well as the following @table @code @item -geometry @i{geom} This option specifies the initial placement and size of the working area. @item -convert @i{fd-file-list} Normally fdesign does its work interactively. This option causes it to simply read a list of fdesign output files (the @code{.fd} files) and emit the corresponding C-routines and header files. This can be useful e.g., in automatically compiling packages in Makefiles. Note that the input @code{.fd} will only be read but never modified when this option is used. @item -migrate @i{fd-file-list} When fdesign is invoked with the @code{-convert} option it just creates new @code{.c} and @code{.h} files but leaves the @code{.fd} files unmodified. In some situations, e.g., if you also want to automatically upgrade @code{.fd} files created with older versions of fdesign, you can instead use the @code{-migrate} option which does all what the @code{-convert} option does but also writes out a new version of the @code{.fd} file it just read in. It also does a few extra checks, e.g., it will test if XBM and XPM image files used for bitmaps and pixmaps actually exist (if they don't the newly generated @code{.fd} file won't reference them anymore, so carefully look out for error messages and, if necessary, restore it from the generated @code{.fd.bak} backup file). @item -version Prints current version and quits. @item -help Prints a brief help message on command line options. @item -altformat Generates an alternative output format. @item -border Forces decorations on some types of windows so that you can move them (only necessary with some window managers). @item -unit @i{point|pixel|mm|cp|cmm} Outputs object sizes in units other than pixels. cp and cmm stand for centi-point (1/100 of a point) and centi-mm (1/100 of a milli-meter). For typical displays, pixel and mm are too coarse and subject to round-off errors. @item -nocode Suppresses the output of UI code. Sometimes useful if the UI code is not to be generated interactively, but rather generated by the make process using "fdesign -convert". @item -I @i{header} Changes the output include file from @code{} to header. Per default, the header file name will be enclosed in angle brackets ('@code{<}' and '@code{>}') unless the name of the include file specified is already enclosed in double quote ('@code{"}'). Useful on systems where @file{forms.h} is renamed to something else or if you need an application header file with e.g., definitions of constants/defines for the UI that itself includes the @code{forms.h} file. @item -main Emits a main program with callback stubs. Can be useful for simple programs. @item -callback Emits callback function template in a separate file. @item -lax Suppresses checking of variable and callback function names for being aceptable C variable names @item -bw @i{borderwidth} Changes the default border width of the forms created. @end table Note that @code{-help}, @code{-version} and @code{-convert} do not require a connection to an X server. If an output unit other than the default (pixel) is selected, all object sizes in the output file will be in the unit requested. This kind of UI has a fixed and device resolution independent size (in theory at least) and can be useful for drawing applications. fdesign recognizes the following resources: @multitable @columnfractions 0.3 0.2 0.5 @item @code{workingArea.geometry} @tab string @tab Geometry @item @code{control.border} @tab bool @tab XForms borderwidth @item @code{control.geometry} @tab string (position only) @tab Control window geometry @item @code{attributes.geometry} @tab string (position only) @tab Attributes window Geometry @item @code{attributes.background} @tab string (e.g., gray80) @tab Attributes window background @item @code{align.geometry} @tab string (position only) @tab Align window geometry @item @code{help.geometry} @tab string (position only) @tab Help window geometry @item @code{convert} @tab bool @tab Convert @item @code{unit} @tab string @tab Unit @item @code{altformat} @tab bool @tab AltFormat @item @code{xformHeader} @tab string @tab Header file name @item @code{helpFontSize} @tab int @tab Help font size @item @code{main} @tab bool @tab Main @end multitable Note that resource specification of convert requires an X connection. In addition, all XForms's resources specification can be used to influence the appearance of various panels. The most useful ones are the font sizes @multitable @columnfractions 0.3 0.5 @item @code{*XForm.FontSize} @tab all label font sizes @item @code{XForm.PupFontSize} @tab all pup font sizes @end multitable xforms-1.2.4/doc/part2_introduction.texi0000644000175000017500000000500512247334224015251 00000000000000@node Part II Introduction @chapter Introduction This part of the documentation describes the Form Designer, a GUI builder meant to help you interactively design dialogue forms for use with the Forms Library. This part assumes the reader is familiar with the Forms Library and has read Part I of this document. Even though designing forms is quite easy and requires only a relatively small number of lines of C-code, it can be time consuming to figure out all required positions and sizes of the objects. The Form Designer was written to facilitate the construction of forms. With Form Designer, there is no longer any need to calculate or guess where the objects should be. The highly interactive and WYSIWYG (What You See Is What You Get) nature of the Form Designer relieves the application programmer from the time consuming process of user interface construction so that he/she can concentrate more on what the application program intends to accomplish. Form Designer provides the abilities to interactively place, move and scale objects on a form, also the abilities to set all attributes of an object. Once satisfactory forms are constructed, the Form Designer generates a piece of C-code that can then be included in the application program. This piece of code will contain one procedure create_form_xxx() for each form, where xxx indicates the form name. The application only needs to call it to generate the form designed. The code produced is easily readable. The Form Designer also lets the user identify each object with C variables for later reference in the application program and allows advanced object callback bindings all within the Form Designer. All actions are performed with the mouse or the function keys. It uses a large number of forms itself to let the user make choices, set attributes, etc. Most of these forms were designed using the Form Designer itself. It is important to note that the Form Designer only helps you in designing the layout of your forms. It does not allow you to specify the actions that have to be taken when, e.g., a button is pushed. You can indicate the callback routine to call but the application program has to supply this callback routine. Also, the current version is mostly a layout tool and not a programming environment, not yet anyway. This means that the Form Designer does not allow you to initialize all your objects. You can, however, initialize some objects, e.g., you can set the bounds of a slider inside the Form Designer. Eventually full support of object initialization will be implemented. xforms-1.2.4/doc/part5_trouble_shooting.texi0000644000175000017500000000320711665175503016131 00000000000000@node Part V Trouble Shooting @chapter Trouble Shooting This chapter deals with a number of (common) problems encountered by people using the Forms Library. Ways of avoiding them are presented. @table @asis @item @code{fl show form()} only draws the form partially This only happens if immediately following @code{@ref{fl_show_form()}} the application program blocks the execution (e.g., waiting for a socket connection, starting a new process via @code{fork()} etc.). To fix this problem, you can flush the X buffer manually using @code{fl_update_display(1)} before blocking occurs or use an idle callback to check the status of the blocking device or let the main loop handle it for you via @code{@ref{fl_add_io_callback()}}. @item I updated the value of a slider/counter/label, but it does not change This only happens if the update is followed by a blockage of execution or a long task without involving the main loop of Forms Library. You can force a screen update using @code{fl_update_display(1)}. @item I found a bug in XForms, What do I do? Please consider subscribing to the XForms mailing list at @url{http://lists.nongnu.org/mailman/listinfo/xforms-development} and sending an email with information about the bug you found. Please try to post information about the version of the Forms Library you're using and your OS beside a description of the bug. Some sample code that exhibits the erratic behavior would help greatly. If, for some reasons, you don't want subscribe to the mailing list you may also send an email to one of the maintainers. At the moment you probably should first contact Jens Thoms Toerring, <@email{jt@@toerring.de}>. @end table xforms-1.2.4/doc/part1_getting_started.texi0000644000175000017500000003017012246666357015735 00000000000000@node Part I Getting Started @chapter Getting Started This chapter introduces the typographical conventions used throughout the manual and then continues with showing a few, simple examples on using the Forms Library. It concludes with a short resumee of the programming model typically found in programs using the library. @ifnottex @menu * Naming Conventions:: * Some Examples:: * Programming Model:: @end menu @end ifnottex @node Naming Conventions @section Naming Conventions The names of all Forms Library functions and user-accessible data structures begin with @code{fl_} or @code{FL_}, and use an "underscore-between-words" convention, that is when function and variable names are composed of more than one word, an underscore is inserted between each word. For example, @example fl_state fl_set_object_label() fl_show_form() @end example All Forms Library macros, constants and types also follow this convention, except that (at least) the first two letters are capitalized. For example, @example FL_min() FL_NORMAL_BUTTON FL_OBJECT @end example The term "form" often can be taken to mean a window of your application. But be aware that there are also can be forms that themselves contain further forms, so "form" and "window" aren't necessarily synonyms. The only exceptions from the above convention are names of functions related to image manipulations - they start with @code{flimage_}. And then there's a single function called @code{@ref{flps_init()}} that allows customization of the way hardcopies are created from an existing user interface. @node Some Examples @section Some Examples Before using forms for interaction with the user you first have to define them. Next you can display them and perform interaction with them. Both stages are simple. Before explaining all the details let us first look at some examples. A very simple form definition would look as @example FL_FORM *simpleform; simpleform = fl_bgn_form(FL_UP_BOX, 230, 160); fl_add_button(FL_NORMAL_BUTTON, 40, 50, 150, 60, "Push Me"); fl_end_form(); @end example The first line indicates the start of the form definition. @code{simpleform} will later be used to identify the form. The type of the form is @code{FL_UP_BOX}. This means that the background of the form is a raised box that looks like it is coming out of the screen. The form has a size of 230 by 160 pixels. Next we add a button to the form. The type of the button is @code{FL_NORMAL_BUTTON} which will be explained below in detail. It is positioned in the form by virtue of the button geometry supplied and has "Push Me" as its label. After having defined the form we can display it using the call @example fl_show_form(simpleform, FL_PLACE_MOUSE, FL_NOBORDER, "SimpleForm"); @end example @ifhtml @center @image{xforms_images/pushme} @end ifhtml @ifnothtml @center @image{xforms_images/pushme,5cm} @end ifnothtml This will show the form on the screen at the mouse position. (The third argument indicates whether the form gets window manager's decoration and the fourth is the window title.) Next we give the control over the interaction to the Forms Library's main event loop by calling @example fl_do_forms(); @end example @noindent This will handle interaction with the form until you press and release the button with the mouse, at which moment control is returned to the program. Now the form can be removed from the screen (and have its associated window destroyed) using @example fl_hide_form(simpleform); @end example @noindent The complete program is given in the file @file{pushme.c} in the subdirectory @file{demos}. All demonstration programs can be found in this directory. Studying them is a good way of learning how the library works. Compile and run it to see the effect. To compile a program using the Forms Library use the following command or something similar @example cc -o pushme pushme.c -lforms @end example @noindent Please note that linking against the Forms library requires some other libraries to be istalled, at least the @code{X11} and the @code{Xpm} library. Some applications may also require the @code{JPEG} and/or the @code{GL} library. These libraries don't need to be specified explicitely in the linker command but must be available since the Forms library depends on them. If not installed contact your systems administrator. This simple example is, of course, of little use. Let us look at a slightly more complicated one (the program can be found in @file{yesno.c}.) @example #include int main(int argc, char *argv[]) @{ FL_FORM *form; FL_OBJECT *yes, *no, *but; fl_initialize(&argc, argv, "FormDemo", 0, 0); form = fl_bgn_form(FL_UP_BOX, 320, 120); fl_add_box(FL_NO_BOX, 160, 40, 0, 0, "Do you want to Quit?"); yes = fl_add_button(FL_NORMAL_BUTTON, 40, 70, 80, 30, "Yes"); no = fl_add_button(FL_NORMAL_BUTTON, 200, 70, 80, 30, "No"); fl_end_form(); fl_show_form(form, FL_PLACE_MOUSE, FL_TRANSIENT, "Question"); while (1) @{ if (fl_do_forms() == yes) @{ printf("Yes is pushed\n"); break; @} else printf("No is pushed\n"); @} fl_finish(); return 0; @} @end example @noindent It creates a form with a simple text and two buttons. After displaying the form @code{@ref{fl_do_forms()}} is called. This routine returns the object being pushed. Simply checking whether this is object @code{yes} or @code{no} determines whether we should quit. @ifhtml @center @image{xforms_images/yesno} @end ifhtml @ifnothtml @center @image{xforms_images/yesno,6cm} @end ifnothtml As you see, the program starts by calling the routine @code{@ref{fl_initialize()}}. This routine should be called before any other calls to the library are made (except for @code{@ref{fl_set_defaults()}}). One of the things this routine does is to establish a connection to the X server and initialize a resource database used by the X resource manager. It also does many other things, such as parsing command line options and initializing internal Forms Library structures. For now, it suffices to know that by calling this routine, a program automatically recognizes the following command line options @multitable @columnfractions 0.3 0.3 0.4 @headitem Option @tab Value type @tab Meaning @item @item @code{-display} @i{host:dpy} @tab string @tab Remote host @item @code{-name} @i{appname} @tab string @tab change application name @item @code{-visual} @i{class} @tab string @tab TrueColor, PseudoColor etc. @item @code{-depth} @i{depth} @tab integer @tab Preferred visual depth @item @code{-private} @tab none @tab Force a private colormap @item @code{-shared} @tab none @tab Always share colormap @item @code{-stdcmap} @tab none @tab Use standard colormap @item @code{-fldebug} @i{level} @tab integer @tab Print some debug information @item @code{-flhelp} @tab none @tab Print out these options @item @code{-sync} @tab none @tab Force synchronous mode @end multitable Note that the executable name @code{argv[0]} should not contain period or @code{*}. @xref{Part V Overview of Main Functions, , Overview of Main Functions}, for further details. The above program can in fact be made a lot simpler, using the goodies described in @ref{Part I Goodies, , Goodies}. You can simply write: @example while (!fl_show_question("Do you want to Quit?", 0)) /* empty */ ; @end example @noindent Except printing out a message telling which button was pressed it will have exactly the same effect. The above program only shows one of the event handling methods provided by the library. The direct method of event handling shown is appropriate for simple programs. But, obviously, already for a program with just a few nmore objects it would become rather tedious to have to check each time @code{@ref{fl_do_forms()}} returns each of those objects to find out which of them was responsible and react accordingly. Utilizing object callback functions is then typically much easier and thus os strongly recommended. We demonstrate the use of object callbacks using the previous example with some modifications so that event processing via callbacks is utilized. It is recommended and also typical of a good XForms application to separate the UI components and the application program itself. Typically the UI components are generated by the bundled GUI builder and the application program consists mostly of callbacks and some glue code that combines the UI and the program. To use callbacks, a typical procedure would be to define all the callback functions first, then register them with the system using @code{@ref{fl_set_object_callback()}}. After the form is realized (shown), control is handed to Forms Library's main loop @code{@ref{fl_do_forms()}}, which responds to user events indefinitely and never returns. After modifications are made to utilize object callbacks, the simple question example looks as follows: @example #include #include #include void yes_callback(FL_OBJECT *obj, long user_data) @{ printf("Yes is pushed\n"); fl_finish(); exit(0); @} void no_callback(FL_OBJECT *obj, long user_data) @{ printf("No is pushed\n"); @} int main(int argc, char *argv[]) @{ FL_FORM *form; FL_OBJECT *obj; fl_initialize(&argc, argv, "FormDemo", 0, 0); form = fl_bgn_form(FL_UP_BOX, 320, 120); fl_add_box(FL_NO_BOX, 160, 40, 0, 0, "Do you want to Quit?"); obj = fl_add_button(FL_NORMAL_BUTTON, 40, 70, 80, 30,"Yes"); fl_set_object_callback(obj, yes_callback, 0); obj = fl_add_button(FL_NORMAL_BUTTON, 200, 70, 80, 30,"No"); fl_set_object_callback(obj, no_callback, 0); fl_end_form(); fl_show_form(form, FL_PLACE_MOUSE, FL_TRANSIENT, "Question"); fl_do_forms(); return 0; @} @end example In this example, callback routines for both the yes and no buttons are first defined. Then they are registered with the system using @code{@ref{fl_set_object_callback()}}. After the form is shown, the event handling is again handed to the main loop in Forms Library via @code{@ref{fl_do_forms()}}. In this case, whenever the buttons are pushed, the callback routine is invoked with the object being pushed as the first argument to the callback function, and @code{@ref{fl_do_forms()}} never returns. You might also have noticed that in this example both buttons are made anonymous, that is, it is not possible to reference the buttons outside of the creating routine. This is often desirable when callback functions are bound to objects as the objects themselves will not be referenced except as callback arguments. By creating anonymous objects a program avoids littering itself with useless identifiers. The callback model presented above is the preferred way of interaction for typical programs and it is strongly recommended that programs using XForms be coded using object callbacks. @node Programming Model @section Programming Model To summarize, every Forms Library application program must perform several basic steps. These are @table @asis @item Initialize the Forms Library This step establishes a connection to the X server, allocates resources and otherwise initializes the Forms Library's internal structures, which include visual selection, font initialization and command line parsing. @item Defining forms Every program creates one or more forms and all the objects on them to construct the user interface. This step may also include callback registration and per object initialization such as setting bounds for sliders etc. @item Showing forms This step makes the designed user interface visible by creating and mapping the window (and subwindows) used by the forms. @item Main loop Most Forms Library applications are completely event-driven and are designed to respond to user events indefinitely. The Forms Library main loop, usually invoked by calling @code{@ref{fl_do_forms()}}, retrieves events from the X event queue, dispatches them to the appropriate objects and notifies the application of what action, if any, should be taken. The actual notification method depends on how the interaction is set up, which could be done by calling an object callback or by returning the object whose status has changed to the application program. @end table The following chapters will lead you through each step of the process with more details. xforms-1.2.4/doc/xforms.texi0000664000175000017500000001264712353623325012753 00000000000000\input texinfo @setfilename xforms.info @settitle XForms (Forms Library) - Version 1.2 (Rev. 4)@*A Graphical User Interface Toolkit for X @set lastupdate June 6, 2014 @paragraphindent 0 @titlepage @title XForms @sp 8 @center @titlefont{XForms (Forms Library)} @sp 1 @center @titlefont{A Graphical User Interface Toolkit for X} @sp 8 @center Library Version 1.2 (Rev. 4) @sp 2 @center June 2014 @sp 8 @end titlepage @dircategory Development @direntry * XForms: (xforms). A Graphical user interface toolkit for X @end direntry @contents @node Top @top @ifnottex @menu * Preface: Preface * Part I - Using The Forms Library: Part I * Introduction: Part I Introduction * Getting Started: Part I Getting Started * Defining Forms: Part I Defining Forms * Doing Interaction: Part I Doing Interaction * Free Objects: Part I Free Objects * Free Objects: Part I Goodies * Part II - The Form Designer: Part II * Introduction: Part II Introduction * Getting Started: Part II Getting Started * Command Line Arguments: Part II Command Line Arguments * Creating Forms: Part II Creating Forms * Saving and Loading Forms: Part II Saving and Loading Forms * Language Filters: Part II Language Filters * Generating Hardcopies: Part II Generating Hardcopies * Part III - Object Classes: Part III * Introduction: Part III Introduction * Static Objects: Part III Static Objects * Button-like Objects: Part III Button-like Objects * Valuator Objects: Part III Valuator Objects * Input Objects: Part III Input Objects * Choice Objects: Part III Choice Objects * Container Objects: Part III Container Objects * Other Objects: Part III Other Objects * Popups: Part III Popups * Deprecated Objects: Part III Deprecated Objects * Part IV - Designing Object Classes: Part IV * Introduction: Part IV Introduction * Global Structure: Part IV Global Structure * Events: Part IV Events * The Type @code{FL_OBJECT}: Part IV The Type FL_OBJECT * Drawing Objects: Part IV Drawing Objects * An Example: Part IV An Example * New Buttons: Part IV New Buttons * Using a Pre-emptive Handler: Part IV Using a Pre-emptive Handler * Part V - General Informations: Part V * Overview of Main Functions: Part V Overview of Main Functions * Some Useful Functions: Part V Some Useful Functions * Resources for Forms Library: Part V Resources for Forms Library * Dirty Tricks: Part V Dirty Tricks * Trouble Shooting: Part V Trouble Shooting * Part VI - Image Supprt API: Part VI * Part VI Images:: @c There are three indexes, for functions, variables and constants. @c But for HTML we combine them into one - it's easier to search only @c one page instead of having to go to three of them and the second @c and third page are also a bit difficult to find... @ifnothtml * Index of Functions:: * Index of Global Variables:: * Index of Constants:: @end ifnothtml @ifhtml * Index:: @end ifhtml @end menu @end ifnottex @include part0_preface.texi @include part1.texi @include part1_introduction.texi @include part1_getting_started.texi @include part1_defining_forms.texi @include part1_doing_interaction.texi @include part1_free_objects.texi @include part1_goodies.texi @include part2.texi @include part2_introduction.texi @include part2_getting_started.texi @include part2_command_line.texi @include part2_creating_forms.texi @include part2_saving_loading.texi @include part2_language_filters.texi @include part2_generating_hardcopies.texi @include part3.texi @include part3_introduction.texi @include part3_static_objects.texi @include part3_buttons.texi @include part3_valuator_objects.texi @include part3_input_objects.texi @include part3_choice_objects.texi @include part3_container_objects.texi @include part3_other_objects.texi @include part3_popups.texi @include part3_deprecated_objects.texi @include part4.texi @include part4_introduction.texi @include part4_global_structure.texi @include part4_events.texi @include part4_fl_object.texi @include part4_drawing_objects.texi @include part4_an_example.texi @include part4_new_buttons.texi @include part4_preemptive_handler.texi @include part5.texi @include part5_overview.texi @include part5_useful_functions.texi @include part5_resources.texi @include part5_dirty_tricks.texi @include part5_trouble_shooting.texi @include part6.texi @include part6_images.texi @c For non-HTML output create an index for functions, global variables @c and constants, for HTML output combine them into one @ifnothtml @node Index of Functions @unnumbered Index of Functions @printindex fn @node Index of Global Variables @unnumbered Index of Global Variables @printindex vr @node Index of Constants @unnumbered Index of Constants @printindex tp @end ifnothtml @ifhtml @syncodeindex vr fn @syncodeindex tp fn @node Index @unnumbered Index @printindex fn @end ifhtml @bye xforms-1.2.4/doc/part3_choice_objects.texi0000644000175000017500000020477412252564642015517 00000000000000@node Part III Choice Objects @chapter Choice Objects @ifnottex @menu * Select Object: Select Object * Nmenu Object: Nmenu Object * Browser Object: Browser Object @end menu @end ifnottex @node Select Object @section Select Object A select object is a rather simple object that allows the user to pick alternatives from a linear list that pops up when he clicks on the object. It remembers the last selected item, which is also shown on top of the select object. The select object internally uses a popup (@pxref{Part III Popups}) and thus it can be helpful to understand at lest some aspects of how popups work to fully grasp the functionality of select objects. @ifnottex @menu * Adding Select Objects: Adding Select Objects * Select Interaction: Select Interaction * Other Select Routines: Other Select Routines * Select Attributes: Select Attributes * Remarks: Select Remarks @end menu @end ifnottex @node Adding Select Objects @subsection Adding Select Objects To add a select object to a form use @findex fl_add_select() @anchor{fl_add_select()} @example FL_OBJECT *fl_add_select(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) @end example @noindent There are currently three types which just differ by the way they look: @table @code @tindex FL_NORMAL_SELECT @anchor{FL_NORMAL_SELECT} @item FL_NORMAL_SELECT Per default this type is drawn as a rounded, flat box (but you can change that by setting a different boxtype for the object) with the text of the currently selected item in its center. @tindex FL_MENU_SELECT @anchor{FL_MENU_SELECT} @item FL_MENU_SELECT This select object looks like a button with a little extra box at its right side (just like a @code{FL_MENU_BUTTON}) and the text of the currently selected item is drawn on the button-like object. @tindex FL_DROPLIST_SELECT @anchor{FL_DROPLIST_SELECT} @item FL_DROPLIST_SELECT This type looks like a button with the text of the currently selected item on top of it and a second square button directly beside it with an downward pointing arrow on it. @end table Per default @code{label} is drawn outside and to the left of the object. Once a new select object has been created items have to be added to it. For this the following function exists: @findex fl_add_select_items() @anchor{fl_add_select_items()} @example FL_POPUP_ENTRY *fl_add_select_items(FL_OBJECT *obj, const char items,...); @end example @noindent @code{items} is a string with the items to add, separated by the @code{|} character. In the simplest case you would just use something like @code{"Item 1|Item 2|Item 3"} to add three items to the list. If there weren't any items before the first item will be automatically shown as the selected one. As also described in the documentation for the similar function @code{@ref{fl_popup_add_entries()}} (@pxref{Adding Popups}) the text for an item may contain "special sequences" that start with the character @code{%} and the may require an additional argument passed to the function after the @code{items} argument: @table @code @item %x Set a value of type @code{long int} that's passed to all callback routines for the item. The value must be given in the arguments following the @code{items} string. @item %u Set a @code{user_void} pointer that's passed to all callbacks of the item. The pointer must be specified in the arguments following the @code{items} string. @item %f Set a callback function that gets called when the item is selected. The function is of type @example int callback(FL_POPUP_RETURN *r); @end example @noindent Information about the item etc.@: gets passed to the callback function via the @code{@ref{FL_POPUP_RETURN}} structure and the return value of the function can be used to keep the selection from becoming reported back to the user made by returning a value of @code{FL_IGNORE} (-1). The function's address must be given in the arguments following the @code{items} string. @item %E Set a callback routine that gets called each time the mouse enters the item (as long as the item isn't disabled or hidden). The type of the function is the same as that of the callback function for the selection of the item but it's return value is never used. The functions address must be given in the arguments following the @code{items} string. @item %L Set a callback routine that gets called each time the mouse leaves the item. The type of the function is the same that as of the callback function for the selection of the item but it's return value is never used. The functions address must be given in the arguments following the @code{items} string. @item %d Marks the item as disabled, i.e., it can't be selected and its text is per default drawn in a different color @item %h Marks the item as hidden, i.e., it is not shown while in this state. @item %S For items with shortcut keys it's quite common to have them shown on the right hand side. Using @code{"%S"} you can split the items text into two parts, the first one (before @code{"%S"}) being drawn flushed left and the second part flushed right. Note that using this special sequence doesn't automatically sets a shortcut key, this still has to be done using @code{"%s"}. @item %s Sets one or more shortcut keys for an item. Requires a string with the shortcuts in the arguments following the @code{items} string. @xref{Shortcuts}, for details on how to define shortcuts. Please note that the character in the label identical to the shortcut character is only shown as underlined if @code{"%S"} isn't used. @item %% Use this to get a @code{'%'} within the text of an item. @end table @noindent If you compare this list of "special sequences" with those listed for the @code{@ref{fl_popup_add_entries()}} function you will find that aome are missing. This is because a select object is a simple linear list of items that uses only parts of the popups functionalities. Another way to set up the popup of a select object is to use the function @findex fl_set_select_items() @anchor{fl_set_select_items()} @example long fl_set_select_items(FL_OBJECT *obj, FL_POPUP_ITEM *item); @end example @noindent Here @code{item} is an array of structures of type @code{@ref{FL_POPUP_ITEM}} with the @code{text} member of the very last element of the array being set to @code{NULL}, indicating the end of the array. The @code{text} member is the text of the item. It may only contain one "special sequence", @code{"%S"} to indicate that the string is to be split at that position into the part of the item label to be drawn to the left and on the right side (also prepending the string with @code{'_'} or @code{'/'} has no effect). @code{callback} is a callback function to be invoked on selection of the item. @code{shortcut} is a string for setting keybord shortcuts for the item. @code{type} has no function at all here (there can be only items of type @code{@ref{FL_POPUP_NORMAL}} in a select objects popup) and @code{state} can be set to @code{@ref{FL_POPUP_DISABLED}} and/or @code{@ref{FL_POPUP_HIDDEN}}. Please note: when the select object already had items before the call of @code{@ref{fl_set_select_items()}} then they are removed before the new ones are set. The values assigned to the items start at 0. A third way to "populate" a select object is to create a popup directly and then associate it with the select object using @findex fl_set_select_popup() @anchor{fl_set_select_popup()} @example int fl_set_select_popup(FL_OBJECT *obj, FL_POPUP *popup); @end example @noindent If the select object already had a popup before this will be deleted and replaced by the new popup passed as the second argument. Please note that the popup the argument @code{popup} points to may not contain any entries other than those of type @code{@ref{FL_POPUP_NORMAL}} (and, of course, the popup can't be a sub-popup of another popup). @node Select Interaction @subsection Select Interaction The simplest interaction with a select object consists of clicking onto the object and then selecting an item in the popup that gets shown directly beside the mouse position. If you click with the left or right mouse button onto the select object previous or next item, respectively, will be selected. If youl keep the left or mouse button pressed down for a longer time slowly all alternatives are selected, one after each other. You finally can also use the scroll wheel of your mouse to select the next or previous item (scrolling down selects the next, scrolling up the previous item). On every selection of an item (also if the already selected item is re-selected) a callback that may have been associated with the item is executed. The callback receives as its argument a pointer to a structure of type @code{@ref{FL_POPUP_RETURN}}. Its @code{val} member is a integer value associated with the entry. It can be set explicitely on creation of the item using the @code{"%x"} "special sequence". If not given then first item gets the value 0, the next 1 etc. @code{user_data} is a pointer to some user data, which can be set on creation of the item using @code{"%u"}. @code{text} is the string used in creating the item, including all "special sequences", while @code{label} is the string shown in the popup for the item. If there was a special sequence of @code{"%S"} in the string that was used to create the item @code{accel} is the text that appears right-flushed in the popup for the item. @code{entry} is a pointer to the popup entry that represents the item in the select object and, finally, @code{popup} is the popup associated with the select object. Normally, when a new item is selected this is reported back to the caller either by calling the select objects callback (if one exists) or by returning the object as the result of a call of e.g., @code{@ref{fl_do_forms()}}. But if the callback for the item itself returns @code{FL_IGNORE} then the latter doesn't happen. This can be useful for cases where all work for a change of the selection can already be done within the items callback and the "main loop" shouldn't get involved anymore. As for all other normal objects the condition under which a @code{FL_SELECT} object gets returned to the application (or an associate callback is called) can be influenced by calling the function @example int fl_set_object_return(FL_OBJECT *obj, unsigned int when) @end example where @code{when} can have the following values @table @code @item @ref{FL_RETURN_NONE} Never return or invoke a callback. @item @ref{FL_RETURN_END_CHANGED} Return or invoke callback if end of interaction and selection of an item coincide. @item @ref{FL_RETURN_CHANGED} Return or invoke callback whenever an item is selected (this is the default). @item @ref{FL_RETURN_END} Return or invoke callback on end of an interaction. @item @ref{FL_RETURN_ALWAYS} Return (or invoke callback) whenever the interaction ends and/or an item is selected. @end table Per default the popup of a select objects remains shown when the user releases the mouse somewhere outside the popup window (or on its title area). The alternative is to close the popup immediately when the user releases the mouse, independent of where it is. Using the function @findex fl_set_select_policy() @anchor{fl_set_select_policy()} @example int fl_set_select_policy(FL_OBJECT *obj, int policy); @end example @noindent the program can switch between these two modes of operation, where @code{policy} can be on of two values: @table @code @tindex FL_POPUP_NORMAL_SELECT @item FL_POPUP_NORMAL_SELECT Keeps the popup opened when the mouse isn't released on one of the selectable items. @tindex FL_POPUP_DRAG_SELECT @item FL_POPUP_DRAG_SELECT Close the popup immediately when the mouse button is released. @end table @noindent The function returns on success the previous setting of the "policy" and -1 on error. @node Other Select Routines @subsection Other Select Routines To find out which item is currently selected use @findex fl_get_select_item() @anchor{fl_get_select_item()} @example FL_POPUP_RETURN *fl_get_select_item(FL_OBJECT *obj); @end example @noindent It returns a pointer to a structure of type @code{@ref{FL_POPUP_RETURN}} as already described above, containing all needed information about the selected item. For some actions, e.g., deletion of an item etc., it is necessary to know the popup entry that represents it. Therefore it's possible to search the list of items according to several criteria: @findex fl_get_select_item_by_value() @anchor{fl_get_select_item_by_value()} @findex fl_get_select_item_by_label() @anchor{fl_get_select_item_by_label()} @findex fl_get_select_item_by_label_f() @anchor{fl_get_select_item_by_label_f()} @findex fl_get_select_item_by_text() @anchor{fl_get_select_item_by_text()} @findex fl_get_select_item_by_text_f() @anchor{fl_get_select_item_by_text_f()} @example FL_POPUP_ENTRY *fl_get_select_item_by_value(FL_OBJECT *obj, long val); FL_POPUP_ENTRY *fl_get_select_item_by_label(FL_OBJECT *obj, const char *label); FL_POPUP_ENTRY *fl_get_select_item_by_label_f(FL_OBJECT *obj, const char *fmt, ...); FL_POPUP_ENTRY *fl_get_select_item_by_text(FL_OBJECT *obj, const char *text); FL_POPUP_ENTRY *fl_get_select_item_by_text_f(FL_OBJECT *obj, const char *fmt, ...); @end example The first function, @code{@ref{fl_get_select_item_by_value()}}, searches through the list of items and returns the first one with the @code{val} associated with the item (or @code{NULL} if none is found). The second and third, @code{@ref{fl_get_select_item_by_label()}} and @code{@ref{fl_get_select_item_by_label_f()}} searches for a certain label as displayed for the item in the popup. The last two, @code{@ref{fl_get_select_item_by_text()}} and @code{@ref{fl_get_select_item_by_text_f()}} searches for the text the item was created by (that might be the same as the label text in simple cases). The difference between the second and third and the forth and the last is the way the text is passed to the functions, it's either a simple string or the result of the expansion of a format string as used for @code{printf()} etc. using the following unspecified arguments. Please note that all these functions return a structure of type @code{@ref{FL_POPUP_ENTRY}} (and not @code{@ref{FL_POPUP_RETURN}}, which gives you direct access to the entry in the popup for the item. Using e.g., the result of one of the functions above you can also set the currently selected item via your program using @findex fl_set_select_item() @anchor{fl_set_select_item()} @example FL_POPUP_RETURN *fl_set_select_item(FL_OBJECT *obj, FL_POPUP_ENTRY *entry); @end example Or you could use the result to delete an item: @findex fl_delete_select_item() @anchor{fl_delete_select_item()} @example int fl_delete_select_item(FL_OBJECT *obj, FL_POPUP_ENTRY *entry); @end example @noindent Please note that the values associated with items won't change due to removing an item. Alternatively, you can replace an item by one or more new ones. To do that use @findex fl_replace_select_item() @anchor{fl_replace_select_item()} @example FL_POPUP_ENTRY *fl_replace_select_item(FL_OBJECT *obj, FL_POPUP_ENTRY *old, const char *new_items, ...); @end example @noindent @code{old} designates the item to be removed and @code{new_items} is a string exactly like it would be used in @code{@ref{fl_add_select_items()}} for the @code{items} argument, that defines the item(s) to replace the existing item. Please note that, unless values to be associated with the items (see the @code{val} member of the @code{@ref{FL_POPUP_RETURN}} structure) there's a twist here. When items get created they per default receive increasing values, starting at 0. This also holds for items that get created in the process of replacement. The result is that the ordering of those values in that case wont represent the order in which they appear in the select objects popup. Another sometimes useful function allows insertion of new items somewhere in the middle of a list of already existing items: @findex fl_insert_select_items() @anchor{fl_insert_select_items()} @example FL_POPUP_ENTRY *fl_insert_select_items(FL_OBJECT *obj, FL_POPUP_ENTRY *after, const char *new_items, ...); @end example @noindent @code{after} is the entry after which the new item(s) are to be inserted (if it's @code{NULL} the new items are inserted at the very start). The rest of the arguments are the same as for @code{@ref{fl_replace_select_item()}} and the same caveats about the values associated automatically with the new items holds. It's possible to remove all items from a select object by calling @findex fl_clear_select() @anchor{fl_clear_select()} @example int fl_clear_select(FL_OBJECT *obj); @end example @noindent Afterwards you have to call again e.g., @code{@ref{fl_add_select_items()}} to set new entries. Note that if you used @code{@ref{fl_set_select_popup()}} to set a popup for the select object then that popup gets deleted automatically on calling @code{@ref{fl_clear_select()}}! The values automatically associated with items when calling @code{@ref{fl_add_select_items()}} will start at 0 again. @node Select Attributes @subsection Select Attributes The two color arguments, @code{clo1} and @code{col2}, of the function @code{@ref{fl_set_object_color()}} set the background color of the object normally and when the mouse is hovering over it, respectively. With the functions @findex fl_set_select_text_color() @anchor{fl_set_select_text_color()} @findex fl_get_select_text_color() @anchor{fl_get_select_text_color()} @example FL_COLOR fl_set_selection_text_color(FL_OBJECT *obj, FL_COLOR color); FL_COLOR fl_get_selection_text_color(FL_OBJECT *obj); @end example @noindent the color of the text of the currently selected item on top of the object can be set or queried. To control (or determine) the alignment of the text with the currently selected item on top of the select object use @findex fl_set_select_text_align() @anchor{fl_set_select_text_align()} @findex fl_get_select_text_align() @anchor{fl_get_select_text_align()} @example int fl_set_select_text_align(FLOBJECT *obj, int align); int fl_get_select_text_align(FLOBJECT *obj); @end example @noindent Please note that the @code{@ref{FL_ALIGN_INSIDE}} flag should be set with @code{align} since the text always will be drawn within the boundaries of the object. On success the function return the old setting for the alignment or -1 on error. Finally, the font style and size of the text can be set or obtained using @findex fl_set_select_text_font() @anchor{fl_set_select_text_font()} @findex fl_get_select_text_font() @anchor{fl_get_select_text_font()} @example int fl_set_select_text_font(FL_OBJECT *obj, int style, int size); int fl_get_select_text_font(FL_OBJECT *obj, int *style, int *size); @end example @noindent The rest of the appearance of a select object concerns the popup that is used. To avoid bloating the API unnecessarily no functions for select objects were added that would just call popup functions. The popup belonging to a select object can be easily found from either a @code{@ref{FL_POPUP_ENTRY}} structure as returned by the functions for searching for items or the @code{@ref{FL_POPUP_RETURN}} structure passed to all callbacks and also returned by @code{@ref{fl_get_select_item()}}. Both structures have a member called @code{popup} that is a pointer to the popup associated with the select object. For popup functions operation on indiviual items just use the pointer to the @code{@ref{FL_POPUP_ENTRY}} structure itself or the @code{entry} member of the @code{@ref{FL_POPUP_RETURN}} structure. There's also a convenience function for finding out the popup used for a select object: @findex fl_get_select_popup() @anchor{fl_get_select_popup()} @example FL_POPUP *fl_get_select_popup(FL_OBJECT *obj); @end example @noindent During the lifetime of a select object the popup never changes as long as @code{@ref{fl_set_select_popup()}} isn't called. Per default the popup of a select object does not have a title drawn on top of it. To change that use @code{@ref{fl_popup_set_title()}}. To change the various colors and fonts used when drawing the popup use the functions @code{@ref{fl_popup_set_color()}} and @code{@ref{fl_popup_entry_set_font()}} (and @code{@ref{fl_popup_set_title_font()}}). To change the border width or minimum width of the popup use @code{@ref{fl_popup_set_bw()}} and @code{@ref{fl_popup_set_min_width()}}. To disable or hide (or do the reverse) an item use the functions @code{@ref{fl_popup_entry_set_state()}} and @code{@ref{fl_popup_entry_get_state()}}. The keyboard shortcut for an entry can be set via @code{@ref{fl_popup_entry_set_shortcut()}}. The callback functions (selection, enter and leave callback) for individual items can be set via @code{@ref{fl_popup_entry_set_callback()}}, @code{@ref{fl_popup_entry_set_enter_callback()}} and @code{@ref{fl_popup_entry_set_leave_callback()}}, a callback for the whole popup with @code{@ref{fl_popup_set_callback()}}. Finally, to assign a different (long) value to an item or set a pointer to user data use @code{@ref{fl_popup_entry_set_value()}} and @code{@ref{fl_popup_entry_set_user_data()}}. @node Select Remarks @subsection Remarks See the demo program @file{select.c} for an example of the use of select objects. @node Nmenu Object @section Nmenu Object Another object type that heavily depends on popups is the "nmenu" object type. It is meant to be used for menus and the "n" in front of the name stands for "new" since this is a re-implementation of the old menu object type (which is now deprecated since it is based on @ref{XPopup}). @ifnottex @menu * Adding Nmenu Objects: Adding Nmenu Objects * Nmenu Interaction: Nmenu Interaction * Other Nmenu Routines: Other Nmenu Routines * Nmenu Attributes: Nmenu Attributes * Remarks: Nmenu Remarks @end menu @end ifnottex @node Adding Nmenu Objects @subsection Adding Nmenu Objects To add a nmenu object use @findex fl_add_nmenu() @anchor{fl_add_nmenu()} @example FL_OBJECT *fl_add_nmenu(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent There are currently three types: @table @code @tindex FL_NORMAL_NMENU @anchor{FL_NORMAL_NMENU} @item FL_NORMAL_NMENU Probably the most often used type: shown as text on a borderless background, popup gets opened when clicked on. @tindex FL_NORMAL_TOUCH_NMENU @anchor{FL_NORMAL_TOUCH_NMENU} @item FL_NORMAL_TOUCH_NMENU Also shown as text on a borderless background, but popup gets opened when the mouse is moved on top of it without any further user action required. @tindex FL_BUTTON_NMENU @anchor{FL_BUTTON_NMENU} @item FL_BUTTON_NMENU When not active shown as text on borderless background, when clicked on popup is shown and the object itself being displayed as a button. @tindex FL_BUTTON_TOUCH_NMENU @anchor{FL_BUTTON_TOUCH_NMENU} @item FL_BUTTON_TOUCH_NMENU When not active shown as text on borderless background, when mouse is moved onto it the popup is shown and the object itself is displayed as a button. @end table Once a new nmenu object has been created items have to be added to it. For this the following function exists: @findex fl_add_nmenu_items() @anchor{fl_add_nmenu_items()} @example FL_POPUP_ENTRY *fl_add_nmenu_items(FL_OBJECT *obj, const char items, ...); @end example @noindent (The function can also be used to append new items to a nmenu object that already has items.) The function returns a pointer to the first menu entry added on success and @code{NULL} on failure. @code{items} is a string with the items to add, separated by the @code{'|'} character. In the simplest case you would just use something like @code{"Item 1|Item 2|Item 3"} to add three items to the list. As also described in the documentation for the similar function @code{@ref{fl_popup_add_entries()}} the text for an item may contain "special sequences" that start with the character @code{'%'} and then may require an additional argument passed to the function after the @code{items} argument. All of those described in detail in the documentation for the @code{@ref{fl_popup_add_entries()}} function can also be used for nmenus. Another way to set up the popup of a select object, using an array of @ref{FL_POPUP_ITEM} structures, is via the function @findex fl_set_nmenu_items() @anchor{fl_set_nmenu_items()} @example FL_POPUP_ENTRY *fl_set_nmenu_items(FL_OBJECT *obj, FL_POPUP_ITEM *item); @end example @noindent The function returns a pointer to the first menu item on success and @code{NULL} on failure. The function expects as arguments a pointer to the nmenu object and an array of @code{@ref{FL_POPUP_ITEM}} structuress, with the very last element having @code{NULL} as the @code{text} member to mark the end of the array. The @code{text} member of the structure may contain the character sequence @code{"%S"} to have the text drawn for the item split up at that position and with everything before @code{"%S"} drawn left-flushed and the rest right-flushed. Moreover, @code{text} may start with the character @code{'/'} and/or @code{'_'}. For an underline character a line is drawn above the item. And if there's a slash this item marks the begin of a sub-menu with all further items belonging to the sub-menu until a structure with member @code{text} being set to @code{NULL} is found in the array. (The @code{'/'} and @code{'_'} characters are, of course, not drawn.) @code{type} indicates the type of the item. It can be @table @code @tindex FL_POPUP_NORMAL @item FL_POPUP_NORMAL A normal, plain item. @tindex FL_POPUP_TOGGLE @item FL_POPUP_TOGGLE An item that represents one of two states and is drawn with a check-marker when in "on" state. @tindex FL_POPUP_RADIO @item FL_POPUP_RADIO A radio item, i.e., it belongs to a group of items of which only one can be in "on" state at a time. They are drawn with a circle to the left with the circle for the "selected" item being filled with a color. @end table @noindent Please note that if @code{text} starts with a @code{'/'} the type @strong{must} be @code{FL_POPUP_NORMAL}. The @code{state} member per default is @code{@ref{FL_POPUP_NONE}}. It can be set to @table @code @tindex FL_POPUP_NONE @item FL_POPUP_NONE No special flags are set for the state of the item. @tindex FL_POPUP_DSABLED @item FL_POPUP_DSABLED The item is disabled and can't be selected. @tindex FL_POPUP_HIDDEN @item FL_POPUP_HIDDEN The item is hidden, i.e., does not get shown (and thus can't be selected). @tindex FL_POPUP_CHECKED @item FL_POPUP_CHECKED Only relevant for toggle or radio items, marks it as in "on" state. @end table @code{callback} is a function that will be called if the item is selected. The callback function has the following type: @example typedef int (*FL_POPUP_CB)(FL_POPUP_RETURN *); @end example @noindent It receives a pointer to a structure that contains all information about the entry selected by the user: @example typedef struct @{ long int val; /* value assigned to entry */ void *user_data; /* pointer to user data */ const char *text; /* text of selected popup entry */ const char *label; /* text drawn on left side */ const char *accel; /* text drawn on right side */ const FL_POPUP_ENTRY *entry; /* selected popup entry */ const FL_POPUP *popup; /* (sub-)popup it belongs to */ @} FL_POPUP_RETURN; @end example @noindent @code{val} is a value that has been associated with the entry and @code{user_data} is a pointer that can be used to store the location of further information. @code{text} is the text that was used to create the entry (including all "special" characters), while @code{label} and @code{accel} are the texts shown for the entry on the left and right. @code{entry} is the pointer to the structure for the entry selected and @code{popup} to the (sub-) popup the entry belongs to (@pxref{Part III Popups} for more details on these structures). If the callback function already does all the work required on selection of the item have it return the value @code{FL_IGNORE} to keep the selection from being reported back to the main loop of the program. Finally, @code{shortcut} is a string encoding the keybord shortcut to be used for the item. There's also a third method to "populate" a menu. If you already created a popup than you can set it as the menu's popup via a call of @findex fl_set_nmenu_popup() @anchor{fl_set_nmenu_popup()} @example int fl_set_nmenu_popup(FL_POPUP *popup); @end example @noindent Of course, the popup you associate with the nmenu object in this way can't be a sub-popup. @node Nmenu Interaction @subsection Nmenu Interaction There are, if seen interaction-wise, two types of nmenu objects, normal ones and touch nmenus. For normal nmenus a popup is opened when the user clicks on the area of the nmenu object while for touch nmenus the popup already is shown when the user moves the mouse unto the area. In other respects they behave identical: the user just selects one of the items in the popup (or one of the sub-popups) and then the popup is closed again. The selection can now be handled within a callback function and/or reported back to the main loop of the program. The popup is always shown directly below the nmenu object (except for the case that the popup is that long that it wouldn't fit on the screen, in which case the popup is drawn above the nmenu's area. The most natural way to deal with a selection by the user is probably via a callback for the item that was selected. But also a callback for the popup as a whole or the object itself can be used. Item and popup callback functions are of type @code{@ref{FL_POPUP_CB}} described above (and in even more detail in @ref{Part III Popups}), while object callbacks are "normal" XForms callback functions. The condition under which a @code{FL_NMENU} object gets returned to the application (or an associate callback is invoked) can be influenced by calling the function @example int fl_set_object_return(FL_OBJECT *obj, unsigned int when) @end example where @code{when} can have the following values @table @code @item @ref{FL_RETURN_NONE} Never return or invoke a callback. @item @ref{FL_RETURN_END_CHANGED} Return or invoke callback if end of interaction and selection of an item coincide. @item @ref{FL_RETURN_CHANGED} Return or invoke callback whenever an item is selected (this is the default). @item @ref{FL_RETURN_END} Return or invoke callback on end of an interaction. @item @ref{FL_RETURN_ALWAYS} Return (or invoke callback) whenever the interaction ends and/or an item is selected. @end table One detail of the interaction that can be adjusted is under which conditions the nmenu's popup gets closed. Per default the popup is closed when an item is selected or (without a selection) when the user clicks somehwere outside of the popups area. This can be changed so that the popup also gets closed (without a selection) when the mouse button is clicked or released on a non-selectable item (giving the impression of a "pull-down" menu). For this purpose there's the @findex fl_set_nmenu_policy() @anchor{fl_set_nmenu_policy()} @example int fl_set_nmenu_policy(FL_OBJECT *obj, int policy); @end example @noindent function where @code{policy} can be one of two values: @table @code @tindex FL_POPUP_NORMAL_SELECT @item FL_POPUP_NORMAL_SELECT Default, popup stays open until mouse button is released on a selectable entry or button is clicked outside the popups area. @tindex FL_POPUP_DRAG_SELECT @item FL_POPUP_DRAG_SELECT Popup is closed when the mouse button is released. @end table @noindent The function returns on success the previous setting of the "policy" and -1 on error. @node Other Nmenu Routines @subsection Other Nmenu Routines To find out which item of a nmenu object was selected last use @findex fl_get_nmenu_item() @anchor{fl_get_nmenu_item()} @example FL_POPUP_RETURN *fl_get_nmenu_item(FL_OBJECT *obj); @end example @noindent The function returns either a pointer to a @code{@ref{FL_POPUP_RETURN}} structure with informations about the selected item (as already discussed above when talking about callbacks) or @code{NULL} if no selection was made the last time the nmenu object was used. For some actions, e.g., deletion of an item etc., it is necessary to know the popup entry that represents it. Therefore it's possible to search the list of items according to several criteria: @findex fl_get_nmenu_item_by_value() @anchor{fl_get_nmenu_item_by_value()} @findex fl_get_nmenu_item_by_label() @anchor{fl_get_nmenu_item_by_label()} @findex fl_get_nmenu_item_by_text() @anchor{fl_get_nmenu_item_by_text()} @example FL_POPUP_ENTRY *fl_get_nmenu_item_by_value(FL_OBJECT *obj, long val); FL_POPUP_ENTRY *fl_get_nmenu_item_by_label(FL_OBJECT *obj, const char *label); FL_POPUP_ENTRY *fl_get_nmenu_item_by_label(FL_OBJECT *obj, const char *text); @end example The first function, @code{@ref{fl_get_nmenu_item_by_value()}}, searches through the list of all items (including items in sub-popups) and returns the first one with the @code{val} associated with the item (or @code{NULL} if none is found). The second, @code{@ref{fl_get_nmenu_item_by_label()}} searches for a certain label as displayed for the item in the popup. The third, @code{@ref{fl_get_nmenu_item_by_text()}} searches for the text the item was created by (that might be the same as the label text in simple cases). Please note that all functions return a structure of type @code{@ref{FL_POPUP_ENTRY}} (and not @code{@ref{FL_POPUP_RETURN}}, which gives you direct access to the entry in the popup for the item. Using e.g., the results of the above searches a nmenu item can be deleted: @findex fl_delete_nmenu_item() @anchor{fl_delete_nmenu_item()} @example int fl_delete_nmenu_item(FL_OBJECT *obj, FL_POPUP_ENTRY *item); @end example Alternatively, an item can be replaced by one or more items: @findex fl_replace_nmenu_item() @anchor{fl_replace_nmenu_item()} @example FL_POPUP_ENTRY *fl_replace_nmenu_item(FL_OBJECT *obj, FL_POPUP_ENTRY *old, const char *new_items, ...); @end example where @code{old} is the item to replace and @code{new_items} is a string exactly as used for @code{@ref{fl_add_nmenu_items()}} with informations about the new item(s). One also may insert additional items using @findex fl_insert_nmenu_items() @anchor{fl_insert_nmenu_items()} @example FL_POPUP_ENTRY *fl_insert_nmenu_items(FL_OBJECT *obj, FL_POPUP_ENTRY *after, const char *new_items, ...); @end example @noindent where @code{after} is the item after which the new items are to be inserted (use @code{NULL} to insert at the very start) and @code{new_items} is a string just like used with @code{@ref{fl_add_nmenu_items()}} with informations about the additional item(s). As you may remember, there are two different ways to "populate" a nmenu object. In one case you pass a kind of format string plus a variable number of arguments and in the other case an array of @code{@ref{FL_POPUP_ITEM}} structures. The previously listed functions for inserting and replacing used the first "interface". But there are also three functions for using the alternative interface: @anchor{fl_add_nmenu_items2()} @findex fl_add_nmenu_items2() @anchor{fl_insert_nmenu_items2()} @findex fl_insert_nmenu_items2() @anchor{fl_replace_nmenu_items2()} @findex fl_replace_nmenu_items2() @example FL_POPUP_ENTRY *fl_add_nmenu_items2(FL_OBJECT *obj, FL_POPUP_ITEM *items); FL_POPUP_ENTRY *fl_insert_nmenu_items2(FL_OBJECT *obj, FL_POPUP_ENTRY *after, FL_POPUP_ITEM *items); FL_POPUP_ENTRY *fl_replace_nmenu_items2(FL_OBJECT *obj, FL_POPUP_ENTRY *old_item, FL_POPUP_ITEM *items); @end example @noindent All three functions return a pointer to the first new entry in the nmenu's popup on success and @code{NULL} on failure. The all take a pointer to the nmenu object as their first argument. @code{@ref{fl_add_nmenu_items2()}} appends the items given by the list specified via the second argument to the nmenu's popup. @code{@ref{fl_insert_nmenu_items2()}} inserts one or more new items (as given by the last argument) after the entry specified by @code{after} (if @code{after} is @code{NULL} the new items are inserted before all existing items). Finally, @code{@ref{fl_replace_nmenu_items2()}} replaces the existing entry @code{old_item} with a new (or a list of new items specified by @code{items}. Finally, there's a function to remove all items from a nmenu object at once: @findex fl_clear_nmenu() @anchor{fl_clear_nmenu()} @example in fl_clear_nmenu(FL_OBJECT *obj); @end example @node Nmenu Attributes @subsection Nmenu Attributes While not "active" the background of the nmenu object is drawn in the color that can be controlled via the first color argument, @code{col1}, of @code{@ref{fl_set_object_color()}}. When "active" (i.e., while the popup is shown) its background is drawn in the color of second color argument, @code{col2}, of the same function. The color of the label when "inactive" is controlled via @code{@ref{fl_set_object_lcolor()}}. When in "active" state the color use for the label can be set via the function @findex fl_set_nmenu_hl_text_color() @anchor{fl_set_nmenu_hl_text_color()} @example FL_COLOR fl_set_nmenu_hl_text_color(FL_OBJECT *obj, FL_COLOR color); @end example @noindent The function returns the old color on success or @code{@ref{FL_MAX_COLORS}} on failure. Per default this color is @code{FL_BLACK} for nmenus that are shown as a button while being "active" while for normal nmenus it's the same color that is used items in the popup when the mouse is hovering over them. The size and style of the font used for the label of the nmenu object can be set via @code{@ref{fl_set_object_lsize()}} and @code{@ref{fl_set_object_lstyle()}}. The rest of the appearance of a nmenu object is given by the appearance of the popup. These can be directly set via the functions for setting the popup appearance as described in @ref{Popup Attributes}. To find out which popup is associated with the nmenu object use the function @findex fl_get_nmenu_popup() @anchor{fl_get_nmenu_popup()} @example FL_POPUP *fl_get_nmenu_popup(FL_OBJECT *obj); @end example @noindent and then use the popup specific functions to set the appearance. The same also holds for the appearance etc.@: of the items of the popup, a lot of functions exist that allow to set the attributes of entries of a popup, @pxref{Popup Attributes}. @node Nmenu Remarks @subsection Remarks See the demo program @file{menu.c}. @node Browser Object @section Browser Object The browser object class is probably the most powerful that currently exists in the Forms Library. A browser is a box that contains a number of lines of text. If the text does not fit inside the box, a scrollbar is automatically added so that the user can scroll through it. A browser can be used for building up a help facility or to give messages to the user. It is possible to create a browser from which the user can select lines. In this way the user can make its selections from a (possible) long list of choices. Both single lines and multiple lines can be selected, depending on the type of the browser. @ifnottex @menu * Adding Browser Objects: Adding Browser Objects * Browser Types: Browser Types * Browser Interaction: Browser Interaction * Other Browser Routines: Other Browser Routines * Browser Attributes: Browser Attributes * Remarks: Browser Remarks @end menu @end ifnottex @node Adding Browser Objects @subsection Adding Browser Objects To add a browser to a form use the routine @findex fl_add_browser() @anchor{fl_add_browser()} @example FL_OBJECT *fl_add_browser(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent The meaning of the parameters is as usual. The label is placed below the box by default. @node Browser Types @subsection Browser Types The following types of browsers exist (see below for more information about them): @table @code @tindex FL_NORMAL_BROWSER @anchor{FL_NORMAL_BROWSER} @item FL_NORMAL_BROWSER A browser in which no selections can be made. @tindex FL_SELECT_BROWSER @anchor{FL_SELECT_BROWSER} @item FL_SELECT_BROWSER In this type of browser the user can make single line selections which get reset immediately when the mouse button is released. @tindex FL_HOLD_BROWSER @anchor{FL_HOLD_BROWSER} @item FL_HOLD_BROWSER Same as @code{FL_SELECT_BROSER} but the selection remains visible till the next selection. @tindex FL_DESELECTABLE_HOLD_BROWSER @anchor{FL_DESELECTABLE_HOLD_BROWSER} @item FL_DESELECTABLE_HOLD_BROWSER Same as the @code{FL_HOLD_BROWSER} but the user can deselect the selected line. @tindex FL_MULTI_BROWSER @anchor{FL_MULTI_BROWSER} @item FL_MULTI_BROWSER Multiple selections can be made and remain visible till de-selected. @end table Hence, the differences only lie in how the selection process works. @node Browser Interaction @subsection Browser Interaction The user can change the position of the slider or use keyboard cursor keys (including @code{}, @code{}, etc.) to scroll through the text. When he/she presses the left mouse below or above the slider, the browser scrolls one page up or down. Any other mouse button scrolls one line at a time (except wheel mouse buttons). When not using an @code{@ref{FL_NORMAL_BROWSER}} the user can also make selections with the mouse by pointing to a line or by using the cursor keys. For @code{@ref{FL_SELECT_BROWSER}}'s, as long as the user keeps the left mouse button pressed, the current line under the mouse is highlighted. Whenever she releases the left mouse button the highlighting disappears and the browser is returned to the application program. The application program can now figure out which line was selected using a call of @code{@ref{fl_get_browser()}} to be described below. It returns the number of the last selected line (with the topmost line being line 1). A @code{@ref{FL_HOLD_BROWSER}} works exactly the same except that, when the left mouse button is released, the selection remains highlighted. A @code{@ref{FL_DESELECTABLE_HOLD_BROWSER}} additionally allows the user to undo a selection (by clicking on it again). An @code{@ref{FL_MULTI_BROWSER}} allows the user to select and de-select multiple lines. Whenever he selects or de-selects a line the browser object is returned to the application program (or a callback is executed when installed) that then can figure out which line was selected using @code{@ref{fl_get_browser()}} (described in more detail below). That function returns the number of the last line to be selected or de-selected. When a line was de-selected the negation of the line number gets returned. I.e., if line 10 was selected the routine returns 10 and if line 10 was de-selected -10. When the user presses the left mouse button on a non-selected line and then moves it with the mouse button still pressed down, he will select all lines he touches with his mouse until he releases it. All these lines will become highlighted. When the user starts pressing the mouse on an already selected line he de-selects lines rather than selecting them. Per default a browser only gets returned (or a possibly associated callback gets invoked) on selection of a line (and, in the case of @code{@ref{FL_MULTI_BROWSER}}, on deselections). This behaviour can be changed by using the function @example int fl_set_object_return(FL_OBJECT *obj, unsigned int when) @end example where @code{when} can have the following values @table @code @item @ref{FL_RETURN_NONE} Never return or invoke callback. @item @ref{FL_RETURN_SELECTION} Return or invoke callback on selection of a line. Please note that for @code{@ref{FL_MULTI_BROWSER}} the browser may be returned just once for a number of lines having been selected. @item @ref{FL_RETURN_DESELECTION} Return or invoke a callback on deselection of a line. This only happens for @code{@ref{FL_DESELECTABLE_HOLD_BROWSER}} and @code{@ref{FL_MULTI_BROWSER}} objects and, for the latter, the browser may get returned (or the callback invoked) just once for a number of lines having been deselected. @item @ref{FL_RETURN_END_CHANGED} Return or invoke callback at end (mouse release) if the text in the browser has been scrolled. @item @ref{FL_RETURN_CHANGED} Return or invoke callback whenever the text in the browser has been scrolled. @item @ref{FL_RETURN_END} Return or invoke callback on end of an interaction for scrolling the text in the browser regardless if the text was scrolled or not. @item @ref{FL_RETURN_ALWAYS} Return or invoke callback on selection, deselection or scrolling of text or end of scrolling. @end table The default setting for @code{when} for a browser object is @code{@ref{FL_RETURN_SELECTION}|@ref{FL_RETURN_DESELECTION}} (unless during the built of XForms you set the configuration flag @code{--enable-bwc-bs-hack} in which case the default is @code{@ref{FL_RETURN_NONE}} to keep backward compatibility with earlier releases of the library). @node Other Browser Routines @subsection Other Browser Routines There are a large number of routines to change the contents of a browser, select and de-select lines, etc. To remove all lnes from a browser use @findex fl_clear_browser() @anchor{fl_clear_browser()} @example void fl_clear_browser(FL_OBJECT *obj); @end example To add a line to a browser use one of @findex fl_add_browser_line() @anchor{fl_add_browser_line()} @findex fl_add_browser_line_f() @anchor{fl_add_browser_line_f()} @example void fl_add_browser_line(FL_OBJECT *obj, const char *text); void fl_add_browser_line_f(FL_OBJECT *obj, const char *fmt, ...); @end example The first function receives a simple string as the argument, the second one expects a format string just like for @code{printf()} etc. and followed by the appropriate number of arguments of the correct types. The line to be added may contain embedded newline characters (@code{'\n'}). These will result in the text being split up into several lines, separated at the newline characters. A second way of adding a line to the browser is to use calls of @findex fl_addto_browser() @anchor{fl_addto_browser()} @findex fl_addto_browser_f() @anchor{fl_addto_browser_f()} @example void fl_addto_browser(FL_OBJECT *obj, const char *text); @end example @noindent The difference to @code{@ref{fl_add_browser_line()}} and @code{@ref{fl_add_browser_line_f()}} is that with these calls the browser will be shifted such that the newly appended line is visible. This is useful when e.g., using the browser to display messages. Sometimes it may be more convenient to add characters to a browser without starting of a new line. To this end, the following routines exists @findex fl_addto_browser_chars() @anchor{fl_addto_browser_chars()} @findex fl_addto_browser_chars_f() @anchor{fl_addto_browser_chars_f()} @example void fl_addto_browser_chars(FL_OBJECT *obj, const char *text); void fl_addto_browser_chars_f(FL_OBJECT *obj, const char *fmt, ...); @end example @noindent These functions appends text to the last line in the browser without advancing the line counter. The to functions differ in that the first one takes a simple string argument while the second expects a format string just as for @code{printf()} etc., followed by a corresponding number of arguments. Again the text may contain embedded newline characters (@code{'\n'}). In that case, the text before the first embedded newline is appended to the last line, and everything afterwards is put onto new lines. As in the case of @code{@ref{fl_addto_browser()}} the last added line will be visible in the browser. You can also insert a line in front of a given line. All lines after it will be shifted. Note that the top line is numbered 1 (not 0). @findex fl_insert_browser_line() @anchor{fl_insert_browser_line()} @findex fl_insert_browser_line_f() @anchor{fl_insert_browser_line_f()} @example void fl_insert_browser_line(FL_OBJECT *obj, int line, const char *text); void fl_insert_browser_line_f(FL_OBJECT *obj, int line, const char *fmt, ...); @end example @noindent The first function takes a simple string argument while the second one expects a format string as used for @code{printf()} etc. and the appropriate number of arguments (of the types specified in the format string). Please note that on insertion (as well as replacements, see below) embedded newline characters don't result in the line being split up as it's done in the previous functions. Instead they will rather likely appear as strange looking characters in the text shown. The only exception is when inserting into an empty browser or after the last line, then this function works exactly as if you had called @code{@ref{fl_add_browser_line()}} or @code{@ref{fl_add_browser_line_f()}}. To delete a line (shifting the following lines) use: @findex fl_delete_browser_line() @anchor{fl_delete_browser_line()} @example void fl_delete_browser_line(FL_OBJECT *obj, int line); @end example One can also replace a line using one of @findex fl_replace_browser_line() @anchor{fl_replace_browser_line()} @findex fl_replace_browser_line_f() @anchor{fl_replace_browser_line_f()} @example void fl_replace_browser_line(FL_OBJECT *obj, int line, const char *text); void fl_replace_browser_line_f(FL_OBJECT *obj, int line, const char *fmt, ...); @end example The first one takes a simple string for the replacement text while for the second it is to be specified by a format string exactly as used in @code{printf()} etc. and the appropriate number of arguments of the types specifed in the format string. \ As in the case of @code{@ref{fl_insert_browser_line()}} and @code{@ref{fl_insert_browser_line_f()}} newline characters embedded into the replacement text don't have any special meaning, i.e., they don't result in replacement of more than a single line. Making many changes to a visible browser after another, e.g., clearing it and then adding a number of new lines, is slow because the browser is redrawn on each and every change. This can be avoided by using calls of @code{@ref{fl_freeze_form()}} and @code{@ref{fl_unfreeze_form()}}. So a piece of code that fills in a visible browser should preferably look like the following @example fl_freeze_form(browser->form); fl_clear_browser(browser); fl_add_browser_line(browser, "line 1"); fl_add_browser_line(browser, "line 2"); ... fl_unfreeze_form(brow->form); @end example @noindent where @code{browser->form} is the form that contains the browser object named @code{browser}. To obtain the contents of a particular line in the browser, use @findex fl_get_browser_line() @anchor{fl_get_browser_line()} @example const char *fl_get_browser_line(FL_OBJECT *obj, int line); @end example @noindent It returns a pointer to the text of that line, exactly as it were passed to the function that created the line. It is possible to load an entire file into a browser using @findex fl_load_browser() @anchor{fl_load_browser()} @example int fl_load_browser(FL_OBJECT *obj, const char *filename); @end example @noindent The routine returns @code{1} when file could be successfully loaded, otherwise @code{0}. If the file name is an empty string (or the file could not be opened for reading) the browser is just cleared. This routine is particularly useful when using the browser for a help facility. You can create different help files and load the needed one depending on context. The application program can select or de-select lines in the browser. To this end the following calls exist with the obvious meaning: @findex fl_select_browser_line() @anchor{fl_select_browser_line()} @findex fl_deselect_browser() @anchor{fl_deselect_browser()} @findex fl_deselect_browser_line() @anchor{fl_deselect_browser_line()} @example void fl_select_browser_line(FL_OBJECT *obj, int line); void fl_deselect_browser_line(FL_OBJECT *obj, int line); void fl_deselect_browser(FL_OBJECT *obj); @end example @noindent The last call de-selects all lines. To check whether a line is selected, use the routine @findex fl_isselected_browser_line() @anchor{fl_isselected_browser_line()} @example int fl_isselected_browser_line(FL_OBJECT *obj, int line); @end example The routine @findex fl_get_browser_maxline() @anchor{fl_get_browser_maxline()} @example int fl_get_browser_maxline(FL_OBJECT *obj); @end example @noindent returns the number of lines in the browser. For example, when the application program wants to figure out which lines in a @code{@ref{FL_MULTI_BROWSER}} are selected code similar to the following can be used: @example int total_lines = fl_get_browser_maxline(browser); for (i = 1; i <= total_lines; i++) if (fl_isselected_browser_line(browser, i)) /* Handle the selected line */ @end example Sometimes it is useful to know how many lines are visible in the browser. To this end, the following call can be used @findex fl_get_browser_screenlines() @anchor{fl_get_browser_screenlines()} @example int fl_get_browser_screenlines(FL_OBJECT *obj); @end example Please note that this count only includes lines that are shown completely in the browser, lines that are partially obscured aren't counted in. To obtain the last selection made by the user, e.g., when the browser is returned, the application program can use the routine @findex fl_get_browser() @anchor{fl_get_browser()} @example int fl_get_browser(FL_OBJECT *obj); @end example @noindent It returns the line number of the last selection being made (0 if no selection was made). When the last action was a de-selection (only for @code{@ref{FL_MULTI_BROWSER}}) the negative of the de-selected line number is returned. The following function allows to find out the (unobscured) line that is currently shown at the top of the browser: @findex fl_get_browser_topline() @anchor{fl_get_browser_topline()} @example int fl_get_browser_topline(FL_OBJECT *obj); @end example @noindent Note that the index of the top line is @code{1}, not @code{0}. A value of @code{0} is returned if the browser doesn't contain any lines. Finally, the function @findex fl_show_browser_line() @anchor{fl_show_browser_line()} @example void fl_show_browser_line(FL_OBJECT *obj, int ln); @end example @noindent shifts the browsers content so that (as far as possible) the line indexed by @code{ln} is shown at the center of the browser. It is possible to register a callback function that gets called when a line is double-clicked on. To do so, the following function is available: @findex fl_set_browser_dblclick_callback() @anchor{fl_set_browser_dblclick_callback()} @example void fl_set_browser_dblclick_callback(FL_OBJECT *obj, void (*cb)(FL_OBJECT *, long), ` long data); @end example @noindent Of course, double-click callbacks make most sense for @code{@ref{FL_HOLD_BROWSER}}s. The part if the text visible within the browser can be set programmatically in a number of ways. With the functions @findex fl_set_browser_topline() @anchor{fl_set_browser_topline()} @findex fl_set_browser_bottomline() @anchor{fl_set_browser_bottomline()} @example void fl_set_browser_topline(FL_OBJECT *obj, int line); void fl_set_browser_bottomline(FL_OBJECT *obj, int line); @end example @noindent the line shown at the top or the bottom can be set (note again that line numbers start with 1). Instead of by line number also the amount the text is scrolled in horizontal and vertical direction can be set with the functions @findex fl_set_browser_xoffset() @anchor{fl_set_browser_xoffset()} @findex fl_set_browser_rel_xoffset() @anchor{fl_set_browser_rel_xoffset()} @findex fl_set_browser_yoffset() @anchor{fl_set_browser_yoffset()} @findex fl_set_browser_rel_yoffset() @anchor{fl_set_browser_rel_yoffset()} @example void fl_set_browser_xoffset(FL_OBJECT *obj, FL_Coord xoff); void fl_set_browser_rel_xoffset(FL_OBJECT *obj, double xval); void fl_set_browser_yoffset(FL_OBJECT *obj, FL_Coord yoff); void fl_set_browser_rel_yoffset(FL_OBJECT *obj, double yval); @end example @noindent where @code{xoff} and @code{yoff} indicate how many pixels to scroll horizontally (relative to the left margin) or vertically (relative to the top of the text), while @code{xval} and @code{yval} stand for positions relative to the total width or height of all of the text and thus have to be numbers between @code{0.0} and @code{1.0}. There are also a number of functions that can be used to obtain the current amount of scrolling: @findex fl_get_browser_xoffset() @anchor{fl_get_browser_xoffset()} @findex fl_get_browser_rel_xoffset() @anchor{fl_get_browser_rel_xoffset()} @findex fl_get_browser_yoffset() @anchor{fl_get_browser_yoffset()} @findex fl_get_browser_rel_yoffset() @anchor{fl_get_browser_rel_yoffset()} @example FL_Coord fl_get_browser_xoffset(FL_OBJECT *obj); FL_Coord fl_get_browser_rel_xoffset(FL_OBJECT *obj); FL_Coord fl_get_browser_yoffset(FL_OBJECT *obj); FL_Coord fl_get_browser_rel_yoffset(FL_OBJECT *obj); @end example Finally, there's a function that tells you the vertical position of a line in pixels: @findex fl_get_browser_line_yoffset() @anchor{fl_get_browser_line_yoffset()} @example int fl_get_browser_line_yoffset(FL_OBJECT *obj, imt line); @end example @noindent The return value is just the value that would have to be passed to @code{@ref{fl_set_browser_yoffset()}} to make the line appear at the top of the browser. If the line does not exist it returns @code{-1} instead. @node Browser Attributes @subsection Browser Attributes Never use the boxtype @code{@ref{FL_NO_BOX}} for browsers. The first color argument (@code{col1}) to @code{@ref{fl_set_object_color()}} controls the color of the browser's box, the second (@code{col2}) the color of the selection. The text color is the same as the label color, @code{obj->lcol}. To set the font size used inside the browser use @findex fl_set_browser_fontsize() @anchor{fl_set_browser_fontsize()} @example void fl_set_browser_fontsize(FL_OBJECT *obj, int size); @end example To set the font style used inside the browser use @findex fl_set_browser_fontstyle() @anchor{fl_set_browser_fontstyle()} @example void fl_set_browser_fontstyle(FL_OBJECT *obj, int style); @end example @noindent @xref{Label Attributes and Fonts}, for details on font sizes and styles. It is possible to change the appearance of individual lines in the browser. Whenever a line starts with the symbol @code{'@@'} the next letter indicates the special characteristics associated with this line. The following possibilities exist at the moment: @table @code @item f Fixed width font. @item n Normal (Helvetica) font. @item t Times-Roman like font. @item b Boldface modifier. @item i Italics modifier. @item l Large (new size is @code{@ref{FL_LARGE_SIZE}}). @item m Medium (new size is @code{@ref{FL_MEDIUM_SIZE}}). @item s Small (new size is @code{@ref{FL_SMALL_SIZE}}). @item L Large (new size = current size + 6) @item M Medium (new size = current size + 4) @item S Small (new size = current size - 2). @item c Centered. @item r Right aligned. @item _ Draw underlined text. @item - An engraved separator. Text following @code{'-'} is ignored. @item C The next number indicates the color index for this line. @item N Non-selectable line (in selectable browsers). @item ' ' (a space character) Does nothing, can be used to separate between the digits specifying a color (following @code{"@@C"}, see above) and the text of a line starting with a digit. @item @@@@ Regular @code{'@@'} character. @end table The modifiers (bold and itatic) work by adding @code{@ref{FL_BOLD_STYLE}} and @code{@ref{FL_ITALIC_STYLE}} to the current active font index to look up the font in the font table (you can modify the table using @code{@ref{fl_set_font_name()}} or @code{@ref{fl_set_font_name_f()}}). More than one option can be used by putting them next to each other. For example, @code{"@@C1@@l@@f@@b@@cTitle"} will give you the red, large, bold fixed font, centered word @code{"Title"}. As you can see the font change requests accumulate and the order is important, i.e., @code{"@@f@@b@@i"} gives you a fixed bold italic font while @code{"@@b@@i@@f"} gives you a (plain) fixed font. Depending on the font size and style lines may have different heights. In some cases the character @code{'@@'} might need to be placed at the beginning of the lines without introducing the special meaning mentioned above. In this case you can use @code{"@@@@"} or change the special character to something other than @code{'@@'} using the following routine @findex fl_set_browser_specialkey() @anchor{fl_set_browser_specialkey()} @example void fl_set_browser_specialkey(FL_OBJECT *obj, int key); @end example To align different text fields on a line, tab characters (@code{'\t'}) can be embedded in the text. See @code{@ref{fl_set_tabstop()}} on how to set tabstops. There are two functions to turn the scrollbars on and off: @findex fl_set_browser_hscrollbar() @anchor{fl_set_browser_hscrollbar()} @findex fl_set_browser_vscrollbar() @anchor{fl_set_browser_vscrollbar()} @example void fl_set_browser_hscrollbar(FL_OBJECT *obj, int how); void fl_set_browser_vscrollbar(FL_OBJECT *obj, int how); @end example @noindent @code{how} can be set to the following values: @table @code @tindex FL_ON @item FL_ON Always on. @tindex FL_OFF @item FL_OFF Always off. @tindex FL_AUTO @item FL_AUTO On only when needed (i.e., there are more lines/chars than could be shown at once in the browser). @end table @noindent @code{FL_AUTO} is the default. Please note that when you switch the scrollbars off the text can't be scrolled by the user anymore at all (i.e., also not using methods that don't use scrollbars, e.g., using the cursor keys). Sometimes, it may be desirable for the application to obtain the scrollbar positions when they change (e.g., to use the scrollbars of one browser to control other browsers). There are two ways to achieve this. You can use these functions: @tindex FL_BROWSER_SCROLL_CALLBACK @findex fl_set_browser_hscroll_callback() @anchor{fl_set_browser_hscroll_callback()} @findex fl_set_browser_vscroll_callback() @anchor{fl_set_browser_vscroll_callback()} @example typedef void (*FL_BROWSER_SCROLL_CALLBACK)(FL_OBJECT *, int, void *); void fl_set_browser_hscroll_callback(FL_OBJECT *obj, FL_BROWSER_SCROLL_CALLBACK cb, void *cb_data); void fl_set_browser_vscroll_callback(FL_OBJECT *obj, FL_BROWSER_SCROLL_CALLBACK cb, void *cb_data); @end example @noindent After scroll callbacks are set whenever the scrollbar changes position the callback function is called as @example cb(ob, offset, cb_data); @end example @noindent The first argument to the callback function @code{cb} is the browser object, the second argument is the new xoffset for the horizontal scrollbar or the new top line for the vertical scrollbar. The third argument is the callback data specified as the third argument in the function calls to install the callback. To uninstall a scroll callback, use a @code{NULL} pointer as the callback function. As an alternative you could request that the browser object gets returned (or a callback invoked) when the the scrollbar positions are changed. This can be done e.g., by passing @code{@ref{FL_RETURN_CHANGED}} (if necessary @code{OR}'ed with flags for also returning on selection/deselections). Within the code for dealing with the event you could check if this is a change event by using the function @findex fl_get_object_return_state() @example int fl_get_object_return_state(FL_OBJECT *obj); @end example and test if @code{@ref{FL_RETURN_CHANGED}} is set in the return value (by just logically @code{AND}'ing both) and then handle the change. By default, the scrollbar size is based on the relation between the size of the browser and the size of the text. To change the default, use the following routine @findex fl_set_browser_scrollbarsize() @anchor{fl_set_browser_scrollbarsize()} @example void fl_set_browser_scrollbarsize(FL_OBJECT *obj, int hh, int vw); @end example @noindent where @code{hh} is the horizontal scrollbar height and @code{vw} is the vertical scrollbar width. Use 0 to indicate the default. The default scrollbar type is @code{FL_THIN_SCROLLBAR}. There are two ways you can change the default. One way is to use @code{@ref{fl_set_defaults()}} or @code{@ref{fl_set_scrollbar_type()}} to set the application wide default, another way is to use @code{@ref{fl_get_object_component()}} to get the object handle to the scrollbars and change the the object type forcibly. The first method is preferable because the user can override the setting via resources. Although the second method of changing the scrollbar type is not recommended, the object handle obtained can be useful in changing the scrollbar colors etc. Finally there is a routine that can be used to obtain the browser size in pixels for the text area @findex fl_get_browser_dimension() @anchor{fl_get_browser_dimension()} @example void fl_get_browser_dimension(FL_OBJECT *obj, FL_Coord *x, FL_Coord *y, FL_COORD *w, FL_COORD *h); @end example @noindent where @code{x} and @code{y} are measured from the top-left corner of the form (or the smallest enclosing window). To establish the relationship between the text area (a function of scrollbar size, border with and text margin), you can compare the browser size and text area size. Finally, the functions @findex fl_get_browser_scrollbar_repeat() @anchor{fl_get_browser_scrollbar_repeat()} @findex fl_set_browser_scrollbar_repeat() @anchor{fl_set_browser_scrollbar_repeat()} @example int fl_get_browser_scrollbar_repeat(FL_OBJECT *obj); void fl_set_browser_scrollbar_repeat(FL_OBJECT *obj, int millisec); @end example @noindent allows to determine and control the time delay (in milliseconds) between jumps of the scrollbar knob when the mouse button is kept pressed down on the scrollbar outside of the knobs area. The default value is @w{100 ms}. The delay for the very first jump is twice that long in order to avoid jumping to start too soon when only a single click was intended but the user is a bit slow in releasing the mouse button. @node Browser Remarks @subsection Remarks Since version 1.0.92 there isn't a limit on the maximum length of lines in a browser anymore. (The macro @code{FL_BROWSER_LINELENGTH} still exists and is set to 2048 for backward compatibility but has no function anymore). See @file{fbrowse1.c} for an example program using a @code{@ref{FL_NORMAL_BROWSER}} to view files. @file{browserall.c} shows all different browsers. @file{browserop.c} shows the insertion and deletion of lines in a @code{@ref{FL_HOLD_BROWSER}}. For the browser class, especially multi browsers, interaction via callbacks is strongly recommended. xforms-1.2.4/doc/xforms.info-30000664000175000017500000111310012353624333013060 00000000000000This is xforms.info, produced by makeinfo version 4.13 from xforms.texi. INFO-DIR-SECTION Development START-INFO-DIR-ENTRY * XForms: (xforms). A Graphical user interface toolkit for X END-INFO-DIR-ENTRY  File: xforms.info, Node: Menu Attributes, Next: Menu Remarks, Prev: Other Menu Routines, Up: Menu Object 23.2.5 Menu Attributes ---------------------- Any boxtype can be used for a menu except for those of type `FL_PULLDOWN_MENU', for which `FL_NO_BOX' should not be used. Using the functiond The first color argument (`col1') to `*note fl_set_object_color()::' controls the color of the menu's box when not open and the second (`col2') is the color when the menu is shown. To change the font style and size used in the popup menus (not the menu label), use the following routines void fl_setpup_default_fontstyle(int style); void fl_setpup_default_fontsize(int size); These settings apply to all menus at once. If desired, you can attach an external popup to a menu object via the following routine void fl_set_menu_popup(FL_OBJECT *obj, int pupID); where `pupID' is the ID returned by `*note fl_newpup()::' or `*note fl_defpup()::'. *Note XPopup::, for more details on popup creation. For a menu created this way only `*note fl_get_menu()::' and `*note fl_get_menu_text()::' work as expected. Other services such as mode setting and query etc. should be done via the popup routines. To obtain the popup ID associated with a menu, use the following routine int fl_get_menu_popup(FL_OBJECT *obj); The function returns the popup ID if the menu was created using `*note fl_set_menu_popup()::' or `*note fl_set_menu_entries()::', otherwise it returns -1. The callback associated with a menu Normally in the popup opened for a menu a title is shown. This can be switched off (and back on again by using the function fl_set_menu_notitle(FL_OBJECT *obj, int off);  File: xforms.info, Node: Menu Remarks, Prev: Menu Attributes, Up: Menu Object 23.2.6 Remarks -------------- See `menu.c' for an example of the use of menus. You can also use `FL_MENU_BUTTON' to initiate a callback and use an XPopup directly within the callback. See `pup.c' for an example of this approach.  File: xforms.info, Node: XPopup, Prev: Menu Object, Up: Part III Deprecated Objects 23.3 XPopup =========== XPopup is not really an object class, but because it is used by menu and choice objects and can function stand-alone, it is documented here. XPopups are simple transient windows that show a number of choices the user can click on to select the desired option. * Menu: * Creating XPopups: Creating XPopups * XPopup Interaction: XPopup Interaction * Other XPopup Routines: Other XPopup Routines * XPopup Attributes: XPopup Attributes * Remarks: XPopup Remarks  File: xforms.info, Node: Creating XPopups, Next: XPopup Interaction, Up: XPopup 23.3.1 Creating XPopups ----------------------- To define a new popup, use the following routines int fl_newpup(Window parent); int fl_defpup(Window parent, const char *str, ...); Both functions allocate and initialize a new popup menu and return the XPopup identifier (or -1 on failure). `*note fl_defpup()::' in addition accepts a pointer `str' to the texts for menu items (optionally also some more arguments, see below). More than one item can be specified by using a vertical bar (`|') between the items, e.g., `"foo|bar"' adds two menu items. The `parent' parameter specifies the window to which the XPopup belongs. In a situation where the XPopup is used inside an object callback `FL_ObjWin(obj)' will do. If `parent' is `None' the root window will be used. Calling `*note fl_defpup()::' with the `str' argument set to `NULL' is equivalent to calling `*note fl_newpup()::'. It is possible to specify XPopup and item properties, such as shortcuts, callbacks etc., together with the items texts using a format string system similar as used for e.g., `oprint(3)'. If XPopup or item properties require arguments, they must be passed to `*note fl_defpup()::' following the `str' argument. The following item properties are supported: `%t' Marks the item text as the XPopup title string. `%F' Binds a callback function to the XPopup as a whole that is called for every selection made from this XPopup. You must specify the function to be invoked in the parameters following `str'. The value of the selected item is passed as the only argument to the invoked callback function. The callback function must return a non-negative integer. If such a callback function has been registered for a XPopup and you select its third item, in the simplest case 3 will be passed as a parameter to the callback function (more complicated situations would involve that the item had been assigned a different value. e.g., using `%x', see below, or that there's also a callback bound to the item itself, in which case the global XPopup callback would receive the return value of the items callback function). `%f' Binds a callback to this particular item which is invoked if the item is selected. The routine must be supplied in the parameters following `str'. It has to return a non-negative integer. The value of the selected item is passed as a parameter to this function. If you have also bound the entire XPopup to a callback function via `%F', then the function specified via `%f' is called first with the items value and its return value (if larger then `0' is then passed as the parameter to to the function bound to the whole XPopup (as set via `%F'). `%i' Disables and greys-out the item. `%d' can be used instead of `%i'. `%l' Adds a line under the current entry. This is useful in providing visual clues to groups of entries `%m' Whenever this item is selected another (already defined) XPopup is bound to the item so that the sub-XPopup is opened when the user moves the mouse onto the item, This can be used to create cascading menus. The identifier of the sub-XPopup to be shown must be provided in the arguments following `str'. It is the programmers responsibility to make sure that the item values of the sub-XPopup don't clash with those of the higher-level XPopup or it may be impossible to determine which item was selected. `%h' Specify a "hotkeys" that can be used to select this item. Hotkeys must be given in the arguments following `str' as a pointer to a string. Use `#' to specify that a key must be pressed together with the `' key, `^' for simultaneous pressing of `' and `&n' for the function key `Fn'. `%s' can be used instead of `%h'. `%xn' Assigns a numerical value to this item. This value must be positive. This new value overrides the default position-based value assigned to this item. Different from most other flags, the value `n' must be entered as part of the text string (i.e., do not try to use the arguments following `str' to specify this value!) and must be number larger than 0. It is the programmers responsibility to make sure that the items value does not clash with those of other items of the XPopup or determining which item was selected may be impossible. `%b' Indicates this item is "binary item" (toggle), currently in off state. When displayed, binary items will be drawn with a small box to the left. See also `FL_PUP_BOX'. `%B' Same as `%b' except that it also signifies that this item is in on or "true" state and consequently is drawn with a checked box on the left. See also `FL_PUP_BOX | FL_PUP_CHECK'. `%rg' Specifies this menu item is a "radio item" belonging to group with number `g', currently not being selected. The group number `g', that must be part of the string directly following `%r' (and not specified via the arguments following the string), must be a non-zero, positive number. Radio items are drawn with a small diamond box to the left (empty while not active). See also `FL_PUP_RADIO'. `%Rg' Same as `%rg' except that it also sets the state of the radio item as selected or "pushed", the item is drawn with a filled diamond box to the left. See also `*note fl_setpup_selection()::'. See also `FL_PUP_RADIO | FL_PUP_CHECK'. `%%' Use this if you need a `%' character in the string. `H (`\010')' Same as `%l' except that the character must precede the item label, i.e., use `"\010Abc"' and not `"Abc\010"'. Due to the use of variable arguments error checking can only be minimal. Also note that if `%x' is used to specify a value that happens to be identical to a position-based value, the result is unpredictable when subsequent references to these items are made. There is currently a limit of `FL_MAXPUPI' (64) items per popup. Tabs characters (`'\t'') can be embedded in the item string to align different fields. You can add more items to an existing XPopup using the following routine int fl_addtopup(int popup_id, const char *str, ...); where `popup_id' is the value returned by `*note fl_newpup()::' or `*note fl_defpup()::' for the XPopup. Again, `str' can contain information for one or more new items, including the special sequences described earlier. The function returns -1 if invalid arguments are detected (as far as possible for a function with a variable number of arguments). To display a popup, use int fl_dopup(int popup_id); This function displays the specified XPopup until the user makes a selection or clicks somewhere outside of the XPopups box. The value returned is the value of the item selected or -1 if no item (or a disabled one) was selected. However, if there is a function bound to the XPopup as a whole or to the selected item itself, this function is invoked with the item value as the argument and the value returned by `*note fl_dopup()::' is then the return value of this function. If a callback function for both the selected item and the XPopup as a whole exists, the callback function for the item is called first with the item value as the argument and then the return value of this item specific callback function is passed to the XPopups callback function. `*note fl_dopup()::' then finally returns the return value of this second function call. Normally a XPopup get opened when the left mouse button has been pressed down and get closed again when the left mouse button is released. But there are a number of ways to achieve a "hanging" XPopup, i.e., that the XPopup that says open, even though the left mouse button isn't pressed down anymore. This happens e.g., when the user releases the mouse button in the title area of the XPopup or when the XPopup was opened via a keyboard shortcut. In that case it's also possible to navigate through the items and select via the keyboard. A typical procedure may look as follows: int item3_cb(int n) { return n + 7; } /* define the menu */ int menu = fl_newpup(parent); fl_addtopup(menu, "Title %t|Item1%rg1|Item2%Rg1|Item3%x10%f|Item4", item3_cb); switch (fl_dopup(menu)) { case 1: /* item1 is selected */ /* handle it */ break; case 2: /* handle it */ break; case 4: /* handle it */ case 17: /* item 3 call back has been executed */ } Here callback function `item3_cb()' is bound to the third item and this item has been assigned the number 10. Thus, when it is selected `*note fl_dopup()::' does not return 3 or 10. Instead the callback function `item3_cb()' is invoked with 10 as its argument. And this function in turn returns `10 + 7', which is the value `*note fl_dopup()::' finally returns. Note also that items 1 and 2 both are radio items, belonging to the same group (numbered 1). Item 2 is currently the active item of this group. Sometimes it might be necessary to obtain the popup ID inside an item callback function. To this end, the following function available: int fl_current_pup(void); If no popup is active, the function returns -1. Until all callback functions have been run the function returns the ID of the XPopup the items belong to. To destroy a popup menu and release all memory used, use the following routine void fl_freepup(int popup_id); For most applications, the following simplified API may be easier to use void fl_setpup_entries(int popup_id, FL_PUP_ENTRIES *entries); where `popup_id' is the popup ID returned by `*note fl_newpup()::' or `*note fl_defpup()::' and `entries' is an array of the following structures typedef struct { const char * item_text; /* item text label */ FL_PUP_CB callback; /* item callback routine */ const char * shortcut; /* shortcut for this item */ unsigned int mode; /* item mode */ } FL_PUP_ENTRY; The meaning of each member of the structure is as follows: `text' This is the text of a XPopup item. If text is `NULL', it signifies the end of this popup menu. The first letter of the text string may have a special meaning if it is one of the following: `'/'' This indicates the beginning of a sub-popup, starting with the next item and ending with the next item with `text' being `NULL'. `'_'' Indicates that a line should be drawn below this item (typically as a visual reminder of logical groupings of items). `callback' This is the callback function that will be called when this particular item is selected by the user. `*note fl_dopup()::' returns the value returned by this callback. If the callback is `NULL', the item number will be returned directly by `*note fl_dopup()::'. `shortcut' Specifies the keyboard shortcut. `mode' Specifies special attributes of this item. This can be one or a combination by bitwise OR of one of the following: `FL PUP NONE' No special characteristics, the default. `FL_PUP_GREY' Item is greyed-out an can't be selected. Trying to select it results in `*note fl_dopup()::' returning -1. `FL_PUP_BOX' "Binary item", drawn with a little box to its left. `FL_PUP_RADIO' "Radio item", drawn with a little diamond-shaped box to its left. All radio items of the XPopup belong to the same group. `FL_PUP_CHECK' OR this value with `FL_PUP_BOX' or `FL_PUP_RADIO' to have the box to the left drawn as checked or pushed. With this simplified API, popup item values start from 1 and are the index in the entries array for the item plus 1. For example, the third element (with index 2) of the array of structure has an item value of 3. Please note that also elements of the array that end a submenu and thus don't appear as visible items in the XPopup get counted. This way, the application can relate the value returned by fl_dopup() to the array easily. See demo program `popup.c' for an example use of the API. To illustrate the usage of `*note fl_setpup_entries()::', Fig 21.2 shows the popup created with the array of structures defined in the following code example: FL_PUP_ENTRY entries[ ] = { {"Top item1", callback}, /* item number 1 */ {"Top item2", callback}, {"Top item3", callback}, {"/Top item4", callback}, {"Sub1 item1", callback}, /* item number 5 */ {"Sub1 item2", callback}, {"Sub1 item3", callback}, {"Sub1 item4", callback}, {"/Sub1 item5", callback}, {"Sub2 item1", callback}, /* item number 10 */ {"Sub2 item2", callback}, {"Sub2 item3", callback}, {NULL, NULL }, /* end of level2, item number 13 */ {NULL, NULL }, /* end of sublevel1, item nuber 14 */ {"Top item5", callback}, /* item number 15 */ {NULL, NULL } /* end of popup */ };  File: xforms.info, Node: XPopup Interaction, Next: Other XPopup Routines, Prev: Creating XPopups, Up: XPopup 23.3.2 XPopup Interaction ------------------------- To select an item, move the mouse to the item to be selected while keeping the mouse button pressed down and then release the mouse button on top of the item to be selected. If you don't want to make a selection release the mouse button somewhere outside the area of the XPopup. If you have a "hanging" XPopup, i.e., a XPopup that's open even though the mouse button isn't pressed anymore you can select by clicking on an item or use the cursor `Up' and `Down' keys to navigate through the items and select by pressing the `' key. The `' and `' keys allow you to jump to the first or last selectable item, respectively. Use `' to close the popup without selecting an item. It is also possible to use convenience functions to bind keyboard keys to items (the "hotkeys") instead of using `%s' with `*note fl_defpup()::': void fl_setpup_shortcut(int popup_id, int item_val, const char *hotkeys); where `item_val' is the value associated with the item (either due to its position or set with `%x') and hotkeys is a string specifying all the hotkey combinations. *Note Shortcuts::, for details. Briefly, within that string `#' and `^' denote the `' and `' keys, respectively. `&n' with `n = 1, 2' etc. can be used to denote the function key numbered `n'. Thus if hotkeys is set to `"#a^A', both `A' and `A' are bound to the item. One additional property of the hotkey is the underlining of corresponding letters in the item string. Again, only the first key in the hotkey string is used. Therefore, the hotkey strings `"Cc"', `"#C"' and `"^C"' will result in the character `C' in the item string `"A Choice"' being underlined, while the the hotkey strings `"cC"' and `"#c"' will not since there's no `c' in the item string. There is a limit of maximum 8 shortcut keys. Two convenience functions are available to set the callback functions for items of a XPopup and the XPopup as a whole (called whenever a selection is made): typedef int (*FL_PUP_CB)(int); FL_PUP_CB fl_setpup_itemcb(int popup_id, int item_val, FL_PUP_CB cb); FL_PUP_CB fl_setpup_menucb(int popup_id, FL_PUP_CB cb); These functions thus allow to change the popup and item callback functions set at creation of the popup with `%F' and `%f'. As usual, `popup_id' is the ID of the XPopup, `item_val' the value associated with the item (position or value set via `%x'), and `cb' is the address of the callback function. Please note that Xpopup objects are a bit special in XForms. Normal objects get returned by e.g., `*note fl_do_forms()::' (or an associated callback gets invoked). But since Xpopup objects are meant to be sub-objects of other objects (like `FL_CHOICE' and `L_MENU' objects) and don't get invoked directly by a call of e.g., `*note fl_do_forms()::' but instead by a call of `*note fl_dopup()::' they can't get returned to the application. Instead the caller of `*note fl_dopup()::' (normally some internal function of a `FL_CHOICE' or `FL_MENU' object) has to deal with the return value. Furthermore, also callback functions can be set that get invoked whenever an item in the XPopup is entered or left, even without a selection being made. The following functions can be used to register these item enter/leave callbacks: typedef void (*FL_PUP_ENTERCB)(int item_val, void *data); typedef void (*FL_PUP_LEAVECB)(int item_val, void *data); FL_PUP_ENTERCB fl_setpup_entercb(int popup_id, FL_PUP_ENTERCB cb, void *data); FL_PUP_LEAVECB fl_setpup_leavecb(int popup_id, FL_PUP_LEAVECB cb, void *data); The function `cb' will be called when the mouse enters or leaves an (non-disabled) item of the XPopup `popup_id'. Two parameters are passed to the callback function. The first parameter is the item number enter/leave applies to and the second parameter is a data pointer. To remove an enter/leave callback, call the functions with the callback function argument `cb' set to `NULL'. There is also a function to associate a XPopup item with a sub-XPopup void fl_setpup_submenu(int popup_id, int item_val, int subpopup_id); If a sub-XPopup is associated with item `item_val' that item can't be selected anymore (releasing the mouse button on this item makes `*note fl_dopup()::' return -1 but instead a new XPopup is opened beside the item and you can now make selections within this sub-XPopup. It is the programmers responsibility to make sure that the item values of the sub-XPopup don't clash with those of the higher-level XPopup or it may be impossible to determine which item was selected.  File: xforms.info, Node: Other XPopup Routines, Next: XPopup Attributes, Prev: XPopup Interaction, Up: XPopup 23.3.3 Other XPopup Routines ---------------------------- Note that most of the setpup/getpup routines are recursive in nature and the function will search the menu and all its submenus for the item. It is possible to modify the display characteristics of a given XPopup item after its creation using the following routine void fl_setpup_mode(int popup_id, int item_val, unsigned mode); As usual `popup_id' is the XPopup ID as returned by `*note fl_newpup()::' or `*note fl_defpup()::' and `item_val' the value of the item. `mode' is one of `FL PUP NONE', `FL PUP GREY', `FL PUP BOX' or `FL PUP RADIO' (one of the later two can be bitwise ORed with `FL_PUP_CHECK', as already discussed above. To obtain the mode of a particular menu item, use the following routine unsigned int fl_getpup_mode(int popup_id, int item_val) This comes in handy to check if a binary or radio item is set if (fl_getpup_mode(popupd, item_val) & FL_PUP_CHECK) /* item is set */ There exists also a routine that can be used to obtain an items text const char *fl_getpup_text(int popup_id, int item_val); In some situations, especially when the popup is activated by non-pointer events (e.g., as a result of a keyboard shortcut), the default placement of popups based on mouse location might not be adequate or appropriate, thus XPopup provides the following routine to override the default placement void fl_setpup_position(int x, int y); where `x' and `y' specify the location where the top-left corner of the popup should be. `x' and `y' must be given in screen coordinates (i.e., relative to the root window) with the origin at the top-left corner of the screen. This routine should be used immediately before invoking `*note fl_dopup()::', the position is not remembered afterwards. If `x' or `y' is negative, the absolute value is taken to mean the desired location relative to the right or bottom corner of the popup (not the screen!). Another function exists for controlling the positon of the popup. When the fuunction void fl_setpup_align_bottom(void); then the pop-up will appear with its lower right hand corner aligned aligned with the mouse position or, if also `*note fl_setpup_position()::' is active, the postion set this way will be interpreted to mean the lower right hand position of the popu-up. A radio item in a group can be initialized to be in "pushed" state by using `%R'. But you can also switch a such a radio item to "pushed state also programmatically using void fl_setpup_selection(int popup_id, int item_val); Of course, other radio items of the XPopup belonging to the same group are reset to "unpushed" state. To obtain the number of items in a popup, use the following routine int fl_getpup_items(int popup_id)  File: xforms.info, Node: XPopup Attributes, Next: XPopup Remarks, Prev: Other XPopup Routines, Up: XPopup 23.3.4 XPopup Attributes ------------------------ The title of a XPopup can be set using the functions void fl_setpup_title(int popup_id, const char *title); void fl_setpup_title_f(int popup_id, const char *fmt, ...); They only differ in the way the new title is passed to the function, the first one accepts a simple string while the second expects a format string as used for `printf()' etc., followed by the appropriate number of (unspecified) arguments. Use the following routines to modify the default popup font style, font size and border width: int fl_setpup_default_fontsize(int size); int fl_setpup_default_fontstyle(int style); int fl_setpup_default_bw(int bw); The functions return the old size, style or border width value, respectively. All XPopups by default use a right arrow cursor. To change the default cursor, use Cursor fl_setpup_default_cursor(int cursor); where you can use for `cursor' any of the standard cursors defined in `' like `XC_watch' etc. The function returns the previously cursor. To change the cursor of a particular XPopup only , use the following routine Cursor fl_setpup_cursor(int popup_id, int cursor); For example, after the following sequence, id = fl_defpup(win, "item1|item2"); fl_setpup_cursor(id, XC_hand2); the popup with ID `id' will use a "hand" instead of the default arrow cursor. In versions before 1.0.91 XPopups were drawn with a heavy shadow around the box. Drawing of this shadow could be controlled via void fl_setpup_shadow(int popup_id, int yes_no); Nowadays this function still exists for backward-compatibility but does nothing. The appearance of XPopups (and their associated sub-popups) can be change by the following routines: void fl_setpup_bw(int popup_id, int bw); void fl_setpup_softedge(int pupup_id, int yes_no); The first sets the border width for a XPopup. Calling `*note fl_setpup_softedge()::' with a true argument for `yes_no' has the same effect as using a negative border width while using a false (0) argument is equivalent to using a positive one (so this function isn't very useful). The background color and text color of a popup can be changed using void fl_setpup_default_color(FL_COLOR bgcolor, FL_COLOR tcolor); By default, the background color `bgcolor' is `FL_COL1' and the text color `tcolor' is `FL_BLACK'. For "binary" or radio items, that have check box associated with them, the "checked" or "pushed" color (default is `FL_BLUE') can be changed with the following routine void fl_setpup_default_checkcolor(FL_COLOR checkcolor); There is by default a limit of 32 XPopups per process. To enlarge the number of XPopups allowed, use the following routine int fl_setpup_maxpups(int new_max); The function returns the previous limit. It is possible to use XPopups as a message facility using the following routines void fl_showpup(int popup_id); void fl_hidepup(int popup_id); No interaction takes place with a XPopup shown by `*note fl_showpup()::' and it can only be removed from the screen programmatically via `*note fl_hidepup()::'.  File: xforms.info, Node: XPopup Remarks, Prev: XPopup Attributes, Up: XPopup 23.3.5 Remarks -------------- Take care to make sure all items, including the items on submenus, of a XPopup have unique values and are positive. XPopups are used indirectly in the demo programs `menu.c', `boxtype.c', `choice.c' and others. For a direct pop-up demo see `popup.c'.  File: xforms.info, Node: Part IV, Next: Part IV Introduction, Prev: Part III Deprecated Objects, Up: Top _Part IV - Designing Object Classes_ ************************************ * Menu: * Part IV Introduction:: * Part IV Global Structure:: * Part IV Events:: * Part IV The Type FL_OBJECT:: * Part IV Drawing Objects:: * Part IV An Example:: * Part IV New Buttons:: * Part IV Using a Pre-emptive Handler::  File: xforms.info, Node: Part IV Introduction, Next: Part IV Global Structure, Prev: Part IV, Up: Top 24 Introduction *************** Earlier chapters discussed ways to build user interfaces by combining suitable objects from the Forms Library, defining a few object callbacks and using Xlib functions. However, there is always a possibility that the built-in objects of the Forms Library might not be enough. Although free objects in principle provide all the flexibility a programmer needs, there can be situations where it is beneficial to create new types of objects, for example switches or joysticks or other types of sliders, etc. In these cases, a programmer can use the architecture defined by the Forms Library to create a new object class that will work smoothly with the built-in or user-created object classes. Creating such new object classes and adding them to the library is simpler than it sounds. In fact it is almost the same as making a free object. This part gives you all the details of how to add new classes. In chapter 24 a global architectural overview is given of how the Forms Library works and how it communicates with the different object classes by means of events (messages). Chapter 25 describes in detail what type of events objects can receive and how they should react to them. Chapter 26 describes in detail the structure of the type `FL_OBJECT' which plays a crucial role, a role equivalent to a superclass (thus all other object classes have `FL_OBJECT' as their parent class) in object-oriented programming. One of the important aspects of an object is how to draw it on the screen. Chapter 27 gives all the details on drawing objects. The Forms Library contains a large number of routines that help you draw objects. In this chapter an overview is given of all of them. Chapter 28 gives an example illustrating on how to create a new object class. Due to the importance of button classes, special routines are provided by the Forms Library to facilitate the creation of this particular class of objects. Chapter 29 illustrates by two examples the procedures of creating new button classes using the special services. One of the examples is taken from the Forms Library itself and the other offers actual usability. Sometimes it might be desirable to alter the behavior of a built-in class slightly. Obviously a full-blown (re)implementation from scratch of the original object class is not warranted. Chapter 30.1 discusses the possibilities of using the pre-emptive handler of an object to implement derived objects.  File: xforms.info, Node: Part IV Global Structure, Next: Part IV Events, Prev: Part IV Introduction, Up: Top 25 Global Structure ******************* The Forms Library defines the basic architecture of an object class. This architecture allows different object classes developed by different programmers to work together without complications. The Forms Library consists of a main module and a number of object class modules. The object class modules are completely independent from the main module. So new object class modules can be added without any change (nor recompilation) of the main module. The main module takes care of all the global bookkeeping and the handling of events. The object class modules have to take care of all the object specific aspects, like drawing the object, reacting to particular types of user actions, etc. For each class there exists a file that contains the object class module. For example, there are files `slider.c', `box.c', `text.c', `button.c', etc. The main module communicates with the object class modules by means of events (messages if you prefer). Each object has to have a handle routine known to the main module so that it can be called whenever something needs to be done. One of the arguments passed to the handle routine is the type of event, e.g., `FL_DRAW', indicating that the object needs to be redrawn. Each object class consists of two components. One component, both its data and functions, is common to all object classes in the Forms Library. The other component is specific to the object class in question and is typically opaque. So for typical object classes, there should be routines provided by the object class to manipulate the object class specific data. Since C lacks inheritance as a language construct, inheritance is implemented in the Forms Library by pointers and the global function `*note fl_make_object()::'(1). It is helpful to understand the global architecture and the object-oriented approach of the Forms Library, it makes reading the C code easier and also adds perspective on why some of the things are implemented the way they are. In this chapter it is assumed that we want to create a new class with the name `NEW'. Creating a new object class mainly consists of writing the handle routine. There also should be a routine that adds an object of the new class to a form and associates the handle routine to it. This routine should have the following basic form: FL_OBJECT *fl_add_NEW(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); This routine must add an object of class `NEW' to the current form. It receives the parameters `type', indicating the type of the object within the class (see below), `x', `y', `w', and `h', indicating the bounding box of the object in the current active units (mm, point or pixels), and `label' which is the label of the object. This is the routine the programmer uses to add an object of class `NEW' to a form. See below for the precise actions this routine should take. One of the tasks of `fl_add_NEW()' is to bind the event handling routine to the object. For this it will need a routine: static int handle_NEW(FL_OBJECT *obj, int event, FL_Coord mx, FL_Coord my, int key, void *xev); This routine is the same as the handle routine for free objects and should handle particular events for the object. `mx' and `my' contain the current mouse position and `key' the key that was pressed (if this information is related to the event). *Note Events: Part IV Events, for the types of events and the actions that should be taken. `xev' is the XEvent that caused the invocation of the handler. Note that some of the events may have a `NULL' `xev' parameter, so `xev' should be checked before dereferencing it. The routine should return whether the status of the object is changed, i.e., whether the event dispatcher should invoke this object's callback or, if no callback is set for the object, whether the object is to be returned to the application program by `*note fl_do_forms()::' or `*note fl_check_forms()::'. What constitutes a status change is obviously dependent on the specific object class and possibly its types within this class. For example, a mouse push on a radio button is considered a status change while it is not for a normal button where a status change occurs on release. Moreover, most classes have a number of other routines to change settings of the object or get information about it. In particular the following two routines often exist: void fl_set_NEW(FL_OBJECT *obj, ...); that sets particular values for the object and fl_get_NEW(FL_OBJECT *obj, ...); that returns some particular information about the object. See e.g., the routines `*note fl_set_button()::' and `*note fl_get_button()::'. * Menu: * The Routine fl_add_NEW():: ---------- Footnotes ---------- (1) There are other ways to simulate inheritance, such as including a pointer to generic objects as part of the instance specific data.  File: xforms.info, Node: The Routine fl_add_NEW(), Up: Part IV Global Structure 25.1 The Routine `fl_add_NEW()' =============================== `fl_add_NEW()' has to add a new object to the form and bind its handle routine to it. To make it consistent with other object classes and also more flexible, there should in fact be two routines: `fl_create_NEW()' that creates the object and `fl_add_NEW()' that actually adds it to the form. They normally look as follows: typedef struct { /* instance specific record */ } SPEC; FL_OBJECT *fl_create_NEW(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) { FL_OBJECT *obj; /* create a generic object */ obj = fl_make_object(FL_COLBOX, type, x, y, w, h, label, handle_NEW); /* fill in defaults */ obj->boxtype = FL_UP_BOX; /* allocate instance-specific storage and fill it with defaults */ obj->spec_size = sizeof SPEC; obj->spec = fl_calloc(1, obj->spec_size); return obj; } The constant `FL_NEW' will indicate the object class. It should be an integer. The numbers 0 to `FL_USER_CLASS_START - 1' (1000) and `FL_BEGIN_GROUP' (10000) and higher are reserved for the system and should not be used. Also it is preferable to use `fl_malloc()', `fl_calloc()', `fl_realloc()' and `fl_free()' to allocate/free the memory for the instance specific structures. These routines have the same prototypes and work the same way as those in the standard library and may offer additional debugging capabilities in future versions of the Forms Library. Also note that these functions are actually function pointers, and if desired, the application is free to assign these pointers to its own memory allocation routines. There's also a version equivalent to the `strdup()' POSIX function which used `*note fl_malloc()::': char * fl_strdup(const char *s); The object pointer returned by `*note fl_make_object()::' will have all of its fields set to some defaults (*note The Type `FL_OBJECT': Part IV The Type FL_OBJECT.). In other words, the newly created object inherits many attributes of a generic one. Any class specific defaults that are different from the generic one can be changed after `*note fl_make_object()::'. Conversion of units, if different from the default pixel, is performed within `*note fl_make_object()::' and a class module never needs to know what the prevailing unit is. After the object is created, it has to be added to a form: FL_OBJECT *fl_add_NEW(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) { FL_OBJECT *obj; obj = fl_create_NEW(type, x, y, w, h, label); fl_add_object(fl_current_form, obj); return obj; }  File: xforms.info, Node: Part IV Events, Next: Part IV The Type FL_OBJECT, Prev: Part IV Global Structure, Up: Top 26 Events ********* As indicated above, the main module of the Forms Library communicates with the objects by calling the associated handling routine with, as one of the arguments, the particular event for which action must be taken. In the following we assume that `obj' is the object to which the event is sent. The following types of events can be sent to an object: `FL_DRAW' The object has to be (re)drawn. To figure out the actual size of the object you can use the fields `obj->x', `obj->y', `obj->w' and `obj->h'. Many Xlib drawing routines require a window ID, which you can obtain from the object pointer using `FL_ObjWin(obj)'. Some other aspects might also influence the way the object has to be drawn. E.g., you might want to draw the object differently when the mouse is on top of it or when the mouse is pressed on it. This can be figured out the following way: The field `obj->belowmouse' tells you whether the object is below the mouse. The field `obj->pushed' indicates whether the object is currently being pushed with the mouse. Finally, `obj->focus' indicate whether input focus is directed towards this object. Note that drawing of the object is the full responsibility of the object class, including the bounding box and the label, which can be found in the field `obj->label'. The Forms Library provides a large number of routines to help you draw object. *Note Drawing Objects: Part IV Drawing Objects, for more details on drawing objects and an overview of all available routines. One important caution about your draw event handling code: none of the high level routines (`*note fl_freeze_form()::', `*note fl_deactivate_form()::') etc. can be used. The only routines allowed to be used are (direct) drawing functions and object internal book keeping routines. Attribute modifying routines, such as `*note fl_set_object_color()::' etc. are not allowed (using them can lead to infinite recursions). In addition, (re)drawing of other objects using `*note fl_redraw_object()::' while handling `*note FL_DRAW::' will also not work. Due to the way double buffering is handled, at the time the `FL_DRAW' event is passed to the handling function (and only then) `FL_ObjWin(obj)' might return a pixmap used as the backbuffer (at least if the object is double buffered). What that means is that `FL_ObjWin(obj)' should not be used when a real window is needed. For a real window you can change the window's cursor or query the mouse position within it. You can't do either of these with the backbuffer pixmap. If there is a need to obtain the real window ID the following routine can be used: Window fl_get_real_object_window(FL_OBJECT *) To summarize: use `FL_ObjWin(obj)' when drawing and use `*note fl_get_real_object_window()::' for cursor or pointer routines. This distinction is important only while handling `FL_DRAW' events, `FL_ObjWin(obj)' should be used anywhere else. `FL_DRAWLABEL' This event typically follows `FL_DRAW' and indicates that the object label needs to be (re)drawn. If the object in question always draws its label inside the bounding box and this is taken care of by handing `FL_DRAW', you can ignore this event. `FL_ENTER' This event is sent when the mouse has entered the bounding box and might require some action. Note also that the field `obj->belowmouse' in the object is being set. If entering an objects area only changes its appearance, redrawing it normally suffices. Don't do this directly! Always redraw the object by calling `*note fl_redraw_object()::'. It will send an `FL_DRAW' event to the object but also does some other things (like setting window IDs and taking care of double buffering etc.). `FL_LEAVE' The mouse has left the bounding box. Again, normally a redraw is enough (or nothing at all). `FL_MOTION' Motion events get sent between `FL_ENTER' and `FL_LEAVE' events when the mouse position changes on the object. The mouse position is given as an argument to the handle routine. `FL_PUSH' The user has pushed a mouse button on the object. Normally this requires some actual action. The number of the mouse button pushed is given in the `key' parameter, having one of the following values: `FL_LEFT_MOUSE, FL_MBUTTON1' Left mouse button was pressed. `FL_MIDDLE_MOUSE, FL_MBUTTON2' Middle mouse button was pressed. `FL_RIGHT_MOUSE, FL_MBUTTON3' Right mouse button was pressed. `FL_SCROLLUP_MOUSE, FL_MBUTTON4' Mouse scroll wheel was rotated in up direction. `FL_SCROLLDOWN_MOUSE, FL_MBUTTON5' Mouse scroll wheel was rotated in down direction. `FL_RELEASE' The user has released the mouse button. This event is only sent if a `*note FL_PUSH::' event was sent before. `*note FL_PUSH::' event. `FL_DBLCLICK' The user has pushed a mouse button twice within a certain time limit (`FL_CLICK_TIMEOUT'), which by default is 400 msec. This event is sent after two `FL_PUSH', `FL_RELEASE' sequence. Note that `FL_DBLCLICK' is only generated for objects that have non-zero `obj->click timeout' fields and it will not be generated for events from the scroll wheel. `FL_TRPLCLICK' The user has pushed a mouse button three times within a certain time window. This event is sent after a `*note FL_DBLCLICK::', `*note FL_PUSH::', `*note FL_RELEASE::' sequence. Set click timeout to none-zero to activate `FL_TRPLCLICK'. `FL_FOCUS' Input got focussed to this object. This type of event and the next two are only sent to objects for which the field `obj->input' is set to 1 (see below). `FL_UNFOCUS' Input is no longer focussed on the object. `FL_KEYPRESS' A key was pressed. The ASCII value (or KeySym if non-ASCII) is passed to the routine via the `key' argument, modifier keys can be retrieved from the `state' member of the XEvent also passed to the function via `xev'. This event only happens between `*note FL_FOCUS::' and `*note FL_UNFOCUS::' events. Not all objects are sent keyboard events, only those that have non-zero value in field `obj->input' or `obj->wantkey'. `FL_SHORTCUT' The user used a keyboard shortcut. The shortcut used is given in the parameter key. See below for more on shortcuts. `FL_STEP' A `FL_STEP' event is sent all the time (typically about 20 times a second but possibly less often because of system delays and other time-consuming tasks) to objects for which the field `obj->automatic' has been set to a non-zero value. The handling routine receives a synthetic `MotionNotify' event as the XEvent. This can be used to make an object change appearance without user action. Clock and timer objects use this type of event. `FL_UPDATE' An `FL_UPDATE' event, like the `*note FL_STEP::' event, also gets send about every 50 msec (but less often under high load) to objects while they are "pushed", i.e., between receiving a `*note FL_PUSH::' and a `*note FL_RELEASE::' event if their `obj->want_update' field is set. Like for the `FL_STEP' event the handling routine receives a synthetic `MotionNotify' event as the XEvent. This is typically used by objects that have to perform tasks at regular time intervals while they are "pushed" (e.g., counters that need to count up or down while the mouse is pushed on one of its buttons). `FL_ATTRIB' An `FL_ATTRIB' event is sent to an object (via calling the handler function each object type must define for this purpose) whenever one of it's properties changes, be it its size, position, box type, border width, colors, label, label color, style or alignment etc. This can e.g., be used by the object to do preparations for later drawing of it or check that what got set is reasonable. It should not use this event to actually draw anything (this is to be done only when an `*note FL_DRAW::' event is received). When the handler function for events is called all the arguments it gets passed are `0'. `FL_FREEMEM' This event is sent when the object is to be freed. All memory allocated for the object internally must be freed when this event is received. `FL_OTHER' Events other than the above. These events currently include ClientMessage, Selection and possibly other window manager events. All information about the event is contained in `xev' parameter and `mx' and `my' may or may not reflect the actual position of the mouse. Many of these events might make it necessary that the object has to be redrawn or partially redrawn. Always do this using the routine `*note fl_redraw_object()::'. * Menu: * Shortcuts::  File: xforms.info, Node: Shortcuts, Up: Part IV Events 26.1 Shortcuts ============== The Forms Library has a mechanism of dealing with keyboard shortcuts. In this way the user can use the keyboard rather than the mouse for particular actions. Obviously, only "active" objects can have shortcuts (i.e., not objects like boxes, texts etc.). The mechanism works as follows. There is a routine void fl_set_object_shortcut(FL_OBJECT *obj, const char *str, int showit); with which one can bind a series of keys to an object. E.g., when `str' is `"acE#d^h"' the keys `'a'', `'c'', `'E'', `d' and `h' are associated with the object. The precise format is as follows: Any character in the string is considered as a shortcut, except `'^'' and `'#'', which stand for combinations with the `' and `' keys. (The case of the key following `'#'' or `'^'' is not important, i.e., no distiction is made between e.g., `"^C"' and `"^c"', both encode the key combination `C' as well as `C'.) The key `'^'' itself can be set as a shortcut key by using `"^^"' in the string defining the shortcut. The key `'#'' can be obtained as a shortcut by using th string `"^#"'. So, e.g., `"#^#"' encodes `#'. The `' key can be given as `"^["'. Another special character not mentioned yet is `'&'', which indicates function and arrow keys. Use a sequence starting with `'&'' and directly followed by a number between 1 and 35 to represent one of the function keys. For example, `"&2"' stands for the `' function key. The four cursors keys (up, down, right, and left) can be given as `"&A"', `"&B"', `"&C"' and `"&D"', respectively. The key `'&'' itself can be obtained as a shortcut by prefixing it with `'^''. The argument `showit' tells whether the shortcut letter in the object label should be underlined if a match exists. Although the entire object label is searched for matches, only the first alphanumerical character in the shortcut string is used. E.g., for the object label `"foobar"' the shortcut `"oO"' would result in a match at the first `o' in `"foobar"' while `"Oo"' would not. However, `"^O"' and `"#O"' would match since for keys used in combination with `' and `' no distiction is made between upper and lower case. To use other special keys not described above as shortcuts, the following routine must be used void fl_set_object_shortcutkey(FL_OBJECT *obj, unsigned int key); where `key' is an X KeySym, for example `XK_Home', `XK_F1' etc. Note that the function `*note fl_set_object_shortcutkey()::' always appends the key specified to the current shortcuts while `*note fl_set_object_shortcut()::' resets the shortcuts. Of course, special keys can't be underlined. Now, whenever the user presses one of these keys, an `*note FL_SHORTCUT::' event is sent to the object. The key pressed is passed to the handle routine (in the argument `key'). Combinations with the `' key are given by adding `*note FL_ALT_MASK::' (currently the 25th bit, i.e., `0x1000000') to the ASCII value of the key. E.g., the key combinations `E' and `e' are passed as `*note FL_ALT_MASK:: + 'E''. The object can now take action accordingly. If you use shortcuts to manipulate class object specific things, you will need to create a routine to communicate with the user, e.g., `fl_set_NEW_shortcut()', and do your own internal bookkeeping to track what keys do what and then call `*note fl_set_object_shortcut()::' to register the shortcut in the event dispatching module. The idea is NOT that the user himself calls `*note fl_set_object_shortcut()::' but that the class provides a routine for this that also keeps track of the required internal bookkeeping. Of course, if there is no internal bookkeeping, a macro to this effect will suffice. For example `*note fl_set_button_shortcut()::' is defined as `*note fl_set_object_shortcut()::'. The order in which keys are handled is as follows: First for a key it is tested whether any object in the form has the key as a shortcut. If yes, the first of those objects gets the shortcut event. Otherwise, the key is checked to see if it is `' or `'. If it is, the `obj->wantkey' field is checked. If the field does not contain `*note FL_KEY_TAB::' bit, input is focussed on the next input field. Otherwise the key is sent to the current input field. This means that input objects only get a `' or `' key sent to them if in the `obj->wantkey' field the `*note FL_KEY_TAB::' bit is set. This is e.g., used in multi-line input fields. If the object wants all cursor keys (including `' etc.), the `obj->wantkey' field must have the `*note FL_KEY_SPECIAL::' bit set. To summarize, the `obj->wantkey' field can take on the following values (or the bit-wise or of them): `FL_KEY_NORMAL' The default. The object receives left and right cursor, `' and `' keys plus all normal keys (0-255) except `' `'. `FL_KEY_TAB' Object receives the `', `' as well as the `' and `' cursor keys. `FL_KEY_SPECIAL' The object receives all keys with a KeySym above 255 which aren't already covered by `FL_KEY_NORMAL' and `FL_KEY_TAB' (e.g., function keys etc.) `FL_KEY_ALL' Object receives all keys. This way it is possible for a non-input object (i.e., if `obj->input' is zero) to obtain special keyboard event by setting `obj->wantkey' to `*note FL_KEY_SPECIAL::'.  File: xforms.info, Node: Part IV The Type FL_OBJECT, Next: Part IV Drawing Objects, Prev: Part IV Events, Up: Top 27 The Type `FL_OBJECT' *********************** Each object has a number of attributes. Some of them are used by the main routine, some have a fixed meaning and should never be altered by the class routines and some are free for the class routines to use. Please always use accessor methods when available instead of using or changing the object's properties directly. Below we consider some of them that are likely to be used in new classes. `int objclass' This indicates the class of the object (e.g., `FL_BUTTON', `FL_SLIDER', `FL_NEW' etc.) The user can query the class of an object using the function `*note fl_get_object_objclass()::'. `int type' This indicates the type of the object within the class. Types are integer constants that should be defined in a header file named after the object class, e.g., `NEW.h'. Their use is completely free. For example, in the slider class the type is used to distinguish between horizontal and vertical sliders. At least one type should exist and the user should always provide it (just for consistency). They should be numbered from 0 upwards. The user can query the type of an object using the function `*note fl_get_object_type()::'. `int boxtype' This is the type of the bounding box for the object. The handling routine for the object, e.g., `handle_NEW()', has to take care that this is actually drawn. Note that there is a routine for drawing boxes, see below. The user can change or query the boxtype of an object with the functions `*note fl_set_object_boxtype()::' and `*note fl_get_object_boxtype()::'. `FL_Coord x, y, w, h' These are the coordinates and sizes that indicate the bounding box of the object. They always have to be provided when adding an object. The system uses them e.g., to determine if the object is below the mouse. The class routines should use them to draw the object in the correct size, etc. Note that these values will change when the user resizes the form window. So never assume anything about their values but always recheck them when drawing the object. The routines `*note fl_get_object_geometry()::', `*note fl_get_object_position()::' and `*note fl_get_object_size()::' should be used to determine position and/or size. To change the position and/or size of an object never change the elements of the structures directly (except in a function like `fl_add_NEW()') but always use `*note fl_set_object_geometry()::', `*note fl_set_object_position()::', `*note fl_set_object_size()::' and `*note fl_move_object()::'! Also note that the `y'-member is always relative to the top of the form the object belongs to, even if the user had called `*note fl_flip_yorigin()::' - this only results in `y'-values passed by and returned to the user when using functions like `*note fl_set_object_position()::' or `*note fl_get_object_position()::' getting "flipped", internally always the normal coordinate system is used. `unsigned int resize' Controls if the object should be resized if the form it is on is resized. The options are `FL_RESIZE_NONE', `FL_RESIZE_X', `FL_RESIZE_Y' and `FL_RESIZE_ALL'. The default is `FL_RESIZE_ALL' which is the bitwise OR of `FL_RESIZE_X' and `FL_RESIZE_Y'. Instead of accessing this element directly better use the functions `*note fl_get_object_resize()::' and `*note fl_set_object_resize()::'. `unsigned int nwgravity, segravity' These two variables control how the object is placed relative to its position prior to resizing. Instead of accessing these elements directly use `*note fl_get_object_gravity()::' and `*note fl_set_object_gravity()::'. `FL_COLOR col1, col2' These are two color indices in the internal color lookup table. The class routines are free to use them or not. The user can change them using the routine `*note fl_set_object_color()::' or inspect the colors with `*note fl_get_object_color()::'. The routine `fl_add_NEW()' should fill in defaults. `char *label' This is a pointer to an allocated text string. This can be used by class routines to provide a label for the object. The class routines may not forget to allocate storage for it when it sets the pointer itself, i.e., doesn't use `*note fl_set_object_label()::' - an empty label should be the empty string and not just a `NULL' pointer. The user can change it using the routines `*note fl_set_object_label()::' and `*note fl_set_object_label_f()::' or ask for it using `*note fl_get_object_label()::'. The label must be drawn by the routine handling the object when it receives a `FL_DRAWLABEL' event (or it could be part of the code for `FL_DRAW' event). For non-offsetted labels, i.e., the alignment is relative to the entire bounding box, simply calling `*note fl_draw_object_label()::' should be enough. `FL_COLOR lcol' The color of the label. The class routines can freely use this. The user can set it with `*note fl_set_object_lcolor()::' and test it with `*note fl_get_object_lcolor()::'. `int lsize' The size of the font used to draw the label. The class routines can freely use this. The user can set it with `*note fl_set_object_lsize()::'. and test it with `*note fl_get_object_lsize()::'. `int lstyle' The style of the font the label os drawn in, i.e., the number of the font in which it should be drawn. The class routines can freely use this. The user can set it with `*note fl_set_object_lstyle()::' and test it with `*note fl_get_object_lstyle()::'. `int align' The alignment of the label with respect to the object. Again it is up to the class routines to do something useful with this. The possible values are `*note FL_ALIGN_LEFT::', `*note FL_ALIGN_RIGHT::', `*note FL_ALIGN_TOP::', `*note FL_ALIGN_BOTTOM::', `*note FL_ALIGN_CENTER::', `*note FL_ALIGN_LEFT_TOP::', `*note FL_ALIGN_RIGHT_TOP::', `*note FL_ALIGN_LEFT_BOTTOM::' and `*note FL_ALIGN_RIGHT_BOTTOM::'. The value should be bitwise ORed with `*note FL_ALIGN_INSIDE::' if the label will be within the bounding box of the object. The user can set this using the routine `*note fl_set_object_lalign()::' and test it with `*note fl_set_object_lalign()::'. `int bw' An integer indicating the border width of the object. Negative values indicate the up box should look "softer" (in which case no black line of 1 pixel width is drawn around the objects box). The user can set a different border width using `*note fl_set_object_bw()::'. `long *shortcut' A pointer to long containing all shortcuts (as keysyms) defined for the object (also see the previous chapter). You should never need them because they are fully handled by the main routines. `void *spec' This is a pointer that points to any class specific information. For example, for sliders it stores the minimum, maximum and current value of the slider. Most classes (except the most simple ones like boxes and texts) will need this. The function for adding a new object (`fl_add_NEW()') has to allocate storage for it. Whenever the object receives the event `FL_FREEMEM' it should free this memory. `int visible' Indicates whether the object is visible. The class routines don't have to do anything with this variable. When the object is not visible the main routine will never try to draw it or send events to it. By default objects are visible. The visisbility of an object can be tested using the `*note fl_object_is_visible()::' function. Note that a this doesn't guarantee that the object is visible on the screen, for this also the form the object belongs to needs to be visible, in which case `*note fl_form_is_visible()::' returns true. `int active' Indicates whether the object is active, i.e., wants to receive events other than `FL_DRAW'. Static objects, such as text and boxes are inactive. This property should be set in the `fl_add_NEW()' routine if required. By default objects are active. This attribute can be changed by using the functions `*note fl_deactivate_object()::' and `*note fl_activate_object()::' and the current state can be determined by calling `*note fl_object_is_active()::'. `int input' Indicates whether this object can receive keyboard input. If not, events related to keyboard input are not sent to the object. The default value of `input' is false. It should be set by `fl_add_NEW()' if required. Note that not all keys are sent (see member `wantkey' below). `int wantkey' An input object normally does not receive `' or `' keystrokes or any other keys except those that have values between 0-255, the `' and `' arrow keys and `' and `' (`' and `' are normally used to switch between input objects). By setting this field to `FL_KEY_TAB' enforces that the object receives also these two keys as well as the `' and `' arrow keys and `' and `' when it has the focus. To receive other special keys (e.g., function keys) `FL_KEY_SPECIAL' must be set in `wantkey'. By setting `wantkey' to `FL_KEY_ALL' all keys are sent to the object. `unsigned int click_timeout' If non-zero this indicates the the maximum elapsed time (in msec) between two mouse clicks to be considered a double click. A zero value disables double/triple click detection. The user can set or query this value using the functions `*note fl_set_object_dblclick()::' and `*note fl_get_object_dblclick()::'. `int automatic' An object is automatic if it automatically (without user actions) has to change its contents. Automatic objects get a `FL_STEP' event about every 50 msec. For example the object class `FL_CLOCK' is automatic. `automatic' by default is false. To set this property use `*note fl_set_object_automatic()::' (don't set the object member directly except from within a function like `fl_add_NEW()', in other contexts some extra work is required) and to test the object for it use `*note fl_object_is_automatic()::'. `int belowmouse' This indicates whether the mouse is on this object. It is set and reset by the main routine. The class routines should never change it but can use it to draw or handle the object differently. `int pushed' This indicates whether the mouse is pushed within the bounding box of the object. It is set and reset by the main routine. Class routines should never change it but can use it to draw or handle objects differently. `int focus' Indicates whether keyboard input is sent to this object. It is set and reset by the main routine. Never change it but you can use its value. `FL_HANDLEPTR handle' This is a pointer to the interaction handling routine for the object. `fl_add_NEW()' sets this by providing the correct handling routine. Normally it is never used (except by the main routine) or changed although there might be situations in which you want to change the interaction handling routine for an object, due to some user action. `FL_OBJECT *next, *prev' `FL_FORM *form' These are pointers to other objects in the form and to the form itself. They are used by the main routines. The class routines should not change them. `void *c_vdata' A void pointer for the class routine. The main module does not reference or modify this field in any way. The object classes, including the built-in ones, may use this field. `char *c_cdata' A char pointer for the class routine. The main module does not reference or modify this field in any way. The object classes, including the built-in ones, may use this field. `long c_ldata' A long variable for the class routine. The main module does not reference or modify this field in any way. The object classes, including the built-in ones, may use this field. `void *u_vdata' A void pointer for the application program. The main module does not reference or modify this field in any way and neither should the class routines. `char *u_cdata' A char pointer for the application program. The main module does not reference or modify this field in any way and neither should the class routines. `long u_ldata' A long variable provided for the application program. `FL_CALLBACKPTR object_callback' The callback routine that the application program assigned to the object and that the system invokes when the user does something with the object. `long argument' The argument to be passed to the callback routine when invoked. `int how_return' Determines under what circumstances the object is returned by e.g., `*note fl_do_forms()::' or the callback function for the object is invoked. This can be either `*note FL_RETURN_NONE::' Object gets never returned or its callback invoked `*note FL_RETURN_CHANGED::' Return object or invoke callback when state of object changed. `*note FL_RETURN_END::' Return object or invoke callback at end of interaction, normally when the mouse key is released or, in the case of input objects, the object has lost focus. `*note FL_RETURN_END_CHANGED::' Return object or invoke callback only when interaction has ended and the state of the object has changed. `*note FL_RETURN_SELECTION::' Return object or invoke callback if e.g., in a browser a line was selected. `*note FL_RETURN_SELECTION::' Return object or invoke callback if e.g., in a browser a line was deselected. `*note FL_RETURN_ALWAYS::' Return object or invoke callback whenever interaction has ended or the state of the object has changed. Never change this element of the structure directly but use the function `*note fl_set_object_return()::' instead! Especially in the case of objects having child objects also the corresponding settings for child objects may need changes and which automatically get adjusted when the above function is used. `int returned' Set to what calling the object handling function did return (and pruned to what the object is supposed to return according to the `how_return' element). Can be either `*note FL_RETURN_NONE::' Handling function did `FL_RETURN_NONE' (i.e., `0'). `*note FL_RETURN_CHANGED::' Handling function detected a change of the objects state. `*note FL_RETURN_END::' Handling function detected end of interaction with object. `*note FL_RETURN_CHANGED::' and `*note FL_RETURN_END::' are bits that can be bitwise ored. If both are set this indicates that the objects state was changed and the interaction ended. The generic object construction routine typedef int (*FL_HANDLEPTR)(FL_OBJECT *obj, int event, FL_Coord mx, FL_Coord my, int key, void *raw_event); FL_OBJECT *fl_make_object(int objclass, int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label, FL_HANDLEPTR handle); allocates a chunk of memory appropriate for all object classes and initializes the newly allocated object to the following state: obj->resize = FL_RESIZE_X | FL_RESIZE_Y; obj->nwgravity = obj->segravity = FL_NoGravity; obj->boxtype = FL_NO_BOX; obj->align = FL_ALIGN_CENTER | FL_ALIGN_INSIDE; obj->lcol = FL_BLACK; obj->lsize = FL_DEFAULT_SIZE; obj->lstyle = FL_NORMAL_STYLE; obj->col1 = FL_COL1; obj->col2 = FL_MCOL; obj->wantkey = FL_KEY_NORMAL; obj->active = 1; obj->visible = 1; obj->bw = borderWidth_resource_set ? resource_val : FL_BOUND_WIDTH; obj->u_ldata = 0; obj->u_vdata = 0; obj->spec = NULL; obj->how_return = FL_RETURN_CHANGED In some situations it can be also useful to make an object a child of another object. An example is the scrollbar object. It has three child objects, a slider and two buttons, which all three are children of the scrollbar object. To make an object `child' a child object of an object named `parent' use the function void fl_add_child(FL_OBJECT *parent, FL_OBJECT *child); When creating a composite object you will typically add callbacks for the child object that handle what happens on events for these child objects (e.g., for the scrollbar the buttons have callbacks that update the internal state for the scrollbar object and result in the slider getting shifted). Within these callback functions the `returned' elements of the parent can be changed to influence if and what gets reported to the application via `*note fl_do_forms()::'. There is rarely any need for the new object class to know how the object is added to a form and how the Forms Library manages the geometry, e.g., does an object have its own window etc. Nonetheless if this information is required, use `*note FL_ObjWin()::' on the object to obtain the window resource ID of the window the object belongs to. Beware that an object window ID may be shared with other objects(1). Always remove an object from the screen with `*note fl_hide_object()::'. The class routine/application may reference the following members of the `FL FORM' structure to obtain information on the status of the form, but should not modify them directly: `int visible' Indicates if the form is visible on the screen (mapped). Never change it directly, use `*note fl_show_form()::' or `*note fl_hide_form()::' instead. `int deactivated' Indicates if the form is deactivated. Never change it directly, use `*note fl_activate_form()::' or `*note fl_deactivate_form()::' instead. `FL OBJECT *focusobj' This pointer points to the object on the form that has the input focus. `FL OBJECT *first' The first object on the form. Pointer to a linked list. `Window window' The forms window. ---------- Footnotes ---------- (1) The only exception is the canvas class where the window ID is guaranteed to be non-shared.  File: xforms.info, Node: Part IV Drawing Objects, Next: Part IV An Example, Prev: Part IV The Type FL_OBJECT, Up: Top 28 Drawing Objects ****************** * Menu: * General Remarks: General Remarks * Color Handling: Color Handling * Mouse Handling: Mouse Handling * Clipping: Clipping * Getting the Size: Getting the Size * Font Handling: Font Handling * Drawing Functions: Drawing Functions  File: xforms.info, Node: General Remarks, Next: Color Handling, Up: Part IV Drawing Objects 28.1 General Remarks ==================== An important aspect of a new object class (or a free object) is how to draw it. As indicated above this should happen when the event `FL_DRAW' is received by the object. The place and size, i.e., the bounding box, of the object are indicated by the object tructure fields `obj->x', `obj->y', `obj->w' and `obj->h'. Forms are drawn in the Forms Library default visual or the user requested visual, which could be any of the X supported visuals. Hence, preferably your classes should run well in all visuals. The Forms Library tries to hide as much as possible the information about graphics mode and, in general, using the built-in drawing routines is the best approach. Here are some details about graphics state in case such information is needed. All state information is kept in a global structure of type `FL_State' and there is a total of six such structures, `fl_state[6]', each for every visual class. The structure contains among others the following members: `XVisualInfo *xvinfo' Many properties of the current visual can be obtained from this member. `int depth' The depth of the visual. Same as what you get from `xvinfo'. `int vclass' The visual class, `PseudoColor', `TrueColor' etc. `Colormap colormap' Current active colormap valid for the current visual for the entire Forms Library (except `FL_CANVAS'). You can allocate colors from this colormap, but you should never free it. `Window trailblazer' This is a valid window resource ID created in the current visual with the colormap mentioned above. This member is useful if you have to call, before the form becomes active (thus does not have a window ID), some Xlib routines that require a valid window. A macro, `fl_default_window()', is defined to return this member and use of the macro is encouraged. `GC gc[16]' A total of 16 GCs appropriate for the current visual and depth. The first (`gc[0]') is the default `GC' used by many internal routines and should be modified with care. It is a good idea to use only the top 8 `GC's (8-15) for your free object so that future Forms Library extensions won't interfere with your program. Since many internal drawing routines use the Forms Library's default `GC' (`gc[0]'), it can change anytime whenever drawing occurs. Therefore, if you are using this GC for some of your own drawing routines make sure to always set the proper value before using it. The currently active visual class (`TrueColor', `PseudoColor' etc.) can be obtained by the following function/macro: int fl_get_form_vclass(FL_FORM *form); int fl_get_vclass(void); The value returned can be used as an index into the array `*note fl_state::' of `*note FL_State::' structures. Note that `*note fl_get_vclass()::' should only be used within a class/new object module where there can be no confusion what the "current" form is. Other information about the graphics mode can be obtained by using visual class as an index into the `fl_state' structure array. For example, to print the current visual depth, code similar to the following can be used: int vmode = fl_get_vclass(); printf("depth: %d\n", fl_state[vmode].depth); Note that `fl_state[]' for indices other than the currently active visual class might not be valid. In almost all Xlib calls, the connection to the X server and current window ID are needed. The Forms Library comes with some utility functions/macros to facilitate easy utilization of Xlib calls. Since the current version of Forms Library only maintains a single connection, the global variable `*note fl_display::' can be used where required. However, it is recommended that you use `fl_get_display()' or `FL_FormDisplay(Form *form)' instead since the function/macro version has the advantage that your program will remain compatible with future (possibly multi-connection) versions of the Forms Library. There are a couple of ways to find out the "current" window ID, defined as the window ID the object receiving dispatcher's messages like `FL_DRAW' etc. belongs to. If the object's address is available, `FL_ObjWin(obj)' will suffice. Otherwise the function `*note fl_winget()::' (see below) can be used. There are other routines that might be useful: FL_FORM *fl_win_to_form(Window win); This function takes a window ID win and returns the form the window belongs to or `None' on failure.  File: xforms.info, Node: Color Handling, Next: Mouse Handling, Prev: General Remarks, Up: Part IV Drawing Objects 28.2 Color Handling =================== As mentioned earlier, Forms Library keeps an internal colormap, initialized to predefined colors. The predefined colors do not correspond to pixel values the server understands but are indexes into the colormap. Therefore, they can't be used in any of the `GC' altering or Xlib routines. To get the actual pixel value the X server understands, use the following routine unsigned long fl_get_pixel(FL_COLOR col); To e.g., get the pixel value of the red color, use unsigned long red_pixel; red_pixel = fl_get_pixel(FL_RED); To change the foreground color in the Forms Library's default `GC' (`gc[0]') use void fl_color(FL_COLOR col); To set the background color in the default `GC' use instead void fl_bk_color(FL_COLOR col); To set foreground or background in `GC's other than the Forms Library's default, the following functions exist: void fl_set_foreground(GC gc, FL_COLOR col); void fl_set_background(GC gc, FL_COLOR col); which is equivalent to the following Xlib calls XSetForeground(fl_get_display(), gc, fl_get_pixel(color)); XSetBackground(fl_get_display(), gc, fl_get_pixel(color)); To free allocated colors from the default colormap, use the following routine void fl_free_colors(FL_COLOR *cols, int n); This function frees the `n' colors stored in the array of colormap indices `cols'. You shouldn't do that for the reserved colors, i.e., colors with indices below `FL_FREE_COL1'. In case the pixel values (instead of the index into the colormap) are known, the following routine can be used to free the colors from the default colormap void fl_free_pixels(unsigned long *pixels, int n); Note that the internal colormap maintained by the Forms Library is not updated. This is in general harmless. To modify or query the internal colormap, use the following routines: unsigned long fl_mapcolor(FL_COLOR col, int red, int green, int blue) long fl_mapcolorname(FL_COLOR col, const char *name); unsigned long fl_getmcolor(FL_COLOR col, int *red, int *green, int *blue); The first function, `*note fl_mapcolor()::' sets a the color indexed by `color' to the color given by the `red', `green' and `blue', returning the colors pixel value. The second function, `*note fl_mapcolorname()::', sets the color in the colormap indexed by `color' to the color named `name', where `name' must be a valid name from the system's color database file `rgb.txt'. It also returns the colors pixel value or -1 on failure. The last function, `*note fl_getmcolor()::', returns the RGB values of the color indexed by `color' in the second to third argument pointers and the pixel value as the return value (or -1, cast to `unsigned long', on failure).  File: xforms.info, Node: Mouse Handling, Next: Clipping, Prev: Color Handling, Up: Part IV Drawing Objects 28.3 Mouse Handling =================== The coordinate system used corresponds directly to that of the screen. But object coordinates are relative to the upper-left corner of the form the object belongs to. To obtain the position of the mouse relative to a certain form or window, use the routines Window fl_get_form_mouse(FL_FORM *form, FL_Coord *x, FL_Coord *y, unsigned *keymask) Window fl_get_win_mouse(Window win, FL_Coord *x, FL_Coord *y, unsigned *keymask); The functions return the ID of the window the mouse is in. Upon return `x' and `y' are set to the mouse position relative to the form or window and `keymask' contains information on modifier keys (same as the the corresponding `XQueryPointer()' argument). A similar routine exists that can be used to obtain the mouse location relative to the root window Window fl_get_mouse(FL_Coord *x, FL_Coord *y, unsigned *keymask); The function returns the ID of the window the mouse is in. To move the mouse to a specific location relative to the root window, use the following routine void fl_set_mouse(FL_Coord x, FL_Coord y); Use this function sparingly, it can be extremely annoying for the user if the mouse position is changed by a program.  File: xforms.info, Node: Clipping, Next: Getting the Size, Prev: Mouse Handling, Up: Part IV Drawing Objects 28.4 Clipping ============= To avoid drawing outside a box the following routine exists: void fl_set_clipping(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h); It sets a clipping region in the Forms Library's default `GC' used for drawing (but not for output of text, see below). `x', `y', `w' and `h' define the area drawing is to restrict to and are relative to the window/form that will be drawn to. In this way you can prevent drawing over other objects. Under some circumstances XForms also does it's own clipping, i.e., while drawing due to a exposure event. This is called "global clipping". Thus the clipping area you have set via a call of `*note fl_set_clipping()::' may get restricted even further due this global clipping. You can check if there's clipping set for the default `GC' using the function int fl_is_clipped(int include_global); which returns `1' if clipping is switched on and `0' otherwise. The `include_global' argument tells the function if global clipping is to be included in the answer or not (i.e., if the argument is `0' only clipping set via `*note fl_set_clipping()::' is reported). The area currently clipped to is returned by the function int fl_get_clipping(int include_global, FL_Coord *x,FL_Coord *y, FL_Coord *width, FL_Coord *height); On return the four pointer arguments are set to the position and size of the clipping rectangle (at least if clipping is switched on) and the qreturn value of this function is the same as that of `*note fl_is_clipped()::'. The `include_global' argument has the same meaning as for `*note fl_is_clipped()::', i.e., it controls if the effects of global clipping is included in the results. When finished with drawing always use void fl_unset_clipping(void); to switch clipping of again. You also can check and obtain the current settings for global clipping using the functions int fl_is_global_clipped(void); int fl_get_global_clipping(FL_Coord *x,FL_Coord *y, FL_Coord *width, FL_Coord *height); Clipping for text is controlled via a different `GC' and thus needs to be set, tested for and unset using a different set of functions: void fl_set_text_clipping(FL_Coord x,FL_Coord y,FL_Coord w,FL_Coord h); int fl_is_text_clipped(int include_global); int fl_get_text_clipping(int include_global, FL_Coord *x,FL_Coord *y, FL_Coord *width, FL_Coord *height); void fl_unset_text_clipping(void); Finally, there are functions to set and unset the clipping for a specific `GC': void fl_set_gc_clipping(GC gc, FL_Coord x, FL_Coord y, FL_Coord width, FL_Coord height); void fl_unset_gc_clipping(GC gc); Please note that setting clipping for a `GC' will always further restrict the region to the region of global clipping (if it is on at the moment the function is called) and unsetting clipping will still retain global clipping if this is on at the moment the second function is invoked (if it is currently on can be checked using the `*note fl_is_global_clipped()::').  File: xforms.info, Node: Getting the Size, Next: Font Handling, Prev: Clipping, Up: Part IV Drawing Objects 28.5 Getting the Size ===================== To obtain the bounding box of an object with the label taken into account (in contrast to the result of the `*note fl_get_object_geometry():: function which doesn't include a label that isn't inside the object' the following routine exists: void fl_get_object_bbox(FL_OBJECT *obj, FL_Coord *x, FL_Coord *y, FL_Coord *w, FL_Coord *h); For drawing text at the correct places you will need some information about the sizes of characters and strings. The following routines are provided: int fl_get_char_height(int style, int size, int *ascent, int *descent) int fl_get_char_width(int style, int size); These two routines return the maximum height and width of the font used, where `size' indicates the point size for the font and `style' is the style in which the text is to be drawn. The first function, `*note fl_get_char_height()::', also returns the height above and below the baseline of the font via the `ascent' and `descent' arguments (if they aren't `NULL' pointers). A list of valid styles can be found in Section 3.11.3. To obtain the width and height information for a specific string use the following routines: int fl_get_string_width(int style, int size, const char *str, int len); int fl_get_string_height(int style, int size, const char *str, int len, int *ascent, int *descent); where `len' is the length of the string `str'. The functions return the width and height of the string, respectively. The second function also returns the height above and below the fonts baseline if `ascent' and `descent' aren't `NULL' pointers. Note that the string may not contain newline characters `'\n'' and that the height calculated from the ascent and descent of those characters in the string that extend the most above and below the fonts baseline. It thus may not be suitable for calculating line spacings, for that use the `*note fl_get_char_height()::' or `*note fl_get_string_dimension()::' function. There exists also a routine that returns the width and height of a string in one call. In addition, the string passed can contain embedded newline characters `'\n'' and the routine will make proper adjustment so the values returned are large enough to contain the multiple lines of text. The height of each of the lines is the fonts height. void fl_get_string_dimension(int style, int size, const char *str, int len, int *width, int *height);  File: xforms.info, Node: Font Handling, Next: Drawing Functions, Prev: Getting the Size, Up: Part IV Drawing Objects 28.6 Font Handling ================== Sometimes it can be useful to get the X font structure for a particular size and style as used in the Forms Library. For this purpose, the following routine exists: [const] XFontStruct *fl_get_fontstruct(int style, int size); The structure returned can be used in, say, setting the font in a particular `GC': XFontStruct *xfs = fl_get_fontstruct(FL_TIMESBOLD_STYLE, FL_HUGE_SIZE); XSetFont(fl_get_display(), mygc, xfs->fid); The caller is not allowed to free the structure returned by `*note fl_get_fontstruct()::', it's just a pointer to an internal structure!  File: xforms.info, Node: Drawing Functions, Prev: Font Handling, Up: Part IV Drawing Objects 28.7 Drawing Functions ====================== There are a number of routines that help you draw objects on the screen. All XForms's internal drawing routine draws into the "current window", defined as the window the object that uses the drawing routine belongs to. If that's not what you need, the following routines can be used to set or query the current window: void fl_winset(Window win); Window fl_winget(void); One caveat about `*note fl_winget()::' is that it can return `None' if called outside of an object's event handler, depending on where the mouse is. Thus, the return value of this function should be checked when called outside of an object's event handler. It is important to remember that unless the following drawing commands are issued while handling the `FL_DRAW' or `FL_DRAWLABEL' event (which is not generally recommended), it is the application's responsibility to set the proper drawable using `*note fl_winset()::'. The most basic drawing routines are for drawing rectangles: void fl_rectf(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col); void fl_rect(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col); Both functions draw a rectangle on the screen in color `col'. While `*note fl_rectf()::' draws a filled rectangle, `*note fl_rect()::' just draws the outline in the given color. To draw a filled (with color `col') rectangle with a black border use void fl_rectbound(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col); To draw a rectangle with rounded corners (filled or just the outlined) employ void fl_roundrectf(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col); void fl_roundrect(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col); To draw a general polygon, use one of the following routines typedef struct { short x, y; } FL_POINT; void fl_polyf(FL_POINT *xpoint, int n, FL_COLOR col); void fl_polyl(FL_POINT *xpoint, int n, FL_COLOR col); void fl_polybound(FL_POINT *xpoint, int n, FL_COLOR col); `*note fl_polyf()::' draws a filled polygon defined by `n' points, `*note fl_polyl()::' the ouline of a polygon and `*note fl_polybound()::' a filled polygon with a black outline. Note: *all* polygon routines require that the array `xpoint' has spaces for *`n+1'* points, i.e., one more than then number of points you intend to draw! To draw an ellipse. either filled, open (with the outline drawn in the given color), or filled with a black border the following routines can be used (use `w' equal to `h' to get a circle): void fl_ovalf(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col); void fl_ovall(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col); void fl_ovalbound(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col); The `x' and `y' arguments are the upper left hand corner of the ellipse, while `w' and `h' are its width and height. Note: `*note fl_ovall()::' (with two 'l') isn't a typo, the trailing 'l' it's meant indicate that only a line will be drawn. And there's also the function void fl_ovalf(int fill, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col); which is invoked by both (the macros) `*note fl_ovalf()::' and `*note fl_ovall()::' with the first argument `fill' set to either `1' or `0'. To simplify drawing circles there are three additional functions. The first one draws an (open) circle (with the circumfence in the given color), the second one a filled circle, and the last one a filled circle with a black circumfence: void fl_circ(FL_Coord x, FL_Coord y, FL_Coord r, FL_COLOR col); void fl_circf(FL_Coord x, FL_Coord y, FL_Coord r, FL_COLOR col); void fl_circbound(FL_Coord x, FL_Coord y, FL_Coord r, FL_COLOR col); Here `x' and `y' are the coordinates of the center of the circle, `r' is its radius and `col' the color to be used. To draw circular arcs, either open or filled, the following routines can be used void fl_arc(FL_Coord x, FL_Coord y, FL_Coord radius, int start_theta, int end_theta, FL_COLOR col); void fl_arcf(FL_Coord x, FL_Coord y, FL_Coord radius, int start_theta, int end_theta, FL_COLOR col); `x' and `y' are the coordinates of the center and `r' is the radius. `start_theta' and `end_theta' are the starting and ending angles of the arc in units of tenths of a degree (where 0 stands for a direction of 3 o'clock, i.e., the right-most point of a circle), and `x' and `y' are the center of the arc. If the difference between `theta_end' and `theta_start' is larger than 3600 (360 degrees), drawing is truncated to 360 degrees. To draw elliptical arcs the following routine can be used: void fl_pieslice(int fill, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int start_theta, int end_theta, FL_COLOR col); `x' and `y' are the upper left hand corner of the box enclosing the ellipse that the pieslice is part of and `w' and `h' the width and height of that box. `start_theta' and `end_theta', to be given in tenth of a degree, specify the starting and ending angles measured from zero degrees (3 o'clock). Depending on circumstance, elliptical arc may be more easily drawn using the following routine void fl_ovalarc(int fill, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int theta, int dtheta, FL_COLOR col); Here `theta' specifies the starting angle (again measured in tenth of a degree and with 0 at the 3 o'clock position), and `dtheta' specifies both the direction and extent of the arc. If `dtheta' is positive the arc is drawn in counter-clockwise direction from the starting point defined by `theta', otherwise in clockwise direction. If `dtheta' is larger than 3600 it is truncated to 3600. To connect two points with a straight line, use void fl_line(FL_Coord x1, FL_Coord y1, FL_Coord x2, FL_Coord y2, FL_COLOR col); There is also a macro for drawing a line along the diagonal of a box (to draw a horizontal line set `h' to 1, not to 0): void fl_diagline(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col); To draw connected line segments between `n' points use void fl_lines(FL_POINT *points, int n, FL_COLOR col); All coordinates in points are relative to the origin of the drawable. There are also routines to draw one or more pixels void fl_point(FL_Coord x, FL_Coord y, FL_COLOR col); void fl_points(FL_POINT *p, int np, FL_COLOR col); As usual, all coordinates are relative to the origin of the drawable. Note that these routines are meant for you to draw a few pixels, not images consisting of tens of thousands of pixels of varying colors. For that kind of drawing `XPutImage(3)' should be used. Or better yet, use the image support in the Forms Library (see *note Images: Part VI Images.). Also it's usually better when drawing multiple points to use fl_points(), even if that means that the application program has to pre-sort and group the pixels of the same color. To change the line width or style, the following convenience functions are available void fl_linewidth(int lw); void fl_linestyle(int style); Set `lw' to 0 to reset the line width to the servers default. Line styles can take on the following values (also see `XChangeGC(3)') `FL SOLID' Solid line. Default and most efficient. `FL DOT' Dotted line. `FL DASH' Dashed line. `FL DOTDASH' Dash-dot-dash line. `FL LONGDASH' Long dashed line. `FL USERDASH' Dashed line, but the dash pattern is user definable via `*note fl_dashedlinestyle()::'. Only the odd numbered segments are drawn with the foreground color. `FL USERDOUBLEDASH' Similar to `FL_LINE_USERDASH' but both even and odd numbered segments are drawn, with the even numbered segments drawn in the background color (as set by `*note fl_bk_color()::'). The following routine can be used to change the dash pattern for `FL_USERDASH' and `FL USERDOUBLEDASH': void fl_dashedlinestyle(const char *dash, int ndashes) Each element of the array `dash' is the length of a segment of the pattern in pixels (0 is not allowed). Dashed lines are drawn as alternating segments, each with the length of an element in `dash'. Thus the overall length of the dash pattern, in pixels, is the sum of all elements of `dash'. When the pattern is used up but the line to draw is longer it used from the start again. The following example code specifies a long dash (9 pixels) to come first, then a skip (3 pixels), a short dash (2 pixels) and then again a skip (3 pixels). After this sequence, the pattern repeats. char ldash_sdash[] = {9, 3, 2, 3}; fl_dashedlinestyle(ldash_sdash, 4); If `dash' is `NULL' or `ndashes' is `0' (or the `dash' array contains an element set to `0') a default pattern of 4 pixels on and 4 fixels off is set. It is important to remember to call `*note fl_dashedlinestyle()::' whenever `FL_USERDASH' is used to set the dash pattern, otherwise whatever the last pattern was will be used. To use the default dash pattern you can pass `NULL' as the dash parameter to `*note fl_dashedlinestyle()::'. By default, all lines are drawn so they overwrite the destination pixel values. It is possible to change the drawing mode so the destination pixel values play a role in the final pixel value. void fl_drawmode(int mode); There are 16 different possible settings for `mode' (see a Xlib programming manual for all the gory details). A of the more useful ones are `GXcopy' Default overwrite mode. Final pixel value = Src `GXxor' Bitwise XOR (exclusive-or) of the pixel value to be drawn with the pixel value already on the screen. Useful for rubber-banding. `GXand' Bitwise AND of the pixel value to be drawn with the pixel value already on the screen. `GXor' Bitwise OR of the pixel value to be drawn with the pixel value already on the screen. `GXinvert' Just invert the pixel values already on the screen. To obtain the current settings of the line drawing attributes use the following routines int fl_get_linewidth(void); int fl_get_linestyle(void); int fl_get_drawmode(void); There are also a number of high-level drawing routines available. To draw boxes the following routine exists. Almost any object class will use it to draw the bounding box of the object. void fl_draw_box(int style, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col, int bw); `style' is the type of the box, e.g., `FL_DOWN_BOX'. `x', `y', `w', and `h' indicate the size of the box. `col' is the color and `bw' is the width of the boundary, which typically should be given the value `obj->bw' or `FL_BOUND_WIDTH'. Note that a negative border width indicates a "softer" up box. See the demo program `borderwidth.c' for the visual effect of different border widths. There is also a routine for drawing a frame: void fl_draw_frame(int style, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col, int bw) All parameters have the usual meaning except that the frame is drawn outside of the bounding box specified. For drawing text there are two routines: void fl_draw_text(int align, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col, int style, int size, const char *str); void fl_draw_text_beside(int align, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col, int style, int size, const char *str); where `align' is the alignment, namely, `FL ALIGN LEFT', `FL ALIGN CENTER' etc. `x', `y', `w' and `h' indicate the bounding box, `col' is the color of the text, `size' is the size of the font to use (in points) and `style' is the font style to be used (see *note Label Attributes and Fonts::, for valid styles). Finally, `str' is the string itself, possibly containing embedded newline characters. `*note fl_draw_text()::' draws the text inside the bounding box according to the alignment requested while `*note fl_draw_text_beside()::' draws the text aligned outside of the box. These two routines interpret a text string starting with the character `@' differently in drawing some symbols instead. Note that `*note fl_draw_text()::' puts a padding of 5 pixels in vertical direction and 4 in horizontal around the text. Thus the bounding box should be 10 pixels wider and 8 pixels higher than required for the text to be drawn. The following routine can also be used to draw text and, in addition, a cursor can optionally be drawn void fl_draw_text_cursor(int align, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col, int style, int size, char *str, FL_COLOR ccol, int pos); where `ccol' is the color of the cursor and `pos' is its position which indicates the index of the character in `str' before which to draw the cursor (-1 means show no cursor). This routine does no interpretion of the special character `@' nor does it add padding around the text. Given a bounding box and the size of an object (e.g., a label) to draw, the following routine can be used to obtain the position of where to draw it with a certain alignment and including padding: void fl_get_align_xy(int align, int x, int y, int w, int h, int obj_xsize, int obj_ysize, int xmargin, int ymargin, int *xpos, int *ypos); This routine works regardless if the object is to be drawn inside or outside of the bounding box specified by `x', `y', `w' and `h'. `obj_xsize' and `obj->ysize' are the width and height of the object to be drawn and `xmargin' and `ymargin' is the additional padding to use. `xpos' and `ypos' return the position to be used for drawing the object. For drawing object labels the following routines might be more convenient: void fl_draw_object_label(FL_OBJECT *obj) void fl_draw_object_label_outside(FL_OBJECT *obj); Both routines assume that the alignment is relative to the full bounding box of the object. The first routine draws the label according to the alignment, which could be inside or outside of the bounding box. The second routine will always draw the label outside of the bounding box. An important aspect of (re)drawing an object is efficiency which can result in flicker and non-responsiveness if not handled with care. For simple objects like buttons or objects that do not have "movable parts", drawing efficiency is not a serious issue although you can never be too fast. For complex objects, especially those that a user can interactively change, special care should be taken. The most important rule for efficient drawing is not to draw if you don't have to, regardless how simple the drawing is. Given the networking nature of X, simple or not depends not only on the host/server speed but also the connection. What this strategy entails is that the drawing should be broken into blocks and depending on the context, draw/update only those parts that need to.  File: xforms.info, Node: Part IV An Example, Next: Part IV New Buttons, Prev: Part IV Drawing Objects, Up: Top 29 An Example ************* Let us work through an example of how to create a simple object class named `colorbox'. Assume that we want a class with the following behavior: it should normally be red. When the user presses the mouse on it it should turn blue. When the user releases the mouse button the object should turn red again and be returned to the application program. Further, the class module should keep a total count how many times the box got pushed. The first thing to do is to define some constants in a file named `colbox.h'. This file should at least contain the class number and one or more types: /* Class number must be between FL_USER_CLASS_START and FL_USER_CLASS_END */ #define FL_COLBOX (FL_USER_CLASS_START + 1) #define FL_NORMAL_COLBOX 0 /* The only type */ Note that the type must start from zero onward. Normally it should also contain some defaults for the boxtype and label alignment etc. The include file also has to declare all the functions available for this object class. I.e., it should contain: extern FL_OBJECT *fl_create_colbox(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char *); extern FL_OBJECT *fl_add_colbox(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char *); extern int fl_get_colorbox(FL_OBJECT *); Now we have to write a module `colbox.c' that contains the different routines. First of all we need routines to create an object of the new type and to add it to the current form. We also need to have a counter that keeps track of number of times the colbox is pushed. They would look as follows: typedef struct { int counter; /* no. of times pushed */ } COLBOX_SPEC; FL_OBJECT *fl_create_colbox(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) { FL_OBJECT *obj; /* create a generic object class with an appropriate ID */ obj = fl_make_object(FL_COLBOX, type, x, y, w, h, label, handle_colbox); /* initialize some members */ obj->col1 = FL_RED; obj->col2 = FL_BLUE; /* create class specific structures and initialize */ obj->spec = fl_malloc(sizeof *obj->spec); obj->spec->counter = 0; return obj; } FL_OBJECT *fl_add_colbox(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) { FL_OBJECT *obj = fl_create_colbox(type, x, y, w, h, label); fl_add_object(fl_current_form, obj); return obj; } The fields `col1' and `col2' are used to store the two colors red and blue such that the user can change them when required with the routine `*note fl_set_object_color()::'. What remains is to write the handling routine `handle_colbox()'. It has to react to three types of events: `FL_DRAW', `FL_PUSH' and `FL_RELEASE'. Also, when the box is pushed, the counter should be incremented to keep a total count. Note that whether or not the mouse is pushed on the object is indicated in the field `obj->pushed'. Hence, when pushing and releasing the mouse the only thing that needs to be done is redrawing the object. This leads to the following piece of code: static int handle_colbox(FL_OBJECT *obj, int event, FL_Coord mx, FL_Coord my, int key, void *xev) { switch (event) { case FL_DRAW: /* Draw box */ fl_draw_box(obj->boxtype, obj->x,obj->y, obj->w, obj->h, obj->pushed ? obj->col2 : obj->col1, obj->bw); /* fall through */ case FL_DRAWLABEL: /* Draw label */ fl_draw_object_label(obj); break; case FL_PUSH: ((COLBOX_SPEC *) obj->spec)->counter++; fl_redraw_object(obj); break; case FL_RELEASE: fl_redraw_object(obj); return 1; /* report back to application! */ case FL_FREEMEM: fl_free(obj->spec); break; } return 0; } That is the whole piece of code. Of course, since the `COLBOX_SPEC' structure is invisible outside of `colbox.c', the following routine should be provided to return the total number of times the colbox was pushed: int fl_get_colbox(FL_OBJECT *obj) { if (!obj || obj->objclass != FL_COLBOX) { fprintf(stderr, "fl_get_colbox: Bad argument or wrong type); return -1; } return ((COLBOX_SPEC *) obj->spec)->counter; } To use it, compile it into a file `colbox.o'. An application program that wants to use the new object class simply should include `colbox.h' and link with `colbox.o' when compiling the program. It can then use the routine `fl_add_colbox()' to add objects of the new type to a form.  File: xforms.info, Node: Part IV New Buttons, Next: Part IV Using a Pre-emptive Handler, Prev: Part IV An Example, Up: Top 30 New Buttons ************** Since button-like object is one of the most important, if not _the_ most important, classes in graphical user interfaces, Forms Library provides, in addition to the ones explained earlier, a few more routines that make create new buttons or button-like objects even easier. These routines take care of the communication between the main module and the button handler so all new button classes created using this scheme behave consistently. Within this scheme, the programmer only has to write a drawing function that draws the button. There is no need to handle events or messages from the main module and all types of buttons, radio, pushed or normal are completely taken care of by the generic button class. Further, `*note fl_get_button()::' and `*note fl_set_button()::' work automatically without adding any code for them. Forms Library provides two routines to facilitate the creation of new button object classes. One of the routines is FL_OBJECT *fl_create_generic_button(int objclass, int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); which can be used to create a generic button that has all the properties of a real button except that this generic button does not know what the real button looks like. The other routine `*note fl_add_button_class()::', discussed below, can be used to register a drawing routine that completes the creation of a new button. All button or button-like objects have the following instance-specific structure, defined in `forms.h', that can be used to obtain information about the current status of the button: typedef struct { Pixmap pixmap; /* for bitmap/pixmap button only */ Pixmap mask; /* for bitmap/pixmap button only */ unsigned int bits_w, /* for bitmap/pixmap button only */ bits_h; int val; /* whether it's pushed */ int mousebut; /* mouse button that caused the push */ int timdel; /* time since last touch (TOUCH buttons)*/ int event; /* what event triggered the redraw */ long cspecl; /* for non-generic class specific data */ void * cspec; /* for non-generic class specific data */ char * file; /* filename for the pixmap/bitmap file */ } FL_BUTTON_STRUCT; Of all its members, only `val' and `mousebut' probably will be consulted by the drawing function. `cspecl' and `cspecv' are useful for keeping track of class status other than those supported by the generic button (e.g., you might want to add a third color to a button for whatever purposes.) These two members are neither referenced nor changed by the generic button class. Making this structure visible somewhat breaks the Forms Library's convention of hiding the instance specific data but the convenience and consistency gained by this far outweights the compromise on data hiding. The basic procedures in creating a new button-like object are as follows. First, just like creating any other object classes, you have to decide on a class ID, an integer between `FL_USER_CLASS_START' (1001) and `FL_USER_CLASS_END' (9999) inclusive. Then write a header file so that application programs can use this new class. The header file should include the class ID definition and function prototypes specific to this new class. After the header file is created, you will have to write C functions that create and draw the button. You also will need an interface routine to place the newly created button onto a form. After creating the generic button, the new button class should be made known to the button driver via the following function void fl_add_button_class(int objclass, void (*draw)(FL_OBJECT *), void (*cleanup)(FL_BUTTON_SPEC *)); where `objclass' is the class ID, and `draw' is a function that will be called to draw the button. `cleanup' is a function that will be called prior to destroying the button. You need a cleanup function only if the drawing routine uses the `cspecv' field of `FL_BUTTON_STRUCT' to hold memory allocated dynamically by the new button. We use two examples to show how new buttons are created. The first example is taken from the button class in the Forms Library, i.e., its real working source code that implements the button class. To illustrate the entire process of creating this class, let us call this button class `FL_NBUTTON'. First we create a header file to be included in an application program that uses this button class: #ifndef NBUTTON_H_ #define NBUTTON_H_ #define FL_NBUTTON FL_USER_CLASS_START extern FL_OBJECT *fl_create_nbutton(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char *); extern FL_OBJECT *fl_add_nbutton(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char *); #endif Now to the drawing function. We use `obj->col1' for the normal color of the box and `obj->col2' for the color of the box when pushed. We also add an extra property so that when mouse moves over the button box, the box changes color. The following is the full source code that implements this: static void draw_nbutton(FL_OBJECT *obj) { FL_COLOR col; /* box color. If pushed we use obj->col2, otherwise use obj->col1 */ col = ((FL_BUTTON_STRUCT *) obj->spec)->val ? obj->col2 : obj->col1; /* if mouse is on top of the button, we change the color of * the button to a different color. However we only do this * if the * box has the default color. */ if (obj->belowmouse && col == FL_COL1) col = FL_MCOL; /* If original button is an up_box and it is being pushed, * we draw a down_box. Otherwise, don't have to change * the boxtype */ if ( obj->boxtype == FL_UP_BOX && ((FL_BUTTON_STRUCT *) obj->spec)->val) fl_draw_box(FL_DOWN_BOX, obj->x, obj->y, obj->w, obj->h, col, obj->bw); else fl_draw_box(obj->boxtype, obj->x, obj->y, obj->w, obj->h, col, obj->bw); /* draw the button label */ fl_draw_object_label(obj); /* if the button is a return button, draw the return symbol. * Note that size and style are 0 as they are not used when * drawing symbols */ if (obj->type == FL_RETURN_BUTTON) fl_draw_text(FL_ALIGN_CENTER, obj->x + obj->w - 0.8 * obj->h - 1, obj->y + 0.2 * obj->h, 0.6 * obj->h, 0.6 * obj->h, obj->lcol, 0, 0, "@returnarrow"); } Note that when drawing symbols, the style and size are irrelevent and set to zero in `*note fl_draw_text()::' above. Since we don't use the `cspecv' field to point to dynamically allocated memory we don't have to write a clean-up function. Next, following the standard procedures of the Forms Library, we code a separate routine that creates the new button(1) FL_OBJECT *fl_create_nbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) { FL_OBJECT *obj; obj = fl_create_generic_button(FL_NBUTTON, type, x, y, w, h, label); fl_add_button_class(FL_NBUTTON, draw_nbutton, NULL); obj->col1 = FL_COL1; /* normal color */ obj->col2 = FL_MCOL; /* pushed color */ obj->align = FL_ALIGN_CENTER; /* button label placement */ return obj; } You will also need a routine that adds the newly created button to a form FL_OBJECT *fl_add_nbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) { FL_OBJECT *obj = fl_create_nbutton(type, x, y, w, h, label); fl_add_object(fl_current_form, obj); return obj; } This concludes the creation of button class `FL_NBUTTON'. The next example implements a button that might be added to the Forms Library in the future. We call this button a crossbutton. Normally, this button shows a small up box with a label on the right. When pushed, the up box becomes a down box and a small cross appears on top of it. This kind of button obviously is best used as a push button or a radio button. However, the Forms Library does not enforce this. It can be enforced, however, by the application program or by the object class developers. [image src="xforms_images/crossbutton.png"] We choose to use `obj->col1' as the color of the box and `obj->col2' as the color of the cross (remember these two colors are changeable by the application program via `*note fl_set_object_color()::'). Note that this decision on color use is somewhat arbitrary, we could have easily made `obj->col2' the color of the button when pushed and use `obj->spec->cspecl' for the cross color (another routine named e.g., `fl_set_crossbutton_crosscol()' should be provided to change the cross color in this case). We start by defining the class ID and declaring the utility routine prototypes in the header file `crossbut.h': #ifndef CROSSBUTTON_H_ #define CROSSBUTTON_H_ #define FL_CROSSBUTTON (FL_USER_CLASS_START + 2) extern FL_OBJECT *fl_add_crossbutton(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char *); extern FL_OBJECT *fl_create_crossbutton(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char *); #endif Next we write the actual code that implements crossbutton class and put it into `crossbut.c': /* routines implementing the "crossbutton" class */ #include #include "crossbut.h" /** How to draw it */ static void draw_crossbutton(FL_OBJECT *obj) { FL_Coord xx, yy, ww, hh; FL_BUTTON_STRUCT *sp = obj->spec; /* There is no visual change when mouse enters/leaves the box */ if (sp->event == FL_ENTER || sp->event == FL_LEAVE) return; /* draw the bounding box first */ fl_draw_box(obj->boxtype, obj->x, obj->y, obj->w, obj->h, obj->col1, obj->bw); /* Draw the box that contains the cross */ ww = hh = (0.5 * FL_min(obj->w, obj->h)) - 1; xx = obj->x + FL_abs(obj->bw); yy = obj->y + (obj->h - hh) / 2; /* If pushed, draw a down box with the cross */ if (sp->val) { fl_draw_box(FL_DOWN_BOX, xx, yy, ww, hh, obj->col1, obj->bw); fl_draw_text(FL_ALIGN_CENTER, xx - 2, yy - 2, ww + 4, hh + 4, obj->col2, 0, 0, "@9plus"); } else fl_draw_box(FL_UP_BOX, xx, yy, ww, hh, obj->col1, obj->bw); /* Draw the label */ if (obj->align == FL_ALIGN_CENTER) fl_draw_text(FL_ALIGN_LEFT, xx + ww + 2, obj->y, 0, obj->h, obj->lcol, obj->lstyle, obj->lsize, obj->label); else fl_draw_object_label_outside(obj); if (obj->type == FL_RETURN_BUTTON) fl_draw_text(FL_ALIGN_CENTER, obj->x + obj->w - 0.8 * obj->h, obj->y + 0.2 * obj->h, 0.6 * obj->h, 0.6 * obj->h, obj->lcol, 0, 0, "@returnarrow"); } This button class is somewhat different from the normal button class (`FL_BUTTON') in that we enforce the appearance of a crossbutton so that an un-pushed crossbutton always has an upbox and a pushed one always has a downbox. Note that the box that contains the cross is not the bounding box of a crossbutton although it can be if the drawing function is coded so. The rest of the code simply takes care of interfaces: /* creation routine */ FL_OBJECT * fl_create_crossbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) { FL_OBJECT *obj; fl_add_button_class(FL_CROSSBUTTON, draw_crossbutton, NULL); /* if you want to make cross button only available for * push or radio buttons, do it here as follows: if (type != FL_PUSH_BUTTON && type != FL_RADIO_BUTTON) type = FL_PUSH_BUTTON; */ obj = fl_create_generic_button(FL_CROSSBUTTON, type, x, y, w, h, label); obj->boxtype = FL_NO_BOX; obj->col2 = FL_BLACK; /* cross color */ return obj; } /* interface routine to add a crossbutton to a form */ FL_OBJECT *fl_add_crossbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) { FL_OBJECT *obj = fl_create_crossbutton(type, x, y, w, h, label); fl_add_object(fl_current_form, obj); return obj; } The actual code is in the demo directory, see the files `crossbut.c' and `crossbut.h'. An application program only needs to include the header file `crossbut.h' and link with `crossbut.o' to use this new object class. There is no need to change or re-compile the Forms Library. Of course, if you really like the new object class, you can modify the system header file `forms.h' to include your new class header file automatically (either through inclusion at compile time or by including the actual header). You can also place the object file (`crossbut.o') in `libforms.a' and `libforms.so' if you wish. Note however that this will make your application programs dependent on your personal version of the library. Since the current version of Form Designer does not support any new object classes developed as outlined above, the best approach is to use another object class as stubs when creating a form, for example, you might want to use checkbutton as stubs for the crossbutton. Once the position and size are satisfactory, generate the C-code and then manually change checkbutton to crossbutton. You probably can automate this with some scripts. Finally there is a demo program utilizing this new button class. The program is `newbutton.c'. ---------- Footnotes ---------- (1) A separate creation routine is useful for integration into the Form Designer.  File: xforms.info, Node: Part IV Using a Pre-emptive Handler, Next: Part V, Prev: Part IV New Buttons, Up: Top 31 Using a Pre-emptive Handler ****************************** Pre-emptive handlers came into being due to reasons not related to developing new classes. They are provided for the application programs to have access to the current state or event of a particular object. However, with some care, this preemptive handler can be used to override parts of the original built-in handler thus yielding a new class of objects. As mentioned earlier, an object module communicates with the main module via events. Central part of the module is the event handler, which determines how an object responds to various events such as mouse clicks or a key presses. Now a pre-emptive handler is a function which, if installed, gets called first by the main module when an event for the object occurs. The pre-emptive handler has the option to override the built-in handler by informing the main module not to call the built-in handler (and a possibly also installed post handler), thus altering the behavior of the object. A post handler, on the other hand, is called when the object handler has finished its tasks and thus does not offer the capability of overriding the built-in handler. It is much safer, however. The API to install a pre- or post-handler for an object is as follows typedef int (*FL_HANDLEPTR)(FL_OBJECT *obj, int event, FL_Coord mx, FL_Coord my, int key, void *raw_event); void fl_set_object_prehandler(FL_OBJECT *obj, FL_HANDLEPTR pre_handler); void fl_set_object_posthandler(FL_OBJECT *obj, FL_HANDLEPTR post_handler); `event' is a generic event of the Forms Library, that is, `*note FL_DRAW::', `*note FL_ENTER::' etc. Parameters `mx' and `my' are the mouse position and `key' is the key pressed. The last parameter `raw_event' is a pointer to the XEvent (cast to a void pointer due to the different types of Xevents) that caused the invocation of the pre- or post-handler. But note: not all events of the Form Library have a corresponding Xevent and thus dereferencing of `xev' should only be done after making sure it is not `NULL'. The pre- and post-handler have the same function prototype as the built-in handler. Actually they are called with exactly the same parameters by the event dispatcher. The pre-handler should return `FL_PREEMPT' to prevent the dispatcher from calling the normal object handler for events and `!FL_PREEMPT' if the objects handler for is to be invoked next. The post-handler may return whatever it wants since the return value is not used. Note that a post-handler will receive all events even if the object the post-handler is registered for does not. For example, a post-handler for a box (a static object that only receives `*note FL_DRAW::') receives all events. Note that when an object has been de-activated using `*note fl_deactivate_object()::' (or the whole form the object belongs to is de-activated via calls of `*note fl_deactivate_form()::' or `*note fl_deactivate_all_forms()::') also pre-emptive and post-handlers won't get invoked for the object. See the demo programs `preemptive.c' and `xyplotall.c' for examples. Bear in mind that modifying the built-in behavior is in general not a good idea. Using a pre-emptive handler for the purpose of "peeking", however, is quite legitimate and can be useful in some situations.  File: xforms.info, Node: Part V, Next: Part V Overview of Main Functions, Prev: Part IV Using a Pre-emptive Handler, Up: Top _Part V - General Informations_ ******************************* * Menu: * Part V Overview of Main Functions:: * Part V Some Useful Functions:: * Part V Resources for Forms Library:: * Part V Dirty Tricks:: * Part V Trouble Shooting::  File: xforms.info, Node: Part V Overview of Main Functions, Next: Part V Some Useful Functions, Prev: Part V, Up: Top 32 Overview of Main Functions ***************************** In this chapter we give a brief overview of all the main functions that are available. For an overview of all routines related to specific object classes see Part III. * Menu: * Version Information:: * Initialization:: * Creating Forms:: * Object Attributes:: * Doing Interaction:: * Signals:: * Idle Callbacks and Timeouts:: * Global Variables and Macros::  File: xforms.info, Node: Version Information, Next: Initialization, Up: Part V Overview of Main Functions 32.1 Version Information ======================== The header file `forms.h' defines three symbolic constants which you can use to conditionally compile your application. They are `FL_VERSION' The major version number. `FL_REVISION' Revision number. `FL_INCLUDE_VERSION' `1000 * FL_VERSION + FL_REVISION' There is also a routine that can be used to obtain the library version at run time: int fl_library_version(int *version, int *revision) The function returns a consolidated version information, computed as `1000 * version + revision'. For example, for library version 1 revision 21 (1.21), the function returns a value of 1021 with `version' and `revision' (if not `NULL') set to 1 and 21, respectively. It is always a good idea to check if the header and the run time library are of the same version and take appropriate actions when they are not. This is especially important for versions less than 1. To obtain the version number of the library used in an executable, run the command with `-flversion' option, which will print the complete version information.  File: xforms.info, Node: Initialization, Next: Creating Forms, Prev: Version Information, Up: Part V Overview of Main Functions 32.2 Initialization =================== The routine Display *fl_initialize(int *argc, char *argv[], const char *appclass, XrmOptionDescList app_opt, int n_app_opt); initializes the Forms Library and returns a pointer to the `Display' structure if a connection could be made, otherwise `NULL'. This function must be called before any other calls to the Forms Library (except `*note fl_set_defaults()::' and a few other functions that alter some of the defaults of the library). The meaning of the arguments is as follows `argc, argv' Number and array of the command line arguments the application was started with. The application name is derived from `argv[0]' by stripping leading path names and trailing period and extension, if any. Due to the way the X resources (and command line argument parsing) work, the executable name should not contain a dot `.' or a star `*'. `appclass' The application class name, which typically is the generic name for all instances of this application. If no meaningful class name exists, it is typically given (or converted to if non given) as the application name with the first letter capitalized (second if the first letter is an X). `app_opt' Specifies how to parse the application-specific resources. `n_app_opt' Number of entries in the option list. The `*note fl_initialize()::' function builds the resource database, calls the Xlib `XrmParseCommand()' function to parse the command line arguments and performs other per display initialization. After the creation of the database, it is associated with the display via `XrmSetDatabase()', so the application can get at it if necessary. All recognized options are removed from the argument list and their corresponding values set. The XForms library provides appropriate defaults for all options. The following are recognized by the library: *Option* *Type* *Meaning* *Default* `-fldebug' level int Print debug information 0 (off) `-name' appname string Change application name none `-flversion' Print version of the library `-sync' Synchronous X11 mode (debug) false `-display' string Set (remote) host `$DISPLAY' host:dpy `-visual' class string TrueColor, PseudoColor... best `-depth' depth int Set prefered visual depth best `-vid' id long Set prefered visual ID 0 `-private' Force use of private colormap false `-shared' Force use of shared colormap false `-stdcmap' Force use of standard colormap false `-double' Enable double buffering for false forms `-bw' width int Set object border width 1 `-rgamma' gamma float Set red gamma 1.0 `-ggamma' gamma float Set green gamma 1.0 `-bgamma' gamma float Set blue gamma 1.0 In the above table "best" means the visual that has the most colors, which may or may not be the server's default. There is a special command option `-visual Default' that sets both the visual and depth to the X servers default. If a visual ID is requested, it overrides depth or visual if specified. The visual ID can also be requested programmatically (before `*note fl_initialize()::' is called) via the function void fl_set_visualID(long id); Note that all command line options can be abbreviated, thus if the application program uses single character options, they might clash with the built-ins. For example, if you use `-g' as a command line option to indicate geometry, it might not work as `-g' matches `-ggamma' in the absence of `-ggamma'. Thus you should avoid using single character command line options. If the border width is set to a negative number, all objects appear to have a softer appearance. Older version of the library used a larger default for the border width of 3. As mentioned the `*note fl_initialize()::' function removes all the above listed values from the command line arguments, leaving you with a cleaned-up list. To get again at the complete list you can use the function char **fl_get_cmdline_args( int *arg_cnt ); returning a copy to the values from the original list and their number via the `arg_cnt' argument. Depending on your application XForms defaults may or may not be appropriate. E.g., on machines capable of 24 bits visuals, Forms Library always selects the deeper 24 bits visual. If your application only uses a limited number of colors, it might be faster if a visual other than 24 bits is selected. There are a couple of ways to override the default settings. You can provide an application specific resource database distributed with your program. The easiest way, however, is to set up your own program defaults programmatically without affecting the users' ability to override them with command line options. For this, you can use the following routine before calling `*note fl_initialize()::': void fl_set_defaults(unsigned long mask, FL_IOPT *flopt); In addition to setting a preferred visual, this function can also be used to set other program defaults, such as label font size, unit of measure for form sizes etc. The following table lists the fields, masks and their meanings of `*note FL_IOPT::': Structure Mask Name Meaning --------------------------------------------------------------------------- `typedef struct {' `int debug;' `FL_PDDebug' Debug level (0-5) `int depth;' `FL_PDDepth' Preferred visual depth `int vclass;' `FL_PDVisual' Prefered visual, `TrueColor' etc. `int `FL_PDDouble' Simulate double buffering doubleBuffer;' `int `FL_PDButtonFontSize' Default button label font size buttonFontSize;' `int `FL_PDMenuFontSize' Menu label font size menuFontSize;' `int `FL_PDChoiceFontSize' Choice label and choice text choiceFontSize;' font size `int `FL_PDBrowserFontSize' Browser label and text font size browserFontSize;' `int `FL_PDInputFontSize' Input label and text font size inputFontSize;' `int `FL_PDLabelFontSize' Label font size for all other labelFontSize;' objects (box, pixmap etc.) `int pupFontSize;' `FL_PDPupFontSize' Font size for pop-ups `int `FL_PDPrivateMap' Select private colormap if privateColormap;' appropriate `int `FL_PDSharedMap' Force use of shared colormap sharedColormap;' `int `FL_PDStandardMap' Force use of standard colormap standardColormap;' `int `FL_PDScrollbarType' Scrollbar type to use for scrollbarType;' browser and input `int ulThickness;' `FL_PDULThickness' Underline thickness `int ulPropWidth;' `FL_PDULPropWidth' Underline width, 0 for const. width fonts `int `FL_PDBS' Turn BackingStore on or off backingStore;' `int coordUnit;' `FL_PDCoordUnit' Unit of measure: pixel, mm, point `int borderWidth;' `FL_PDBorderWidth' Default border width `} FL IOPT;' A special visual designation, `FL_DefaultVisual' and a command line option equivalent, `-visual Default' are provided to set the program default to the server's default visual class and depth. If you set up your resource specifications to use class names instead of instance names, users can then list instance resources under an arbitrary name that is specified with the `-name' option. Coordinate units can be in pixels, points (1/72 inch), mm (millimeters), cp (centi-point, i.e., 1/100 of a point) or cmm (centi-millimeter). The the type of unit in use can be queried or set via the functions int fl_get_coordunit(void); void fl_set_coordunit(int coordUnit); `coordUnit' can have the following values: `FL_COORD_PIXEL', `FL_COORD_POINT', `FL_COORD_MM', `FL_COORD_centiPOINT' and `FL_COORD_centiMM'. The unit in use can be changed anytime, but typically you would do this prior to creating a form, presumably to make the size of the form screen resolution independent. The basic steps in doing this may look something like the following: int oldcoordUnit = fl_get_coordunit(); fl_set_coordunit(FL_COORD_POINT); fl_bgn_form(...); /* add more objects */ fl_end_form(); fl_set_coordunit(oldcoordunit); Some of the defaults are "magic" in that their exact values depend on the context or platform. For example, the underline thickness by default is 1 for normal fonts and 2 for bold fonts. There exists a convenience function to set the application default border width void fl_set_border_width(int border_width) which is equivalent to FL_IOPT fl_cntl; fl_cntl.borderWidth = border_width; fl_set_defaults(FL_PDBorderWidth, &fl_cntl); Typically this function, if used, should appear before `*note fl_initialize()::' is called so the user has the option to override the default via resource or command line options. The cirrent setting of the borderwidth can also tested via int fl_get_border_width(void); To change the default scrollbar type (which is `THIN_SCROLLBAR') used in browser and input object, the following convenience function can be used: void fl_set_scrollbar_type(int type); where `type' can be one of the following `FL_NORMAL_SCROLLBAR' Basic scrollbar `FL_THIN_SCROLLBAR' Thin scrollbar `FL_NICE_SCROLLBAR' Nice scrollbar `FL_PLAIN_SCROLLBAR' Similar to thin scrollbar, but not as fancy Setting the scrollbar type before calling `*note fl_initialize()::' is equivalent to FL_IOPT fl_cntl; fl_cntl.scrollbarType = type; fl_set_defaults(FL_PDScrollbarType, &fl_cntl); It is recommended that this function be used before `*note fl_initialize()::' so the user has the option to override the default through application resources. Prior to version 0.80 the origin of XForms' coordinate system was at the lower left-hand corner of the form. The new Form Designer will convert the form definition file to the new coordinate system, i.e., with the origin at the upper left-hand corner, so no manual intervention is required. To help those who lost the `.fd' files or otherwise can't use a newer version of `fdesign', a compatibility function is provided void fl_flip_yorigin(void); Note however that this function must be called prior to `*note fl_initialize()::' and is a no-op after that. If this function has been called functions like `*note fl_get_object_position()::' or `*note fl_get_object_bbox()::', reporting an objects positions and bounding box, will return `y'-coordinates in the old-fashioned coordinate system with the origin at the left bottom corner of the form. Similarly, the functions for setting or changing an objects position (`*note fl_set_object_position()::' and `*note fl_move_object()::') then expect to receive arguments for the `y'-coordinates in this system. The `y'-coordinate stored in the object itself (i.e., `obj->y') is always for the normal coordinate system with the origin at the top left corner. For proportional font, substituting tabs with spaces is not always appropriate because this most likely will fail to align text properly. Instead, a tab is treated as an absolute measure of distance, in pixels, and a tab stop will always end at multiples of this distance. Application program can adjust this distance by setting the tab stops using the following routine void fl_set_tabstop(const char *s); where `s' is a string whose width in pixels is to be used as the tab length. The font used to calculate the width is the same font that is used to render the string in which the tab is embedded. The default `"aaaaaaaa"', i.e., eight `'a''s. Before we proceed further, some comments about double buffering are in order. Since Xlib does not support double buffering, Forms Library simulates this functionality with pixmap bit-bliting. In practice, the effect is hardly distinguishable from double buffering and performance is on par with multi-buffering extensions (It is slower than drawing into a window directly on most workstations however). Bear in mind that a pixmap can be resource hungry, so use this option with discretion. In addition to using double buffering throughout an application, it is also possible to use double buffering on a per-form or per-object basis by using the following routines: void fl_set_form_dblbuffer(FL_FORM *form, int yes_no); void fl_set_object_dblbuffer(FL_OBJECT *obj, int yes_no); Currently double buffering for objects having a non-rectangular box might not work well. A nonrectangular box means that there are regions within the bounding box that should not be painted, which is not easily done without complex and expensive clipping and unacceptable inefficiency. XForms gets around this by painting these regions with the form's backface color. In most cases, this should prove to be adequate. If needed, you can modify the background of the pixmap by changing `obj->dbl_background' after switching to double buffer. Normally the Forms Library reports errors to `stderr'. This can be avoided or modified by registering an error handling function void fl_set_error_handler(void (*user_handler)(const char *where, const char *fmt,...)); The library will call the `user_handler' function with a string indicating in which function an error occured and a formatting string (see `sprintf()') followed by zero or more arguments. To restore the default handler, call the function again with `user_handler' set to `NULL'. You can call this function anytime and as many times as you wish. You can also instruct the default message handler to log the error to a file instead of printing to `stderr' void fl_set_error_logfp(FILE *fp); For example fl_set_error_logfp(fopen("/dev/null","w")); redirects all error messages to `/dev/null', effectively turning off the default error reporting to `stderr'. In XForms versions older than 1.0.01 for some error messages, in addition to being printed to stderr, a dialog box were shown that requires actions from the user. This could be turned off and on with the function void fl_show_errors(int show); where `show' indicates whether to show (1) or not show (0) the errors. With newer versions of the Forms Library this function has no effect. The fonts used in all forms can be changed using the routines int fl_set_font_name(int n, const char *name); int fl_set_font_name_f(int n, const char *fmt, ,,,); The first function just accepts a simple string while the second constructs the font name from a format string just as it's used for `printf()' etc. and the following arguments. The first argument, `n', must be a number between 0 and `FL_MAXFONTS-1'. The function returns `0' on success, `1' if called before proper initialization of the library and `-1' for either invalid arguments (`name' or the result of the expansion of the format string doesn't name an available font, `n' negative or not less than `FL_MAXFONTS'). *Note Label Attributes and Fonts::, for details. A redraw of all forms is required to actually see the change for visible forms. Since the dimension of an object is typically given in pixels, depending on the server resolution and the font used, this can lead to unsatisfactory user interfaces. For example, a button designed to (just) contain a label in a 10 pt font on a 75 DPI monitor will have the label overflow the button on a 100 DPI monitor. This comes about because a character of a 10 pt font when rendered with `75 DPI' resolution may have 10 pixels while the same character in the same 10 pt font with 100 DPI resolution may have 14 pixels. Thus, when designing the interfaces, leave a few extra pixels for the object. Or use a resolution independent unit, such as point, or centi-point etc. Using a resolution independent unit for the object size should solve the font problems, theoretically. In practice, this approach may still prove to be vulnerable. The reason is the discreteness of both the font resolution and the monitor/server resolutions. The standard X fonts only come in two discrete resolutions, 75 DPI and 100 DPI. Due to the variations in monitor resolutions, the theoretically identical sized font, say a 10 pt font, can vary in sizes (pixels) by up to 30%, depending on the server (rendering a font on a 80 DPI monitor will cause errors in sizes regardless if a 75 DPI or 100 DPI font is used.) This has not even taken into account the fact that a surprising number of systems have wrong font paths (e.g., a 90 DPI monitor using 75 DPI fonts etc.). With the theoretical and practical problems associated with X fonts, it is not practical for XForms to hard-code default font resolution and it is not practical to use the resolution information obtained from the server either as information obtained from the server regarding monitor resolution is highly unreliable. Thus, XForms does not insist on using fonts with specific resolutions and instead it leaves the freedom to select the default fonts of appropriate resolutions to the system administrators. Given all these uncertainties regarding fonts, as a workaround, XForms provides a function that can be used to adjust the object size dynamically according to the actual fonts loaded: double fl_adjust_form_size(FL_FORM *form); This function works by computing the size (in pixels) of every object on the form that has an inside label and compares it to the size of the object. Scaling factors are computed for all object labels that don't fit. The maximum scaling factor found is then used to scale the form so every object label fits inside the object. It will never shrink a form. The function returns the resulting scaling factor. In scaling the aspect ratio of the form is left unmodified and all object gravity specifications are ignored. Since this function is meant to compensate for font size and server display resolution variations, scaling is limited to 125% per invocation. The best place to use this function is right after the creation of the forms. If the forms are properly designed this function should be a no-op on the machine the forms were designed on. Form Designer has a special option `-compensate' and resource `compensate' to request the emission of this function automatically for every form created. It is likely that this will become the default once the usefulness of it has been established. There is a similar function that works the same way, but on an object-by-object basis and further allows explicit margin specifications: void fl_fit_object_label(FL_OBJECT *obj, FL_Coord hm, FL_Coord vm); where `hm' and `vm' are the horizontal and vertical margins to leave on each side of the object, respectively. This function works by computing the object labels size and comparing it to the object size. If the label does not fit inside the object with the given margin, the entire form the object is on is scaled so the object label fits. In scaling the form, all gravity specification is ignored but the aspect ratio of the form (and thus of all objects) is kept. This function will not shrink a form. You can use this function on as many objects as you choose. Of course the object has to have a label inside the object for this function to work. All colors with indices smaller than `FL_FREE_COL1' are used (or can potentially be used) by the Forms Library. If you wish they can be changed using the following function prior to `*note fl_initialize()::': void fl_set_icm_color(FL_COLOR index, int r, int g, int b); Using this function you can actually change all entries in the internal colormap (with `index' going up to `FL_MAX_COLORS-1'). You may also inspect the internal colormap using void fl_get_icm_color(FL_COLOR index, int *r, int *g, int *b); In some situations Forms Library may modify some of the server defaults. All modified defaults are restored as early as possible by the main loop and in general, when the application exits, all server defaults are restored. The only exception is when exiting from a callback that is activated by shortcuts. Thus it is recommended that the cleanup routine `*note fl_finish()::' is called prior to exiting an application or register it via `atexit()'. void fl_finish(void); In addition to restoring all server defaults, `*note fl_finish()::' also shuts down the connection and frees dynamically allocated memory.  File: xforms.info, Node: Creating Forms, Next: Object Attributes, Prev: Initialization, Up: Part V Overview of Main Functions 32.3 Creating Forms =================== To start the definition of a form call FL_FORM *fl_bgn_form(int type, FL_Coord w, FL_Coord h); When the form is created it automatically acquires one object, a box object covering the full area of the form, which is used as the background of the form. The `type' argument is the type of this box object, so you can "style" the look of your forms (but don't use any non-rectangular box types). `w' and `h' are the width and height of the new form. The function returns a pointer to the new form. Note: if you look at the code generated by `fdesign' for the creation of a form you may notice that the type of this automatically assigned box is `*note FL_NO_BOX::' (which is invisible) and that for the background another box of the same size but a different (visible) type is added. This is because in `fdesign' the very first object can't be accessed and thus its properties can not be adjusted (like the box type or its color that then becomes the background color of the form). By using an extra box, which can be accessed from within `fdesign', that problem is circumvented. There also exist functions for setting and requesting the background color of a form void fl_set_form_background_color(FL_FORM *form, FL_COLOR col); FL_COLOR fl_get_form_background_color(FL_FORM *form); These functions use the color of the very first object of the form, or, if this is a box of type `*note FL_NO_BOX::' as it is the case with forms created via code generated by `fdesign', the color of the second object. If these object(s) don't exist the function can't work properly. Once all objects required have been added to a form call void fl_end_form(void); Between these two calls objects and groups of objects are added to the form with functions like `*note fl_add_button()::'. To start a new group of objects use FL_OBJECT *fl_bgn_group(void); The function returns a pointer to the group (actually to an invisible pseudo-object of class `FL_BEGIN_GROUP'). Groups can't be nested. When all objects that are supposed to belong to the group are added call void fl_end_group(void); Also this function creates an (invisible) pseudo-object, belonging to class `FL_END_GROUP', but since it can't be used its address isn ot returned. Groups are useful for two reasons. First of all, it is possible to hide or deactivate groups of objects with a single function call. This is often very handy to dynamically change the appearance of a form depending on the context or selected options. In addition it can also be used as a shortcut to set some particular attributes of several objects. It is not uncommon that you want several objects to maintain their relative positioning upon form resizing. This requires to set the gravity for each object. If these objects are placed inside a group, setting the gravity attributes of the group will suffice. The second reason for use of groups is radio buttons. Radio buttons are considered related only if they belong to the same group. Using groups is the only way to place unrelated groups of radio buttons on a single form without interference from each other. Both forms and groups that have been ended by `*note fl_end_form()::' or `*note fl_end_group()::' can be "reopened" by using FL_FORM *fl_addto_form(FL_FORM *form) FL_OBJECT *fl_addto_group(FL_OBJECT *group); Both functions return their argument on success and `NULL' on failure (e.g., because a different group or form is still open). On success further objects can be appended to the form or group. To remove an object from a form use void fl_delete_object(FL_OBJECT *obj); This does not yet destroy the object, it just breaks its connection to the form it did belong to, so it can still be referenced and added to the same form again or some other form using void fl_add_object(FL_FORM *form, FL_OBJECT *obj); even without "reopening" the form using `*note fl_addto_form()::'. To finally destroy an object use void fl_free_object(FL_OBJECT *obj); If `*note fl_delete_object()::' hadn't been called for the object this will happen now. The object receives a final event of type `*note FL_FREEMEM::' to allow it to free memory it did allocate and do whatever other clean-up required. Finally all memory allocated for the object is freed. After being freed an object can not be referenced anymore. A form as a whole, together with all the objects it contains can be deleted by calling void fl_free_form(FL_FORM *form); This will first hide the form (emitting warning if this is necessary), then free all of its objects and finally release memory allocated for the form.  File: xforms.info, Node: Object Attributes, Next: Doing Interaction, Prev: Creating Forms, Up: Part V Overview of Main Functions 32.4 Object Attributes ====================== A number of general routines are available for setting and querying attributes. Unless stated otherwise, all attributes altering routines affect the appearance or geometry of the object immediately if the object is visible. Since the object class and type of an object can't be changed anymore once an object has been created there are only functions for querying these attributes: int fl_get_object_objclass(FL_OBJECT *obj); int fl_get_object_type(FL_OBJECT *obj); Receiving a negative value indicates that a `NULL' pointer was passed to the functions. To set the two colors that influence the appearance of the object use void fl_set_object_color(FL_OBJECT *obj, FL_COLOR col1, FL_COLOR col2); and to find out about the colors of an object use void fl_get_object_color(FL_OBJECT *obj, FL_COLOR *col1, FL_COLOR *col2); void fl_set_object_boxtype(FL_OBJECT *obj, int boxtype); Changes the shape of the box of the object. Please note that not all possible boxtypes are suitable for all types of objects, see the documentation for the different objects for limitations. To find out the current boxtype of an object use int fl_get_object_boxtype(FL_OBJECT *obj); Receiving a negative value indicates that a `NULL' pointer was passed to the function. There are also functions to change or query the border width of an object: void fl_set_object_bw(FL_OBJECT *obj, int bw); void fl_get_object_bw(FL_OBJECT *obj, int *bw); If the requested border width is 0, -1 is used. To change or inquire the objects position (relative to the form it belongs to) the functions void fl_set_object_position(FL_OBJECT *obj, FL_Coord x, FL_Coord y); void fl_get_object_position(FL_OBJECT *obj, FL_Coord *x, FL_Coord *y); exist. If the object is visible it's redrawn at the new position. An object can also be moved relative to its current position using the function void fl_move_object(FL_OBJECT *obj, FL_Coord dx, FL_Coord dy); where `dx' and `dy' are the amounts by which the object is moved to the right and down. To change or inquire about the size of an object use void fl_set_object_size(FL_OBJECT *obj, FL_Coord w, FL_Coord h); void fl_get_object_size(FL_OBJECT *obj, FL_Coord *w, FL_Coord *h); When changing the size of the object the position of its upper left hand corner remains unchanged. To set or query both the position and the size of an object the functions void fl_set_object_geometry(FL_OBJECT *obj, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h); void fl_get_object_geometry(FL_OBJECT *obj, FL_Coord *x, FL_Coord *y, FL_Coord (*w, FL_Coord *h); can be used. Please note: always use one of the above functions to change the position and/or size of an object and don't try to change the information stored in the object directly. There's some double bookkeeping going on under the hood that makes sure that the objects position and size won't change due to rounding errors when the whole form gets resized and changing the internal information kept in the objects structure would interfere with this. There's a second function for calculation an objects geometry: void fl_get_object_bbox(FL_OBJECT *obj, FL_Coord *x, FL_Coord *y, FL_Coord *w, FL_Coord *h); The difference between this functions and `*note fl_get_object_geometry()::' is that `*note fl_get_object_bbox()::' returns the bounding box size that has the label, which could be drawn outside of the object figured in. Some objects in the library are composite objects that consist of other objects. For example, the scrollbar object is made of a slider and two scroll buttons. To get a handle to one of the components of the composite object, the following routine is available: FL_OBJECT *fl_get_object_component(FL_OBJECT *obj, int objclass, int type, int number); where `obj' is the composite object, `objclass' and `type' are the component object's class ID and type; and `number' is the sequence number of the desired object in case the composite has more than one object of the same class and type. You can use a constant -1 for `type' to indicate any type of class `objclass'. The function returns the object handle if the requested object is found, otherwise `NULL'. For example to obtain the object handle to the horizontal scrollbar in a browser, code similiar to the following can be used hscrollbar = fl_get_object_component(browser, FL_SCROLLBAR, FL_HOR_THIN_SCROLLBAR, 0) To influence change the color, font size, font style, alignment and text of the label of an object use void fl_set_object_lcolor(FL_OBJECT *obj, FL_COLOR lcol); void fl_set_object_lsize(FL_OBJECT *obj, int lsize); void fl_set_object_lstyle(FL_OBJECT *obj, int lstyle); void fl_set_object_lalign(FL_OBJECT *obj, int align); void fl_set_object_label(FL_OBJECT *obj, const char *label); void fl_set_object_label(FL_OBJECT *obj, const char *fmt, ...); To find out about the object labels color, font size, style, alignment and the string itself use FL_COLOR fl_get_object_lcolor(FL_OBJECT *obj); int fl_get_object_lsize(FL_OBJECT *obj); int fl_get_object_lstyle(FL_OBJECT *obj); int fl_get_object_lalign(FL_OBJECT *obj); const char * fl_get_object_label(FL_OBJECT *obj); To set a tool-tip text for an object use the following routines void fl_set_object_helper(FL_OBJECT *obj, const char *helpmsg); void fl_set_object_helper_f(FL_OBJECT *obj, const char *fmt, ...); where `helpmsg' is a text string (with possible embedded newlines in it) that will be shown when the mouse hovers over the object for nore than about 600 msec. A copy of the string is made internally. The second functions accepts instead of a simple string a format string just as it's used for `printf()' etc., followed by as many further arguments as the format string contains format specifiers. The boxtype, color and font for the tool-tip message displayed can be customized further using the following routines: void fl_set_tooltip_boxtype(int boxtype); void fl_set_tooltip_color(FL_COLOR textcolor, FL_COLOR background); void fl_set_tooltip_font(int style, int size); where `boxtype' is the backface of the form that displays the text. The default is `*note FL_BORDER_BOX::'. `textcolor' and `background' specify the color of the text and the color of the backface. The defaults for these are `FL_BLACK' and `FL_YELLOW'. `style' and `size' are the font style and size of the text. There are four function for controlling how an object reacts to resizing the form it belongs to or to find out what its current settings are: void fl_set_object_resize(FL_OBJECT *obj, unsigned int howresize); void fl_get_object_resize(FL_OBJECT *obj, unsigned int *howresize); void fl_set_object_gravity(FL_OBJECT *obj, unsigned int NWgravity, unsigned int SEgravity); void fl_get_object_gravity(FL_OBJECT *obj, unsigned int *NWgravity, unsigned int *SEgravity); *Note Doing Interaction: Part I Doing Interaction, for more details on the resizing behaviour of objects. If you change many attributes of a single object or many objects in a visible form the changed object is redrawn after each change. To avoid this put the changes between calls of the two functions void fl_freeze_form(FL_FORM *form); void fl_unfreeze_form(FL_FORM *form); The form is automatically redrawn once it is "unfrozen", so a call of `*note fl_redraw_form()::' isn't required (and, while the form is "frozen", calling this function as well as `*note fl_redraw_object()::' has no effects). You may also freeze and unfreeze all forms at once by using void fl_freeze_all_forms(void); void fl_unfreeze_all_forms(void); There are also routines that influence the way events are dispatched. These routines are provided mainly to facilitate the development of (unusual) new objects where attributes need to be changed on the fly. These routines should not be used on the built-in ones. To enable or disable an object to receive the `*note FL_STEP::' event, use the following routine void fl_set_object_automatic(FL_OBJECT *obj, int yes_no); To determine if an object receives `*note FL_STEP::' events use int fl_object_is_automatic(FL_OBJECT *obj); To enable or disable an object to receive the `*note FL_DBLCLICK::' event use the following routine void fl_set_object_dblclick(FL_OBJECT *obj, unsigned long timeout); where `timeout' specifies the maximum time interval (in msec) between two clicks for them to be considered a double-click (using 0 disables double-click detection). To determine the current setting of the timeout use unsigned fl_get_object_dblclick(FL_OBJECT *obj); To make an object or a group invisible or visible use the following two functions void fl_hide_object(FL_OBJECT *obj); void fl_show_object(FL_OBJECT *obj); `obj' can be the pseudo-object returned by `*note fl_bgn_group()::' and then allows to hide or show whole groups of objects. To determine if an object is visible (given that the form it belongs to is also visible) use int fl_object_is_visible(FL_OBJECT *obj); void fl_trigger_object(FL_OBJECT *obj); returns `obj' to the application program after calling its callback if one exists. void fl_set_focus_object(FL_FORM *form, FL_OBJECT *obj); sets the input focus in form `form' to object `obj'. Note however, if this routine is used as a response to an `*note FL_UNFOCUS::' event, i.e., as an attempt to override the focus assignment by the main loop from within an objects event handler, this routine will not work as the main loop assigns a new focus object upon return from the object event handler, which undoes the focus change inside the event handler. To override the `*note FL_UNFOCUS::' event the following routine should be used: void fl_reset_focus_object(FL_OBJECT *obj); Use the following routine to obtain the object that has the focus on a form FL_OBJECT *fl_get_focus_object(FL_FORM *form); The routine void fl_set_object_callback(FL_OBJECT *obj, void (*callback)(FL_OBJECT *, long), long argument); binds a callback routine to an object. To invoke the callback manually (as opposed to invocation by the main loop), use the following function void fl_call_object_callback(FL_OBJECT *obj); If the object `obj' does not have a callback associated with it, this call has not effect. void fl_set_form_callback(FL_FORM *form, void (*callback)(FL_OBJECT *, void *), void *data); binds a callback routine to an entire form. It is sometimes useful to obtain the last X event from within a callback function, e.g., to implement different functionalities depending on which button triggers the callback. For this, the following routine can be used from within a callback function. const XEvent *fl_last_event(void); In other rare circumstances one might not be interested not in the X event but instead the internal XForms event resulting in the invocation of an object or form callback. This information can be obtained by calling int fl_current_event(void); A callback invocation resulting from a call of `*note fl_call_object_callback()::' will return `FL_TRIGGER'. For other possible return value see *note the chapter about XForms internal events: Part IV Events. Calling this function is only useful while within an object or form callback, at all other times it returns just `FL_NOEVENT'. Also in objects callback it might be of interest to find out if the mouse is on top of a certain letter of the (inside) label (one trivial use of this can be found in the program `demo/strange_button.c'. To find out about this use int fl_get_label_char_at_mouse(FL_OBJECT *obj); The function returns the index of the character in the label of the object the mouse is on or `-1' if it's not over the label. Note that this function has some limitations: it can only be used on labels inside of the object and the label string may not contain underline characters (and the label can't be a symbol) - if you try to use it on labels that don't satisfy these requirements `-1' is returned. Sometimes, it may be desirable to obtain hardcopies of some objects in a what-you-see-is-what-you-get (WYSISYG) way, especially those that are dynamic and of vector-graphics in nature. To this end, the following routine exists: int fl_object_ps_dump(FL_OBJECT *obj, const char *fname); The function will output the specified object in PostScript. If `fname' is `NULL', a file selector will be shown to ask the user for a file name. The function returns a negative number if no output is generated due to errors. At the moment, only the `FL_XYPLOT' object is supported. Nothe that this function isn't part of the statndard XForms library (`libforms') but the XForms image library (`libflimage' discussed in *note Part VI Images::. The object must be visible at the time of the function call. The hardcopy should mostly be WYSIWYG and centered on the printed page. The orientation is determined such that a balanced margin results, i.e., if the width of the object is larger than the height, landscape mode will be used. Further, if the object is too big to fit on the printed page, a scale factor will be applied so the object fits. The box underneath the object is by default not drawn and in the default black&white mode, all curves are drawn in black. See demo program `xyplotover.c' for an example output. It is possible to customize the output by changing the PostScript output control parameters via the function FLPS_CONTROL *flps_init(void); A typical use is to call this routine to obtain a handle to the PostScript output control structure and change the control structure members to suit your needs before calling `*note fl_object_ps_dump()::'. You should not free the returned buffer. The control structure has the following members `int ps_color' The choices are full color (`FLPS_COLOR'), grayscale (`FLPS_GRAYSCALE') and black&white (`FLPS_BW'). The default for xyplot is black and white. In this mode, all drawings are black, on a white background. If `drawbox' (see below) is true, the drawing color can be either white or black depending on the specified color. `int orientation' Valid choices are `FLPS_AUTO', `FLPS_PORTRAIT' and `FLPS_LANDSCAPE'. The default is `FLPS_AUTO'. `auto_fit' By default, this is true so the object always fits the printed page. Set it to false (0) to turn off auto-scaling. `int eps' Set this to 1 if output in EPS format is required. `int drawbox' Set this to 1 if the box of the object is to be drawn. `float xdpi, ydpi' These two are the screen resolution. The default is to use the actual resolution of the display. Note by setting a dpi number smaller or larger than the actual resolution, the output object is in effect being enlarged or shrunken. `float paper_w' The paper width in inches. The default is 8.5 in. `float paper_h' The paper height in inches. The default is 11 in. To generate a PostScript output of a form or forms, use the `fd2ps' program documented in *note Part II Generating Hardcopies::.  File: xforms.info, Node: Doing Interaction, Next: Signals, Prev: Object Attributes, Up: Part V Overview of Main Functions 32.5 Doing Interaction ====================== To display the form `form' on the screen use one of Window fl_show_form(FL_FORM *form, int place, int border, const char *title); Window fl_show_form(FL_FORM *form, int place, int border, const char *fmt, ...); `place' controls the position and size of the form. `border' indicates whether a border (window manager's decoration) should be drawn around the form. If a border is to be drawn `title' is the name of the window (and its associated icon). The routine returns the window identifier of the form. For resource and identification purposes, the form name is taken to be the title with spaces removed and the first character lower-cased. E.g., if a form has a title `"Foo Bar' the forms name is derived as `"fooBar"'. The only difference between the two functions is that the first one accepts a simple string for the title while the second expects a format string like `printf()', followed by the appropriate number of arguments. For the the location and size of the window controlled by `place' the following possibilities exist: `FL_PLACE_SIZE' The user can control the position but the size is fixed. Interactive resizing is not allowed once the form becomes visible. `FL_PLACE_POSITION' Initial position used will be the one set via `*note fl_set_form_position()::'. Interactive resizing is allowed. `FL_PLACE GEOMETRY' Place at the latest position and size (see also below) or the geometry set via `*note fl_set_form_geometry()::' etc. A form so shown will have a fixed size and interactive resizing is not allowed. `FL_PLACE_ASPECT' Allows interactive resizing but any new size will have the aspect ratio as that of the initial size. `FL_PLACE_MOUSE' The form is placed centered below the mouse. Interactive resizing will not be allowed unless this option is accompanied by `*note FL_FREE_SIZE::' as in `*note FL_PLACE_MOUSE::|*note FL_FREE_SIZE::'. `FL_PLACE_CENTER' The form is placed in the center of the screen. If `*note FL_FREE_SIZE::' is also specified, interactive resizing will be allowed. `FL_PLACE_FULLSCREEN' The form is scaled to cover the full screen. If `*note FL_FREE_SIZE::' is also specified, interative resizing will be allowed. `FL_PLACE_FREE' Both the position and size are completely free. The initial size used is the designed size. Initial position, if set via `*note fl_set_form_position()::', will be used, otherwise interactive positioning may be possible if the window manager allows it. `FL_PLACE_HOTSPOT' The form is so placed that mouse is on the "hotspot". If `*note FL_FREE_SIZE::' is also specified, interactive resizing will be allowed. `FL_PLACE_CENTERFREE' Same as `*note FL_PLACE_CENTER::|*note FL_FREE_SIZE::', i.e., place the form at the center of the screen and allow resizing. `FL_PLACE ICONIC' The form is shown initially iconified. The size and location used are the window manager's default. If no size is specified, the designed (or later scaled) size will be used. Note that the initial position is dependent upon the window manager used. Some window managers will allow interactive placement of the windows and some will not. There are three values that can be passed for `border': `FL_FULLBORDER' Draw full border with title `FL_TRANSIENT' Draw borders with possibly less decoration (depends on the window managers behaviour) `FL_NOBORDER' Draw no border at all Since multiple forms can be displayed at the same time note that using `FL_NOBORDER' might have adverse effect on keyboard focus and is not very friendly to other applications (it is close to impossible to move a form that has no border). Thus use this feature with discretion. The only situation where `FL_NOBORDER' is appropriate is for automated demonstration suites or when the application program must obtain an input or a mouse click from the user, and even then all other forms should be deactivated while a borderless form is active. For almost all situations where the application must demand an action from the user `FL_TRANSIENT' is preferable. Also note that you can't iconify a form that has no borders and under most window managers forms displayed with `FL_TRANSIENT' can't be iconified either. One additional property (under almost all window managers) of a transient window is that it will stay on top of the main form, which the application program can designate using void fl_set_app_mainform(FL_FORM *form); By default, the main form is set automatically by the library to the first full-bordered form shown. To obtain the current main form, use the following routine FL_FORM *fl_get_app_mainform(void); In some situations, either because the concept of an application main form does not apply (for example, an application might have multiple full-bordered windows), or under some (buggy) window managers, the designation of a main form may cause stacking order problems. To workaround these, the following routine can be used to disable the designation of a main form (must be called before any full-bordered form is shown): void fl_set_app_nomainform(int yes_no); with a true flag. All visible forms will have the properties `WM_CLASS', `WM_CLIENT_MACHINE' and `WM_NAME' set. In addition, the first full-bordered form will have the `WM_COMMAND' property set and is by default the applications main form. Sometimes it is necessary to have access to the window resource ID before the window is mapped (shown). For this, the following routines can be used Window fl_prepare_form_window(FL_FORM *form, int place, int border, const char *name); Window fl_prepare_form_window_f(FL_FORM *form, int place, int border, const char *fmt, ...); These routines create a window that obeys any and all constraints just as `*note fl_show_form()::' does but remains unmapped. The only difference between the two functions is that the first one takes a simple string for the forms name while the second expects a format string like `printf()', followed by the appropriate number of further arguments. To map such a window, the following must be used Window fl_show_form_window(FL_FORM *form); Between these two calls, the application program has full access to the window and can set all attributes, such as icon pixmaps etc., that are not set by `*note fl_show_form()::'. The application program can raise a form to the top of the screen so no other forms obscures it by calling void fl_raise_form(FL_FORM *form); To instead lower a form to the bottom of the stack use void fl_lower_form(FL_FORM *form); When placing a form on the screen using `FL_PLACE_GEOMETRY' for the `place' argument to `*note fl_show_form()::' the position and size can be set before by using the routines void fl_set_form_position(FL_FORM *form, FL_Coord x, FL_Coord y); void fl_set_form_size(FL_FORM *form, FL_Coord w, FL_Coord h); void fl_set_form_geometry(FL_FORM form*, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h); void fl_scale_form(FL_FORM *form, double xsc, double ysc); where `*note fl_set_form_geometry()::' combines the functionality of `*note fl_set_form_position()::' and `*note fl_set_form_size()::' and the last routine, `*note fl_scale_form()::', scales the form in horizontal and vertical direction by the factors passed to the function. These routines can also be used when the form is visible. Sometimes it is desirable to know how large the decoration are the window manager puts around a forms window. They can be obtained by a call of void fl_get_decoration_sizes(FL_FORM *form, int *top, int *right, int *bottom, int *left); This is especially useful if it is necessary to open a window at some previously stored position since in that case one needs the position of of the window, which deviates from the position reported for the form by the window manager's decorations. Obviously, the above function can't be used for forms that are embedded into another form. The function int fl_form_is_iconified(FL_FORM *form); allows to test if the (visible) window of a form is in iconified state. If interactive resizing is allowed (e.g., by showing the form with `*note FL_PLACE_POSITION::') it can be useful to limit the range of the size of a form can take. To this end, the following functions are available void fl_set_form_minsize(FL_FORM *form, FL_Coord minw, FL_Coord minh); void fl_set_form_maxsize(FL_FORM *form, FL_Coord maxw, FL_Coord maxh); Although these two routines can be used before or after a form becomes visible, not all window managers honor such requests once the window is visible. Also note that the constraints only apply to the next call of `*note fl_show_form()::' for the form. To set or change the icon shown when a form is iconified use the following routine void fl_set_form_icon(FL_FORM *form, Pixmap icon, Pixmap mask); where `icon' can be any valid pixmap ID. (*note Pixmap Object:: for some of the routines that can be used to create pixmaps.) Note that a previously set icon if not freed or modified in anyway. If, for any reason, you would like to change the form title after the form has been made visible, the following calls can be used (they will also change the icon title) void fl_set_form_title(FL_FORM *form, const char *name); void fl_set_form_title_f(FL_FORM *form, const char *fmt, ...); (While the first function expects a simple string, the second has to be called with a format string as `printf()' etc., followed by the corresponding number of arguments.) The routine void fl_hide_form(FL_FORM *form); hides the particular form, i.e., closes its window and all subwindows. To check if a form is visible or not, the following function can be used int fl_form_is_visible(FL_FORM *form)' The function can return that the form is visible (`*note FL_VISIBLE::'), is invisible (`*note FL_INVISIBLE::') or is in the processing of becoming invisible (`*note FL_BEING_HIDDEN::'). The most important function for doing the actual interaction with forms is FL_OBJECT *fl_do_forms(void); It starts the main loop of the program and returns only when either the state of an object changes that has no callback bound to it or `*note fl_finish()::' is called in a callback. In the first case the address of the object is returned, in the latter `NULL'. A second way of doing interaction with the currently displayed forms is using FL_OBJECT *fl_check_forms(void); This routine returns `NULL' immediately unless the state of one of the object (without a callback bound to it) changed. In that case a pointer to this object gets returned. `NULL' also gets returned after a call of `*note fl_finish()::'. Then there are two more functions: FL_OBJECT *fl_do_only_forms(void); FL_OBJECT *fl_check_only_forms(void); Both functions do the same as `*note fl_do_forms()::' and `*note fl_check_forms()::' except that they do not handle user events generated by application windows opened via `*note fl_winopen()::' or similar routines. To activate or deactivate a form for user interaction you can use void fl_activate_form(FL_FORM *form); void fl_deactivate_form(FL_FORM *form); The same can also be done for all forms at once using void fl_deactivate_all_forms(void) void fl_activate_all_forms(void) To find out if a form is currently active call int fl_form_is_activated(FL_FORM *form); A return value of 0 tells you that the form is currently deactivated. You can also register callbacks for a form that are invoked whenever the activation status of the form is changed: typedef void (*FL_FORM_ATACTIVATE)(FL_FORM *, void *); FL_FORM_ACTIVATE fl_set_form_atactivate(FL_FORM *form, FL_FORM_ATACTIVATE callback, void *data); typedef void (*FL_FORM_ATDEACTIVATE)(FL_FORM *, void *); FL_FORM_ACTIVATE fl_set_form_atdeactivate(FL_FORM *form, FL_FORM_ATACTIVATE callback, void *data); Also individual objects (or groups of objects if the argument of the function is an object returned by `*note fl_bgn_group()::') can be activated and deactivated to enable or disable user interaction: void fl_activate_object(FL_OBJECT *obj); void fl_deactivate_object(FL_OBJECT *obj); It is normally useful to give the user a visual clue when an object gets deactivated, e.g., by graying out its label etc. To find out if an object is active use int fl_object_is_active(FL_OBJECT *obj); void fl_redraw_object(FL_OBJECT *obj); This routine redraws the particular object. If `obj' is a group it redraws the complete group. Normally you should never need this routine because all library routines take care of redrawing objects when necessary, but there might be situations in which an explicit redraw is required. To redraw an entire form use void fl_redraw_form(FL_FORM *form); For non-form windows, i.e., those created with `*note fl_winopen()::' or similar routines by the application program, the following means of interaction are provided (note that these do not work on form windows, for which a different set of functions exist, *note Windowing Support:: for details.) You may set up a callback routine (of type `FL_APPEVENT_CB' for all user events using typedef int (*FL_APPEVENT_CB)(XEvent *, void *); FL_APPEVENT_CB fl_set_event_callback(FL_APPEVENT_CB callback, void *data); The function returns the previously set callback (or `NULL'). It is also possible to set up callback functions on a per window/event basis using the following routines: typedef int (*FL_APPEVENT_CB)(XEvent *xev, void *user_data); FL_APPEVENT_CB fl_add_event_callback(Window win, int xevent_type, FL_APPEVENT_CB callback, void *user_data); void fl_remove_event_callback(Window win, int xevent_type); These functions manipulate the event callback functions for the window specified, which will be called when an event of type `xevent_type' is pending for the window. If `xevent_type' is 0 it signifies a callback for all event for window `win'. Note that the Forms Library does not solicit any event for the caller, i.e., the Forms Library assumes the caller opens the window and solicits all events before calling these routines. To let the Forms Library handle event solicitation, the following function may be used void fl_activate_event_callbacks(Window win);  File: xforms.info, Node: Signals, Next: Idle Callbacks and Timeouts, Prev: Doing Interaction, Up: Part V Overview of Main Functions 32.6 Signals ============ Typically, when a signal is delivered, the application does not know what state the application is in, thus limiting the tasks a signal handler can do. In a GUI system and with a main loop inside the library, it's even harder to know what's safe or unsafe to do in a signal handler. Given all these difficulties, the Forms Library's main loop is made to be aware of signal activities and invoke signal handlers only when it's appropriate to do so, thus removing most limitations on what a signal handler can do. The application program can elect to handle the receipt of a signal by registering a callback function that gets called when a signal is caught typedef void (*FL_SIGNAL_HANDLER)(int, void *); void fl_add_signal_callback(int signal, FL_SIGNAL_HANDLER sh, void *data); Only one callback per signal is permitted. By default, `*note fl_add_signal_callback()::' will store the callback function and initiate a mechanism for the OS to deliver the signal when it occurs. When the signal is received by the library, the main loop will invoke the registered callback function when it is appropriate to do so. The callback function can make use of all of XForms's functions as well as Xlib functions as if they were reentrant. Further, a signal callback registered his way is persistent and will cease to function only when explicitly removed. It is very simple to use this routine. For example, to prevent a program from exiting prematurely due to signals, a code fragment similar to the following can be used: void clean_up(int signum, void *data) { /* clean up, of course */ } /* call this somewhere after fl_initialize() */ fl_add_signal_callback(SIGINT, clean_up, &mydata); After this, whenever a `SIGINT' signal is received, `clean_up()' is called. To remove a signal callback, the following routine should be used void fl_remove_signal_callback(int signal); Although very easy to use, there are limitations with the default behavior outlined above. For example on some platforms there is no blocking of signals of any kind while handling a signal. In addition, use of `*note fl_add_signal_callback()::' prevents the application program from using any, potentially more flexible, system signal handling routines on some platforms. Also there might be perceptible delays from the time a signal is delivered by the OS and the time its callback is invoked by XForms' main loop. This delay can be particular troublesome for timing sensitive tasks (playing music for example). In light of these limitations, provisions are made so an application program may choose to take over the initial signal handling setup and receipt via various system dependent methods (`sigaction()' for example). To change the default behavior of the built-in signal facilities, the following routine should be called prior to any use of `fl_add_signal_callback(') with a true value for `flag': void fl_app_signal_direct(int flag); After this call `*note fl_add_signal_callback()::' will not initiate any actions to receive a signal. The application program should handle the receipt and blocking of signals (via e.g., `signal(2)', `sigaction(2)', `sigprocmask(2') etc.) When the signal is received by the application program, it should call the following routine to inform the main loop of the delivery of the signal `signum', possibly after performing some timing sensitive tasks: void fl_signal_caught(int signum); This routine is the only one in the library that can be safely called from within a direct application signal handler. If multiple invocations of `*note fl_signal_caught()::' occur before the main loop is able to call the registered callback, the callback is called only once. The following example illustrates how to handle a timing critical situation (for most application, idle callback, timeouts or `FL_TIMER' object should be sufficient). First, you need to define the function that will handle the timing critical tasks. The function will be registered with the OS to be invoked directly by it. There are limitations on what you can do within a (OS) signal handler, in particular, GUI activity is not safe. void timing_critical_task(int sig) { /* handle timing critical tasks that does not involve GUI */ ... /* Now tell the library the signal has been delivered by the OS. * The library will invoke the xforms signal handler when it's * appropriate to do so */ fl_signal_caught(sig); } Now define a (XForms) signal handler that will be responsible for handling the response of the GUI upon receipt of the signal void gui_signal_handler(int sig, void *data) { /* within an XForms signal handler, there is no limitation * on GUI activitity */ fl_set_object_color(....); ... } To make all this work, a set-up similar to the following can be used /* setup the signal */ fl_app_signal_direct(1); setitimer(ITIMER_REAL, interval); /* setup the OS signal handler */ signal(SIGALRM, timing_critical_tasks); /* setup the XForms signal handler */ fl_add_signal_callback(SIGALRM, gui_signal_handler, &myData);  File: xforms.info, Node: Idle Callbacks and Timeouts, Next: Global Variables and Macros, Prev: Signals, Up: Part V Overview of Main Functions 32.7 Idle Callbacks and Timeouts ================================ For application programs that need to perform some light, but semi-continuous or periodic tasks, idle callback and timeouts (also `FL_TIMER' objects) can be utilized. To register an idle callback with the system, use the following routine typedef int (*FL_APPEVENT_CB)(XEvent *, void *); FL_APPEVENT_CB fl_set_idle_callback(FL_APPEVENT_CB callback, void *user_data); where `callback' is the function that will get called whenever the main loop is idle. The time interval between invocations of the idle callback can vary considerably depending on interface activity and other factors. A range between 50 and 300 msec should be expected. While the idle callback is executed it won't be called again (i.e., no call of any XForms function from within the idle callback function will call the idle callback function), so it does not need to be reentrant. It is possible to change what the library considers to be "idle" with the following function: void fl_set_idle_delta(long msec); Here `msec' is the minimum time interval of inactivity after which the main loop is considered to be in an idle state. However it should be noted that under some conditions an idle callback can be called sooner than the minimum interval. If the timing of the idle callback is of concern, timeouts should be used. Timeouts are similar to idle callbacks but with the property that the user can specify a minimum time interval that must elapse before the callback is called. The precision of timeouts tends to be quite a bit better than that of idle callbacks since they internally get prefered treatent. To register a timeout callback, the following routine can be used typedef void (*FL_TIMEOUT_CALLBACK)(int, void *); int fl_add_timeout(long msec, FL_TIMEOUT_CALLBACK callback, void *data); The function returns the timeout ID (note: the function will not return 0 and -1, so the application can use these values to mark invalid or expired timeouts). When the time interval specified by the `msec' argument (in milli-second) is elapsed, the timeout is removed and the callback function is called with the timeout ID as the first argument. Although a timeout offers some control over the timing, due to performance and CPU load compromises, while the resolution can be better than 10 ms under favourable conditions, it can also be much worse, occasionally up to 150 ms. To remove a timeout before it triggers, use the following routine void fl_remove_timeout(int id); where `id' is the timeout ID returned by `*note fl_add_timeout()::'. *Note Timer Object::, for the usage of `FL_TIMER' object. For tasks that need more accurate timing the use of signal should be considered.  File: xforms.info, Node: Global Variables and Macros, Prev: Idle Callbacks and Timeouts, Up: Part V Overview of Main Functions 32.8 Global Variables and Macros ================================ For convenience the library exports a number of global variables. These are: `FL_OBJECT *FL_EVENT' This is a special object returned by `*note fl_do_forms()::' etc. when an X event is received that isn't coming from a form under the control of the library, e.g., for a window that was opened directly via Xlib functions. Upon receiving this special event the application program can and must remove the pending event from the queue using `*note fl_XNextEvent()::'. `FL_FORM *fl_current_form' This variable is always set to the currently active form. `Display *fl_display' This variable is set to the display (X server) the program is connected to and is needed as an argument for many Xlib functions. It's recommended not to use this global variable but instead either the function `*note fl_get_display()::' or `*note FL_FormDisplay()::' (the latter accepts a form pointer as its argument and will also be safe in future versions of the library that may support multiple connections). `int fl_screen' This variable is set to the default screen of the display connection. `Window fl_root' This variable is set to the root window. `Window fl_vroot' Some window managers have problems with obtaining the corrent root window and applications don't work with the normal root windows. In this case `fl_vroot' can be used instead. `int fl_scrw, fl_scrh' These variables contain the screens width and height. `int fl_mode' The variable contains the visual mode in use, it should be one of the Xlib constants `PseudoColor', `TrueColor', `DirectColor', `StaticColor', `GrayScale or `StaticGray'. Alternatively, the functions `*note fl_get_vclass()::' or `fl_get_form_vclass()'' can be used (the latter accepts a form pointer as its argument and is thus also safe for future versions that may allow multiple connections). `FL_State fl_state[6]' This array of structure of type `*note FL_State::' contains a lot of information about the graphics mode, where each structure has the information for each of the visual modes. Of interest is only the entry for the visual mode in use, `*note fl_vmode::'. `double fl_dpi' `double fl_get_dpi()' The `fl_dpi' variable contains the screen resolution (in dots per inch), averaged over the resolutions in `x'- and `y'-direction. The funtion is a convenience macros with the same result. `Visual *fl_visual' `Visual *fl_get_visual()' Convenience macros that expands to the `Visual' pointer in use. Same as `*note fl_state::[*note fl_vmode::].xvinfo->visual'. `Colormap fl_colormap' `Colormap fl_get_colormap()' Convenience macros that expands to the currently used `Colormap'. Same as `*note fl_state::[*note fl_vmode::].colormap'. `char *fl_ul_magic_char' This variable points to the character used to indicate underlining in labels and other texts. If it appears as the very first character of a string all characters in that string are underlined, otherwise the character direct in front of it. Per default it's set to `'\b''.  File: xforms.info, Node: Part V Some Useful Functions, Next: Part V Resources for Forms Library, Prev: Part V Overview of Main Functions, Up: Top 33 Some Useful Functions ************************ * Menu: * Misc. Functions:: * Windowing Support:: * Cursors:: * Clipboard::  File: xforms.info, Node: Misc. Functions, Next: Windowing Support, Up: Part V Some Useful Functions 33.1 Misc. Functions ==================== The following routine can be used to sound the keyboard bell (if capable): void fl_ringbell(int percent); where `percent' can range from -100 to 100 with 0 being the default volume setting of the keyboard. A value of 100 indicates maximum volume and a value of -100 minimum volume (off). Note that not all keyboards support volume variations. To get the user name who's running the application you can use the routine const char *fl_whoami(void); To get a string form of the current date and time, the following routine is available: const char *fl_now(void); The format of the string is of the form `"Wed Jun 30 21:49:08 1993"'. The following time related routine might come in handy void fl_gettime(unsigned long *sec, unsigned long *usec); Upon function return `sec' and `usec' are set to the current time, expressed in seconds and microseconds since 00:00 GMT January, 1970. This function is most useful for computing time differences. Th function int fl_mode_capable(int mode, int warn); allows to determine the visual classes the system is capable of. `mode' must be one of `GrayScale', `StaticGray', `PseudoColor', `StaticColor', `DirectColor' and `TrueColor' and the function returns 1 if the system is capable of displaying in this visual class and 0 otherwise. If `warn' is set a warning is printed out in case the capability asked for isn't available. To find out the "depth" of the current display (basically the number of bits used for colors) use the function int fl_get_visual_depth(void); Finally int fl_msleep(usigned long msec); allows to wait for a number of milli-seconds (with the best resolution possible on your system).  File: xforms.info, Node: Windowing Support, Next: Cursors, Prev: Misc. Functions, Up: Part V Some Useful Functions 33.2 Windowing Support ====================== Some of the following routines are also used internally by the Forms Library as an attempt to localize window system dependencies and may be of some general use. Be warned that these routines may be subject to changes, both in their API and/or functionality. You can create and show a window with the following routines Window fl_wincreate(const char *name); Window fl_winshow(Window win); where the parameter `win' of `*note fl_winshow()::' is the window ID returned by `*note fl_wincreate()::'. The title of the window is set by the `name' argument. Between the creation and showing of the window other attributes of the window can be set. Note that a window opened this way is always a top level window and uses all the Forms Library's defaults (visual, depth etc.). Another thing about `*note fl_winshow()::' is that it will wait for and gobble up the first `Expose' event and you can draw into the window immediately after the function returns. It is sometimes more convenient to create and show a window in a single call using Window fl_winopen(const char *name); This will open a (top-level) window with the title `name'. A window so opened can be drawn into as soon as the function returns, i.e., `*note fl_winopen()::' waits until the window is ready to be drawn to. The newly opened window will have the following default attributes `event_mask' `ExposureMask', `KeyPressMask', `KeyReleaseMask', `ButtonPressMask', `ButtonReleaseMask', `OwnerGrabButtonMask', `ButtonMotionMask', `PointerMotionMask', `PointerMotionHintMask', `StructureNotifyMask' `backing_store' as set by `fl_cntl.backingStore' `class' `InputOutput' `visual' same as Forms Library's default `colormap' same as Forms Library's default To make a top-level window a sub-window of another window use the following routine int fl_winreparent(Window win, Window new_parent); The origin of the window `win' will be at the origin of the parent window `new_parent'. At the time of the function call, both the window and the parent window must be valid windows. By default, a newly opened window will have a size of 320 by 200 pixels and no other constraints. You can modify the default or constraints using the following routines prior to calling `*note fl_winopen()::': void fl_initial_winsize(FL_Coord w, FL_Coord h); void fl_winsize(FL_Coord w, FL_Coord h); These two routines set the preferred window size. `w' and `h' are the width and height of the window in pixels. `*note fl_winsize()::' in addition will make the window non-resizeable (but you can still resize the window programmatically) by setting the minimum and maximum window size to the requested size via `WMHints'. The effect of a window having this property is that it can't be interactively resized (provided the window manager cooperates). Also the state of the window when opening it can be influenced by the function void fl_initial_winstate(int state); where `state' is on of the XLib constants `NormalState' (the default) or `IconicState', which will result in the opened window being iconified. The third possible constant, `WithdrawnState', doesn't make much sense in this context. It is sometimes desirable to have a window that is resizeable but only within a useful range. To set such a constraint use the following functions: void fl_winminsize(Window window, FL_Coord minw, FL_Coord minh); void fl_winmaxsize(Window window, FL_Coord maxw, FL_Coord maxh); These two routines can also be used after a window has become visible. For windows still to be created/opened, use `None' for the window parameter. For example, if we want to open a window of 640 by 480 pixels and have it remain resizeable but within a permitted range, code similar to the following can be used: fl_initial_winsize(640, 480); fl_winminsize(None, 100,100); fl_winmaxsize(None, 1024,768) win = fl_winopen("MyWin"); In addition to the window size preference you can also set the preferred position of a window to be opened: void fl_winposition(FL_Coord x, FL_Coord y); where `x' and `y' are the coordinates of the upper-left corner of the window relative to the root window. Alternatively, you can set the geometry (position and size) in a single function call: void fl_initial_wingeometry(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h); void fl_wingeometry(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h); Again, windows for which `*note fl_wingeometry()::' had been created will not allow interactive resizing later on. There are further routines that can be used to change other aspects of the window to be created: void fl_winaspect(Window win, FL_Coord x, FL_Coord y); This will set the aspect ratio of the window for later interactive resizing. To change the window title (and its associated icon title) use void fl_wintitle(Window win, const char *title); void fl_wintitle_f(Window win, const char *fmt, ...); While the first function only accepts a simple string for the window title the second one allows to pass a format string just like the one used for `printf()' etc. and an appropriate number of further arguments which are used to construct the title. To change the icon title only use the routines void fl_winicontitle(Window win, const char *title); void fl_winicontitle_f(Window win, const char *fmt, ...); To install an icon for the window use void fl_winicon(Window win, Pixmap icon, Pixmap mask); You can suppress the window manager's decoration or make a window a transient one by using the following routines prior to creating the window void fl_noborder(void); void fl_transient(void); You can also set the background of the window to a certain color using the following call void fl_winbackground(Window win, unsigned long pixel); It is possible to set the steps by which the size of a window can be changed by using void fl_winstepsize(Window win, int xunit, int yunit); where `xunit' and `yunit' are the number of pixels of changes per unit in x- and y- directions, respectively. Changes to the window size will be multiples of these units after this call. Note that this only applies to interactive resizing. To change constraints (size and aspect ratio) on an active window, you can use the following routine void fl_reset_winconstraints(Window win); The following routines are available to get information about an active window win: void fl_get_winsize(Window win, FL_Coord *w, FL_Coord *h); void fl_get_winorigin(Window win, FL_Coord *x, FL_Coord *y); void fl_get_wingeometry(Window win, FL_Coord *x, FL_Coord *y, FL_Coord *w, FL_Coord *h); All values returned are in pixels. The origin of a window is measured from the upper left hand corner of the root window. To change the size of a window programmatically the following function is available: void fl_winresize(Window win, FL_Coord neww, FL_Coord newh); Resizing will not change the origin of the window (relative to the root window). While the window gets resized originally set restraints will remain unchanged. E.g., if a window was not permitted to be resized interactively it will continue to remain unresizeable by the user. To move a window without resizing it use the following function: void fl_winmove(Window win, FL_Coord newx, FL_Coord newy); To move and resize a window, use the following routine void fl_winreshape(Window win, FL_Coord newx, FL_Coord newy, FL_Coord neww, FL_Coord newh); The following routine is available to iconify a window int fl_iconify(Window win); The return value is nonzero when the message, asking for iconification of the window, was send successfully to the window manager, otherwise zero (but this may not be taken as a sure sign that the window was really iconified). To make a window invisible use void fl_winhide(Window win); A window hidden this way can be shown again later using `*note fl_winshow()::'. To hide and destroy a window, use the following calls void fl_winclose(Window win); There will be no events generated from `*note fl_winclose()::', i.e., the function waits and gobbles up all events for window `win'. In addition, this routine also removes all callbacks associated with the closed window. The following routine can be used to check if a window ID is valid or not int fl_winisvalid(Window win); Note that excessive use of this function may negatively impact performance. Usually an X application should work with window managers and accepts the keyboard focus assignment. In some special situations, explicit override of the keyboard focus might be warranted. To this end, the following routine exists: void fl_winfocus(Window win); After this call keyboard input is directed to window `win'.  File: xforms.info, Node: Cursors, Next: Clipboard, Prev: Windowing Support, Up: Part V Some Useful Functions 33.3 Cursors ============ XForms provides a convenience function to change the cursor shapes: void fl_set_cursor(Window win, int name); where `win' must be a valid window identifier and `name' is one of the symbolic cursor names (shapes) defined by standard X or the integer values returned by `*note fl_create_bitmap_cursor()::' or one of the Forms Library's pre-defined symbolic names. The X standard symbolic cursor names (all starts with `XC_') are defined in `' (you don't need to explicitly include this as `' already does this for you). For example, to set a watch-shaped cursor for form `form' (after the form is shown), the following call may be made fl_set_cursor(form->window, XC_watch); The Forms Library defines a special symbolic constants, `FL_INVISIBLE_CURSOR' that can be used to hide the cursor for window `win': fl_set_cursor(win, FL_INVISIBLE_CURSOR); Depending on the structure of the application program, a call of `XFlush(fl_get_display());' may be required following `*note fl_set_cursor()::'. To reset the cursor to the XForms's default (an arrow pointing northwest), use the following routine void fl_reset_cursor(Window win); To change the color of a cursor use the following routine void fl_set_cursor_color(int name, FL_COLOR fg, FL_COLOR bg); where `fg' and `bg' are the foreground and background color of the cursor, respectively. If the cursor is being displayed, the color change is visible immediately. It is possible to use cursors other than those defined by the standard cursor font by creating a bitmap cursor with int fl_create_bitmap_cursor(const char *source, const char *mask, int w, int h, int hotx, int hoty); where `source' and `mask' are two (x)bitmaps. The mask defines the shape of the cursor. The pixels set to 1 in the mask define which source pixels are displayed. If `mask' is `NULL' all bits in `source' are displayed. `hotx' and `hoty' are the hotspot of the cursor (relative to the source's origin). The function returns the cursor ID which can be used in calls of `*note fl_set_cursor()::' and `*note fl_set_cursor_color()::' etc. Finally, there is a routine to create animated cursors where several cursors are displayed one after another: int fl_create_animated_cursor(int *cur_names, int interval); The function returns the cursor name (ID) that can be shown later via `*note fl_set_cursor()::'. In the function call `cur_names' is an array of cursor names (either X standard cursors or cursor names returned by `*note fl_create_bitmap_cursor()::'), terminated by -1. Parameter `interval' indicates the time each cursor is displayed before it is replaced by the next in the array. An interval about 150 msec is a good value for typical uses. Note that there is currently a limit of 24 cursors per animation sequence. Internally animated cursor works by utilizing the timeout callback. This means that if the application blocks (thus the main loop has no chance of servicing the timeouts), the animation will stop. See demo program `cursor.c' for an example use of the cursor routines.  File: xforms.info, Node: Clipboard, Prev: Cursors, Up: Part V Some Useful Functions 33.4 Clipboard ============== Clipboard is implemented in the Forms Library using the X selection mechanism, more specifically the `XA_PRIMARY' selection. X selection is a general and flexible way of sharing arbitrary data among applications on the same server (the applications are of course not necessarily running on the same machine). The basic (and over-simplified) concept of the X selection can be summarized as follows: the X Server is the central point of the selection mechanism and all applications running on the server communicate with other applications through the server. The X selection is asynchronous in nature. Every selection has an owner (an application represented by a window) and every application can become owner of the selection or lose the ownership. The clipboard in Forms Library is a lot simpler than the full-fledged X selection mechanism. The simplicity is achieved by hiding and handling some of the details and events that are of no interests to the application program. In general terms, you can think of a clipboard as a read-write buffer shared by all applications running on the server. The major functionality you want with a clipboard is the ability to post data onto the clipboard and request the content of the clipboard. To post data onto the clipboard, use the following routine typedef int (*FL_LOSE_SELECTION_CB)(FL_OBJECT *obj, long type); int fl_stuff_clipboard(FL_OBJECT *obj, long type, const void *data, long size, FL_LOSE_SELECTION_CB callback); where `size' is the size (in bytes) of the content pointed to by `data'. If successful, the function returns a positive value and the data will have been copied onto the clipboard. The callback is the function that will be called when another application takes ownership of the clipboard. For textual content the application that loses the clipboard should typically undo the visual cues about the selection. If no action is required when losing the ownership a `NULL'q callback can be passed. The `obj' argument is used to obtain the window (owner) of the selection. `type' is currently unused. At the moment the return value of `lose_selection_callback()' is also unused. The data posted onto the clipboard are available to all applications that manipulate `XA_PRIMARY', such as xterm etc. To request the current clipboard content use the following routine typedef int (*FL_SELECTION_CB)(FL_OBJECT *obj, long type, const void * data, long size); int fl_request_clipboard(FL_OBJECT *obj, long type, FL_SELECTION_CB callback); where `callback' is the callback function that gets called when the clipboard content is obtained. The content `data' passed to the callback function should not be modified. One thing to remember is that the operation of the clipboard is asynchronous. Requesting the content of the clipboard merely asks the owner of the content for it and you will not have the content immediately (unless the asking object happens to own the selection). XForms main event loop takes care of the communication between the requesting object and the owner of the clipboard and breaks up and re-assembles the content if it exceeds the maximum protocol request size (which has a guaranteed minimum of 16 kB, but typically is larger). If the content of the clipboard is successfully obtained the main loop invokes the lose selection callback of the prior owner and then the requesting object's callback function. The function returns a positive number if the requesting object owns the selection (i.e., the callback could beinvoked before the function returned) and 0 otherwise. If there is no selection the selection callback is called with an empty buffer and the length of the buffer is set to 0. In that case `*note fl_request_clipboard()::' returns -1.  File: xforms.info, Node: Part V Resources for Forms Library, Next: Part V Dirty Tricks, Prev: Part V Some Useful Functions, Up: Top 34 Resources for Forms Library ****************************** Managing resources is an important part of programming with X. Typical X programs use extensive resource database/management to customize their appearances. With the help of the Form Designer there is little or no need to specify any resources for the default appearance of an application written using the Forms Library. Because of this, complete resource support is a somewhat low-priority task and currently only minimal support is available. Nevertheless, more complete and useful resource management system specific to the Forms Library can be implemented using the services provided by the XForms. * Menu: * Current Support:: * Going Further::  File: xforms.info, Node: Current Support, Next: Going Further, Up: Part V Resources for Forms Library 34.1 Current Support ==================== At the moment all built-in XForms resources have a top level class name `XForm' and a resource name `xform'. Because of this incomplete specification most of the current resources are "global", in the sense that they affect all form windows. Eventually all resources will be fully resolved, e.g., to specify attribute `foo' of form `formName', the resource name can be `appName.formName.foo' instead of (the current incomplete) `appName.xform.foo'. The argument `app_opt' passed to `*note fl_initialize()::' is a table of structures listing your applications command line options. The structure is defined as follows typedef struct { char * option; char * specifier; XrmOptionKind argKind; void * value; } XrmOptionDescList, FL_CMD_OPT; See `XrmGetResource()' for details. After the initialization routine is called all command line arguments, both XForms built-in and application specific ones, are removed from `argc' and `argv' and parsed into a standard XResources database. To read your application specific options follow `*note fl_initialize()::' with the following routine void fl_get_app_resources(FL_RESOURCE *resource, int nresources); Here `resource' is a table containing application specific resources in the following format: typedef struct { char * res_name; /* resource name without application name */ char * res_class; /* resource class */ FL_RTYPE type; /* C type of the variable */ void * var /* variable that will hold the value */ char * defval; /* default value in string form */ int nbytes; /* buffer size for string var. */ } FL_RESOURCE; and the resource type `FL_RTYPE' type is one of the following `FL_SHORT' for short variable `FL_BOOL' for boolean variable (int) `FL_INT' for int variable `FL_LONG' for long variable `FL_FLOAT' for float variable `FL_STRING' for char[] variable `FL_NONE' for variables not to be used (or not available) Note that the variable for `FL_BOOL' must be of type int. It differs from `FL_INT' only in the way the resources are converted, not in the way their values are stored. A boolean variable is considered to be true (1) if any one of `True', `true', `Yes', `yes', `On', `on', or 1 is specified as its value. For string variables, the length for the destination buffer must be specified. `*note fl_get_app_resources()::' simply looks up all entries specified in the `FL_RESOURCE' structure in all databases after prefixing the resource name with the application name, which can be the new name introduced by the `-name' command line option. Summarized below are the currently recognized Forms Library built-in resources: Resource Name Class Type Default values ---------------------------------------------------------------------------- rgamma Gamma float 1.0 ggamma Gamma float 1.0 bgamma Gamma float 1.0 visual Visual string best depth Depth int best doubleBuffer DoubleBuffer bool true privateColormap PrivateColormap bool false standardColormap StandardColormap bool false sharedColormap SharedColormap bool false pupFontSize PupFontSize int 12pt buttonFontSize FontSize int 10pt sliderFontSize FontSize int 10pt inputFontSize FontSize int 10pt browserFontSize FontSize int 10pt menuFontSize FontSize int 10pt choiceFontSize FontSize int 10pt ulPropWidth ULPropWidth bool true ulThickness ULThickness int 1 scrollbarType ScrollbarType string thin coordUnit CoordUnit string pixel borderWidth BorderWidth int 1 Again, "best" means that the Forms Library by default selects a visual that has the most depth. By default, resource files are read and merged in the order as suggested by X11 R5 as follows: * `/usr/lib/X11/app-defaults/' * `$XAPPRLESDIR/' * `RESOURCE_MANAGER' property as set using `xrdb' if `RESOURCE_MANAGER' is empty, `~/.Xdefaults' * `$XENVIRONMENT' if `$XENVIORONMENT' is empty, `~/.Xdefaults-hostname' * ommand line options All options set via resources may not be the final values used because resource settings are applied at the time an object/form is created, thus any modifications after that override the resource settings. For example `buttonLabelSize', if set, is applied at the time the button is created (`*note fl_add_button()::'). Thus altering the size after the button is created via `*note fl_set_object_lsize()::' overrides whatever is set by the resource database. To run your application in `PseudoColor' with a depth of 8 and a thicker underline, specify the following resources appname*visual: PseudoColor appname*depth: 8 appname*ulThickness: 2 Since resources on a form by form basis are yet to be implemented, there is no point specifying anything more specific although also `appname.XForm.depth' etc. would work correctly. * Menu: * Resources Example::  File: xforms.info, Node: Resources Example, Up: Current Support 34.1.1 Resources Example ------------------------ Let us assume that you have an application named `myapp' and it accepts the options `-foo' _level_ and `-bar' plus a filename. The proper way to initialize the Forms Library is as follows FL_CMD_OPT cmdopt[] = { {"-foo", "*.foo", XrmoptionSepArg, 0 }, {"-bar", ".bar", XrmoptionNoArg, "True"} }; int foolevel, ifbar; int deftrue; /* can only be set thru resources */ FL_resource res[] = { {"foo", "FooCLASS", FL_INT, &foolevel, "0"}, {"bar", "BarCLASS", FL_BOOL, &ifbar, "0"}, {"deftrue", "Whatever", FL_BOOL, &deftrue, "1"} }; int main(int argc, char *argv[]) { fl_initialize(&argc, argv ,"MyappClass", cmdopt, 2); fl_get_app_resources(res, 3); if (argc == 1) /* missing filename */ fprintf(stderr, "Usage %s: [-foo level][-bar] " "filename\n","myapp"); /* rest of the program */ } After this both variables `foolevel' and `ifbar' are set either through resource files or command line options, with the command line options overriding those set in the resource files. In case neither the command line nor the resource files specified the options, the default value string is converted. There is another routine, a resource routine of the lowest level in XForms, which might be useful if a quick-and-dirty option needs to be read: const char *fl_get_resource(const char *res_name, const char *res_class, FL_RTYPE type, char *defval, void *val, int nbytes); `res_name' and `res_class' must be complete resource specifications (minus the application name) and should not contain wildcards of any kind. The resource will be converted according to the type and result stored in `type', which is an integer of type `*note FL_RTYPE::'. `nbytes' is used only if the resource type is `*note FL_STRING::'. The function returns the string representation of the resource value. If a value of `*note FL_NONE::' is passed for `type' the resource is not converted and the pointer `val' is not dereferenced. There is also a routine that allows the application program to set resources programmatically: void fl_set_resource(const char *string, const char *value); where `string' and `value' are a resource-value pair. The string can be a fully qualified resource name (minus the application name) or a resource class. Routines `*note fl_set_resource()::' and `*note fl_get_resource()::' can be used to store and retrieve arbitrary strings and values and may be useful to pass data around.  File: xforms.info, Node: Going Further, Prev: Current Support, Up: Part V Resources for Forms Library 34.2 Going Further ================== It is possible to implement your own form/object specific resources management system using the services mentioned above. For example, to implement a user-configurable form size, code similar to the following can be used, assuming the form is named `"myform"': struct fsize { int width, height; } myformsize; FL_RESOURCE res[] = { {"myform.width", "XForm.width", FL_INT, &myform.width, "150"}, {"myform.height","XForm.height", FL_INT, &myform.height, "150"} }; fl_initialize(&argc, argv, app_class, 0, 0); fl_get_app_resources(res, 2); /* create the forms */ myform = fl_bgn_form(myformsize.width, myformsize.height,.....); Or (more realistically) you create the form first using `fdesign' and then scale it before it is shown: fl_initialize(&argc, argv, app_class, 0, 0); fl_get_app_resources(res, 2); /*create_all_forms here */ fl_set_form_size(myform, mysformsize.width, myformsize.height); fl_show_form(myform, ...); Since eventually form geometry and other things might be done via XForms internal routines it is recommended that you name your form to be the form title with all spaces removed and the first letter lower-cased, i.e., if a form is shown with a label `Foo Bar', the name of the form should be `fooBar'.  File: xforms.info, Node: Part V Dirty Tricks, Next: Part V Trouble Shooting, Prev: Part V Resources for Forms Library, Up: Top 35 Dirty Tricks *************** This chapter describes some of the routines that may be used in special situations where more power or flexibility from Forms Library is needed. These routines are classified as "dirty tricks" either because they can easily mess up the normal operation of Forms Library or they depend on internal information that might change in the future, or they rely too much on the underlying window systems. Thus whenever possible, try not to use these routines. * Menu: * Interaction:: * Other::  File: xforms.info, Node: Interaction, Next: Other, Up: Part V Dirty Tricks 35.1 Interaction ================ * Menu: * Form Events:: * Object Events::  File: xforms.info, Node: Form Events, Next: Object Events, Up: Interaction 35.1.1 Form Events ------------------ It is possible to by-pass the form event processing entirely by setting a "raw callback" that sits between the event reading and dispatching stage, thus a sneak preview can be implemented and optionally the event can even be consumed before the libraries internal form processing machinery gets to it. Use the following routines to register such a preemptive processing routine typedef int (*FL_RAW_CALLBACK)(FL_FORM *, void *xevent); FL_RAW_CALL_BACK fl_register_raw_callback(FL_FORM *form, unsigned long mask, FL_RAW_CALLBACK callback); where `mask' is the event mask you are interested in (same as the XEvent mask). The function returns the old handler for the event. Currently only handlers for the following events are supported * `KeyPressMask' and `KeyReleaseMask' * `ButtonPressMask' and `ButtonReleaseMask' * `EnterWindowMask' and `LeaveWindowMask' * `ButtonMotionMask' and `PointerMotionMask' * `FL ALL EVENT' (see below) Further, there is only one handler for each event pair, (e.g., `ButtonPress' and `ButtonRelease'), thus you can't have two separate handlers for each pair although it is possible to register a handler only for one of them (but almost always a mistake) if you know what you're doing. If you register a single handler for more than one pair of events, e.g., setting mask to `KeyPressMask|ButtonPressMask', the returned old handler is random. A special constant, `FL_ALL_EVENT', is defined so that the handler registered will received all events that are selected. To select events, use `*note fl_addto_selected_xevent()::'. Once an event handler is registered and the event is detected, then instead of doing the default processing by the dispatcher, the registered handler function is invoked. The handler function must return either `FL_PREEMPT' if the event is consumed) and `0' otherwise so that the internal processing of the event can continue. See the demo program `minput2.c' for an example. Since these kind of handlers work on a rather low level there's a chance that they interfere with some mechanisms of the library. Consider the case of setting a raw callback handler for mouse press and release events, in which the handler returns `0' for mouse press events but `FL_PREEMPT' on relese events. In that case the mouse press event results in the normal processing and e.g., a button below the mouse will receive it (and be drawn correspondingly). To be drawn again in its normal way it also needs to receive the release event (even if the mouse isn't on top of it anymore when the mouse button is released). But when the handler function doesn't also let the release event propagate to the normal handling of events then the button will never receive the expected release event and will stay drawn in the way as if the release event never happened. Thus one should avoid having different return values from the handler for pairs of related events.  File: xforms.info, Node: Object Events, Prev: Form Events, Up: Interaction 35.1.2 Object Events -------------------- Just as you can by-pass the internal event processing for a particular form, you can also do so for an object. Unlike in raw callbacks, you can not select individual events. The mechanism provided is via the registration of a pre-handler for an object. The pre-handler will be called before the built-in object handler. By electing to handle some of the events, a pre-handler can, in effect, replace part of the built-in handler. In *note the chapter about pre-emptive handlers: Part IV Using a Pre-emptive Handler. the API was already discussed in detail, so here we just repeat the discussion for completeness as any use of pre-emptive handler is considered "dirty tricks". To register a pre-handler, use the following routine typedef int (*FL_HANDLEPTR)(FL_OBJECT *obj, int event, FL_Coord mx, FL_Coord my, int key, void *raw_event); void fl_set_object_prehandler(FL_OBJECT *, FL_HANDLEPTR prehandler); where `event' is the generic event in the Forms Library, that is, `FL DRAW', `FL ENTER' etc. The arguments `mx' and `my' are the mouse position and `key' is the key pressed. The last parameter, `raw_event' is a pointer to the XEvent that caused the invocation of the pre-handler. cast to a void pointer. Notice that the pre-handler has the same function prototype as the built-in handler. Actually they are called with the exact same parameters by the event dispatcher. The prehandler should return `0' if the processing by the built-in handler should continue. A return value of `FL PREEMPT' will prevent the dispatcher from calling the built-in handler. See demo program `preemptive.c' for an example. A similar mechanism exists for registering a post-handler, i.e., a handler invoked after the built-in handler is finished, by using void fl_set_object_posthandler(FL_OBJECT *, FL_HANDLEPTR prehandler); Whenever possible a post-handler should be used instead of a pre-handler.  File: xforms.info, Node: Other, Prev: Interaction, Up: Part V Dirty Tricks 35.2 Other ========== As stated earlier, `*note fl_set_defaults()::' can be used to modify the Forms Library's defaults prior to calling `*note fl_initialize()::'. Actually, this routine can also be used after `*note fl_initialize()::' to override the values set on the command line or in the application databases. However, overriding users' preferences should be done with discretion. Further, setting `privateColormap' after `*note fl_initialize()::' has no effect.  File: xforms.info, Node: Part V Trouble Shooting, Next: Part VI, Prev: Part V Dirty Tricks, Up: Top 36 Trouble Shooting ******************* This chapter deals with a number of (common) problems encountered by people using the Forms Library. Ways of avoiding them are presented. `fl show form()' only draws the form partially This only happens if immediately following `*note fl_show_form()::' the application program blocks the execution (e.g., waiting for a socket connection, starting a new process via `fork()' etc.). To fix this problem, you can flush the X buffer manually using `fl_update_display(1)' before blocking occurs or use an idle callback to check the status of the blocking device or let the main loop handle it for you via `*note fl_add_io_callback()::'. I updated the value of a slider/counter/label, but it does not change This only happens if the update is followed by a blockage of execution or a long task without involving the main loop of Forms Library. You can force a screen update using `fl_update_display(1)'. I found a bug in XForms, What do I do? Please consider subscribing to the XForms mailing list at `http://lists.nongnu.org/mailman/listinfo/xforms-development' and sending an email with information about the bug you found. Please try to post information about the version of the Forms Library you're using and your OS beside a description of the bug. Some sample code that exhibits the erratic behavior would help greatly. If, for some reasons, you don't want subscribe to the mailing list you may also send an email to one of the maintainers. At the moment you probably should first contact Jens Thoms Toerring, <>.  File: xforms.info, Node: Part VI, Next: Part VI Images, Prev: Part V Trouble Shooting, Up: Top _Part VI - Image Support API_ ***************************** * Menu: * Part VI Images::  File: xforms.info, Node: Part VI Images, Next: Index of Functions, Prev: Part VI, Up: Top 37 Images ********* Although images are not typically a part of the GUI, they are often part of an application. For this reason and others, image support is part of Forms Library. It is not unusual that the users of a graphical user interface want some graphics support. The most important reason to have image support in the library is the amount of questions/requests on the mailing list of the Forms Library about images. It convinced us that having image support will make many Forms Library users life easier. The second reason has something to do with image support in X, which at best is cumbersome to use as the API reflects the underlying hardware, which, at the level of Xlib, is quite appropriate, but not quite what an application programmer wants to deal with. Image support in Forms Library for the large part is hardware independent. This is possible because xforms makes distinction between the real image it keeps and the image being displayed. At the expense of some flexibility and memory requirement, the high-level image support API should prove to be useful for most situations. The third reason is that image support as it is now in the library is well isolated and is only linked into an application when it is actually being used. This is not a trivial point in the consideration to include image support in the library proper. * Menu: * The Basic Image Support API:: * The FL_IMAGE Structure:: * Supported image types:: * Creating Images:: * Supported Image Formats:: * Setup and Configuration:: * Simple Image Processing:: * Utilities::  File: xforms.info, Node: The Basic Image Support API, Next: The FL_IMAGE Structure, Up: Part VI Images 37.1 The Basic Image Support API ================================ Reading and displaying images are quite easy. It can be as simple as a couple of lines of code: FL_IMAGE *image; if ((image = flimage_load("imagefilename")) image->display(image, win); In this example, an image is created from a file, then the image is displayed in a window, `win'. For most casual uses, this is really what is needed to load and display an image. As you may have guessed, an image in Forms Library is represented by a structure of type `FL_IMAGE'. In addition to the pixels in the image, it also keeps a variety of information about the image such as its type, dimension, lookup tables etc. Further, if the image can not be displayed directly on the display hardware (for example, the image is 24 bits, while the display is only capable of 8 bits), a separate displayable image is created and displayed. Any manipulation of the image is always performed on the original high-resolution image, and a new displayable image will be created if necessary. Writing an image is just as simple if (flimage_dump(image, "filename", "jpeg") < 0) fprintf(stderr,"image write failed"); In this code snippet, an image in memory is written to a file in JPEG format. As you might have noticed by now, all image routines start with flimage. The exact APIs for reading and writing an image are as follows FL_IMAGE *flimage_load(const char *filename); int flimage_dump(FL_IMAGE *im, const char *filename, const char *fmt); The function `*note flimage_load()::' takes a filename and attempts to read it. If successful, an image (or multiple images) is created and returned. If for any reason the image can't be created (no permission to read, unknown file format, out of memory etc), a null pointer is returned. As will be documented later, error reporting and progress report can be configured so these tasks are performed inside the library. The function `*note flimage_dump()::' takes an image, either returned by `*note flimage_load()::' (possibly after some processing) or created on the fly by the application, attempts to create a file to store the image. The image format written is controlled by the third parameter `fmt'q, which should be either the formal name or the short name of one of the supported formats (such as jpeg, ppm, gif, bmp etc., see section 23.3) or some other formats the application knows how to write. If this parameter is `NULL', the original format the image was in is used. If the image is successfully written, a non-negative number is returned, otherwise a negative number. Depending on how the image support is configured, error reporting may have already occurred before the function returns. Given these two routines, a file converter (i.e., changing the image file format) is simple if ((image = flimage_load("inputfile")) flimage_dump(image, "outfile", "newformat"); See the demo program `iconvert.c' for a flexible and usable image converter. To free an image, use the following routine void flimage_free(FL_IMAGE *image); The function first frees all memory allocated for the image, then the image structure itself. After the function returns, the image should not be referenced. The following routines are available to display an image in a window int flimage_display(FL_IMAGE *image, FL_WINDOW win); int flimage_sdisplay(FL_IMAGE *image, FL_WINDOW win); where `win' is a window ID. If the image(s) is successfully displayed, a non-negative integer is returned, a negative integer otherwise. The difference between the two display routines is that `*note flimage_sdisplay()::' only displays a single image while `*note flimage_display()::', built on top of `flimage_sdisplay()', can display single or multiple images. For typical use, `*note flimage_display()::' or `image->display' should be used. `*note flimage_sdisplay()::' is useful only if you're coding your own multi-image display routine. For example, `*note flimage_display()::' is built roughly like the following int flimage_display(FL_IMAGE *im, FL_WINDOW win) { int err; for (err = 0; err >=0 && im; im = im->next) { err = flimage_sdisplay(im, win); fl_update_display(0); fl_msleep(im->setup->delay); } return err; } And you can build your own multi-frame image display routine to suit your application's needs. Despite the display routine's simple look, this function performs tasks that involve the details of dealing with different hardware capabilities, a daunting task for beginners. For PseudoColor displays (i.e., using color maps or color lookup tables), a color quantization or dithering step may be performed by the function to reduce the number of colors in the image (of course, the colorreduced image is kept only for display, the original image is untouched so future processing is carried out on the original full resolution image, rather than the displayed, an approximate of the original image). In general, when the information in an image is reduced in order to display it, the original image is not altered in any way. For example, this function can display a 24bit image on a 1bit display without losing any information on the original 24bit image. By default, the entire image is displayed at the top-left corner of the window. To display the image at other locations within the window (perhaps to center it), use the `image->wx' and `image->wy' fields of the `FL_IMAGE' structure. These two fields specify where in the window the origin of the image should be. By repeatedly changing `image->wx' and `image->wy' and displaying, image panning can be implemented. It is also possible to display a subimage by specifying non-zero value for `(image->sx,image->sy)' and `(image->sw, image->sh)'. You can view the image as a 2D space with the origin at the top left corner. The positive y axis of the image space is pointing downward. `(image->sx,image->sy)' specify the subimage offset into the image (they must be non-negative) and `(image->sw,image->sh)' specify the width and height of the subimage. Taken the window offset and the subimage together, the more accurate statement of the functionality of the the function `*note flimage_display()::' is that it displays a subimage specified by `(image->sx,image->sy)' and `(image->sw,image->sh)' starting at `(image->wx, image->wy)'. You can also use clipping to display a subimage by utilizing the following functions and `image->gc' fl_set_gc_clipping(image->gc, x, y, w, h); fl_unset_gc_clipping(image->gc); where the coordinates are window coordinates. Of course, by manipulating `image->gc' directly, more interesting clipping or masking can be achieved. Since the GC is visual dependent, a newly created image before displaying may not yet have a valid GC assoiated with it. If you must set some clipping before displaying, you can set the `image->gc' yourself beforehand. Note that you if you free the GC, make sure you reset it to `None'. To display an image in a canvas, the following can be used flimage_display(image, FL_ObjWin(canvas)); Since this function only knows about window IDs, and writes to the window directly, it may not be sensitive to the status of the form the canvas is on, e.g., a frozen form. In your application, you should check the status of the form before calling this function. Sometimes it may be useful to find out if a specific file is an image file before attempting to read it (for example, as a file filter). To this end, the following routine exists int flimage_is_supported(const char *file); The function returns true if the specified file is a known image file. If the file is not a known image or not readable for any reason, the function return 0.  File: xforms.info, Node: The FL_IMAGE Structure, Next: Supported image types, Prev: The Basic Image Support API, Up: Part VI Images 37.2 The `FL_IMAGE' Structure ============================= Before we go into more details on image support, some comments on the image structure are in order. The image structure contains the following basic fields that describe fully the image in question and how it should be displayed. typedef unsigned char FL_PCTYPE; /* primary color type */ #define FL_PCBITS 8 /* primary color bits */ #define FL_PCMAX ((1<map len'. Although `alpha lut' is always allocated for a color index image, it's currently not used by the Forms Library. `map_len' The length of the colormap (lookup table). `app_background' A packed RGB value indicating the preferred color to use for the background of an image (also known as transparent color). This field is initialized to an illegal value. Since there is no portable way to obtain the window background the application has to set this field if transparency is to be achieved. In future versions of image support, other means of doing transparency will be explored and implemented. `wx, wy' The window offset to use to display the image. `sx, sy, sw, sh' The subimage to display. `comments' This is typically set by the loading routines to convey some information about the image. The application is free to choose how to display the comment, which may have embedded newlines in it. `io_spec' This field is meant for the reading/writing routine to place format specific state information that otherwise needs to be static or global. `spec_size' This field should be set to the number of bytes `io_spec' contains. `display' A function you can use to display an image. The image loading routine sets this function. `next' This is a link to the next image. This is how `*note flimage_load()::' chains multiple image together. `double_buffer' If true, the display function will double-buffer the image by using a pixmap. For typical image display it's not necessary to enable double-buffering as it is very expensive (memory and speed). Double-buffering may be useful in image editing. `pixmap' The backbuffer pixmap if double-buffered. Although it is generally not necessary for an application to access individual pixels, the need to do so may arise. In doing so, it is important to consult the `image->type' field before dereferencing any of the pixel field. That is, you should access `image->ci' only if you know that the image type is `FL_IMAGE_CI' or `FL_IMAGE_MONO'.  File: xforms.info, Node: Supported image types, Next: Creating Images, Prev: The FL_IMAGE Structure, Up: Part VI Images 37.3 Supported image types ========================== Forms Library supports all common and not-so-common image types. For example, the supported images range from the simple 1 bit bitmap to full 24 bit RGB images. 12 bit gray scale images (common in medical imaging) are also supported. The supported image types are denoted using the following constants, all of them (except `FL_IMAGE_FLEX') using a different bit, so they can be bitwise ORed together: FL_IMAGE_MONO, /* 1 bit bitmaps */ FL_IMAGE_GRAY, /* gray-scale image (8 bit) */ FL_IMAGE_GRAY16, /* gray-scale image (9 to 16 bit) */ FL_IMAGE_CI, /* generic color index image */ FL_IMAGE_RGB, /* 24 bit RGB(A) image */ FL_IMAGE_PACKED, /* 24 bit RGB(A) image. Packed storage */ FL_IMAGE_FLEX, /* All of the above */ For the 24 bit variety another 8 bit (`image->alpha' and the top-most byte of the packed integer) is available for the application, perhaps storing the alpha values into it. The Forms Library does not modify or reference this extra byte. Mono (b&w) images are stored as a colormap image with a lut of length 2. The `FL_IMAGE_FLEX' type is mainly for the reading and loading routines to indicate the types they are capable of handling. For example, if you're coding an output routine, you use `FL_IMAGE_FLEX' to indicate that the output routine can take any type the image. Otherwise the driver will convert the image type before handing the image over to the actual output routine. In displaying an image of type `FL_IMAGE_GRAY16', window leveling, a technique to visualize specific ranges of the data, is employed. Basically, you specify a window level (`level') and a window width (`wwidth') and the display function will map all pixels that fall within `level-width/2' and `level+width/2' linearly to the whole dynamic range of the intensities the hardware is capable of displaying. For example, if the display device can only display 256 shades of gray, `level-width/2' is mapped to 0 and `level+width/2' is mapped to 255, and pixels values between `level-width/2' and `level+width/2' are linearly mapped to values between 0 and 255. Pixel values that fall below `level-width/2' are mapped to zero and those that larger than `level+width/2' are mapped to 255. Use the following routine to set the window level int flimage_windowlevel(FL_IMAGE *im, int level, int wwidth); The function returns 1 if window level parameters are modified, otherwise 0 is returned. Setting `wwidth' to zero disables window leveling. Note that if `im' points to a multiple image, window level parameters are changed for all images. To obtain the image type name in string format, e.g., for reporting purposes, use the following routine const char *flimage_type_name(int type); To convert between different types of images, the following routine is available int flimage_convert(FL_IMAGE *image, int newtype, int ncolors); The parameter `newtype' should be one of the supported image types mentioned earlier in this section. Parameter `ncolors' is meaningful only if `newtype' is `FL_IMAGE_CI'. In this case, it specifies the number of colors to generate, most likely from a color quantization process. If the conversion is successful a non-negative integer is returned, otherwise a negative integaer. Depending on which quantization function is used, the number of quantized colors may not be more than 256. To keep information loss to a minimum, `*note flimage_convert()::' may elect to keep the original image in memory even if the conversion is successful. For example, converting a full color image (24 bit) into a 8 bit image and then converting back can lose much information of the image if the converting function does not keep the original image. What this means is that the following sequence gets back the original image /* the current image is RGB. Now we reduce the full color image to 8 bit color index image. The conversion routine will keep the 24 bit color. */ flimage_convert(image, FL_IMAGE_CI, 256); /* Now convert back to RGB for image processing. The con- version routine will notice that the input image was originally converted from a 24bit image. Instead of doing the conversion, it simply retrieves the saved image and returns. */ flimage_convert(image, FL_IMAGE_RGB, 0); This behavior might not always be what the application wants. To override it, you can set `image->force_convert' to 1 before calling the conversion routine. Upon function return the flag is reset to zero.  File: xforms.info, Node: Creating Images, Next: Supported Image Formats, Prev: Supported image types, Up: Part VI Images 37.4 Creating Images ==================== With the basic fields in the image structure and image types explained, we're now in a position to tackle the problem of creating images on the fly. The data may have come from some simulations or some other means, the task now is to create an image from the data and try to display/visualize it. The first task involved in creating an image is to create an image structure that is properly initialized. To this end, the following routine is available FL_IMAGE *flimage_alloc(void); The function returns a pointer to a piece of dynamically allocated memory that's properly initialized. The task next is to put the existing data into the structure. This involves several steps. The first step is to figure out what type of image to create. For scalar data, there are two logical choices, either a gray-scale intensity image or a color index image with the data being interpreted as indices into some lookup table. Both of these may be useful. Gray-scale imagse are straight forward to create and the meaning of the pixel values is well defined and understood. On the other hand with color-mapped image you can selectively enhance the data range you want to visualize by choosing appropriate color-maps. For vector data, RGB image probably makes most sense. In any case it's strictly application's decision. All that is needed to make it work with Forms Library is to set the `image->type' field to a valid value. Of course the image dimension (width and height) also needs to be set. Once this is done, we need to copy the data into the image structure. Before we copy the data we create the destination storage using one of the following routines void *fl_get_matrix(int nrows, int ncols, unsigned int elem_size); int flimage_getmem(FL_IMAGE *image); The `*note fl_get_matrix()::' function creates a 2-dimensional array of entities of size `elem_size'. The array is of `nrows' by `ncols' in size. The 2D array can be passed as a pointer to pointer and indexed as a real 2D arrays. The `*note flimage_getmem()::' routine allocates the proper amount of memory appropriate for the image type, including colormaps when needed. After the destination storage is allocated, copying the data into it is simple image->type = FL_IMAGE_GRAY; image->w = data_columns; image->h = data_row; flimage_getmem(image); /* or you can use the instead im->gray = fl_get_matrix(im->h, im->w, sizeof **im->gray); */ for (row = 0; row < image->h; row++) for (col = 0; col < image->w; col++) image->gray[row][col] = data_at_row_and_col; Of course, if data is stored row-by-row, a `memcpy(3)' instead of a loop over columns may be more efficient. Also if your data are stored in a single array, `*note fl_make_matrix()::' might be a lot faster as it does not copy the data. If the created image is a color index image, in addition to copying the data to `image->ci', you also need to set the lookup table length `image->map_len', which should reflect the dynamic range of the data: image->type = FL_IMAGE_CI; image->w = A; image->h = B; image->map_len = X; flimage_getmem(image); /* this will allocate ci and lut */ for (row = 0; row < image->h; row++) for (col = 0; col < image->w; col++) image->ci[row][col] = data; for (i = 0; i < image->map_len; i++) { image->red_lut[i] = some_value_less_than_FL_PCMAX; image->green_lut[i] = some_value_less_than_FL_PCMAX; image->blue_lut[i] = some_value_less_than_FL_PCMAX; } If the type is `FL_IMAGE_GRAY16', you also need to set `image->gray_maxval' to the maximum value in the data. Now we're ready to display the image flimage_display(image, win); As mentioned before, the display routine may create a buffered, display hardware specific and potentially lower-resolution image than the original image. If for any reason, you need to modify the image, either the pixels or the lookup tables, you need to inform the library to invalidate the buffered image: image->modified = 1;  File: xforms.info, Node: Supported Image Formats, Next: Setup and Configuration, Prev: Creating Images, Up: Part VI Images 37.5 Supported Image Formats ============================ There are many file formats for image storage. The popularity, flexibility and cleanness of the different formats varies. Forms Library supports several popular ones, but these are not the only ones that are popular. Toward the end of this section, it will be outlined how to extend the image support in the Forms Library so more image file can be read by `*note flimage_load()::'. * Menu: * Built-in support:: * Adding New Formats:: * Queries::  File: xforms.info, Node: Built-in support, Next: Adding New Formats, Up: Supported Image Formats 37.5.1 Built-in support ----------------------- Each image file format in Forms Library is identified by any one of three pieces of information, the formal name, the short name, and the file extension. For example, for the GIF format, the formal name is `"CompuServe GIF"'(1), the short name is `"GIF"', and file extension is `"gif"'. This information is used to specify the output format for `*note flimage_dump()::'. The following table summarizes the supported file formats with comments FormalName ShortName Extension Comments ------------------------------------------------------------------------------- Portable Pixmap ppm ppm Portable Graymap pgm pgm Portable Bitmap pbm pbm CompuServe GIF gif gif Windows/OS2 BMP file bmp bmp JPEG/JFIF format jpeg jpg X Window Bitmap xbm xbm X Window Dump xwd xwd X PixMap xpm xpm XPM3 only NASA/NOST FITS fits fits Standard FITS and IMAGE extension Portable Network Graphics png png needs netpbm SGI RGB format iris rgb need pbmplus/netpbm package PostScript format ps ps needs gs for reading Tagged Image File Format tiff tif no compression support To avoid executable bloating with unnecessary code, only ppm, pgm, pbm and compression filters (gzip and compress) are enabled by default. To enable other formats, call `flimage_enable_xxx()' once anywhere after `*note fl_initialize()::', where `xxx' is the short name for the format. For example, to enable BMP format, `flimage_enable_bmp()' should be called. Further, if you enable GIF support, you're responsible for any copyright/patent and intellectual property dispute arising from it. Under no circumstance should the authors of the Forms Library be liable for the use or misuse of the GIF format. Usually there are choices on how the image should be read and written. The following is a rundown of the built-in options that control some aspects of image support. Note that these options are persistent in nature and once set they remain in force until reset. typedef struct { int quality; int smoothing; } FLIMAGE_JPEG_OPTIONS; void flimage_jpeg_output_options(FLIMAGE_JPEG_OPTIONS *option); The default quality factor for JPEG output is 75. In general, the higher the quality factor rhe better the image is, but the file size gets larger. The default smoothing factor is 0. void flimage_pnm_output_options(int raw_format); For PNM (ppm, pgm, and pbm) output, two variants are supported, the binary (raw) and ASCII format. The raw format is the default. If the output image is of type `FL_IMAGE_GRAY16', ASCII format is always output. void flimage_gif_output_options(int interlace); If `interlace' is true, an interlaced output is generated. Transparency, comments, and text are controlled, respectively, by `image->tran_rgb', `image->comments' and `image->text'. PostScript options affect both reading and writing. FLIMAGE_PS_OPTION *flimage_ps_options(void); where the control structure has the following members `int orientation' The orientation of the generated image on paper. Valid options are `FLPS_AUTO', `FLPS_PORTRAIT' and `FLPS_LANDSCAPE'. The default is `FLPS_AUTO'. `int auto_fit' By default, the output image is scaled to fit the paper if necessary. Set it to false (0) to turn auto-scaling off. `float xdpi, ydpi' These two are the screen resolution. Typical screens these days have resolutions about 80 dpi. The settings of these affect both reading and writing. `float paper_w' The paper width, in inches. The default is 8.5 in. `float paper_h' The paper height, in inches. The default is 11.0 in `char* tmpdir' A directory name where temporary working files go. The default is `/tmp'. `float hm, vm' Horizontal and vertical margins, in inches, to leave when writing images. The default is 0.4 in (about 1 cm). `float xscale' Default is 1.0. `float yscale' Default is 1.0. `int first_page_only' If set, only the first page of the document will be loaded even if the document is multi-paged. The default setting is false. To change an option, simply call `*note flimage_ps_options()::' and change the field from the pointer returned by the function: void SetMyPageSize(float w, float h) { FLIMAGE_PS_OPTION *options = flimage_ps_options(); options->paper_w = w; options->paper_h = h; } All these option setting routines can be used either as a configuration routine or an image-by-image basis by always calling one of these routines before `*note flimage_dump()::'. For example, flimage_jpeg_output_options(option_for_this_image); flimage_dump(im, "file","jpeg"); You can also utilize the `image->pre_write' function to set the options. This function, if set, is always called inside `*note flimage_dump()::' before the actual output begins. ---------- Footnotes ---------- (1) The Graphics Interchange Format (c) is the Copyright property of CompuServe Incorporated. GIF(sm) is a Service Mark property of CompuServe Incorporated.  File: xforms.info, Node: Adding New Formats, Next: Queries, Prev: Built-in support, Up: Supported Image Formats 37.5.2 Adding New Formats ------------------------- It is possible for application to add new formats to the library so `*note flimage_load()::' and `*note flimage_dump()::' know how to handle them. Basically, the application program tells the library how to identify the image format, and the image dimension, and how to read and write pixels. The API for doing so is the following typedef int (*FLIMAGE_Identify) (FILE *); typedef int (*FLIMAGE_Description) (FL_IMAGE *); typedef int (*FLIMAGE_Read_Pixels) (FL_IMAGE *); typedef int (*FLIMAGE_Write_Image) (FL_IMAGE *); int flimage_add_format(const char *formal_name, const char *short_name, const char *extension, int type, FLIMAGE_Identify identify, FLIMAGE_Description description, FLIMAGE_Read_Pixels read_pixels, FLIMAGE_Write_Image write_image); where we have `formal_name' The formal name of the image format `short_name' An abbreviated name for the image format `extension' File extension, if this field is `NULL', `short_name' will be substituted `type' The image type. This field generally is one of the supported image types (e.g., `FL_IMAGE_RGB'), but it does not have to. For image file formats that are capable of holding more than one type of images, this field can be set to indicate this by ORing the supported types together (e.g., `FL_IMAGE_RGB|FL_IMAGE_GRAY'). However, when description returns, the image type should be set to the actual type in the file. `identify' This function should return 1 if the file pointed to by the file pointer passed in is the expected image format (by checking signature etc.). It should return a negative number if the file is not recognized. The decision if the file pointer should be rewound or not is between this function and the description function. `description' This function in general should set the image dimension and type fields (and colormap length for color index images) if successful, so the driver can allocate the necessary memory for read pixel. Of course, if `read_pixels' elects to allocate memory itself, the `description' function does not have to set any fields. However, if reading should continue, the function should return 1 otherwise a negative number. The function should read from input file stream `image->fpin'. It is likely that some information obtained in this function needs to be passed to the actual pixel reading routine. The easiest way is, of course, to make these information static within the file, but if a GUI system is in place, all the reading routines should try to be reentrant. The method to avoid static variables is to use the `image->io_spec' field to keep these information. If this field points to some dynamically allocated memory, you do not need to free it after `read_pixels' function finishes. However, if you free it or this field points to static memory, you should set to this field to `NULL' when finished. The following is a short example showing how this field may be utilized. typedef struct { int bits_per_pixel; int other_stuff; } SPEC; static int description(FL_IMAGE *im) { SPEC *sp = fl_calloc(1, sizeof *sp); im->io_spec = sp; im->spec_size = sizeof *sp; sp->bits_per_pixel = read_from_file(im->fpin); return 0; } static int read_pixels(FL_IMAGE *im) { SPEC *sp = im->io_spec; int bits_per_pixel = sp->bits_per_pixel; read_file_based_on_bits_per_pixel(im->fpin); /* You don't have to free im->io_spec, but if you do remember to set it to NULL before returning */ return 0; } `read_pixels' This function reads the pixels from the file and fills one of the pixel matrix in the image structure depending on the type. If reading is successful, a non-negative number should be returned otherwise a negative number should be returned. Upon entry, `image->completed' is set to zero. The function should not close the file. `write_image' This function takes an image structure and should write the image out in a format it knows. Prior to calling this routine, the driver will have already converted the image type to the type it wants. The function should return 1 on success and a negative number otherwise. If only reading of the image format is supported this parameter can be set to `NULL'. The function should write to file stream `image->fpout'. By calling `*note flimage_add_format()::' the newly specified image format is added to a "recognized image format" pool in the library. When `*note flimage_load()::' is called the library, after verifying that the file is readable, loops over each of the formats and calls the `identify' routine until a format is identified or the pool exhausted. If the file is recognized as one of the supported formats the `description' routine is called to obtain the image dimension and type. Upon its return the library allocates all memory needed, then calls `read_pixels'. If the image format pool is exhausted before the file is recognized `*note flimage_load()::' fails. On output, when `*note flimage_dump()::' is called, the requested format name is used to look up the output routine from the image format pool. Once an output routine for the requested format is found, the library looks the image type the output is capable of writing. If the current image type is not among the types supported by the format the library converts image to the type needed prior to calling the output routine `write_image()'. So what `*note flimage_dump()::' does is int flimage_dump(FL_IMAGE *im, const char *filename, const char *formatName) { format = search_image_format_pool(formatName); if (!format) return -1; im->fpout = fopen(filename); if (im->pre_write) im->pre_write(im); convert image type if necessary(im); format->write_pixels(im); ... } If the name of the image format supplied by `*note flimage_add_format()::' is identical to one that is already supported, the new routines replace those that are in the pool. This way, the application can override the built-in supports. For a non-trivial example of adding a new format, see file `flimage_jpeg.c'. Another way of adding image formats is through external filters that convert an unsupported format into one that is. All you need to do is inform the library what external filter to use. `pbmplus' or `netpbm' are excellent packages for this purpose. The library has two functions that deal with external filters int flimage_description_via_filter(FL_IMAGE * im, char *const *cmds, const char *what, int verbose); int flimage_write_via_filter(FL_IMAGE *im, char *const *cmds, char *const formats[], int verbose); where `cmds' are a list of shell commands (filters) that convert the format in question into one of the supported formats. Parameter `what' is for reporting purposes and parameter `verbose' controls if some information and error messages should be printed. This is mainly for debugging purposes. Let us go through one example to show how this filter facility can be used. In this example, we support SGI's rgb format via the `netpbm' package. As with regular image format, we first define a function that identifies the image format: static int IRIS_identify(FILE *fp) { char buf[2]; fread(buf, 1, 2, fp); return (buf[0] == '\001' && buf[1] == '\332') || (buf[0] == '\332' && buf[1] == '\001'); } Then we need to define the filter(s) that can convert a RGB file into one that's supported. Here we use `sgitopnm', but you can use diferent filters if available. Function `*note flimage_description_via_filter()::' will try all the filters specified until one of them succeeds. If none does an error code is returned: static int IRIS_description(FL_IMAGE *im) { static char *cmds[] = {"sgitopnm %s > %s", NULL /* sentinel, indicating end of list of filters */ }; return flimage_description_via_filter(im, cmds, "Reading RGB...", 0); } All commands should be suitable format strings for function `sprintf()' and contain `%s' twice. The first one will be replaced by the input file name, the second by a filename which will be supplied by the library to hold the converted image. The list must be terminate with a `NULL' element. In the above example, `sgitopnm %s > %s' specifies the external command, `sgitopnm', and how it operates. Basically, the library will do a `sprintf(cmdbuf, cmd[i], irisfile, tmpfile)' and then execute `cmdbuf'. There is really no need for a load function as the filter will have already invoked the correct load function when it returns. For the record of capability queries, a dummy load function is needed: static int IRIS_load(FL_IMAGE * im) { fprintf(stderr, "We should never get here...\n"); return -1; } Writing an image is similar: static int IRIS_dump(FL_IMAGE *im) { static char *cmds[] = {"pnmtosgi %s > %s", NULL}; static char *cmds_rle[] = {"pnmtosgi -rle %s > %s", NULL}; static char *formats[] = {"ppm", "pgm", "pbm", NULL}; return flimage_write_via_filter(im, rle ? cmds_rle : cmds, formats, 0); } Again, the external commands should accept two arguments. The first argument will be supplied by the library, a temporary file that holds the converted image in a format the filter understands, and the second argument will be the requested output filename. For output, an additional argument is required. The additional argument `formats' specifies the image format accepted by the external filter. In this case, this is the pnm format. It is important that if the filter accepts more than one format, you should specify the formats in decreasing generality, i.e., ppm, pgm, pbm. With these functions in place, finally we're ready to add iris support into the library void add_iris(void) { flimage_add_format("SGI Iris", "iris", "rgb", FL_IMAGE_RGB|FL_IMAGE_GRAY|FL_IMAGE_MONO, IRIS_identify, IRIS_description, IRIS_load, IRIS_dump); } After a call of `add_iris()' you can now use `*note flimage_load()::' and `*note flimage_dump()::' to read and write SGI iris format just like any other format.  File: xforms.info, Node: Queries, Prev: Adding New Formats, Up: Supported Image Formats 37.5.3 Queries -------------- Since the number of formats supported by the library is dynamic in nature, some query routines are available to obtain support information. To obtain the number of currently supported image formats, use the routine int flimage_get_number_of_formats(void); The functions returns the number of formats supported, for reading or writing or both. To obtain detailed information for each format, the following can be used typedef struct { const char * formal_name; const char * short_name; const char * extension; int type; int read_write; int annotation; } FLIMAGE_FORMAT_INFO; const FLIMAGE_FORMAT_INFO *flimage_get_format_info(int n); where parameter `n' is an integer between 1 and the return value of `*note flimage_get_number_of_formats()::' . Upon function return a static buffer is returned containing the basic information about the image. The read_write field can be one of the following combinations thereof `FLIMAGE_READABLE' supports reading `FLIMAGE_WRITABLE' supports writing or the bitwise OR of both. These two routines are most useful for reporting or presenting capabilities to the user FLIMAGE_FORMAT_INFO *info; int n = flimage_get_number_of_formats(); fprintf(stderr,"FL supports the following format\n"); for (; n; n--) { info = flimage_get_format_info(n); fprintf(stderr,"%s format\t(%c%c)\n", info->short_name, (info->read_write & FLIMAGE_READABLE) ? 'r' : ' ', (info->read_write & FLIMAGE_WRITABLE) ? 'w' : ' '); }  File: xforms.info, Node: Setup and Configuration, Next: Simple Image Processing, Prev: Supported Image Formats, Up: Part VI Images 37.6 Setup and Configuration ============================ Although the image support is designed with integration into a GUI system in mind, it neither assumes what the GUI system is nor does it need a GUI system to work. As a matter of fact, for the most part it doesn't even need an X connection to work (obviously without a connection, you won't be able to display images). For this reason, some of the typical (and necessary) tasks, such as progress and error reporting, are by default implemented only to use text output (i.e., to `stderr'). Obviously, with a GUI in place this is not quite adequate. Hooks are available for application program to re-define what to do with these tasks. The interface to the library configuration is as follows void flimage_setup(FLIMAGE_SETUP *setup); where the parameter `setup' is a pointer to a structure defined as follows: typedef struct { void * app_data; int (*visual_cue) (FL_IMAGE *im, const char *msg); void (*error_message) (FL_IMAGE *im, const char *msg); const char * rgbfile; int do_not_clear; int max_frames; int delay; int double_buffer; int add_extension; } FLIMAGE_SETUP; with `app_data' The application can use this field to set a value so the field `image->app_data' in all image structures returned by the library will have this value. It's most useful to set this field to something that's persistent during the application run, such as the `fdui' structure of the main control panel. Note that `image->app_data' is different from `image->u_vdata' in that all image structures returned by the library have the same value of `image->app_data', which is set by the library. In contrast, `image->u_vdata' is set by the application on an image-by-image basis. `visual_cue' This is the function that will be called by all image reading, writing and processing routines. The function is meant to give the user some visual feedback about what is happening. For lengthy tasks, this function is called repeatedly and periodically to indicate what percentage of the task is completed and to give the application program a chance to check and process GUI activities (for example, via `*note fl_check_forms()::'). The first parameter to the function is the image currently being worked on and the second parameter is a short message, indicating the name of the task, such as "Reading JPG" etc. Two fields in the image structure can be used to obtain progress information. The member fields `image->total' indicates the total amount of work to be done in some arbitrary units (usually number of rows in the image). `image->completed' indicates how much of the task has been completed. The percentage of how much is completed is then simply the ratio of `image->completed' and `image->total', multiplied by 100. At the begin of a task `image->completed' is set to a value less or equal 1, and at the end of the task, `image->completed' is set to `image->total'. A special value of -1 for `image->completed' may be used to indicate a task of unknown length. `error_message' This is a function that is called when an error (of all severities) has occurred inside the library. It is recommanded that the application provide a means to show the messages to the user by sypplying this function. The first parameter is a pointer to the image that's being worked on, and the second parameter is a brief message, such as "memory allocation failed" etc. A convenience function, `*note flimage_error()::', is provided to call the error message handler. `rgbfile' This field should be set to the full path to the color name database (`rgb.txt') if your system has it in non-standard locations. On most systems, this file is `/usr/lib/X11/rgb.txt', which is the default if this field is not set.(1) `do_not_clear' By default, `*note flimage_display()::' clears the window before displaying the image. Set this member to 1 to disable window clearing. `no_auto_extension' By default, `*note flimage_dump()::' changes the filename extension to reflect the format. Set this member to 1 to disable extension substitution. `double_buffer' If set, all image display will by default double-buffered. Double-buffering an image is very expensive (in terms of both resource and speed) as the backbuffer is simulated using a pixmap. If there are no annotations, double-buffering an image does not really improve anything. It is far better to turn double-buffering on and off on a image-by-image basis using the `image->double_bufffer' field. `max_frames' This field specifies the maximum number of frames to read by `*note flimage_load()::'. The default maximum is 30 frames. `delay' This field specifies the delay (in milliseconds) between successive frames. It is used by the `*note flimage_display()::' routine. Note that it is always a good idea to clear the setup structure before initializing and using it FLIMAGE_SETUP mysetup; memset(mysetup, 0, sizeof mysetup); mysetup.max_frames = 100; mysetup.delay = 10; flimage_setup(&mysetup); It is possible to modify the image loading process by utilizing the following routines `*note flimage_load()::' is based on: FL_IMAGE *flimage_open(const char *name); This function takes a file name and returns an image sturcture pointer if the file is a recognized image file. Otherwise `NULL' is returned. The function FL_IMAGE *flimage_read(FL_IMAGE *im); takes an image structure returned by `*note flimage_open()::' and fills the image structure. Between `*note flimage_open()::' and `*note flimage_read()::' you can inspect or modify fields in the image structure. int flimage_close(FL_IMAGE *im); This function closes all file streams used to create the image. ---------- Footnotes ---------- (1) The routine where this field is used searches some more locations than the default and should work on most systems automagically.  File: xforms.info, Node: Simple Image Processing, Next: Utilities, Prev: Setup and Configuration, Up: Part VI Images 37.7 Simple Image Processing ============================ Some simple image processing capabilities are present in the Forms Library image support. All the image processing routines take an image as a parameter and process it in place. If appropriate, only the subimage specified by `(image->subx, image->suby)' and `(image->subw, image->subw)' is affected (note these are different fields from those for subimage displaying). The subimage fields are best set via user interaction, perhaps by having a rubber band that the user can drag to set the size. In the following, each routine will be briefly explained. * Menu: * Convolution:: * Tint:: * Rotation:: * Image Flipping:: * Cropping:: * Scaling:: * Warping:: * General Pixel Transformation:: * Image Annotation:: * Write Your Own Routines::  File: xforms.info, Node: Convolution, Next: Tint, Up: Simple Image Processing 37.7.1 Convolution ------------------ Convolution or filtering can be done easily using the following routine int flimage_convolve(FL_IMAGE *im, int **kernel, int krow, int kcol); This function takes a convolution kernel of `krow' by `kcol' and convolves it with the image. The result replaces the input image. The kernel size should be odd. If successful, the function returns a positive integer, otherwise a negative number. The kernel should be allocated by `*note fl_get_matrix()::'. To use a kernel that's a C 2-dimensional array (cast to a pointer to int), use the following function int flimage_convolvea(FL_IMAGE *im, int *kernel, int krow, int kcol); The difference between these two functions is in their usage syntax: int **kernel1 = fl_get_matrix(sizeof **kernel, n, m); int kernel2[n][m]; kernel1[x][y] = z; kernel2[x][y] = z; flimage_convolve(im, kernel1, n, m); flimage_convolvea(im, (int*) kernel2, n, m); /* note the cast */ Two special built-in kernels are designated with the following symbolic constants `FLIMAGE_SMOOTH' indicates a 3 by 3 smoothing kernel `FLIMAGE_SHARPEN' indicates a 3 by 3 sharpening kernel  File: xforms.info, Node: Tint, Next: Rotation, Prev: Convolution, Up: Simple Image Processing 37.7.2 Tint ----------- Tint as implemented in the Forms Library emulates the effect of looking at an image through a piece of colored glass. You can specify the color and transparency of the glass: int flimage_tint(FL_IMAGE *im, unsigned int packed, double opacity); where the parameter `packed' is a packed RGB color, specifying the color of the glass. `opacity' specifies how much the color of the image is absorbed by the glass. A value of 0 means the glass is totally transparent, i.e., the glass has no effect3, while a value of 1.0 means total opaqueness, i.e., all you see is the color of the glass. Any value between these two extremes results in a color that is a combination of the pixel color and the glass color. For example, to tint a part of the image bluish, you can set `packed' to `FL_PACK(0,0,200)' and use an opacity of 0(1). Tint is most useful in cases where you want to put some annotations on the image, but do not want to use a uniform and opaque background that completely obscures the image behind. By using tint, you can have a background that provides some contrast to the text, yet not obscures the image beneath completely. Tint operation uses the subimage settings. ---------- Footnotes ---------- (1) Strictly speaking, a piece of glass that is totally transparent can't have colors.  File: xforms.info, Node: Rotation, Next: Image Flipping, Prev: Tint, Up: Simple Image Processing 37.7.3 Rotation --------------- Image rotation can be easily done with the following routine int flimage_rotate(FL_IMAGE *im, int angle, int subpixel); where `angle' is the angle in one-tenth of a degree (i.e., a 45 degree rotation should be specified as 450) with a positive sign for counter-clock rotation. The parameter `subpixel' should be one of the following, specifying if subpixel sampling should be enabled. It can be set to either `FLIMAGE_NOSUBPIXEL' or `FLIMAGE_SUBPIXEL'. If subpixel sampling is enabled, the resulting image pixels are interpolated from the original pixels. This usually has an "anti-aliasing" effect that leads to less severe jagged edges and similar artifacts commonly encountered in rotations. However, it also means that a color indexed image gets converted to a RGB image. If preserving the pixel value is important, you should not turn subpixel sampling on. `*note flimage_rotate()::' return a negative number if it for some reason (usually due to running out of memory) fails to perform the rotation. Since the rotated image has to be on a rectangular grid, the regions that are not occupied by the image are filled with a fill color, where the default is black. If a different fill color is desired you can set the `image->fill_ccolor' field to a packed RGB color before calling the rotation function. Note that even for color indexed images the fill color should be specified in RGB. The rotation function will search the colormap for the appropriate index if no subpixel sampling is used. Repeated rotations should be avoided if possible. If you have to call it more than once it's a good idea to crop after rotations in order to get rid of the regions that contain only fill color.  File: xforms.info, Node: Image Flipping, Next: Cropping, Prev: Rotation, Up: Simple Image Processing 37.7.4 Image Flipping --------------------- Image flipping refers to the mirror operation in x- or y-direction at the center. For example, to flip the columns of an image, the left and right of the image are flipped (just like having a vertical mirror in the center of the image) thus the first pixel on any given row becomes the last, and the last pixel becomes the first etc. The API for flipping is as follows int flimage_flip(FL_IMAGE *im, int what); where `what' can be `'c'' or `'r''. indicating if column and row flipping is desired.  File: xforms.info, Node: Cropping, Next: Scaling, Prev: Image Flipping, Up: Simple Image Processing 37.7.5 Cropping --------------- There are two functions available to crop an image int flimage_autocrop(FL_IMAGE *im, unsigned int background); int flimage_crop(FL_IMAGE *im, int xl, int yt, int xr, int yb); The first function, as its name suggests, automatically crops an image using the background as the color to crop. The function works by searching the image from all four sides and removing all contiguous regions of the uniform background from the sides. The image is modified in place. If cropping is successful, a non-negative integer is returned, otherwise -1. If `background' is specified as the constant `FLIMAGE_AUTOCOLOR', the background is chosen as the first pixel of the image. The second function uses the parameters supplied by the user to crop the image. `xl' and `xr' are the offsets into the image from the left and the right sides, respectively, i.e., if both `xl' and `xr' are 1, the cropping removes the first column and the last column from the image. Parameters `yt' and `yb' specify the offsets into the image from the top and bottom of the image respectively. Note the offsets do not have to be positive. When they are negative, they indicate enlargement of the image. The additional regions are filled with the uniform color specified by `image->fill_color', a packed RGB color. This can be quite useful to add a couple of pixels of border to an image. For example, the following adds a 1 pixel wide yellow border to an image image->fill_color = FL_PACK(255,255,0); flimage_crop(image, -1, -1, -1, -1); Another function is available that can be used to obtain the auto-cropping offsets int flimage_get_autocrop(FL_IMAGE *im, unsigned background, int *xl, int *yt, int *xl, int *yb); This function works the same way as `*note flimage_autocrop()::', except that no actual cropping is performed. Upon function return the parameters `xl', `yt', `xl' and `yb' are set to the offsets found by the function. The application can then make adjustment to these offsets and call `*note flimage_crop()::'.  File: xforms.info, Node: Scaling, Next: Warping, Prev: Cropping, Up: Simple Image Processing 37.7.6 Scaling -------------- An image can be scaled to any desired size with or without subpixel sampling. Without subpixel sampling simple pixel replication is used, otherwise a box average algorithm is employed that yields an anti-aliased image with much less artifacts. A special option is available that scales the image to the desired size but keeps the aspect ratio of the image the same by filling the part of the image that would otherwise be empty. The main entry point to the scaling function is int flimage_scale(FL_IMAGE *im, int newwidth, int newheight, int option); where the parameters `newwidth' and `newheight' specify the desired image size. Parameter `option'q can be one of the following constants or the bitwise OR of them: `FLIMAGE_NOSUBPIXEL' scale the image with no subpixel sampling `FLIMAGE_SUBPIXEL' scale the image with subpixel sampling `FLIMAGE_ASPECT' scale the image with no aspect ratio change `FLIMAGE_CENTER' center the scaled image if aspect `FLIMAGE_NOCENTER' do not center the scaled image For example, `FLIMAGE_ASPECT|FLIMAGE_SUBPIXEL' requests fitting the image to the new size with subpixel sampling. `FLIMAGE_ASPECT' specifies a scaling that results in an image of the requested size (even if the scales are different for width and height) without changing the aspect ratio of the original image by filling in the stretched regions with the fill color `image->fill_color', a packed RGB color: im->fill_color = FL_PACK(255,0,0); flimage_scale(im, im->w+2, im->h, FLIMAGE_SUBPIXEL|FLIMAGE_ASPECT); This code generates an image that is two pixels wider than the original image but with the same aspect ratio. The two additional pixel columns on each side of the image are filled with the fill color (red), yielding a red border. The fitting can be useful in turning a series of images of unequal sizes into images of equal sizes with no perceptible change in image quality. Depending on what the application requires, simple scaling (zooming) with no subpixel sampling is much faster than box averaging or blending, but subpixel sampling tends to yield smoother images with less scaling artifacts. xforms-1.2.4/doc/part4_drawing_objects.texi0000664000175000017500000010763712344033372015714 00000000000000@node Part IV Drawing Objects @chapter Drawing Objects @ifnottex @menu * General Remarks: General Remarks * Color Handling: Color Handling * Mouse Handling: Mouse Handling * Clipping: Clipping * Getting the Size: Getting the Size * Font Handling: Font Handling * Drawing Functions: Drawing Functions @end menu @end ifnottex @node General Remarks @section General Remarks An important aspect of a new object class (or a free object) is how to draw it. As indicated above this should happen when the event @code{FL_DRAW} is received by the object. The place and size, i.e., the bounding box, of the object are indicated by the object tructure fields @code{obj->x}, @code{obj->y}, @code{obj->w} and @code{obj->h}. Forms are drawn in the Forms Library default visual or the user requested visual, which could be any of the X supported visuals. Hence, preferably your classes should run well in all visuals. The Forms Library tries to hide as much as possible the information about graphics mode and, in general, using the built-in drawing routines is the best approach. Here are some details about graphics state in case such information is needed. All state information is kept in a global structure of type @tindex FL_State @anchor{FL_State} @code{FL_State} and there is a total of six such structures, @code{fl_state[6]}, each for every visual class. The structure contains among others the following members: @table @code @item XVisualInfo *xvinfo Many properties of the current visual can be obtained from this member. @item int depth The depth of the visual. Same as what you get from @code{xvinfo}. @item int vclass The visual class, @code{PseudoColor}, @code{TrueColor} etc. @item Colormap colormap Current active colormap valid for the current visual for the entire Forms Library (except @code{FL_CANVAS}). You can allocate colors from this colormap, but you should never free it. @item Window trailblazer This is a valid window resource ID created in the current visual with the colormap mentioned above. This member is useful if you have to call, before the form becomes active (thus does not have a window ID), some Xlib routines that require a valid window. A macro, @findex fl_default_window() @anchor{fl_default_window()} @code{fl_default_window()}, is defined to return this member and use of the macro is encouraged. @item GC gc[16] A total of 16 GCs appropriate for the current visual and depth. The first (@code{gc[0]}) is the default @code{GC} used by many internal routines and should be modified with care. It is a good idea to use only the top 8 @code{GC}s (8-15) for your free object so that future Forms Library extensions won't interfere with your program. Since many internal drawing routines use the Forms Library's default @code{GC} (@code{gc[0]}), it can change anytime whenever drawing occurs. Therefore, if you are using this GC for some of your own drawing routines make sure to always set the proper value before using it. @end table The currently active visual class (@code{TrueColor}, @code{PseudoColor} etc.) can be obtained by the following function/macro: @findex fl_get_form_vclass() @anchor{fl_get_form_vclass()} @findex fl_get_vclass() @anchor{fl_get_vclass()} @example int fl_get_form_vclass(FL_FORM *form); int fl_get_vclass(void); @end example @noindent The value returned can be used as an index into the array @code{@ref{fl_state}} of @code{@ref{FL_State}} structures. Note that @code{@ref{fl_get_vclass()}} should only be used within a class/new object module where there can be no confusion what the "current" form is. Other information about the graphics mode can be obtained by using visual class as an index into the @code{fl_state} structure array. For example, to print the current visual depth, code similar to the following can be used: @example int vmode = fl_get_vclass(); printf("depth: %d\n", fl_state[vmode].depth); @end example @noindent Note that @code{fl_state[]} for indices other than the currently active visual class might not be valid. In almost all Xlib calls, the connection to the X server and current window ID are needed. The Forms Library comes with some utility functions/macros to facilitate easy utilization of Xlib calls. Since the current version of Forms Library only maintains a single connection, the global variable @code{@ref{fl_display}} can be used where required. However, it is recommended that you use @findex fl_get_display() @anchor{fl_get_display()} @code{fl_get_display()} or @findex FL_FormDisplay() @anchor{FL_FormDisplay()} @code{FL_FormDisplay(Form *form)} instead since the function/macro version has the advantage that your program will remain compatible with future (possibly multi-connection) versions of the Forms Library. There are a couple of ways to find out the "current" window ID, defined as the window ID the object receiving dispatcher's messages like @code{FL_DRAW} etc.@: belongs to. If the object's address is available, @code{FL_ObjWin(obj)} will suffice. Otherwise the function @code{@ref{fl_winget()}} (see below) can be used. There are other routines that might be useful: @findex fl_win_to_form() @anchor{fl_win_to_form()} @example FL_FORM *fl_win_to_form(Window win); @end example @noindent This function takes a window ID win and returns the form the window belongs to or @code{None} on failure. @node Color Handling @section Color Handling As mentioned earlier, Forms Library keeps an internal colormap, initialized to predefined colors. The predefined colors do not correspond to pixel values the server understands but are indexes into the colormap. Therefore, they can't be used in any of the @code{GC} altering or Xlib routines. To get the actual pixel value the X server understands, use the following routine @findex fl_get_pixel() @anchor{fl_get_pixel()} @example unsigned long fl_get_pixel(FL_COLOR col); @end example @noindent To e.g., get the pixel value of the red color, use @example unsigned long red_pixel; red_pixel = fl_get_pixel(FL_RED); @end example To change the foreground color in the Forms Library's default @code{GC} (@code{gc[0]}) use @findex fl_color() @anchor{fl_color()} @example void fl_color(FL_COLOR col); @end example To set the background color in the default @code{GC} use instead @findex fl_bk_color() @anchor{fl_bk_color()} @example void fl_bk_color(FL_COLOR col); @end example To set foreground or background in @code{GC}s other than the Forms Library's default, the following functions exist: @findex fl_set_foreground() @anchor{fl_set_foreground()} @findex fl_set_background() @anchor{fl_set_background()} @example void fl_set_foreground(GC gc, FL_COLOR col); void fl_set_background(GC gc, FL_COLOR col); @end example @noindent which is equivalent to the following Xlib calls @example XSetForeground(fl_get_display(), gc, fl_get_pixel(color)); XSetBackground(fl_get_display(), gc, fl_get_pixel(color)); @end example To free allocated colors from the default colormap, use the following routine @findex fl_free_colors() @anchor{fl_free_colors()} @example void fl_free_colors(FL_COLOR *cols, int n); @end example @noindent This function frees the @code{n} colors stored in the array of colormap indices @code{cols}. You shouldn't do that for the reserved colors, i.e., colors with indices below @code{FL_FREE_COL1}. In case the pixel values (instead of the index into the colormap) are known, the following routine can be used to free the colors from the default colormap @findex fl_free_pixels() @anchor{fl_free_pixels()} @example void fl_free_pixels(unsigned long *pixels, int n); @end example @noindent Note that the internal colormap maintained by the Forms Library is not updated. This is in general harmless. To modify or query the internal colormap, use the following routines: @findex fl_mapcolor() @anchor{fl_mapcolor()} @findex fl_mapcolorname() @anchor{fl_mapcolorname()} @findex fl_getmcolor() @anchor{fl_getmcolor()} @example unsigned long fl_mapcolor(FL_COLOR col, int red, int green, int blue) long fl_mapcolorname(FL_COLOR col, const char *name); unsigned long fl_getmcolor(FL_COLOR col, int *red, int *green, int *blue); @end example @noindent The first function, @code{@ref{fl_mapcolor()}} sets a the color indexed by @code{color} to the color given by the @code{red}, @code{green} and @code{blue}, returning the colors pixel value. The second function, @code{@ref{fl_mapcolorname()}}, sets the color in the colormap indexed by @code{color} to the color named @code{name}, where @code{name} must be a valid name from the system's color database file @file{rgb.txt}. It also returns the colors pixel value or -1 on failure. The last function, @code{@ref{fl_getmcolor()}}, returns the RGB values of the color indexed by @code{color} in the second to third argument pointers and the pixel value as the return value (or -1, cast to @code{unsigned long}, on failure). @node Mouse Handling @section Mouse Handling The coordinate system used corresponds directly to that of the screen. But object coordinates are relative to the upper-left corner of the form the object belongs to. To obtain the position of the mouse relative to a certain form or window, use the routines @findex fl_get_form_mouse() @anchor{fl_get_form_mouse()} @findex fl_get_win_mouse() @anchor{fl_get_win_mouse()} @example Window fl_get_form_mouse(FL_FORM *form, FL_Coord *x, FL_Coord *y, unsigned *keymask) Window fl_get_win_mouse(Window win, FL_Coord *x, FL_Coord *y, unsigned *keymask); @end example @noindent The functions return the ID of the window the mouse is in. Upon return @code{x} and @code{y} are set to the mouse position relative to the form or window and @code{keymask} contains information on modifier keys (same as the the corresponding @code{XQueryPointer()} argument). A similar routine exists that can be used to obtain the mouse location relative to the root window @findex fl_get_mouse() @anchor{fl_get_mouse()} @example Window fl_get_mouse(FL_Coord *x, FL_Coord *y, unsigned *keymask); @end example @noindent The function returns the ID of the window the mouse is in. To move the mouse to a specific location relative to the root window, use the following routine @findex fl_set_mouse() @anchor{fl_set_mouse()} @example void fl_set_mouse(FL_Coord x, FL_Coord y); @end example @noindent Use this function sparingly, it can be extremely annoying for the user if the mouse position is changed by a program. @node Clipping @section Clipping To avoid drawing outside a box the following routine exists: @findex fl_set_clipping() @anchor{fl_set_clipping()} @example void fl_set_clipping(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h); @end example @noindent It sets a clipping region in the Forms Library's default @code{GC} used for drawing (but not for output of text, see below). @code{x}, @code{y}, @code{w} and @code{h} define the area drawing is to restrict to and are relative to the window/form that will be drawn to. In this way you can prevent drawing over other objects. Under some circumstances XForms also does it's own clipping, i.e., while drawing due to a exposure event. This is called "global clipping". Thus the clipping area you have set via a call of @code{@ref{fl_set_clipping()}} may get restricted even further due this global clipping. You can check if there's clipping set for the default @code{GC} using the function @findex fl_is_clipped() @anchor{fl_is_clipped()} @example int fl_is_clipped(int include_global); @end example @noindent which returns @code{1} if clipping is switched on and @code{0} otherwise. The @code{include_global} argument tells the function if global clipping is to be included in the answer or not (i.e., if the argument is @code{0} only clipping set via @code{@ref{fl_set_clipping()}} is reported). The area currently clipped to is returned by the function @findex fl_get_clipping() @anchor{fl_get_clipping()} @example int fl_get_clipping(int include_global, FL_Coord *x,FL_Coord *y, FL_Coord *width, FL_Coord *height); @end example @noindent On return the four pointer arguments are set to the position and size of the clipping rectangle (at least if clipping is switched on) and the qreturn value of this function is the same as that of @code{@ref{fl_is_clipped()}}. The @code{include_global} argument has the same meaning as for @code{@ref{fl_is_clipped()}}, i.e., it controls if the effects of global clipping is included in the results. When finished with drawing always use @findex fl_unset_clipping() @anchor{fl_unset_clipping()} @example void fl_unset_clipping(void); @end example @noindent to switch clipping of again. You also can check and obtain the current settings for global clipping using the functions @findex fl_is_global_clipped() @anchor{fl_is_global_clipped()} @findex fl_get_global_clipping() @anchor{fl_get_global_clipping()} @example int fl_is_global_clipped(void); int fl_get_global_clipping(FL_Coord *x,FL_Coord *y, FL_Coord *width, FL_Coord *height); @end example Clipping for text is controlled via a different @code{GC} and thus needs to be set, tested for and unset using a different set of functions: @findex fl_set_text_clipping() @anchor{fl_set_text_clipping()} @findex fl_is_text_clipped( @anchor{fl_is_text_clipped()} @findex fl_get_text_clipping( @anchor{fl_get_text_clipping()} @findex fl_unset_text_clipping() @anchor{fl_unset_text_clipping()} @example void fl_set_text_clipping(FL_Coord x,FL_Coord y,FL_Coord w,FL_Coord h); int fl_is_text_clipped(int include_global); int fl_get_text_clipping(int include_global, FL_Coord *x,FL_Coord *y, FL_Coord *width, FL_Coord *height); void fl_unset_text_clipping(void); @end example Finally, there are functions to set and unset the clipping for a specific @code{GC}: @findex fl_set_gc_clipping() @anchor{fl_set_gc_clipping()} @findex fl_unset_gc_clipping() @anchor{fl_unset_gc_clipping()} @example void fl_set_gc_clipping(GC gc, FL_Coord x, FL_Coord y, FL_Coord width, FL_Coord height); void fl_unset_gc_clipping(GC gc); @end example @noindent Please note that setting clipping for a @code{GC} will always further restrict the region to the region of global clipping (if it is on at the moment the function is called) and unsetting clipping will still retain global clipping if this is on at the moment the second function is invoked (if it is currently on can be checked using the @code{@ref{fl_is_global_clipped()}}). @node Getting the Size @section Getting the Size To obtain the bounding box of an object with the label taken into account (in contrast to the result of the @code{@ref{fl_get_object_geometry()} function which doesn't include a label that isn't inside the object} the following routine exists: @findex fl_get_object_bbox() @example void fl_get_object_bbox(FL_OBJECT *obj, FL_Coord *x, FL_Coord *y, FL_Coord *w, FL_Coord *h); @end example For drawing text at the correct places you will need some information about the sizes of characters and strings. The following routines are provided: @findex fl_get_char_height() @anchor{fl_get_char_height()} @findex fl_get_char_width() @anchor{fl_get_char_width()} @example int fl_get_char_height(int style, int size, int *ascent, int *descent) int fl_get_char_width(int style, int size); @end example @noindent These two routines return the maximum height and width of the font used, where @code{size} indicates the point size for the font and @code{style} is the style in which the text is to be drawn. The first function, @code{@ref{fl_get_char_height()}}, also returns the height above and below the baseline of the font via the @code{ascent} and @code{descent} arguments (if they aren't @code{NULL} pointers). A list of valid styles can be found in Section 3.11.3. To obtain the width and height information for a specific string use the following routines: @findex fl_get_string_width() @anchor{fl_get_string_width()} @findex fl_get_string_height() @anchor{fl_get_string_height()} @example int fl_get_string_width(int style, int size, const char *str, int len); int fl_get_string_height(int style, int size, const char *str, int len, int *ascent, int *descent); @end example where @code{len} is the length of the string @code{str}. The functions return the width and height of the string, respectively. The second function also returns the height above and below the fonts baseline if @code{ascent} and @code{descent} aren't @code{NULL} pointers. Note that the string may not contain newline characters @code{'\n'} and that the height calculated from the ascent and descent of those characters in the string that extend the most above and below the fonts baseline. It thus may not be suitable for calculating line spacings, for that use the @code{@ref{fl_get_char_height()}} or @code{@ref{fl_get_string_dimension()}} function. There exists also a routine that returns the width and height of a string in one call. In addition, the string passed can contain embedded newline characters @code{'\n'} and the routine will make proper adjustment so the values returned are large enough to contain the multiple lines of text. The height of each of the lines is the fonts height. @findex fl_get_string_dimension() @anchor{fl_get_string_dimension()} @example void fl_get_string_dimension(int style, int size, const char *str, int len, int *width, int *height); @end example @node Font Handling @section Font Handling Sometimes it can be useful to get the X font structure for a particular size and style as used in the Forms Library. For this purpose, the following routine exists: @findex fl_get_fontstruct() @anchor{fl_get_fontstruct()} @example [const] XFontStruct *fl_get_fontstruct(int style, int size); @end example @noindent The structure returned can be used in, say, setting the font in a particular @code{GC}: @example XFontStruct *xfs = fl_get_fontstruct(FL_TIMESBOLD_STYLE, FL_HUGE_SIZE); XSetFont(fl_get_display(), mygc, xfs->fid); @end example @noindent The caller is not allowed to free the structure returned by @code{@ref{fl_get_fontstruct()}}, it's just a pointer to an internal structure! @node Drawing Functions @section Drawing Functions There are a number of routines that help you draw objects on the screen. All XForms's internal drawing routine draws into the "current window", defined as the window the object that uses the drawing routine belongs to. If that's not what you need, the following routines can be used to set or query the current window: @findex fl_winset() @anchor{fl_winset()} @findex fl_winget() @anchor{fl_winget()} @example void fl_winset(Window win); Window fl_winget(void); @end example @noindent One caveat about @code{@ref{fl_winget()}} is that it can return @code{None} if called outside of an object's event handler, depending on where the mouse is. Thus, the return value of this function should be checked when called outside of an object's event handler. It is important to remember that unless the following drawing commands are issued while handling the @code{FL_DRAW} or @code{FL_DRAWLABEL} event (which is not generally recommended), it is the application's responsibility to set the proper drawable using @code{@ref{fl_winset()}}. The most basic drawing routines are for drawing rectangles: @findex fl_rectf() @anchor{fl_rectf()} @findex fl_rect() @anchor{fl_rect()} @example void fl_rectf(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col); void fl_rect(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col); @end example @noindent Both functions draw a rectangle on the screen in color @code{col}. While @code{@ref{fl_rectf()}} draws a filled rectangle, @code{@ref{fl_rect()}} just draws the outline in the given color. To draw a filled (with color @code{col}) rectangle with a black border use @findex fl_rectbound() @anchor{fl_rectbound()} @example void fl_rectbound(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col); @end example To draw a rectangle with rounded corners (filled or just the outlined) employ @findex fl_roundrectf() @anchor{fl_roundrectf()} @findex fl_roundrect() @anchor{fl_roundrect()} @example void fl_roundrectf(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col); void fl_roundrect(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col); @end example To draw a general polygon, use one of the following routines @tindex FL_POINT @findex fl_polyf() @anchor{fl_polyf()} @findex fl_polyl() @anchor{fl_polyl()} @findex fl_polybound() @anchor{fl_polybound()} @example typedef struct @{ short x, y; @} FL_POINT; void fl_polyf(FL_POINT *xpoint, int n, FL_COLOR col); void fl_polyl(FL_POINT *xpoint, int n, FL_COLOR col); void fl_polybound(FL_POINT *xpoint, int n, FL_COLOR col); @end example @noindent @code{@ref{fl_polyf()}} draws a filled polygon defined by @code{n} points, @code{@ref{fl_polyl()}} the ouline of a polygon and @code{@ref{fl_polybound()}} a filled polygon with a black outline. Note: @strong{all} polygon routines require that the array @code{xpoint} has spaces for @strong{@code{n+1}} points, i.e., one more than then number of points you intend to draw! To draw an ellipse. either filled, open (with the outline drawn in the given color), or filled with a black border the following routines can be used (use @code{w} equal to @code{h} to get a circle): @findex fl_ovalf() @anchor{fl_ovalf()} @findex fl_ovall() @anchor{fl_ovall()} @findex fl_ovalbound() @anchor{fl_ovalbound()} @example void fl_ovalf(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col); void fl_ovall(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col); void fl_ovalbound(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col); @end example @noindent The @code{x} and @code{y} arguments are the upper left hand corner of the ellipse, while @code{w} and @code{h} are its width and height. Note: @code{@ref{fl_ovall()}} (with two 'l') isn't a typo, the trailing 'l' it's meant indicate that only a line will be drawn. And there's also the function @findex fl_oval() @example void fl_ovalf(int fill, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col); @end example which is invoked by both (the macros) @code{@ref{fl_ovalf()}} and @code{@ref{fl_ovall()}} with the first argument @code{fill} set to either @code{1} or @code{0}. To simplify drawing circles there are three additional functions. The first one draws an (open) circle (with the circumfence in the given color), the second one a filled circle, and the last one a filled circle with a black circumfence: @findex fl_circ() @anchor{fl_circ()} @findex fl_circf() @anchor{fl_circf()} @findex fl_circbound() @anchor{fl_circbound()} @example void fl_circ(FL_Coord x, FL_Coord y, FL_Coord r, FL_COLOR col); void fl_circf(FL_Coord x, FL_Coord y, FL_Coord r, FL_COLOR col); void fl_circbound(FL_Coord x, FL_Coord y, FL_Coord r, FL_COLOR col); @end example @noindent Here @code{x} and @code{y} are the coordinates of the center of the circle, @code{r} is its radius and @code{col} the color to be used. To draw circular arcs, either open or filled, the following routines can be used @findex fl_arc() @anchor{fl_arc()} @findex fl_arcf() @anchor{fl_arcf()} @example void fl_arc(FL_Coord x, FL_Coord y, FL_Coord radius, int start_theta, int end_theta, FL_COLOR col); void fl_arcf(FL_Coord x, FL_Coord y, FL_Coord radius, int start_theta, int end_theta, FL_COLOR col); @end example @code{x} and @code{y} are the coordinates of the center and @code{r} is the radius. @code{start_theta} and @code{end_theta} are the starting and ending angles of the arc in units of tenths of a degree (where 0 stands for a direction of 3 o'clock, i.e., the right-most point of a circle), and @code{x} and @code{y} are the center of the arc. If the difference between @code{theta_end} and @code{theta_start} is larger than 3600 (360 degrees), drawing is truncated to 360 degrees. To draw elliptical arcs the following routine can be used: @findex fl_pieslice() @anchor{fl_pieslice()} @example void fl_pieslice(int fill, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int start_theta, int end_theta, FL_COLOR col); @end example @noindent @code{x} and @code{y} are the upper left hand corner of the box enclosing the ellipse that the pieslice is part of and @code{w} and @code{h} the width and height of that box. @code{start_theta} and @code{end_theta}, to be given in tenth of a degree, specify the starting and ending angles measured from zero degrees (3 o'clock). Depending on circumstance, elliptical arc may be more easily drawn using the following routine @findex fl_ovalarc( @anchor{fl_ovalarc(} @example void fl_ovalarc(int fill, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int theta, int dtheta, FL_COLOR col); @end example @noindent Here @code{theta} specifies the starting angle (again measured in tenth of a degree and with 0 at the 3 o'clock position), and @code{dtheta} specifies both the direction and extent of the arc. If @code{dtheta} is positive the arc is drawn in counter-clockwise direction from the starting point defined by @code{theta}, otherwise in clockwise direction. If @code{dtheta} is larger than 3600 it is truncated to 3600. To connect two points with a straight line, use @findex fl_line() @anchor{fl_line()} @example void fl_line(FL_Coord x1, FL_Coord y1, FL_Coord x2, FL_Coord y2, FL_COLOR col); @end example There is also a macro for drawing a line along the diagonal of a box (to draw a horizontal line set @code{h} to 1, not to 0): @findex fl_diagline() @anchor{fl_diagline()} @example void fl_diagline(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col); @end example To draw connected line segments between @code{n} points use @findex fl_lines() @anchor{fl_lines()} @example void fl_lines(FL_POINT *points, int n, FL_COLOR col); @end example @noindent All coordinates in points are relative to the origin of the drawable. There are also routines to draw one or more pixels @findex fl_point() @anchor{fl_point()} @findex fl_points() @anchor{fl_points()} @example void fl_point(FL_Coord x, FL_Coord y, FL_COLOR col); void fl_points(FL_POINT *p, int np, FL_COLOR col); @end example @noindent As usual, all coordinates are relative to the origin of the drawable. Note that these routines are meant for you to draw a few pixels, not images consisting of tens of thousands of pixels of varying colors. For that kind of drawing @code{XPutImage(3)} should be used. Or better yet, use the image support in the Forms Library (see @ref{Part VI Images, , Images}). Also it's usually better when drawing multiple points to use fl_points(), even if that means that the application program has to pre-sort and group the pixels of the same color. To change the line width or style, the following convenience functions are available @findex fl_linewidth() @anchor{fl_linewidth()} @findex fl_linestyle() @anchor{fl_linestyle()} @example void fl_linewidth(int lw); void fl_linestyle(int style); @end example @noindent Set @code{lw} to 0 to reset the line width to the servers default. Line styles can take on the following values (also see @code{XChangeGC(3)}) @table @code @tindex FL SOLID @item FL SOLID Solid line. Default and most efficient. @tindex FL DOT @item FL DOT Dotted line. @tindex FL DASH @item FL DASH Dashed line. @tindex FL DOTDASH @item FL DOTDASH Dash-dot-dash line. @tindex FL LONGDASH @item FL LONGDASH Long dashed line. @tindex FL USERDASH @item FL USERDASH Dashed line, but the dash pattern is user definable via @code{@ref{fl_dashedlinestyle()}}. Only the odd numbered segments are drawn with the foreground color. @tindex FL USERDOUBLEDASH @item FL USERDOUBLEDASH Similar to @code{FL_LINE_USERDASH} but both even and odd numbered segments are drawn, with the even numbered segments drawn in the background color (as set by @code{@ref{fl_bk_color()}}). @end table The following routine can be used to change the dash pattern for @code{FL_USERDASH} and @code{FL USERDOUBLEDASH}: @findex fl_dashedlinestyle() @anchor{fl_dashedlinestyle()} @example void fl_dashedlinestyle(const char *dash, int ndashes) @end example Each element of the array @code{dash} is the length of a segment of the pattern in pixels (0 is not allowed). Dashed lines are drawn as alternating segments, each with the length of an element in @code{dash}. Thus the overall length of the dash pattern, in pixels, is the sum of all elements of @code{dash}. When the pattern is used up but the line to draw is longer it used from the start again. The following example code specifies a long dash (9 pixels) to come first, then a skip (3 pixels), a short dash (2 pixels) and then again a skip (3 pixels). After this sequence, the pattern repeats. @example char ldash_sdash[] = @{9, 3, 2, 3@}; fl_dashedlinestyle(ldash_sdash, 4); @end example @noindent If @code{dash} is @code{NULL} or @code{ndashes} is @code{0} (or the @code{dash} array contains an element set to @code{0}) a default pattern of 4 pixels on and 4 fixels off is set. It is important to remember to call @code{@ref{fl_dashedlinestyle()}} whenever @code{FL_USERDASH} is used to set the dash pattern, otherwise whatever the last pattern was will be used. To use the default dash pattern you can pass @code{NULL} as the dash parameter to @code{@ref{fl_dashedlinestyle()}}. By default, all lines are drawn so they overwrite the destination pixel values. It is possible to change the drawing mode so the destination pixel values play a role in the final pixel value. @findex fl_drawmode() @anchor{fl_drawmode()} @example void fl_drawmode(int mode); @end example @noindent There are 16 different possible settings for @code{mode} (see a Xlib programming manual for all the gory details). A of the more useful ones are @table @code @item GXcopy Default overwrite mode. Final pixel value = Src @item GXxor Bitwise XOR (exclusive-or) of the pixel value to be drawn with the pixel value already on the screen. Useful for rubber-banding. @item GXand Bitwise AND of the pixel value to be drawn with the pixel value already on the screen. @item GXor Bitwise OR of the pixel value to be drawn with the pixel value already on the screen. @item GXinvert Just invert the pixel values already on the screen. @end table To obtain the current settings of the line drawing attributes use the following routines @findex fl_get_linewidth() @anchor{fl_get_linewidth()} @findex fl_get_linestyle(() @anchor{fl_get_linestyle(()} @findex fl_get_drawmode(() @anchor{fl_get_drawmode(()} @example int fl_get_linewidth(void); int fl_get_linestyle(void); int fl_get_drawmode(void); @end example There are also a number of high-level drawing routines available. To draw boxes the following routine exists. Almost any object class will use it to draw the bounding box of the object. @findex fl_draw_box() @anchor{fl_draw_box()} @example void fl_draw_box(int style, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col, int bw); @end example @noindent @code{style} is the type of the box, e.g., @code{FL_DOWN_BOX}. @code{x}, @code{y}, @code{w}, and @code{h} indicate the size of the box. @code{col} is the color and @code{bw} is the width of the boundary, which typically should be given the value @code{obj->bw} or @code{FL_BOUND_WIDTH}. Note that a negative border width indicates a "softer" up box. See the demo program @file{borderwidth.c} for the visual effect of different border widths. There is also a routine for drawing a frame: @findex fl_draw_frame() @anchor{fl_draw_frame()} @example void fl_draw_frame(int style, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col, int bw) @end example @noindent All parameters have the usual meaning except that the frame is drawn outside of the bounding box specified. For drawing text there are two routines: @findex fl_draw_text() @anchor{fl_draw_text()} @findex fl_draw_text_beside() @anchor{fl_draw_text_beside()} @example void fl_draw_text(int align, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col, int style, int size, const char *str); void fl_draw_text_beside(int align, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col, int style, int size, const char *str); @end example @noindent where @code{align} is the alignment, namely, @code{FL ALIGN LEFT}, @code{FL ALIGN CENTER} etc. @code{x}, @code{y}, @code{w} and @code{h} indicate the bounding box, @code{col} is the color of the text, @code{size} is the size of the font to use (in points) and @code{style} is the font style to be used (see @ref{Label Attributes and Fonts}, for valid styles). Finally, @code{str} is the string itself, possibly containing embedded newline characters. @code{@ref{fl_draw_text()}} draws the text inside the bounding box according to the alignment requested while @code{@ref{fl_draw_text_beside()}} draws the text aligned outside of the box. These two routines interpret a text string starting with the character @code{@@} differently in drawing some symbols instead. Note that @code{@ref{fl_draw_text()}} puts a padding of 5 pixels in vertical direction and 4 in horizontal around the text. Thus the bounding box should be 10 pixels wider and 8 pixels higher than required for the text to be drawn. The following routine can also be used to draw text and, in addition, a cursor can optionally be drawn @findex fl_draw_text_cursor() @anchor{fl_draw_text_cursor()} @example void fl_draw_text_cursor(int align, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col, int style, int size, char *str, FL_COLOR ccol, int pos); @end example @noindent where @code{ccol} is the color of the cursor and @code{pos} is its position which indicates the index of the character in @code{str} before which to draw the cursor (-1 means show no cursor). This routine does no interpretion of the special character @code{@@} nor does it add padding around the text. Given a bounding box and the size of an object (e.g., a label) to draw, the following routine can be used to obtain the position of where to draw it with a certain alignment and including padding: @findex fl_get_align_xy() @anchor{fl_get_align_xy()} @example void fl_get_align_xy(int align, int x, int y, int w, int h, int obj_xsize, int obj_ysize, int xmargin, int ymargin, int *xpos, int *ypos); @end example @noindent This routine works regardless if the object is to be drawn inside or outside of the bounding box specified by @code{x}, @code{y}, @code{w} and @code{h}. @code{obj_xsize} and @code{obj->ysize} are the width and height of the object to be drawn and @code{xmargin} and @code{ymargin} is the additional padding to use. @code{xpos} and @code{ypos} return the position to be used for drawing the object. For drawing object labels the following routines might be more convenient: @findex fl_draw_object_label() @anchor{fl_draw_object_label()} @findex fl_draw_object_label_outside() @anchor{fl_draw_object_label_outside()} @example void fl_draw_object_label(FL_OBJECT *obj) void fl_draw_object_label_outside(FL_OBJECT *obj); @end example @noindent Both routines assume that the alignment is relative to the full bounding box of the object. The first routine draws the label according to the alignment, which could be inside or outside of the bounding box. The second routine will always draw the label outside of the bounding box. An important aspect of (re)drawing an object is efficiency which can result in flicker and non-responsiveness if not handled with care. For simple objects like buttons or objects that do not have "movable parts", drawing efficiency is not a serious issue although you can never be too fast. For complex objects, especially those that a user can interactively change, special care should be taken. The most important rule for efficient drawing is not to draw if you don't have to, regardless how simple the drawing is. Given the networking nature of X, simple or not depends not only on the host/server speed but also the connection. What this strategy entails is that the drawing should be broken into blocks and depending on the context, draw/update only those parts that need to. xforms-1.2.4/doc/part3_valuator_objects.texi0000664000175000017500000017352112340166201016102 00000000000000@node Part III Valuator Objects @chapter Valuator Objects @ifnottex @menu * Slider Object: Slider Object * Scrollbar Object: Scrollbar Object * Dial Object: Dial Object * Positioner Object: Positioner Object * Counter Object: Counter Object * Spinner Object: Spinner Object * Thumbwheel Object: Thumbwheel Object @end menu @end ifnottex @node Slider Object @section Slider Object Sliders are useful for letting the user indicate a value between some fixed bounds. Both horizontal and vertical sliders exist. They have a minimum, a maximum and a current value (all floating point values). The user can change the current value by shifting the slider with the mouse. Whenever the value changes, this is reported to the application program. @ifnottex @menu * Adding Slider Objects: Adding Slider Objects * Slider Types: Slider Types * Slider Interaction: Slider Interaction * Other Slider Routines: Other Slider Routines * Slider Attributes: Slider Attributes * Remarks: Slider Remarks @end menu @end ifnottex @node Adding Slider Objects @subsection Adding Slider Objects Adding an object To add a slider to a form use @findex fl_add_slider() @anchor{fl_add_slider()} @example FL_OBJECT *fl_add_slider(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent or @findex fl_add_valslider() @anchor{fl_add_valslider()} @example FL_OBJECT *fl_add_valslider(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent The meaning of the parameters is as usual. The label is by default placed below the slider. The difference between a normal slider and a valslider is that for the second type its value is displayed above or to the left of the slider. @node Slider Types @subsection Slider Types The following types of sliders are available: @table @code @tindex FL_VERT_SLIDER @anchor{FL_VERT_SLIDER} @item FL_VERT_SLIDER A vertical slider. @tindex FL_HOR_SLIDER @anchor{FL_HOR_SLIDER} @item FL_HOR_SLIDER A horizontal slider. @tindex FL_VERT_FILL_SLIDER @anchor{FL_VERT_FILL_SLIDER} @item FL_VERT_FILL_SLIDER A vertical slider, filled from the bottom. @tindex FL_HOR_FILL_SLIDER @anchor{FL_HOR_FILL_SLIDER} @item FL_HOR_FILL_SLIDER A horizontal slider, filled from the left. @tindex FL_VERT_NICE_SLIDER @anchor{FL_VERT_NICE_SLIDER} @item FL_VERT_NICE_SLIDER A nice looking vertical slider. @tindex FL_HOR_NICE_SLIDER @anchor{FL_HOR_NICE_SLIDER} @item FL_HOR_NICE_SLIDER A nice looking horizontal slider. @tindex FL_VERT_BROWSER_SLIDER @anchor{FL_VERT_BROWSER_SLIDER} @item FL_VERT_BROWSER_SLIDER A different looking vertical slider. @tindex FL_HOR_BROWSER_SLIDER @anchor{FL_HOR_BROWSER_SLIDER} @item FL_HOR_BROWSER_SLIDER A different looking horizontal slider. @tindex FL_VERT_PROGRESS_BAR @anchor{FL_VERT_PROGRESS_BAR} @item FL_VERT_PROGRESS_BAR A vertical progress bar @tindex FL_HOR_PROGRESS_BAR @anchor{FL_HOR_PROGRESS_BAR} @item FL_HOR_PROGRESS_BAR A horizontal progress bar @end table Please note that except for @code{@ref{FL_VERT_PROGRESS_BAR}} and @code{@ref{FL_HOR_PROGRESS_BAR}} the label will always drawn on the outside of the slider (even if you attempt to set an inside alignment). @ifhtml @center @image{xforms_images/slidertypes} @end ifhtml @ifnothtml @center @image{xforms_images/slidertypes,12cm} @end ifnothtml @node Slider Interaction @subsection Slider Interaction Whenever the user changes the value of the slider using the mouse, the slider is returned (unless there's callback function associated with the object) by the interaction routines. The slider position is changed by moving the mouse inside the slider area. For fine control, hold down the @code{} key while usinf the slider, in that case the slider doesn't follow the mouse directly but at a lower speed. Please note: the @code{@ref{FL_VERT_PROGRESS_BAR}} and @code{@ref{FL_HOR_PROGRESS_BAR}} aren't actually valuator objects (they don't react to any user interaction) but are vor visualization only (i.e., showing a progress bar that is changed by the program only), they appear here because they are directly derived from the @code{@ref{FL_VERT_FILL_SLIDER}} and @code{@ref{FL_VERT_FILL_SLIDER}} slider. Thus the only way to change the value of objects of these types is by calling @code{@ref{fl_set_slider_value()}}! To obtain the correct "progress bar" behaviour you should also update the label accordingly. In some cases you might not want the slider to be returned or its callback called each time its value changes. To change the default, call the following routine: @example void fl_set_object_return(FL_OBJECT *obj, unsigned int when) @end example @noindent where the parameter @code{when} can be one of the four values: @table @code @item @ref{FL_RETURN_NONE} Never return or invoke callback. @item @ref{FL_RETURN_END_CHANGED} Return or invoke callback at end (mouse release) if value is changed since last return. @item @ref{FL_RETURN_CHANGED} Return or invoke callback whenever the slider value is changed. This is the default. @item @ref{FL_RETURN_END} Return or invoke callback at end (mouse release) regardless if the value is changed or not. @item @ref{FL_RETURN_ALWAYS} Return or invoke callback when the value changed or at end (mouse release). @end table See the demo program @file{objreturn.c} for an example use of this. @node Other Slider Routines @subsection Other Slider Routines To change the value and bounds of a slider use the following routines @findex fl_set_slider_value() @anchor{fl_set_slider_value()} @findex fl_set_slider_bounds() @anchor{fl_set_slider_bounds()} @example void fl_set_slider_value(FL_OBJECT *obj, double val); void fl_set_slider_bounds(FL_OBJECT *obj, double min, double max); @end example @noindent By default, the minimum value for a slider is 0.0, the maximum is 1.0 and the value is 0.5. For vertical sliders the slider position for the minimum value is at the left, for horizontal sliders at the top of the slider. By setting @code{nin} to a larger value than @code{max} in a call of @code{@ref{fl_set_slider_bounds()}} this can be reversed. If in a call of @code{@ref{fl_set_slider_bounds()}} the actual value of a slider isn't within the range of the new bounds, its value gets adjusted to the nearest limit. When the requested new slider value in a call of @code{@ref{fl_set_slider_value()}} is outside the range of bounds it gets adjusted to the nearest boundary value. To obtain the current value or bounds of a slider use @findex fl_get_slider_value() @anchor{fl_get_slider_value()} @findex fl_get_slider_bounds() @anchor{fl_get_slider_bounds()} @example double fl_get_slider_value(FL_OBJECT *obj); void fl_get_slider_bounds(FL_OBJECT *obj, double *min, double *max); @end example Per default a slider only reacts to the left mouse button. But sometimes it can be useful to modify this. To set this call @findex fl_set_slider_mouse_buttons() @anchor{fl_set_slider_mouse_buttons()} @example void fl_set_slider_mouse_buttons(FL_OBJECT *obj, int mbuttons); @end example @noindent @code{mbuttons} is the bitwise OR of the numbers 1 for the left mouse button, 2 for the middle and 4 for the right mouse button. To determine which mouse buttons a slider reacts to use @findex fl_get_slider_mouse_buttons() @anchor{fl_get_slider_mouse_buttons()} @example void fl_get_slider_mouse_buttons(FL_OBJECT *obj, unsigned int *mbuttons); @end example @noindent The value returned via @code{mbuttons} is the same value as would be used in @code{@ref{fl_set_slider_mouse_buttons()}}. @c ----------------------------------------------------------------- @c The following function still exist but the description is wrong. @c fl_set_slider_step() doesn't do anything and @c fl_set_slider_increment() is only used internally for sliders @c used in scrollbars (and doesn't do anything for normal sliders) @c In a number of situations you may like slider values to be rounded to @c some values, e.g., to integer values. To this end use the routine @c @findex fl_set_slider_step() @c @anchor{fl_set_slider_step()} @c @example @c void fl_set_slider_step(FL_OBJECT *obj, double step); @c @end example @c @noindent @c After this call slider values will be rounded to multiples of @code{step}. @c Use the value 0.0 for @code{step} to switch off rounding. @c By default, if the mouse is pressed below or above the the sliding @c bar, the sliding bar jumps to the location where the mouse got pressed. @c You can, however, use the following routine to change this default so @c the jumps are made is discrete increments: @c @findex fl_set_slider_increment() @c @anchor{fl_set_slider_increment()} @c @example @c void fl_set_slider_increment(FL_OBJECT *obj, double lj, double rj); @c @end example @c @noindent @c where @code{lj} indicates how much to jump if the left mouse button is @c pressed and @code{rj} indicates how much to increment if right/middle @c mouse buttons pressed. This routine can be used if finer control of @c the slider value is needed or to assign different meanings to different @c mouse buttons. For example, for the slider in the browser class, the @c left mouse jump is made to be one page and right jump is made to be @c one line. @c @c To obtain the current increment, use the following routine @c @findex fl_get_slider_increment() @c @anchor{fl_get_slider_increment()} @c @example @c void fl_get_slider_increment(FL_OBJECT *obj, double *lj, double *rj); @c @end example @c ----------------------------------------------------------------- @node Slider Attributes @subsection Slider Attributes Never use @code{FL_NO_BOX} as the boxtype for a slider. For @code{FL_VERT_NICE_SLIDER}s and @code{FL_HOR_NICE_SLIDER}s it's best to use a @code{FL_FLAT_BOX} in the color of the background to get the nicest effect. The first color argument (@code{col1}) to @code{@ref{fl_set_object_color()}} controls the color of the background of the slider, the second (@code{col2}) the color of the slider itself. You can control the size of the slider inside the box using the routine @findex fl_set_slider_size() @anchor{fl_set_slider_size()} @example void fl_set_slider_size(FL_OBJECT *obj, double size); @end example @noindent @code{size} should be a floating point value between 0.0 and 1.0. The default is @tindex FL_SLIDER_WIDTH @code{FL_SLIDER_WIDTH}, which is 0.1 for regular sliders and 0.15 for browser sliders. With a value for @code{size} of 1.0, the slider covers the box completely and can no longer be moved. This function does nothing if applied to sliders of type @code{NICE_SLIDER} and @code{FILL_SLIDER}. To obtain the current setting of the slider size use @findex fl_get_slider_size() @anchor{fl_get_slider_size()} @example double fl_get_slider_size(FL_OBJECT *obj); @end example The routine @findex fl_set_slider_precision() @anchor{fl_set_slider_precision()} @example void fl_set_slider_precision(FL_OBJECT *obj, int prec); @end example @noindent sets the precision with which the value of the slider is shown. This only applies to sliders showing their value, i.e., valsliders. The argument must be between 0 and @tindex FL_SLIDER_MAX_PREC @code{FL_SLIDER_MAX_PREC} (currently set to 10). By default, the value shown by a valslider is the slider value in floating point format. You can override the default by registering a filter function using the following routine @findex fl_set_slider_filter() @anchor{fl_set_slider_filter()} @example void fl_set_slider_filter(FL_OBJECT *obj, const char *(*filter)(FL_OBJECT *, double value, int prec)); @end example @noindent where @code{value} and @code{prec} are the slider value and precision respectively. The filter function @code{filter} should return a string that is to be shown. The default filter is equivalent to the following @example const char *filter(FL_OBJECT *obj, double value, int prec) @{ static char buf[32]; sprintf(buf, "%.*f", prec, value); return buf; @} @end example @node Slider Remarks @subsection Remarks See the demo program @file{demo05.c} for an example of the use of sliders. See demo programs @file{sldsize.c} and @file{sliderall.c} for the effect of setting slider sizes and the different types of sliders. @node Scrollbar Object @section Scrollbar Object Scrollbars are similar to sliders (as a matter of fact, scrollbars are made with sliders and scrollbuttons) and alse let the user indicate a value between some fixed bounds. Both horizontal and vertical scrollbars exist. They have a minimum, maximum and current value (all floating point values). The user can change this value by dragging the sliding bar with the mouse or by pressing the scroll buttons. Per default whenever the value changes, it is reported to the application program via the callback function. @ifnottex @menu * Adding Scrollbar Objects: Adding Scrollbar Objects * Scrollbar Types: Scrollbar Types * Scrollbar Interaction: Scrollbar Interaction * Other Scrollbar Routines: Other Scrollbar Routines * Scrollbar Attributes: Scrollbar Attributes * Remarks: Scrollbar Remarks @end menu @end ifnottex @node Adding Scrollbar Objects @subsection Adding Scrollbar Objects To add a scrollbar to a form use @findex fl_add_scrollbar() @anchor{fl_add_scrollbar()} @example FL_OBJECT *fl_add_scrollbar(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent The meaning of the parameters is as usual. The label is by default placed below the scrollbar. @ifhtml @center @image{xforms_images/scrollbars} @end ifhtml @ifnothtml @center @image{xforms_images/scrollbars,14cm} @end ifnothtml @node Scrollbar Types @subsection Scrollbar Types The following types of scrollbar are available: @table @code @tindex FL_VERT_SCROLLBAR @anchor{FL_VERT_SCROLLBAR} @item FL_VERT_SCROLLBAR A vertical scrollbar. @tindex FL_HOR_SCROLLBAR @anchor{FL_HOR_SCROLLBAR} @item FL_HOR_SCROLLBAR A horizontal scrollbar. @tindex FL_VERT_THIN_SCROLLBAR @anchor{FL_VERT_THIN_SCROLLBAR} @item FL_VERT_THIN_SCROLLBAR A different looking vertical scrollbar. @tindex FL_HOR_THIN_SCROLLBAR @anchor{FL_HOR_THIN_SCROLLBAR} @item FL_HOR_THIN_SCROLLBAR A different looking horizontal scrollbar. @tindex FL_VERT_NICE_SCROLLBAR @anchor{FL_VERT_NICE_SCROLLBAR} @item FL_VERT_NICE_SCROLLBAR A vertical scrollbar using @code{FL_NICE_SLIDER}. @tindex FL_HOR_NICE_SCROLLBAR @anchor{FL_HOR_NICE_SCROLLBAR} @item FL_HOR_NICE_SCROLLBAR A horizontal scrollbar using @code{FL_NICE_SLIDER}. @tindex FL_VERT_PLAIN_SCROLLBAR @anchor{FL_VERT_PLAIN_SCROLLBAR} @item FL_VERT_PLAIN_SCROLLBAR Similar to @code{FL_THIN_SCROLLBAR}. @tindex FL_HOR_PLAIN_SCROLLBAR @anchor{FL_HOR_PLAIN_SCROLLBAR} @item FL_HOR_PLAIN_SCROLLBAR Similar to @code{FL_HOR_THIN_SCROLLBAR}. @end table @node Scrollbar Interaction @subsection Scrollbar Interaction Whenever the user changes the value of the scrollbar, the scrollbar's callback is called (if one is associated with the scrollbar). The scrollbar position can be changed in several ways. The most simple one is to left-click on the knob of the scrollbar and move the know while the left mouse button is kept pressed down. Left-clicking beside the know will move the knob in large steps toward the current position of the mouse, clicking with the middle or right mouse button in smaller steps. Small shifts can also be obtained by clicking on one of the buttons at the side of the scrollbar or by using the scroll-wheel somehwere over the scrollbar. You can control under which conditions the scrollbar gets returned to your application or its callback invoked. To change the default, call @example void fl_set_object_return(FL_OBJECT *obj, unsigned int when); @end example @noindent where the parameter @code{when} can be one of the following four values: @table @code @item @ref{FL_RETURN_NONE} Never return or invoke callback. @item @ref{FL_RETURN_END_CHANGED} Return or invoke callback at end (mouse release) if value is changed (since last return). @item @ref{FL_RETURN_CHANGED} Return or invoke callback whenever the scrollbar value is changed. This is the default. @item @ref{FL_RETURN_END} Return or invoke callback at end (mouse release) regardless if the value is changed or not. @item @ref{FL_RETURN_ALWAYS} Return or invoke callback whenever value changed or mouse button was released. @end table The default setting for @code{when} for a scrollbar object is @code{@ref{FL_RETURN_CHANGED}} (unless during the build of XForms you set the configuration flag @code{--enable-bwc-bs-hack} in which case the default is @code{@ref{FL_RETURN_NONE}} to keep backward compatibility with earlier releases of the library). See demo program @file{objreturn.c} for an example use of this. @node Other Scrollbar Routines @subsection Other Scrollbar Routines To change the value and bounds of a scrollbar use the following routines: @findex fl_set_scrollbar_value() @anchor{fl_set_scrollbar_value()} @findex fl_set_scrollbar_bounds() @anchor{fl_set_scrollbar_bounds()} @example void fl_set_scrollbar_value(FL_OBJECT *obj, double val); void fl_set_scrollbar_bounds(FL_OBJECT *obj, double min, double max); @end example By default, the minimum value for a slider is 0.0, the maximum is 1.0 and the value is 0.5. For vertical sliders the slider position for the minimum value is at the left, for horizontal sliders at the top of the slider. By setting @code{min} to a larger value than @code{max} in a call of @code{@ref{fl_set_scrollbar_bounds()}} this can be reversed. If in a call of @code{@ref{fl_set_scrollbar_bounds()}} the actual value of a scrollbar isn't within the range of the new bounds, its value gets adjusted to the nearest limit. When the requested new scrollbar value in a call of @code{@ref{fl_set_scrollbar_value()}} is outside the range of bounds it gets adjusted to the nearest boundary value. To obtain the current value and bounds of a scrollbar use @findex fl_get_scrollbar_value() @anchor{fl_get_scrollbar_value()} @findex fl_get_scrollbar_bounds() @anchor{fl_get_scrollbar_bounds()} @example double fl_get_scrollbar_value(FL_OBJECT *obj); void fl_get_scrollbar_bounds(FL_OBJECT *obj, double *min, double *max); @end example @c --------------------------------------------------------------- @c The function fl_set_scrollbar_step() still exists but doesn't @c has any effect! @c In a number of situations you would like scrollbar values to be @c rounded to some values, e.g., to integer values. To this end use the @c routine @c @findex fl_set_scrollbar_step() @c @anchor{fl_set_scrollbar_step()} @c @example @c void fl_set_scrollbar_step(FL_OBJECT *obj, double step); @c @end example @c @noindent @c After this call the scrollbar values will be rounded to multiples of @c @code{step}. Use the value 0.0 for @code{step} to switch off rounding. @c This should not be confused with the increment/decrement value when @c the scroll buttons are pressed. Use @c @code{@ref{fl_set_scrollbar_increment()}} to change the increment @c value. @c --------------------------------------------------------------- By default, if the mouse is pressed beside the the sliding bar, the bar starts to jumps in the direction of the mouse position. You can use the following routine to change this size of the steps being made : @findex fl_set_scrollbar_increment() @anchor{fl_set_scrollbar_increment()} @example void fl_set_scrollbar_increment(FL_OBJECT *obj, double lj, double rj); @end example @noindent where @code{lj} indicates how much to increment if the left mouse button is pressed and @code{rj} indicates how much to jump if the middle mouse button pressed. For example, for the scrollbar in the browser class, the left mouse jump is made to be one page and middle mouse jump is made to be one line. The increment (decrement) value when the scrollbuttons are pressed is set to the value of the right jump. The default values for @code{lj} and @code{rj} are @code{0.1} and @code{0.02}. To obtain the current increment settings, use the following routine @findex fl_get_scrollbar_increment() @anchor{fl_get_scrollbar_increment()} @example void fl_get_scrollbar_increment(FL_OBJECT *obj, double *lj, double *sj); @end example With the function @findex fl_get_scrollbar_repeat() @anchor{fl_get_scrollbar_repeat()} @findex fl_set_scrollbar_repeat() @anchor{fl_set_scrollbar_repeat()} @example int fl_get_scrollbar_repeat(FL_OBJECT *obj); void fl_set_scrollbar_repeat(FL_OBJECT *obj, int millisec); @end example @noindent you can determine and control the time delay (in milliseconds) between jumps of the knob when the mouse button is kept pressed down outside of the knobs area. The default value is @w{100 ms}. The delay for the very first jump is twice that long in order to avoid jumping to start too soon when only a single click was intended but the user is a bit slow in releasing the mouse button. @node Scrollbar Attributes @subsection Scrollbar Attributes Never use @code{FL_NO_BOX} as the boxtype for a scrollbar. For @code{FL_VERT_NICE_SCROLLBAR}s and @code{FL_HOR_NICE_SCROLLBAR}s it's best to use a @code{FL_FLAT_BOX} boxtype in the color of the background to get the nicest effect. The first color argument (@code{col1} to @code{@ref{fl_set_object_color()}} controls the color of the background of the scrollbar, the second (@code{col2}) the color of the sliding bar itself. You can control the size of the sliding bar inside the box using the routine @findex fl_set_scrollbar_size() @anchor{fl_set_scrollbar_size()} @example void fl_set_scrollbar_size(FL_OBJECT *obj, double size); @end example @noindent @code{size} should be a value between 0.0 and 1.0. The default is @tindex FL_SLIDER_WIDTH @code{FL_SLIDER_WIDTH}, which is 0.15 for all scrollbars With @code{size} set to 1.0, the scrollbar covers the box completely and can no longer be moved. This function does nothing if applied to scrollbars of type @code{FL_NICE_SCROLLBAR}. The function @findex fl_get_scrollbar_size() @anchor{fl_get_scrollbar_size()} @example double fl_get_scrollbar_size(FL_OBJECT *obj); @end example @noindent returns the current setting of the scrollbar size. @node Scrollbar Remarks @subsection Remarks See the demo program @file{scrollbar.c} for an example of the use of scrollbars. @node Dial Object @section Dial Object Dial objects are dials that the user can put in a particular position using the mouse. They have a minimum, maximum and current value (all floating point values). The user can change this value by turning the dial with the mouse. Whenever the value changes, this is reported to the application program. @ifnottex @menu * Adding Dial Objects: Adding Dial Objects * Dial Types: Dial Types * Dial Interaction: Dial Interaction * Other Dial Routines: Other Dial Routines * Dial Attributes: Dial Attributes * Remarks: Dial Remarks @end menu @end ifnottex @node Adding Dial Objects @subsection Adding Dial Objects To add a dial to a form use @findex fl_add_dial() @anchor{fl_add_dial()} @example FL_OBJECT *fl_add_dial(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent The meaning of the parameters is as usual. The label is by default placed below the dial. @node Dial Types @subsection Dial Types @ifhtml @center @image{xforms_images/dials} @end ifhtml @ifnothtml @center @image{xforms_images/dials,10cm} @end ifnothtml The following types of dials are available: @table @code @tindex FL_NORMAL_DIAL @anchor{FL_NORMAL_DIAL} @item FL_NORMAL_DIAL A dial with a knob indicating the position. @tindex FL_LINE_DIAL @anchor{FL_LINE_DIAL} @item FL_LINE_DIAL A dial with a line indicating the position. @tindex FL_FILL_DIAL @anchor{FL_FILL_DIAL} @item FL_FILL_DIAL The area between initial and current is filled. @end table @node Dial Interaction @subsection Dial Interaction By default, the dial value is returned to the application when the user releases the mouse. It is possible to change this behavior using the following routine @example void fl_set_object_return(FL_OBJECT *obj, unsigned int when); @end example @noindent where @code{when} can be one of the following @table @code @item @ref{FL_RETURN_NONE} Never report or invoke callback. @item @ref{FL_RETURN_END_CHANGED} Return or invoke callback at end (mouse release) and only if the dial value is changed. This is the default setting. @item @ref{FL_RETURN_CHANGED} Return or invoke callback whenever the dial value is changed. @item @ref{FL_RETURN_END} Return or invoke callback at the end regardless if the dial value is changed or not. @item @ref{FL_RETURN_ALWAYS} Return or invoke callback when value has changed or mouse button has been released. @end table @node Other Dial Routines @subsection Other Dial Routines To change the value of the dial and its bounds use @findex fl_set_dial_value() @anchor{fl_set_dial_value()} @findex fl_set_dial_bounds() @anchor{fl_set_dial_bounds()} @example void fl_set_dial_value(FL_OBJECT *obj, double val); void fl_set_dial_bounds(FL_OBJECT *obj, double min, double max); @end example @noindent By default, the minimum value is 0.0, the maximum is 1.0 and the value is 0.5. To obtain the current values of the dial and its bounds use @findex fl_get_dial_value() @anchor{fl_get_dial_value()} @findex fl_get_dial_bounds() @anchor{fl_get_dial_bounds()} @example double fl_get_dial_value(FL_OBJECT *obj); void fl_get_dial_bounds(FL_OBJECT *obj, double *min, double *max); @end example Sometimes, it might be desirable to limit the angular range a dial can take or choose an angle other than 0 to represent the minimum value. For this purpose, use the following routine @findex fl_set_dial_angles() @anchor{fl_set_dial_angles()} @example void fl_set_dial_angles(FL_OBJECT *obj, double thetai, double thetaf) @end example @noindent where @code{thetai} maps to the minimum value of the dial and @code{thetaf} to its maximum value. The angles are relative to the origin of the dial, which is by default at 6 o'clock and rotates clock-wise. By default, the minimum angle is 0 and the maximum angle is 360. To obtain the start and end angles use @findex fl_get_dial_angles() @anchor{fl_get_dial_angles()} @example void fl_get_dial_angles(FL_OBJECT *obj, double *thetai, double *thetaf) @end example By default, crossing from 359.9 to 0 or from 0 to 359.9 is not allowed. To allowing crossing over, use the following routine @findex fl_set_dial_crossover() @anchor{fl_set_dial_crossover()} @example void fl_set_dial_crossover(FL_OBJECT *obj, int yes_no); @end example @noindent where a true value for @code{yes_no} indicates that cross-over is allowed. In a number of situations you might want dial values to be rounded to some values, e.g., to integer values. To this end use the routine @findex fl_set_dial_step() @anchor{fl_set_dial_step()} @example void fl_set_dial_step(FL_OBJECT *obj, double step); @end example @noindent After this call dial values will be rounded to multiples of @code{step}. Use a value of 0.0 for @code{step} to switch off rounding. To get the current setting for the rounding steps use @findex fl_get_dial_step() @anchor{fl_get_dial_step()} @example double fl_get_dial_step(FL_OBJECT *obj); @end example By default, clock-wise rotation increases the dial value. To change, use the following routine @findex fl_set_dial_direction() @anchor{fl_set_dial_direction()} @example void fl_set_dial_direction(FL_OBJECT *obj, int dir); @end example @noindent where @code{dir} can be either @tindex FL_DIAL_CCW @code{FL_DIAL_CCW} or @tindex FL_DIAL_CW @code{FL_DIAL_CW}. To obtain the direction use @findex fl_get_dial_direction() @anchor{fl_get_dial_direction()} @example int fl_get_dial_direction(FL_OBJECT *obj); @end example @node Dial Attributes @subsection Dial Attributes You can use any boxtype you like, but the final dial face always appears to be circular although certain correlation between the requested boxtype and actual boxtype exists (for example, @code{FL_FRAME_BOX} is translated into a circular frame box.) The first color argument (@code{col1} to @code{@ref{fl_set_object_color()}} controls the color of the background of the dial, the second @code{col2}) the color of the knob or the line or the fill color. @node Dial Remarks @subsection Remarks The resolution of a dial is about 0.2 degrees, i.e., there are only about 2000 steps per 360 degrees and, depending on the size of the dial, it is typically less. The dial is always drawn with a circular box. If you specify a @code{FL_UP_BOX}, a @code{FL_OVAL3D_UPBOX} will be used. See the demo programs @file{ldial.c}, @file{ndial.c} and @file{fdial.c} for examples of the use of dials. @node Positioner Object @section Positioner Object A positioner is an object in which the user can indicate a position with an x- and a y-coordinate. It displays a box with a cross-hair cursor in it (except an invisble positioner, of course). Clicking the mouse inside the box changes the position of the cross-hair cursor and, hence, the x- and y-values. @ifnottex @menu * Adding Positioner Objects: Adding Positioner Objects * Positioner Types: Positioner Types * Positioner Interaction: Positioner Interaction * Other Positioner Routines: Other Positioner Routines * Positioner Attributes: Positioner Attributes * Remarks: Positioners Remarks @end menu @end ifnottex @node Adding Positioner Objects @subsection Adding Positioner Objects A positioner can be added to a form using the call @findex fl_add_positioner() @anchor{fl_add_positioner()} @example FL_OBJECT *fl_add_positioner(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent The meaning of the parameters is as usual. The label is placed below the box by default. @node Positioner Types @subsection Positioner Types The following types of positioner exist: @table @code @tindex FL_NORMAL_POSITIONER @anchor{FL_NORMAL_POSITIONER} @item FL_NORMAL_POSITIONER Cross-hair inside a box. @tindex FL_OVERLAY_POSITIONER @anchor{FL_OVERLAY_POSITIONER} @item FL_OVERLAY_POSITIONER Cross-hair inside a transparent box. @tindex FL_INVISIBLE_POSITIONER @anchor{FL_INVISIBLE_POSITIONER} @item FL_INVISIBLE_POSITIONER Completely invisible positioner, to be used just for the side effect of obtaining a position (typically an object is below below it that otherwise would receive user events). @end table Note that for exatly positioning a @code{@ref{FL_OVERLAY_POSITIONER}} or @code{@ref{FL_INVISIBLE_POSITIONER}} over another object you have to take account of the (absolute value of the) border widths of both the underlying obkject and the positioner. @node Positioner Interaction @subsection Positioner Interaction The user changes the setting of the positioner using the mouse inside the box. Per default whenever the values changes, the object is returned by the interaction routines or its callback invoked (if one exists. To change the default use the function @example void fl_set_object_return(FL_OBJECT *obj, unsigned int when); @end example @noindent where @code{when} can be one of the following @table @code @item @ref{FL_RETURN_NONE} Never report or invoke callback. @item @ref{FL_RETURN_END_CHANGED} Return or invoke callback at end (mouse release) and only when the positioner ended in a different position than the one it started from. @item @ref{FL_RETURN_CHANGED} Return or invoke callback whenever the positioners value is changed, default setting. @item @ref{FL_RETURN_END} Return or invoke callback at the end only but regardless if the positioners value changed or not. @item @ref{FL_RETURN_ALWAYS} Return or invoke callback when value has changed or mouse button has been released. @end table Per default a positioner only reacts to the left mouse button. But sometimes it can be useful to modify which mouse buttons it will reacts to. To set this use @findex fl_set_positioner_mouse_buttons() @anchor{fl_set_positioner_mouse_buttons()} @example void fl_set_positioner_mouse_buttons(FL_OBJECT *obj, int mbuttons); @end example @noindent @code{mbuttons} is the bitwise OR of the numbers 1 for the left mouse button, 2 for the middle, 4 for the right mouse button, 8 for moving the scroll wheel up "button" and 16 for scrolling down "button". To determine which mouse buttons a positioner reacts to use @findex fl_get_positioner_mouse_buttons() @anchor{fl_get_positioner_mouse_buttons()} @example void fl_get_positioner_mouse_buttons(FL_OBJECT *obj, unsigned int *mbuttons); @end example @noindent The value returned via @code{mbuttons} is the same value as would be used in @code{@ref{fl_set_positioner_mouse_buttons()}}. Sometimes you may want to assign different meanings to the mouse buttons used to interact with the positioner. To find out which one has been used there's the function @findex fl_get_positioner_numb() @anchor{fl_get_positioner_numb()} @example int fl_get_positioner_numb(FL_OBJECT *obj); @end example @noindent It returns one of the constants @code{@ref{FL_LEFT_MOUSE}}, @code{@ref{FL_MIDDLE_MOUSE}}, @code{@ref{FL_RIGHT_MOUSE}}, @code{@ref{FL_SCROLLUP_MOUSE}} or @code{@ref{FL_SCROLLDOWN_MOUSE}} (the latter two are from the scroll wheel of the mouse). @node Other Positioner Routines @subsection Other Positioner Routines Usually, a positioner of type @code{@ref{FL_OVERLAY_POSITIONER}} is used on top if another object, e.g., a pixmap object. If the object below the positioner is changed, e.g., by setting a new pixmap for the pixmap object, tis may lead to visual artefacts since the postioner isn't aware of the changes of the underlying object. To avoid this call the function @findex fl_reset_positioner @anchor{fl_reset_positioner} @example void fl_reset_positioner(FL_OBJECT *obj); @end example before each change to an object below it. Per defauly the range that the @code{x} and @code{y} values of a positioner can assume are controlled via minimum and maximum values for both directions. These boundary values can be set by using the functions the routines: @findex fl_set_positioner_xbounds() @anchor{fl_set_positioner_xbounds()} @findex fl_set_positioner_ybounds() @anchor{fl_set_positioner_ybounds()} @example void fl_set_positioner_xbounds(FL_OBJECT *obj, double min, double max); int fl_set_positioner_ybounds(FL_OBJECT *obj, double min, double max); @end example @noindent When a new positioner object is created the minimum values are 0.0 and the maximum values are 1.0. For boundaries in x-direction @code{min} and @code{max} should be taken to mean the left- and right-most position, respectively, and for the y-boundaries @code{min} and @code{max} should be taken to mean the value at the bottom and value at the top of the positioner, respectively. Note that the posituoners value may be changed automatically when setting new boundaries to make them satisfy the new conditions. For more complicated situations, i.e., when only a subset of the positioners value range may be used, a validation function can be installed (see the @file{positioner_overlay} demo program for an example): @tindex FL_POSITIONER_VALIDATOR @anchor{FL_POSITIONER_VALIDATOR} @findex fl_set_positioner_validator() @anchor{fl_set_positioner_validator()} @example typedef int (*FL_POSITIONER_VALIDATOR (FL_OBJECT * obj, double x, double y, double *x_repl, double *y_repl); FL_POSITIONER_VALIDATOR fl_set_positioner_validator(FL_OBJECT * obj, FL_POSITIONER_VALIDATOR validator); @end example If a non-@code{NULL} pointer is passed to the function each time a new position is set the validation function is invoked. It can return either @tindex FL_POSITIONER_INVALID @anchor{FL_POSITIONER_INVALID} @code{FL_POSITIONER_INVALID} to indicate that the new valuea aren't acceptable, in which case the position remains unchanged. It may also return @tindex FL_POSITIONER_VALID @anchor{FL_POSITIONER_VALID} @code{FL_POSITIONER_VALID} if the values are acceptable. Finally, the function may also return modified values via the @code{x_repl} and @code{y_repl} pointers and return @tindex FL_POSITIONER_REPLACED @anchor{FL_POSITIONER_REPLACED} @code{FL_POSITIONER_REPLACED}. In this case the values returned are used. It's the responsibility of the validation function to make sure that the @code{x} and @code{y} values satisfy the boundary restrictions etc. If it doesn't the results are unpredictable. To switch off validation pass the function a @code{NULL} pointer. The function returns a pointer to the previously active validation function (or @code{NULL} if non had been set). Note that if a new validation function is set it is immediately called to check that the current position is still compatible with the new requirements. If the validation function returns @code{@ref{FL_POSITIONER_INVALID}} in this case the position can't be corrected to fit the new conditions. Thus if you write your validation function in a way that it may return this value it is advisable to set compilant values for the positions before installing the validation function. To programatically change the @code{x} and @code{y} position use @findex fl_set_positioner_values() @anchor{fl_set_positioner_values()} @findex fl_set_positioner_xvalue() @anchor{fl_set_positioner_xvalue()} @findex fl_set_positioner_yvalue() @anchor{fl_set_positioner_yvalue()} @example int fl_set_positioner_values(FL_OBJECT *obj, double xval, double yval); int fl_set_positioner_xvalue(FL_OBJECT *obj, double val); int fl_set_positioner_yvalue(FL_OBJECT *obj, double val); @end example These functions return either @code{@ref{FL_POSITIONER_VALID}} if the new position was acceptable or @code{@ref{FL_POSITIONER_REPLACED}} if the value passed to the function had to be modified due to constraints imposed by the boundaries the step sizes or a validation routine. If a validation routine is set the functions also may return @code{@ref{FL_POSITIONER_INVALID}} if that routine returned this value. To obtain the current values of the positioner and the bounds use @findex fl_get_positioner_xvalue() @anchor{fl_get_positioner_xvalue()} @findex fl_get_positioner_yvalue() @anchor{fl_get_positioner_yvalue()} @findex fl_get_positioner_xbounds() @anchor{fl_get_positioner_xbounds()} @findex fl_get_positioner_ybounds() @anchor{fl_get_positioner_ybounds()} @example double fl_get_positioner_xvalue(FL_OBJECT *obj); double fl_get_positioner_yvalue(FL_OBJECT *obj); void fl_get_positioner_xbounds(FL_OBJECT *obj, double *min, double *max); void fl_get_positioner_ybounds(FL_OBJECT *obj, double *min, double *max); @end example @noindent In a number of situations you might like positioner values to be rounded to some values, e.g., to integer values. To this end use the routines @findex fl_set_positioner_xstep() @anchor{fl_set_positioner_xstep()} @findex fl_set_positioner_ystep() @anchor{fl_set_positioner_ystep()} @example void fl_set_positioner_xstep(FL_OBJECT *obj, double step); void fl_set_positioner_ystep(FL_OBJECT *obj, double step); @end example @noindent After these calls positioner values will be rounded to multiples of @code{step}. Use a value of 0 for @code{step} to switch off rounding. The functions @findex fl_get_positioner_xstep() @anchor{fl_get_positioner_xstep()} @findex fl_get_positioner_ystep() @anchor{fl_get_positioner_ystep()} @example void fl_get_positioner_xstep(FL_OBJECT *obj); void fl_get_positioner_ystep(FL_OBJECT *obj); @end example @noindent return the current settings for the @code{x} and @code{y} step size. Sometimes, it makes more sense for a positioner to have an icon/pixmap as the background that represents a minified version of the area where the positioner's values apply. Type @code{FL_OVERLAY_POSITIONER} is specifically designed for this by drawing the moving cross-hair in XOR mode as not to erase the background. A typical creation procedure might look something like the following @example obj = fl_add_pixmap(FL_NORMAL_PIXMAP, x, y, w, h, label); fl_set_pixmap_file(obj, iconfile); pos = fl_add_positioner(FL_OVERLAY_POSITIONER, x, y, w, h, label); @end example @noindent Of course, you can overlay this type of positioner on objects other than a pixmap. See the demo program @file{positionerXOR.c} for an example. @node Positioner Attributes @subsection Positioner Attributes Never use @code{FL_NO_BOX} as the boxtype for a positioner of type. @code{FL_NORMAL_POSITIONER} (but the other two types will have a box type of @code{FL_NO_BOX} per default). The first color argument (@code{col1}) to @code{@ref{fl_set_object_color()}} controls the color of the box, the second (@code{col2}) the color of the cross-hair. @node Positioners Remarks @subsection Remarks A demo can be found in @file{positioner.c}. @node Counter Object @section Counter Object A counter provides a different mechanism for the user to select a value. In consists of a box displaying a value with one or two buttons on each side. The user can press these buttons to change the value (and while the mouse button is kept pressed down the value will continue to change, slow at first and faster after some time). If the counter has four buttons, the left- and right-most button make the value change in large steps, the other buttons make it change in small steps. @ifnottex @menu * Adding Counter Objects: Adding Counter Objects * Counter Types: Counter Types * Counter Interaction: Counter Interaction * Other Counter Routines: Other Counter Routines * Counter Attributes: Counter Attributes * Remarks: Counter Remarks @end menu @end ifnottex @node Adding Counter Objects @subsection Adding Counter Objects To add a counter to a form use @findex fl_add_counter() @anchor{fl_add_counter()} @example FL_OBJECT *fl_add_counter(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) @end example @noindent The meaning of the parameters is as usual. The label is by default placed below the counter. @node Counter Types @subsection Counter Types @ifhtml @center @image{xforms_images/counters} @end ifhtml @ifnothtml @center @image{xforms_images/counters,8cm} @end ifnothtml The following types of counters are available: @table @code @tindex FL_NORMAL_COUNTER @anchor{FL_NORMAL_COUNTER} @item FL_NORMAL_COUNTER A counter with two buttons on each side. @tindex FL_SIMPLE_COUNTER @anchor{FL_SIMPLE_COUNTER} @item FL_SIMPLE_COUNTER A counter with one button on each side. @end table @node Counter Interaction @subsection Counter Interaction The user changes the value of the counter by keeping his mouse pressed on one of the buttons. Per default whenever the mouse is released and the counter value is changed the counter is returned to the application program or its callback is invoked. In some applications you might want the counter to be returned to the application program (or the callback invoked) e.g., whenever the value changes and not only when the mouse is released. To this end use @example void fl_set_object_return(FL_OBJECT *obj, unsigned int when); @end example @noindent where @code{when} can be either @table @code @item @ref{FL_RETURN_NONE} Never report or invoke callback. @item @ref{FL_RETURN_END_CHANGED} Return or invoke callback at end (mouse release) and only if the counter value is changed. @item @ref{FL_RETURN_CHANGED} Return or invoke callback whenever the counter value is changed. This is the default setting. @item @ref{FL_RETURN_END} Return or invoke callback at the end regardless if the counter value is changed or not. @item @ref{FL_RETURN_ALWAYS} Return or invoke callback when the counter value has changed or mouse button has been released. @end table @node Other Counter Routines @subsection Other Counter Routines To change the value of the counter, it's bounds and stp size use the routines @findex fl_set_counter_value() @anchor{fl_set_counter_value()} @findex fl_set_counter_bounds() @anchor{fl_set_counter_bounds()} @findex fl_set_counter_step() @anchor{fl_set_counter_step()} @example void fl_set_counter_value(FL_OBJECT *obj, double val); void fl_set_counter_bounds(FL_OBJECT *obj, double min, double max); void fl_set_counter_step(FL_OBJECT *obj, double small, double large); @end example @noindent The first routine sets the value (default is 0) of the counter, the second routine sets the minimum and maximum values that the counter will take (default are -1000000 and 1000000, respectively) and the third routine sets the sizes of the small and large steps (defaults to 0.1 and 1). (For simple counters only the small step is used.) For conflicting settings, bounds take precedence over value, i.e., if setting a value that is outside of the current bounds, it is clamped. Also changing the bounds in a way that the current counter value isn't within the new bounds range anymore will result in its value being adjusted to the nearest of the new limits. To obtain the current value of the counter use @findex fl_get_counter_value() @anchor{fl_get_counter_value()} @example double fl_get_counter_value(FL_OBJECT *obj); @end example To obtain the current bounds and steps, use the following functions @findex fl_get_counter_bounds() @anchor{fl_get_counter_bounds()} @findex fl_get_counter_step() @anchor{fl_get_counter_step()} @example void fl_get_counter_bounds(FL_OBJECT *obj, double *min, double *max); void fl_get_counter_step(FL_OBJECT *obj, double *small, double *large); @end example To set the precision (number of digits after the dot) with which the counter value is displayed use the routine @findex fl_set_counter_precision() @anchor{fl_set_counter_precision()} @example void fl_set_counter_precision(FL_OBJECT *obj, int prec); @end example To determine the current value of the precision use @findex fl_get_counter_precision() @anchor{fl_get_counter_precision()} @example int fl_get_counter_precision(FL_OBJECT *obj); @end example By default, the value shown is the counter value in floating point format. You can override the default by registering a filter function using the following routine @findex fl_set_counter_filter() @anchor{fl_set_counter_filter()} @example void fl_set_counter_filter(FL_OBJECT *obj, const char *(*filter)(FL_OBJECT *, double value, int prec)); @end example @noindent where @code{value} and @code{prec} are the counter value and precision respectively. The filter function @code{filter} should return a string that is to be shown. Note that the default filter is equivalent to the following @example const char *filter(FL_OBJECT *obj, double value, int prec) @{ static char buf[32]; sprintf(buf, "%.*f",prec,value); return buf; @} @end example By default the counter value changes first slowly and the rate of change then accelerates until a final speed is reached. The default delay between value changes is @w{600 ms} at the start and the final delay is @w{50 ms}. You can change the initial delay by a call of the function @findex fl_set_counter_repeat() @anchor{fl_set_counter_repeat()} @example void fl_set_counter_repeat(FL_OBJECT *obj, int millisec); @end example @noindent and the final delay by using @findex fl_set_counter_min_repeat() @anchor{fl_set_counter_min_repeat()} @example void fl_set_counter_min_repeat(FL_OBJECT *obj, int millisec); @end example @noindent where in both cases the argument @code{millisec} is the delay in milli-seconds. The current settings for the initial and final delay can be obtained by calling the functions @findex fl_get_counter_repeat() @anchor{fl_get_counter_repeat()} @findex fl_get_counter_min_repeat() @anchor{fl_get_counter_min_repeat()} @example int fl_get_counter_repeat(FL_OBJECT *obj); int fl_get_counter_min_repeat(FL_OBJECT *obj); @end example Until version 1.0.91 of the library the delay between changes of a counter was constant (with a default value of @w{100 ms}). To obtain this traditional behaviour simple set the initial and final delay to the same value. As a third alternative you can also request that only the first change of the counter has a different delay from all the following ones. To achieve this call @findex fl_set_counter_speedjump() @anchor{fl_set_counter_speedjump()} @example void fl_set_counter_speedjump(FL_OBJECT *obj, int yes_no); @end example @noindent with a true value for @code{yes_no}. The delay for the first change of the counter value will then be the one set by @code{@ref{fl_set_counter_repeat()}} and the following delays last as long as set by @code{@ref{fl_set_counter_min_repeat()}}. To determine the setting for "speedjumping" call @findex fl_get_counter_speedjump() @anchor{fl_get_counter_speedjump()} @example int fl_get_counter_speedjump(FL_OBJECT *obj); @end example @node Counter Attributes @subsection Counter Attributes Never use @code{FL_NO_BOX} as the boxtype for a counter. The first color argument (@code{col1}) t @code{@ref{fl_set_object_color()}} controls the color of the background of the counter, the second (@code{col2}) sets the color of the arrow buttons of the counter. @node Counter Remarks @subsection Remarks See demo program @file{counter.c} for an example of the use of counters. @node Spinner Object @section Spinner Object A spinner object is a combination of a (numerical) input field with two (touch) buttons that allow to increment or decrement the value in the (editable) input field. I.e., the user can change the spinners value by either editing the value of the input field or by using the up/down buttons shown beside the input field. There are two types of spinner objects, one for integer and one for floating point values. You can set limits on the values that can be input and you can also set the amount of increment/decrement achieved when clicking on its buttons. @ifnottex @menu * Adding Spinner Objects: Adding Spinner Objects * Spinner Types: Spinner Types * Spinner Interaction: Spinner Interaction * Other Spinner Routines: Other Spinner Routines * Spinner Attributes: Spinner Attributes @end menu @end ifnottex @node Adding Spinner Objects @subsection Adding Spinner Objects To add a spinner to a form use @findex fl_add_spinner() @anchor{fl_add_spinner()} @example FL_OBJECT *fl_add_spinner(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent The meaning of the parameters is as usual. The label is by default placed on the left of the spinner object. @node Spinner Types @subsection Spinner Types There are two types of spinners, one for input of integer and one for floating point values: @table @code @tindex FL_INT_SPINNER @anchor{FL_INT_SPINNER} @item FL_INT_SPINNER A spinner that allows input of integer values. @tindex FL_FLOAT_SPINNER @anchor{FL_FLOAT_SPINNER} @item FL_FLOAT_SPINNER A spinner that allows input of floating point values. @end table The way a spinner looks like depends on its dimensions. If it's at least as wide as it's high the two buttons are drawn above each other to the right of the input field (and are marked with and up and down pointing triangle), while when the object is higher than it's wide they are drawn beside each other and below the input field (and the markers are then left and right pointing arrows). @node Spinner Interaction @subsection Spinner Interaction The user can change the value of a spinner in two ways. She can either edit the value in the spinner directly (exactly the same as for an integer or floating point input object (@ref{Part III Input Objects}) or by clicking on one of the buttons that will increment or decrement the value. Per default the spinner object gets returned to the application (or the associated callback is called) whenever the value changed and the interaction seems to have ended. If you want it returned under different circumstances use the function @example void fl_set_object_return(FL_OBJECT *obj, unsigned int when); @end example where the parameter @code{when} can be one of the four values @table @code @item @ref{FL_RETURN_NONE} Never return or invoke callback. @item @ref{FL_RETURN_END_CHANGED} Return or invoke callback at end of interaction (when either the input field loses the focus or one of the buttons was released) and the spinner's value changed during the interaction. @item @ref{FL_RETURN_CHANGED} Return or invoke callback whenever the spinner's value changed. This is the default. @item @ref{FL_RETURN_END} Return or invoke callback at end of interaction regardless of the spinner's value having changed or not. @item @ref{FL_RETURN_ALWAYS} Return or invoke callback whenever the value changed or the interaction ended. @end table @node Other Spinner Routines @subsection Other Spinner Routines Probably the most often used spinner functions are @findex fl_get_spinner_value() @anchor{fl_get_spinner_value()} @findex fl_set_spinner_value() @anchor{fl_set_spinner_value()} @example double fl_get_spinner_value(FL_OBJECT *obj ); double fl_set_spinner_value(FL_OBJECT *obj, double val); @end example @noindent The first one returns the value of a spinner. The type of the return value is a double for both integer and floating point spinners, so you have to convert it for integer spinners appropriately, e.g:@: using the @code{FL_nint()} macro, that converts a double to the nearest integer value. You can set or retrieve the upper and lower limit the value a spinner can be set to using the functions @findex fl_set_spinner_bounds() @anchor{fl_set_spinner_bounds()} @findex fl_get_spinner_bounds() @anchor{fl_get_spinner_bounds()} @example void fl_set_spinner_bounds(FL_OBJECT *obj, double min, double max); void fl_get_spinner_bounds(FL_OBJECT *obj, double *min, double *max); @end example @noindent Since this function is to be used for integer as well as floating point spinner objects the @code{double} type values must be converted as necessary for @code{@ref{FL_INT_SPINNER}}. The default limits are @code{-10000} and @code{10000}, but can be set to up to @code{INT_MIN} and @code{INT_MIN} for @code{@ref{FL_INT_SPINNER}}s and @code{-DBL_MAX} and @code{DBL_MAX} for @code{@ref{FL_FLOAT_SPINNER}}s. To set or determine the step size by which a spinner will be incremented or decremented when one of the buttons is clicked on use @findex fl_set_spinner_step() @anchor{fl_set_spinner_step()} @findex fl_get_spinner_step() @anchor{fl_get_spinner_step()} @example void fl_set_spinner_step(FL_OBJECT *obj, double step); double fl_get_spinner_step(FL_OBJECT *obj); @end example @noindent The default step size is @code{1} for both @code{@ref{FL_INT_SPINNER}} and @code{@ref{FL_FLOAT_SPINNER}} objects. For @code{@ref{FL_FLOAT_SPINNER}} objects you can set (or determine) how many digits after the decimal point are shown by using @findex fl_set_spinner_precision() @anchor{fl_set_spinner_precision()} @findex fl_get_spinner_precision() @anchor{fl_get_spinner_precision()} @example void fl_set_spinner_precision(FL_OBJECT *obj, int prec); int fl_get_spinner_precision(FL_OBJECT *obj); @end example @noindent This is per default set to 6 digits after the decimal point. The function for setting the precision has no effect on @code{@ref{FL_INT_SPINNER}} objects and the other one returns 0 for this type of spinners. @node Spinner Attributes @subsection Spinner Attributes Please don't change the boxtype from @code{@ref{FL_NO_BOX}}. The label color and font can be set using the normal @code{@ref{fl_set_object_lcolor()}}, @code{@ref{fl_set_object_lsize()}} and @code{@ref{fl_set_object_lstyle()}} functions. The color of the input field of a spinner object can be set via using @code{@ref{fl_set_object_color()}} where the first color argument (@code{col1}) controls the color of the input field when it is not selected and the second (@code{col2}) is the color when selected. Instead of creating a plethora of functions to influence all the other aspects of how the spinner is drawn (colors, font types etc.) the user is given direct access to the sub-objects of a spinner. To this end three functions exist: @findex fl_get_spinner_input() @anchor{fl_get_spinner_input()} @findex fl_get_spinner_up_button() @anchor{fl_get_spinner_up_button()} @findex fl_get_spinner_down_button() @anchor{fl_get_spinner_down_button()} @example FL_OBJECT *fl_get_spinner_input(FL_OBJECT *obj); FL_OBJECT *fl_get_spinner_up_button(FL_OBJECT *obj); FL_OBJECT *fl_get_spinner_down_button(FL_OBJECT *obj); @end example @noindent They return the addresses of the objects the spinner object is made up from, i.e., that of the input field and the buttons for increasing and decreasing the spinner's value. These then can be used to set or query the way the individual component objects are drawn. The addresses of these sub-objects shouldn't be used for any other purposes, especially their callback function may never be changed! @node Thumbwheel Object @section Thumbwheel Object Thumbwheel is another valuator that can be useful for letting the user indicate a value between some fixed bounds. Both horizontal and vertical thumbwheels exist. They have a minimum, a maximum and a current value (all floating point values). The user can change the current value by rolling the wheel. @ifnottex @menu * Adding Thumbwheel Objects: Adding Thumbwheel Objects * Thumbwheel Types: Thumbwheel Types * Thumbwheel Interaction: Thumbwheel Interaction * Other Thumbwheel Routines: Other Thumbwheel Routines * Thumbwheel Attributes: Thumbwheel Attributes * Remarks: Thumbwheel Remarks @end menu @end ifnottex @node Adding Thumbwheel Objects @subsection Adding Thumbwheel Objects To add a thumbwheel to a form use @findex fl_add_thumbwheel() @anchor{fl_add_thumbwheel()} @example FL_OBJECT *fl_add_thumbwheel(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent The meaning of the parameters is as usual. The label is by default placed below the thumbwheel. @node Thumbwheel Types @subsection Thumbwheel Types @ifhtml @center @image{xforms_images/thumbwheels} @end ifhtml @ifnothtml @center @image{xforms_images/thumbwheels,7cm} @end ifnothtml The following types of thumbwheels are available: @table @code @tindex FL_VERT_THUMBWHEEL @anchor{FL_VERT_THUMBWHEEL} @item FL_VERT_THUMBWHEEL A vertical thumbwheel. @tindex FL_HOR_THUMBWHEEL @anchor{FL_HOR_THUMBWHEEL} @item FL_HOR_THUMBWHEEL A horizontal thumbwheel. @end table @node Thumbwheel Interaction @subsection Thumbwheel Interaction Whenever the user changes the value of the thumbwheel using the mouse or keyboard, the thumbwheel is returned (or the callback called) by the interaction routines. You change the value of a thumbwheel by dragging the mouse inside the wheel area or, for vertical thumbwheels also by using the scroll wheel of the mouse. Each pixel of movement changes the value of the thumbwheel by 0.005, which you can change using the @code{@ref{fl_set_thumbwheel_step()}} function. The keyboard can be used to change the value of a thumbwheel. Specifically, the @code{} and @code{} cursor keys can be used to increment or decrement the value of a vertical thumbwheel and the @code{} and @code{} cursor keys can be used to increment or decrement the value of horizontal thumbwheel. Each pressing of the cursor key changes the thumbwheel value by the current step value. The @code{} key can be used to set the thumbwheel to a known value, which is the average of the minimum and the maximum value of the thumbwheel. In some applications you might not want the thumbwheel to be returned all the time. To change the default, call the following routine: @example void fl_set_object_return(FL_OBJECT *obj, unsigned int when); @end example where the parameter @code{when} can be one of the four values @table @code @item @ref{FL_RETURN_NONE} Never return or invoke callback. @item @ref{FL_RETURN_END_CHANGED} Return or invoke callback at end (mouse release) if value is changed since last return. @item @ref{FL_RETURN_CHANGED} Return or invoke callback whenever the thumbwheel value is changed. @item @ref{FL_RETURN_END} Return or invoke callback at end (mouse release) regardless if the value is changed or not. @item @ref{FL_RETURN_ALWAYS} Return or invoke callback whenever the value changes or the mouse button is released. @end table See demo program @file{thumbwheel.c} for an example use of this. @node Other Thumbwheel Routines @subsection Other Thumbwheel Routines To change the value and bounds of a thumbwheel use the following routines @findex fl_set_thumbwheel_value() @anchor{fl_set_thumbwheel_value()} @findex fl_set_thumbwheel_bounds() @anchor{fl_set_thumbwheel_bounds()} @example double fl_set_thumbwheel_value(FL_OBJECT *obj, double val); void fl_set_thumbwheel_bounds(FL_OBJECT *obj, double min, double max); @end example @noindent By default, the minimum value is 0.0, the maximum is 1.0 and the value is 0.5. To obtain the current value or bounds of a thumbwheel use @findex fl_get_thumbwheel_value() @anchor{fl_get_thumbwheel_value()} @findex fl_get_thumbwheel_bounds() @anchor{fl_get_thumbwheel_bounds()} @example double fl_get_thumbwheel_value(FL_OBJECT *obj); void fl_get_thumbwheel_bounds(FL_OBJECT *obj, double *min, double *max); @end example By default, the bounds are "hard", i.e., once you reach the minimum or maximum, the wheel would not turn further in this direction. However, if desired, you can make the bounds to turn over such that it crosses over from the minimum to the maximum value and vice versa. To this end, the following routine is available @findex fl_set_thumbwheel_crossover() @anchor{fl_set_thumbwheel_crossover()} @example int fl_set_thumbwheel_crossover(FL_OBJECT *obj, int yes_no); @end example In a number of situations you might like thumbwheel values to be rounded to some values, e.g., to integer values. To this end use the routine @findex fl_set_thumbwheel_step() @anchor{fl_set_thumbwheel_step()} @example void fl_set_thumbwheel_step(FL_OBJECT *obj, double step); @end example @noindent After this call thumbwheel values will be rounded to multiples of @code{step}. Use a value 0.0 for @code{step} to switch off rounding. To get the current setting for this call @findex fl_get_thumbwheel_step() @anchor{fl_get_thumbwheel_step()} @example double fl_set_thumbwheel_step(FL_OBJECT *obj); @end example @node Thumbwheel Attributes @subsection Thumbwheel Attributes Setting colors via @code{@ref{fl_set_object_color()}} has no effect on thumbwheels. @node Thumbwheel Remarks @subsection Remarks See the demo program @file{thumbwheel.c} for an example of the use of thumbwheels. xforms-1.2.4/doc/part3_buttons.texi0000664000175000017500000005313112252564656014246 00000000000000@node Part III Button-like Objects @chapter Button-like Objects A very important set of object classes are those for buttons. Buttons are placed on the form such that the user can push them with the mouse. The different button classes mostly are distinguished by the way they are displayed. Differences in behaviour can be achieved by using different types for a button: there exist button types that make them return to their normal state when the user releases the mouse, types for buttons that stay pushed until the user pushes them again, a radio button type for buttons that are grouped with other radio buttons and of which only one can be in the on state at a time and a touch button type for buttons that "fire" repeatedly while being pressed. @ifhtml @center @image{xforms_images/buttontypes} @end ifhtml @ifnothtml @center @image{xforms_images/buttontypes,7cm} @end ifnothtml Also different shapes of buttons exist. Normal buttons are rectangles that come out of the background. When the user pushes them they go into the background (and possibly change color). Lightbuttons have a small light inside them. Pushing these buttons switches the light on. Round buttons are simple circles and, when pushed, a colored circle appears inside of them. Bitmap and pixmap buttons are buttons with an image in addition to a text label. @ifnottex @menu * Adding Button Objects: Adding Button Objects * Button Types: Button Types * Button Interaction: Button Interaction * Other Button Routines: Other Button Routines * Button Attributes: Button Attributes * Remarks: Button Remarks @end menu @end ifnottex @node Adding Button Objects @section Adding Button Objects Adding an object To add buttons use one of the following routines: @findex fl_add_button() @anchor{fl_add_button()} @findex fl_add_lightbutton() @anchor{fl_add_lightbutton()} @findex fl_add_roundbutton() @anchor{fl_add_roundbutton()} @findex fl_add_round3dbutton() @anchor{fl_add_round3dbutton()} @findex fl_add_checkbutton() @anchor{fl_add_checkbutton()} @findex fl_add_bitmapbutton() @anchor{fl_add_bitmapbutton()} @findex fl_add_pixmapbutton() @anchor{fl_add_pixmapbutton()} @findex fl_add_labelbutton() @anchor{fl_add_labelbutton()} @findex fl_add_scrollbutton() @anchor{fl_add_scrollbutton()} @example FL_OBJECT *fl_add_button(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); FL_OBJECT *fl_add_lightbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); FL_OBJECT *fl_add_roundbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); FL_OBJECT *fl_add_round3dbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); FL_OBJECT *fl_add_checkbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); FL_OBJECT *fl_add_bitmapbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); FL_OBJECT *fl_add_pixmapbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); FL_OBJECT *fl_add_labelbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); FL_OBJECT *fl_add_scrollbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example These finctions create buttons of the following classes: @table @code @tindex FL_BUTTON @anchor{FL_BUTTON} @item FL_BUTTON A standard normal button. @tindex FL_LIGHTBUTTON @anchor{FL_LIGHTBUTTON} @item FL_LIGHTBUTTON A button with a small embedded, colored area that changes color when the button is in the on state. @tindex FL_ROUNDBUTTON @anchor{FL_ROUNDBUTTON} @item FL_ROUNDBUTTON A circular button (with a label beside). The inner area of the circle changes color when the button is on. Often used for radio buttons. @tindex FL_ROUND3DBUTTON @anchor{FL_ROUND3DBUTTON} @item FL_ROUND3DBUTTON Just like the @code{@ref{FL_ROUNDBUTTON}} but the circle is dran in a 3D-fashion. @tindex FL_CHECKBUTTON @anchor{FL_CHECKBUTTON} @item FL_CHECKBUTTON Button shaped in the form of a rhombus slightly raised above the forms plane when off and slightly embossed (ypically with a different color) when on. @tindex FL_BITMAPBUTTON @anchor{FL_BITMAPBUTTON} @item FL_BITMAPBUTTON Button decorated with a bitmap (often read in from an X bitmap file with extension @code{xbm}) in additional to a label. @tindex FL_PIXMAPBUTTON @anchor{FL_PIXMAPBUTTON} @item FL_PIXMAPBUTTON Button decorated with a pixmap (often read in from an X pixmap file with extension @code{xpm}) in additional to a label. An additonal pixmap can be set for the case that the mouse hoovers over the button. @tindex FL_LABELBUTTON @anchor{FL_LABELBUTTON} @item FL_LABELBUTTON A button that does not appear to be a button, only its label is shown, can be used e.g., for hyperlinks. @tindex FL_SCROLLBARBUTTON @anchor{FL_SCROLLBARBUTTON} @item FL_SCROLLBARBUTTON A button mostly used at the ends of scrollbars - instead of a label it can only contain a triangle pointing up, down, left or right. @end table The meaning of the parameters is as usual. The label is by default placed inside the button for button and lightbutton. For roundbutton, round3dbutton, bitmapbutton and pixmapbutton, it is placed to the right of the circle and to the bottom of the bitmap/pixmap respectively. For scrollbutton, the label must be of some pre-determined string that indicates the direction of the scroll arrow. @node Button Types @section Button Types The following types of buttons are available: @table @code @tindex FL_NORMAL_BUTTON @anchor{FL_NORMAL_BUTTON} @item FL_NORMAL_BUTTON Returned to @code{@ref{fl_do_forms()}} (or having its callback funtion invoked) when released. @tindex FL_PUSH_BUTTON @anchor{FL_PUSH_BUTTON} @item FL_PUSH_BUTTON Stays pushed until user pushes it again. @tindex FL_MENU_BUTTON @anchor{FL_MENU_BUTTON} @item FL_MENU_BUTTON Returned when pushed, useful e.g., for opening a popup when pushed. @tindex FL_TOUCH_BUTTON @anchor{FL_TOUCH_BUTTON} @item FL_TOUCH_BUTTON Returned at regulat intervals as long as the user pushes it. @tindex FL_RADIO_BUTTON @anchor{FL_RADIO_BUTTON} @item FL_RADIO_BUTTON Push button that switches off other radio buttons. @tindex FL_HIDDEN_BUTTON @anchor{FL_HIDDEN_BUTTON} @item FL_HIDDEN_BUTTON Invisible normal button. @tindex FL_INOUT_BUTTON @anchor{FL_INOUT_BUTTON} @item FL_INOUT_BUTTON Returned both when pushed and when released. @tindex FL_RETURN_BUTTON @anchor{FL_RETURN_BUTTON} @item FL_RETURN_BUTTON Like a normal button but also reacts to the @code{} key. @tindex FL_HIDDEN_RET_BUTTON @anchor{FL_HIDDEN_RET_BUTTON} @item FL_HIDDEN_RET_BUTTON Invisible return button. @end table Except for the @code{@ref{FL_HIDDEN_BUTTON}} and @code{@ref{FL_HIDDEN_RET_BUTTON}}, which are invisible, there's not much visible indication of the button type but the function is quite different. For each of the types the button gets pushed down when the user presses the mouse on top of it. What actually happens when the user does so then depends on the type of the button. An @code{@ref{FL_NORMAL_BUTTON}}, @code{@ref{FL_TOUCH_BUTTON}} and @code{@ref{FL_INOUT_BUTTON}} gets released when the user releases the mouse button. Their difference lies in the moment at which the interaction routines return them (see below). A @code{@ref{FL_PUSH_BUTTON}} remains pushed and is only released when the user pushes it again. A @code{@ref{FL_RADIO_BUTTON}} is a push button with the following extra property: whenever the user pushes a radio button, all other pushed radio buttons in the same form (or in the same group) are released. In this way the user can make its choice among several possibilities. A @code{@ref{FL_RETURN_BUTTON}} behaves like a normal button, but it also reacts when the @code{} key on the keyboard is pressed. When a form contains such a button (of course there can only be one) the @code{} key can no longer be used to move between input fields. For this the @code{} key must be used. A @code{@ref{FL_HIDDEN_BUTTON}} behaves like a normal button but is invisible. A @code{@ref{FL_HIDDEN_RET_BUTTON}} is like a hidden button but also reacts to @code{} key presses. @node Button Interaction @section Button Interaction @code{@ref{FL_NORMAL_BUTTON}}s, @code{@ref{FL_PUSH_BUTTON}}s, @code{@ref{FL_RADIO_BUTTON}}s, @code{@ref{FL_RETURN_BUTTON}}s and @code{@ref{FL_HIDDEN_BUTTON}}s are returned at the moment the user releases the mouse after having pressed it on the button. A @code{@ref{FL_MENU_BUTTON}}, in contrast, is returned already on a mouse press. A @code{@ref{FL_INOUT_BUTTON}} is returned both when the user presses it and when the user releases it. A @code{@ref{FL_TOUCH_BUTTON}} is returned all the time as long as the user keeps the mouse button pressed while the mouse is on top of it. A @code{@ref{FL_RETURN_BUTTON}} and a @code{@ref{FL_HIDDEN_RET_BUTTON}} are also returned when the user presses the @code{} key. As for other ``active'' objects, you can control under which conditions a button object gets returned or its callback invoked by using the function @example int fl_set_object_return(FL_OBJECT *obj, unsigned int when); @end example where reasonable values for @code{when} are @table @code @item @ref{FL_RETURN_NONE} Never return object or invoke callback. @item @ref{FL_RETURN_END_CHANGED} Return object or invoke callback when mouse button is released and at the same moment the state of the button changed. @item @ref{FL_RETURN_CHANGED} Return object or invoke callback whenever the state of the button changes. @item @ref{FL_RETURN_END} Return object or invoke callback when mouse button is released @item @ref{FL_RETURN_ALWAYS} Return object or invoke callback on all of the above condtions. @end table Most buttons will always return @code{@ref{FL_RETURN_END}} and @code{@ref{FL_RETURN_CHANGED}} at the same time. Exceptions are @code{@ref{FL_INOUT_BUTTON}}s and @code{@ref{FL_TOUCH_BUTTON}}s. The former returns @code{@ref{FL_RETURN_CHANGED}} when pushed and both @code{@ref{FL_RETURN_END}} and @code{@ref{FL_RETURN_CHANGED}} together when released. @code{@ref{FL_TOUCH_BUTTON}}s return when pressed, then @code{@ref{FL_RETURN_CHANGED}} at regular time intervals while being pressed and finally @code{@ref{FL_RETURN_END}} when released. See demo @file{butttypes.c} for a feel of the different button types. @node Other Button Routines @section Other Button Routines The application program can also set a button to be pushed or not itself without a user action. To this end use the routine @findex fl_set_button() @anchor{fl_set_button()} @example void fl_set_button(FL_OBJECT *obj, int pushed); @end example @noindent @code{pushed} indicates whether the button should be set to be pushed (1) or released (0). When setting a @code{@ref{FL_RADIO_BUTTON}} to be pushed this automatically releases the currently pushed radio button in the same form (or group). Also note that this routine only simulates the visual appearance but does not affect the program flow in any way, i.e., setting a button as being pushed does not invoke its callback or results in the button becoming returned to the program. For that follow up the call of @code{@ref{fl_set_button()}} with a call of @code{@ref{fl_trigger_object()}} (or @code{@ref{fl_call_object_callback()}}). To figure out whether a button is pushed or not use@footnote{@code{@ref{fl_mouse_button()}} can also be used.} @findex fl_get_button() @anchor{fl_get_button()} @example int fl_get_button(FL_OBJECT *obj); @end example Sometimes you want to give the button a different meaning depending on which mouse button gets pressed on it. To find out which mouse button was used at the last push (or release) use the routine @findex fl_get_button_numb() @anchor{fl_get_button_numb()} @example int fl_get_button_numb(FL_OBJECT *obj); @end example @noindent It returns one of the constants @code{@ref{FL_LEFT_MOUSE}}, @code{@ref{FL_MIDDLE_MOUSE}}, @code{@ref{FL_RIGHT_MOUSE}}, @code{@ref{FL_SCROLLUP_MOUSE}} or @code{@ref{FL_SCROLLDOWN_MOUSE}} (the latter two are from the scroll wheel of the mouse). If the last push was triggered by a shortcut (see below), the function returns the @code{keysym} (ASCII value if the key used is between 0 and 127) of the key plus @tindex FL_SHORTCUT @code{@ref{FL_SHORTCUT}}. For example, if a button has @code{-C} as its shortcut the button number returned upon activation of the shortcut will be @code{FL_SHORTCUT + 3} (the ASCII value of @code{-C} is 3). It can also be controlled which mouse buttons a buttons reacts to (per default a button reacts to all mouse buttons, including the scroll wheel). To set which mouse buttons the button reacts to use @findex fl_set_button_mouse_buttons() @anchor{fl_set_button_mouse_buttons()} @example void fl_set_button_mouse_buttons(FL_OBJECT *obj, int mbuttons); @end example @noindent @code{mbuttons} is the bitwise OR of the numbers 1 for the left mouse button, 2 for the middle, 4 for the right mouse button, 8 for moving the scroll wheel up "button" and 16 for scrolling down "button". Per default a button reacts to all mouse buttons. To determine which mouse buttons a button is reacting to use @findex fl_get_button_mouse_buttons() @anchor{fl_get_button_mouse_buttons()} @example void fl_get_button_mouse_buttons(FL_OBJECT *obj, unsigned int *mbuttons); @end example @noindent The value returned via @code{mbuttons} is the same value as would be used in @code{@ref{fl_set_button_mouse_buttons()}}. In a number of situations it is useful to define a keyboard equivalent for a button. You might e.g., want to define that @code{Q} has the same meaning as pressing the "Quit" button. This can be achieved using the following call: @findex fl_set_button_shortcut() @anchor{fl_set_button_shortcut()} @example void fl_set_button_shortcut(FL_OBJECT *obj, const char *str, int showUL); @end example @noindent Note that @code{str} is a string, not a single character. This string is a list of all the characters to become keyboard shortcuts for the button. E.g., if you use string "^QQq" the button will react on the keys @code{q}, @code{Q} and @code{Q}. (As you see you can use the symbol @code{^} to indicate the control key. Similarly you can use the symbol @code{#} to indicate the @code{} key.) Be careful with your choices. When the form also contains input fields you probably don't want to use the normal printable characters because they can no longer be used for input in the input fields. Shortcuts are always evaluated before input fields. Other special keys, such as @code{} etc., can also be used as shortcuts. @xref{Shortcuts}, for details. Finally, keep in mind that a button of type @code{FL_RETURN_BUTTON} is in fact nothing more than a normal button, just with the @code{} key set as the shortcut. So don't change the shortcuts for such a button. If the third parameter @code{showUL} is true and one of the letters in the object label matches the shortcut the matching letter will be underlined. This applies to non-printable characters (such as @code{#A}) as well in the sense that if the label contains the letter @code{a} or @code{A} it will be underlined (i.e., special characters such as @code{#} and @code{^} are ignored when matching). A false value (0) for @code{showUL} turns off underlining without affecting the shortcut. Note that although the entire object label is searched for matching character to underline of the shortcut string itself only the first (non-special) character is considered, thus a shortcut string of @code{"Yy"} for the label @code{"Yes"} will result in the letter @code{Y} becoming underlined while for @code{"yY"} it won't. To set the bitmap to use for a bitmap button the following functions can be used: @findex fl_set_bitmapbutton_data() @anchor{fl_set_bitmapbutton_data()} @findex fl_set_bitmapbutton_file() @anchor{fl_set_bitmapbutton_file()} @example void fl_set_bitmapbutton_data(FL_OBJECT *obj, int w, int h, unsigned char *bits); void fl_set_bitmapbutton_file(FL_OBJECT *obj, const char *filename); @end example Similarly, to set the pixmap to use for a pixmap button the following routines can be used: @findex fl_set_pixmapbutton_data() @anchor{fl_set_pixmapbutton_data()} @findex fl_set_pixmapbutton_file() @anchor{fl_set_pixmapbutton_file()} @findex fl_set_pixmapbutton_pixmap() @anchor{fl_set_pixmapbutton_pixmap()} @example void fl_set_pixmapbutton_data(FL_OBJECT *obj, unsigned char **bits); void fl_set_pixmapbutton_file(FL_OBJECT *obj, const char *file); void fl_set_pixmapbutton_pixmap(FL_OBJECT *obj, Pixmap id, Pixmap mask); @end example @noindent To use the first routine, you @code{#include} the pixmap file into your source code and use the pixmap definition data (an array of char pointers) directly. For the second routine the filename @code{file} that contains the pixmap definition is used to specify the pixmap. The last routine assumes that you already have a X Pixmap resource ID for the pixmap you want to use. Note that these routines do not free a pixmap already associated with the button. To free the pixmaps use the function @findex fl_free_pixmapbutton_pixmap() @anchor{fl_free_pixmapbutton_pixmap()} @example void fl_free_pixmapbutton_pixmap(FL_OBJECT *obj); @end example @noindent This function frees the pixmap and mask together with all the colors allocated for them. To get the pixmap and mask that is currently being displayed, use the following routine @findex fl_get_pixmapbutton_pixmap() @anchor{fl_get_pixmapbutton_pixmap()} @example Pixmap fl_get_pixmapbutton_pixmap(FL_OBJECT *obj, Pixmap &pixmap, Pixmap &mask); @end example Pixmaps are by default displayed centered inside the bounding box. However, this can be changed using the following routine @findex fl_set_pixmapbutton_align() @anchor{fl_set_pixmapbutton_align()} @example void fl_set_pixmapbutton_align(FL_OBJECT *obj, int align, int xmargin, int ymargin); @end example @noindent where @code{align} is the same as that used for labels. @xref{Label Attributes and Fonts}, for a list. @code{xmargin} and @code{ymargin} are extra margins to leave in addition to the object border width. Note that although you can place a pixmap outside of the bounding box, it probably is not a good idea. When the mouse enters a pixmap button an outline of the button is shown. If required, a different pixmap (the focus pixmap) can also be shown. To set such a focus pixmap the following functions are available: @findex fl_set_pixmapbutton_focus_data() @anchor{fl_set_pixmapbutton_focus_data()} @findex fl_set_pixmapbutton_focus_file() @anchor{fl_set_pixmapbutton_focus_file()} @findex fl_set_pixmapbutton_focus_pixmap() @anchor{fl_set_pixmapbutton_focus_pixmap()} @example void fl_set_pixmapbutton_focus_data(FL_OBJECT *obj, unsigned char **bits); void fl_set_pixmapbutton_focus_file(FL_OBJECT *obj, const char *file); void fl_set_pixmapbutton_focus_pixmap(FL_OBJECT *obj, Pixmap id, Pixmap mask); @end example @noindent The meanings of the parameters are the same as that in the regular pixmap routines. Finally, there's a function that can be used to enable or disable the focus outline @findex fl_set_pixmapbutton_focus_outline() @anchor{fl_set_pixmapbutton_focus_outline()} @example void fl_set_pixmapbutton_focus_outline(FL_OBJECT *obj, int yes_no); @end example @noindent See also @ref{Pixmap Object}, for pixmap color and transparency handling. To get rid of a focus pixmap of a pixmap button use the function @findex fl_free_pixmap_focus_pixmap() @anchor{fl_free_pixmap_focus_pixmap()} @example void fl_free_pixmap_focus_pixmap(FL_OBJECT *obj); @end example @node Button Attributes @section Button Attributes For normal buttons the first color argument (@code{col1}) to @code{@ref{fl_set_object_color()}} controls the normal color and the second (@code{col2}) the color the button has when pushed. For lightbuttons @code{col1} is the color of the light when off and @code{col2} the color when on. For round buttons, @code{col1} is the color of the circle and @code{col2} the color of the circle that is placed inside it when pushed. For round3dbutton, @code{col1} is the color of the inside of the circle and @code{col2} the color of the embedded circle. For bitmapbuttons, @code{col1} is the normal box color (or bitmap background if boxtype is not @code{FL_NO_BOX}) and @code{col2} is used to indicate the focus color. The foreground color of the bitmap is controlled by label color (as set via @code{@ref{fl_set_object_lcolor()}}. For scrollbutton, @code{col1} is the overall boundbox color (if boxtype is not @code{FL_NO_BOX}), @code{col2} is the arrow color. The label of a scrollbutton must be a string with a number between 1 and 9 (except 5), indicating the arrow direction like on the numerical key pad. The label can have an optional prefix @code{#} to indicate uniform scaling. For example, the label @code{"#9"} tells that the arrow should be pointing up-right and the arrow has the identical width and height regardless the overall bounding box size. @node Button Remarks @section Remarks See all demo programs, in particular @file{pushbutton.c} and @file{buttonall.c} for the use of buttons. xforms-1.2.4/doc/part1_goodies.texi0000664000175000017500000011065012353623325014166 00000000000000@node Part I Goodies @chapter Goodies A number of special routines are provided that make working with simple forms even simpler. All these routines build simple forms and handle the interaction with the user. @ifnottex @menu * Messages and Questions:: * Command Log:: * Colormap:: * Color Chooser:: * File Selector:: @end menu @end ifnottex @node Messages and Questions @section Messages and Questions The following routines are meant to give messages to the user and to ask simple questions: @findex fl_show_message() @anchor{fl_show_message()} @example void fl_show_message(const char *s1, const char *s2, const char *s3); @end example @noindent It shows a simple form with three lines of text and a button labeled OK on it. The form is so shown such that the mouse pointer is on the button. Sometimes, it may be more convenient to use the following routine @findex fl_show_messages() @anchor{fl_show_messages()} @example void fl_show_messages(const char *str); @end example @noindent when the message is a single line or when you know the message in advance. Embed newlines in @code{str} to get multi-line messages. As a third alternative you can also use @findex fl_show_messages_f() @anchor{fl_show_messages_f()} @example void fl_show_messages_f(const char * fmt, ...); @end example @noindent The only required argument @code{fmt} is a format string as you would use it for e.g., @code{printf(3)}, which then is followed by as many arguments as there are format specifiers in the format string. The string resulting from expanding the format string, using the remaining arguments, can have arbitrary length and embedded newline characters (@code{'\n'}), producing line breaks. The size of the message box is automatically made to fit the whole text. Both of the message routines block execution and do not return immediately (but idle callbacks and asynchronous IO continue to be run and checked). Execution resumes when the OK button is pressed or @code{} is hit, or when the message form is removed from the screen by the following routine (for example, triggered by a timeout or idle callback): @findex fl_hide_message() @anchor{fl_hide_message()} @example void fl_hide_message(void) @end example There is also a routine that can be used to show a one-line message that can only be removed programmatically @findex fl_show_oneliner() @anchor{fl_show_oneliner()} @findex fl_hide_oneliner() @anchor{fl_hide_oneliner()} @example void fl_show_oneliner(const char *str, FL_Coord x, FL_Coord y); void fl_hide_oneliner(void); @end example @noindent where @code{str} is the message and @code{x} and @code{y} are the coordinates (relative to the root window) the message should be placed. Note that multi-line messages are possible by embedding the newline character into @code{str}. See the demo program @file{preemptive.c} for an example of its use. By default, the background of the message is yellow and the text black. To change this default, use the following routine @findex fl_set_oneliner_color() @anchor{fl_set_oneliner_color()} @example void fl_set_oneliner_color(FL_COLOR background, FL_COLOR textcol); @end example A similar routine exists to change the font style and size @findex fl_set_oneliner_font() @anchor{fl_set_oneliner_font()} @example void fl_set_oneliner_font(int style, int size); @end example @noindent @findex fl_show_alert() @anchor{fl_show_alert()} @findex fl_hide_alert() @anchor{fl_hide_alert()} @example void fl_show_alert(const char *s1, const char *s2, const char *s3, int centered); void fl_hide_alert(void); @end example @noindent work the same as @code{@ref{fl_show_messages()}} goodie except that an alert icon (!) is added and the first string is shown bold-faced. The extra parameter @code{centered} controls whether to display the form centered on the screen. As in the case of messages also another function is avaialble @findex fl_show_alert_f() @anchor{fl_show_alert_f()} @example void fl_show_alert2(int centered, const char *fmt, ...); @end example @noindent @code{centered} controls if the alert message is centered and @code{fmt} must be a format string as e.g., used for @code{printf(3)}. After the format string as many further arguments are required as there are format specifiers in the format string. The string resulting from expanding the format string, using the rest of the arguments, can have arbitrary length and the first embedded form-feed character (@code{'\f'}) is used as the separator between the title string and the message of the alert box. Embedded newline characters (@code{'\n'}) produce line breaks. In combination with @code{@ref{fl_add_timeout()}}, it is easy to develop a timed alert routine that goes away when the user pushes the OK button or when a certain time has elapsed: @example static void dismiss_alert(int ID, void *data) @{ fl_hide_alert(); @} void show_timed_alert(const char *s1, const char *s2, const char *s3, int centered) @{ fl_add_timeout( 10000, dismiss_alert, 0 ); /* ten seconds */ /* fl_show_alert blocks, and returns only when the OK button is pushed or when the timeout, in this case, 10 seconds, has elapsed */ fl_show_alert(s1, s2, s3, centered); @} @end example @noindent Then you can use @code{show_timed_alert()} just as @code{@code{fl_show_alert()}} but with added functionality that the alert will remove itself after 10 seconds even if the user does not push the OK button. @findex fl_show_question() @anchor{fl_show_question()} @findex fl_hide_question() @anchor{fl_hide_question()} @example int fl_show_question(const char *message, int def); void fl_hide_question(void); @end example @noindent Again shows a message (with possible embedded newlines in it) but this time with a Yes and a No button. @code{def} controls which button the mouse pointer should be on: 1 for Yes, 0 for No and any other value causes the form to be shown so the mouse pointer is at the center of the form. It returns whether the user pushed the Yes button. The user can also press the @code{} key to mean Yes and the @code{} key to mean No. If the question goodie is removed programmatically via @code{@ref{fl_hide_question()}}, the default @code{def} as given in @code{@ref{fl_show_question()}} is taken. If no default is set, 0 is returned by @code{@ref{fl_show_question()}}. The following code segment shows one way of using @code{@ref{fl_hide_question()}} @example void timeout_yesno(int id, void *data) @{ fl_hide_question(); @} ... fl_add_timeout(5000, timeout_yesno, 0); /* show_question blocks until either timeouts or one of the buttons is pushed */ if (fl_show_question("Want to Quit ?", 1)) exit(0); /* no is selected, continue */ ... /* rest of the code *. @end example @noindent In the above example, the user is given 5 seconds to think if he wants to quit. If within the 5 seconds he can't decide what to do, the timeout is triggered and @code{@ref{fl_show_question()}} returns 1. If, on the other hand, he pushes the No button before the timeout triggers, @code{@ref{fl_show_question()}} returns normally and @code{@ref{fl_hide_question()}} becomes a no-op. @findex fl_show_choice() @anchor{fl_show_choice()} @findex fl_show_choices() @anchor{fl_show_choices()} @findex fl_set_choices_shortcut() @anchor{fl_set_choices_shortcut()} @findex fl_hide_choice() @anchor{fl_hide_choice()} @example int fl_show_choice(const char *s1, const char *s2, const char *s3, int numb, const char *b1, const char *b2, const char *b3, int def); int fl_show_choices(const char *s, int numb, const char *b1, const char *b2, const char *b3, int def); void fl_set_choices_shortcut(const char *s1, const char *s2, const char *s3); void fl_hide_choice(void); @end example @noindent The first routine shows a message (up to three lines) with one, two or three buttons. @code{numb} indicates the number of buttons. @code{b1}, @code{b2} and @code{b3} are the labels of the buttons. @code{def} can be 1, 2 or 3, indicating the default choice. The second routine is similar to the first except that the message is passed as a single string with possible embedded newlines in it. Both routines return the number of the button pressed (1, 2 or 3). The user can also press the @code{<1>}, @code{<2>} or @code{<3>} key to indicate the first, second, or third button. More mnemonic hotkeys can be defined using the shortcut routine, @code{s1}, @code{s2} and @code{s3} are the shortcuts to bind to the three buttons. If the choice goodie is removed by @code{@ref{fl_hide_choice()}}, the default @code{def} is returned. To change the font used in all messages, use the following routine @findex fl_set_goodies_font() @anchor{fl_set_goodies_font()} @example void fl_set_goodies_font(int style, int size); @end example To obtain some text from the user, use the following routine @findex fl_show_input() @anchor{fl_show_input()} @findex fl_hide_input() @anchor{fl_hide_input()} @example const char *fl_show_input(const char *str1, const char *defstr); void fl_hide_input(void); @end example @noindent This shows a box with one line of message (indicated by @code{str1}), and an input field into which the user can enter a string. @code{defstr} is the default input string placed in the input box. In addition, three buttons, labeled @code{Cancel}, @code{OK} and @code{Clear} respectively, are added. The button labeled @code{Clear} deletes the string in the input field. The routine returns the string in the input field when the user presses the @code{OK} button or the @code{} key. The function also returns when button @code{Cancel} is pressed. In this case, instead of returning the text in the input field, @code{NULL} is returned. This routine can be used to have the user provide all kinds of textual input. Removing the input field programmatically by calling @code{@ref{fl_hide_input()}} results in @code{NULL} being returned by @code{@ref{fl_show_input()}}, i.e., it's equivalent to pressing the @code{Cancel} button. A similar but simpler routine can also be used to obtain textual input @findex fl_show_simple_input() @anchor{fl_show_simple_input()} @example const char *fl_show_simple_input(const char *str1, const char *defstr); @end example @noindent The form shown in this case only has the @code{OK} button. The example program @file{goodies.c} shows you these goodies. It is possible to change some of the built-in button labels via the following resource function with proper resource names @findex fl_set_resource() @example void fl_set_resource(const char *res_str, const char *value) @end example @noindent To, for example, change the label of the @code{Dismiss} button to @code{"Go"} in the alert form, code similar to the following can be used after calling @code{@ref{fl_initialize()}} but before any use of the alert goodie: @example fl_set_resource("flAlert.dismiss.label", "Go"); @end example Currently the following goodies resources are supported: @table @code @item flAlert.title The window title of the alert goodie @item flAlert.dismiss.label The label of the @code{Dismiss} button @item flQuestion.yes.label The label of the @code{Yes} button @item flQuestion.no.label The label of the @code{No} button @item flQuestion.title The window title of the Question goodie @item flChoice.title The window title of the Choice goodie @item *.ok.label The label of the @code{OK} button @end table Note that all goodies are shown with @code{FL_TRANSIENT} and not all window managers decorate such forms with titles. Thus the title setting in the above listing may not apply. @node Command Log @section Command Log In a number of situations, a GUI is created specifically to make an existing command-line oriented program easier to use. For stylistic considerations, you probably don't want to have the output (@code{stderr} and @code{stdout}) as a result of running the command printed on the terminal. Rather you want to log all the messages to a browser so the user can decide if and when to view the log. For this, a goodie is available @findex fl_exe_command() @anchor{fl_exe_command()} @example long fl_exe_command(const char *cmd, int block); @end example @noindent This function, similar to a @code{system(3)} call, forks a new process that runs the command @code{cmd}, which must be a (null-terminated) string containing a command line passed to the (sh) shell. The output (both @code{stderr} and @code{stdout}) of @code{cmd} is logged into a browser, which can be presented to the user when appropriate (see below). The @code{block} argument is a flag indicating if the function should wait for the child process to finish. If the argument @code{block} is true (non-zero), the function waits until the command @code{cmd} completes and then returns the exit status of the command @code{cmd} (i.e., the status one gets form @code{wait()} or @code{waitpid()}, so use @code{WEXITSTATUS()} on it if you want the return or @code{exit()} value from the program started)). If the argument @code{block} is false (0), the function returns immediately without waiting for the command to finish. In this case, the function returns the process ID of the child process or -1 if an error occured. Unlike other goodies, @code{@ref{fl_exe_command()}} does not deactivate other forms even in blockng mode. This means that the user can interact with the GUI while @code{@ref{fl_exe_command()}} waits for the child process to finish. If this is not desired, you can use @code{@ref{fl_deactivate_all_forms()}} and @code{@ref{fl_activate_all_forms()}} to wrap the function. If @code{@ref{fl_exe_command()}} is called in non-blocking mode, the following function should be called to clean up related processes and resources before the caller exits (otherwise a zombie process may result) @findex fl_end_command() @anchor{fl_end_command()} @example int fl_end_command(long pid); @end example @noindent where @code{pid} is the process ID returned by @code{@ref{fl_exe_command()}}. The function suspends the current process and waits until the child process is completed, then it returns the exit status of the child process or -1 if an error has occurred. There is another routine that will wait for all the child processes initiated by @code{@ref{fl_exe_command()}} to complete @findex fl_end_all_command() @anchor{fl_end_all_command()} @example int fl_end_all_command(void) @end example @noindent The function returns the status of the last child process. You can also poll the status of a child process using the following routine @findex fl_check_command() @anchor{fl_check_command()} @example int fl_check_command(long pid); @end example @noindent where @code{pid} is the process ID returned by @code{@ref{fl_exe_command()}}. The function returns the following values: 0 if the child process is finished; 1 if the child process still exists (running or stopped) and -1 if an error has occurred inside the function. If some interaction with the command being executed is desired, the following functions may be more appropriate. These functions operates almost exactly as the @code{popen(3)} and @code{pclose(3)} functions: @findex fl_popen() @anchor{fl_popen()} @findex fl_pclose() @anchor{fl_pclose()} @example FILE *fl_popen(const char *command, const char *type); int fl_pclose(FILE *stream); @end example @noindent The @code{@ref{fl_popen()}} function executes the command in a child process, and logs the @code{stderr} messages into the command log. Further, if type is @code{"w"}, @code{stdout} will also be logged into the command browser. @code{@ref{fl_pclose()}} should be used to clean up the child process. To show or hide the logs of the command output, use the following functions @findex fl_show_command_log() @anchor{fl_show_command_log()} @findex fl_hide_command_log() @anchor{fl_hide_command_log()} @example int fl_show_command_log(int border); void fl_hide_command_log(void); @end example @noindent where @code{border} is the same as that used in @code{@ref{fl_show_form()}}. These two routines can be called anytime anywhere after @code{@ref{fl_initialize()}} has been invoked. The command log is by default placed at the top-right corner of the screen. To change the default placement, use the following routine @findex fl_set_command_log_position() @anchor{fl_set_command_log_position()} @example void fl_set_command_log_position(int x, int y); @end example @noindent where @code{x} and @code{y} are the coordinates of the upper-left corner of the form relative to the root window. The logging of the output is accumulative, i.e., @code{@ref{fl_exe_command()}} does not clear the browser. To clear the browser, use the following routine @findex fl_clear_command_log() @anchor{fl_clear_command_log()} @example void fl_clear_command_log(void); @end example It is possible to add arbitrary text to the command browser via the following routine @findex fl_addto_command_log() @anchor{fl_addto_command_log()} @findex fl_addto_command_log_f() @anchor{fl_addto_command_log_f()} @example void fl_addto_command_log(const char *txt); void fl_addto_command_log_f(const char *fmt, ...); @end example @noindent where @code{txt} for @code{fl_addto_command_log()} is a string and @code{fmt} for @code{fl_addto_command_log_f()} is a format string like for @code{printf()} that gets expanded using the following arguments. This string, with possible embedded newlines, gets added to the last line of the browser using @code{@ref{fl_addto_browser_chars()}}. Finally, there is a routine that can be used to obtain the GUI structure of the command browser @findex fl_get_command_log_fdstruct() @anchor{fl_get_command_log_fdstruct()} @example typedef struct @{ FL_FORM * form; /* the form */ FL_OBJECT * browser; /* the browser */ FL_OBJECT * close_browser; /* the close button */ FL_OBJECT * clear_browser; /* the clear button */ @} FD_CMDLOG; FD_CMDLOG *fl_get_command_log_fdstruct(void); @end example @noindent From the information returned the application program can change various attributes of the command browser and its associated objects. Note however, that you should not hide/show the form or free any members of the structure. @node Colormap @section Colormap In a number of applications the user has to select a color from the colormap. For this a goody has been created. It shows the first 64 entries of the colormap. The user can scroll through the colormap to see more entries. Once the user presses the mouse one of the entries the corresponding index is returned and the colormap is removed from the screen. To display the colormap use the routine @findex fl_show_colormap() @anchor{fl_show_colormap()} @example int fl_show_colormap(int oldcol); @end example @noindent @code{oldcol} should be the current or default color. The user can decide not to change this color by pressing the @code{Cancel} button in the form. The procedure returns the index of the color selected (or the index of the old color). @node Color Chooser @section Color Chooser It's also not uncommon that an application lets the user use an arbitrary color (not necessarily already in the colormap). The color chooser shows a form that allows the user to select a new color either using a HSV color wheel and a slider for the intensity or by entering HSV or RGB values directly. @ifhtml @center @image{xforms_images/colchooser} @end ifhtml @ifnothtml @center @image{xforms_images/colchooser,15cm} @end ifnothtml To show such a form call @findex fl_show_color_chooser() @anchor{fl_show_color_chooser()} @example int fl_show_color_chooser(const int *rgb_in, int * rgb_out); @end example @noindent The first argument is a pointer to an array with the 3 RGB values to use for the color to be displayed when the color chooser is shown. If it is @code{NULL} white is used. The second argument is another pointer to an array for the 3 RGB values of the selected color to be returned on success. On success the function returns 1 (and sets the @code{rgb_out} array), but if the user clicked on the "Cancel" button 0 gets returns (and the @code{rgb_out} array is not modified. Please keep in mind that there's no 1-to-1 mapping between the HSV and RGB color space, there are a lot more HSV than RGB triples and some colors don't even have a unique representation in HSV space like, for example, all shades of grey, including white and black. @node File Selector @section File Selector The most extended predefined form is the file selector. It provides an easy and interactive way to let the user select files. It is called as follows: @findex fl_show_fselector() @anchor{fl_show_fselector()} @example const char *fl_show_fselector(const char *message, const char *directory, const char *pattern, const char *default); @end example @noindent A form will be shown in which all files in directory @code{directory} are listed that satisfy the pattern @code{pattern} (see Fig 6.1). @code{pattern} can be any kind of regular expression, e.g., @code{[a-f]*.c}, which would list all files starting with a letter between @code{a} and @code{f} and ending with @code{.c}. @code{default} is the default file name. @code{message} is the message string placed at the top of the form. The user can choose a file from the list given and the function then returns a pointer to a static buffer that contains the filename selected, or @code{NULL} if the @code{Cancel} button is pressed (see below). The user can also walk through the directory structure, either by clicking on the box with the name of the currently displayed directory to edit it manually, or by double-clicking on the name of a directory (shown with a 'D' in front of it) shown in the list. If the directory content changes while it is being displayed in the file selector the @code{ReScan} button can be used to request a rescan of the directory. @ifhtml @center @image{xforms_images/fselect} @end ifhtml @ifnothtml @center @image{xforms_images/fselect,7cm} @end ifnothtml In a typical application, once the file selector goodie is shown, it is up to the user when the file selector should be dismissed by pushing @code{Ready} or @code{Cancel} button. In some situations the application may want to remove the file selector on it's own. To this end, the following routine is available @findex fl_hide_fselector() @anchor{fl_hide_fselector()} @example void fl_hide_fselector(void); @end example @noindent The effect of removing the file selector programmatically is the same as pushing the @code{Cancel} button. There are total of @tindex FL_MAX_FSELECTOR @code{FL_MAX_FSELECTOR} (6) file selectors in the Forms Library with each having its own current directory and content cache. All the file selector functions documented manipulate the currently active file selector, which can be set using the following routine @findex fl_use_fselector() @anchor{fl_use_fselector()} @example int fl_use_fselector(int n); @end example @noindent where @code{n} is a number between 0 and @code{FL_MAX_FSELECTOR - 1}. To change the font the file selector uses, the following routine can be used: @findex fl_set_fselector_fontsize() @anchor{fl_set_fselector_fontsize()} @findex fl_set_fselector_fontstyle() @anchor{fl_set_fselector_fontstyle()} @example void fl_set_fselector_fontsize(int font_size); void fl_set_fselector_fontstyle(int font_style); @end example @noindent These routines change the font for all the objects on the form. It is possible to change the font for some of the objects (e.g., browser only) using @code{@ref{fl_get_fselector_fdstruct()}} explained later. The window title of the file selector can be changed anytime using the following routine @findex fl_set_fselector_title() @anchor{fl_set_fselector_title()} @example void fl_set_fselector_title(const char *title); @end example To force an update programmatically, call @findex fl_invalidate_fselector_cache() @anchor{fl_invalidate_fselector_cache()} @example void fl_invalidate_fselector_cache(void); @end example @noindent before @code{@ref{fl_show_fselector()}}. Note that this call only forces an update once, and on the directory that is to be browsed. To disable caching altogether, the following routine can be used: @findex fl_disable_fselector_cache() @anchor{fl_disable_fselector_cache()} @example void fl_disable_fselector_cache(int yes); @end example @noindent A false (0) parameter (re)enables directory caching. The user can also change the pattern by clicking the mouse on top of it it. Note that directories are shown independent of whether they satisfy the pattern. He can also type in a file name directly. Complete keyboard navigation is built-in. E.g., you can use @code{d} to change the directory instead of using the mouse. When the user is satisfied, i.e., found the correct directory and indicated the file name required, he can press the button labeled @code{Ready} or press the @code{} key. He can also double click on the file name in the browser. The full path to the filename is returned by the procedure. If the user presses the @code{Cancel} button @code{NULL} is returned. It is also possible to set a callback routine so that whenever the user double clicks on a filename, instead of returning the filename, the callback routine is invoked with the filename as the argument. To set such a callback, use the following routine @findex fl_set_fselector_callback() @anchor{fl_set_fselector_callback()} @example void fl_set_fselector_callback(int (*callback)(const char *, void *), void *user_data); @end example @noindent where the second argument of the callback is the @code{user data}. The return value of the callback function is currently not used. Note that the behavior of the file selector is slightly different when a callback is present. Without the callback, a file selector is always modal. Please note that when a file selector has a callback installed the field for manually entering a file name isn't shown. The placement of the file selector is by default centered on the screen, which can be changed by the following routine @findex fl_set_fselector_placement() @anchor{fl_set_fselector_placement()} @example void fl_set_fselector_placement(int place); @end example @noindent where place is the placement request same as in @code{@ref{fl_show_form()}}. The default is @code{FL_PLACE_CENTER | FL_FREE_SIZE}. By default, an fselector is displayed with transient property set. To change the default, use the following routine @findex fl_set_fselector_border() @anchor{fl_set_fselector_border()} @example void fl_set_fselector_border(int border); @end example @noindent The @code{border} request by this function is the same as in @code{@ref{fl_show_form()}}, but @code{FL_NOBORDER} is ignored. If the arguments @code{directory}, @code{pattern} or @code{default} passed to @code{@ref{fl_show_form()}} are empty strings or @code{NULL}, the previous value is used (with some reasonable defaults getting used when this happens the first time). Thus the file selector "remembers" all the settings the selector had last time. The application program can figure out the directory, pattern and file name (without the path) after the user changed them using the routines @findex fl_get_directory() @anchor{fl_get_directory()} @findex fl_get_pattern() @anchor{fl_get_pattern()} @findex fl_get_filename() @anchor{fl_get_filename()} @example const char *fl_get_directory(void); const char *fl_get_pattern(void); const char *fl_get_filename(void); @end example It is also possible to programatically set new values for the default directory and pattern by using the functions @findex fl_set_directory() @anchor{fl_set_directory()} @findex fl_set_pattern() @anchor{fl_set_pattern()} @example int fl_set_directory( const char * dir ); void fl_set_pattern( const char * pattern ); @end example @noindent @code{@ref{fl_set_directory()}} returns 0 on success and 1 on failure, either because the argument was a @code{NULL} pointer or not a valid directory. There are other routines that make the fselector more flexible. The most important of which is the ability to accommodate up to three application specific button: @findex fl_add_fselector_appbutton() @anchor{fl_add_fselector_appbutton()} @example void fl_add_fselector_appbutton(const char *label, void (*callback)(void *), void *data); @end example @noindent The argument @code{data} is passed to the callback. Whenever this application specific button is pushed, the callback function is invoked. To remove an application specific button, use the following routine @findex fl_remove_fselector_appbutton() @anchor{fl_remove_fselector_appbutton()} @example void fl_remove_fselector_appbutton(const char *label); @end example Within the callback function, in addition to using the routines mentioned above, the following routines can be used: @findex fl_refresh_fselector() @anchor{fl_refresh_fselector()} @example void fl_refresh_fselector(void); @end example @noindent This function causes the file selector to re-scan the current directory and to list all entries in it. If, for whatever reasons, there is a need to get the fselector's form the following routine can be used: @findex fl_get_fselector_form() @anchor{fl_get_fselector_form()} @example FL_FORM *fl_get_fselector_form(void); @end example @noindent See @file{fbrowse.c} for the use of the file selector. Although discouraged, it is recognized that direct access to the individual objects of a fselector's form maybe necessary. To this end, the following routine exists @tindex FD_FSELECTOR @findex fl_get_fselector_fdstruct() @anchor{fl_get_fselector_fdstruct()} @example typedef struct @{ FL_FORM * fselect; void * vdata; char * cdata; long ldata; FL_OBJECT * browser, * input, * prompt, * resbutt; FL_OBJECT * patbutt, * dirbutt, * cancel, * ready; FL_OBJECT * dirlabel, * patlabel; FL_OBJECT * appbutt[3]; @} FD_FSELECTOR; FD_FSELECTOR *fl_get_fselector_fdstruct(void); @end example You can, for example, change the default label strings of various buttons via members of the @code{FD_FSELECTOR} structure: @example FD_FSELECTOR *fs = fl_get_fselector_fdstruct(); fl_set_object_label(fs->ready, "Go !"); fl_fit_object_label(fs->ready, 1, 1); @end example @noindent Since the return value of @code{@ref{fl_get_fselector_fdstruct()}} is a pointer to an internal structures, the members of this structure should not be modified. In the listing of files in a directory special files are marked with a prefix in the browser (for example, @code{D} for directories, @code{p} for pipes etc.). To change the prefix, use the following routine @findex fl_set_fselector_filetype_marker() @anchor{fl_set_fselector_filetype_marker()} @example void fl_set_fselector_filetype_marker(int dir, int fifo, int socket, int cdev, int bdev); @end example @noindent where @code{dir} is the marker character for directories, @code{fifo} the marker for pipes and FIFOs, @code{socket} the marker for sockets, @code{cdev} the marker for character device files and, finally, @code{bdev} the marker character for block device files. Although file systems under Unix are similar, they are not identical. In the implementation of the file selector, the subtle differences in directory structures are isolated and conditionally compiled so an apparent uniform interface to the underlying directory structure is achieved. To facilitate alternative implementations of file selectors, the following (internal) routines can be freely used: To get a directory listing, the following routine can be used @tindex FL_Dirlist @findex fl_get_dirlist() @anchor{fl_get_dirlist()} @example const FL_Dirlist *fl_get_dirlist(const char *dirname, const char *pattern, int *nfiles, int rescan); @end example @noindent where @code{dirname} is the directory name; @code{pattern} is a regular expression that is used to filter the directory entries; @code{nfiles} on return is the total number of entries in directory @code{dirname} that match the pattern specified by @code{pattern} (not exactly true, see below). The function returns the address of an array of type @code{FL_Dirlist} with @code{nfiles} if successful and @code{NULL} otherwise. By default, directory entries are cached. Passing the function a true (non-zero) value for the @code{rescan} argument requests a re-read. @code{FL_Dirlist} is a structure defined as follows @example typedef struct @{ char * name; /* file name */ int type; /* file type */ long dl_mtime; /* file modification time */ unsigned long dl_size; /* file size in bytes */ @} FL_Dirlist; @end example @noindent where @code{type} is one of the following file types @table @code @tindex FT_FILE @item FT_FILE a regular file @tindex FT_DIR @item FT_DIR a directory @tindex FT_SOCK @item FT_SOCK a socket @tindex FT_FIFO @item FT_FIFO a pipe or FIFO @tindex FT_LINK @item FT_LINK a symbolic link @tindex FT_BLK @item FT_BLK a block device @tindex FT_CHR @item FT_CHR a character device @item FT_OTHER ? @end table To free the list cache returned by @code{@ref{fl_get_dirlist()}}, use the following call @findex fl_free_dirlist() @anchor{fl_free_dirlist()} @example void fl_free_dirlist(FL_Dirlist *dl); @end example @noindent Note that a cast may be required to get rid of compiler warnings due to the @code{const} qualifier of the return value of @code{@ref{fl_get_dirlist()}}. See demo program @file{dirlist.c} for an example use of @code{@ref{fl_get_dirlist()}}. Per default not all types of files are returned by @code{@ref{fl_get_dirlist()}}. The specific rules for which types of file are returned are controlled by an additional filter after the pattern filter. It has the type @example int default_filter(const char *name, int type); @end example @noindent and is called for each entry found in the directory that matched the pattern. This filter function should return true (non-zero) if the entry is to be included in the directory list. The default filter is similar to the following @example int ffilter(const char *name, int type) @{ return type == FT_DIR || type == FT_FILE || type == FT_LINK; @} @end example @noindent i.e., per default only directories, normal files and symbolic links are shown (the first argument of the function, the file name, isn't used by the default filter). To change the default filter, use the following routine @tindex FL_DIRLIST_FILTER @findex fl_set_dirlist_filter() @anchor{fl_set_dirlist_filter()} @example typedef int (*FL_DIRLIST_FILTER)(const char *, int); FL_DIRLIST_FILTER fl_set_dirlist_filter(FL_DIRLIST_FILTER filter); @end example As noted before, directories are by default not subject to filtering. If, for any reason, it is desirable to filter also directories, use the following routine with a true flag @findex fl_set_dirlist_filterdir() @anchor{fl_set_dirlist_filterdir()} @example int fl_set_dirlist_filterdir(int flag); @end example @noindent The function returns the old setting. Since there is only one filter active at any time in XForms, changing the filter affects all subsequent uses of file browsers. By default, the files returned are sorted alphabetically. You can change the default sorting using the following routine: @findex fl_set_dirlist_sort() @anchor{fl_set_dirlist_sort()} @example int fl_set_dirlist_sort(int method); @end example @noindent where @code{method} can be one of the following @table @code @tindex FL_NONE @item FL_NONE Don't sort the entries @tindex FL_ALPHASORT @item FL_ALPHASORT Sort the entries in alphabetic order - this is the default @tindex FL_RALPHASORT @item FL_RALPHASORT Sort the entries in reverse alphabetic order @tindex FL_MTIMESORT @item FL_MTIMESORT Sort the entries according to the modification time @tindex FL_RMTIMESORT @item FL_RMTIMESORT Sort the entries according to the modification time, but reverse the order, i.e., latest first. @tindex FL_SIZESORT @item FL_SIZESORT Sort the entries in increasing size order @tindex FL_RSIZESORT @item FL_RSIZESORT Sort the entries in decreasing size order @tindex FL_CASEALPHASORT @item FL_CASEALPHASORT Sort the entries in alphabetic order with no regard to case @tindex FL_RCASEALPHASORT @item FL_RCASEALPHASORT Sort the entries in reverse alphabetic order with no regard to case. @end table The function returns the old sort method. For directories having large numbers of files, reading the directory can take quite a long time due to sorting and filtering. Electing not to sort and (to a lesser degree) not to filter the directory entries (by setting the filter to @code{NULL}) can speed up the directory reading considerably. xforms-1.2.4/doc/part1_defining_forms.texi0000664000175000017500000020361212353623325015527 00000000000000@node Part I Defining Forms @chapter Defining Forms In this chapter we will describe the basics of defining forms. Not all possible classes of objects are described here, only the most common ones. Also, for most classes only a subset of the available types are described. See Part III for a complete overview of all object classes currently available. Normally you will almost never have to write the code to define forms yourself because the package includes a Form Designer that does this for you (see Part II). Still it is useful to read through this chapter because it explains what some of the different object classes are and how to work with them. @ifnottex @menu * Starting and Ending a Form Definition:: * Boxes:: * Texts:: * Buttons:: * Sliders:: * ValSliders:: * Input Fields:: * Grouping Objects:: * Hiding and Showing:: * Deactivating and Triggering Objects:: * Changing Attributes:: * Adding and Removing Objects:: * Freeing Objects:: @end menu @end ifnottex @node Starting and Ending a Form Definition @section Starting and Ending a Form Definition A form consists of a collection of objects. A form definition is started with the routine @findex fl_bgn_form() @example FL_FORM *fl_bgn_form(int type, FL_Coord w, FL_Coord h); @end example @noindent @code{w} and @code{h} indicate the width and height of the form (in pixels by default). Positions in the form will be indicated by integers between 0 and @code{w-1} or @code{h-1}. The actual size of the form when displayed on the screen can still be varied. @code{type} indicates the type of the background drawn in the form. The background of each form is a box. See the next section for the different types available. The routine returns a pointer to the form just defined. This pointer must be used, for example, when drawing the form or doing interaction with it. The form definition ends with @findex fl_end_form() @example void fl_end_form(void); @end example @noindent Between these two calls objects are added to the form. The following sections describe some of the more common classes of objects that can be added to a form. there's no built-in upper limit on the number of forms that can be defined and displayed when required. Normally you probably will first define all your forms before starting the actual work but it's no problem to define new forms also later on. @node Boxes @section Boxes The probably simplest type of objects are boxes. Boxes are used to give the forms and objects a nicer appearance. They can be used to visually group other objects together. The background of each form is a box. To add a box to a form you use the routine @findex fl_add_box() @example FL_OBJECT *fl_add_box(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent where @code{type} indicates the shape of the box. The Forms Library at the moment supports the following types of boxes: @table @code @tindex FL_NO_BOX @item FL_NO_BOX No box at all (it's transparent), just a label @tindex FL_UP_BOX @item FL_UP_BOX A box that comes out of the screen @tindex FL_DOWN_BOX @item FL_DOWN_BOX A box that goes down into the screen @tindex FL_BORDER_BOX @item FL_BORDER_BOX A flat box with a border @tindex FL_SHADOW_BOX @item FL_SHADOW_BOX A flat box with a shadow @tindex FL_FRAME_BOX @item FL_FRAME_BOX A flat box with an engraved frame @tindex FL_ROUNDED_BOX @item FL_ROUNDED_BOX A rounded box @tindex FL_EMBOSSED_BOX @item FL_EMBOSSED_BOX A flat box with an embossed frame @tindex FL_FLAT_BOX @item FL_FLAT_BOX A flat box without a border (normally invisible unless given a different color than the surroundings) @tindex FL_RFLAT_BOX @item FL_RFLAT_BOX A rounded box without a border (normally invisible unless given a different color than the surroundings) @tindex FL_RSHADOW_BOX @item FL_RSHADOW_BOX A rounded box with a shadow @tindex FL_OVAL_BOX @item FL_OVAL_BOX A box shaped like an ellipse @tindex FL_ROUNDED3D_UPBOX @item FL_ROUNDED3D_UPBOX A rounded box coming out of the screen @tindex FL_ROUNDED3D_DOWNBOX @item FL_ROUNDED3D_DOWNBOX A rounded box going into the screen @tindex FL_OVAL3D_UPBOX @item FL_OVAL3D_UPBOX An oval box coming out of the screen @tindex FL_OVAL3D_DOWNBOX @item FL_OVAL3D_DOWNBOX An oval box going into the screen @end table @ifhtml @center @image{xforms_images/boxtypes} @end ifhtml @ifnothtml @center @image{xforms_images/boxtypes,15cm} @end ifnothtml The arguments @code{x} and @code{y} in the call of @code{@ref{fl_add_box()}}indicate the upper left corner of the box in the form while @code{w} and @code{h} are its width and height. @code{label} is a text that is placed in the center of the box. If you don't want a label in the box use an empty string or a @code{NULL} pointer. The label can be either one line or multiple lines. To obtain multi-line labels, insert newline characters (@code{\n}) in the label string. It is also possible to underline the label or one of the characters in the label. This is accomplished by embedding @code{ H} (@code{\010} or @code{'\b'}) after the letter that needs to be underlined. If the very first character of the label is @code{H}, the entire label is underlined. The routine @code{@ref{fl_add_box()}} returns a pointer to the box object. (All routines that add objects return a pointer to the object.) This pointer can be used for later references to the object. It is possible to change the appearance of a box in a form. First of all, it is possible to change the color of the box and secondly, it is possible to change color, size and position of the label inside the box. Details on changing attributes of objects can be found in @ref{Changing Attributes}. Just a simple example has to suffice here. Assume we want to create a red box, coming out of the screen with the large words "I am a Box" in green in the center: @example FL_OBJECT *thebox; thebox = fl_add_box(FL_UP_BOX, 20, 20, 100, 100, "I am a Box"); fl_set_object_color(thebox, FL_RED, 0 ); /* make box red */ fl_set_object_lcolor(thebox, FL_GREEN ); /* make label green */ fl_set_object_lsize(thebox, FL_LARGE_SIZE); /* make label large */ @end example @noindent Of course, this has to be placed inside a form definition (but the functions for changing the object attributes can also used anywhere else within the program). @node Texts @section Texts A second type of object is text. Text can be placed at any place on the form in any color you like. Placing a text object is done with the routine @findex fl_add_text() @example FL_OBJECT *fl_add_text(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent where @code{type} indicates the shape of the text. The Forms Library at the moment supports only one type of text: @code{FL_NORMAL_TEXT}. The text can be placed inside a box using the routine @code{@ref{fl_set_object_boxtype()}} to be described in @ref{Changing Attributes}. Again, the text can be multi-lined or underlined by embedding respectively the newline (@code{\n}) or @code{H} (@code{\010} or @code{'\b'}) in the label. The style, size and color of the text can be controlled and changed in many ways, @pxref{Label Attributes and Fonts}. Note that there is almost no difference between a box with a label and a text. The only difference lies in the position where the text is placed object. Text is normally placed inside the box at the left side. This helps you put different lines of text below each other. Labels inside boxes are by default centered in the box. You can change the position of the text inside the box using the routines in @ref{Label Attributes and Fonts}. Note that, when not using any box around the text there is no need to specify a width and height of the box, they can both be 0. @node Buttons @section Buttons A very important class of objects are buttons. Buttons are placed on the form such that the user can push them with the mouse. Different types of buttons exist: buttons that return to their normal position when the user releases the mouse, buttons that stay pushed until the user pushes them again and radio buttons that make other buttons be released. Adding a button to a form can be done using the following routine @findex fl_add_button() @example FL_OBJECT *fl_add_button(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent @code{label} is the text placed inside (or next to) the button. @code{type} indicates the type of the button. The Forms Library at the moment supports a number of types of buttons. The most important ones are: @tindex FL_NORMAL_BUTTON @tindex FL_PUSH_BUTTON @tindex FL_TOUCH_BUTTON @tindex FL_RADIO_BUTTON @example FL_NORMAL_BUTTON FL_PUSH_BUTTON FL_TOUCH_BUTTON FL_RADIO_BUTTON @end example @noindent They all look the same on the screen but their functions are quite different. Each of these buttons get pushed down when the user presses the mouse on top of them. What actually happens when the user does so depends on the type of button. A normal button returns to its normal position when the user releases the mouse button. A push button remains pushed and is only released when the user pushes it again. A touch button is like a normal button except that as long as the user keeps the mouse pressed it is returned to the application program (@pxref{Part I Doing Interaction, , Doing Interaction} on the details of interaction). A radio button is a push button with additional extra property: Whenever the user pushes a radio button, all other pushed radio buttons in the form (or at least in the group, see below) they belong to are released. In this way the user can make a choice among some mutually exclusive possibilities. Whenever the user pushes a button and then releases the mouse, the interaction routine @code{@ref{fl_do_forms()}} is interrupted and returns a pointer to the button that was pushed and released. If a callback routine is present for the object being pushed, this routine will be invoked. In either case, the application program knows that the button was pushed and can take action accordingly. In the first case, control will have to be returned to @code{@ref{fl_do_forms()}} again after the appropriate action is performed; and in the latter, @code{@ref{fl_do_forms()}} would never return. @xref{Part I Doing Interaction, , Doing Interaction}, for details on the interaction with forms. Different types of buttons are used in all the example programs provided. The application program can also set a button to appear pushed or not without user action. This is of course only useful for push buttons and radio buttons. To set or reset a push or radio button use the routine @findex fl_set_button() @example void fl_set_button(FL_OBJECT *obj, int pushed); @end example @noindent @code{pushed} indicates whether the button should appear to be pushed (1) or released (0). Note that this does not invoke a callback routine bound to the button or results in the button getting returned to the program, i.e., only the visual appearance of the button is changed and what it returns when asked for its state (and, in the case of a radio button, possibly that of another radio button in the same group). To also get the callback invoked or the button returned to the program additonally call e.g., @code{@ref{fl_trigger_object()}}. To figure out whether a button appears as pushed or not use @findex fl_get_button() @example int fl_get_button(FL_OBJECT *obj); @end example @noindent See the program @file{pushbutton.c} for an example of the use of push buttons and setting and getting button information. The color and label of buttons can again be changed using the routines in @ref{Changing Attributes}. There are other classes of buttons available that behave the same way as buttons but only look different. @table @asis @item Light buttons have a small "light" (colored area) in the button. Pushing the button switches the light on, and releasing the button switches it off. To add a light button use @code{@ref{fl_add_lightbutton()}} with the same parameters as for normal buttons. The other routines are exactly the same as for normal buttons. The color of the light can be controlled with the routine @code{@ref{fl_set_object_color()}}, @pxref{Changing Attributes}. @item Round buttons are buttons that are round. Use @code{@ref{fl_add_roundbutton()}} to add a round button to a form. @item Round3d buttons are buttons that are round and 3D-ish looking. Round and light buttons are nice as radio and push buttons. @item Check buttons are buttons that have a small checkbox the user can push. To add a check button, use @code{@ref{fl_add_checkbutton()}}. More stylish for a group of radio buttons. @item Bitmap buttons are buttons that have a bitmap on top of the box. Use routine @code{@ref{fl_add_bitmapbutton()}} to add a bitmap button to a form. @item Pixmap buttons are buttons that have a pixmap on top of the box. Use routine @code{@ref{fl_add_pixmapbutton()}} to add a pixmap button to a form. @end table Playing with different boxtypes, colors, etc., you can make many different types of buttons. See @file{buttonall.c} for some examples. Fig. 16.1 shows all buttons in their default states. @node Sliders @section Sliders Sliders are useful in letting the user indicate a value between some fixed bounds. A slider is added to a form using the routine @findex fl_add_slider() @example FL_OBJECT *fl_add_slider(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example The two most important types of sliders are @code{FL_VERT_SLIDERM} and @code{FL_HOR_SLIDER}. The former displays a slider that can be moved vertically and the latter gives a slider that moves horizontally. In both cases the label is placed below the slider. Default value of the slider is 0.5 and can vary between 0.0 and 1.0. These values can be changed using the routines: @findex fl_set_slider_value() @findex fl_set_slider_bounds() @example void fl_set_slider_value(FL_OBJECT *obj, double val); void fl_set_slider_bounds(FL_OBJECT *obj, double min, double max); @end example @noindent Whenever the value of the slider is changed by the user, it results in the slider being returned to the application program or the callback routine invoked. The program can read the slider value using the call @findex fl_get_slider_value() @example double fl_get_slider_value(FL_OBJECT *obj); @end example @noindent and take action accordingly. See the example program @file{demo05.c} for the use of these routines. @ifhtml @center @image{xforms_images/slider} @end ifhtml @ifnothtml @center @image{xforms_images/slider,8cm} @end ifnothtml @node ValSliders @section ValSliders A valslider is almost identical with a normal slider. The only difference is the way the slider is drawn. For valsliders, in addition to the slider itself, its current value is also shown. To add a valslider, use @findex fl_add_valslider() @example FL_OBJECT *fl_add_valslider(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example For all other interaction with a valslider the same function as for normal sliders can be used. @node Input Fields @section Input Fields It is often required to obtain textual input from the user, e.g., a file name, some fields in a database, etc. To this end input fields exist in the Forms Library. An input field is a field that can be edited by the user using the keyboard. To add an input field to a form use @findex fl_add_input() @example FL_OBJECT *fl_add_input(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent The main type of input field available is @code{FL_NORMAL_INPUT}. The input field normally looks like an @code{FL_DOWN_BOX}. This can be changed using the routine @code{@ref{fl_set_object_boxtype()}} to be described in @ref{Changing Attributes}. Whenever the user presses the mouse inside an input field a cursor will appear in it (and it will change color). Further input will appear inside this field. Full emacs(1) style editing is supported. When the user presses @code{} or @code{} the input field is returned to the application program and further input is directed to the next input field. (The @code{} key only works if there are no default buttons in the form. See the overview of object classes. The @code{} key always works.) @ifhtml @center @image{xforms_images/input} @end ifhtml @ifnothtml @center @image{xforms_images/input,8cm} @end ifnothtml The user can use the mouse to select parts of the input field which will be removed when the user types the erase character or replaced by any new input the user types in. Also the location of the cursor can be moved in the input field using the mouse. The input field is fully integrated with the X Selection mechanism. Use the left button to cut from and the middle button to paste into an input field. The application program can direct the focus to a particular object using the call @findex fl_set_focus_object() @example void fl_set_focus_object(FL_FORM *form, FL_OBJECT *obj); @end example @noindent It puts the input focus in the form form onto object @code{obj}. To obtain the focus object, the following routine is available @findex fl_get_focus_object() @example FL_OBJECT *fl_get_focus_object(FL_FORM *form); @end example Note that the label is not the default text in the input field. The label is (by default) placed in front of the input field. To set the contents of the input field use the routines @findex fl_set_input() @findex fl_set_input_f() @example void fl_set_input(FL_OBJECT *obj, const char *str); void fl_set_input_f(FL_OBJECT *obj, const char *fmt, ...); @end example To change the color of the input text or the cursor use @findex fl_set_input_color() @example void fl_set_input_color(FL_OBJECT *obj, int tcol, int ccol); @end example @noindent Here @code{tcol} indicates the color of the text and @code{ccol} is the color of the cursor. To obtain the string in the field (when the user has changed it) use: @findex fl_get_input() @example const char *fl_get_input(FL_OBJECT *obj); @end example See the program @file{demo06.c} for an example of the use of input fields. @node Grouping Objects @section Grouping Objects Objects inside a form definition can be grouped together. To this end we place them in between the routines @findex fl_bgn_group() @example FL_OBJECT *fl_bgn_group(void); @end example @noindent and @findex fl_end_group() @example void fl_end_group(void); @end example @noindent The first function returns a pointer to a pseudo-object that represents the start of the group (its class is @code{FL_BEGIN_GROUP}). It can be used in a number of functions to work on the whole group at once. Also the second creates a pseudo-object (of class @code{FL_END_GROUP}), marking the groups end, but since this object can't be used its address isn't returned. Groups can't be nested. Groups are useful for two reasons. First of all it is possible to hide groups of objects. (@pxref{Hiding and Showing} below.) This is often very handy. We can, for example, display part of a form only when the user asks for it (see demo program @file{group.c}. Some attributes are naturally multi-objects, e.g., to glue several objects together using the gravity attribute. Instead of setting the gravity for each object, you can place all related objects inside a group and set the resize/gravity attribute of the group. The second reason is for using radio buttons. As indicated in section 3.4 pushing a radio button makes the currently pushed radio button released. In fact, this happens only with radio buttons in the particular group. So to make two pairs (or more) of radio buttons, simply put each pair in a different group so that they won't interfere with each other. See, e.g., the example program @file{buttonall.c}. It is a good idea to always put radio buttons in a group, even if you have only one set of them. It is possible to add objects to an existing group @findex fl_addto_group() @example FL_OBJECT *fl_addto_group(FL_OBJECT *group); @end example @noindent where @code{group} is the object returned by @code{@ref{fl_bgn_group()}}. After this call, you can start adding objects to the group (e.g., @code{@ref{fl_add_button()}} etc.). The newly added objects are appended at the end of the group. When through with adding, use @code{@ref{fl_end_group()}} as before. @node Hiding and Showing @section Hiding and Showing It is possible to temporarily hide certain objects or groups of objects. To this end, use the routine @findex fl_hide_object() @example void fl_hide_object(FL_OBJECT *obj); @end example @noindent @code{obj} is the object to hide or the group of objects to hide. Hidden objects don't play any role anymore. All routines on the form act as if the object does not exist. To make the object or group of objects visible again use @findex fl_show_object() @example void fl_show_object(FL_OBJECT *obj); @end example @noindent Hiding and showing (groups of) objects are useful to change the appearance of a form depending on particular information provided by the user. You can also make overlapping groups in the form and take care that only one of them is visible. If you want to know if an object is shown you can use @findex fl_object_is_visible() @example int fl_object_is_visible(FL_OBJECT *obj); @end example @noindent Please note for an object to be visible also the form it belongs to must be shown, which isn't factored into the return value. @node Deactivating and Triggering Objects @section Deactivating and Triggering Objects Sometimes you might want a particular object to be temporarily inactive, e.g., you want to make it impossible for the user to press a particular button or to type input in a particular field. For this you can use the routine @findex fl_deactivate_object() @example void fl_deactivate_object(FL_OBJECT *obj); @end example @noindent @code{obj} is the object to be deactivated. When @code{obj} is a group the whole group is deactivated. To reactivate the group or button use the routine @findex fl_activate_object() @example void fl_activate_object(FL_OBJECT *obj); @end example To find out if an object is in active state use the function @findex fl_object_is_active() @example int fl_object_is_active(FL_OBJECT *obj); @end example Normally you also want to give the user a visual indication that the object is not active. This can, for example, be done by changing the label color to grey (see below). This is not done automatically, so unless you set e.g., a different color the objects appearance won't change on deactivation (or re-activation). It is possible to simulate the action of an object being triggered from within the program by using the following routine @findex fl_trigger_object() @example void fl_trigger_object(FL_OBJECT *obj); @end example @noindent Calling this routine on an object @code{obj} results in the object returned to the application program or its callback being called if it exists. Note however, there is no visual feedback, i.e., @code{fl_trigger_object(button)} will not make the button object named @code{button} appear to be pushed. @node Changing Attributes @section Changing Attributes There are a number of general routines that can be used to alter the appearance of any object. @ifnottex @menu * Color:: * Bounding Boxes:: * Label Attributes and Fonts:: * Tool Tips:: * Redrawing:: * Changing Many Attributes:: * Symbols:: @end menu @end ifnottex @node Color @subsection Color To change the color of a particular object use the routine @findex fl_set_object_color() @example void fl_set_object_color(FL_OBJECT *obj, FL_COLOR col1, FL_COLOR col2); @end example @noindent @code{col1} and @code{col2} are indices into a colormap. Which colors are actually changed depends on the type of the object. For box and text only @code{col1} is important. It indicates the color of the box or of the box in which the text is placed. For buttons, @code{col1} is the color of the button when released and @code{col2} is the color of the button when pushed. (Note that when changing the color of a button the nice property that the color of a button changes when the mouse moves over it disappears.) For light buttons the two colors indicate the color of the light when off and when on. For bitmap buttons, @code{col1} is the color of the box and @code{col2} is the color of the bitmap. For sliders @code{col1} is the color of the background of the slider and @code{col2} is the color of the slider itself. Finally, for input objects @code{col1} is the color of the input field when it is not selected and @code{col2} is the color when it has input focus, i.e., the user can enter text. For all types of objects, the default colors can be found in the file @file{forms.h}. For example, for input fields the default colors are @code{FL_INPUT_COL1} and @code{FL_INPUT_COL2}. Form Designer comes in very handy in familiarizing you with various attributes since you can change all attributes of an object and immediately see the difference by "test"ing the object. To find out the colors of an object use @findex fl_get_object_color() @example void fl_get_object_color(FL_OBJECT *obj, FL_COLOR *col1, FL_COLOR *col2); @end example The following pre-defined color symbols can be used in all color change requests. If the workstation does not support this many colors, substitution by the closest color will happen. @multitable @columnfractions 0.3 0.3 0.3 @headitem Name @tab RGB triple @tindex FL_BLACK @anchor{FL_BLACK} @item @code{FL_BLACK} @tab @code{( 0, 0, 0)} @ifhtml @tab @image{xforms_images/FL_BLACK} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_BLACK,2cm,5mm} @end ifnothtml @tindex FL_WHITE @anchor{FL_WHITE} @item @code{FL_WHITE} @tab @code{(255, 255, 255)}, @ifhtml @tab @image{xforms_images/FL_WHITE} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_WHITE,2cm,5mm} @end ifnothtml @tindex FL_COL1 @anchor{FL_COL1} @item @code{FL_COL1} @tab @code{(173, 173, 173)} @ifhtml @tab @image{xforms_images/FL_COL1} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_COL1,2cm,5mm} @end ifnothtml @tindex FL_BOTTOM_BCOL @anchor{FL_BOTTOM_BCOL} @item @code{FL_BOTTOM_BCOL} @tab @code{( 89, 89, 89)} @ifhtml @tab @image{xforms_images/FL_BOTTOM_BCOL} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_BOTTOM_BCOL,2cm,5mm} @end ifnothtml @tindex FL_RIGHT_BCOL @anchor{FL_RIGHT_BCOL} @item @code{FL_RIGHT_BCOL} @tab @code{( 41, 41, 41)} @ifhtml @tab @image{xforms_images/FL_RIGHT_BCOL} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_RIGHT_BCOL,2cm,5mm} @end ifnothtml @tindex FL_MCOL @anchor{FL_MCOL} @item @code{FL_MCOL} @tab @code{(191, 191, 191)} @ifhtml @tab @image{xforms_images/FL_MCOL} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_MCOL,2cm,5mm} @end ifnothtml @tindex FL_LEFT_BCOL @anchor{FL_LEFT_BCOL} @item @code{FL_LEFT_BCOL} @tab @code{(222, 222, 222)} @ifhtml @tab @image{xforms_images/FL_LEFT_BCOL} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_LEFT_BCOL,2cm,5mm} @end ifnothtml @tindex FL_LIGHTER_COL1 @anchor{FL_LIGHTER_COL1} @item @code{FL_LIGHTER_COL1} @tab @code{(204, 204, 204)} @ifhtml @tab @image{xforms_images/FL_LIGHTER_COL1} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_LIGHTER_COL1,2cm,5mm} @end ifnothtml @tindex FL_DARKER_COL1 @anchor{FL_DARKER_COL1} @item @code{FL_DARKER_COL1} @tab @code{(161, 161, 161)} @ifhtml @tab @image{xforms_images/FL_DARKER_COL1} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_DARKER_COL1,2cm,5mm} @end ifnothtml @tindex FL_SLATEBLUE @anchor{FL_SLATEBLUE} @item @code{FL_SLATEBLUE} @tab @code{(113, 113, 198)} @ifhtml @tab @image{xforms_images/FL_SLATEBLUE} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_SLATEBLUE,2cm,5mm} @end ifnothtml @tindex FL_INDIANRED @anchor{FL_INDIANRED} @item @code{FL_INDIANRED} @tab @code{(198, 113, 113)} @ifhtml @tab @image{xforms_images/FL_INDIANARED} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_INDIANARED,2cm,5mm} @end ifnothtml @tindex FL_RED @anchor{FL_RED} @item @code{FL_RED} @tab @code{(255, 0, 0)} @ifhtml @tab @image{xforms_images/FL_RED} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_RED,2cm,5mm} @end ifnothtml @tindex FL_BLUE @anchor{FL_BLUE} @item @code{FL_BLUE} @tab @code{( 0, 0, 255)} @ifhtml @tab @image{xforms_images/FL_BLUE} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_BLUE,2cm,5mm} @end ifnothtml @tindex FL_GREEN @anchor{FL_GREEN} @item @code{FL_GREEN} @tab @code{( 0, 255, 0)} @ifhtml @tab @image{xforms_images/FL_GREEN} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_GREEN,2cm,5mm} @end ifnothtml @tindex FL_YELLOW @anchor{FL_YELLOW} @item @code{FL_YELLOW} @tab @code{(255, 255, 0)} @ifhtml @tab @image{xforms_images/FL_YELLOW} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_YELLOW,2cm,5mm} @end ifnothtml @tindex FL_MAGENTA @anchor{FL_MAGENTA} @item @code{FL_MAGENTA} @tab @code{(255, 0, 255)} @ifhtml @tab @image{xforms_images/FL_MAGENTA} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_MAGENTA,2cm,5mm} @end ifnothtml @tindex FL_CYAN @anchor{FL_CYAN} @item @code{FL_CYAN} @tab @code{( 0, 255, 255)} @ifhtml @tab @image{xforms_images/FL_CYAN} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_CYAN,2cm,5mm} @end ifnothtml @tindex FL_TOMATO @anchor{FL_TOMATO} @item @code{FL_TOMATO} @tab @code{ 255, 99, 71} @ifhtml @tab @image{xforms_images/FL_TOMATO} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_TOMATO,2cm,5mm} @end ifnothtml @tindex FL_INACTIVE @anchor{FL_INACTIVE} @item @code{FL_INACTIVE} @tab @code{(110, 110, 110)} @ifhtml @tab @image{xforms_images/FL_INACTIVE} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_INACTIVE,2cm,5mm} @end ifnothtml @tindex FL_TOP_BCOL @anchor{FL_TOP_BCOL} @item @code{FL_TOP_BCOL} @tab @code{(204, 204, 204)} @ifhtml @tab @image{xforms_images/FL_TOP_BCOL} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_TOP_BCOL,2cm,5mm} @end ifnothtml @tindex FL_PALEGREEN @anchor{FL_PALEGREEN} @item @code{FL_PALEGREEN} @tab @code{(113, 198, 113)} @ifhtml @tab @image{xforms_images/FL_PALEGREEN} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_PALEGREEN,2cm,5mm} @end ifnothtml @tindex FL_DARKGOLD @anchor{FL_DARKGOLD} @item @code{FL_DARKGOLD} @tab @code{(205, 149, 10)} @ifhtml @tab @image{xforms_images/FL_DARKGOLD} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_DARKGOLD,2cm,5mm} @end ifnothtml @tindex FL_ORCHID @anchor{FL_ORCHID} @item @code{FL_ORCHID} @tab @code{(205, 105, 201)} @ifhtml @tab @image{xforms_images/FL_ORCHID} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_ORCHID,2cm,5mm} @end ifnothtml @tindex FL_DARKCYAN @anchor{FL_DARKCYAN} @item @code{FL_DARKCYAN} @tab @code{(40, 170, 175)} @ifhtml @tab @image{xforms_images/FL_DARKCYAN} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_DARKCYAN,2cm,5mm} @end ifnothtml @tindex FL_DARKTOMATO @anchor{FL_DARKTOMATO} @item @code{FL_DARKTOMATO} @tab @code{(139, 54, 38)} @ifhtml @tab @image{xforms_images/FL_DARKTOMATO} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_DARKTOMATO,2cm,5mm} @end ifnothtml @tindex FL_WHEAT @anchor{FL_WHEAT} @item @code{FL_WHEAT} @tab @code{(255, 231, 155)} @ifhtml @tab @image{xforms_images/FL_WHEAT} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_WHEAT,2cm,5mm} @end ifnothtml @tindex FL_DARKORANGE @anchor{FL_DARKORANGE} @item @code{FL_DARKORANGE} @tab @code{(255, 128, 0)} @ifhtml @tab @image{xforms_images/FL_DARKORANGE} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_DARKORANGE,2cm,5mm} @end ifnothtml @tindex FL_DEEPPINK @anchor{FL_DEEPPINK} @item @code{FL_DEEPPINK} @tab @code{(255, 0, 128)} @ifhtml @tab @image{xforms_images/FL_DARKPINK} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_DARKPINK,2cm,5mm} @end ifnothtml @tindex FL_CHARTREUSE @anchor{FL_CHARTREUSE} @item @code{FL_CHARTREUSE} @tab @code{(128, 255, 0)} @ifhtml @tab @image{xforms_images/FL_CHARTEUSE} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_CHARTEUSE,2cm,5mm} @end ifnothtml @tindex FL_DARKVIOLET @anchor{FL_DARKVIOLET} @item @code{FL_DARKVIOLET} @tab @code{(128, 0, 255)} @ifhtml @tab @image{xforms_images/FL_DARKVIOLET} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_DARKVIOLET,2cm,5mm} @end ifnothtml @tindex FL_SPRINGGREEN @anchor{FL_SPRINGGREEN} @item @code{FL_SPRINGGREEN} @tab @code{( 0, 255, 128)} @ifhtml @tab @image{xforms_images/FL_SPRINGGREEN} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_SPRINGGREEN,2cm,5mm} @end ifnothtml @tindex FL_DODGERBLUE @anchor{FL_DODGERBLUE} @item @code{FL_DODGERBLUE} @tab @code{( 0, 128, 255)} @ifhtml @tab @image{xforms_images/FL_DODGERBLUE} @end ifhtml @ifnothtml @tab @image{xforms_images/FL_DODGERBLUE,2cm,5mm} @end ifnothtml @tindex FL_FREE_COL1 @anchor{FL_FREE_COL1} @item @code{FL_FREE_COL1} @tab @code{( ?, ?, ?)} @end multitable Of all the colors listed in the table above @code{FL_FREE_COL1} has the largest numerical value, and all color with indices smaller than that are used (or can potentially be used) by the Forms Library although, if you wish, they can also be changed using the following routine prior to @code{@ref{fl_initialize()}}: @findex fl_set_icm_color() @example void fl_set_icm_color(FL_COLOR index, int r, int g, int b); @end example Note that although the color of an object is indicated by a single index, it is not necessarily true that the Forms Library is operating in PseudoColor. Forms Library is capable of operating in all visuals and as a matter of fact the Forms Library will always select TrueColor or DirectColor if the hardware is capable of it. The actual color is handled by an internal colormap of @tindex FL_MAX_COLORS @anchor{FL_MAX_COLORS} @code{FL_MAX_COLORS} entries (default is 1024). To change or query the values of this internal colormap use the call @findex fl_set_icm_color() @findex fl_get_icm_color() @example void fl_set_icm_color(FL_COLOR index, int r, int g, int b); void fl_get_icm_color(FL_COLOR index, int *r, int *g, int *b); @end example Call @code{@ref{fl_set_icm_color()}} before @code{@ref{fl_initialize()}} to change XForms's default colormap. Note that these two routines do not communicate with the X server, they only populate/return information about the internal colormap, which is made known to the X server by the initialization routine @code{@ref{fl_initialize()}}. To change the colormap and make a color index active so that it can be used in various drawing routines after @code{@ref{fl_initialize()}} initialization, use the following function @findex fl_mapcolor() @example unsigned long fl_mapcolor(FL_COLOR i, int red, int green, int blue); @end example @noindent This function frees the previous allocated pixel corresponding to color index @code{i} and re-allocates a pixel with the RGB value specified. The pixel value is returned by the function. It is recommended that you use an index larger than @code{FL_FREE_COL1} for your remap request to avoid accidentally freeing the colors you have not explicitly allocated. Indices larger than 224 are reserved and should not be used. Sometimes it may be more convenient to associate an index with a colorname, e.g., "red" etc., which may have been obtained via resources. To this end, the following routine exists @findex fl_mapcolorname() @example long fl_mapcolorname(FL_COLOR i, const char *name); @end example @noindent where @code{name} is the color name@footnote{Standard color names are listed in a file named @file{rgb.txt} and usually resides in @file{/usr/lib/X11/}}. The function returns -1 if the colorname name is not resolved. You can obtain the RGB values of an index by using the following routine @findex fl_getmcolor() @example unsigned long fl_getmcolor(FL_COLOR i, int *red, int *green, int *blue); @end example @noindent The function returns the pixel value as known by the Xserver. If the requested index, @code{i}, is never mapped or is freed, the RGB values as well as the pixel value are random. Since this function communicates with the Xserver to obtain the pixel information, it has a two-way traffic overhead. If you're only interested in the internal colormap of XForms, @code{@ref{fl_get_icm_color()}} is more efficient. Note that the current version only uses the lower byte of the primary color. Thus all primary colors in the above functions should be specified in the range of 0-255 inclusive. To free any colors that you no longer need, the following routine should be used @findex fl_free_colors() @example void fl_free_colors(FL_COLOR colors[], int ncolors); @end example Prior to XForms version 0.76, there is a color "leakage" in the implementation of the internal colormap that prevents the old index from being freed in the call @code{@ref{fl_mapcolor()}}, resulting in accelerated colormap overflow and some other undesirable behavior. Since there may still be some applications based on older versions of the Forms Library, a routine is provided to force the library to be compatible with the (buggy) behavior: @findex fl_set_color_leak() @anchor{fl_set_color_leak()} @example void fl_set_color_leak(int flag); @end example Due to the use of an internal colormap and the simplified user interface, changing the colormap value for the index may not result in a change of the color for the object. An actual redraw of the object (see below) whose color is changed may be required to have the change take effect. Therefore, a typical sequence of changing the color of a visible object is as follows: @example fl_mapcolor(newcol, red, green, blue); /* obj uses newcol */ fl_redraw_object(obj); @end example @node Bounding Boxes @subsection Bounding Boxes Each object has a bounding box. This bounding box can have different shapes. For boxes it is determined by the type. For text it is normally not visible. For input fields it normally is a @code{FL_DOWN_BOX}, etc. The shape of the box can be changed using the routine @example @findex fl_set_object_boxtype() void fl_set_object_boxtype(FL_OBJECT *obj, int boxtype); @end example @noindent @code{boxtype} should be one of the following: @code{FL_UP_BOX}, @code{FL_DOWN_BOX}, @code{FL_FLAT_BOX}, @code{FL_BORDER_BOX}, @code{FL_SHADOW_BOX}, @code{FL_ROUNDED_BOX}, @code{FL_RFLAT_BOX}, @code{FL_RSHADOW_BOX} and @code{FL_NO_BOX}, with the same meaning as the type for boxes. Some care has to be taken when changing boxtypes. In particular, for objects like sliders, input fields, etc. never use the boxtype @code{FL_NO_BOX}. Don't change the boxtype of objects that are visible on the screen. It might have undesirable effects. If you must do so, redraw the entire form after changing the boxtype of an object (see below). See the program @file{boxtype.c} for the effect of the boxtype on the different classes of objects. It is possible to alter the appearance of an object by changing the border width attribute @findex fl_set_object_bw() @example void fl_set_object_bw(FL_OBJECT *obj, int bw); @end example @noindent To find out about the current setting for the border width of an object call @findex fl_get_object_bw() @example int fl_get_object_bw(FL_OBJECT *obj); @end example Border width controls the "height" of an object, e.g., a button having a border width of 3 pixels appears more pronounced than one having a border width of 2. The Forms Library's default is @code{FL_BOUND_WIDTH} (1) pixels (before version 1.0.91 the default was 3). Note that the border width can be negative. Negative border width does not make a down box, rather, it makes the object having an upbox appear less pronounced and "softer". See program @file{borderwidth.c} for the effect of border width on different objects. All applications developed using XForms accept a command line option @samp{-bw}, followed by an integer number, the user can use to select the preferred border width. It is recommended that you document this flag in your application documentation. If you prefer a certain border width, use @code{@ref{fl_set_defaults()}} or @code{@ref{fl_set_border_width()}} before @code{@ref{fl_initialize()}} to set the border width instead of hard-coding it on a per form or per object basis so the user has the option to change it at run time via the @samp{-bw} flag. @ifhtml @center @image{xforms_images/borderwidth} @end ifhtml @ifnothtml @center @image{xforms_images/borderwidth,14cm} @end ifnothtml There also exists a call that changes the object border width for the entire application @findex fl_set_border_width() @example void fl_set_border_width(int border_width); @end example @node Label Attributes and Fonts @subsection Label Attributes and Fonts There are also a number of routines to change the appearance of the label. The first one is @findex fl_set_object_lcolor() @example void fl_set_object_lcolor(FL_OBJECT *obj, FL_COLOR lcol); @end example @noindent It sets the color of the label. The default is black (@code{FL_BLACK}). The font size of the label can be changed using the routine @findex fl_set_object_lsize() @example void fl_set_object_lsize(FL_OBJECT *obj, int lsize); @end example @noindent where @code{lsize} gives the size in points. Depending on the server and fonts installed, arbitrary sizes may or may not be possible. Fig 3.5 shows the font sizes that are standard with MIT/XConsortium distribution. So use of these values is encouraged. In any case, if a requested size can not be honored, substitution will be made. The default size for XForms is 10pt. @multitable @columnfractions 0.3 0.2 0.5 @anchor{FL_TINY_SIZE} @tindex FL_TINY_SIZE @item @code{FL_TINY_SIZE} @tab 8pt @anchor{FL_SMALL_SIZE} @tindex FL_SMALL_SIZE @item @code{FL_SMALL_SIZE} @tab 10pt @anchor{FL_NORMAL_SIZE} @tindex FL_NORMAL_SIZE @item @code{FL_NORMAL_SIZE} @tab 12pt @anchor{FL_MEDIUM_SIZE} @tindex FL_MEDIUM_SIZE @item @code{FL_MEDIUM_SIZE} @tab 14pt @anchor{FL_LARGE_SIZE} @tindex FL_LARGE_SIZE @item @code{FL_LARGE_SIZE} @tab 18pt @anchor{FL_HUGE_SIZE} @tindex FL_HUGE_SIZE @item @code{FL_HUGE_SIZE} @tab 24pt @end multitable @ifhtml @center @image{xforms_images/fontsize} @end ifhtml @ifnothtml @center @image{xforms_images/fontsize,6cm} @end ifnothtml Labels can be drawn in many different font styles. The style of the label can be controlled with the routine @findex fl_set_object_lstyle() @example void fl_set_object_lstyle(FL_OBJECT *obj, int lstyle); @end example @noindent The default font for the Forms Library is Helvetica at 10pt. Additional styles are available: @multitable @columnfractions 0.5 0.5 @anchor{FL_NORMAL_STYLE} @tindex FL_NORMAL_STYLE @item @code{FL_NORMAL_STYLE} @tab Normal text @anchor{FL_BOLD_STYLE} @tindex FL_BOLD_STYLE @item @code{FL_BOLD_STYLE} @tab Boldface text @anchor{FL_ITALIC_STYLE} @tindex FL_ITALIC_STYLE @item @code{FL_ITALIC_STYLE} @tab Guess what @anchor{FL_BOLDITALIC_STYLE} @tindex FL_BOLDITALIC_STYLE @item @code{FL_BOLDITALIC_STYLE} @tab BoldItalic @anchor{FL_FIXED_STYLE} @tindex FL_FIXED_STYLE @item @code{FL_FIXED_STYLE} @tab Fixed width (good for tables) @anchor{FL_FIXEDBOLD_STYLE} @tindex FL_FIXEDBOLD_STYLE @item @code{FL_FIXEDBOLD_STYLE} @tab @anchor{FL_FIXEDITALIC_STYLE} @tindex FL_FIXEDITALIC_STYLE @item @code{FL_FIXEDITALIC_STYLE} @tab @anchor{FL_FIXEDBOLDITALIC_STYLE} @tindex FL_FIXEDBOLDITALIC_STYLE @item @code{FL_FIXEDBOLDITALIC_STYLE} @tab @anchor{FL_TIMES_STYLE} @tindex FL_TIMES_STYLE @item @code{FL_TIMES_STYLE} @tab Times-Roman like font @anchor{FL_TIMESBOLD_STYLE FL} @tindex FL_TIMESBOLD_STYLE FL @item @code{FL_TIMESBOLD_STYLE FL} @tab @anchor{FL_TIMESITALIC_STYLE} @tindex FL_TIMESITALIC_STYLE @item @code{FL_TIMESITALIC_STYLE} @tab @anchor{FL_TIMESBOLDITALIC_STYLE} @tindex FL_TIMESBOLDITALIC_STYLE @item @code{FL_TIMESBOLDITALIC_STYLE} @tab @anchor{FL_SHADOW_STYLE} @tindex FL_SHADOW_STYLE @item @code{FL_SHADOW_STYLE} @tab Text casting a shadow @anchor{FL_ENGRAVED_STYLE} @tindex FL_ENGRAVED_STYLE @item @code{FL_ENGRAVED_STYLE} @tab Text engraved into the form @anchor{FL_EMBOSSED_STYLE} @tindex FL_EMBOSSED_STYLE @item @code{FL_EMBOSSED_STYLE} @tab Text standing out @end multitable The last three styles are special in that they are modifiers, i.e., they do not cause font changes themselves, they only modify the appearance of the font already active. E.g., to get a bold engraved text, set @code{lstyle} to @code{FL_BOLD_STYLE|FL_ENGRAVED_STYLE}. Other styles correspond to the first 12 fonts. The package, however, can handle up to 48 different fonts. The first 16 (numbers 0-15) have been pre-defined. The following table gives their names: @example 0 helvetica-medium-r 1 helvetica-bold-r 2 helvetica-medium-o 3 helvetica-bold-o 4 courier-medium-r 5 courier-bold-r 6 courier-medium-o 7 courier-bold-o 8 times-medium-r 9 times-bold-r 10 times-medium-o 11 times-bold-o 12 charter-medium-r 13 charter-bold-r 14 charter-medium-i 15 Symbol @end example The other 32 fonts (numbers 16-47) can be filled in by the application program. Actually, the application program can also change the first 16 fonts if required (e.g., to force a particular resolution). To change a font for the the entire application, use one of the following routines: @findex fl_set_font_name() @findex fl_set_font_name_f() @example int fl_set_font_name(int index, const char *name); int fl_set_font_name(int index, const char *fmt, ...); @end example The first form accepts just a simple string for the font name while the second assembles the name from a format string as it's used with @code{printf()} etc. and the following arguments. The first argument, @code{index}, is the number of the font (between 0 and @code{FL_MAXFONTS-1}) and the font name should be a valid font name (with the exception of the size field). If you are defining a completely different font family starting at index @code{k}, it's a good idea to define @code{k + FL_BOLD_STYLE} to be the corresponding bold font in the family , and @code{k + FL_ITALIC_STYLE} the corresponding italic font in the family (so object like browser can obtain correct style when switching font styles): @example #define Pretty 30 #define PrettyBold (Pretty + FL_BOLD_STYLE) #define PrettyItalic (Pretty + FL_ITALIC_STYLE) fl_set_font_name(Pretty, fontname); fl_set_font_name(PrettyBold, boldfontname); fl_set_font_name(PrettyItalic, italicfontname); ... fl_set_object_lstyle(obj, PrettyBold); @end example The function returns a negative value if the requested font is invalid or otherwise can't be loaded. Note however, if this routine is called before @code{@ref{fl_initialize()}}, it will return 0, but may fail later if the font name is not valid. To change the default font (helvetica-medium), a program should change font @code{FL_NORMAL_STYLE}. To get the name of a font at a certain index use @example @findex fl_get_font_name() @anchor{fl_get_font_name()} const char *fl_get_font_name(int index); @end example If a font name in XLFD is given, a question mark (@code{?}) in the point size position (i.e.; between the eighth and the nineth dash) informs the Forms Library that a scalable font should be requested later. It is preferable that the complete XLFD name (i.e., with 14 dashes and possibly wildcards) be given because a complete name has the advantage that the font may be re-scalable if scalable fonts are available. This means that although both @example "-*-helvetica-medium-r-*-*-*-?-*-*-*-*-*-*" "-*-helvetica-medium-r-*-*-*-?-*-*" @end example @noindent are valid font names, the first form may be re-scalable while the the second is not. To obtain the actual built-in font names, use the following function @findex fl_enumerate_fonts() @anchor{fl_enumerate_fonts()} @example int fl_enumerate_fonts(void (*cb)(const char *f), int shortform); @end example where @code{cb} is a callback function that gets called once for every built-in font name. The font name is passed to the callback function as the string pointer parameter while @code{shortform} selects if a short form of the name should be used. XForms only specifies the absolutely needed parts of the font names, and assumes the font path is set so that the server always chooses the most optimal fonts for the system. If this is not true, you can use @code{@ref{fl_set_font_name()}} or @code{@ref{fl_set_font_name_f()}} to select the exact font you want. In general, this is not recommended if your application is to be run/displayed on different servers. See @file{fonts.c} for a demonstration of all the built-in font styles available. You can change the alignment of the label with respect to the bounding box of the object. For this you should use the routine @findex fl_set_object_lalign() @example void fl_set_object_lalign(FL_OBJECT *obj, int align); @end example @noindent with the following values for the @code{align} argument: @multitable @columnfractions 0.3 0.7 @anchor{FL_ALIGN_LEFT} @tindex FL_ALIGN_LEFT @item @code{FL_ALIGN_LEFT} @tab To the left of the box. @anchor{FL_ALIGN_RIGHT} @tindex FL_ALIGN_RIGHT @item @code{FL_ALIGN_RIGHT} @tab To the right of the box. @anchor{FL_ALIGN_TOP} @tindex FL_ALIGN_TOP @item @code{FL_ALIGN_TOP} @tab To the top of the box. @anchor{FL_ALIGN_BOTTOM} @tindex FL_ALIGN_BOTTOM @item @code{FL_ALIGN_BOTTOM} @tab To the bottom of the box. @anchor{FL_ALIGN_CENTER} @tindex FL_ALIGN_CENTER @item @code{FL_ALIGN_CENTER} @tab In the middle of the box. @anchor{FL_ALIGN_RIGHT_BOTTOM} @tindex FL_ALIGN_RIGHT_BOTTOM @item @code{FL_ALIGN_RIGHT_BOTTOM} @tab To the right and bottom of the box. @anchor{FL_ALIGN_LEFT_BOTTOM} @tindex FL_ALIGN_LEFT_BOTTOM @item @code{FL_ALIGN_LEFT_BOTTOM} @tab To the left and bottom of the box. @anchor{FL_ALIGN_RIGHT_TOP} @tindex FL_ALIGN_RIGHT_TOP @item @code{FL_ALIGN_RIGHT_TOP} @tab To the right and top of the box. @anchor{FL_ALIGN_LEFT_TOP} @tindex FL_ALIGN_LEFT_TOP @item @code{FL_ALIGN_LEFT_TOP} @tab To the left and top of the box. @end multitable Alignment requests with the abpve constants place the text outside the box (except for @code{@ref{FL_ALIGN_CENTER}}). To get a value that can be used to align the label within the object the function @findex fl_to_inside_lalign() @anchor{fl_to_inside_lalign()} @example int fl_to_inside_lalign(int align); @end example @noindent can be used, which returns the necessary value for the corresponding inside alignment. Except for the case of @code{@ref{FL_ALIGN_CENTER}} (which is always inside the object) the result is the original value, logically or'ed with the constant @tindex FL_ALIGN_INSIDE @anchor{FL_ALIGN_INSIDE} . There's also a function for the reverse conversion, i.e., from a calue for inside to outside alignment @findex fl_to_outside_lalign() @anchor{fl_to_outside_lalign()} @example int fl_to_outside_lalign(int align); @end example @noindent Using this functions is a bit simpler than combining the value with the @code{@ref{FL_ALIGN_INSIDE}} constant, especially when it comes to @code{@ref{FL_ALIGN_CENTER}} (which doesn't has the this bit set, even though labels with this alignment will always be shown within the object. Both functions return @code{-1} if an invalid value for the alignment is passed to them. There exist also three functions to test for the inside or outside alignment: @findex fl_is_inside_lalign() @anchor{fl_is_inside_lalign()} @findex fl_is_outside_lalign() @anchor{fl_is_outside_lalign()} @findex fl_is_center_lalign() @anchor{fl_is_center_lalign()} @example int fl_is_inside_lalign(int align); int fl_is_outside_lalign(int align); int fl_is_center_lalign(int align); @end example @noindent Note that these functions return @code{0} also in the case that the alignment value passed to them is invalid. Not all objects accept all kinds of label alignment. For example for sliders, inputs etc. it doesn't make sense to have the label within the object und in these cases a request for an inside label is ignored (or, more precisely, converted to the corresponding request for an outside label or, on a request with @code{@ref{FL_ALIGN_CENTER}}, the reversion to the default label position). On the other hand, some objects like the text object (where the text to be shown is the label's text) accept only inside alignment and a request for an outside alignment will automatically replaced by the corresponding inside alignment. See also the demo program @file{lalign.c} for an example of the positioning of labels using the above constants. Finally, the routines @findex fl_set_object_label() @findex fl_set_object_label_f() @example void fl_set_object_label(FL_OBJECT *obj, const char *label); void fl_set_object_label_f(FL_OBJECT *obj, const char *fmt, ...); @end example change the label of a given object. Whilw the first function expects a simple string for the label. the second one accepts a format string with the same format specifiers as @code{printf()} etc., followed by as many additional arguments as there are format specifiers. An internal copy of the label for the object is made. As mentioned earlier, newline (@code{\n}) can be embedded in the label to generate multiple lines. By embedding @code{H} (@code{\010}) in the label, the entire label or one of the characters in the label can be underlined. The function @findex fl_get_object_label() @example const char * fl_get_object_label(FL_OBJECT *obj); @end example @noindent returns the label string. @node Tool Tips @subsection Tool Tips As will be seen later, an object can be decorated by icons instead of labels. For this kind of object, it is helpful to show a text string that explains the function the object controls under appropriate conditions. Forms Library elected to show the message after the mouse enters the object for about 600 milli-seconds. The text is removed when the mouse leaves the object or when the mouse is pressed. To set the text, use the following routines @findex fl_set_object_helper() @findex fl_set_object_helper_f() @example void fl_set_object_helper(FL_OBJECT *obj, const char *helpmsg); void fl_set_object_helper_f(FL_OBJECT *obj, const char *fmt, ...); @end example where @code{helpmsg} is a text string (with possible embedded newlines in it) that will be shown when the mouse enters the object, after about a 600 milli-second delay. The second form of the function accepts instead a format string like @code{printf()} etc., followed by the appropriate number of arguments. In both cases an internal copy of the string is made. The boxtype, color and font for the message display can be customized further using the following routines @findex fl_set_tooltip_boxtype() @findex fl_set_tooltip_color() @findex fl_set_tooltip_font() @findex fl_set_tooltip_lalign() @example void fl_set_tooltip_boxtype(int boxtype); void fl_set_tooltip_color(FL_COLOR textcolor, FL_COLOR background); void fl_set_tooltip_font(int style, int size); void fl_set_tooltip_lalign(int align); @end example @noindent where @code{boxtype} is the backface of the form that displays the text. The default is @code{FL_BORDER_BOX}. @code{textcolor} and @code{background} specify the colors of the text string and the backface. The defaults for these are @code{FL_BLACK} and @code{FL_YELLOW} respectively. The @code{style} and @code{size} parameters are the font style and size of the text. @code{align} is the alignment of the text string with respective to the box. The default is @code{FL_ALIGN_LEFT | FL_ALIGN_INSIDE} . @node Redrawing @subsection Redrawing Objects A word of caution is required. It is possible to change the attributes of an object at any time. But when the form is already displayed on the screen some care has to be taken. Whenever attributes change the system redraws the object. This is fine when drawing the object erases the old one but this is not always the case. For example, when placing labels outside the box (not using @code{FL_ALIGN_CENTER}) they are not correctly erased. It is always possible to force the system to redraw an object using @findex fl_redraw_object() @example void fl_redraw_object(FL_OBJECT *obj); @end example When the object is a group it redraws the complete group. To redraw an entire form, use @findex fl_redraw_form() @example void fl_redraw_form(FL_FORM *form); @end example Use of these routines is normally not necessary and should be kept to an absolute minimum. @node Changing Many Attributes @subsection Changing Many Attributes Whenever you change an attribute of an object in a visible form the object is redrawn immediately to make the change visible. This can be undesirable when you change a number of attributes of the same object. You only want the changed object to be drawn after the last change. Drawing it after each change will give a flickering effect on the screen. This gets even worse when you, for example, just want to hide a few objects. After each object you hide the entire form is redrawn. In addition to the flickering, it is also time consuming. Thus it is more efficient to tell the library to temporarily not redraw the form while changes are being made. This can be done by "freezing" the form. While a form is being frozen it is not redrawn, all changes made are instead buffered internally. Only when you unfreeze the form, all changes made in the meantime are drawn at once. For freezing and unfreezing two calls exist: @findex fl_freeze_form() @example void fl_freeze_form(FL_FORM *form); @end example @noindent and @findex fl_unfreeze_form() @example void fl_unfreeze_form(FL_FORM *form); @end example @noindent It is a good practice to place multiple changes to the contents of a form always between calls to these two procedures. Further, it is better to complete modifying the attributes of one object before starting work on the next. @node Symbols @subsection Symbols Rather than using text as a label it is possible to place symbols like an arrows etc.@: on objects. This is done in the following way: When the label starts with the character @code{@@} instead of the text a particular symbol is drawn@footnote{If you want a literal @code{@@} character as the first character of a label text, escape it with another @code{@@} character.}. The rest of the label string indicates the symbol. A number of pre-defined symbols are available: @multitable @columnfractions 0.2 0.8 @item @code{->} @tab Normal arrow pointing to the right. @item @code{<-} @tab Normal arrow pointing to the left. @item @code{>} @tab Triangular arrow pointing to the right. @item @code{<} @tab Triangular arrow pointing to the left. @item @code{>>} @tab Double triangle pointing to the right. @item @code{<<} @tab Double triangle pointing to the left. @item @code{<->} @tab Arrow pointing left and right. @item @code{->|} @tab A normal arrow with a bar at the end. @item @code{>|} @tab A triangular arrow with a bar at the end. @item @code{-->} @tab A thin arrow pointing to the right. @item @code{=} @tab Three embossed lines. @item @code{arrow} @tab Same as @code{-->}. @item @code{returnarrow} @tab @code{} key symbol. @item @code{square} @tab A square. @item @code{circle} @tab A circle. @item @code{line} @tab A horizontal line. @item @code{plus} @tab A plus sign (can be rotated to get a cross). @item @code{UpLine} @tab An embossed line. @item @code{DnLine} @tab An engraved line. @item @code{UpArrow} @tab An embossed arrow. @item @code{DnArrow} @tab An engraved arrow. @end multitable @noindent See Fig. 3.6 for how some of them look. It is possible to use the symbols in different orientations. When the symbol name is preceded by a digit @code{1}-@code{9} it is rotated like on the numerical keypad, i.e., @code{6} (and also @code{5}) result in no rotation, @code{9} a rotation of @w{45 degrees} counter-clockwise, @code{8} a rotation of @w{90 degrees}, etc. Hence the order is @code{6}, @code{9}, @code{8}, @code{7}, @code{4}, @code{1}, @code{2}, @code{3}. (Just think of the keypad as consisting of arrow keys with 6 pointing in the default orientation, i.e., to the right). So to get an arrow that is pointing to the left top use a label @code{@@7->}. To put the symbol in other orientations, put a 0 after the @code{@@}, followed by the angle (counter-clockwise). E.g., to draw an arrow at an angle of 30 degrees you can use @code{@@030->}. The symbol will be scaled to fit in the bounding box. When the bounding box is not square, scaling in the x- and y-directions will be different. If keeping the aspect ratio is desired, put a sharp (@code{#}) immediately after the @. E.g., @code{@@#9->}. Two additional prefixes, @code{+} and @code{-}, followed by a single digit, can be used to make small symbol size adjustment. A @code{+} indicates an increase of the symbol size while a @code{-} a decrease. The single digit following the prefix is the amount of increment (or decrement) in pixels. For example, to draw a square that is @w{3 pixels} smaller in size than the default size use @code{@@-3square}. If a single sequence of @code{+} or @code{-} and a single digit does not suffice, it can repeated, the effect is cumulative. Of course, this can also be combined with a rotation etc., so i.e., @code{@@-9-3030->} (the order in which the different sequences are used doesn't matter) will result in an arrow drawn @w{12 pixels} smaller than normal and rotated by @w{30 degrees} counter-clockwise. As already stated the "default" size of a symbol is (this at least holds for the built-in ones) one where it fits autoatically into the box it is to be drawn into, with a bit of room left around it. Thus the size of the symbol should in most cases be fine without any further fine-tuning. If you increase the size for whatever reasons please consider that the symbol automatically gets clipped to the area it is will be drawn into, i.e., increments that result in the symbol becoming larger than the box it is to be drawn into should be avoided. @ifhtml @center @image{xforms_images/symbols} @end ifhtml @ifnothtml @center @image{xforms_images/symbols} @end ifnothtml In addition to using symbols as object labels, symbols can also be drawn directly using @findex fl_draw_symbol() @anchor{fl_draw_symbol()} @example int fl_draw_symbol(const char *symbolname, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_Color col); @end example @noindent (the function returns @code{1} on success and @code{0} on failure when the symbol name isn't valid) or indirectly via @code{@ref{fl_draw_text()}}. Drawing is clipped automatically to the area given by the arguments. The application program can also add symbols to the system which it can then use to display symbols on objects that are not provided by the Forms Library. To add a symbol, use the call @findex fl_add_symbol() @anchor{fl_add_symbol()} @example int fl_add_symbol(const char *name, void (*drawit)(),int sc); @end example @noindent @code{name} is the name under which the symbol should be known, which may not have a @code{@@}, a @code{#} or a digit at the start (or @code{+} or @code{-}, directly followed by a digit). @code{drawit()} is the routine to be called for drawing the symbol. @code{sc} is reserved and currently has no meaning. Best set it to @code{0}. The routine @code{drawit()} should have the form @example void drawit(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle, FL_COLOR col); @end example @noindent @code{col} is the color in which to draw the symbol. This is the label color that can be provided and changed by the application program. The routine should draw the symbol centered inside the box by @code{x}, @code{y}, @code{w}, @code{h} and rotated from its natural position by @code{angle} degrees. The draw function can call all types of drawing routines, including @code{@ref{fl_draw_symbol()}}. Before it is called clipping is set to the area given by the first four arguments. If the new symbol name is the same as that of a built-in or of one previously defined, the new definition overrides the built-in or previously defined one. The function returns @code{1} on success and @code{0} on failure (due to invalid arguments). The symbol handling routines really should be viewed as a means of associating an arbitrary piece of text (the label) with arbitrary graphics, application of which can be quite pleasant given the right tasks. A symbol (built-in or previously defined) can also be deleted using @findex fl_delete_symbol() @anchor{fl_delete_symbol()} @example int fl_delete_symbol(const char *name); @end example @noindent On success @code{1} is returned, otherwise @code{0}. @node Adding and Removing Objects @section Adding and Removing Objects In some situations you might want to add objects to an already existing form (i.e., a form for which @code{@code{fl_end_form()}} has already been called. Reopening a form for the addition of further objects can be done by using the call @findex fl_addto_form() @example FL_FORM *fl_addto_form(FL_FORM *form); @end example @noindent After this call you can again add objects to the form with the usual functions for adding objects (like @code{@ref{fl_add_button()}} etc.). When done with adding objects to the form again call @code{@ref{fl_end_form()}}. It is possible to add objects to forms that are being displayed, but this is not always a good idea because not everything behaves well (e.g., strange things might happen when a group is started but not yet finished). To remove an object from a form simply use @findex fl_delete_object() @example void fl_delete_object(FL_OBJECT *obj); @end example @noindent It removes the object from the form it currently belongs to and also from a group it may belong to. The argument can also be the pseudo-object starting a group (i.e., the return value of @code{@ref{fl_bgn_group()}}) in which case the whole group of objects will be removed from the form. Contrary to what the name of the function may hint at the object itself isn't deleted but it remains available (except if it's an object that marks the start or end of a group) and thus it can be added again to the same or another form (without having to call @code{@ref{fl_addto_form()}} first and @code{@ref{fl_end_form()}} afterwards) using the function @findex fl_add_object() @example void fl_add_object(FL_FORM *form, FL_OBJECT *obj); @end example @noindent Normally, this function should only be used within object classes to add a newly created object to the form currently under construction. It can not be used for pseude-objects representing the start or end of a group. @node Freeing Objects @section Freeing Objects If the application program does not need an object anymore it can completely delete it, freeing all memory used for it, using a call of @findex fl_free_object() @example void fl_free_object(FL_OBJECT *obj); @end example @noindent After this the object is truely destroyed and can no longer be used. If you hadn't removed the object from the form it did belong to using @code{@ref{fl_delete_object()}} before this will be done automatically. To free the memory used by an entire form use a call of @findex fl_free_form() @example void fl_free_form(FL_FORM *form); @end example @noindent This will delete and free all the objects of the form and the form itself. A freed form can not be referenced anymore. xforms-1.2.4/doc/xforms.css0000664000175000017500000000025712254553226012566 00000000000000p {font-family:Tahoma,Verdana} code {font-family:monospace;font-weight:bold;color:#333} .example {margin:-0.15em 0 -0.3em 0;font-family:monospace;font-weight:bold;color:#333} xforms-1.2.4/doc/part5_resources.texi0000644000175000017500000002567611665175504014574 00000000000000@node Part V Resources for Forms Library @chapter Resources for Forms Library Managing resources is an important part of programming with X. Typical X programs use extensive resource database/management to customize their appearances. With the help of the Form Designer there is little or no need to specify any resources for the default appearance of an application written using the Forms Library. Because of this, complete resource support is a somewhat low-priority task and currently only minimal support is available. Nevertheless, more complete and useful resource management system specific to the Forms Library can be implemented using the services provided by the XForms. @ifnottex @menu * Current Support:: * Going Further:: @end menu @end ifnottex @node Current Support @section Current Support At the moment all built-in XForms resources have a top level class name @code{XForm} and a resource name @code{xform}. Because of this incomplete specification most of the current resources are "global", in the sense that they affect all form windows. Eventually all resources will be fully resolved, e.g., to specify attribute @code{foo} of form @code{formName}, the resource name can be @code{appName.formName.foo} instead of (the current incomplete) @code{appName.xform.foo}. The argument @code{app_opt} passed to @code{@ref{fl_initialize()}} is a table of structures listing your applications command line options. The structure is defined as follows @tindex FL_CMD_OPT @example typedef struct @{ char * option; char * specifier; XrmOptionKind argKind; void * value; @} XrmOptionDescList, FL_CMD_OPT; @end example @noindent See @code{XrmGetResource()} for details. After the initialization routine is called all command line arguments, both XForms built-in and application specific ones, are removed from @code{argc} and @code{argv} and parsed into a standard XResources database. To read your application specific options follow @code{@ref{fl_initialize()}} with the following routine @findex fl_get_app_resources() @anchor{fl_get_app_resources()} @example void fl_get_app_resources(FL_RESOURCE *resource, int nresources); @end example @noindent Here @code{resource} is a table containing application specific resources in the following format: @tindex FL_resource @example typedef struct @{ char * res_name; /* resource name without application name */ char * res_class; /* resource class */ FL_RTYPE type; /* C type of the variable */ void * var /* variable that will hold the value */ char * defval; /* default value in string form */ int nbytes; /* buffer size for string var. */ @} FL_RESOURCE; @end example @noindent and the resource type @code{FL_RTYPE} type is one of the following @tindex FL_RTYPE @anchor{FL_RTYPE} @table @code @tindex FL_SHORT @anchor{FL_SHORT} @item FL_SHORT for short variable @tindex FL_BOOL @anchor{FL_BOOL} @item FL_BOOL for boolean variable (int) @tindex FL_INT @anchor{FL_INT} @item FL_INT for int variable @tindex FL_LONG @anchor{FL_LONG} @item FL_LONG for long variable @tindex FL_FLOAT @anchor{FL_FLOAT} @item FL_FLOAT for float variable @tindex FL_FLOAT @tindex FL_STRING @anchor{FL_STRING} @item FL_STRING for char[] variable @tindex FL_FLOAT @anchor{FL_NONE} @item FL_NONE for variables not to be used (or not available) @end table Note that the variable for @code{FL_BOOL} must be of type int. It differs from @code{FL_INT} only in the way the resources are converted, not in the way their values are stored. A boolean variable is considered to be true (1) if any one of @code{True}, @code{true}, @code{Yes}, @code{yes}, @code{On}, @code{on}, or 1 is specified as its value. For string variables, the length for the destination buffer must be specified. @code{@ref{fl_get_app_resources()}} simply looks up all entries specified in the @code{FL_RESOURCE} structure in all databases after prefixing the resource name with the application name, which can be the new name introduced by the @code{-name} command line option. Summarized below are the currently recognized Forms Library built-in resources: @multitable @columnfractions 0.3 0.3 0.2 0.2 @headitem Resource Name @tab Class @tab Type @tab Default values @item rgamma @tab Gamma @tab float @tab 1.0 @item ggamma @tab Gamma @tab float @tab 1.0 @item bgamma @tab Gamma @tab float @tab 1.0 @item visual @tab Visual @tab string @tab best @item depth @tab Depth @tab int @tab best @item doubleBuffer @tab DoubleBuffer @tab bool @tab true @item privateColormap @tab PrivateColormap @tab bool @tab false @item standardColormap @tab StandardColormap @tab bool @tab false @item sharedColormap @tab SharedColormap @tab bool @tab false @item pupFontSize @tab PupFontSize @tab int @tab 12pt @item buttonFontSize @tab FontSize @tab int @tab 10pt @item sliderFontSize @tab FontSize @tab int @tab 10pt @item inputFontSize @tab FontSize @tab int @tab 10pt @item browserFontSize @tab FontSize @tab int @tab 10pt @item menuFontSize @tab FontSize @tab int @tab 10pt @item choiceFontSize @tab FontSize @tab int @tab 10pt @item ulPropWidth @tab ULPropWidth @tab bool @tab true @item ulThickness @tab ULThickness @tab int @tab 1 @item scrollbarType @tab ScrollbarType @tab string @tab thin @item coordUnit @tab CoordUnit @tab string @tab pixel @item borderWidth @tab BorderWidth @tab int @tab 1 @end multitable Again, "best" means that the Forms Library by default selects a visual that has the most depth. By default, resource files are read and merged in the order as suggested by X11 R5 as follows: @itemize @bullet @item @file{/usr/lib/X11/app-defaults/} @item @file{$XAPPRLESDIR/} @item @code{RESOURCE_MANAGER} property as set using @code{xrdb} if @code{RESOURCE_MANAGER} is empty, @file{~/.Xdefaults} @item @code{$XENVIRONMENT} if @code{$XENVIORONMENT} is empty, @file{~/.Xdefaults-hostname} @item ommand line options @end itemize All options set via resources may not be the final values used because resource settings are applied at the time an object/form is created, thus any modifications after that override the resource settings. For example @code{buttonLabelSize}, if set, is applied at the time the button is created (@code{@ref{fl_add_button()}}). Thus altering the size after the button is created via @code{@ref{fl_set_object_lsize()}} overrides whatever is set by the resource database. To run your application in @code{PseudoColor} with a depth of 8 and a thicker underline, specify the following resources @example appname*visual: PseudoColor appname*depth: 8 appname*ulThickness: 2 @end example Since resources on a form by form basis are yet to be implemented, there is no point specifying anything more specific although also @code{appname.XForm.depth} etc.@: would work correctly. @ifnottex @menu * Resources Example:: @end menu @end ifnottex @node Resources Example @subsection Resources Example Let us assume that you have an application named @code{myapp} and it accepts the options @w{@code{-foo} @emph{level}} and @code{-bar} plus a filename. The proper way to initialize the Forms Library is as follows @example FL_CMD_OPT cmdopt[] = @{ @{"-foo", "*.foo", XrmoptionSepArg, 0 @}, @{"-bar", ".bar", XrmoptionNoArg, "True"@} @}; int foolevel, ifbar; int deftrue; /* can only be set thru resources */ FL_resource res[] = @{ @{"foo", "FooCLASS", FL_INT, &foolevel, "0"@}, @{"bar", "BarCLASS", FL_BOOL, &ifbar, "0"@}, @{"deftrue", "Whatever", FL_BOOL, &deftrue, "1"@} @}; int main(int argc, char *argv[]) @{ fl_initialize(&argc, argv ,"MyappClass", cmdopt, 2); fl_get_app_resources(res, 3); if (argc == 1) /* missing filename */ fprintf(stderr, "Usage %s: [-foo level][-bar] " "filename\n","myapp"); /* rest of the program */ @} @end example @noindent After this both variables @code{foolevel} and @code{ifbar} are set either through resource files or command line options, with the command line options overriding those set in the resource files. In case neither the command line nor the resource files specified the options, the default value string is converted. There is another routine, a resource routine of the lowest level in XForms, which might be useful if a quick-and-dirty option needs to be read: @findex fl_get_resource() @anchor{fl_get_resource()} @example const char *fl_get_resource(const char *res_name, const char *res_class, FL_RTYPE type, char *defval, void *val, int nbytes); @end example @noindent @code{res_name} and @code{res_class} must be complete resource specifications (minus the application name) and should not contain wildcards of any kind. The resource will be converted according to the type and result stored in @code{type}, which is an integer of type @code{@ref{FL_RTYPE}}. @code{nbytes} is used only if the resource type is @code{@ref{FL_STRING}}. The function returns the string representation of the resource value. If a value of @code{@ref{FL_NONE}} is passed for @code{type} the resource is not converted and the pointer @code{val} is not dereferenced. There is also a routine that allows the application program to set resources programmatically: @findex fl_set_resource() @anchor{fl_set_resource()} @example void fl_set_resource(const char *string, const char *value); @end example @noindent where @code{string} and @code{value} are a resource-value pair. The string can be a fully qualified resource name (minus the application name) or a resource class. Routines @code{@ref{fl_set_resource()}} and @code{@ref{fl_get_resource()}} can be used to store and retrieve arbitrary strings and values and may be useful to pass data around. @node Going Further @section Going Further It is possible to implement your own form/object specific resources management system using the services mentioned above. For example, to implement a user-configurable form size, code similar to the following can be used, assuming the form is named @code{"myform"}: @example struct fsize @{ int width, height; @} myformsize; FL_RESOURCE res[] = @{ @{"myform.width", "XForm.width", FL_INT, &myform.width, "150"@}, @{"myform.height","XForm.height", FL_INT, &myform.height, "150"@} @}; fl_initialize(&argc, argv, app_class, 0, 0); fl_get_app_resources(res, 2); /* create the forms */ myform = fl_bgn_form(myformsize.width, myformsize.height,.....); @end example Or (more realistically) you create the form first using @code{fdesign} and then scale it before it is shown: @example fl_initialize(&argc, argv, app_class, 0, 0); fl_get_app_resources(res, 2); /*create_all_forms here */ fl_set_form_size(myform, mysformsize.width, myformsize.height); fl_show_form(myform, ...); @end example Since eventually form geometry and other things might be done via XForms internal routines it is recommended that you name your form to be the form title with all spaces removed and the first letter lower-cased, i.e., if a form is shown with a label @code{Foo Bar}, the name of the form should be @code{fooBar}. xforms-1.2.4/doc/part4_new_buttons.texi0000664000175000017500000003456312353623325015117 00000000000000@node Part IV New Buttons @chapter New Buttons Since button-like object is one of the most important, if not @emph{the} most important, classes in graphical user interfaces, Forms Library provides, in addition to the ones explained earlier, a few more routines that make create new buttons or button-like objects even easier. These routines take care of the communication between the main module and the button handler so all new button classes created using this scheme behave consistently. Within this scheme, the programmer only has to write a drawing function that draws the button. There is no need to handle events or messages from the main module and all types of buttons, radio, pushed or normal are completely taken care of by the generic button class. Further, @code{@ref{fl_get_button()}} and @code{@ref{fl_set_button()}} work automatically without adding any code for them. Forms Library provides two routines to facilitate the creation of new button object classes. One of the routines is @findex fl_create_generic_button() @anchor{fl_create_generic_button()} @example FL_OBJECT *fl_create_generic_button(int objclass, int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent which can be used to create a generic button that has all the properties of a real button except that this generic button does not know what the real button looks like. The other routine @code{@ref{fl_add_button_class()}}, discussed below, can be used to register a drawing routine that completes the creation of a new button. All button or button-like objects have the following instance-specific structure, defined in @file{forms.h}, that can be used to obtain information about the current status of the button: @tindex FL_BUTTON_STRUCT @example typedef struct @{ Pixmap pixmap; /* for bitmap/pixmap button only */ Pixmap mask; /* for bitmap/pixmap button only */ unsigned int bits_w, /* for bitmap/pixmap button only */ bits_h; int val; /* whether it's pushed */ int mousebut; /* mouse button that caused the push */ int timdel; /* time since last touch (TOUCH buttons)*/ int event; /* what event triggered the redraw */ long cspecl; /* for non-generic class specific data */ void * cspec; /* for non-generic class specific data */ char * file; /* filename for the pixmap/bitmap file */ @} FL_BUTTON_STRUCT; @end example Of all its members, only @code{val} and @code{mousebut} probably will be consulted by the drawing function. @code{cspecl} and @code{cspecv} are useful for keeping track of class status other than those supported by the generic button (e.g., you might want to add a third color to a button for whatever purposes.) These two members are neither referenced nor changed by the generic button class. Making this structure visible somewhat breaks the Forms Library's convention of hiding the instance specific data but the convenience and consistency gained by this far outweights the compromise on data hiding. The basic procedures in creating a new button-like object are as follows. First, just like creating any other object classes, you have to decide on a class ID, an integer between @code{FL_USER_CLASS_START} (1001) and @code{FL_USER_CLASS_END} (9999) inclusive. Then write a header file so that application programs can use this new class. The header file should include the class ID definition and function prototypes specific to this new class. After the header file is created, you will have to write C functions that create and draw the button. You also will need an interface routine to place the newly created button onto a form. After creating the generic button, the new button class should be made known to the button driver via the following function @findex fl_add_button_class() @anchor{fl_add_button_class()} @example void fl_add_button_class(int objclass, void (*draw)(FL_OBJECT *), void (*cleanup)(FL_BUTTON_SPEC *)); @end example @noindent where @code{objclass} is the class ID, and @code{draw} is a function that will be called to draw the button. @code{cleanup} is a function that will be called prior to destroying the button. You need a cleanup function only if the drawing routine uses the @code{cspecv} field of @code{FL_BUTTON_STRUCT} to hold memory allocated dynamically by the new button. We use two examples to show how new buttons are created. The first example is taken from the button class in the Forms Library, i.e., its real working source code that implements the button class. To illustrate the entire process of creating this class, let us call this button class @code{FL_NBUTTON}. First we create a header file to be included in an application program that uses this button class: @example #ifndef NBUTTON_H_ #define NBUTTON_H_ #define FL_NBUTTON FL_USER_CLASS_START extern FL_OBJECT *fl_create_nbutton(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char *); extern FL_OBJECT *fl_add_nbutton(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char *); #endif @end example Now to the drawing function. We use @code{obj->col1} for the normal color of the box and @code{obj->col2} for the color of the box when pushed. We also add an extra property so that when mouse moves over the button box, the box changes color. The following is the full source code that implements this: @example static void draw_nbutton(FL_OBJECT *obj) @{ FL_COLOR col; /* box color. If pushed we use obj->col2, otherwise use obj->col1 */ col = ((FL_BUTTON_STRUCT *) obj->spec)->val ? obj->col2 : obj->col1; /* if mouse is on top of the button, we change the color of * the button to a different color. However we only do this * if the * box has the default color. */ if (obj->belowmouse && col == FL_COL1) col = FL_MCOL; /* If original button is an up_box and it is being pushed, * we draw a down_box. Otherwise, don't have to change * the boxtype */ if ( obj->boxtype == FL_UP_BOX && ((FL_BUTTON_STRUCT *) obj->spec)->val) fl_draw_box(FL_DOWN_BOX, obj->x, obj->y, obj->w, obj->h, col, obj->bw); else fl_draw_box(obj->boxtype, obj->x, obj->y, obj->w, obj->h, col, obj->bw); /* draw the button label */ fl_draw_object_label(obj); /* if the button is a return button, draw the return symbol. * Note that size and style are 0 as they are not used when * drawing symbols */ if (obj->type == FL_RETURN_BUTTON) fl_draw_text(FL_ALIGN_CENTER, obj->x + obj->w - 0.8 * obj->h - 1, obj->y + 0.2 * obj->h, 0.6 * obj->h, 0.6 * obj->h, obj->lcol, 0, 0, "@@returnarrow"); @} @end example Note that when drawing symbols, the style and size are irrelevent and set to zero in @code{@ref{fl_draw_text()}} above. Since we don't use the @code{cspecv} field to point to dynamically allocated memory we don't have to write a clean-up function. Next, following the standard procedures of the Forms Library, we code a separate routine that creates the new button@footnote{A separate creation routine is useful for integration into the Form Designer.} @example FL_OBJECT *fl_create_nbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) @{ FL_OBJECT *obj; obj = fl_create_generic_button(FL_NBUTTON, type, x, y, w, h, label); fl_add_button_class(FL_NBUTTON, draw_nbutton, NULL); obj->col1 = FL_COL1; /* normal color */ obj->col2 = FL_MCOL; /* pushed color */ obj->align = FL_ALIGN_CENTER; /* button label placement */ return obj; @} @end example You will also need a routine that adds the newly created button to a form @example FL_OBJECT *fl_add_nbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) @{ FL_OBJECT *obj = fl_create_nbutton(type, x, y, w, h, label); fl_add_object(fl_current_form, obj); return obj; @} @end example This concludes the creation of button class @code{FL_NBUTTON}. The next example implements a button that might be added to the Forms Library in the future. We call this button a crossbutton. Normally, this button shows a small up box with a label on the right. When pushed, the up box becomes a down box and a small cross appears on top of it. This kind of button obviously is best used as a push button or a radio button. However, the Forms Library does not enforce this. It can be enforced, however, by the application program or by the object class developers. @ifhtml @center @image{xforms_images/crossbutton} @end ifhtml @ifnothtml @center @image{xforms_images/crossbutton,8cm} @end ifnothtml We choose to use @code{obj->col1} as the color of the box and @code{obj->col2} as the color of the cross (remember these two colors are changeable by the application program via @code{@ref{fl_set_object_color()}}). Note that this decision on color use is somewhat arbitrary, we could have easily made @code{obj->col2} the color of the button when pushed and use @code{obj->spec->cspecl} for the cross color (another routine named e.g., @code{fl_set_crossbutton_crosscol()} should be provided to change the cross color in this case). We start by defining the class ID and declaring the utility routine prototypes in the header file @file{crossbut.h}: @example #ifndef CROSSBUTTON_H_ #define CROSSBUTTON_H_ #define FL_CROSSBUTTON (FL_USER_CLASS_START + 2) extern FL_OBJECT *fl_add_crossbutton(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char *); extern FL_OBJECT *fl_create_crossbutton(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char *); #endif @end example Next we write the actual code that implements crossbutton class and put it into @file{crossbut.c}: @example /* routines implementing the "crossbutton" class */ #include #include "crossbut.h" /** How to draw it */ static void draw_crossbutton(FL_OBJECT *obj) @{ FL_Coord xx, yy, ww, hh; FL_BUTTON_STRUCT *sp = obj->spec; /* There is no visual change when mouse enters/leaves the box */ if (sp->event == FL_ENTER || sp->event == FL_LEAVE) return; /* draw the bounding box first */ fl_draw_box(obj->boxtype, obj->x, obj->y, obj->w, obj->h, obj->col1, obj->bw); /* Draw the box that contains the cross */ ww = hh = (0.5 * FL_min(obj->w, obj->h)) - 1; xx = obj->x + FL_abs(obj->bw); yy = obj->y + (obj->h - hh) / 2; /* If pushed, draw a down box with the cross */ if (sp->val) @{ fl_draw_box(FL_DOWN_BOX, xx, yy, ww, hh, obj->col1, obj->bw); fl_draw_text(FL_ALIGN_CENTER, xx - 2, yy - 2, ww + 4, hh + 4, obj->col2, 0, 0, "@@9plus"); @} else fl_draw_box(FL_UP_BOX, xx, yy, ww, hh, obj->col1, obj->bw); /* Draw the label */ if (obj->align == FL_ALIGN_CENTER) fl_draw_text(FL_ALIGN_LEFT, xx + ww + 2, obj->y, 0, obj->h, obj->lcol, obj->lstyle, obj->lsize, obj->label); else fl_draw_object_label_outside(obj); if (obj->type == FL_RETURN_BUTTON) fl_draw_text(FL_ALIGN_CENTER, obj->x + obj->w - 0.8 * obj->h, obj->y + 0.2 * obj->h, 0.6 * obj->h, 0.6 * obj->h, obj->lcol, 0, 0, "@@returnarrow"); @} @end example This button class is somewhat different from the normal button class (@code{FL_BUTTON}) in that we enforce the appearance of a crossbutton so that an un-pushed crossbutton always has an upbox and a pushed one always has a downbox. Note that the box that contains the cross is not the bounding box of a crossbutton although it can be if the drawing function is coded so. The rest of the code simply takes care of interfaces: @example /* creation routine */ FL_OBJECT * fl_create_crossbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) @{ FL_OBJECT *obj; fl_add_button_class(FL_CROSSBUTTON, draw_crossbutton, NULL); /* if you want to make cross button only available for * push or radio buttons, do it here as follows: if (type != FL_PUSH_BUTTON && type != FL_RADIO_BUTTON) type = FL_PUSH_BUTTON; */ obj = fl_create_generic_button(FL_CROSSBUTTON, type, x, y, w, h, label); obj->boxtype = FL_NO_BOX; obj->col2 = FL_BLACK; /* cross color */ return obj; @} /* interface routine to add a crossbutton to a form */ FL_OBJECT *fl_add_crossbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) @{ FL_OBJECT *obj = fl_create_crossbutton(type, x, y, w, h, label); fl_add_object(fl_current_form, obj); return obj; @} @end example The actual code is in the demo directory, see the files @file{crossbut.c} and @file{crossbut.h}. An application program only needs to include the header file @file{crossbut.h} and link with @file{crossbut.o} to use this new object class. There is no need to change or re-compile the Forms Library. Of course, if you really like the new object class, you can modify the system header file @file{forms.h} to include your new class header file automatically (either through inclusion at compile time or by including the actual header). You can also place the object file (@file{crossbut.o}) in @file{libforms.a} and @file{libforms.so} if you wish. Note however that this will make your application programs dependent on your personal version of the library. Since the current version of Form Designer does not support any new object classes developed as outlined above, the best approach is to use another object class as stubs when creating a form, for example, you might want to use checkbutton as stubs for the crossbutton. Once the position and size are satisfactory, generate the C-code and then manually change checkbutton to crossbutton. You probably can automate this with some scripts. Finally there is a demo program utilizing this new button class. The program is @file{newbutton.c}. xforms-1.2.4/doc/xforms.info-20000664000175000017500000111400712353624333013066 00000000000000This is xforms.info, produced by makeinfo version 4.13 from xforms.texi. INFO-DIR-SECTION Development START-INFO-DIR-ENTRY * XForms: (xforms). A Graphical user interface toolkit for X END-INFO-DIR-ENTRY  File: xforms.info, Node: Button Types, Next: Button Interaction, Prev: Adding Button Objects, Up: Part III Button-like Objects 16.2 Button Types ================= The following types of buttons are available: `FL_NORMAL_BUTTON' Returned to `*note fl_do_forms()::' (or having its callback funtion invoked) when released. `FL_PUSH_BUTTON' Stays pushed until user pushes it again. `FL_MENU_BUTTON' Returned when pushed, useful e.g., for opening a popup when pushed. `FL_TOUCH_BUTTON' Returned at regulat intervals as long as the user pushes it. `FL_RADIO_BUTTON' Push button that switches off other radio buttons. `FL_HIDDEN_BUTTON' Invisible normal button. `FL_INOUT_BUTTON' Returned both when pushed and when released. `FL_RETURN_BUTTON' Like a normal button but also reacts to the `' key. `FL_HIDDEN_RET_BUTTON' Invisible return button. Except for the `*note FL_HIDDEN_BUTTON::' and `*note FL_HIDDEN_RET_BUTTON::', which are invisible, there's not much visible indication of the button type but the function is quite different. For each of the types the button gets pushed down when the user presses the mouse on top of it. What actually happens when the user does so then depends on the type of the button. An `*note FL_NORMAL_BUTTON::', `*note FL_TOUCH_BUTTON::' and `*note FL_INOUT_BUTTON::' gets released when the user releases the mouse button. Their difference lies in the moment at which the interaction routines return them (see below). A `*note FL_PUSH_BUTTON::' remains pushed and is only released when the user pushes it again. A `*note FL_RADIO_BUTTON::' is a push button with the following extra property: whenever the user pushes a radio button, all other pushed radio buttons in the same form (or in the same group) are released. In this way the user can make its choice among several possibilities. A `*note FL_RETURN_BUTTON::' behaves like a normal button, but it also reacts when the `' key on the keyboard is pressed. When a form contains such a button (of course there can only be one) the `' key can no longer be used to move between input fields. For this the `' key must be used. A `*note FL_HIDDEN_BUTTON::' behaves like a normal button but is invisible. A `*note FL_HIDDEN_RET_BUTTON::' is like a hidden button but also reacts to `' key presses.  File: xforms.info, Node: Button Interaction, Next: Other Button Routines, Prev: Button Types, Up: Part III Button-like Objects 16.3 Button Interaction ======================= `*note FL_NORMAL_BUTTON::'s, `*note FL_PUSH_BUTTON::'s, `*note FL_RADIO_BUTTON::'s, `*note FL_RETURN_BUTTON::'s and `*note FL_HIDDEN_BUTTON::'s are returned at the moment the user releases the mouse after having pressed it on the button. A `*note FL_MENU_BUTTON::', in contrast, is returned already on a mouse press. A `*note FL_INOUT_BUTTON::' is returned both when the user presses it and when the user releases it. A `*note FL_TOUCH_BUTTON::' is returned all the time as long as the user keeps the mouse button pressed while the mouse is on top of it. A `*note FL_RETURN_BUTTON::' and a `*note FL_HIDDEN_RET_BUTTON::' are also returned when the user presses the `' key. As for other "active" objects, you can control under which conditions a button object gets returned or its callback invoked by using the function int fl_set_object_return(FL_OBJECT *obj, unsigned int when); where reasonable values for `when' are `*note FL_RETURN_NONE::' Never return object or invoke callback. `*note FL_RETURN_END_CHANGED::' Return object or invoke callback when mouse button is released and at the same moment the state of the button changed. `*note FL_RETURN_CHANGED::' Return object or invoke callback whenever the state of the button changes. `*note FL_RETURN_END::' Return object or invoke callback when mouse button is released `*note FL_RETURN_ALWAYS::' Return object or invoke callback on all of the above condtions. Most buttons will always return `*note FL_RETURN_END::' and `*note FL_RETURN_CHANGED::' at the same time. Exceptions are `*note FL_INOUT_BUTTON::'s and `*note FL_TOUCH_BUTTON::'s. The former returns `*note FL_RETURN_CHANGED::' when pushed and both `*note FL_RETURN_END::' and `*note FL_RETURN_CHANGED::' together when released. `*note FL_TOUCH_BUTTON::'s return when pressed, then `*note FL_RETURN_CHANGED::' at regular time intervals while being pressed and finally `*note FL_RETURN_END::' when released. See demo `butttypes.c' for a feel of the different button types.  File: xforms.info, Node: Other Button Routines, Next: Button Attributes, Prev: Button Interaction, Up: Part III Button-like Objects 16.4 Other Button Routines ========================== The application program can also set a button to be pushed or not itself without a user action. To this end use the routine void fl_set_button(FL_OBJECT *obj, int pushed); `pushed' indicates whether the button should be set to be pushed (1) or released (0). When setting a `*note FL_RADIO_BUTTON::' to be pushed this automatically releases the currently pushed radio button in the same form (or group). Also note that this routine only simulates the visual appearance but does not affect the program flow in any way, i.e., setting a button as being pushed does not invoke its callback or results in the button becoming returned to the program. For that follow up the call of `*note fl_set_button()::' with a call of `*note fl_trigger_object()::' (or `*note fl_call_object_callback()::'). To figure out whether a button is pushed or not use(1) int fl_get_button(FL_OBJECT *obj); Sometimes you want to give the button a different meaning depending on which mouse button gets pressed on it. To find out which mouse button was used at the last push (or release) use the routine int fl_get_button_numb(FL_OBJECT *obj); It returns one of the constants `*note FL_LEFT_MOUSE::', `*note FL_MIDDLE_MOUSE::', `*note FL_RIGHT_MOUSE::', `*note FL_SCROLLUP_MOUSE::' or `*note FL_SCROLLDOWN_MOUSE::' (the latter two are from the scroll wheel of the mouse). If the last push was triggered by a shortcut (see below), the function returns the `keysym' (ASCII value if the key used is between 0 and 127) of the key plus `*note FL_SHORTCUT::'. For example, if a button has `-C' as its shortcut the button number returned upon activation of the shortcut will be `FL_SHORTCUT + 3' (the ASCII value of `-C' is 3). It can also be controlled which mouse buttons a buttons reacts to (per default a button reacts to all mouse buttons, including the scroll wheel). To set which mouse buttons the button reacts to use void fl_set_button_mouse_buttons(FL_OBJECT *obj, int mbuttons); `mbuttons' is the bitwise OR of the numbers 1 for the left mouse button, 2 for the middle, 4 for the right mouse button, 8 for moving the scroll wheel up "button" and 16 for scrolling down "button". Per default a button reacts to all mouse buttons. To determine which mouse buttons a button is reacting to use void fl_get_button_mouse_buttons(FL_OBJECT *obj, unsigned int *mbuttons); The value returned via `mbuttons' is the same value as would be used in `*note fl_set_button_mouse_buttons()::'. In a number of situations it is useful to define a keyboard equivalent for a button. You might e.g., want to define that `Q' has the same meaning as pressing the "Quit" button. This can be achieved using the following call: void fl_set_button_shortcut(FL_OBJECT *obj, const char *str, int showUL); Note that `str' is a string, not a single character. This string is a list of all the characters to become keyboard shortcuts for the button. E.g., if you use string "^QQq" the button will react on the keys `q', `Q' and `Q'. (As you see you can use the symbol `^' to indicate the control key. Similarly you can use the symbol `#' to indicate the `' key.) Be careful with your choices. When the form also contains input fields you probably don't want to use the normal printable characters because they can no longer be used for input in the input fields. Shortcuts are always evaluated before input fields. Other special keys, such as `' etc., can also be used as shortcuts. *Note Shortcuts::, for details. Finally, keep in mind that a button of type `FL_RETURN_BUTTON' is in fact nothing more than a normal button, just with the `' key set as the shortcut. So don't change the shortcuts for such a button. If the third parameter `showUL' is true and one of the letters in the object label matches the shortcut the matching letter will be underlined. This applies to non-printable characters (such as `#A') as well in the sense that if the label contains the letter `a' or `A' it will be underlined (i.e., special characters such as `#' and `^' are ignored when matching). A false value (0) for `showUL' turns off underlining without affecting the shortcut. Note that although the entire object label is searched for matching character to underline of the shortcut string itself only the first (non-special) character is considered, thus a shortcut string of `"Yy"' for the label `"Yes"' will result in the letter `Y' becoming underlined while for `"yY"' it won't. To set the bitmap to use for a bitmap button the following functions can be used: void fl_set_bitmapbutton_data(FL_OBJECT *obj, int w, int h, unsigned char *bits); void fl_set_bitmapbutton_file(FL_OBJECT *obj, const char *filename); Similarly, to set the pixmap to use for a pixmap button the following routines can be used: void fl_set_pixmapbutton_data(FL_OBJECT *obj, unsigned char **bits); void fl_set_pixmapbutton_file(FL_OBJECT *obj, const char *file); void fl_set_pixmapbutton_pixmap(FL_OBJECT *obj, Pixmap id, Pixmap mask); To use the first routine, you `#include' the pixmap file into your source code and use the pixmap definition data (an array of char pointers) directly. For the second routine the filename `file' that contains the pixmap definition is used to specify the pixmap. The last routine assumes that you already have a X Pixmap resource ID for the pixmap you want to use. Note that these routines do not free a pixmap already associated with the button. To free the pixmaps use the function void fl_free_pixmapbutton_pixmap(FL_OBJECT *obj); This function frees the pixmap and mask together with all the colors allocated for them. To get the pixmap and mask that is currently being displayed, use the following routine Pixmap fl_get_pixmapbutton_pixmap(FL_OBJECT *obj, Pixmap &pixmap, Pixmap &mask); Pixmaps are by default displayed centered inside the bounding box. However, this can be changed using the following routine void fl_set_pixmapbutton_align(FL_OBJECT *obj, int align, int xmargin, int ymargin); where `align' is the same as that used for labels. *Note Label Attributes and Fonts::, for a list. `xmargin' and `ymargin' are extra margins to leave in addition to the object border width. Note that although you can place a pixmap outside of the bounding box, it probably is not a good idea. When the mouse enters a pixmap button an outline of the button is shown. If required, a different pixmap (the focus pixmap) can also be shown. To set such a focus pixmap the following functions are available: void fl_set_pixmapbutton_focus_data(FL_OBJECT *obj, unsigned char **bits); void fl_set_pixmapbutton_focus_file(FL_OBJECT *obj, const char *file); void fl_set_pixmapbutton_focus_pixmap(FL_OBJECT *obj, Pixmap id, Pixmap mask); The meanings of the parameters are the same as that in the regular pixmap routines. Finally, there's a function that can be used to enable or disable the focus outline void fl_set_pixmapbutton_focus_outline(FL_OBJECT *obj, int yes_no); See also *note Pixmap Object::, for pixmap color and transparency handling. To get rid of a focus pixmap of a pixmap button use the function void fl_free_pixmap_focus_pixmap(FL_OBJECT *obj); ---------- Footnotes ---------- (1) `*note fl_mouse_button()::' can also be used.  File: xforms.info, Node: Button Attributes, Next: Button Remarks, Prev: Other Button Routines, Up: Part III Button-like Objects 16.5 Button Attributes ====================== For normal buttons the first color argument (`col1') to `*note fl_set_object_color()::' controls the normal color and the second (`col2') the color the button has when pushed. For lightbuttons `col1' is the color of the light when off and `col2' the color when on. For round buttons, `col1' is the color of the circle and `col2' the color of the circle that is placed inside it when pushed. For round3dbutton, `col1' is the color of the inside of the circle and `col2' the color of the embedded circle. For bitmapbuttons, `col1' is the normal box color (or bitmap background if boxtype is not `FL_NO_BOX') and `col2' is used to indicate the focus color. The foreground color of the bitmap is controlled by label color (as set via `*note fl_set_object_lcolor()::'. For scrollbutton, `col1' is the overall boundbox color (if boxtype is not `FL_NO_BOX'), `col2' is the arrow color. The label of a scrollbutton must be a string with a number between 1 and 9 (except 5), indicating the arrow direction like on the numerical key pad. The label can have an optional prefix `#' to indicate uniform scaling. For example, the label `"#9"' tells that the arrow should be pointing up-right and the arrow has the identical width and height regardless the overall bounding box size.  File: xforms.info, Node: Button Remarks, Prev: Button Attributes, Up: Part III Button-like Objects 16.6 Remarks ============ See all demo programs, in particular `pushbutton.c' and `buttonall.c' for the use of buttons.  File: xforms.info, Node: Part III Valuator Objects, Next: Part III Input Objects, Prev: Part III Button-like Objects, Up: Top 17 Valuator Objects ******************* * Menu: * Slider Object: Slider Object * Scrollbar Object: Scrollbar Object * Dial Object: Dial Object * Positioner Object: Positioner Object * Counter Object: Counter Object * Spinner Object: Spinner Object * Thumbwheel Object: Thumbwheel Object  File: xforms.info, Node: Slider Object, Next: Scrollbar Object, Up: Part III Valuator Objects 17.1 Slider Object ================== Sliders are useful for letting the user indicate a value between some fixed bounds. Both horizontal and vertical sliders exist. They have a minimum, a maximum and a current value (all floating point values). The user can change the current value by shifting the slider with the mouse. Whenever the value changes, this is reported to the application program. * Menu: * Adding Slider Objects: Adding Slider Objects * Slider Types: Slider Types * Slider Interaction: Slider Interaction * Other Slider Routines: Other Slider Routines * Slider Attributes: Slider Attributes * Remarks: Slider Remarks  File: xforms.info, Node: Adding Slider Objects, Next: Slider Types, Up: Slider Object 17.1.1 Adding Slider Objects ---------------------------- Adding an object To add a slider to a form use FL_OBJECT *fl_add_slider(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); or FL_OBJECT *fl_add_valslider(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); The meaning of the parameters is as usual. The label is by default placed below the slider. The difference between a normal slider and a valslider is that for the second type its value is displayed above or to the left of the slider.  File: xforms.info, Node: Slider Types, Next: Slider Interaction, Prev: Adding Slider Objects, Up: Slider Object 17.1.2 Slider Types ------------------- The following types of sliders are available: `FL_VERT_SLIDER' A vertical slider. `FL_HOR_SLIDER' A horizontal slider. `FL_VERT_FILL_SLIDER' A vertical slider, filled from the bottom. `FL_HOR_FILL_SLIDER' A horizontal slider, filled from the left. `FL_VERT_NICE_SLIDER' A nice looking vertical slider. `FL_HOR_NICE_SLIDER' A nice looking horizontal slider. `FL_VERT_BROWSER_SLIDER' A different looking vertical slider. `FL_HOR_BROWSER_SLIDER' A different looking horizontal slider. `FL_VERT_PROGRESS_BAR' A vertical progress bar `FL_HOR_PROGRESS_BAR' A horizontal progress bar Please note that except for `*note FL_VERT_PROGRESS_BAR::' and `*note FL_HOR_PROGRESS_BAR::' the label will always drawn on the outside of the slider (even if you attempt to set an inside alignment). [image src="xforms_images/slidertypes.png"]  File: xforms.info, Node: Slider Interaction, Next: Other Slider Routines, Prev: Slider Types, Up: Slider Object 17.1.3 Slider Interaction ------------------------- Whenever the user changes the value of the slider using the mouse, the slider is returned (unless there's callback function associated with the object) by the interaction routines. The slider position is changed by moving the mouse inside the slider area. For fine control, hold down the `' key while usinf the slider, in that case the slider doesn't follow the mouse directly but at a lower speed. Please note: the `*note FL_VERT_PROGRESS_BAR::' and `*note FL_HOR_PROGRESS_BAR::' aren't actually valuator objects (they don't react to any user interaction) but are vor visualization only (i.e., showing a progress bar that is changed by the program only), they appear here because they are directly derived from the `*note FL_VERT_FILL_SLIDER::' and `*note FL_VERT_FILL_SLIDER::' slider. Thus the only way to change the value of objects of these types is by calling `*note fl_set_slider_value()::'! To obtain the correct "progress bar" behaviour you should also update the label accordingly. In some cases you might not want the slider to be returned or its callback called each time its value changes. To change the default, call the following routine: void fl_set_object_return(FL_OBJECT *obj, unsigned int when) where the parameter `when' can be one of the four values: `*note FL_RETURN_NONE::' Never return or invoke callback. `*note FL_RETURN_END_CHANGED::' Return or invoke callback at end (mouse release) if value is changed since last return. `*note FL_RETURN_CHANGED::' Return or invoke callback whenever the slider value is changed. This is the default. `*note FL_RETURN_END::' Return or invoke callback at end (mouse release) regardless if the value is changed or not. `*note FL_RETURN_ALWAYS::' Return or invoke callback when the value changed or at end (mouse release). See the demo program `objreturn.c' for an example use of this.  File: xforms.info, Node: Other Slider Routines, Next: Slider Attributes, Prev: Slider Interaction, Up: Slider Object 17.1.4 Other Slider Routines ---------------------------- To change the value and bounds of a slider use the following routines void fl_set_slider_value(FL_OBJECT *obj, double val); void fl_set_slider_bounds(FL_OBJECT *obj, double min, double max); By default, the minimum value for a slider is 0.0, the maximum is 1.0 and the value is 0.5. For vertical sliders the slider position for the minimum value is at the left, for horizontal sliders at the top of the slider. By setting `nin' to a larger value than `max' in a call of `*note fl_set_slider_bounds()::' this can be reversed. If in a call of `*note fl_set_slider_bounds()::' the actual value of a slider isn't within the range of the new bounds, its value gets adjusted to the nearest limit. When the requested new slider value in a call of `*note fl_set_slider_value()::' is outside the range of bounds it gets adjusted to the nearest boundary value. To obtain the current value or bounds of a slider use double fl_get_slider_value(FL_OBJECT *obj); void fl_get_slider_bounds(FL_OBJECT *obj, double *min, double *max); Per default a slider only reacts to the left mouse button. But sometimes it can be useful to modify this. To set this call void fl_set_slider_mouse_buttons(FL_OBJECT *obj, int mbuttons); `mbuttons' is the bitwise OR of the numbers 1 for the left mouse button, 2 for the middle and 4 for the right mouse button. To determine which mouse buttons a slider reacts to use void fl_get_slider_mouse_buttons(FL_OBJECT *obj, unsigned int *mbuttons); The value returned via `mbuttons' is the same value as would be used in `*note fl_set_slider_mouse_buttons()::'.  File: xforms.info, Node: Slider Attributes, Next: Slider Remarks, Prev: Other Slider Routines, Up: Slider Object 17.1.5 Slider Attributes ------------------------ Never use `FL_NO_BOX' as the boxtype for a slider. For `FL_VERT_NICE_SLIDER's and `FL_HOR_NICE_SLIDER's it's best to use a `FL_FLAT_BOX' in the color of the background to get the nicest effect. The first color argument (`col1') to `*note fl_set_object_color()::' controls the color of the background of the slider, the second (`col2') the color of the slider itself. You can control the size of the slider inside the box using the routine void fl_set_slider_size(FL_OBJECT *obj, double size); `size' should be a floating point value between 0.0 and 1.0. The default is `FL_SLIDER_WIDTH', which is 0.1 for regular sliders and 0.15 for browser sliders. With a value for `size' of 1.0, the slider covers the box completely and can no longer be moved. This function does nothing if applied to sliders of type `NICE_SLIDER' and `FILL_SLIDER'. To obtain the current setting of the slider size use double fl_get_slider_size(FL_OBJECT *obj); The routine void fl_set_slider_precision(FL_OBJECT *obj, int prec); sets the precision with which the value of the slider is shown. This only applies to sliders showing their value, i.e., valsliders. The argument must be between 0 and `FL_SLIDER_MAX_PREC' (currently set to 10). By default, the value shown by a valslider is the slider value in floating point format. You can override the default by registering a filter function using the following routine void fl_set_slider_filter(FL_OBJECT *obj, const char *(*filter)(FL_OBJECT *, double value, int prec)); where `value' and `prec' are the slider value and precision respectively. The filter function `filter' should return a string that is to be shown. The default filter is equivalent to the following const char *filter(FL_OBJECT *obj, double value, int prec) { static char buf[32]; sprintf(buf, "%.*f", prec, value); return buf; }  File: xforms.info, Node: Slider Remarks, Prev: Slider Attributes, Up: Slider Object 17.1.6 Remarks -------------- See the demo program `demo05.c' for an example of the use of sliders. See demo programs `sldsize.c' and `sliderall.c' for the effect of setting slider sizes and the different types of sliders.  File: xforms.info, Node: Scrollbar Object, Next: Dial Object, Prev: Slider Object, Up: Part III Valuator Objects 17.2 Scrollbar Object ===================== Scrollbars are similar to sliders (as a matter of fact, scrollbars are made with sliders and scrollbuttons) and alse let the user indicate a value between some fixed bounds. Both horizontal and vertical scrollbars exist. They have a minimum, maximum and current value (all floating point values). The user can change this value by dragging the sliding bar with the mouse or by pressing the scroll buttons. Per default whenever the value changes, it is reported to the application program via the callback function. * Menu: * Adding Scrollbar Objects: Adding Scrollbar Objects * Scrollbar Types: Scrollbar Types * Scrollbar Interaction: Scrollbar Interaction * Other Scrollbar Routines: Other Scrollbar Routines * Scrollbar Attributes: Scrollbar Attributes * Remarks: Scrollbar Remarks  File: xforms.info, Node: Adding Scrollbar Objects, Next: Scrollbar Types, Up: Scrollbar Object 17.2.1 Adding Scrollbar Objects ------------------------------- To add a scrollbar to a form use FL_OBJECT *fl_add_scrollbar(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); The meaning of the parameters is as usual. The label is by default placed below the scrollbar. [image src="xforms_images/scrollbars.png"]  File: xforms.info, Node: Scrollbar Types, Next: Scrollbar Interaction, Prev: Adding Scrollbar Objects, Up: Scrollbar Object 17.2.2 Scrollbar Types ---------------------- The following types of scrollbar are available: `FL_VERT_SCROLLBAR' A vertical scrollbar. `FL_HOR_SCROLLBAR' A horizontal scrollbar. `FL_VERT_THIN_SCROLLBAR' A different looking vertical scrollbar. `FL_HOR_THIN_SCROLLBAR' A different looking horizontal scrollbar. `FL_VERT_NICE_SCROLLBAR' A vertical scrollbar using `FL_NICE_SLIDER'. `FL_HOR_NICE_SCROLLBAR' A horizontal scrollbar using `FL_NICE_SLIDER'. `FL_VERT_PLAIN_SCROLLBAR' Similar to `FL_THIN_SCROLLBAR'. `FL_HOR_PLAIN_SCROLLBAR' Similar to `FL_HOR_THIN_SCROLLBAR'.  File: xforms.info, Node: Scrollbar Interaction, Next: Other Scrollbar Routines, Prev: Scrollbar Types, Up: Scrollbar Object 17.2.3 Scrollbar Interaction ---------------------------- Whenever the user changes the value of the scrollbar, the scrollbar's callback is called (if one is associated with the scrollbar). The scrollbar position can be changed in several ways. The most simple one is to left-click on the knob of the scrollbar and move the know while the left mouse button is kept pressed down. Left-clicking beside the know will move the knob in large steps toward the current position of the mouse, clicking with the middle or right mouse button in smaller steps. Small shifts can also be obtained by clicking on one of the buttons at the side of the scrollbar or by using the scroll-wheel somehwere over the scrollbar. You can control under which conditions the scrollbar gets returned to your application or its callback invoked. To change the default, call void fl_set_object_return(FL_OBJECT *obj, unsigned int when); where the parameter `when' can be one of the following four values: `*note FL_RETURN_NONE::' Never return or invoke callback. `*note FL_RETURN_END_CHANGED::' Return or invoke callback at end (mouse release) if value is changed (since last return). `*note FL_RETURN_CHANGED::' Return or invoke callback whenever the scrollbar value is changed. This is the default. `*note FL_RETURN_END::' Return or invoke callback at end (mouse release) regardless if the value is changed or not. `*note FL_RETURN_ALWAYS::' Return or invoke callback whenever value changed or mouse button was released. The default setting for `when' for a scrollbar object is `*note FL_RETURN_CHANGED::' (unless during the build of XForms you set the configuration flag `--enable-bwc-bs-hack' in which case the default is `*note FL_RETURN_NONE::' to keep backward compatibility with earlier releases of the library). See demo program `objreturn.c' for an example use of this.  File: xforms.info, Node: Other Scrollbar Routines, Next: Scrollbar Attributes, Prev: Scrollbar Interaction, Up: Scrollbar Object 17.2.4 Other Scrollbar Routines ------------------------------- To change the value and bounds of a scrollbar use the following routines: void fl_set_scrollbar_value(FL_OBJECT *obj, double val); void fl_set_scrollbar_bounds(FL_OBJECT *obj, double min, double max); By default, the minimum value for a slider is 0.0, the maximum is 1.0 and the value is 0.5. For vertical sliders the slider position for the minimum value is at the left, for horizontal sliders at the top of the slider. By setting `min' to a larger value than `max' in a call of `*note fl_set_scrollbar_bounds()::' this can be reversed. If in a call of `*note fl_set_scrollbar_bounds()::' the actual value of a scrollbar isn't within the range of the new bounds, its value gets adjusted to the nearest limit. When the requested new scrollbar value in a call of `*note fl_set_scrollbar_value()::' is outside the range of bounds it gets adjusted to the nearest boundary value. To obtain the current value and bounds of a scrollbar use double fl_get_scrollbar_value(FL_OBJECT *obj); void fl_get_scrollbar_bounds(FL_OBJECT *obj, double *min, double *max); By default, if the mouse is pressed beside the the sliding bar, the bar starts to jumps in the direction of the mouse position. You can use the following routine to change this size of the steps being made : void fl_set_scrollbar_increment(FL_OBJECT *obj, double lj, double rj); where `lj' indicates how much to increment if the left mouse button is pressed and `rj' indicates how much to jump if the middle mouse button pressed. For example, for the scrollbar in the browser class, the left mouse jump is made to be one page and middle mouse jump is made to be one line. The increment (decrement) value when the scrollbuttons are pressed is set to the value of the right jump. The default values for `lj' and `rj' are `0.1' and `0.02'. To obtain the current increment settings, use the following routine void fl_get_scrollbar_increment(FL_OBJECT *obj, double *lj, double *sj); With the function int fl_get_scrollbar_repeat(FL_OBJECT *obj); void fl_set_scrollbar_repeat(FL_OBJECT *obj, int millisec); you can determine and control the time delay (in milliseconds) between jumps of the knob when the mouse button is kept pressed down outside of the knobs area. The default value is 100 ms. The delay for the very first jump is twice that long in order to avoid jumping to start too soon when only a single click was intended but the user is a bit slow in releasing the mouse button.  File: xforms.info, Node: Scrollbar Attributes, Next: Scrollbar Remarks, Prev: Other Scrollbar Routines, Up: Scrollbar Object 17.2.5 Scrollbar Attributes --------------------------- Never use `FL_NO_BOX' as the boxtype for a scrollbar. For `FL_VERT_NICE_SCROLLBAR's and `FL_HOR_NICE_SCROLLBAR's it's best to use a `FL_FLAT_BOX' boxtype in the color of the background to get the nicest effect. The first color argument (`col1' to `*note fl_set_object_color()::' controls the color of the background of the scrollbar, the second (`col2') the color of the sliding bar itself. You can control the size of the sliding bar inside the box using the routine void fl_set_scrollbar_size(FL_OBJECT *obj, double size); `size' should be a value between 0.0 and 1.0. The default is `FL_SLIDER_WIDTH', which is 0.15 for all scrollbars With `size' set to 1.0, the scrollbar covers the box completely and can no longer be moved. This function does nothing if applied to scrollbars of type `FL_NICE_SCROLLBAR'. The function double fl_get_scrollbar_size(FL_OBJECT *obj); returns the current setting of the scrollbar size.  File: xforms.info, Node: Scrollbar Remarks, Prev: Scrollbar Attributes, Up: Scrollbar Object 17.2.6 Remarks -------------- See the demo program `scrollbar.c' for an example of the use of scrollbars.  File: xforms.info, Node: Dial Object, Next: Positioner Object, Prev: Scrollbar Object, Up: Part III Valuator Objects 17.3 Dial Object ================ Dial objects are dials that the user can put in a particular position using the mouse. They have a minimum, maximum and current value (all floating point values). The user can change this value by turning the dial with the mouse. Whenever the value changes, this is reported to the application program. * Menu: * Adding Dial Objects: Adding Dial Objects * Dial Types: Dial Types * Dial Interaction: Dial Interaction * Other Dial Routines: Other Dial Routines * Dial Attributes: Dial Attributes * Remarks: Dial Remarks  File: xforms.info, Node: Adding Dial Objects, Next: Dial Types, Up: Dial Object 17.3.1 Adding Dial Objects -------------------------- To add a dial to a form use FL_OBJECT *fl_add_dial(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); The meaning of the parameters is as usual. The label is by default placed below the dial.  File: xforms.info, Node: Dial Types, Next: Dial Interaction, Prev: Adding Dial Objects, Up: Dial Object 17.3.2 Dial Types ----------------- [image src="xforms_images/dials.png"] The following types of dials are available: `FL_NORMAL_DIAL' A dial with a knob indicating the position. `FL_LINE_DIAL' A dial with a line indicating the position. `FL_FILL_DIAL' The area between initial and current is filled.  File: xforms.info, Node: Dial Interaction, Next: Other Dial Routines, Prev: Dial Types, Up: Dial Object 17.3.3 Dial Interaction ----------------------- By default, the dial value is returned to the application when the user releases the mouse. It is possible to change this behavior using the following routine void fl_set_object_return(FL_OBJECT *obj, unsigned int when); where `when' can be one of the following `*note FL_RETURN_NONE::' Never report or invoke callback. `*note FL_RETURN_END_CHANGED::' Return or invoke callback at end (mouse release) and only if the dial value is changed. This is the default setting. `*note FL_RETURN_CHANGED::' Return or invoke callback whenever the dial value is changed. `*note FL_RETURN_END::' Return or invoke callback at the end regardless if the dial value is changed or not. `*note FL_RETURN_ALWAYS::' Return or invoke callback when value has changed or mouse button has been released.  File: xforms.info, Node: Other Dial Routines, Next: Dial Attributes, Prev: Dial Interaction, Up: Dial Object 17.3.4 Other Dial Routines -------------------------- To change the value of the dial and its bounds use void fl_set_dial_value(FL_OBJECT *obj, double val); void fl_set_dial_bounds(FL_OBJECT *obj, double min, double max); By default, the minimum value is 0.0, the maximum is 1.0 and the value is 0.5. To obtain the current values of the dial and its bounds use double fl_get_dial_value(FL_OBJECT *obj); void fl_get_dial_bounds(FL_OBJECT *obj, double *min, double *max); Sometimes, it might be desirable to limit the angular range a dial can take or choose an angle other than 0 to represent the minimum value. For this purpose, use the following routine void fl_set_dial_angles(FL_OBJECT *obj, double thetai, double thetaf) where `thetai' maps to the minimum value of the dial and `thetaf' to its maximum value. The angles are relative to the origin of the dial, which is by default at 6 o'clock and rotates clock-wise. By default, the minimum angle is 0 and the maximum angle is 360. To obtain the start and end angles use void fl_get_dial_angles(FL_OBJECT *obj, double *thetai, double *thetaf) By default, crossing from 359.9 to 0 or from 0 to 359.9 is not allowed. To allowing crossing over, use the following routine void fl_set_dial_crossover(FL_OBJECT *obj, int yes_no); where a true value for `yes_no' indicates that cross-over is allowed. In a number of situations you might want dial values to be rounded to some values, e.g., to integer values. To this end use the routine void fl_set_dial_step(FL_OBJECT *obj, double step); After this call dial values will be rounded to multiples of `step'. Use a value of 0.0 for `step' to switch off rounding. To get the current setting for the rounding steps use double fl_get_dial_step(FL_OBJECT *obj); By default, clock-wise rotation increases the dial value. To change, use the following routine void fl_set_dial_direction(FL_OBJECT *obj, int dir); where `dir' can be either `FL_DIAL_CCW' or `FL_DIAL_CW'. To obtain the direction use int fl_get_dial_direction(FL_OBJECT *obj);  File: xforms.info, Node: Dial Attributes, Next: Dial Remarks, Prev: Other Dial Routines, Up: Dial Object 17.3.5 Dial Attributes ---------------------- You can use any boxtype you like, but the final dial face always appears to be circular although certain correlation between the requested boxtype and actual boxtype exists (for example, `FL_FRAME_BOX' is translated into a circular frame box.) The first color argument (`col1' to `*note fl_set_object_color()::' controls the color of the background of the dial, the second `col2') the color of the knob or the line or the fill color.  File: xforms.info, Node: Dial Remarks, Prev: Dial Attributes, Up: Dial Object 17.3.6 Remarks -------------- The resolution of a dial is about 0.2 degrees, i.e., there are only about 2000 steps per 360 degrees and, depending on the size of the dial, it is typically less. The dial is always drawn with a circular box. If you specify a `FL_UP_BOX', a `FL_OVAL3D_UPBOX' will be used. See the demo programs `ldial.c', `ndial.c' and `fdial.c' for examples of the use of dials.  File: xforms.info, Node: Positioner Object, Next: Counter Object, Prev: Dial Object, Up: Part III Valuator Objects 17.4 Positioner Object ====================== A positioner is an object in which the user can indicate a position with an x- and a y-coordinate. It displays a box with a cross-hair cursor in it (except an invisble positioner, of course). Clicking the mouse inside the box changes the position of the cross-hair cursor and, hence, the x- and y-values. * Menu: * Adding Positioner Objects: Adding Positioner Objects * Positioner Types: Positioner Types * Positioner Interaction: Positioner Interaction * Other Positioner Routines: Other Positioner Routines * Positioner Attributes: Positioner Attributes * Remarks: Positioners Remarks  File: xforms.info, Node: Adding Positioner Objects, Next: Positioner Types, Up: Positioner Object 17.4.1 Adding Positioner Objects -------------------------------- A positioner can be added to a form using the call FL_OBJECT *fl_add_positioner(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); The meaning of the parameters is as usual. The label is placed below the box by default.  File: xforms.info, Node: Positioner Types, Next: Positioner Interaction, Prev: Adding Positioner Objects, Up: Positioner Object 17.4.2 Positioner Types ----------------------- The following types of positioner exist: `FL_NORMAL_POSITIONER' Cross-hair inside a box. `FL_OVERLAY_POSITIONER' Cross-hair inside a transparent box. `FL_INVISIBLE_POSITIONER' Completely invisible positioner, to be used just for the side effect of obtaining a position (typically an object is below below it that otherwise would receive user events). Note that for exatly positioning a `*note FL_OVERLAY_POSITIONER::' or `*note FL_INVISIBLE_POSITIONER::' over another object you have to take account of the (absolute value of the) border widths of both the underlying obkject and the positioner.  File: xforms.info, Node: Positioner Interaction, Next: Other Positioner Routines, Prev: Positioner Types, Up: Positioner Object 17.4.3 Positioner Interaction ----------------------------- The user changes the setting of the positioner using the mouse inside the box. Per default whenever the values changes, the object is returned by the interaction routines or its callback invoked (if one exists. To change the default use the function void fl_set_object_return(FL_OBJECT *obj, unsigned int when); where `when' can be one of the following `*note FL_RETURN_NONE::' Never report or invoke callback. `*note FL_RETURN_END_CHANGED::' Return or invoke callback at end (mouse release) and only when the positioner ended in a different position than the one it started from. `*note FL_RETURN_CHANGED::' Return or invoke callback whenever the positioners value is changed, default setting. `*note FL_RETURN_END::' Return or invoke callback at the end only but regardless if the positioners value changed or not. `*note FL_RETURN_ALWAYS::' Return or invoke callback when value has changed or mouse button has been released. Per default a positioner only reacts to the left mouse button. But sometimes it can be useful to modify which mouse buttons it will reacts to. To set this use void fl_set_positioner_mouse_buttons(FL_OBJECT *obj, int mbuttons); `mbuttons' is the bitwise OR of the numbers 1 for the left mouse button, 2 for the middle, 4 for the right mouse button, 8 for moving the scroll wheel up "button" and 16 for scrolling down "button". To determine which mouse buttons a positioner reacts to use void fl_get_positioner_mouse_buttons(FL_OBJECT *obj, unsigned int *mbuttons); The value returned via `mbuttons' is the same value as would be used in `*note fl_set_positioner_mouse_buttons()::'. Sometimes you may want to assign different meanings to the mouse buttons used to interact with the positioner. To find out which one has been used there's the function int fl_get_positioner_numb(FL_OBJECT *obj); It returns one of the constants `*note FL_LEFT_MOUSE::', `*note FL_MIDDLE_MOUSE::', `*note FL_RIGHT_MOUSE::', `*note FL_SCROLLUP_MOUSE::' or `*note FL_SCROLLDOWN_MOUSE::' (the latter two are from the scroll wheel of the mouse).  File: xforms.info, Node: Other Positioner Routines, Next: Positioner Attributes, Prev: Positioner Interaction, Up: Positioner Object 17.4.4 Other Positioner Routines -------------------------------- Usually, a positioner of type `*note FL_OVERLAY_POSITIONER::' is used on top if another object, e.g., a pixmap object. If the object below the positioner is changed, e.g., by setting a new pixmap for the pixmap object, tis may lead to visual artefacts since the postioner isn't aware of the changes of the underlying object. To avoid this call the function void fl_reset_positioner(FL_OBJECT *obj); before each change to an object below it. Per defauly the range that the `x' and `y' values of a positioner can assume are controlled via minimum and maximum values for both directions. These boundary values can be set by using the functions the routines: void fl_set_positioner_xbounds(FL_OBJECT *obj, double min, double max); int fl_set_positioner_ybounds(FL_OBJECT *obj, double min, double max); When a new positioner object is created the minimum values are 0.0 and the maximum values are 1.0. For boundaries in x-direction `min' and `max' should be taken to mean the left- and right-most position, respectively, and for the y-boundaries `min' and `max' should be taken to mean the value at the bottom and value at the top of the positioner, respectively. Note that the posituoners value may be changed automatically when setting new boundaries to make them satisfy the new conditions. For more complicated situations, i.e., when only a subset of the positioners value range may be used, a validation function can be installed (see the `positioner_overlay' demo program for an example): typedef int (*FL_POSITIONER_VALIDATOR (FL_OBJECT * obj, double x, double y, double *x_repl, double *y_repl); FL_POSITIONER_VALIDATOR fl_set_positioner_validator(FL_OBJECT * obj, FL_POSITIONER_VALIDATOR validator); If a non-`NULL' pointer is passed to the function each time a new position is set the validation function is invoked. It can return either `FL_POSITIONER_INVALID' to indicate that the new valuea aren't acceptable, in which case the position remains unchanged. It may also return `FL_POSITIONER_VALID' if the values are acceptable. Finally, the function may also return modified values via the `x_repl' and `y_repl' pointers and return `FL_POSITIONER_REPLACED'. In this case the values returned are used. It's the responsibility of the validation function to make sure that the `x' and `y' values satisfy the boundary restrictions etc. If it doesn't the results are unpredictable. To switch off validation pass the function a `NULL' pointer. The function returns a pointer to the previously active validation function (or `NULL' if non had been set). Note that if a new validation function is set it is immediately called to check that the current position is still compatible with the new requirements. If the validation function returns `*note FL_POSITIONER_INVALID::' in this case the position can't be corrected to fit the new conditions. Thus if you write your validation function in a way that it may return this value it is advisable to set compilant values for the positions before installing the validation function. To programatically change the `x' and `y' position use int fl_set_positioner_values(FL_OBJECT *obj, double xval, double yval); int fl_set_positioner_xvalue(FL_OBJECT *obj, double val); int fl_set_positioner_yvalue(FL_OBJECT *obj, double val); These functions return either `*note FL_POSITIONER_VALID::' if the new position was acceptable or `*note FL_POSITIONER_REPLACED::' if the value passed to the function had to be modified due to constraints imposed by the boundaries the step sizes or a validation routine. If a validation routine is set the functions also may return `*note FL_POSITIONER_INVALID::' if that routine returned this value. To obtain the current values of the positioner and the bounds use double fl_get_positioner_xvalue(FL_OBJECT *obj); double fl_get_positioner_yvalue(FL_OBJECT *obj); void fl_get_positioner_xbounds(FL_OBJECT *obj, double *min, double *max); void fl_get_positioner_ybounds(FL_OBJECT *obj, double *min, double *max); In a number of situations you might like positioner values to be rounded to some values, e.g., to integer values. To this end use the routines void fl_set_positioner_xstep(FL_OBJECT *obj, double step); void fl_set_positioner_ystep(FL_OBJECT *obj, double step); After these calls positioner values will be rounded to multiples of `step'. Use a value of 0 for `step' to switch off rounding. The functions void fl_get_positioner_xstep(FL_OBJECT *obj); void fl_get_positioner_ystep(FL_OBJECT *obj); return the current settings for the `x' and `y' step size. Sometimes, it makes more sense for a positioner to have an icon/pixmap as the background that represents a minified version of the area where the positioner's values apply. Type `FL_OVERLAY_POSITIONER' is specifically designed for this by drawing the moving cross-hair in XOR mode as not to erase the background. A typical creation procedure might look something like the following obj = fl_add_pixmap(FL_NORMAL_PIXMAP, x, y, w, h, label); fl_set_pixmap_file(obj, iconfile); pos = fl_add_positioner(FL_OVERLAY_POSITIONER, x, y, w, h, label); Of course, you can overlay this type of positioner on objects other than a pixmap. See the demo program `positionerXOR.c' for an example.  File: xforms.info, Node: Positioner Attributes, Next: Positioners Remarks, Prev: Other Positioner Routines, Up: Positioner Object 17.4.5 Positioner Attributes ---------------------------- Never use `FL_NO_BOX' as the boxtype for a positioner of type. `FL_NORMAL_POSITIONER' (but the other two types will have a box type of `FL_NO_BOX' per default). The first color argument (`col1') to `*note fl_set_object_color()::' controls the color of the box, the second (`col2') the color of the cross-hair.  File: xforms.info, Node: Positioners Remarks, Prev: Positioner Attributes, Up: Positioner Object 17.4.6 Remarks -------------- A demo can be found in `positioner.c'.  File: xforms.info, Node: Counter Object, Next: Spinner Object, Prev: Positioner Object, Up: Part III Valuator Objects 17.5 Counter Object =================== A counter provides a different mechanism for the user to select a value. In consists of a box displaying a value with one or two buttons on each side. The user can press these buttons to change the value (and while the mouse button is kept pressed down the value will continue to change, slow at first and faster after some time). If the counter has four buttons, the left- and right-most button make the value change in large steps, the other buttons make it change in small steps. * Menu: * Adding Counter Objects: Adding Counter Objects * Counter Types: Counter Types * Counter Interaction: Counter Interaction * Other Counter Routines: Other Counter Routines * Counter Attributes: Counter Attributes * Remarks: Counter Remarks  File: xforms.info, Node: Adding Counter Objects, Next: Counter Types, Up: Counter Object 17.5.1 Adding Counter Objects ----------------------------- To add a counter to a form use FL_OBJECT *fl_add_counter(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) The meaning of the parameters is as usual. The label is by default placed below the counter.  File: xforms.info, Node: Counter Types, Next: Counter Interaction, Prev: Adding Counter Objects, Up: Counter Object 17.5.2 Counter Types -------------------- [image src="xforms_images/counters.png"] The following types of counters are available: `FL_NORMAL_COUNTER' A counter with two buttons on each side. `FL_SIMPLE_COUNTER' A counter with one button on each side.  File: xforms.info, Node: Counter Interaction, Next: Other Counter Routines, Prev: Counter Types, Up: Counter Object 17.5.3 Counter Interaction -------------------------- The user changes the value of the counter by keeping his mouse pressed on one of the buttons. Per default whenever the mouse is released and the counter value is changed the counter is returned to the application program or its callback is invoked. In some applications you might want the counter to be returned to the application program (or the callback invoked) e.g., whenever the value changes and not only when the mouse is released. To this end use void fl_set_object_return(FL_OBJECT *obj, unsigned int when); where `when' can be either `*note FL_RETURN_NONE::' Never report or invoke callback. `*note FL_RETURN_END_CHANGED::' Return or invoke callback at end (mouse release) and only if the counter value is changed. `*note FL_RETURN_CHANGED::' Return or invoke callback whenever the counter value is changed. This is the default setting. `*note FL_RETURN_END::' Return or invoke callback at the end regardless if the counter value is changed or not. `*note FL_RETURN_ALWAYS::' Return or invoke callback when the counter value has changed or mouse button has been released.  File: xforms.info, Node: Other Counter Routines, Next: Counter Attributes, Prev: Counter Interaction, Up: Counter Object 17.5.4 Other Counter Routines ----------------------------- To change the value of the counter, it's bounds and stp size use the routines void fl_set_counter_value(FL_OBJECT *obj, double val); void fl_set_counter_bounds(FL_OBJECT *obj, double min, double max); void fl_set_counter_step(FL_OBJECT *obj, double small, double large); The first routine sets the value (default is 0) of the counter, the second routine sets the minimum and maximum values that the counter will take (default are -1000000 and 1000000, respectively) and the third routine sets the sizes of the small and large steps (defaults to 0.1 and 1). (For simple counters only the small step is used.) For conflicting settings, bounds take precedence over value, i.e., if setting a value that is outside of the current bounds, it is clamped. Also changing the bounds in a way that the current counter value isn't within the new bounds range anymore will result in its value being adjusted to the nearest of the new limits. To obtain the current value of the counter use double fl_get_counter_value(FL_OBJECT *obj); To obtain the current bounds and steps, use the following functions void fl_get_counter_bounds(FL_OBJECT *obj, double *min, double *max); void fl_get_counter_step(FL_OBJECT *obj, double *small, double *large); To set the precision (number of digits after the dot) with which the counter value is displayed use the routine void fl_set_counter_precision(FL_OBJECT *obj, int prec); To determine the current value of the precision use int fl_get_counter_precision(FL_OBJECT *obj); By default, the value shown is the counter value in floating point format. You can override the default by registering a filter function using the following routine void fl_set_counter_filter(FL_OBJECT *obj, const char *(*filter)(FL_OBJECT *, double value, int prec)); where `value' and `prec' are the counter value and precision respectively. The filter function `filter' should return a string that is to be shown. Note that the default filter is equivalent to the following const char *filter(FL_OBJECT *obj, double value, int prec) { static char buf[32]; sprintf(buf, "%.*f",prec,value); return buf; } By default the counter value changes first slowly and the rate of change then accelerates until a final speed is reached. The default delay between value changes is 600 ms at the start and the final delay is 50 ms. You can change the initial delay by a call of the function void fl_set_counter_repeat(FL_OBJECT *obj, int millisec); and the final delay by using void fl_set_counter_min_repeat(FL_OBJECT *obj, int millisec); where in both cases the argument `millisec' is the delay in milli-seconds. The current settings for the initial and final delay can be obtained by calling the functions int fl_get_counter_repeat(FL_OBJECT *obj); int fl_get_counter_min_repeat(FL_OBJECT *obj); Until version 1.0.91 of the library the delay between changes of a counter was constant (with a default value of 100 ms). To obtain this traditional behaviour simple set the initial and final delay to the same value. As a third alternative you can also request that only the first change of the counter has a different delay from all the following ones. To achieve this call void fl_set_counter_speedjump(FL_OBJECT *obj, int yes_no); with a true value for `yes_no'. The delay for the first change of the counter value will then be the one set by `*note fl_set_counter_repeat()::' and the following delays last as long as set by `*note fl_set_counter_min_repeat()::'. To determine the setting for "speedjumping" call int fl_get_counter_speedjump(FL_OBJECT *obj);  File: xforms.info, Node: Counter Attributes, Next: Counter Remarks, Prev: Other Counter Routines, Up: Counter Object 17.5.5 Counter Attributes ------------------------- Never use `FL_NO_BOX' as the boxtype for a counter. The first color argument (`col1') t `*note fl_set_object_color()::' controls the color of the background of the counter, the second (`col2') sets the color of the arrow buttons of the counter.  File: xforms.info, Node: Counter Remarks, Prev: Counter Attributes, Up: Counter Object 17.5.6 Remarks -------------- See demo program `counter.c' for an example of the use of counters.  File: xforms.info, Node: Spinner Object, Next: Thumbwheel Object, Prev: Counter Object, Up: Part III Valuator Objects 17.6 Spinner Object =================== A spinner object is a combination of a (numerical) input field with two (touch) buttons that allow to increment or decrement the value in the (editable) input field. I.e., the user can change the spinners value by either editing the value of the input field or by using the up/down buttons shown beside the input field. There are two types of spinner objects, one for integer and one for floating point values. You can set limits on the values that can be input and you can also set the amount of increment/decrement achieved when clicking on its buttons. * Menu: * Adding Spinner Objects: Adding Spinner Objects * Spinner Types: Spinner Types * Spinner Interaction: Spinner Interaction * Other Spinner Routines: Other Spinner Routines * Spinner Attributes: Spinner Attributes  File: xforms.info, Node: Adding Spinner Objects, Next: Spinner Types, Up: Spinner Object 17.6.1 Adding Spinner Objects ----------------------------- To add a spinner to a form use FL_OBJECT *fl_add_spinner(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); The meaning of the parameters is as usual. The label is by default placed on the left of the spinner object.  File: xforms.info, Node: Spinner Types, Next: Spinner Interaction, Prev: Adding Spinner Objects, Up: Spinner Object 17.6.2 Spinner Types -------------------- There are two types of spinners, one for input of integer and one for floating point values: `FL_INT_SPINNER' A spinner that allows input of integer values. `FL_FLOAT_SPINNER' A spinner that allows input of floating point values. The way a spinner looks like depends on its dimensions. If it's at least as wide as it's high the two buttons are drawn above each other to the right of the input field (and are marked with and up and down pointing triangle), while when the object is higher than it's wide they are drawn beside each other and below the input field (and the markers are then left and right pointing arrows).  File: xforms.info, Node: Spinner Interaction, Next: Other Spinner Routines, Prev: Spinner Types, Up: Spinner Object 17.6.3 Spinner Interaction -------------------------- The user can change the value of a spinner in two ways. She can either edit the value in the spinner directly (exactly the same as for an integer or floating point input object (*note Part III Input Objects::) or by clicking on one of the buttons that will increment or decrement the value. Per default the spinner object gets returned to the application (or the associated callback is called) whenever the value changed and the interaction seems to have ended. If you want it returned under different circumstances use the function void fl_set_object_return(FL_OBJECT *obj, unsigned int when); where the parameter `when' can be one of the four values `*note FL_RETURN_NONE::' Never return or invoke callback. `*note FL_RETURN_END_CHANGED::' Return or invoke callback at end of interaction (when either the input field loses the focus or one of the buttons was released) and the spinner's value changed during the interaction. `*note FL_RETURN_CHANGED::' Return or invoke callback whenever the spinner's value changed. This is the default. `*note FL_RETURN_END::' Return or invoke callback at end of interaction regardless of the spinner's value having changed or not. `*note FL_RETURN_ALWAYS::' Return or invoke callback whenever the value changed or the interaction ended.  File: xforms.info, Node: Other Spinner Routines, Next: Spinner Attributes, Prev: Spinner Interaction, Up: Spinner Object 17.6.4 Other Spinner Routines ----------------------------- Probably the most often used spinner functions are double fl_get_spinner_value(FL_OBJECT *obj ); double fl_set_spinner_value(FL_OBJECT *obj, double val); The first one returns the value of a spinner. The type of the return value is a double for both integer and floating point spinners, so you have to convert it for integer spinners appropriately, e.g: using the `FL_nint()' macro, that converts a double to the nearest integer value. You can set or retrieve the upper and lower limit the value a spinner can be set to using the functions void fl_set_spinner_bounds(FL_OBJECT *obj, double min, double max); void fl_get_spinner_bounds(FL_OBJECT *obj, double *min, double *max); Since this function is to be used for integer as well as floating point spinner objects the `double' type values must be converted as necessary for `*note FL_INT_SPINNER::'. The default limits are `-10000' and `10000', but can be set to up to `INT_MIN' and `INT_MIN' for `*note FL_INT_SPINNER::'s and `-DBL_MAX' and `DBL_MAX' for `*note FL_FLOAT_SPINNER::'s. To set or determine the step size by which a spinner will be incremented or decremented when one of the buttons is clicked on use void fl_set_spinner_step(FL_OBJECT *obj, double step); double fl_get_spinner_step(FL_OBJECT *obj); The default step size is `1' for both `*note FL_INT_SPINNER::' and `*note FL_FLOAT_SPINNER::' objects. For `*note FL_FLOAT_SPINNER::' objects you can set (or determine) how many digits after the decimal point are shown by using void fl_set_spinner_precision(FL_OBJECT *obj, int prec); int fl_get_spinner_precision(FL_OBJECT *obj); This is per default set to 6 digits after the decimal point. The function for setting the precision has no effect on `*note FL_INT_SPINNER::' objects and the other one returns 0 for this type of spinners.  File: xforms.info, Node: Spinner Attributes, Prev: Other Spinner Routines, Up: Spinner Object 17.6.5 Spinner Attributes ------------------------- Please don't change the boxtype from `*note FL_NO_BOX::'. The label color and font can be set using the normal `*note fl_set_object_lcolor()::', `*note fl_set_object_lsize()::' and `*note fl_set_object_lstyle()::' functions. The color of the input field of a spinner object can be set via using `*note fl_set_object_color()::' where the first color argument (`col1') controls the color of the input field when it is not selected and the second (`col2') is the color when selected. Instead of creating a plethora of functions to influence all the other aspects of how the spinner is drawn (colors, font types etc.) the user is given direct access to the sub-objects of a spinner. To this end three functions exist: FL_OBJECT *fl_get_spinner_input(FL_OBJECT *obj); FL_OBJECT *fl_get_spinner_up_button(FL_OBJECT *obj); FL_OBJECT *fl_get_spinner_down_button(FL_OBJECT *obj); They return the addresses of the objects the spinner object is made up from, i.e., that of the input field and the buttons for increasing and decreasing the spinner's value. These then can be used to set or query the way the individual component objects are drawn. The addresses of these sub-objects shouldn't be used for any other purposes, especially their callback function may never be changed!  File: xforms.info, Node: Thumbwheel Object, Prev: Spinner Object, Up: Part III Valuator Objects 17.7 Thumbwheel Object ====================== Thumbwheel is another valuator that can be useful for letting the user indicate a value between some fixed bounds. Both horizontal and vertical thumbwheels exist. They have a minimum, a maximum and a current value (all floating point values). The user can change the current value by rolling the wheel. * Menu: * Adding Thumbwheel Objects: Adding Thumbwheel Objects * Thumbwheel Types: Thumbwheel Types * Thumbwheel Interaction: Thumbwheel Interaction * Other Thumbwheel Routines: Other Thumbwheel Routines * Thumbwheel Attributes: Thumbwheel Attributes * Remarks: Thumbwheel Remarks  File: xforms.info, Node: Adding Thumbwheel Objects, Next: Thumbwheel Types, Up: Thumbwheel Object 17.7.1 Adding Thumbwheel Objects -------------------------------- To add a thumbwheel to a form use FL_OBJECT *fl_add_thumbwheel(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); The meaning of the parameters is as usual. The label is by default placed below the thumbwheel.  File: xforms.info, Node: Thumbwheel Types, Next: Thumbwheel Interaction, Prev: Adding Thumbwheel Objects, Up: Thumbwheel Object 17.7.2 Thumbwheel Types ----------------------- [image src="xforms_images/thumbwheels.png"] The following types of thumbwheels are available: `FL_VERT_THUMBWHEEL' A vertical thumbwheel. `FL_HOR_THUMBWHEEL' A horizontal thumbwheel.  File: xforms.info, Node: Thumbwheel Interaction, Next: Other Thumbwheel Routines, Prev: Thumbwheel Types, Up: Thumbwheel Object 17.7.3 Thumbwheel Interaction ----------------------------- Whenever the user changes the value of the thumbwheel using the mouse or keyboard, the thumbwheel is returned (or the callback called) by the interaction routines. You change the value of a thumbwheel by dragging the mouse inside the wheel area or, for vertical thumbwheels also by using the scroll wheel of the mouse. Each pixel of movement changes the value of the thumbwheel by 0.005, which you can change using the `*note fl_set_thumbwheel_step()::' function. The keyboard can be used to change the value of a thumbwheel. Specifically, the `' and `' cursor keys can be used to increment or decrement the value of a vertical thumbwheel and the `' and `' cursor keys can be used to increment or decrement the value of horizontal thumbwheel. Each pressing of the cursor key changes the thumbwheel value by the current step value. The `' key can be used to set the thumbwheel to a known value, which is the average of the minimum and the maximum value of the thumbwheel. In some applications you might not want the thumbwheel to be returned all the time. To change the default, call the following routine: void fl_set_object_return(FL_OBJECT *obj, unsigned int when); where the parameter `when' can be one of the four values `*note FL_RETURN_NONE::' Never return or invoke callback. `*note FL_RETURN_END_CHANGED::' Return or invoke callback at end (mouse release) if value is changed since last return. `*note FL_RETURN_CHANGED::' Return or invoke callback whenever the thumbwheel value is changed. `*note FL_RETURN_END::' Return or invoke callback at end (mouse release) regardless if the value is changed or not. `*note FL_RETURN_ALWAYS::' Return or invoke callback whenever the value changes or the mouse button is released. See demo program `thumbwheel.c' for an example use of this.  File: xforms.info, Node: Other Thumbwheel Routines, Next: Thumbwheel Attributes, Prev: Thumbwheel Interaction, Up: Thumbwheel Object 17.7.4 Other Thumbwheel Routines -------------------------------- To change the value and bounds of a thumbwheel use the following routines double fl_set_thumbwheel_value(FL_OBJECT *obj, double val); void fl_set_thumbwheel_bounds(FL_OBJECT *obj, double min, double max); By default, the minimum value is 0.0, the maximum is 1.0 and the value is 0.5. To obtain the current value or bounds of a thumbwheel use double fl_get_thumbwheel_value(FL_OBJECT *obj); void fl_get_thumbwheel_bounds(FL_OBJECT *obj, double *min, double *max); By default, the bounds are "hard", i.e., once you reach the minimum or maximum, the wheel would not turn further in this direction. However, if desired, you can make the bounds to turn over such that it crosses over from the minimum to the maximum value and vice versa. To this end, the following routine is available int fl_set_thumbwheel_crossover(FL_OBJECT *obj, int yes_no); In a number of situations you might like thumbwheel values to be rounded to some values, e.g., to integer values. To this end use the routine void fl_set_thumbwheel_step(FL_OBJECT *obj, double step); After this call thumbwheel values will be rounded to multiples of `step'. Use a value 0.0 for `step' to switch off rounding. To get the current setting for this call double fl_set_thumbwheel_step(FL_OBJECT *obj);  File: xforms.info, Node: Thumbwheel Attributes, Next: Thumbwheel Remarks, Prev: Other Thumbwheel Routines, Up: Thumbwheel Object 17.7.5 Thumbwheel Attributes ---------------------------- Setting colors via `*note fl_set_object_color()::' has no effect on thumbwheels.  File: xforms.info, Node: Thumbwheel Remarks, Prev: Thumbwheel Attributes, Up: Thumbwheel Object 17.7.6 Remarks -------------- See the demo program `thumbwheel.c' for an example of the use of thumbwheels.  File: xforms.info, Node: Part III Input Objects, Next: Part III Choice Objects, Prev: Part III Valuator Objects, Up: Top 18 Input Objects **************** It is often required to obtain textual input from the user, e.g., a file name, some fields in a database, etc. To this end input fields exist in the Forms Library. An input field is a field that can be edited by the user using the keyboard. * Menu: * Adding Input Objects: Adding Input Objects * Input Types: Input Types * Input Interaction: Input Interaction * Other Input Routines: Other Input Routines * Input Attributes: Input Attributes * Remarks: Input Remarks  File: xforms.info, Node: Adding Input Objects, Next: Input Types, Up: Part III Input Objects 18.1 Adding Input Objects ========================= Adding an object To add an input field to a form you use the routine FL_OBJECT *fl_add_input(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) The meaning of the parameters is as usual. The label is by default placed in front of the input field.  File: xforms.info, Node: Input Types, Next: Input Interaction, Prev: Adding Input Objects, Up: Part III Input Objects 18.2 Input Types ================ The following types of input fields exist: `FL_NORMAL_INPUT' Any type of text can be typed into this field. `FL_FLOAT_INPUT' Only a floating point numbers can be typed in (e.g., -23.2e12). The resulting string will be accepted by `strtod()' in its entirety (but may be too big to be represented by an `int' or `long'). `FL_INT_INPUT' Only an integers can be typed in (e.g., -86). The resulting string will be accepted by `strtol()' in its entirety (but may be too big to be represented by an `float' or `double'). `FL_DATE_INPUT' Only a date (MM/DD/YY or DD/MM/YY) can be typed in (and limited per default to 10 characters). `FL_MULTILINE_INPUT' An input field allowing for multiple lines. `FL_SECRET_INPUT' A normal input field that does not show the text (and limited per default to a maximum length of 16 characters). `FL_HIDDEN_INPUT' A normal input field but invisible. A normal input field can contain one line of text, to be typed in by the user. A float input field can only contain a float number. If the user tries to type in something else than a float, it is not shown and the bell is sounded. Similarly, an int input field can only contain an integer number and a date input field can only contain a valid date (see below). A multi-line input field can contain multiple lines of text. A secret input field works like a normal input field but the text is not shown (or scrambled). Only the cursor is shown which does move while text is being entered. This can for example be used for getting passwords. Finally, a hidden input field is not shown at all but does collect text for the application program to use.  File: xforms.info, Node: Input Interaction, Next: Other Input Routines, Prev: Input Types, Up: Part III Input Objects 18.3 Input Interaction ====================== Whenever the user presses the mouse inside an input field a cursor will appear in it (and the field will change color to indicate that it received the input focus). Further input will be directed into this field. The user can use the following keys (as in `emacs(1)') to edit or move around inside the input field: delete previous char `', `h' delete next char `' delete previous word `' delete next word `' delete from cursor position to end of line `k' delete from cursor position to begin of line `h' jump to begin of line `a' jump to end of line `e' move char backward `b' move char forward `f' move to next line `n', `' move to previous line `p', `' move word backward `b' move word forward `f' move to begin of field `' move to end of field `' clear input field `u' paste `y' It is possible to remap the the bindings, see below for details. A single click into the input field positions the cursor at the position of the mouse click. There are three ways to select part of the input field. Dragging, double-click and triple-click. A double-click selects the word the mouse is on and a triple-click selects the entire line the mouse is on. The selected part of the input field is removed when the user types the `' or `' key or replaced by what the user types in. One additional property of selecting part of the text field is that if the selection is done with the left mouse button the selected part becomes the primary (`XA PRIMARY') selection of the X Selection mechanism, thus other applications, e.g., `xterm', can request this selection. Conversely, the cut-buffers from other applications can be pasted into the input field. Use the middle mouse button for pasting. Note that `y' only pastes the cut-buffer generated by `k' and is not related to the X Selection mechanism, thus it only works within the same application. When the user presses the `' key the input field is returned to the application program and the input focus is directed to the next input field. This also happens when the user presses the `' key but only if the form does not contain a return button. The order which input fields get the focus when the `' is pressed is the same as the order the input fields were added to the form. From within Form Designer, using the raising function you can arrange (re-arrange) the focus order, see *note Raising and Lowering::, in Part II for details. If the `' key is pressed down when the `' is pressed, the focus is directed to the previous input field. Leaving an input field using the `') key does not work for multi-line input fields since the `' key is used to start a new line. Per default the input object gets returned to the application (or the callback set for the input object is invoked) when the input field is left and has been changed. Depending on the application, other options might be useful. To change the precise condition for the object to be returned (or its callback to become invoked), the `*note fl_set_object_return()::' function can be used with one of the following values: `*note FL_RETURN_NONE::' Never return or invoke callback `*note FL_RETURN_END_CHANGED::' Default, object is returned or callback is called at the end if the field had been modified. `*note FL_RETURN_CHANGED::' Return or invoke the callback function whenever the field had been changed. `*note FL_RETURN_END::' Return or invoke the callback function at the end regardless if the field was modified or not. `*note FL_RETURN_ALWAYS::' Return or invoke the callback function upon each keystroke and at the end (regardless if the field was changed or not) See demo `objreturn.c' for an example use of this. A few additional notes: when you read "the fields has been changed" this includes the case that the user e.g., deleted a character and then added it back again. Also this case is reported as a "change" (a delete alone isn't) so the term "changed" does not necessarily mean that the content of the field has changed but that the user made changes (but which still might result in the exact same content as before). Another term that may be understood differently is "end". In the versions since 1.0.91 it means that the users either hits the `' or the `' key (except for multi-line inputs) or that she clicks onto some other object that in principle allows user interaction. These events are interpreted as an indication the user is done editing the input field and thus are reported back to the program, either by returning the input object or invoking its callback. But unless the user goes to a different input object the input field edited retains the focus. Up to version 1.0.90 this was handled a bit differently: an "end of edit" event was not reported back to the program when the user clicked on a non-input object, i.e., changed to a different input object. This let to some problems when the interaction with the clicked-on non-input object dependet on the new content of the input object, just having been edited, but which hadn't been been reported back to the caller. On the other hand, some programs rely on the "old" behaviour. These programs can switch back to the traditional behaviour by calling the new function (available since 1.0.93) fl_input_end_return_handling(int type); where `type' can be either `FL_INPUT_END_EVENT_ALWAYS', which is now the default, or `FL_INPUT_END_EVENT_CLASSIC', which switches back to the type of handing used in versions up and including to 1.0.90. The function can be used at any time to change between the two possible types of behaviour. The function returns the previous setting. There is a routine that can be used to limit the number of characters per line for input fields of type `*note FL_NORMAL_INPUT::' void fl_set_input_maxchars(FL_OBJECT *obj, int maxchars); To reset the limit to unlimited, set `maxchars' to 0. Note that input objects of type `*note FL_DATE_INPUT::' are limited to 10 characters per default and those of type `*note FL_SECRET_INPUT::' to 16. Although an input of type `*note FL_RETURN_ALWAYS::' can be used in combination with the callback function to check the validity of characters that are entered into the input field, use of the following method may simplify this task considerably: typedef int (*FL_INPUT_VALIDATOR)(FL_OBJECT *obj, const char *old, const char *cur, int c); FL_INPUT_VALIDATOR fl_set_input_filter(FL_OBJECT *obj, FL_INPUT_VALIDATOR filter); The function `filter()' is called whenever a new (regular) character is entered. `old' is the string in the input field before the newly typed character `c' was added to form the new string `cur'. If the new character is not an acceptable character for the input field, the filter function should return `FL_INVALID' otherwise `FL_VALID'. If `FL_INVALID' is returned, the new character is discarded and the input field remains unmodified. The function returns the old filter. While the built-in filters also sound the keyboard bell, this doesn't happpen if a custom filter only returns `FL_INVALID'. To also sound the keyboard bell logically or it with `FL_INVALID | FL_RINGBELL'. This still leaves the possibility that the input is valid for every character entered, but the string is invalid for the field because it is incomplete. For example, 12.0e is valid for a float input field for every character typed, but the final string is not a valid floating point number. To guard against such cases the filter function is also called just prior to returning the object with the argument `c' (for the newly entered character) set to zero. If the validator returns `FL_INVALID' the object is not returned to the application program, but input focus can change to the next input field. If the return value is `FL_INVALID | FL_RINGBELL' the keyboard bell is sound, the object is also not returned to the application program and the input focus remains in the object. To facilitate specialized input fields using validators, the following validator dependent routines are available void fl_set_input_format(FL_OBJECT *obj, int attrib1, int attrib2); void fl_get_input_format(FL_OBJECT *obj, int *attrib1, int *attrib2); These two routines more or less provide a means for the validator to store and retrieve some information about user preference or other state dependent information. `attrib1' and `attrib2' can be any validator defined variables. For the built-in class, only the one of type `*note FL_DATE_INPUT::' utilizes these to store the date format: for `attrib1', it can take `FL_INPUT_MMDD' or `FL_INPUT_DDMM' and `attrib2' is the separator between month and day. For example, to set the date format to `dd/mm', use fl_set_input_format(obj, FL_INPUT_DDMM, '/'); For the built-in type `*note FL_DATE_INPUT::' the default is `FL_INPUT_MMDD' and the separator is `'/''. There is no limit on the year other than it must be an integer and appear after month and day. The function int fl_validate_input(FL_OBJECT *obj); can be used to test if the value in an input field is valid. It returns `*note FL_VALID::' if the value is valid or if there is no validator function set for the input, otherwise `*note FL_INVALID::'. There are two slightly different input modes for input objects. In the "normal" mode, when the input field is entered not using the mouse (e.g., by using of the key) the cursor is placed again at the position it was when the field was left (or at the end of a possibly existing string when it's entered for the first time). When an input object has a maximum number of allowed characters set (via the `*note fl_set_input_maxchars()::' function) and there's no room left no new input is accepted until at least one character has been deleted. As an alternative there's an input mode that is similar to the way things were handle in DOS forms etc. Here, when the field is entered by any means but clicking into it with the mouse, the cursor is placed at the start of the text. And for fields with a maximum capacity, that contain already as many characters as possible, the character at the end of the field are removed when a new one is entered. To switch between the two modes use the function where `mode' is one of `FL_NORMAL_INPUT_MODE' The default. Use it to switch to the "normal" input mode `FL_DOS_INPUT_MODE' For selecting the DOS-like input mode (in this mode, when a maximum number of characters has been set, as many characters already have been entered, and a new character is inserted somewhere in the middle the character at the very end gets deleted to make room for the new character) The function returns the previous setting. Note that the function changes the input mode for all input fields in your application.  File: xforms.info, Node: Other Input Routines, Next: Input Attributes, Prev: Input Interaction, Up: Part III Input Objects 18.4 Other Input Routines ========================= Note that the label is not the default text in the input field. To set the contents of the input field use one of these routines: void fl_set_input(FL_OBJECT *obj, const char *str); void fl_set_input_f(FL_OBJECT *obj, const char *fmt, ...); The first one takes a simple string while the second expects a format string with format specifiers just like `printf()' etc. and as many (appropriate) arguments as there are format specifiers. Only a limited check on the string passed to the function is done in that only printable characters (according to the `isprint()' function) and, in the case of `*note FL_MULTILINE_INPUT::' objects, new-lines (`'\n'') are accepted (i.e., all that don't fit are skipped). Use an empty string (or a `NULL' pointer as the second argument) to clear an input field. Setting the content of an input field does not trigger an object event, i.e., the object callback is not called. In some situations you might want to have the callback invoked. For this, you may use the function `*note fl_call_object_callback()::'. To obtain the string in the field (when the user has changed it) use: const char *fl_get_input(FL_OBJECT *obj); This function returns a char pointer for all input types. Thus for numerical input types e.g., `strtol(3)', `atoi(3)', `strtod(3)', `atof(3)' or `sscanf(3)' should be used to convert the string to the proper data type you need. For multiline input, the returned pointer points to the entire content with possibly embedded newlines. The application may not modify the content pointed to by the returned pointer, it points to the internal buffer. To select or deselect the current input or part of it, the following two routines can be used void fl_set_input_selected(FL_OBJECT *obj, int flag); void fl_set_input_selected_range(FL_OBJECT *obj, int start, int end); where `start' and `end' are measured in characters. When `start' is 0 and `end' equals the number of characters in the string, `*note fl_set_input_selected()::' makes the entire input field selected. However, there is a subtle difference between this routine and `*note fl_set_input_selected()::' when called with `flag' set to 1: `*note fl_set_input_selected()::' always places the cursor at the end of the string while `*note fl_set_input_selected_range()::q' places the cursor at the beginning of the selection. To obtain the currently selected range, either selected by the application or by the user, use the following routine const char *fl_get_input_selected_range(FL_OBJECT *obj, int *start, int *end); where `start' and `end', if not `NULL', are set to the begining and end position of the selected range, measured in characters. For example, if `start' is 5 after the function returned and `end' is 7, it means the selection starts at character 6 (`str[5]') and ends before character 8 (`str[7]'), so a total of two characters are selected (i.e., character 6 and 7). The function returns the selected string (which may not be modified). If there is currently no selection, the function returns `NULL' and both `start' and `end' are set to -1. Note that the `char' pointer returned by the function points to (kind of) a static buffer, and will be overwritten by the next call. It is possible to obtain the cursor position using the following routine int fl_get_input_cursorpos(FL_OBJECT *obj, int *xpos, int *ypos); The function returns the cursor position measured in number of characters (including newline characters) in front of the cursor. If the input field does not have input focus (thus does not have a cursor), the function returns -1. Upon function return, `ypos' is set to the number of the line (starting from 1) the cursor is on, and `xpos' set to the number of characters in front of the cursor measured from the beginning of the current line as indicated by `ypos'. If the input field does not have input focus the `xpos' is set to -1. It is possible to move the cursor within the input field programmatically using the following routine void fl_set_input_cursorpos(FL_OBJECT *obj, int xpos, int ypos); where `xpos' and `ypos' are measured in characters (lines). E.g., given the input field `"an arbitrary string"' the call fl_set_input_cursorpos(ob, 4, 1); places the the cursor after the first character of the word `"arbitrary"', i.e., directly after the first `a'. By default, if an input field of type `*note FL_MULTILINE_INPUT::' contains more text than can be shown, scrollbars will appear with which the user can scroll the text around horizontally or vertically. To change this default, use the following routines void fl_set_input_hscrollbar(FL_OBJECT *obj, int how); void fl_set_input_vscrollbar(FL_OBJECT *obj, int how); where `how' can be one of the following values `FL_AUTO' The default. Shows the scrollbar only if needed. `FL_ON' Always shows the scrollbar. `FL_OFF' Never show scrollbar. Note however that turning off scrollbars for an input field does not turn off scrolling, the user can still scroll the field using cursor and other keys. To completely turn off scrolling for an input field (for both multiline and single line input field), use the following routine with a false value for `yes_no' void fl_set_input_scroll(FL_OBJECT *obj, int yes_no); There are also routines that can scroll the input field programmatically. To scroll vertically (for input fields of type `*note FL_MULTILINE_INPUT::' only), use void fl_set_input_topline(FL_OBJECT *obj, int line); where `line' is the new top line (starting from 1) in the input field. To programmatically scroll horizontally, use the following routine void fl_set_input_xoffset(FL_OBJECT *obj, int pixels); where `pixels', which must be a positive number, indicates how many pixels to scroll to the left relative to the nominal position of the text lines. To obtain the current xoffset, use int fl_get_input_xoffset(FL_OBJECT *obj); It is possible to turn off the cursor of the input field using the following routine with a false value for `yes_no': void fl_set_input_cursor_visible(FL_OBJECT *obj, int yes_no); To obtain the number of lines in the input field, call int fl_get_input_numberoflines(FL_OBJECT *obj); To obtain the current topline in the input field, use int fl_get_input_topline(FL_OBJECT *obj); To obtain the number of lines that fit inside the input box, use int fl_get_input_screenlines(FL_OBJECT *obj); For secret input field, the default is to draw the text using spaces. To change the character used to draw the text, the following function can be used int fl_set_input_fieldchar(FL_OBJECT *obj, int field_char); The function returns the old field char.  File: xforms.info, Node: Input Attributes, Next: Input Remarks, Prev: Other Input Routines, Up: Part III Input Objects 18.5 Input Attributes ===================== Never use `*note FL_NO_BOX::' as the boxtype. The first color argument (`col1') to `*note fl_set_object_color()::' controls the color of the input field when it is not selected and the second (`col2') is the color when selected. To change the color of the input text or the cursor use void fl_set_input_color(FL_OBJECT *obj, FL_COLOR tcol, FL_COLOR ccol); Here `tcol' indicates the color of the text and `ccol' is the color of the cursor. If you want to know the colors of the text and cursor use void fl_get_input_color(FL_OBJECT *obj, FL_COLOR *tcol, FL_COLOR *ccol); By default, the scrollbar size is dependent on the initial size of the input box. To change the size of the scrollbars, use the following routine void fl_set_input_scrollbarsize(FL_OBJECT *obj, int hh, int vw); where `hh' is the horizontal scrollbar height and `vw' is the vertical scrollbar width in pixels. To determine the current settings for the horizontal scrollbar height and the vertical scrollbar width use void fl_get_input_scrollbarsize(FL_OBJECT *obj, int *hh, int *vw); The default scrollbar types are `*note FL_HOR_THIN_SCROLLBAR::' and `*note FL_VERT_THIN_SCROLLBAR::'. There are two ways you can change the default. One way is to use `*note fl_set_defaults()::' or `*note fl_set_scrollbar_type()::' to set the application wide default (preferred); another way is to use `*note fl_get_object_component()::' to get the object handle to the scrollbars and change the the object type forcibly. Although the second method of changing the scrollbar type is not recommended, the object handle obtained can be useful in changing the scrollbar colors etc. As mentioned earlier, it is possible for the application program to change the default edit keymaps. The editing key assignment is held in a structure of type `FL_EditKeymap' defined as follows: typedef struct { long del_prev_char; /* delete previous char */ long del_next_char; /* delete next char */ long del_prev_word; /* delete previous word */ long del_next_word; /* delete next word */ long del_to_eol; /* delete from cursor to end of line */ long del_to_bol; /* delete from cursor to begin of line */ long clear_field; /* delete all */ long del_to_eos; /* not implemented */ long backspace; /* alternative for del_prev_char */ long moveto_prev_line; /* one line up */ long moveto_next_line; /* one line down */ long moveto_prev_char; /* one char left */ long moveto_next_char; /* one char right */ long moveto_prev_word; /* one word left */ long moveto_next_word; /* one word right */ long moveto_prev_page; /* one page up */ long moveto_next_page; /* one page down */ long moveto_bol; /* move to begining of line */ long moveto_eol; /* move to end of line */ long moveto_bof; /* move to begin of file */ long moveto_eof; /* move to end of file */ long transpose; /* switch two char positions*/ long paste; /* paste the edit buffer */ } FL_EditKeymap; To change the default edit keymaps, the following routine is available: void fl_set_input_editkeymap(const FL_EditKeymap *km); with a filled or partially filled `*note FL_EditKeymap::' structure. The unfilled members must be set to 0 so the default mapping is retained. Change of edit keymap is global and affects all input field within the application. Calling `*note fl_set_input_editkeymap()::' with `km' set to `NULL' restores the default. All cursor keys (`', `' etc.) are reserved and their meanings hard-coded, thus can't be used in the mapping. For example, if you try to set `del_prev_char' to `', pressing the `' key will not delete the previous character. To obtain the current map of the edit keys use the function void fl_get_input_editkeymap(FL_EditKeymap *km); with the `km' argument pointing of a user supplied structure which after the call will be set up with the current settings for the edit keys. In filling the keymap structure, ASCII characters (i.e., characters with values below 128, including the control characters with values below 32) should be specified by their ASCII codes (` C' is 3 etc.), while all others by their `Keysym's (`XK_F1' etc.). Control and special character combinations can be obtained by adding `FL_CONTROL_MASK' to the `Keysym'. To specify `Meta' add `FL_ALT_MASK' to the key value. FL_EditKeymap ekm; memset(&ekm, 0, sizeof ekm); /* zero struct */ ekm.del_prev_char = 8; /* */ ekm.del_prev_word = 8 | FL_CONTROL_MASK; /* */ ekm.del_next_char = 127; /* */ ekm.del_prev_word = 'h' | FL_ALT_MASK; /* h */ ekm.del_next_word = 127 | FL_ALT_MASK; /* */ ekm.moveto_bof = XK_F1; /* */ ekm.moveto_eof = XK_F1 | FL_CONTROL_MASK; /* */ fl_set_input_editkeymap(&ekm); Note: In earlier versions of XForms (all version before 1.2) the default behaviour of the edit keys was slightly different which doesn't fit modern user expectations, as was the way the way the edit keymap was to be set up. If you use XForms for some older application that makes massive use of the "classical" behaviour you can compile XForms to use the old behaviour by using the `--enable-classic-editkeys' option when configuring the library for compilation.  File: xforms.info, Node: Input Remarks, Prev: Input Attributes, Up: Part III Input Objects 18.6 Remarks ============ Always make sure that the input field is high enough to contain a single line of text. If the field is not high enough, the text may get clipped, i.e., become unreadable. See the program `demo06.c' for an example of the use of input fields. See `minput.c' for multi-line input fields. See `secretinput.c' for secret input fields and `inputall.c' for all input fields.  File: xforms.info, Node: Part III Choice Objects, Next: Part III Container Objects, Prev: Part III Input Objects, Up: Top 19 Choice Objects ***************** * Menu: * Select Object: Select Object * Nmenu Object: Nmenu Object * Browser Object: Browser Object  File: xforms.info, Node: Select Object, Next: Nmenu Object, Up: Part III Choice Objects 19.1 Select Object ================== A select object is a rather simple object that allows the user to pick alternatives from a linear list that pops up when he clicks on the object. It remembers the last selected item, which is also shown on top of the select object. The select object internally uses a popup (*note Part III Popups::) and thus it can be helpful to understand at lest some aspects of how popups work to fully grasp the functionality of select objects. * Menu: * Adding Select Objects: Adding Select Objects * Select Interaction: Select Interaction * Other Select Routines: Other Select Routines * Select Attributes: Select Attributes * Remarks: Select Remarks  File: xforms.info, Node: Adding Select Objects, Next: Select Interaction, Up: Select Object 19.1.1 Adding Select Objects ---------------------------- To add a select object to a form use FL_OBJECT *fl_add_select(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) There are currently three types which just differ by the way they look: `FL_NORMAL_SELECT' Per default this type is drawn as a rounded, flat box (but you can change that by setting a different boxtype for the object) with the text of the currently selected item in its center. `FL_MENU_SELECT' This select object looks like a button with a little extra box at its right side (just like a `FL_MENU_BUTTON') and the text of the currently selected item is drawn on the button-like object. `FL_DROPLIST_SELECT' This type looks like a button with the text of the currently selected item on top of it and a second square button directly beside it with an downward pointing arrow on it. Per default `label' is drawn outside and to the left of the object. Once a new select object has been created items have to be added to it. For this the following function exists: FL_POPUP_ENTRY *fl_add_select_items(FL_OBJECT *obj, const char items,...); `items' is a string with the items to add, separated by the `|' character. In the simplest case you would just use something like `"Item 1|Item 2|Item 3"' to add three items to the list. If there weren't any items before the first item will be automatically shown as the selected one. As also described in the documentation for the similar function `*note fl_popup_add_entries()::' (*note Adding Popups::) the text for an item may contain "special sequences" that start with the character `%' and the may require an additional argument passed to the function after the `items' argument: `%x' Set a value of type `long int' that's passed to all callback routines for the item. The value must be given in the arguments following the `items' string. `%u' Set a `user_void' pointer that's passed to all callbacks of the item. The pointer must be specified in the arguments following the `items' string. `%f' Set a callback function that gets called when the item is selected. The function is of type int callback(FL_POPUP_RETURN *r); Information about the item etc. gets passed to the callback function via the `*note FL_POPUP_RETURN::' structure and the return value of the function can be used to keep the selection from becoming reported back to the user made by returning a value of `FL_IGNORE' (-1). The function's address must be given in the arguments following the `items' string. `%E' Set a callback routine that gets called each time the mouse enters the item (as long as the item isn't disabled or hidden). The type of the function is the same as that of the callback function for the selection of the item but it's return value is never used. The functions address must be given in the arguments following the `items' string. `%L' Set a callback routine that gets called each time the mouse leaves the item. The type of the function is the same that as of the callback function for the selection of the item but it's return value is never used. The functions address must be given in the arguments following the `items' string. `%d' Marks the item as disabled, i.e., it can't be selected and its text is per default drawn in a different color `%h' Marks the item as hidden, i.e., it is not shown while in this state. `%S' For items with shortcut keys it's quite common to have them shown on the right hand side. Using `"%S"' you can split the items text into two parts, the first one (before `"%S"') being drawn flushed left and the second part flushed right. Note that using this special sequence doesn't automatically sets a shortcut key, this still has to be done using `"%s"'. `%s' Sets one or more shortcut keys for an item. Requires a string with the shortcuts in the arguments following the `items' string. *Note Shortcuts::, for details on how to define shortcuts. Please note that the character in the label identical to the shortcut character is only shown as underlined if `"%S"' isn't used. `%%' Use this to get a `'%'' within the text of an item. If you compare this list of "special sequences" with those listed for the `*note fl_popup_add_entries()::' function you will find that aome are missing. This is because a select object is a simple linear list of items that uses only parts of the popups functionalities. Another way to set up the popup of a select object is to use the function long fl_set_select_items(FL_OBJECT *obj, FL_POPUP_ITEM *item); Here `item' is an array of structures of type `*note FL_POPUP_ITEM::' with the `text' member of the very last element of the array being set to `NULL', indicating the end of the array. The `text' member is the text of the item. It may only contain one "special sequence", `"%S"' to indicate that the string is to be split at that position into the part of the item label to be drawn to the left and on the right side (also prepending the string with `'_'' or `'/'' has no effect). `callback' is a callback function to be invoked on selection of the item. `shortcut' is a string for setting keybord shortcuts for the item. `type' has no function at all here (there can be only items of type `*note FL_POPUP_NORMAL::' in a select objects popup) and `state' can be set to `*note FL_POPUP_DISABLED::' and/or `*note FL_POPUP_HIDDEN::'. Please note: when the select object already had items before the call of `*note fl_set_select_items()::' then they are removed before the new ones are set. The values assigned to the items start at 0. A third way to "populate" a select object is to create a popup directly and then associate it with the select object using int fl_set_select_popup(FL_OBJECT *obj, FL_POPUP *popup); If the select object already had a popup before this will be deleted and replaced by the new popup passed as the second argument. Please note that the popup the argument `popup' points to may not contain any entries other than those of type `*note FL_POPUP_NORMAL::' (and, of course, the popup can't be a sub-popup of another popup).  File: xforms.info, Node: Select Interaction, Next: Other Select Routines, Prev: Adding Select Objects, Up: Select Object 19.1.2 Select Interaction ------------------------- The simplest interaction with a select object consists of clicking onto the object and then selecting an item in the popup that gets shown directly beside the mouse position. If you click with the left or right mouse button onto the select object previous or next item, respectively, will be selected. If youl keep the left or mouse button pressed down for a longer time slowly all alternatives are selected, one after each other. You finally can also use the scroll wheel of your mouse to select the next or previous item (scrolling down selects the next, scrolling up the previous item). On every selection of an item (also if the already selected item is re-selected) a callback that may have been associated with the item is executed. The callback receives as its argument a pointer to a structure of type `*note FL_POPUP_RETURN::'. Its `val' member is a integer value associated with the entry. It can be set explicitely on creation of the item using the `"%x"' "special sequence". If not given then first item gets the value 0, the next 1 etc. `user_data' is a pointer to some user data, which can be set on creation of the item using `"%u"'. `text' is the string used in creating the item, including all "special sequences", while `label' is the string shown in the popup for the item. If there was a special sequence of `"%S"' in the string that was used to create the item `accel' is the text that appears right-flushed in the popup for the item. `entry' is a pointer to the popup entry that represents the item in the select object and, finally, `popup' is the popup associated with the select object. Normally, when a new item is selected this is reported back to the caller either by calling the select objects callback (if one exists) or by returning the object as the result of a call of e.g., `*note fl_do_forms()::'. But if the callback for the item itself returns `FL_IGNORE' then the latter doesn't happen. This can be useful for cases where all work for a change of the selection can already be done within the items callback and the "main loop" shouldn't get involved anymore. As for all other normal objects the condition under which a `FL_SELECT' object gets returned to the application (or an associate callback is called) can be influenced by calling the function int fl_set_object_return(FL_OBJECT *obj, unsigned int when) where `when' can have the following values `*note FL_RETURN_NONE::' Never return or invoke a callback. `*note FL_RETURN_END_CHANGED::' Return or invoke callback if end of interaction and selection of an item coincide. `*note FL_RETURN_CHANGED::' Return or invoke callback whenever an item is selected (this is the default). `*note FL_RETURN_END::' Return or invoke callback on end of an interaction. `*note FL_RETURN_ALWAYS::' Return (or invoke callback) whenever the interaction ends and/or an item is selected. Per default the popup of a select objects remains shown when the user releases the mouse somewhere outside the popup window (or on its title area). The alternative is to close the popup immediately when the user releases the mouse, independent of where it is. Using the function int fl_set_select_policy(FL_OBJECT *obj, int policy); the program can switch between these two modes of operation, where `policy' can be on of two values: `FL_POPUP_NORMAL_SELECT' Keeps the popup opened when the mouse isn't released on one of the selectable items. `FL_POPUP_DRAG_SELECT' Close the popup immediately when the mouse button is released. The function returns on success the previous setting of the "policy" and -1 on error.  File: xforms.info, Node: Other Select Routines, Next: Select Attributes, Prev: Select Interaction, Up: Select Object 19.1.3 Other Select Routines ---------------------------- To find out which item is currently selected use FL_POPUP_RETURN *fl_get_select_item(FL_OBJECT *obj); It returns a pointer to a structure of type `*note FL_POPUP_RETURN::' as already described above, containing all needed information about the selected item. For some actions, e.g., deletion of an item etc., it is necessary to know the popup entry that represents it. Therefore it's possible to search the list of items according to several criteria: FL_POPUP_ENTRY *fl_get_select_item_by_value(FL_OBJECT *obj, long val); FL_POPUP_ENTRY *fl_get_select_item_by_label(FL_OBJECT *obj, const char *label); FL_POPUP_ENTRY *fl_get_select_item_by_label_f(FL_OBJECT *obj, const char *fmt, ...); FL_POPUP_ENTRY *fl_get_select_item_by_text(FL_OBJECT *obj, const char *text); FL_POPUP_ENTRY *fl_get_select_item_by_text_f(FL_OBJECT *obj, const char *fmt, ...); The first function, `*note fl_get_select_item_by_value()::', searches through the list of items and returns the first one with the `val' associated with the item (or `NULL' if none is found). The second and third, `*note fl_get_select_item_by_label()::' and `*note fl_get_select_item_by_label_f()::' searches for a certain label as displayed for the item in the popup. The last two, `*note fl_get_select_item_by_text()::' and `*note fl_get_select_item_by_text_f()::' searches for the text the item was created by (that might be the same as the label text in simple cases). The difference between the second and third and the forth and the last is the way the text is passed to the functions, it's either a simple string or the result of the expansion of a format string as used for `printf()' etc. using the following unspecified arguments. Please note that all these functions return a structure of type `*note FL_POPUP_ENTRY::' (and not `*note FL_POPUP_RETURN::', which gives you direct access to the entry in the popup for the item. Using e.g., the result of one of the functions above you can also set the currently selected item via your program using FL_POPUP_RETURN *fl_set_select_item(FL_OBJECT *obj, FL_POPUP_ENTRY *entry); Or you could use the result to delete an item: int fl_delete_select_item(FL_OBJECT *obj, FL_POPUP_ENTRY *entry); Please note that the values associated with items won't change due to removing an item. Alternatively, you can replace an item by one or more new ones. To do that use FL_POPUP_ENTRY *fl_replace_select_item(FL_OBJECT *obj, FL_POPUP_ENTRY *old, const char *new_items, ...); `old' designates the item to be removed and `new_items' is a string exactly like it would be used in `*note fl_add_select_items()::' for the `items' argument, that defines the item(s) to replace the existing item. Please note that, unless values to be associated with the items (see the `val' member of the `*note FL_POPUP_RETURN::' structure) there's a twist here. When items get created they per default receive increasing values, starting at 0. This also holds for items that get created in the process of replacement. The result is that the ordering of those values in that case wont represent the order in which they appear in the select objects popup. Another sometimes useful function allows insertion of new items somewhere in the middle of a list of already existing items: FL_POPUP_ENTRY *fl_insert_select_items(FL_OBJECT *obj, FL_POPUP_ENTRY *after, const char *new_items, ...); `after' is the entry after which the new item(s) are to be inserted (if it's `NULL' the new items are inserted at the very start). The rest of the arguments are the same as for `*note fl_replace_select_item()::' and the same caveats about the values associated automatically with the new items holds. It's possible to remove all items from a select object by calling int fl_clear_select(FL_OBJECT *obj); Afterwards you have to call again e.g., `*note fl_add_select_items()::' to set new entries. Note that if you used `*note fl_set_select_popup()::' to set a popup for the select object then that popup gets deleted automatically on calling `*note fl_clear_select()::'! The values automatically associated with items when calling `*note fl_add_select_items()::' will start at 0 again.  File: xforms.info, Node: Select Attributes, Next: Select Remarks, Prev: Other Select Routines, Up: Select Object 19.1.4 Select Attributes ------------------------ The two color arguments, `clo1' and `col2', of the function `*note fl_set_object_color()::' set the background color of the object normally and when the mouse is hovering over it, respectively. With the functions FL_COLOR fl_set_selection_text_color(FL_OBJECT *obj, FL_COLOR color); FL_COLOR fl_get_selection_text_color(FL_OBJECT *obj); the color of the text of the currently selected item on top of the object can be set or queried. To control (or determine) the alignment of the text with the currently selected item on top of the select object use int fl_set_select_text_align(FLOBJECT *obj, int align); int fl_get_select_text_align(FLOBJECT *obj); Please note that the `*note FL_ALIGN_INSIDE::' flag should be set with `align' since the text always will be drawn within the boundaries of the object. On success the function return the old setting for the alignment or -1 on error. Finally, the font style and size of the text can be set or obtained using int fl_set_select_text_font(FL_OBJECT *obj, int style, int size); int fl_get_select_text_font(FL_OBJECT *obj, int *style, int *size); The rest of the appearance of a select object concerns the popup that is used. To avoid bloating the API unnecessarily no functions for select objects were added that would just call popup functions. The popup belonging to a select object can be easily found from either a `*note FL_POPUP_ENTRY::' structure as returned by the functions for searching for items or the `*note FL_POPUP_RETURN::' structure passed to all callbacks and also returned by `*note fl_get_select_item()::'. Both structures have a member called `popup' that is a pointer to the popup associated with the select object. For popup functions operation on indiviual items just use the pointer to the `*note FL_POPUP_ENTRY::' structure itself or the `entry' member of the `*note FL_POPUP_RETURN::' structure. There's also a convenience function for finding out the popup used for a select object: FL_POPUP *fl_get_select_popup(FL_OBJECT *obj); During the lifetime of a select object the popup never changes as long as `*note fl_set_select_popup()::' isn't called. Per default the popup of a select object does not have a title drawn on top of it. To change that use `*note fl_popup_set_title()::'. To change the various colors and fonts used when drawing the popup use the functions `*note fl_popup_set_color()::' and `*note fl_popup_entry_set_font()::' (and `*note fl_popup_set_title_font()::'). To change the border width or minimum width of the popup use `*note fl_popup_set_bw()::' and `*note fl_popup_set_min_width()::'. To disable or hide (or do the reverse) an item use the functions `*note fl_popup_entry_set_state()::' and `*note fl_popup_entry_get_state()::'. The keyboard shortcut for an entry can be set via `*note fl_popup_entry_set_shortcut()::'. The callback functions (selection, enter and leave callback) for individual items can be set via `*note fl_popup_entry_set_callback()::', `*note fl_popup_entry_set_enter_callback()::' and `*note fl_popup_entry_set_leave_callback()::', a callback for the whole popup with `*note fl_popup_set_callback()::'. Finally, to assign a different (long) value to an item or set a pointer to user data use `*note fl_popup_entry_set_value()::' and `*note fl_popup_entry_set_user_data()::'.  File: xforms.info, Node: Select Remarks, Prev: Select Attributes, Up: Select Object 19.1.5 Remarks -------------- See the demo program `select.c' for an example of the use of select objects.  File: xforms.info, Node: Nmenu Object, Next: Browser Object, Prev: Select Object, Up: Part III Choice Objects 19.2 Nmenu Object ================= Another object type that heavily depends on popups is the "nmenu" object type. It is meant to be used for menus and the "n" in front of the name stands for "new" since this is a re-implementation of the old menu object type (which is now deprecated since it is based on *note XPopup::). * Menu: * Adding Nmenu Objects: Adding Nmenu Objects * Nmenu Interaction: Nmenu Interaction * Other Nmenu Routines: Other Nmenu Routines * Nmenu Attributes: Nmenu Attributes * Remarks: Nmenu Remarks  File: xforms.info, Node: Adding Nmenu Objects, Next: Nmenu Interaction, Up: Nmenu Object 19.2.1 Adding Nmenu Objects --------------------------- To add a nmenu object use FL_OBJECT *fl_add_nmenu(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); There are currently three types: `FL_NORMAL_NMENU' Probably the most often used type: shown as text on a borderless background, popup gets opened when clicked on. `FL_NORMAL_TOUCH_NMENU' Also shown as text on a borderless background, but popup gets opened when the mouse is moved on top of it without any further user action required. `FL_BUTTON_NMENU' When not active shown as text on borderless background, when clicked on popup is shown and the object itself being displayed as a button. `FL_BUTTON_TOUCH_NMENU' When not active shown as text on borderless background, when mouse is moved onto it the popup is shown and the object itself is displayed as a button. Once a new nmenu object has been created items have to be added to it. For this the following function exists: FL_POPUP_ENTRY *fl_add_nmenu_items(FL_OBJECT *obj, const char items, ...); (The function can also be used to append new items to a nmenu object that already has items.) The function returns a pointer to the first menu entry added on success and `NULL' on failure. `items' is a string with the items to add, separated by the `'|'' character. In the simplest case you would just use something like `"Item 1|Item 2|Item 3"' to add three items to the list. As also described in the documentation for the similar function `*note fl_popup_add_entries()::' the text for an item may contain "special sequences" that start with the character `'%'' and then may require an additional argument passed to the function after the `items' argument. All of those described in detail in the documentation for the `*note fl_popup_add_entries()::' function can also be used for nmenus. Another way to set up the popup of a select object, using an array of *note FL_POPUP_ITEM:: structures, is via the function FL_POPUP_ENTRY *fl_set_nmenu_items(FL_OBJECT *obj, FL_POPUP_ITEM *item); The function returns a pointer to the first menu item on success and `NULL' on failure. The function expects as arguments a pointer to the nmenu object and an array of `*note FL_POPUP_ITEM::' structuress, with the very last element having `NULL' as the `text' member to mark the end of the array. The `text' member of the structure may contain the character sequence `"%S"' to have the text drawn for the item split up at that position and with everything before `"%S"' drawn left-flushed and the rest right-flushed. Moreover, `text' may start with the character `'/'' and/or `'_''. For an underline character a line is drawn above the item. And if there's a slash this item marks the begin of a sub-menu with all further items belonging to the sub-menu until a structure with member `text' being set to `NULL' is found in the array. (The `'/'' and `'_'' characters are, of course, not drawn.) `type' indicates the type of the item. It can be `FL_POPUP_NORMAL' A normal, plain item. `FL_POPUP_TOGGLE' An item that represents one of two states and is drawn with a check-marker when in "on" state. `FL_POPUP_RADIO' A radio item, i.e., it belongs to a group of items of which only one can be in "on" state at a time. They are drawn with a circle to the left with the circle for the "selected" item being filled with a color. Please note that if `text' starts with a `'/'' the type *must* be `FL_POPUP_NORMAL'. The `state' member per default is `*note FL_POPUP_NONE::'. It can be set to `FL_POPUP_NONE' No special flags are set for the state of the item. `FL_POPUP_DSABLED' The item is disabled and can't be selected. `FL_POPUP_HIDDEN' The item is hidden, i.e., does not get shown (and thus can't be selected). `FL_POPUP_CHECKED' Only relevant for toggle or radio items, marks it as in "on" state. `callback' is a function that will be called if the item is selected. The callback function has the following type: typedef int (*FL_POPUP_CB)(FL_POPUP_RETURN *); It receives a pointer to a structure that contains all information about the entry selected by the user: typedef struct { long int val; /* value assigned to entry */ void *user_data; /* pointer to user data */ const char *text; /* text of selected popup entry */ const char *label; /* text drawn on left side */ const char *accel; /* text drawn on right side */ const FL_POPUP_ENTRY *entry; /* selected popup entry */ const FL_POPUP *popup; /* (sub-)popup it belongs to */ } FL_POPUP_RETURN; `val' is a value that has been associated with the entry and `user_data' is a pointer that can be used to store the location of further information. `text' is the text that was used to create the entry (including all "special" characters), while `label' and `accel' are the texts shown for the entry on the left and right. `entry' is the pointer to the structure for the entry selected and `popup' to the (sub-) popup the entry belongs to (*note Part III Popups:: for more details on these structures). If the callback function already does all the work required on selection of the item have it return the value `FL_IGNORE' to keep the selection from being reported back to the main loop of the program. Finally, `shortcut' is a string encoding the keybord shortcut to be used for the item. There's also a third method to "populate" a menu. If you already created a popup than you can set it as the menu's popup via a call of int fl_set_nmenu_popup(FL_POPUP *popup); Of course, the popup you associate with the nmenu object in this way can't be a sub-popup.  File: xforms.info, Node: Nmenu Interaction, Next: Other Nmenu Routines, Prev: Adding Nmenu Objects, Up: Nmenu Object 19.2.2 Nmenu Interaction ------------------------ There are, if seen interaction-wise, two types of nmenu objects, normal ones and touch nmenus. For normal nmenus a popup is opened when the user clicks on the area of the nmenu object while for touch nmenus the popup already is shown when the user moves the mouse unto the area. In other respects they behave identical: the user just selects one of the items in the popup (or one of the sub-popups) and then the popup is closed again. The selection can now be handled within a callback function and/or reported back to the main loop of the program. The popup is always shown directly below the nmenu object (except for the case that the popup is that long that it wouldn't fit on the screen, in which case the popup is drawn above the nmenu's area. The most natural way to deal with a selection by the user is probably via a callback for the item that was selected. But also a callback for the popup as a whole or the object itself can be used. Item and popup callback functions are of type `*note FL_POPUP_CB::' described above (and in even more detail in *note Part III Popups::), while object callbacks are "normal" XForms callback functions. The condition under which a `FL_NMENU' object gets returned to the application (or an associate callback is invoked) can be influenced by calling the function int fl_set_object_return(FL_OBJECT *obj, unsigned int when) where `when' can have the following values `*note FL_RETURN_NONE::' Never return or invoke a callback. `*note FL_RETURN_END_CHANGED::' Return or invoke callback if end of interaction and selection of an item coincide. `*note FL_RETURN_CHANGED::' Return or invoke callback whenever an item is selected (this is the default). `*note FL_RETURN_END::' Return or invoke callback on end of an interaction. `*note FL_RETURN_ALWAYS::' Return (or invoke callback) whenever the interaction ends and/or an item is selected. One detail of the interaction that can be adjusted is under which conditions the nmenu's popup gets closed. Per default the popup is closed when an item is selected or (without a selection) when the user clicks somehwere outside of the popups area. This can be changed so that the popup also gets closed (without a selection) when the mouse button is clicked or released on a non-selectable item (giving the impression of a "pull-down" menu). For this purpose there's the int fl_set_nmenu_policy(FL_OBJECT *obj, int policy); function where `policy' can be one of two values: `FL_POPUP_NORMAL_SELECT' Default, popup stays open until mouse button is released on a selectable entry or button is clicked outside the popups area. `FL_POPUP_DRAG_SELECT' Popup is closed when the mouse button is released. The function returns on success the previous setting of the "policy" and -1 on error.  File: xforms.info, Node: Other Nmenu Routines, Next: Nmenu Attributes, Prev: Nmenu Interaction, Up: Nmenu Object 19.2.3 Other Nmenu Routines --------------------------- To find out which item of a nmenu object was selected last use FL_POPUP_RETURN *fl_get_nmenu_item(FL_OBJECT *obj); The function returns either a pointer to a `*note FL_POPUP_RETURN::' structure with informations about the selected item (as already discussed above when talking about callbacks) or `NULL' if no selection was made the last time the nmenu object was used. For some actions, e.g., deletion of an item etc., it is necessary to know the popup entry that represents it. Therefore it's possible to search the list of items according to several criteria: FL_POPUP_ENTRY *fl_get_nmenu_item_by_value(FL_OBJECT *obj, long val); FL_POPUP_ENTRY *fl_get_nmenu_item_by_label(FL_OBJECT *obj, const char *label); FL_POPUP_ENTRY *fl_get_nmenu_item_by_label(FL_OBJECT *obj, const char *text); The first function, `*note fl_get_nmenu_item_by_value()::', searches through the list of all items (including items in sub-popups) and returns the first one with the `val' associated with the item (or `NULL' if none is found). The second, `*note fl_get_nmenu_item_by_label()::' searches for a certain label as displayed for the item in the popup. The third, `*note fl_get_nmenu_item_by_text()::' searches for the text the item was created by (that might be the same as the label text in simple cases). Please note that all functions return a structure of type `*note FL_POPUP_ENTRY::' (and not `*note FL_POPUP_RETURN::', which gives you direct access to the entry in the popup for the item. Using e.g., the results of the above searches a nmenu item can be deleted: int fl_delete_nmenu_item(FL_OBJECT *obj, FL_POPUP_ENTRY *item); Alternatively, an item can be replaced by one or more items: FL_POPUP_ENTRY *fl_replace_nmenu_item(FL_OBJECT *obj, FL_POPUP_ENTRY *old, const char *new_items, ...); where `old' is the item to replace and `new_items' is a string exactly as used for `*note fl_add_nmenu_items()::' with informations about the new item(s). One also may insert additional items using FL_POPUP_ENTRY *fl_insert_nmenu_items(FL_OBJECT *obj, FL_POPUP_ENTRY *after, const char *new_items, ...); where `after' is the item after which the new items are to be inserted (use `NULL' to insert at the very start) and `new_items' is a string just like used with `*note fl_add_nmenu_items()::' with informations about the additional item(s). As you may remember, there are two different ways to "populate" a nmenu object. In one case you pass a kind of format string plus a variable number of arguments and in the other case an array of `*note FL_POPUP_ITEM::' structures. The previously listed functions for inserting and replacing used the first "interface". But there are also three functions for using the alternative interface: FL_POPUP_ENTRY *fl_add_nmenu_items2(FL_OBJECT *obj, FL_POPUP_ITEM *items); FL_POPUP_ENTRY *fl_insert_nmenu_items2(FL_OBJECT *obj, FL_POPUP_ENTRY *after, FL_POPUP_ITEM *items); FL_POPUP_ENTRY *fl_replace_nmenu_items2(FL_OBJECT *obj, FL_POPUP_ENTRY *old_item, FL_POPUP_ITEM *items); All three functions return a pointer to the first new entry in the nmenu's popup on success and `NULL' on failure. The all take a pointer to the nmenu object as their first argument. `*note fl_add_nmenu_items2()::' appends the items given by the list specified via the second argument to the nmenu's popup. `*note fl_insert_nmenu_items2()::' inserts one or more new items (as given by the last argument) after the entry specified by `after' (if `after' is `NULL' the new items are inserted before all existing items). Finally, `*note fl_replace_nmenu_items2()::' replaces the existing entry `old_item' with a new (or a list of new items specified by `items'. Finally, there's a function to remove all items from a nmenu object at once: in fl_clear_nmenu(FL_OBJECT *obj);  File: xforms.info, Node: Nmenu Attributes, Next: Nmenu Remarks, Prev: Other Nmenu Routines, Up: Nmenu Object 19.2.4 Nmenu Attributes ----------------------- While not "active" the background of the nmenu object is drawn in the color that can be controlled via the first color argument, `col1', of `*note fl_set_object_color()::'. When "active" (i.e., while the popup is shown) its background is drawn in the color of second color argument, `col2', of the same function. The color of the label when "inactive" is controlled via `*note fl_set_object_lcolor()::'. When in "active" state the color use for the label can be set via the function FL_COLOR fl_set_nmenu_hl_text_color(FL_OBJECT *obj, FL_COLOR color); The function returns the old color on success or `*note FL_MAX_COLORS::' on failure. Per default this color is `FL_BLACK' for nmenus that are shown as a button while being "active" while for normal nmenus it's the same color that is used items in the popup when the mouse is hovering over them. The size and style of the font used for the label of the nmenu object can be set via `*note fl_set_object_lsize()::' and `*note fl_set_object_lstyle()::'. The rest of the appearance of a nmenu object is given by the appearance of the popup. These can be directly set via the functions for setting the popup appearance as described in *note Popup Attributes::. To find out which popup is associated with the nmenu object use the function FL_POPUP *fl_get_nmenu_popup(FL_OBJECT *obj); and then use the popup specific functions to set the appearance. The same also holds for the appearance etc. of the items of the popup, a lot of functions exist that allow to set the attributes of entries of a popup, *note Popup Attributes::.  File: xforms.info, Node: Nmenu Remarks, Prev: Nmenu Attributes, Up: Nmenu Object 19.2.5 Remarks -------------- See the demo program `menu.c'.  File: xforms.info, Node: Browser Object, Prev: Nmenu Object, Up: Part III Choice Objects 19.3 Browser Object =================== The browser object class is probably the most powerful that currently exists in the Forms Library. A browser is a box that contains a number of lines of text. If the text does not fit inside the box, a scrollbar is automatically added so that the user can scroll through it. A browser can be used for building up a help facility or to give messages to the user. It is possible to create a browser from which the user can select lines. In this way the user can make its selections from a (possible) long list of choices. Both single lines and multiple lines can be selected, depending on the type of the browser. * Menu: * Adding Browser Objects: Adding Browser Objects * Browser Types: Browser Types * Browser Interaction: Browser Interaction * Other Browser Routines: Other Browser Routines * Browser Attributes: Browser Attributes * Remarks: Browser Remarks  File: xforms.info, Node: Adding Browser Objects, Next: Browser Types, Up: Browser Object 19.3.1 Adding Browser Objects ----------------------------- To add a browser to a form use the routine FL_OBJECT *fl_add_browser(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); The meaning of the parameters is as usual. The label is placed below the box by default.  File: xforms.info, Node: Browser Types, Next: Browser Interaction, Prev: Adding Browser Objects, Up: Browser Object 19.3.2 Browser Types -------------------- The following types of browsers exist (see below for more information about them): `FL_NORMAL_BROWSER' A browser in which no selections can be made. `FL_SELECT_BROWSER' In this type of browser the user can make single line selections which get reset immediately when the mouse button is released. `FL_HOLD_BROWSER' Same as `FL_SELECT_BROSER' but the selection remains visible till the next selection. `FL_DESELECTABLE_HOLD_BROWSER' Same as the `FL_HOLD_BROWSER' but the user can deselect the selected line. `FL_MULTI_BROWSER' Multiple selections can be made and remain visible till de-selected. Hence, the differences only lie in how the selection process works.  File: xforms.info, Node: Browser Interaction, Next: Other Browser Routines, Prev: Browser Types, Up: Browser Object 19.3.3 Browser Interaction -------------------------- The user can change the position of the slider or use keyboard cursor keys (including `', `', etc.) to scroll through the text. When he/she presses the left mouse below or above the slider, the browser scrolls one page up or down. Any other mouse button scrolls one line at a time (except wheel mouse buttons). When not using an `*note FL_NORMAL_BROWSER::' the user can also make selections with the mouse by pointing to a line or by using the cursor keys. For `*note FL_SELECT_BROWSER::''s, as long as the user keeps the left mouse button pressed, the current line under the mouse is highlighted. Whenever she releases the left mouse button the highlighting disappears and the browser is returned to the application program. The application program can now figure out which line was selected using a call of `*note fl_get_browser()::' to be described below. It returns the number of the last selected line (with the topmost line being line 1). A `*note FL_HOLD_BROWSER::' works exactly the same except that, when the left mouse button is released, the selection remains highlighted. A `*note FL_DESELECTABLE_HOLD_BROWSER::' additionally allows the user to undo a selection (by clicking on it again). An `*note FL_MULTI_BROWSER::' allows the user to select and de-select multiple lines. Whenever he selects or de-selects a line the browser object is returned to the application program (or a callback is executed when installed) that then can figure out which line was selected using `*note fl_get_browser()::' (described in more detail below). That function returns the number of the last line to be selected or de-selected. When a line was de-selected the negation of the line number gets returned. I.e., if line 10 was selected the routine returns 10 and if line 10 was de-selected -10. When the user presses the left mouse button on a non-selected line and then moves it with the mouse button still pressed down, he will select all lines he touches with his mouse until he releases it. All these lines will become highlighted. When the user starts pressing the mouse on an already selected line he de-selects lines rather than selecting them. Per default a browser only gets returned (or a possibly associated callback gets invoked) on selection of a line (and, in the case of `*note FL_MULTI_BROWSER::', on deselections). This behaviour can be changed by using the function int fl_set_object_return(FL_OBJECT *obj, unsigned int when) where `when' can have the following values `*note FL_RETURN_NONE::' Never return or invoke callback. `*note FL_RETURN_SELECTION::' Return or invoke callback on selection of a line. Please note that for `*note FL_MULTI_BROWSER::' the browser may be returned just once for a number of lines having been selected. `*note FL_RETURN_DESELECTION::' Return or invoke a callback on deselection of a line. This only happens for `*note FL_DESELECTABLE_HOLD_BROWSER::' and `*note FL_MULTI_BROWSER::' objects and, for the latter, the browser may get returned (or the callback invoked) just once for a number of lines having been deselected. `*note FL_RETURN_END_CHANGED::' Return or invoke callback at end (mouse release) if the text in the browser has been scrolled. `*note FL_RETURN_CHANGED::' Return or invoke callback whenever the text in the browser has been scrolled. `*note FL_RETURN_END::' Return or invoke callback on end of an interaction for scrolling the text in the browser regardless if the text was scrolled or not. `*note FL_RETURN_ALWAYS::' Return or invoke callback on selection, deselection or scrolling of text or end of scrolling. The default setting for `when' for a browser object is `*note FL_RETURN_SELECTION::|*note FL_RETURN_DESELECTION::' (unless during the built of XForms you set the configuration flag `--enable-bwc-bs-hack' in which case the default is `*note FL_RETURN_NONE::' to keep backward compatibility with earlier releases of the library).  File: xforms.info, Node: Other Browser Routines, Next: Browser Attributes, Prev: Browser Interaction, Up: Browser Object 19.3.4 Other Browser Routines ----------------------------- There are a large number of routines to change the contents of a browser, select and de-select lines, etc. To remove all lnes from a browser use void fl_clear_browser(FL_OBJECT *obj); To add a line to a browser use one of void fl_add_browser_line(FL_OBJECT *obj, const char *text); void fl_add_browser_line_f(FL_OBJECT *obj, const char *fmt, ...); The first function receives a simple string as the argument, the second one expects a format string just like for `printf()' etc. and followed by the appropriate number of arguments of the correct types. The line to be added may contain embedded newline characters (`'\n''). These will result in the text being split up into several lines, separated at the newline characters. A second way of adding a line to the browser is to use calls of void fl_addto_browser(FL_OBJECT *obj, const char *text); The difference to `*note fl_add_browser_line()::' and `*note fl_add_browser_line_f()::' is that with these calls the browser will be shifted such that the newly appended line is visible. This is useful when e.g., using the browser to display messages. Sometimes it may be more convenient to add characters to a browser without starting of a new line. To this end, the following routines exists void fl_addto_browser_chars(FL_OBJECT *obj, const char *text); void fl_addto_browser_chars_f(FL_OBJECT *obj, const char *fmt, ...); These functions appends text to the last line in the browser without advancing the line counter. The to functions differ in that the first one takes a simple string argument while the second expects a format string just as for `printf()' etc., followed by a corresponding number of arguments. Again the text may contain embedded newline characters (`'\n''). In that case, the text before the first embedded newline is appended to the last line, and everything afterwards is put onto new lines. As in the case of `*note fl_addto_browser()::' the last added line will be visible in the browser. You can also insert a line in front of a given line. All lines after it will be shifted. Note that the top line is numbered 1 (not 0). void fl_insert_browser_line(FL_OBJECT *obj, int line, const char *text); void fl_insert_browser_line_f(FL_OBJECT *obj, int line, const char *fmt, ...); The first function takes a simple string argument while the second one expects a format string as used for `printf()' etc. and the appropriate number of arguments (of the types specified in the format string). Please note that on insertion (as well as replacements, see below) embedded newline characters don't result in the line being split up as it's done in the previous functions. Instead they will rather likely appear as strange looking characters in the text shown. The only exception is when inserting into an empty browser or after the last line, then this function works exactly as if you had called `*note fl_add_browser_line()::' or `*note fl_add_browser_line_f()::'. To delete a line (shifting the following lines) use: void fl_delete_browser_line(FL_OBJECT *obj, int line); One can also replace a line using one of void fl_replace_browser_line(FL_OBJECT *obj, int line, const char *text); void fl_replace_browser_line_f(FL_OBJECT *obj, int line, const char *fmt, ...); The first one takes a simple string for the replacement text while for the second it is to be specified by a format string exactly as used in `printf()' etc. and the appropriate number of arguments of the types specifed in the format string. \ As in the case of `*note fl_insert_browser_line()::' and `*note fl_insert_browser_line_f()::' newline characters embedded into the replacement text don't have any special meaning, i.e., they don't result in replacement of more than a single line. Making many changes to a visible browser after another, e.g., clearing it and then adding a number of new lines, is slow because the browser is redrawn on each and every change. This can be avoided by using calls of `*note fl_freeze_form()::' and `*note fl_unfreeze_form()::'. So a piece of code that fills in a visible browser should preferably look like the following fl_freeze_form(browser->form); fl_clear_browser(browser); fl_add_browser_line(browser, "line 1"); fl_add_browser_line(browser, "line 2"); ... fl_unfreeze_form(brow->form); where `browser->form' is the form that contains the browser object named `browser'. To obtain the contents of a particular line in the browser, use const char *fl_get_browser_line(FL_OBJECT *obj, int line); It returns a pointer to the text of that line, exactly as it were passed to the function that created the line. It is possible to load an entire file into a browser using int fl_load_browser(FL_OBJECT *obj, const char *filename); The routine returns `1' when file could be successfully loaded, otherwise `0'. If the file name is an empty string (or the file could not be opened for reading) the browser is just cleared. This routine is particularly useful when using the browser for a help facility. You can create different help files and load the needed one depending on context. The application program can select or de-select lines in the browser. To this end the following calls exist with the obvious meaning: void fl_select_browser_line(FL_OBJECT *obj, int line); void fl_deselect_browser_line(FL_OBJECT *obj, int line); void fl_deselect_browser(FL_OBJECT *obj); The last call de-selects all lines. To check whether a line is selected, use the routine int fl_isselected_browser_line(FL_OBJECT *obj, int line); The routine int fl_get_browser_maxline(FL_OBJECT *obj); returns the number of lines in the browser. For example, when the application program wants to figure out which lines in a `*note FL_MULTI_BROWSER::' are selected code similar to the following can be used: int total_lines = fl_get_browser_maxline(browser); for (i = 1; i <= total_lines; i++) if (fl_isselected_browser_line(browser, i)) /* Handle the selected line */ Sometimes it is useful to know how many lines are visible in the browser. To this end, the following call can be used int fl_get_browser_screenlines(FL_OBJECT *obj); Please note that this count only includes lines that are shown completely in the browser, lines that are partially obscured aren't counted in. To obtain the last selection made by the user, e.g., when the browser is returned, the application program can use the routine int fl_get_browser(FL_OBJECT *obj); It returns the line number of the last selection being made (0 if no selection was made). When the last action was a de-selection (only for `*note FL_MULTI_BROWSER::') the negative of the de-selected line number is returned. The following function allows to find out the (unobscured) line that is currently shown at the top of the browser: int fl_get_browser_topline(FL_OBJECT *obj); Note that the index of the top line is `1', not `0'. A value of `0' is returned if the browser doesn't contain any lines. Finally, the function shifts the browsers content so that (as far as possible) the line indexed by `ln' is shown at the center of the browser. It is possible to register a callback function that gets called when a line is double-clicked on. To do so, the following function is available: void fl_set_browser_dblclick_callback(FL_OBJECT *obj, void (*cb)(FL_OBJECT *, long), ` long data); Of course, double-click callbacks make most sense for `*note FL_HOLD_BROWSER::'s. The part if the text visible within the browser can be set programmatically in a number of ways. With the functions void fl_set_browser_topline(FL_OBJECT *obj, int line); void fl_set_browser_bottomline(FL_OBJECT *obj, int line); the line shown at the top or the bottom can be set (note again that line numbers start with 1). Instead of by line number also the amount the text is scrolled in horizontal and vertical direction can be set with the functions void fl_set_browser_xoffset(FL_OBJECT *obj, FL_Coord xoff); void fl_set_browser_rel_xoffset(FL_OBJECT *obj, double xval); void fl_set_browser_yoffset(FL_OBJECT *obj, FL_Coord yoff); void fl_set_browser_rel_yoffset(FL_OBJECT *obj, double yval); where `xoff' and `yoff' indicate how many pixels to scroll horizontally (relative to the left margin) or vertically (relative to the top of the text), while `xval' and `yval' stand for positions relative to the total width or height of all of the text and thus have to be numbers between `0.0' and `1.0'. There are also a number of functions that can be used to obtain the current amount of scrolling: FL_Coord fl_get_browser_xoffset(FL_OBJECT *obj); FL_Coord fl_get_browser_rel_xoffset(FL_OBJECT *obj); FL_Coord fl_get_browser_yoffset(FL_OBJECT *obj); FL_Coord fl_get_browser_rel_yoffset(FL_OBJECT *obj); Finally, there's a function that tells you the vertical position of a line in pixels: int fl_get_browser_line_yoffset(FL_OBJECT *obj, imt line); The return value is just the value that would have to be passed to `*note fl_set_browser_yoffset()::' to make the line appear at the top of the browser. If the line does not exist it returns `-1' instead.  File: xforms.info, Node: Browser Attributes, Next: Browser Remarks, Prev: Other Browser Routines, Up: Browser Object 19.3.5 Browser Attributes ------------------------- Never use the boxtype `*note FL_NO_BOX::' for browsers. The first color argument (`col1') to `*note fl_set_object_color()::' controls the color of the browser's box, the second (`col2') the color of the selection. The text color is the same as the label color, `obj->lcol'. To set the font size used inside the browser use void fl_set_browser_fontsize(FL_OBJECT *obj, int size); To set the font style used inside the browser use void fl_set_browser_fontstyle(FL_OBJECT *obj, int style); *Note Label Attributes and Fonts::, for details on font sizes and styles. It is possible to change the appearance of individual lines in the browser. Whenever a line starts with the symbol `'@'' the next letter indicates the special characteristics associated with this line. The following possibilities exist at the moment: `f' Fixed width font. `n' Normal (Helvetica) font. `t' Times-Roman like font. `b' Boldface modifier. `i' Italics modifier. `l' Large (new size is `*note FL_LARGE_SIZE::'). `m' Medium (new size is `*note FL_MEDIUM_SIZE::'). `s' Small (new size is `*note FL_SMALL_SIZE::'). `L' Large (new size = current size + 6) `M' Medium (new size = current size + 4) `S' Small (new size = current size - 2). `c' Centered. `r' Right aligned. `_' Draw underlined text. `-' An engraved separator. Text following `'-'' is ignored. `C' The next number indicates the color index for this line. `N' Non-selectable line (in selectable browsers). `' '' (a space character) Does nothing, can be used to separate between the digits specifying a color (following `"@C"', see above) and the text of a line starting with a digit. `@@' Regular `'@'' character. The modifiers (bold and itatic) work by adding `*note FL_BOLD_STYLE::' and `*note FL_ITALIC_STYLE::' to the current active font index to look up the font in the font table (you can modify the table using `*note fl_set_font_name()::' or `*note fl_set_font_name_f()::'). More than one option can be used by putting them next to each other. For example, `"@C1@l@f@b@cTitle"' will give you the red, large, bold fixed font, centered word `"Title"'. As you can see the font change requests accumulate and the order is important, i.e., `"@f@b@i"' gives you a fixed bold italic font while `"@b@i@f"' gives you a (plain) fixed font. Depending on the font size and style lines may have different heights. In some cases the character `'@'' might need to be placed at the beginning of the lines without introducing the special meaning mentioned above. In this case you can use `"@@"' or change the special character to something other than `'@'' using the following routine void fl_set_browser_specialkey(FL_OBJECT *obj, int key); To align different text fields on a line, tab characters (`'\t'') can be embedded in the text. See `*note fl_set_tabstop()::' on how to set tabstops. There are two functions to turn the scrollbars on and off: void fl_set_browser_hscrollbar(FL_OBJECT *obj, int how); void fl_set_browser_vscrollbar(FL_OBJECT *obj, int how); `how' can be set to the following values: `FL_ON' Always on. `FL_OFF' Always off. `FL_AUTO' On only when needed (i.e., there are more lines/chars than could be shown at once in the browser). `FL_AUTO' is the default. Please note that when you switch the scrollbars off the text can't be scrolled by the user anymore at all (i.e., also not using methods that don't use scrollbars, e.g., using the cursor keys). Sometimes, it may be desirable for the application to obtain the scrollbar positions when they change (e.g., to use the scrollbars of one browser to control other browsers). There are two ways to achieve this. You can use these functions: typedef void (*FL_BROWSER_SCROLL_CALLBACK)(FL_OBJECT *, int, void *); void fl_set_browser_hscroll_callback(FL_OBJECT *obj, FL_BROWSER_SCROLL_CALLBACK cb, void *cb_data); void fl_set_browser_vscroll_callback(FL_OBJECT *obj, FL_BROWSER_SCROLL_CALLBACK cb, void *cb_data); After scroll callbacks are set whenever the scrollbar changes position the callback function is called as cb(ob, offset, cb_data); The first argument to the callback function `cb' is the browser object, the second argument is the new xoffset for the horizontal scrollbar or the new top line for the vertical scrollbar. The third argument is the callback data specified as the third argument in the function calls to install the callback. To uninstall a scroll callback, use a `NULL' pointer as the callback function. As an alternative you could request that the browser object gets returned (or a callback invoked) when the the scrollbar positions are changed. This can be done e.g., by passing `*note FL_RETURN_CHANGED::' (if necessary `OR''ed with flags for also returning on selection/deselections). Within the code for dealing with the event you could check if this is a change event by using the function int fl_get_object_return_state(FL_OBJECT *obj); and test if `*note FL_RETURN_CHANGED::' is set in the return value (by just logically `AND''ing both) and then handle the change. By default, the scrollbar size is based on the relation between the size of the browser and the size of the text. To change the default, use the following routine void fl_set_browser_scrollbarsize(FL_OBJECT *obj, int hh, int vw); where `hh' is the horizontal scrollbar height and `vw' is the vertical scrollbar width. Use 0 to indicate the default. The default scrollbar type is `FL_THIN_SCROLLBAR'. There are two ways you can change the default. One way is to use `*note fl_set_defaults()::' or `*note fl_set_scrollbar_type()::' to set the application wide default, another way is to use `*note fl_get_object_component()::' to get the object handle to the scrollbars and change the the object type forcibly. The first method is preferable because the user can override the setting via resources. Although the second method of changing the scrollbar type is not recommended, the object handle obtained can be useful in changing the scrollbar colors etc. Finally there is a routine that can be used to obtain the browser size in pixels for the text area void fl_get_browser_dimension(FL_OBJECT *obj, FL_Coord *x, FL_Coord *y, FL_COORD *w, FL_COORD *h); where `x' and `y' are measured from the top-left corner of the form (or the smallest enclosing window). To establish the relationship between the text area (a function of scrollbar size, border with and text margin), you can compare the browser size and text area size. Finally, the functions int fl_get_browser_scrollbar_repeat(FL_OBJECT *obj); void fl_set_browser_scrollbar_repeat(FL_OBJECT *obj, int millisec); allows to determine and control the time delay (in milliseconds) between jumps of the scrollbar knob when the mouse button is kept pressed down on the scrollbar outside of the knobs area. The default value is 100 ms. The delay for the very first jump is twice that long in order to avoid jumping to start too soon when only a single click was intended but the user is a bit slow in releasing the mouse button.  File: xforms.info, Node: Browser Remarks, Prev: Browser Attributes, Up: Browser Object 19.3.6 Remarks -------------- Since version 1.0.92 there isn't a limit on the maximum length of lines in a browser anymore. (The macro `FL_BROWSER_LINELENGTH' still exists and is set to 2048 for backward compatibility but has no function anymore). See `fbrowse1.c' for an example program using a `*note FL_NORMAL_BROWSER::' to view files. `browserall.c' shows all different browsers. `browserop.c' shows the insertion and deletion of lines in a `*note FL_HOLD_BROWSER::'. For the browser class, especially multi browsers, interaction via callbacks is strongly recommended.  File: xforms.info, Node: Part III Container Objects, Next: Part III Other Objects, Prev: Part III Choice Objects, Up: Top 20 Container Objects ******************** * Menu: * Folder Object: Folder Object * FormBrowser Object: FormBrowser Object  File: xforms.info, Node: Folder Object, Next: FormBrowser Object, Up: Part III Container Objects 20.1 Folder Object ================== A tabbed folder is a special container class that is capable of holding multiple groups of objects (folders) to maximize the utilization of the screen real estate. Each folder has its own tab the user can click on to call up a specific folder from which option can be selected. [image src="xforms_images/folders.png"] * Menu: * Adding Folder Objects: Adding Folder Objects * Folder Types: Folder Types * Folder Interaction: Folder Interaction * Other Folder Routines: Other Folder Routines * Remarks: Folder Remarks  File: xforms.info, Node: Adding Folder Objects, Next: Folder Types, Up: Folder Object 20.1.1 Adding Folder Objects ---------------------------- To add a tabbed folder to a form use the routine FL_OBJECT *fl_add_tabfolder(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); The geometry indicated by `x', `y', `w', and `h' is the total area of the tabbed folders, including the area used for the tab riders.  File: xforms.info, Node: Folder Types, Next: Folder Interaction, Prev: Adding Folder Objects, Up: Folder Object 20.1.2 Folder Types ------------------- The following types are available: `FL_TOP_TABFOLDER' Tabs on top of the folders. `FL_BOTTOM_TABFOLDER' Tabs at the bottom of the folders.  File: xforms.info, Node: Folder Interaction, Next: Other Folder Routines, Prev: Folder Types, Up: Folder Object 20.1.3 Folder Interaction ------------------------- The folders displayed by the tabbed folder class are simply regular forms (of type `FL_FORM'), which in turn contain objects. Each folder is associated with a name (shown on the tab rider). The folder interacts with the user just like any other form. Different from other top-level forms is that only one folder is active at any time. The user selects different folders by clicking on the tab rider associated with a folder. To set up when the application is notified about events of the tabfolder or the tabfolders callback is invoked (if installed) use void fl_set_object_return(FL_OBJECT *obj, unsigned int when); where the `when' argument can be one of `*note FL_RETURN_NONE::' Never report or invoke callback even if the selected folder has been changed. `*note FL_RETURN_CHANGED::' `*note FL_RETURN_END_CHANGED::' Result in a notification when a folder other that the currently active one has been selected (this is the default). `*note FL_RETURN_END::' `*note FL_RETURN_ALWAYS::' Notify when either a new or the already active folder has been selected. In the releases before version 1.0.92 of the library only a callback for the folder was executed (if one was installed) on change of the selected folder bur not via e.g., `*note fl_do_forms()::' etc. This has changed with version 1.0.92. To get the old behaviour you have to build XForms with the `--enable-bwc-bs-hack' being set. To find out which folder is currently active the following routines the tab riders are available FL_FORM *fl_get_active_folder(FL_OBJECT *obj); int fl_get_active_folder_number(FL_OBJECT *obj); const char *fl_get_active_folder_name(FL_OBJECT *obj); All three functions essentially perform the same task, i.e., return a handle of the active folder, but the kind of handle returned is different. The first function returns the form associated with the folder, the second function the folder sequence number starting from 1 on the left, and the third the folder name. Depending on the application setup, one routine might be more convenient than the other two. To find out what the previous active folder was (which may be of similar interest as the currently active one) the following functions can be used: FL_FORM *fl_get_folder(FL_OBJECT *obj) int fl_get_folder_number(FL_OBJECT *obj) const char *fl_get_folder_name(FL_OBJECT *obj) Again, depending on the application, one might prefer one routine to the other two.  File: xforms.info, Node: Other Folder Routines, Next: Folder Remarks, Prev: Folder Interaction, Up: Folder Object 20.1.4 Other Folder Routines ---------------------------- To populate a tabbed folder, use the following routine FL_OBJECT *fl_addto_tabfolder(FL_OBJECT *obj, const char *tab_name, FL_FORM *folder) where `tab_name' is a string (with possible embedded newlines in it) indicating the text of the tab rider and `folder' is a regular form created between calls of `*note fl_bgn_form()::' and `*note fl_end_form()::'. Only the pointer to the form is required. This means that the application program should not destroy a form that has been added to a tabbed folder. The function returns the folder tab object, which is an object of class `FL_BUTTON'. The initial object color, label color, and other attributes (gravities, for example) of the tab button are inherited from the tabbed folder object `obj' and the location and size of the tab are determined automatically. You can change the attributes of the returned object just like any other objects, but not all possibilities result in a pleasing appearance. Note that although there is no specific requirement of what the backface of the folder/form should be, a boxtype other than `FL_FLAT_BOX' or `FL_NO_BOX' may not look nice. If the backface of the form is of `FL_FLAT_BOX' the associated tab will take on the color of the backface when activated. One thing to note is that each tab must have its own form, i.e., you should not associate the same form with two different tabs. However, you can create copies of a form and use these copies. To access the individual forms on the tabfolder, e.g., in order to modify something on it, use the following routines FL_FORM *fl_get_tabfolder_folder_bynumber(FL_OBJECT *obj, int num); FL_FORM *fl_get_tabfolder_folder_byname(FL_OBJECT *obj, const char *name); FL_FORM *fl_get_tabfolder_folder_byname_f(FL_OBJECT *obj, const char *fnt, ...); The functions take either the sequence number (the first tab on the left has a sequence number 1, the second 2 etc) or the tab name, which can either be passed directly as a string or via a format string like for `printf()' etc. and the corresponding (unspecified) arguments. The functions return the form associated with the number or the name. If the requested number or name is invalid, `NULL' is returned. If there are more tabs than that can be shown, the right-most tab will be shown as "broken". Clicking on the "broken" tab scrolls the tab to the right one per each click. To scroll to the left (if there are tabs scrolled-off screen from the left), clicking on the first tab scrolls right. How many tabs are "hidden" on the left can be determined and also set using the functions int fl_get_tabfolder_offset(FL_OBJECT *ojb); int gl_set_tabfolder_offset(FL_OBJECT *obj, int offset); where `offset' is the number of tabs hidden on the left. Although a regular form (top-level) and a form used as a folder behave almost identically, there are some differences. In a top-level form, objects that do not have callbacks bound to them will be returned, when their states change, to the application program via `*note fl_do_forms()::' or `*note fl_check_forms()::'. When a form is used as a folder, objects that do not have a callback are ignored even when their states changes. The reason for this behavior is that presumably the application does not care while the changes take place and they only become relevant when the the folder is switched off and at that time the application program can decide what to do with these objects' states (apply or ignore for example). If immediate reaction is desired, just use callback functions for these objects. To obtain the number of folders in the tabfolder, the following routine can be used int fl_get_tabfolder_numfolders(FL_OBJECT *obj); To remove a folder, the following routine is available void fl_delete_folder(FL_OBJECT *obj, FL_FORM *folder); void fl_delete_folder_bynumber(FL_OBJECT *obj, int num); void fl_delete_folder_byname(FL_OBJECT *obj, const char *name); void fl_delete_folder_byname_f(FL_OBJECT *obj, const char *fmt, ...); (the last two function differ in the way the tab names gets passed, the first is to be called with a simple string while the second expects a format string as used for `printf()' etc. and the appropriate number of arguments, from which the tab name gets constructed). wNote that after deletion, the number of folders in the tabfolder as well as the sequence numbers are updated. This means if you want to delete all folders after the second folder, you can do that by deleting the third folder repeatedly. The application program can select which folder to show by using the following routines void fl_set_folder(FL_OBJECT *obj, FL_FORM *folder); void fl_set_folder_bynumber(FL_OBJECT *obj, int num); void fl_set_folder_byname(FL_OBJECT *obj, const char *name); void fl_set_folder_byname_f(FL_OBJECT *obj, const char *fmt, ...); (The latter two functions only differ in the way the tab name gets passed top them, the first accepts a simple string while the second expects a format string as used for `printf()' etc. and the appropriate number of (unspecified arguments, from which the tab name is constructed.) Since the area occupied by the tabbed folder contains the space for tabs, the following routine is available to obtain the actual folder size void fl_get_folder_area(FL_OBJECT *obj, FL_Coord *x, FL_Coord *y, FL_OBJECT *w, FL_OBJECT *h) where `x' and `y' are relative to the (top-level) form the tabbed folder belongs to. The size information may be useful for resizing the individual forms that has to go into the tabbed folder. Note that the folder area may not be constant depending on the current tabs (For example, adding a multi-line tab will reduce the area for the folders). Since tab size can vary depending on monitor/font resolutions, it is in general not possible to design the forms (folders) so they fit exactly into the folder area. To dynamically adjust the sizes of the folders so they fit, the following routine is available int fl_set_tabfolder_autofit(FL_OBJECT *obj, int how); where `how' can be one of the following constants: `FL_NO' Do not scale the form. `FL_FIT' Always scale the form. `FL_ENLARGE_ONLY' Scale the form only if it is smaller than the folder area. The function returns the old setting.  File: xforms.info, Node: Folder Remarks, Prev: Other Folder Routines, Up: Folder Object 20.1.5 Remarks -------------- By default, the tab for each folder is drawn with a corner of 3 pixels so it appears to be a trapezoid rather than a square. To change the appearance of the tabs, you can adjust the corner pixels using the following routine int fl_set_default_tabfolder_corner(int n); where `n' is the number of corner pixels. A value of 1 or 0 makes the tabs appear to be squarish. The function returns the old value. A tabbed folder is a composite object consisting of a canvas and several foldertab buttons. Each individual form is shown inside the canvas. Folder switching is accomplished by some internal callbacks bound to the foldertab button. Should the application change the callback functions of the foldertab buttons, these new callback functions must take the responsibility of switching the active folder. Some visual effects like colors and label font of the tab rider buttons can be set all at once by calling the corresponding functions (i.e., `*note fl_set_object_color()::', `*note fl_set_object_lstyle()::' etc.) with the tabbed folder object as the first argument. Individual tab rider buttons can also be modified by calling those function with the corresponding return value of `*note fl_addto_tabfolder()::' as the first argument. `fl_free_object(tabfolder)' does not free the individual forms that make up the tabfolder. See the demo program `folder.c' for an example use of tabbed folder class. A nested tabfolder might not work correctly at the moment.  File: xforms.info, Node: FormBrowser Object, Prev: Folder Object, Up: Part III Container Objects 20.2 FormBrowser Object ======================= A form browser is another container class that is capable of holding multiple forms, the height of which in aggregate may exceed the screen height. The form browser also works obviously for a single form that has a height that is larger than the screen height. This object class was developed with contributed code from Steve Lamont of UCSD and the National Center for Microscopy and Imaging Research (). * Menu: * Adding FormBrowser Objects: Adding FormBrowser Objects * FormBrowser Types: FormBrowser Types * FormBrowser Interaction: FormBrowser Interaction * Other FormBrowser Routines: Other FormBrowser Routines * Remarks: FormBrowser Remarks  File: xforms.info, Node: Adding FormBrowser Objects, Next: FormBrowser Types, Up: FormBrowser Object 20.2.1 Adding FormBrowser Objects --------------------------------- Adding an object To add a formbrowser object to a form use the routine FL_OBJECT *fl_add_formbrowser(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); The geometry indicated by `x', `y', `w' and `h' is the total area of the formbrowser, including scrollbars.  File: xforms.info, Node: FormBrowser Types, Next: FormBrowser Interaction, Prev: Adding FormBrowser Objects, Up: FormBrowser Object 20.2.2 FormBrowser Types ------------------------ There's only a single type of formbrowser available, the `FL_NORMAL_FORMBROWSER'.  File: xforms.info, Node: FormBrowser Interaction, Next: Other FormBrowser Routines, Prev: FormBrowser Types, Up: FormBrowser Object 20.2.3 FormBrowser Interaction ------------------------------ Once a formbrowser is populated with forms, you can scroll the forms with the scrollbars and interact with any of the forms. All objects on the forms act, for the most part, the same way as they would if they were on separate forms, i.e., if there are callback functions bound to the objects, they will be invoked by the main loop when the states of the objects change. However, objects on the form that do not have callbacks bound to them will not be returned by `*note fl_do_forms()::' or `*note fl_check_forms()::'. Your application can be notified about changes of the scrollbars of the formbrowser. To set up under which conditions the application is notified or the formbrowsers callback is invoked (if installed) use void fl_set_object_return(FL_OBJECT *obj, unsigned int when); where the `when' argument can be one of `*note FL_RETURN_NONE::' Never report or invoke callback (this is the default for the formbrowser object) `*note FL_RETURN_CHANGED::' Result in a notification whenever the position of one of the scrollbars has changed. `*note FL_RETURN_END_CHANGED::' Notification is sent if the position of a scrollbar has changed and the mouse button has been released. `*note FL_RETURN_END::' Notification on release of the mouse button. `*note FL_RETURN_ALWAYS::' Notify if the position of a scrollbar has changed or the mouse button has been released.  File: xforms.info, Node: Other FormBrowser Routines, Next: FormBrowser Remarks, Prev: FormBrowser Interaction, Up: FormBrowser Object 20.2.4 Other FormBrowser Routines --------------------------------- To populate a formbrowser, use the following routine int fl_addto_formbrowser(FL_OBJECT *obj, FL_FORM *form); where `form' is a pointer to a regular form created between calls of `*note fl_bgn_form()::' and `*note fl_end_form()::'. Only the form pointer is passed to the function, which means that the form should be valid for the duration of the formbrowser and the application program should not destroy a form that is added to a formbrowser before deleting the form from the formbrowser first. The function returns the total number of forms in the formbrowser. Note that although there is no specific requirement on what the backface of the form should be, not all boxtypes look nice. The form so added is appended to the list of forms that are already in the formbrowser. You can also use the following routine to obtain the total number of forms in a formbrowser int fl_get_formbrowser_numforms(FL_OBJECT *formbrowser); Although a regular form (top-level) and a form used inside a formbrowser behave almost identically, there are some differences. In a top-level form, objects that do not have callbacks bound to them will be returned to the application program when their states change via `*note fl_do_forms()::' or `*note fl_check_forms()::'. When a form is used as member of a formbrowser those objects that do not have callbacks are ignored even when their states change. To remove a form from the formbrowser, the following routine is available int fl_delete_formbrowser(FL_OBJECT *obj, FL_FORM *form); FL_FORM* fl_delete_formbrowser_bynumber(FL_OBJECT *obj, int num); In the first function you specify the form to be removed from the formbrowser by a pointer to the form. If the form was removed successfully the function returns the remaining number of forms in the formbrowser, otherwise -1. In the second function, you indicate the form to be removed with a sequence number, an integer between 1 and the number of forms in the browser. The sequence number is basically the order in which forms were added to the formbrowser. After a form is removed, the sequence numbers are re-adjusted so they are always consecutive. The function returns `NULL' if `num' was invalid, otherwise it returns address of the form that was removed. To replace a form in formbrowser, the following routine is available FL_FORM *fl_replace_formbrowser(FL_OBJECT *obj, int num, FL_FORM *form); where `num' is the sequence number of the form that is to be replaced by `form'. For example, to replace the first form in the browser with a different form, you should use 1 for `num'. The function returns the form that has been replaced on success, otherwise `NULL' is returned. You can also insert a form into a formbrowser at arbitrary locations using the following routine int fl_insert_formbrowser(FL_OBJECT *obj, int num, FL_FORM *form); where `num' is the sequence number before which the new form `form' is to be inserted into the formbrowser. If successful the function returns the number of forms in the formbrowser, otherwise -1. To find out the sequence number of a particular form, the following routine is available int fl_find_formbrowser_form_number(FL_OBJECT *obj, FL_FORM *form); The function returns a number between 1 and the number of forms in the formbrowser on success, otherwise 0. To obtain the form handle from the sequence number, use the following routine int fl_get_formbrowser_form(FL_OBJECT *obj, int num); By default, if the size of the forms exceeds the size of the formbrowser, scrollbars are added automatically. You can use the following routines to control the scrollbars void fl_set_formbrowser_hscrollbar(FL_OBJECT *obj, int how); void fl_set_formbrowser_vscrollbar(FL_OBJECT *obj, int how); where `how' can be one of the following `FL_ON' Always on. `FL_OFF' Always off. `FL_AUTO' On when needed. This is the default. The vertical scrollbar by default scrolls a fixed number of pixels. To change it so each action of the scrollbar scrolls to the next forms, the following routine is available void fl_set_formbrowser_scroll(FL_OBJECT *obj, int how) where `how' can be one of the following `FL_SMOOTH_SCROLL' The default. `FL_JUMP_SCROLL' Scrolls in form increments. To obtain the form that is currently the first form in the formbrowser visible to the user, the following can be used FL_FORM *fl_get_formbrowser_topform(FL_OBJECT *obj); You can also set which form to show by setting the top form using the following routine int fl_set_formbrowser_topform(FL_OBJECT *obj, FL_FORM *form); FL_FORM* fl_set_formbrowser_topform_bynumber(FL_OBJECT *obj, int num); The first function returns the sequence number of the form and the second function returns the form with sequence number `num'. Since the area occupied by the formbrowser contains the space for the scrollbars, the following routine is available to obtain the actual size of the forms area void fl_get_formbrowser_area(FL_OBJECT *obj, int *x, int *y, int *w, int *h); where `x' and `y' are relative to the (top-level) form the formbrowser belongs to. To programatically scroll within a formbrowser in horizontal and vertical direction, the following routines are available int fl_set_formbrowser_xoffset(FL_OBJECT *obj, int offset); int fl_set_formbrowser_yoffset(FL_OBJECT *obj, int offset); where `offset' is a positive number, measuring in pixels the offset from the the natural position from the left and the top, respectively. In other words, 0 indicates the natural position of the content within the formbrowser. An x-offset of 10 means the content is scrolled 10 pixels to the left. Similarly an y-offset of 10 means the content is scrolled by 10 pixels upwards. To obtain the current offsets, use the following routines int fl_get_formbrowser_xoffset(FL_OBJECT *obj); int fl_get_formbrowser_yoffset(FL_OBJECT *obj);  File: xforms.info, Node: FormBrowser Remarks, Prev: Other FormBrowser Routines, Up: FormBrowser Object 20.2.5 Remarks -------------- A call of `fl_free_object(formbrowser)' does not free the individual forms, it only frees the formbrowser object itself. See the demo program `formbrowser.c' for an example use of formbrowser class. A nested formbrowser might not work correctly at the moment.  File: xforms.info, Node: Part III Other Objects, Next: Part III Popups, Prev: Part III Container Objects, Up: Top 21 Other Objects **************** * Menu: * Timer Object: Timer Object * XYPlot Object: XYPlot Object * Canvas Object: Canvas Object  File: xforms.info, Node: Timer Object, Next: XYPlot Object, Up: Part III Other Objects 21.1 Timer Object ================= Timer objects can be used to make a timer that runs down toward 0 or runs up toward a pre-set value after which it starts blinking and returns itself to the application program. This can be used in many different ways, for example, to give a user a certain amount of time for completing a task, etc. Also hidden timer objects can be created. In this case the application program can take action at the moment the timer expires. For example, you can use this to show a message that remains visible until the user presses the "OK" button or until a certain amount of time has passed. The precision of the timer is not very high. Don't count on anything better than, say, 50 milli-seconds, especially when the system is rather busy. The timer can trigger early by up to 10 ms. Run the demo `timerprec.c' for an actual accuracy measurement. * Menu: * Adding Timer Objects: Adding Timer Objects * Timer Types: Timer Types * Timer Interaction: Timer Interaction * Other Timer Routines: Other Timer Routines * Timer Attributes: Timer Attributes * Remarks: Timer Remarks  File: xforms.info, Node: Adding Timer Objects, Next: Timer Types, Up: Timer Object 21.1.1 Adding Timer Objects --------------------------- To add a timer to a form you use the routine FL_OBJECT *fl_add_timer(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); The meaning of the parameters is as usual.  File: xforms.info, Node: Timer Types, Next: Timer Interaction, Prev: Adding Timer Objects, Up: Timer Object 21.1.2 Timer Types ------------------ There are at the moment three types of timers: `FL_NORMAL_TIMER' Visible, Shows a label in a box which blinks when the timer expires. `FL_VALUE_TIMER' Visible, showing the time left or the elapsed time. Blinks if the timer expires. `FL_HIDDEN_TIMER' Not visible.  File: xforms.info, Node: Timer Interaction, Next: Other Timer Routines, Prev: Timer Types, Up: Timer Object 21.1.3 Timer Interaction ------------------------ When a visible timer expires it starts blinking. The user can stop the blinking by pressing the mouse on it or by resetting the timer to 0. The timer object is returned to the application program or its callback called when the timer expired per default. You can also switch off reporting the expiry of the timer by calling int fl_set_object_return(FL_OBJECT *obj, unsigned int when) with `when' set to `*note FL_RETURN_NONE::'. To re-enable reporting call it with one of `*note FL_RETURN_CHANGED::', `*note FL_RETURN_END::', `*note FL_RETURN_END_CHANGED::' or `*note FL_RETURN_ALWAYS::'.  File: xforms.info, Node: Other Timer Routines, Next: Timer Attributes, Prev: Timer Interaction, Up: Timer Object 21.1.4 Other Timer Routines --------------------------- To set the timer to a particular value use void fl_set_timer(FL_OBJECT *obj, double delay); `delay' gives the number of seconds the timer should run. Use 0.0 to reset/de-blink the timer. To obtain the time left in the timer use double fl_get_timer(FL_OBJECT *obj); By default, a timer counts down toward zero and the value shown (for `FL_VALUE_TIMER's) is the time left until the timer expires. You can change this default so the timer counts up and shows elapsed time by calling void fl_set_timer_countup(FL_OBJECT *obj, int yes_no); with a true value for the argument `yes_no'. A timer can be temporarily suspended (stopwatch) using the following routine void fl_suspend_timer(FL_OBJECT *obj); and later be resumed by void fl_resume_timer(FL_OBJECT *obj); Unlike `*note fl_set_timer()::' a suspended timer keeps its internal state (total delay, time left etc.), so when it is resumed, it starts from where it was suspended. Finally there is a routine that allows the application program to change the way the time is presented in `FL_VALUE_TIMER': typedef char *(FL_TIMER_FILTER)(FL_OBJECT *obj, double secs); FL_TIMER_FILTER fl_set_timer_filter(FL_OBJECT *obj, FL_TIMER_FILTER filter); The function `filter' receives the timer ID and the time left for count-down timers and the elapsed time for up-counting timers (in units of seconds) and should return a string representation of the time. The default filter returns the time in a `hour:minutes:seconds.fraction' format.  File: xforms.info, Node: Timer Attributes, Next: Timer Remarks, Prev: Other Timer Routines, Up: Timer Object 21.1.5 Timer Attributes ----------------------- Never use `FL_NO_BOX' as the boxtype for `FL_VALUE_TIMER's. The first color argument (`col1') to `*note fl_set_object_color()::' controls the color of the timer, the second (`col2') is the blinking color.  File: xforms.info, Node: Timer Remarks, Prev: Timer Attributes, Up: Timer Object 21.1.6 Remarks -------------- Although having different APIs and the appearance of a different interaction behaviour, the way timers and timeout callbacks work is almost identical with one exception: you can deactivate a timer by deactivating the form it belongs to. While the form is deactivated, the timers callback will not be called, even if it expires. The interaction will only resume when the form is activated again. See `timer.c' for the use of timers.  File: xforms.info, Node: XYPlot Object, Next: Canvas Object, Prev: Timer Object, Up: Part III Other Objects 21.2 XYPlot Object ================== A xyplot object gives you an easy way to display a tabulated function generated on the fly or from an existing data file. An active xyplot is also available to model and/or change a function. * Menu: * Adding XYPlot Objects: Adding XYPlot Objects * XYPlot Types: XYPlot Types * XYPlot Interaction: XYPlot Interaction * Other XYPlot Routines: Other XYPlot Routines * XYPlot Attributes: XYPlot Attributes * Remarks: XYPlot Remarks  File: xforms.info, Node: Adding XYPlot Objects, Next: XYPlot Types, Up: XYPlot Object 21.2.1 Adding XYPlot Objects ---------------------------- To add an xyplot object to a form use the routine FL_OBJECT *fl_add_xyplot(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); It shows an empty box on the screen with the label per default below it.  File: xforms.info, Node: XYPlot Types, Next: XYPlot Interaction, Prev: Adding XYPlot Objects, Up: XYPlot Object 21.2.2 XYPlot Types ------------------- The following types are available: `FL_NORMAL_XYPLOT' A solid line is drawn through the data points. `FL_SQUARE_XYPLOT' Data drawn as a solid line plus squares at data points. `FL_CIRCLE_XYPLOT' Data drawn as a solid line plus circles at data points. `FL_FILL_XYPLOT' Data drawn as a solid line with the area under the curve filled. Only data points are drawn with. per default, stars. `FL_LINEPOINTS_XYPLOT' Data drawn as a solid line plus, per default, stars at data point. `FL_DASHED_XYPLOT' Data drawn as a dashed line. `FL_DOTTED_XYPLOT' Data drawn as a dotted line. `FL_DOTDASHED_XYPLOT' Data drawn as a dash-dot-dash line. `FL_IMPULSE_XYPLOT' Data drawn by vertical lines. `FL_ACTIVE_XYPLOT' Data drawn as a solid line plus squares at data points, accepting manipulations. `FL_EMPTY_XYPLOT' Only the axes are drawn. All xyplots per default display the curve auto-scaled to fit the plotting area. Although there is no limitation on the actual data, a non-monotonic increasing (or decreasing) x-axis might be plotted incorrectly. XYPlots of type `FL_POINTS_XYPLOT' and `FL_LINEPOINTS_XYPLOT' are special in that the application can change the symbol drawn on the data point.  File: xforms.info, Node: XYPlot Interaction, Next: Other XYPlot Routines, Prev: XYPlot Types, Up: XYPlot Object 21.2.3 XYPlot Interaction ------------------------- Only `FL_ACTIVE_XYPLOT' report mouse events by default. Clicking and dragging the data points (marked with little squares) will change the data and result in the object getting returned to the application (or the object's callback getting invoked). By default, the reporting happens only when the mouse is released. In some situations, reporting changes as soon as they happen might be desirable. To control when mouse events are returned use the function int fl_set_object_return(FL_OBJECT *obj, unsigned int when); where `when' can have the folowing values: `*note FL_RETURN_NONE::' Never return or invoke callback. `*note FL_RETURN_END_CHANGED::' Return or invoke callback at end (mouse release) if one of the points has been moved to a different place. This is the default. `*note FL_RETURN_CHANGED::' Return or invoke callback whenever a point has been moved. `*note FL_RETURN_END::' Return or invoke callback at end (mouse release) regardless if a point has been moved is changed or not. `*note FL_RETURN_ALWAYS::' Return or invoke callback when a point has been moved or the mouse button has been release). Please note: an object can also be in inspect mode (see function `*note fl_set_xyplot_inspect()::' below). In this case the object gets returned (or its callback invoked) for all of the above settings except (`*note FL_RETURN_NONE::') when the mouse was released on top of one of the points. To obtain the current value of the point that has changed, use the routine void fl_get_xyplot(FL_OBJECT *obj, float *x, float *y, int *i); where via `i' the data index (starting from 0) is returned while via `x' and `y' the actual data point gets returned. If no point has changed `i' will be set to -1. It is possible to switch drawing of the squares that mark an active plot on and off (default is on) using the following routine void fl_set_xyplot_mark_active(FL_OBJECT *obj, int yes_no); with `yes_no' being set to false (0). To set or replace the data for an xyplot, use void fl_set_xyplot_data(FL_OBJECT *obj, float *x, float *y, int n, const char *title, const char *xlabel, const char *ylabel); void fl_set_xyplot_data_double(FL_OBJECT *obj, double *x, double *y, int n, const char *title, const char *xlabel, const char *ylabel); (The `fl_set_xyplot_data_double()' function allows to pass data of type `double' but which get "demoted" to `float' type when assigned to the xyplot object.) Here `x', `y' is the tabulated function, and `n' is the number of data points. If the xyplot object being set already exists old data will be cleared. Note that the tabulated function is copied internally so you can free or do whatever you want with the `x' and `y' arrays after the function has returned. `title' is a title that is drawn above the XYPlot and `xlabel' and `ylabel' are the labels drawn at the x- and y-axes. You can also load a tabulated function from a file using the routine int fl_set_xyplot_file(FL_OBJECT *obj, const char *filename, const char *title, const char *xlabel, const char *ylabel); The data file should be an ASCII file consisting of data lines. Each data line must have two columns, indicating the (x,y) pair with a space, tab or comma separating the two columns. Lines that start with any of `!', `;' or `#' are considered to be comments and are ignored. The functions returns the number of data points successfully read or 0 if the file couldn't be opened. To get a copy of the current XYPLot data, use int fl_get_xyplot_data_size(FL_OBJECT *obj); void fl_get_xyplot_data(FL_OBJECT *obj, float *x, *float y, int *n); The first function returns the number of data points which the second will return. The caller must supply the space for the data returned by `fl_get_xyplot_data()'. The last argument of that function is again the number of points that got returned. All XYPlot objects can be made aware of mouse clicks by using the following routine void fl_set_xyplot_inspect(FL_OBJECT *obj, int yes_no); Once an XYPlot is in inspect mode, whenever the mouse is released and the mouse position is on one of the data point, the object is returned to the caller or its callback is invoked. You then can use `*note fl_get_xyplot()::' to find out which point the mouse was clicked on. Note that for an object of type `*note FL_ACTIVE_XYPLOT::' the data can't be modified while in inspect mode! Another, perhaps even more general, way to obtain the values from an XYPlot is to use a posthandler or an overlay positioner. See demo `xyplotall.c' for the use of posthandler and `positionerXOR.c' for an example of reading-out xyplot values using an overlayed positioner.  File: xforms.info, Node: Other XYPlot Routines, Next: XYPlot Attributes, Prev: XYPlot Interaction, Up: XYPlot Object 21.2.4 Other XYPlot Routines ---------------------------- There are several routines to change the appearance of an XYPlot. First of all, you can change the number of tic marks using the following routine void fl_set_xyplot_xtics(FL_OBJECT *obj, int major, int minor); void fl_set_xyplot_ytics(FL_OBJECT *obj, int major, int minor); where `major' and `minor' are the number of tic marks to be placed on the axis and the number of divisions between major tic marks. In particular, -1 suppresses the tic marks completely while 0 restores the default settings (which is 5 for the major and 2 for the minor tic arguments). Note that the actual scaling routine may choose a value other than that requested if it decides that this would make the plot look nicer, thus `major' and `minor' are only taken as a hint to the scaling routine. However, in almost all cases the scaling routine will not generate a major tic that differs from the requested value by more than 3. Normally the minor tics of logarithmic scales are drawn equidistant. To have them also drawn logarithmically use the functions int fl_set_xyplot_log_minor_xtics(FL_OBJECT *obj, int yesno); int fl_set_xyplot_log_minor_ytics(FL_OBJECT *obj, int yesno); With this enabled e.g., the minor tics between 1 and 10 (when the interval is to be divided into 5 subintervals) will be drawn at the positions 2, 4, 6, and 8 instead of at 10^0.2, 10^0.4, 10^0.6 and 10^0.8. The functions return the previous setting. It is possible to label the major tic marks with alphanumerical characters instead of numerical values. To this end, use the following routines void fl_set_xyplot_alphaxtics(FL_OBJECT *obj, const char *major, const char *minor); void fl_set_xyplot_alphaytics(FL_OBJECT *obj, const char *major, const char *minor); where `major' is a string specifying the labels with the embedded character `|' that specifies major divisions. For example, to label a plot with Monday, Tuesday etc, `major' should be given as `"Monday|Tuesday|..."'. Parameter `minor' is currently unused and the minor divisions are set to 1, i.e, no divisions between major tic marks. Naturally the number of major/minor divisions set by this routine and `*note fl_set_xyplot_xtics()::' and `*note fl_set_xyplot_ytics()::' can't be active at the same time and the one that gets used is the one that was set last. The above two functions can also be used to specify non-uniform and arbitary major divisions. To achieve this you must embed the major tic location information in the alphanumerical text. The location information is introduced by the `@' symbol and followed by a float or integer number specifying the coordinates in world coordinates. The entire location info should follow the label. For example, `"Begin@1|3/4@0.75|1.9@1.9"' will produce three major tic marks at 0.75, 1.0, and 1.9 with labels "3/4", "begin" and "1.9". To get a gridded XYPlot use the following routines void fl_set_xyplot_xgrid(FL_OBJECT *obj, int xgrid); void fl_set_xyplot_ygrid(FL_OBJECT *obj, int ygrid); where `xgrid' and `ygrid' can be one of the following `FL_GRID_NONE' No grid. `FL_GRID_MAJOR' Grid for the major divisions only. `FL_GRID_MINOR' Grid for both the major and minor divisions. The grid line by default is drawn using a dotted line, which you can change using the routine int fl_set_xyplot_grid_linestyle(FL_OBJECT *obj, int style); where `style' is the line style (`FL_SOLID', `FL_DASH' etc. *Note Drawing Objects: Part IV Drawing Objects, for a complete list). The function returns the old grid linestyle. By default, the plotting area is automatically adjusted for tic labels and titles so that a maximum plotting area results. This can in certain situations be undesirable. To control the plotting area manually, the following routines can be used void fl_set_xyplot_fixed_xaxis(FL_OBJECT *obj, const char *lm, const char *rm) void fl_set_xyplot_fixed_yaxis(FL_OBJECT *obj, const char *bm, const char *tm) where `lm' and `rm' specify the right and left margin, respectively, and `bm' and `tm' the bottom and top margins. The pixel amounts are computed using the current label font and size. Note that even for y-axis margins the length of the string, not the height, is used as the margin, thus to leave space for one line of text, a single character (say `m') or two narrow characters (say `ii') should be used. To restore automatic margin computation, set all margins to `NULL'. To change the size of the symbols drawn at data points, use the following routine void fl_set_xyplot_symbolsize(FL_OBJECT *obj, int size); where `size' should be given in pixels. The default is 4. For `FL_POINTS_XYPLOT' and `FL_LINEPOINTS_XYPLOT' (main plot or overlay), the application program can change the symbol using the following routine typedef void (*FL_XYPLOT_SYMBOL)(FL_OBJECT *, int id, FL_POINT *p, int n, int w, int h); FL_XYPLOT_SYMBOL fl_set_xyplot_symbol(FL_OBJECT *obj, int id, FL_XYPLOT_SYMBOL symbol); where `id' is the overlay id (0 means the main plot, and you can use -1 to indicate all), and `symbol' is a pointer to the function that will be called to draw the symbols on the data point. The parameters passed to this function are the object pointer, the overlay `id', the center of the symbol (`p->x', `p->y'), the number of data points (`n') and the preferred symbol size (`w', `h'). If the type of the XYPlot corresponding to `id' is not `FL_POINTS_XYPLOT' or `FL_LINESPOINTS_XYPLOT', the function will not be called. To change for example a `FL_LINEPOINTS_XYPLOT' XYPlot to plot filled small circles instead of the default crosses, the following code could be used void drawsymbol(FL_OBJECT *obj, int id, FL_POINT *p, int n, int w, int h) { int r = (w + h) / 4; FL_POINT *ps = p + n; for (; p < ps; p++) fl_circf(p->x, p->y, r, FL_BLACK); } ... fl_set_xyplot_symbol(xyplot, 0, drawsymbol); ... If a Xlib drawing routine is used it should use the current active window (`FL_ObjWin(obj)') and the current GC. Take care not to call routines inside the `drawsymbol()' function that could trigger a redraw of the XYPlot (such as `*note fl_set_object_color()::', `*note fl_set_xyplot_data()::' etc.). To use absolute bounds (as opposed to the bounds derived from the data), use the following routines void fl_set_xyplot_xbounds(FL_OBJECT *obj, double min, double max); void fl_set_xyplot_ybounds(FL_OBJECT *obj, double min, double max); Data that fall outside of the range set this way will be clipped. To restore autoscaling, call the function with `max' and `min' set to exactly the same value. To reverse the axes (e.g., `min' at right and `max' at left), set `min > max' for that axis. To get the current bounds, use the following routines void fl_get_xyplot_xbounds(FL_OBJECT *obj, float *min, float *max); void fl_get_xyplot_ybounds(FL_OBJECT *obj, float *min, float *max); To replace the value of a particular point use the routine void fl_replace_xyplot_point(FL_OBJECT *obj, int index, double x, double y); Here `index' is the index of the value to be replaced. The first value has an index of 0. It is possible to overlay several plots together by calling void fl_add_xyplot_overlay(FL_OBJECT *obj, int id, float *x, float *y, int npoints, FL_COLOR col); where `id' must be between 1 and `FL_MAX_XYPLOTOVERLAY' (currently 32). This limit can be raised (or lowered) by calling the function `*note fl_set_xyplot_maxoverlays()::'. Again, the data are copied to an internal buffer (old data are freed if necessary). As for the base data, a data file can be used to specify the (x,y) function int fl_add_xyplot_overlay_file(FL_OBJECT *obj, int ID, const char *file, FL_COLOR col); The function returns the number of data points successfully read. The type (`FL_NORMAL_XYPLOT' etc.) used in overlay plot is the same as the object itself. To change an overlay style, use the following call void fl_set_xyplot_overlay_type(FL_OBJECT *obj, int id, int type); Note that although the API of adding an overlay is similar to adding an object, an XYPlot overlay is not a separate object. It is simply a property of an already existing XYPlot object. To get the data of an overlay, use the following routine void fl_get_xyplot_overlay_data(FL_OBJECT *obj, int id, float x[], float y[], int *n); where `id' specifies the overlay number between 1 and `FL_MAX_XYPLOTOVERLAY' or the number set via `*note fl_set_xyplot_maxoverlays()::' (see below). (Actually, when `id' is zero, this function returns the base data). The caller must supply the storage space for the data. Upon function return, `n' will be set to the number of data points retrieved. Sometimes it may be more convenient and efficient to get the pointer to the data rather than a copy of the data. To this end, the following routine is available void fl_get_xyplot_data_pointer(FL_OBJECT *obj, int id, float **x, float **y, int *n); Upon function return, `x' and `y' are set to point to the data storage. You're free to modify the data and redraw the XYPlot (via `*note fl_redraw_object()::'). The pointers returned may not be freed. If needed, the maximum number of overlays an object can have (which by default is 32) can be changed using the following routine int fl_set_xyplot_maxoverlays(FL_OBJECT *obj, int maxoverlays); The function returns the previous maximum number of overlays. If the new number is smaller that what it was before overlays with IDs higher that the previous number are deleted. To obtain the number of data points, use the routine int fl_get_xyplot_numdata(FL_OBJECT *obj, int id); where `id' is the overlay ID (with 0 being the base data set). To insert a point into an xyplot, use the following routine void fl_insert_xyplot_data(FL_OBJECT *obj, int id, int n, double x, double y); where `id' is the overlay ID; `n' is the index of the point after which the data new point specified by `x' and `y' is to be inserted. Set `n' to -1 to insert the point in front. To append to the data, set `n' to be equal or larger than the return value of `fl_get_xyplot_numdata(obj, id)'. To delete an overlay, use the following routine void fl_delete_xyplot_overlay(FL_OBJECT *obj, int id); It is possible to place inset texts on an XYPlot using the following routine (up to `FL_MAX_XYPLOTOVERLAY' or the value set via `*note fl_set_xyplot_maxoverlays()::' of such insets can be accommodated): void fl_add_xyplot_text(FL_OBJECT *obj, double x, double y, const char *text, int align, FL_COLOR col); where `x' and `y' are the (world) coordinates where text is to be placed and align specifies the placement options relative to the specified point (See `*note fl_set_object_lalign()::' for valid options). If you for example specify `FL_ALIGN_LEFT', the text will appear on the left of the point and flushed toward the point (see Fig. 21.1). This is mostly consistent with the label alignment except that now the bounding box (of the point) is of zero dimension. Normal text interpretation applies, i.e., if text starts with `@' a symbol is drawn. To remove an inset text, use the following routine void fl_delete_xyplot_text(FL_OBJECT *obj, const char *text); Another kind of inset is the "keys" to the plots. A key is the combination of drawing a segment of the plot line style with a piece of text that describes what the corrsponding line represents. Obviously, keys are most useful when you have more than one plot (i.e., overlays). To add a key to a particular plot, use the following routine void fl_set_xyplot_key(FL_OBJECT *obj, int id, const char *keys); where `id' again is the overlay ID. To remove a key, set the key to `NULL'. All the keys will be drawn together inside a box. The position of the keys can be set via void fl_set_xyplot_key_position(FL_OBJECT *obj, float x, float y, int align) where `x' and `y' should be given in world coordinates. `align' specifies the alignment of the entire key box relative to the given position (see Fig.21.1). The following routine combines the above two functions and may be more convenient to use void fl_set_xyplot_keys(FL_OBJECT *obj, char *keys[], float x, float y, int align); where `keys' specifies the keys for each plot. The last element of the array must be `NULL' to indicate the end. The array index is the plot id, i.e., `key[0]' is the key for the base plot, `key[1]' the key for the the first overlay etc. To change the font the key text uses, the following routine is available void fl_set_xyplot_key_font(FL_OBJECT *obj, int style, int size); Data may be interpolated using an nth order Lagrangian polynomial: void fl_set_xyplot_interpolate(FL_OBJECT *obj, int id, int degree, double grid); where `id' is the overlay ID (use 0 for the base data set); `degree' is the order of the polynomial to use (between 2 and 7) and `grid' is the working grid onto which the data are to be interpolated. To restore the default linear interpolation, use `degree' set to 0 or 1. To change the line thickness of an xyplot (base data or overlay), the follow routine is available: void fl_set_xyplot_linewidth(FL_OBJECT *obj, int id, int width); Again, use a `id' of value 0 to indicate the base data. Setting `width' to zero restores the server default and typically is the fastest. By default, a linear scale in both the x and y direction is used. To change the scaling, use the following call void fl_set_xyplot_xscale(FL_OBJECT *obj, int scale, double base); void fl_set_xyplot_yscale(FL_OBJECT *obj, int scale, double base); where the valid scaling options for scale are q`FL_LINEAR' and `FL_LOG', and `base' is used only for `FL_LOG' and in that case is the base of the logarithm to be used. Use the following routine to clear an xyplot void fl_clear_xyplot(FL_OBJECT *obj); This routine frees all data associated with an XYPlot, including all overlays and all inset texts. This routine does not reset all plotting options, such as line thickness, major/minor divisions etc. nor does it free all memories associated with the XYPlot, for this `*note fl_free_object()::' is needed. The mapping between the screen coordinates and data can be obtained using the following routines void fl_get_xyplot_xmapping(FL_OBJECT *obj, float *a, float *b); void fl_get_xyplot_xmapping(FL_OBJECT *obj, float *a, float *b); where `a' and `b' are the mapping constants and are used as follows: screenCoord = a * data + b (linear scale) screenCoord = a * log(data) / log(p) + b (log scale) where `p' is the base of the requested logarithm. If you need to do conversions only occasionally (for example, converting the position of a mouse click to a data point or vice versa) the following routines might be more convenient void fl_xyplot_s2w(FL_OBJECT *obj, double sx, double sy, float *wx, float *wy); void fl_xyplot_w2s(FL_OBJECT *obj, double wx, double wy, float *sx, float *sy); where `sx' and `sy' are the screen coordinates and `wx' and `wy' are the world coordinates. Finally, there's a function for returning the coordinates of the area of the object used for drawing the data (i.e., the area, when axes are displayed, which is enclosed by the axes): void fl_get_xyplot_screen_area(FL_OBJECT *obj, FL_COORD *llx, FL_COORD *lly, FL_COORD *urx, FL_COORD *ury); void fl_get_xyplot_world_area(FL_OBJECT *obj, float *llx, float *lly, float *urx, float *ury); where via `llx' and `lly' the coordinates of the lower left hand corner and via `urx' and `ury' those of the upper right hand corner are returned. The first function returns the corner positions in screen coordinates (relative to the object), while the secoind returns them in "world" coordinates. Per default an XYPlot object only reacts to the left mouse button. But sometimes it can be useful to modify this. To set this call void fl_set_xyplot_mouse_buttons(FL_OBJECT *obj, int mbuttons); `mbuttons' is the bitwise OR of the numbers 1 for the left mouse button, 2 for the middle and 4 for the right mouse button. To determine which mouse buttons an XYPlot object reacts to use void fl_get_xyplot_mouse_buttons(FL_OBJECT *obj, unsigned int *mbuttons); The value returned via `mbuttons' is the same value as would be used in `*note fl_set_slider_mouse_buttons()::'.  File: xforms.info, Node: XYPlot Attributes, Next: XYPlot Remarks, Prev: Other XYPlot Routines, Up: XYPlot Object 21.2.5 XYPlot Attributes ------------------------ Don't use `FL_NO_BOX' as the boxtype of an XYPlot object that is to be changed dynamically. To change the font size and style for the tic labels, inset text etc., use `*note fl_set_object_lsize()::' and `*note fl_set_object_lstyle()::'. The first color argument (`col1') to `*note fl_set_object_color()::' controls the color of the box and the second (`col2') the actual XYPlot color.  File: xforms.info, Node: XYPlot Remarks, Prev: XYPlot Attributes, Up: XYPlot Object 21.2.6 Remarks -------------- The interpolation routine is public and can be used in the application program int fl_interpolate(const float *inx, const float *iny, int num_in, float *outx, float *outy, double grid, int ndeg); If successful, the function returns the number of points in the interpolated function (`(inx[num_in - 1] - inx[0]) / grid + 1.01'), otherwise it returns -1. Upon return, `outx' and `outy' are set to the interpolated values. The caller must allocate the storage for `outx' and `outy'. See `xyplotall.c' and `xyplotactive.c' for examples of the use of XYPlot objects. There is also an example program called `xyplotover.c', which shows the use of overlays. In addition, `xyplotall.c' shows a way of getting all mouse clicks without necessarily using an active XYPlot. It is possible to generate a PostScript output of an XYPlot. See the function `*note fl_object_ps_dump()::' documented in Part V.  File: xforms.info, Node: Canvas Object, Prev: XYPlot Object, Up: Part III Other Objects 21.3 Canvas Object ================== A canvas is a managed plain X (sub)window. It it different from the free object in that a canvas is guaranteed to be associated with a window that is not shared with any other object, thus an application program has more freedom in utilizing a canvas, such as using its own colormap or rendering double-buffered OpenGL in it etc. A canvas is also different from a raw application window because a canvas is decorated differently and its geometry is managed, e.g., you can use `*note fl_set_object_resize()::' to control its position and size after its parent form is resized. You also should be aware that when using a canvas you'll probably mostly program directly using basic Xlib functions, XForms doesn't supply much more than a few helper functions. You'll rather likely draw to it with Xlib functions and will be dealing with `XEvent's yourself (instead having them taken care of by XForms and cenverted to some simpler to use events that then just return the object from `*note fl_do_forms()::' or invoke an associated callback function. Thus you will typically need a basic knowledge of how to program via the X11 Xlib. * Menu: * Adding Canvas Objects: Adding Canvas Objects * Canvas Types: Canvas Types * Canvas Interaction: Canvas Interaction * Other Canvas Routines: Other Canvas Routines * Canvas Attributes: Canvas Attributes * OpenGL Canvas: OpenGL Canvas  File: xforms.info, Node: Adding Canvas Objects, Next: Canvas Types, Up: Canvas Object 21.3.1 Adding Canvas Objects ---------------------------- Adding an object To add a canvas to a form you use the routine FL_OBJECT *fl_add_canvas(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); The meaning of the parameters is as usual. The label is not drawn but used as the window name for possible resource and playback purposes. If label is empty, the window name will be generated on the fly as `flcanvasn', where `n = 0, 1,...'.  File: xforms.info, Node: Canvas Types, Next: Canvas Interaction, Prev: Adding Canvas Objects, Up: Canvas Object 21.3.2 Canvas Types ------------------- The only types of canvases currently available is `FL_NORMAL_CANVAS'.  File: xforms.info, Node: Canvas Interaction, Next: Other Canvas Routines, Prev: Canvas Types, Up: Canvas Object 21.3.3 Canvas Interaction ------------------------- The canvas class is designed to maximize the programmer's ability to deal with situations where standard form classes may not be flexible enough. With canvases, the programmer has complete control over everything that can happen to a window. It thus doesn't work like other objects that get returned by `*note fl_do_forms()::' etc. or have their callbacks invoked. Instead the user can request that for specific `X' events (not XForms object events like `FL_PRESS', `FL_KEYPRESS' etc.!) callbacks are invoked that receive all information about the `XEvent' that led to their invocation. This obviously requires some understanding of how the X Window system works. The interaction with a canvas is typically set up as follows. First, you register the `X' events you're interested in and their handlers using the following routine typedef int (*FL_HANDLE_CANVAS)(FL_OBJECT *obj, Window win, int win_width, int win_height, XEvent *xev, void *user_data); void fl_add_canvas_handler(FL_OBJECT *obj, int event, FL_HANDLE_CANVAS handler, void *user_data); where `event' is the `XEvent' type, e.g., `Expose' etc. The `*note fl_add_canvas_handler()::' function first registers a procedure with the event dispatching system of the Forms Library, then it figures out the event masks corresponding to the event `event' and invokes `*note fl_addto_selected_xevent()::' to solicit the event from the server. Other book keeping (e.g., drawing the box that encloses the canvas, etc.) is done by the object handler. When a canvas handler is installed the library tries to set the correct mask for the the `XEvent' (which then tells the X Window system which events to pass on to the Forms Library). But since translation from an `XEvent' to an `XEvent' mask is not unique, the default translation of the `XEvent' to a mask may or may not match exactly the intention of the application. Two events, namely `MotionNotify' and `ButtonPress', are likely candidates that need further clarification from the application. There are two functions to add or delete from the mask, `*note fl_addto_selected_xevent()::' and `*note fl_remove_selected_xevent()::'. By default, when a mouse motion handler (i.e., for the `MotionNotify' events) is registered, it is assumed that, while the application wants to be informed about mouse movements, it's not interested in a continous motion monitoring (tracking), thus per default `MotionNotify' events are requested with `PointerMotionHintMask' being set in the mask to reduce the number of events generated. If this is not the case and in fact the application wants to use the mouse motion as some type of graphics control, the default behavior would appear "jerky" as not every mouse motion is reported. To change the default behavior so that every mouse motion is reported, you need to call `*note fl_remove_selected_xevent()::' with mask set to `PointerMotionHintMask'. Furthermore, the mouse motion is reported regardless if a mouse button is pressed or not. If the application is interested in mouse motion only when a mouse button is pressed `*note fl_remove_selected_xevent()::' should be called with a mask of `PointerMotionMask|PointerMotionHintMask'. With `ButtonPress' events you need to call `*note fl_addto_selected_xevent()::' with a mask of `OwnerGrabButtonMask' if you are to add or remove other canvas handlers in the button press handler. To remove a registered handler, use void fl_remove_canvas_handler(FL_OBJECT *obj, int event, FL_CANVAS_HANDLER handler); After this function call the canvas ceases to receive the events for `event'. The corresponding default bits in the `XEvent' mask as were set by `*note fl_add_canvas_handler()::' are cleared. If you added extra ones with `*note fl_addto_selected_xevent()::' you should reset them using `*note fl_remove_selected_xevent()::'. To obtain the window ID of a canvas, use Window fl_get_canvas_id(FL_OBJECT *obj); or use the generic function (macro) (recommended) Window FL_ObjWin(FL_OBJECT *obj); Of course, the window ID only has a meaning after the form/canvas is shown. When the canvas or the form the canvas is on is hidden (via `*note fl_hide_object()::' or `*note fl_hide_form()::'), the canvas window may be destroyed. If the canvas is shown again, a new window ID for the canvas may be created. Thus recording the canvas window ID in a static variable is not the right thing to do. It is much safer (and it doesn't add any run-time overhead) to obtain the canvas window ID via `*note FL_ObjWin()::' whenever it's needed. If your application must show and hide the canvas/form repeatedly, you might consider to "unmap" the window, a way of removing the window from the screen without actually destroying it and later re-mapping the window to show it. The Xlib API functions for doing this are `XUnmapWindow()' and `XMapWindow()'. Both require two arguments. the display, which you can determine by calling `*note fl_get_display()::' and the window ID, which can be obtained by using `form->window' if you want to (un)map a form or `FL_ObjWin(obj)' for a canvas.  File: xforms.info, Node: Other Canvas Routines, Next: Canvas Attributes, Prev: Canvas Interaction, Up: Canvas Object 21.3.4 Other Canvas Routines ---------------------------- Upon canvas creation, all its window related attributes, e.g., visual, depth and colormap etc., are inherited from its parent (i.e., the window of the form the canvas belongs to). To modify any attributes of the canvas, use the following routine void fl_set_canvas_attributes(FL_OBJECT *obj, unsigned mask, XSetWindowAttributes *xswa); See `XSetWindowAttributes()' for the definition of the structure members. Note that this routine should not be used to manipulate events. Other functions exists that can be used to modify the color/visual property of a canvas: void fl_set_canvas_colormap(FL_OBJECT *obj, Colormap map); Colormap fl_get_canvas_colormap(FL_OBJECT *obj); void fl_set_canvas_visual(FL_OBJECT *obj, Visual *vi); void fl_set_canvas_depth(FL_OBJECT *obj, int depth); int fl_get_canvas_depth(FL_OBJECT *obj); Note that changing visual or depth does not generally make sense once the canvas window is created (which happens when the parent form is shown). Also, typically if you change the canvas visual, you probably should also change the canvas depth to match the visual. Caution should also applied when using `*note fl_set_canvas_colormap()::': when the canvas window goes away, e.g., as a result of a call of `*note fl_hide_form()::', the colormap associated with the canvas is freed (destroyed). This likely will cause problems if a single colormap is used for multiple canvases as each canvas will attempt to free the same colormap, resulting in an X error. If your application works this way, i.e., the same colormap is used on multiple canvases (via `*note fl_set_canvas_colormap()::'), you should use the following routine to prevent the canvas from freeing the colormap: void fl_share_canvas_colormap(FL_OBJECT *obj, Colormap colormap); This function works the same way as `*note fl_set_canvas_colormap()::' except that it also sets a internal flag so the colormap isn't freed when the canvas goes away. By default, canvases are decorated with an `FL_DOWN_FRAME'. To change the decoration, change the the boxtype of the canvas and the boxtype will be translated into a frame that best approximates the appearance of the request boxtype (e.g., a `FL_DOWN_BOX' is translated into a `FL_DOWN_FRAME' etc). Note that not all frame types are appropriate for decorations. The following routine is provided to facilitate the creation of a colormap appropriate for a given visual to be used with a canvas: Colormap fl_create_colormap(XVisualInfo *xvinfo, int n_colors); where `n_colors' indicates how many colors in the newly created colormap should be filled with XForms' default colors (to avoid flashing effects). Note however, that the colormap entry 0 is allocated with either black or white even if you specify 0 for `n_colors'. To prevent this from happening (so you get a completely empty colormap), set `n_colors' to -1. *Note Drawing Objects: Part IV Drawing Objects, on how to obtain the `XVisualInfo' for the window. Depending on the window manager, a colormap other than the default may not get installed correctly. If you're working with such a window manager, you may have to install the colormap yourself when the mouse pointer enters the canvas using `XInstallColormap()'. By default, objects with shortcuts appearing on the same form as the canvas will "steal" keyboard inputs if they match the shortcuts. To disable this feature, use the following routine with a false (0) value for `yes_no': void fl_canvas_yield_to_shortcut(FL_OBJECT *obj, int yes_no); To clear the canvas use void fl_clear_canvas(FL_OBJECT *obj); If `*note fl_set_object_color()::' gas been called on the object the first color passed to the function will be used to draw the background of the color, otherwise it's drawn in black.  File: xforms.info, Node: Canvas Attributes, Next: OpenGL Canvas, Prev: Other Canvas Routines, Up: Canvas Object 21.3.5 Canvas Attributes ------------------------ Some of the attributes, such as boxtype, do not apply to the canvas class. The first color argument (`col1') to `*note fl_set_object_color()::' can be used to set the background color of the canvas (by default, a canvas has no background color). The second argument (`col2') controls the decoration color (if applicable).  File: xforms.info, Node: OpenGL Canvas, Prev: Canvas Attributes, Up: Canvas Object 21.3.6 OpenGL Canvas -------------------- Deriving specialized canvases from the general canvas object is possible. See the next subsection for general approaches how this is done. The following routines work for OpenGL (under X) as well as Mesa, a free OpenGL clone. To add an OpenGL canvas to a form, use the following routine FL_OBJECT *fl_add_glcanvas(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); where `type' is the same as for a normal canvas. A "glcanvas" created this way will have the following attributes by default GLX_RGBA, GLX_DEPTH_SIZE: 1, GLX_RED_SIZE: 1, GLX_GREEN_SIZE: 1, GLX_BLUE_SIZE: 1, GLX_DOUBLEBUFFER The application program can modify these defaults using the following routine (before the creation of glcanvases) void fl_set_glcanvas_defaults(const int *attributes); See `glXChooseVisual()' for a list of valid attributes. To get the current defaults use void fl_get_glcanvas_defaults(int *attributes); It is also possible to change the attributes on a canvas by canvas basis by utilizing the following routine: void fl_set_glcanvas_attributes(FL_OBJECT *obj, const int *attributes); Note that this routine can be used to change a glcanvas attributes on the fly even if the canvas is already visible and active. To obtain the attributes of a particular canvas, use the following routine void fl_get_glcanvas_attributes(FL_OBJECT *obj, int attributes[]); The caller must supply the space for the attribute values. To obtain the the glx context (for whatever purposes), use GLXContext fl_get_glcanvas_context(FL_OBJECT *obj); Note that by default the rendering context created by a glcanvas uses direct rendering (i.e., by-passing the Xserver). To change this default, i.e., to always render through the Xserver, use the following routine: void fl_set_glcanvas_direct(FL_OBJECT *obj, int yes_no); with the argument `yes_no' set to false (0). Remember that OpenGL drawing routines always draw into the window the current context is bound to. For application with a single canvas, this is not a problem. In case of multiple canvases, the canvas driver takes care of setting the proper context before invoking the expose handler. In some cases, the application may want to draw into canvases actively. In this case, explicit drawing context switching may be required. To this end, use the following routine void fl_activate_glcanvas(FL_OBJECT *obj); before drawing into glcanvas object. Finally there is a routine that can be used to obtain the `XVisual' information that is used to create the context XVisualInfo *fl_get_glcanvas_xvisualinfo(FL_OBJECT *obj); See demo program `gl.c' for an example use of a glcanvas.  File: xforms.info, Node: Part III Popups, Next: Part III Deprecated Objects, Prev: Part III Other Objects, Up: Top 22 Popups ********* Popup is not an object class. In contrast to normal objects popups are only shown for a short time in their own window and, while they are shown, no interaction with other objects is possible. So they don't fit directly into the normal event loop where one waits for user actions via `*note fl_do_forms()::'. Instead, when used stand-alone (e.g., for a context menu) they are shown on a call of the function `*note fl_popup_do()::', which returns when the the user is done with the popup and it has been removed from the screen. Only idle callbacks and timers etc. are executed in the background while a popup is being shown. Popups are the building blocks for menu and selector objects, which internally create and use popups. Thus it might be helpful to understand how popups work to get the most out of these objects. All functions dealing with popups have names starting with `'fl_popup_'', functions for individual entries start with `'fl_popup_entry_'' and typedefs as well as macros with `'FL_POPUP_''. * Menu: * Adding Popups: Adding Popups * Popup Interaction: Popup Interaction * Other Popup Routines: Other Popup Routines * Popup Attributes: Popup Attributes  File: xforms.info, Node: Adding Popups, Next: Popup Interaction, Up: Part III Popups 22.1 Adding Popups ================== There are two ways to create and populate a popup with entries. The first method, that allows more fine-grained control consists of first generating a popup and then adding entries. Using this method all the properties of entries can be set immediately. The second method, to be discussed later, is simpler and may be sufficient for many applications, and internally uses the first method. To define a new popup using the more general interface call FL_POPUP *fl_popup_add(Window win, const char *title); The function returns the address of the new popup on success and `NULL' on failure. `win' is the window of a parent object (use `*note FL_ObjWin()::' to find out about it). You can also use `*note fl_root::' for the root window, with `None' having the same effect . `title' is an optional string that gets shown at the top of the popup in a framed box. If not wanted pass an empty string or `NULL'. The function returns a pointer to a new popup or `NULL' on failure. The title may contain embedded newline characters, this allows to create titles that span more than one line.) There is no built-in limit to the number of popups that can be created. Once you have popup you may add one or more entries by using FL_POPUP_ENTRY *fl_popup_add_entries(FL_POPUP *popup, const char *entries, ...); On success the return value is the address of the first entry created and `NULL' on failure. The first argument, `entries', is a pointer to the popup the new entry (or entries) is added to. The second argument, `entries', encodes information about the entries to add. In the most simple case it consists just of the entries texts, separated by `|' characters, e.g., `"Item 1|Item 2|Item 3"'. This would create three simple entries in the popup with labels `"Item 1"', `"Item 2"' and `"Item 3"'. The `entries' string may contain newline characters which allows to create entries that span more than a single line. There's no built-in limit to the number of entries than be added to a popup. `*note fl_popup_add_entries()::' can be called repeatedly to append further entries to a popup. It often is necessary to have more complex entries. E.g., one may want to have keyboard shortcuts for entries, which are shown on the right hand side of an entry, one may want to have sub-popups or set callbacks etc. This can be achieved by embedding special character sequences within the string describing the entries and passing further arguments to the function, similar to the use of a format string in e.g., `printf(3)'. All special sequences start with a `%'. The following sequences are recognized: `%x' Set a value of type `long int' that's passed to all callback routines for the entry. The value must be given in the arguments following the `entries' string. `%u' Set a `user_void' pointer that's passed to all callbacks of the entry. The pointer must be specified in the arguments following the `entries' string. `%f' Set a callback function that gets called when the entry is selected. The function is of type int callback(FL_POPUP_RETURN *r); Information about the entry etc. gets passed to the callback function via the `FL_POPUP_RETURN' structure (see below) and the return value of the function can be used to keep the selection being reported back to the caller of `*note fl_popup_do()::' by returning a value of `FL_IGNORE' (-1). The functions address must be given in the arguments following the `entries' string. `%E' Set a callback routine that gets called each time the mouse enters the entry (as long as the entry isn't disabled or hidden). The type of the function is the same as that of the callback function for the selection of the item but it's return value is never used. The functions address must be given in the arguments following the `entries' string. `%L' Set a callback routine that gets called each time the mouse leaves the entry. The type of the function is the same as that of the callback function for the selection of the entry but it's return value is never used. The functions address must be given in the arguments following the `entries' string. `%m' When this is specified a sub-popup gets opened when the mouse enters the entry (the entry itself thus can't be selected). The sub-popup to be opened must be an already existing popup and its address must be given in the arguments following the `entries' string. A triangle will be drawn on the right of the entry to indicate that it's an entry for a sub-popup. Mutually exclusive with `%t', `%T', `%r', `%R' and `%l'. `%t' `%T' This makes the entry a "toggle" entry, an entry that represents binary states and gets a check-mark drawn on its left if in "on" state. If created with `%t' its in "off" state at the start, if created with `"T"' its in "on" state. Switching states happens automatically when the entry is selected. Mutually exclusive with `%m', `%r', `%R' and `%l'. `%r' `%R' This makes the entry a "radio" entry, i.e., it becomes part of a group of entries of which only one can be "on" at a time. The group, an integer value (don't use `INT_MIN' and `INT_MIN'), must be given in the arguments following the `entries' string. Radio entries are drawn with a small circle to the left, with the one for the entry in "on" state filled with a color (blue per default). When a radio entry is selected by the user that was in "off" state the entry of the group that was is "on" state before is automatically switched to "off" state. If the entry gets created with `%r' the entry is in "off" state, if created with `%R' it's in "on" state (in that case all entries created before in "on" state are reset to "off" state, i.e., the one created last "wins"). Mutually exclusive with `%m', `%t', `%T' and `%l'. `%l' This creates not a real entry but indicates that a line is to be drawn to visually group other entries. While other properties can be set for such an "entry" only the "hidden" property (see below) is taken into acount. Mutually exclusive with `%m', `%t', `%T', `%' and `%R'. `%d' Marks the entry as disabled, i.e., it can't be selected and its text is per default drawn in a different color `%h' Marks the entry as hidden, i.e., it is not shown while in this state. `%S' For entries with shortcut keys it's quite common to have them shown on the right hand side. Using `%S' you can split the entrys text into two parts, the first one (before `%S') being drawn flushed left and the second part flushed right. Note that using this special sequence doesn't automatically sets a shortcut key, this still has to be done using `%s'. `%s' Sets one or more shortcut keys for an entry. Requires a string with the shortcuts in the arguments following the `entries' string, *note Shortcuts:: for details on how to define shortcuts. Please note that the character in the label identical to the shortcut character is only shown as underlined if `%S' isn't used. `%%' Use this to put a `%' character within the text of an entry. Please note that since `*note fl_popup_add_entries()::' is a variadic function (i.e., it takes a variable number of arguments) only very limited error checking is possible and thus it is of importance that the arguments passed to the function have exactly the required types! The return value of `*note fl_popup_add_entries()::' is a pointer to the first of the entries created. Since entries are stored as a linked list this value can be used to iterate over the list (see below for more information about the `*note FL_POPUP_ENTRY::' structure). If the function returns `NULL' no entries were created. A typical piece of code creating a popup may look like this: int save_cb(FL_POPUP_RETURN *result) { ... } int main(int argc, char *argv[]) { FL_POPUP *popup; File *fp; ... popup = fl_popup_add(None, NULL); fl_popup_add_entries(popup, "Save%SCtrl+S%s%f%u|" "Quit%SEsc%s|" "%l|" "Work Offline%SCtrl+O%T%s", "^S", save_cb, (void *) fp, "^[", "^O"); ... } This creates a popup with three entries. The first one has the label `"Save"' shown at the left and `"Ctrl+S"' at the right can be selected by pressing `S', in which case the function `save_cb()' will be invoked with a pointer to a structure that, beside other informations, contains the file pointer `fp'. The second entry has the labels `"Quit"' and `"Esc"' and it's shortcut key is set to `'. Below this entry a separator line is drawn, followed by the third entry with labels `"Work Offline"' and `"Ctrl+O"' and shortcut key `O'. This label is a "toggle" entry in "on" state, thus a check-marker is shown beside it. A few remarks about the callback routines. All have a type of `FL_POPUP_CB' as given by this `typedef': typedef int (*FL_POPUP_CB)(FL_POPUP_RETURN *); There are three kinds of callbacks, all with the same type. Whenever an item is entered (by moving the mouse on top of it or with the keyboard) its enter callback function is invoked (if one is set). Exceptions are entries that are disabled or hidden or entries, that just stand for separator lines. When an entry that can receive enter callbacks is left, its leave callback is invoked. Leave callbacks are not called when a selection has been made. Instead, only the selection callback for the selected entry is invoked. A "sub-popup entry", i.e., an entry that when entered results in a sub-popup to open, also can have an enter callback. Its leave callback is not called when the user moves the mouse onto the sub-popup but only once the sub-popup has been closed again and the mouse has been moved off the sub-popup entry. While enter and leave callback functions are defined to return an integer value, it's never used. But for the third kind of callback, invoked on selection of an entry, this isn't true. Instead, the callbacks return value is important: if it is `FL_IGNORE' (-1), the selection isn't reported back to the caller (and following callbacks also aren't called). This can be useful when the callback function already does everything required and nothing is left to be done. All callbacks receive a pointer to a structure of the type `FL_POPUP_RETURN': typedef struct { long int val; /* value assigned to entry */ void *user_data; /* pointer to user data */ const char *text; /* text of selected popup entry */ const char *label; /* text drawn on left */ const char *accel; /* text drawn on right */ const FL_POPUP_ENTRY *entry; /* selected popup entry */ const FL_POPUP *popup; /* (sub-) popup it belongs to */ } FL_POPUP_RETURN; `val' is the value set by `"%x"'. If `"%x"' wasn't given, it's an automatically generated value: when a popup is created with `*note fl_popup_add_entries()::' a counter is initalized to 0. Whenever an entry gets added the value of the counter is assigned to the entry and then incremented. Unless a different value is set explicitely via `"%x"' the first entry added to a popup thus gets a value `val' of 0, the second one gets 1 etc. This even holds for entries that just stand for separator lines. In simple situations the value of `val' is probably sufficient to identify which entry got selected. Please note: it is possible that by setting the `val' members two or more structures for items of the same popup get the same value. It is the programmers responsibility to avoid that (unless, of course, that's just what you intended). The `user_data' member of the structure is the `user_void' pointer set via `"%u"'. It allows to pass more complex data to the callback function (or have returned on selection of an entry. The `text' member is exactly the string used to create the entry, including all the special sequences starting with `'%''. `label' is what's left after all those sequences as well as backspace characters have been removed, tabs replaced by single spaces and the string is split at `"%S"'. I.e., it's exactly what's drawn left-flushed for the entry in the popup. `accel' is then what's left after clean-up and came after `"%S"', i.e., it's what appears as the right-flushed text of the entry. Please note that one or more of these pointers could under some circumstances be `NULL'. Finally, the two member `entry' and `popup' are pointers to the entry itself and the popup the callback function is invoked for - to find out the popup the selected entry itself belongs to use the `popup' member of the entrys `*note FL_POPUP_ENTRY::' structure. Please note: while in a callback you are only allowed to change the values of the `val' and `user_data' members. This can be useful in the case of a cascade of selection callback calls since all the selection callbacks receive the same structure (and this is also the structure that finally gets passed back to the caller of `*note fl_popup_do()::') at the end in order to implement more complex information interchange between the callbacks involved. The elements of a `FL_POPUP_ENTRY' structure that might be of interest) are typedef { FL_POPUP_ENTRY *prev; /* previous popup entry */ FL_POPUP_ENTRY *next; /* next popup entry */ int type; /* normal, toggle, radio, sub-popup, line*/ unsigned int state; /* disabled, hidden, checked */ int group; /* group (for radio entries only) */ FL_POPUP *sub; /* sub-popup bound to entry */ ... } FL_POPUP_ENTRY; Note that you should not change the members of a `*note FL_POPUP_ENTRY::' structure directly! Use the appropriate functions documented below to modify them instead. `prev' and `next' are pointers to the previous and the following popup entry (or `NULL' if none exists). `type' tells what kind of popup entry this is. There are five different types: `FL_POPUP_NORMAL' Normal popup entry with no special properties `FL_POPUP_TOGGLE' "Toggle" or "binary" entry, drawn with a check-mark to its left if in "on" state `FL_POPUP_RADIO' Radio entry, drawn with a circle to its left (color-filled when "on". The `group' member of the `*note FL_POPUP_ENTRY::' structure determines to which group the entry belongs. `FL_POPUP_SUB' Entry for a sub-popup. The `sub' member of its *note FL_POPUP_ENTRY:: structure is a pointer to the sub-popup that gets shown when the mouse enters the entry. `FL_POPUP_LINE' Not a "real" entry, just indicates that a separator line is to be drawn between the previous and the next entry. Finally, the `state' member can have the following values: `FL_POPUP_NONE' No special state is set for the entry, the default. `FL_POPUP_DISABLED' The entry is disabled, i.e., isn't selectable (and normally is drawn in a way to indicate this). `FL_POPUP_HIDDEN' The entry is not drawn at all (and thus can't be selected). `FL_POPUP_CHECKED' Only relevant for toggle and radio entries. Indicates that the state of a toggle entry is "on" (drawn with a check-marker) and for a radio entry that it is the one in "on" state of its group. The state can be a combination of the above constants by using a bitwise OR. The more interesting members of a `FL_POPUP' structure are typedef struct { FL_POPUP *next; /* previously created popup */ FL_POPUP *prev; /* later created popup */ FL_POPUP *parent; /* for sub-popups: direct parent */ FL_POPUP *top_parent; /* and top-most parent */ Window win; /* window of the popup */ FL_POPUP_ENTRY *entries; /* pointer to list of entries */ char *title; /* title string of the popup */ ... } FL_POPUP; Note again that you are not supposed to change the members of the structure. Like popup entries also popups are stored in a (doubly) linked list. Thus the `prev' and `next' members of the structure are pointers to popups created earlier or later. If a popup is a sub-popup of another popup then `parent' points to the next higher level popup (otherwise it's `NULL'). In case there's a cascade of popups the `top_parent' member points to the "root" popup (i.e., the top-level popup), while for popups that aren't sub-popups it always points back to the popup itself (in that case `parent' is `NULL'). `win' is the window created for the popup. It's `None' (0) while the popup isn't shown, so it can be used to check if the popup is currently visible. The `entries' member points to the first element of the list of entries of the popup. See the `*note FL_POPUP_ENTRY::' structure documented above on how to iterate over all entries. Finally, `title' is the title shown at the top of the popup (if one is set). Never try to change it directly, there ars the functions `*note fl_popup_set_title()::' and `*note fl_popup_set_title_f()::', described below, to do just that. To remove a popup entry use int fl_popup_entry_delete(FL_POPUP_ENTRY *entry); The function return 0 on success and -1 if it failed for some reasons. Note that the function for a sub-popup entry also deletes the popup that was associated with the entry! You may also insert one or more entries into a popup at arbitrary places using FL_POPUP_ENTRY *fl_popup_insert_entries(FL_POPUP *popup, FL_POPUP_ENTRY *after, const char *entries, ...); `popup' is the popup the entries are to be inserted in, `after' is the entry after which the new entries are to be added (use `NULL' if the new entries are to be inserted at the very first position), and `entries' is the same kind if string as already used in `*note fl_popup_add_entries()::', including all the available special sequences. The arguments indicated by `...' have to be given according to the `entries' string. Finally, when you don't need a popup anymore simply call int fl_popup_delete(FL_POPUP *popup); The function returns 0 on success and -1 on failure. It's not possible to call the function while the popup is still visible on the screen. Calling it from any callback function is problematic unless you know for sure that the popup to be deleted (and sub-popups of it) won't be used later and thus normally should be avoided. Above was described how to first generate a popup and then populate it. But there's also a (though less general) method to create and populate a popup in a single function call. For this use FL_POPUP *fl_popup_create(Window win, const char *title, FL_POPUP_ITEM *items); The `win' and `title' arguments are the same as used in `*note fl_popup_add()::', i.e., they are parent window for the popup (or `*note fl_root::' or `None') and the (optional, can be `NULL') title for the popup. `items' is a pointer to an array of structures of the following form: typedef struct { const char *text; /* text of entry */ FL_POPUP_CB callback; /* (selection) callback */ const char *shortcut; /* keyboard shortcut description */ int type; /* type of entry */ int state; /* disabled, hidden, checked */ } FL_POPUP_ITEM; The array must contain one structure for each entry of the popup and must end in a structure where at least the `text' member is set to `NULL'. The `text' member describes the text of the entry. If it contains the string `"%S"' the text is split up at this position and the first part is used as the label drawn left-flushed for the entry and the second part for the right-flushed part (for showing accelerator keys etc.). Two more characters have a special meaning if they appear at the very start of the string (and which then do not become part of the label shown): `'_'' Draw a separator line above this entry. `'/'' This entry is a sub-popup entry and the following elements of the `items' array (until the first element with `text' set to `NULL' define the entries of the sub-popup. Both `'_'' and `'/'' can appear at the start of the string, it doesn't matter which one comes first. The `callback' member is a function to be invoked when the entry is selected (irrelevant for sub-popup entries). `shortcut' is a string, encoding which keyboard shortcut keys can be used to select the item (*note Shortcuts:: for details on how such a string has to be assembled). `type' describes the type of the entry and must be one of `*note FL_POPUP_NORMAL::', `*note FL_POPUP_RADIO::' (all radio entries automatically belong to the same group (numbered `INT_MIN'). You can't use `*note FL_POPUP_LINE::' or `*note FL_POPUP_SUB::'. If you want a sub-popup entry use `*note FL_POPUP_NORMAL::' and set `'/'' as the first character of the `text' member of the structure. If you need a separator line put a `'_'' at the start of the `text' member string of the entry which comes after the separator line. Finally, the `state' member can be 0 or the bitwise or of `*note FL_POPUP_DISABLED::', `*note FL_POPUP_HIDDEN::' and `*note FL_POPUP_CHECKED::'. The first one makes the entry appear disabled and non-selectable, the second will keep the entry from being drawn at all, and the third one puts the entry into "on" state (relevant for toggle and radio entries only). If you try to set `*note FL_POPUP_CHECKED::' for more than a single radio entry the last one you set if for "wins", i.e., only this one will be in "on" state. See below for a more detailed discussion of these entry properties. `*note fl_popup_create()::' does not allow to associate values or pointers to user data to individual entries, set titles for sub-popups, have radio entries belong to different groups or set enter or leave callback functions (though there exist a number of functions to remedy the situation in case such things are needed). The function returns a pointer to the newly created popup (or `NULL' on failure). You are guaranteed that each entry has been assigned a unique value, starting at 0 and which is identical to the index of corresponding element in the `items' array, i.e., the first element results in an entry assigned 0, the second entry gets 1 etc. All functions working on popups or entries can, of course, be used on popups and their entries generated via `*note fl_popup_create()::'. They can be employed to remedy some of the limitations imposed by the simpler popup creation API. Here's an example of how to create a popup using `fl_popup_create()': FL_POPUP *popup; FL_POPUP_ITEMS items[] = { {"Item 1%S^1", NULL, "^1", FL_POPUP_NORMAL, FL_POPUP_NONE }, {"Item 2%S^2", NULL, "^2", FL_POPUP_RADIO, FL_POPUP_CHECKED }, {"Item 3%S^3", NULL, "^3", FL_POPUP_RADIO, FL_POPUP_NONE }, {"_/Item 4", NULL, NULL, FL_POPUP_NORMAL, FL_POPUP_NONE }, {"Sub-item A", cbA, "^A", FL_POPUP_NORMAL, FL_POPUP_DISABLED}, {"Sub-item B", cbB, "^B", FL_POPUP_TOGGLE, FL_POPUP_NONE }, {NULL, NULL, NULL, 0, 0 }, {"Item 5", NULL, NULL, FL_POPUP_NORMAL, FL_POPUP_NONE }, {NULL, NULL, NULL, 0, FL_POPUP_NONE } }; popup = fl_popup_create(None, "Test", items); This creates a new popup with the title `"Test"' and 5 entries as well as a a sub-popup with two entries, that gets opened when the mouse is over the entry labeled `"Item 4"'. The first entry in the main popup has the label `"Item 1"' on the left and `"^1"' of the right side. It has no callback routine and can be selected via the `1' shortcut. It's just a normal menu entry. The second entry has the label `"Item 2"' on the left and `"^2"' of the right side, also no callack and `2' as its keyboard shortcut. It's a radio entry that is in "on" state. The third entry is like the second, labels are `"Item 3"' and `"^3"' and it reacts to `3', except that it's in "off" state. The second and third label belong to the same group (with the group number set to `INT_MIN'), i.e., when the third entry gets selected the second one gets switched to "off" state (and vice versa). Before the fourth entry a separator line will be drawn (that's the effect of its text starting with `'_''. It's a sub-popup entry (due to the `'/'' at the start of its text). It's label is simply `"Item 4"' and no right hand label (but that isn't supposed to indicate that sub-entries couldn't have shortcuts!). It has no selection callback (which wouldn't sense make sense for a sub-popup entry anyway). The following three elements of the `items' array are for the sub-popup that gets opened when the mouse is over the fourth item of the main popup. In the sub-popup we first have an normal entry with label `"Sub-item A"'. The function `cbA()' will be called when this entry of the sub-popup is selected. Then we have a second entry, labled `"Sub-item B"', which is a currently disabled toggle entry in "off" state. If it weren't disabled its selection would result in the callback function `cbB()' getting called. The next element of the `items' array, having `NULL' as its `text' member, signifies the end of the sub-popup. Now that we're done with the sub-popup another entry in the main popup follows, a normal entry with just a left-label of `Item 5'. The final element of `items', where `text' is set to `NULL' then signifies that this is the end of the popup. As there are functions to append to and insert entries into a popup with a kind of format string, followed by a variable list of arguments, there are also functions for adding and inserting entries using an array of `*note FL_POPUP_ITEM::'. These are FL_POPUP_ENTRY *fl_popup_add_items(FL_POPUP *popup, FL_POPUP_ITEM *items); FL_POPUP_ENTRY *fl_popup_insert_items(FL_POPUP *popup, FL_POPUP_ENTRY *after, FL_POPUP_ITEM *items); Both functions return the address of the first entry created on success and `NULL' on error. The first argument is the popup the entries are to be appended to or inserted into, the last argument the array of items (as in the case of `*note fl_popup_create()::' at least the `text' member of the last element must be a `NULL' pointer to indicate the end). `fl_popup_insert_items()' takes another argument, `after', the entry after which the new entries are to be inserted (if called with `after' set to `NULL' the new entries are inserted at the very start of the popup).  File: xforms.info, Node: Popup Interaction, Next: Other Popup Routines, Prev: Adding Popups, Up: Part III Popups 22.2 Popup Interaction ====================== A popup will be drawn on the screen when the function FL_POPUP_RETURN *fl_popup_do(FL_POPUP *popup); is called. It only returns when the user either selects an entry or closes it in some other way (e.g., by clicking outside the popup's area). When a selection was made the function returns a pointer to a `*note FL_POPUP_RETURN::' structure with information about the entry that was selected (please note that the structure is internal storage belonging to the Forms Library and is re-used when the popup is shown again, so copy out all data you may need to keep). If no selection was made (or one of the invoked callback routines returned a value of `FL_IGNORE' (-1) `NULL' is returned. While the popup is shown the user can interact with the popup using the mouse or the keyboard. When the mouse is hovering over a selectable entry of the popup the entry is highlighted, when the mouse reaches an entry for a sub-popup, the associated sub-popup automatically gets opened. A selection is made by clicking on an entry (or, in case that the popup was opened while a mouse button was pressed down, when the mouse button is released). Clicking outside the popups window (or, depending on the "policy", see below, releasing the mouse button somewhere else than over a selectable item) closes the popup without a selection being made. Popups also can be controlled via the keyboard. First of all, on pressing a key, the shortcuts set for items are evaluated and, if a match is found, the corresponding entry is returned as selected (if the popup currently shown is a sub-popup, first the shortcuts for this sub-popup are checked, then those of its parent etc. until the top-most popup has been reached and checked for). The user can also navigate through the selectable entires using the `' and `' arrow keys and open and close sub-popups with the `' and `' cursor keys. Pressing the `' key highlights the first (selectable) entry in the popup, `' the last one. By using the `' key (or `' if available) the currently shown popup is closed (if an entry in a sub-popup was highlighted just this sub-popup is closed). Finally, pressing `' while on a selectable entry results in this entry being reported as selected. Once the user has selected an entry its callback function is invoked with a `*note FL_POPUP_RETURN::' structure as the argument. When this function returns, the callback for the popup the entry belongs to is called with exactly the same structure. If the popup is a sub-popup, next the callback for its "parent" popup is invoked, again with the same structure (except that the `popup' member is changed each time to indicate which popup the call is made for). Repeat until the callback for the top-most popup has been called. Finally the structure used in all those callback invocations is returned from `*note fl_popup_do()::'. This chain of callback calls is interrupted when one of the callbacks returns a value of `FL_IGNORE' (-1). In that case no further callbacks are invoked and `*note fl_popup_do()::' returns `NULL', i.e., from the callers perspective it looks as if no selection has been made. This can be useful when one of the callbacks was already was able to do all the work required on a selection. Per default a popup stays open when the user releases the mouse button anywhere else than on a selectable entry. It only gets closed when the user either selects an entry or clicks somewhere outside of the popup area. An alternative is a "drag-down" popup that gets closed whenever the mouse button is released, even if the mouse isn't on the area of the popup or a selectable entry. To achieve this effect you can change the "policy" using the function int fl_popup_set_policy(FL_POPUP *popup, int policy); There are two values `policy' can have: `FL_POPUP_NORMAL_SELECT' Default, popup stays open until mouse button is released on a selectable entry or button is clicked outside the popups area. `FL_POPUP_DRAG_SELECT' Popup is closed when the mouse button is released anywhere. The function can be called with either a (valid) popup address, in which case the policy for that popup is changed, or with a `NULL' pointer to change the default setting of the policy, used in the creation of new popups. The function returns the previous policy value or -1 on errors. It's also possible to determine the policy setting by using int fl_popup_get_policy(Fl_POPUP *popup); If called with the address of a (valid) popup the policy for this popup (or its parent if one exists) gets returned. If called with a `NULL' pointer the default policy used in creating new popups is returned. On error -1gets returned. Calling the function with `NULL' as the `popup' argument changes the default setting for the popups created afterwards. If the popup is partially off-screen the user can push the mouse at the screen borders in the direction of the currently invisible popup entries. This results in the popups window getting moved so that previosuly invisible entries become accessible. The popup window gets shifted vertically in single entry steps, in horizontal direction by a tenth of the screen width. The delay between shifts is about 100 ms.  File: xforms.info, Node: Other Popup Routines, Next: Popup Attributes, Prev: Popup Interaction, Up: Part III Popups 22.3 Other Popup Routines ========================= When `*note fl_popup_do()::' is called the popup per default is shown with its left upper corner at the mouse position (unless the popup wouldn't fit onto the screen). Using void fl_popup_set_position(FL_POPUP *popup, int x, int y); the position where the popup is drawn can be changed (but if it wouldn't fit onto the screen at that position it will also changed automatically). `x' and `y'. to be given relative to the root window, define the position of the upper left hand corner. Using this function for sub-popups is useless, they always get opened as near as possible to the corresponding sub-popup entry. When setting the position of a popup it can be useful to know the exact sizes of its window in advance. These can be obtained by calling int fl_popup_get_size(FL_POPUP *popup, unsigned int *w, unsigned int *h); The function returns 0 on success and -1 on error (in case the supplied `popup' argument isn't valid). Please note that the reported values are only valid until the popup is changed, e.g., by adding, deleting or changing entries or changing the appearance of the popup. A callback function `cb()' of type `*note FL_POPUP_CB::', to be called when a entry (or an entry of a sub-popup) is selected, can be associated with a popup (or changed) using typedef int (*FL_POPUP_CB)(FL_POPUP_RETURN *); FL_POPUP_CB fl_popup_set_callback(FL_POPUP *popup, FL_POPUP_CB cb); The function returns the old setting of the callback routine (on error `NULL' is returned, which may indistinguishable from the case that no callback was set before). For an entry all three associated callback functions can be set via FL_POPUP_CB fl_popup_entry_set_callback(FL_POPUP_ENTRY *entry, FL_POPUP_CB cb); FL_POPUP_CB fl_popup_entry_set_enter_callback(FL_POPUP_ENTRY *entry, FL_POPUP_CB enter_cb) FL_POPUP_CB fl_popup_entry_set_leave_callback(FL_POPUP_ENTRY *entry, FL_POPUP_CB leave_cb); The first function sets the callback invoked when the entry is selected, the second when the mouse enters the area of the entry and the third, when the mouse leaves that area. All function return the previously set callback or `NULL' when none was set or an error occured. `NULL' also gets returned on errors. There are three properties that can be set for a popup entry `FL_POPUP_DISABLED' The entry is is shown as disabled and can't be selected. `FL_POPUP_HIDDEN' The entry is not shown when the popup is opened. `FL_POPUP_CHECKED' Relevant only for toggle and redio entries. When set beside the label of a toggle entry a check-marker is drawn while the circle beside a radio button is drawn colored. The "state" of an entry is the binary OR of these values which can be set and queried using the functions unsigned int fl_popup_entry_set_state(FL_POPUP_ENTRY *entry, unsigned int state); unsigned int fl_popup_entry_get_state(FL_POPUP_ENTRY *entry); `*note fl_popup_entry_set_state()::' returns the previous state on success and `UINT_MAX' (a value with all bits set) on failure. Note that when setting `*note FL_POPUP_CHECKED::' for a radio entry all other radio entries belonging to the same group automatically lose their "on" (checked) property. There are also three convenience function for clearing, raising and toggling bits in the state of an entry. Normally to clear a certain bit of the state you have to first call `*note fl_popup_entry_get_state()::', then clear the bit in the return value and finally call `*note fl_popup_entry_set_state()::' with the result to set the new state. Use of these convenience functions allows to change state bits in a single call. unsigned int fl_popup_entry_clear_state(FL_POPUP_ENTRY *entry, unsigned int what); unsigned int fl_popup_entry_raise_state(FL_POPUP_ENTRY *entry, unsigned int what); unsigned int fl_popup_entry_toggle_state(FL_POPUP_ENTRY *entry, unsigned int what); The `what' argument can be any value resulting from a bitwise OR of `*note FL_POPUP_DISABLED::', `*note FL_POPUP_HIDDEN::' and `*note FL_POPUP_CHECKED::' (thus you can clear, set or toggle one or more bits of the state in a single call). The functions all return the original value of the state. You may search for an entry in a popup by different criteria (please note that the search also includes sub-popups of the popup, you can identify them by checking the `popup' member of the *note FL_POPUP_ENTRY:: structure). The search obviously will only deliver reasonable results if what you're searching for is unique between all the entries. First, you can ask for the entry that had been created with a certain text, including all the special sequences, by calling FL_POPUP_ENTRY *fl_popup_entry_get_by_text(FL_POPUP *popup, const char *text); FL_POPUP_ENTRY *fl_popup_entry_get_by_text_f(FL_POPUP *popup, const char *fmt, ...); The functions returns either a pointer to the entry found or `NULL' on failure (because either no entry with this text was found or the popup doesn't exist). (The functions differ in that the first one accepts just a simple string while the second assembles the text from a format string, just as it's used for `printf()' etc., and an appropriate number of following arguments.) You may as well search by the left-flushed label parts of the entries as shown on the screen (note that tab characters `'\t'' originally embedded in the text used when creating the label have been replaced by single spaces and backspace characters `'\b'' were removed as well as all special sequences) FL_POPUP_ENTRY *fl_popup_entry_get_by_label(FL_POPUP *popup, const char *label); FL_POPUP_ENTRY *fl_popup_entry_get_by_label_f(FL_POPUP *popup, const char *fmt, ...); Thus, since an entry created via a string like `"I\bt%Tem\t1%SCtrl+X"' will shown with a left-flushed label part of `"Item 1"', this will be found when searching with either this string or a format string fo e.g., `"Item %d"' and a following integer argument of `1'. Another way to search for an entry is by its value as either specified via the `"%x"' special sequence or assigned automatically by FL_POPUP_ENTRY *fl_popup_entry_get_by_value(FL_POPUP *popup, long value); Also the `user_data' pointer associated with the entry can be used as the search criterion: FL_POPUP_ENTRY *fl_popup_entry_get_by_user_data(FL_POPUP *popup, void *user_data); Finally one can try to find an entry by its current position in the popup (note that here sub-popups aren't taken into consideration since that would make the meaning of "position" rather hard to define) by FL_POPUP_ENTRY *fl_popup_entry_get_by_position(FL_POPUP *popup, long position); where `posistion' is starting with 0, so when called with 0 the first entry will be returned, when called with 1 you get the second entry etc. Note that separator lines aren't counted but entries currently being hidden are.  File: xforms.info, Node: Popup Attributes, Prev: Other Popup Routines, Up: Part III Popups 22.4 Popup Attributes ===================== Using void fl_popup_set_title(FL_POPUP *popup, const char *title); void fl_popup_set_title_f(FL_POPUP *popup, const char *fmt, ...); const char *fl_popup_set_title(FL_POPUP *popup); the title of a popup can be changed or the currently set title determined. (The two functions for setting the title are just different in the way the title is passed: the first one receives a simple string while the second one assembles the title from a format string just like the one used with `printf()' etc. and an appropriate number of following arguments.) To query or set the font the popups title is drawn in use void fl_popup_get_title_font(FL_POPUP *popup, int *size, int *style); void fl_popup_set_title_font(FL_POPUP *popup, int size, int style); *Note Label Attributes and Fonts::, for details about the sizes and styles that should be used. The default size and style are `*note FL_NORMAL_SIZE::' and `*note FL_EMBOSSED_STYLE::'. This setting also applies to sub-popups of the popup, thus setting a title font for sub-popups is useless. When called with the `popup' argument set to `NULL' the default settings for popups generated later are returned or set. Also the font for the entries of a popup can be queried or and set via void fl_popup_entry_get_font(FL_POPUP *popup, int *style, int *size); void fl_popup_entry_set_font(FL_POPUP *popup, int style, int size); The defalt size is `*note FL_NORMAL_SIZE::' and the default style is `*note FL_NORMAL_STYLE::'. Again, the returned or set values also apply to all sub-popups, so calling the function for sub-popups doesn't make sense. When called with `popup' set to `NULL' the default settings for popups are returned or changed. The width of a popup is calculated using the widths of the title and the entries. You can influence this width by setting a minimum width a popup should have. There are two functions for the minimum width: int fl_popup_get_min_width(FL_POPUP *popup); int fl_popup_set_min_width(FL_POPUP *popup, int min_width); The first one returns the currently set minimum width (a negative return value indicates an error). The second allows sets a new minimum width. Setting the minimum width to 0 or a negative value switches the use of the minimum width off. It returns the previous value (or a negative value on error). You can query or set the border width popups are drawn width (per default it's set to `1'). To this purpose call int fl_popup_get_bw(FL_POPUP *popup); int fl_popup_set_bw(FL_POPUP *popup, int bw); Please note that the border width setting is automatically applied also to sub-popups, so there's no good reason to call these functions for sub-popups. The default border width is the same as that for objects. The functions can also be called with `popup' set to `NULL' in which case the default setting for the border width is returned or set, respectively. To change the cursor that is displayed when a popup is shown use void fl_popup_set_cursor(FL_POPUP *popup, int cursor_name); Use one of the symbolic cursor names (shapes) defined by standard X or the integer value returned by `*note fl_create_bitmap_cursor()::' or one of the Forms Library's pre-defined symbolic names for the `cursor_name' argument. Per default the cursor named `"XC_sb_right_arrow"' is used. If the function is called with `popup' set to `NULL' the default cursor for popups generated afterwards is changed. There are several colors used in drawing a popup. These can be set or queried with the functions FL_COLOR fl_popup_set_color(FL_POPUP *popup, int type, FL_COLOR color); FL_COLOR fl_popup_get_color(FL_POPUP *popup, int type); where `type' can be one of the following values: `FL_POPUP_BACKGROUND_COLOR' Background color of the popup, default is `FL_MCOL'. `FL_POPUP_HIGHLIGHT_COLOR' Backgroud color an entry is drawn with when it's selectable and the mouse is on top of it, default is `FL_BOTTOM_BCOL'. `FL_POPUP_TITLE_COLOR' Color used for the title text of a popup, default is `FL_BLACK'. `FL_POPUP_TEXT_COLOR' Color normal used for entry texts, default is `FL_BLACK'. `FL_POPUP_HIGHLIGHT_TEXT_COLOR' Color of the entry text when it's selectable and the mouse is on top of it, default is `FL_WHITE'. `FL_POPUP_DISABLED_TEXT_COLOR' Color for drawing the text of disabled entries, default is `FL_INACTIVE_COL'. `FL_POPUP_RADIO_COLOR' Color the circle drawn for radio entris in "on" state is drawn in. When setting a new color the color previously used is returned by `*note fl_popup_set_color()::'. Calling these functions for sub-popups doesn't make sense since sub-popups are always drawn in the colors set for the parent popup. When called with `popup' set to `NULL' the functions return or set the default colors of popups created afterwards. To change the text of a popup entry call int fl_popup_entry_set_text(FL_POPUP_ENTRY *entry, const char *text); Please note that in the text no special sequences except `"%S"' (at which place the text is split to make up the left- and right-flushed part of the label drawn) are recognized. The shortcut keys for a popup label can be changed using void fl_popup_entry_set_shortcut(FL_POPUP_ENTRY *entry, const char *shortcuts); *Note Shortcuts::, for details on how such a string has to look like. The value assigned to a popup entry can be changed via long fl_popup_entry_set_value(FL_POPUP_ENTRY *entry, long value); The function returns the previous value. Also the user data pointer associated with a popup entry can be modified by calling void *fl_popup_entry_set_user_data(FL_POPUP_ENTRY *entry, void *user_data); The function returns the previous setting of `user_data'. To determine to which group a radio entry belongs call int fl_popup_entry_get_group(FL_POPUP_ENTRY *entry); Obviously, this function only makes much sense when applied to radio entries. It returns the group number on success and `INT_MAX' on failure (that's why `INT_MAX' shouldn't be used for group numbers). To assign a radio entry to a different group call int fl_popup_entry_set_group(FL_POPUP_ENTRY *entry, int group); Again, for obvious reasons, the function should normally only be called for radio entries. It returns the previous group number on success and `INT_MAX' on failure. If one of the entries of the new group was in "on" state the entries state will be reset to "off" if necessary. For entries other than radio entries the group isn't used at all. So, theoretically, it could be used to store a bit of additional information. If that would be good programming practice is another question... Finally, the sub-popup associated with a sub-popup-entry can be queried or changed using the functions FL_POPUP *fl_popup_entry_get_subpopup(FL_POPUP_ENTRY *entry); FL_POPUP *fl_popup_entry_get_subpopup(FL_POPUP_ENTRY *entry, FL_POPUP *subpopup); Obviously, calling these functions only makes sense for sub-popup entries. `*note fl_popup_entry_get_subpopup()::' returns the address of the sub-popup associated with the entry or `NULL' on failure. To change the sub-popup of an entry a valid sub-popup must be passed to `*note fl_popup_entry_set_subpopup()::', i.e., the sub-popup must not already be a sub-popup of another entry or the popup the entry belongs to itself. You also can't set a new sub-popup while the old sub-popup associated with the entry or the popup to become the new sub-popup is shown. On success the address of the new sub-popup is returned, on failure `NULL'. Note that this function deletes the old sub-popup that was associated with the popup.  File: xforms.info, Node: Part III Deprecated Objects, Next: Part IV, Prev: Part III Popups, Up: Top 23 Deprecated Objects ********************* In this chapter describes object types that have been replaced by newer ones. But they will remain part of XForms and also can be used in new programs. But there probably will be not more support for these objects than bug fixes etc. * Menu: * Choice Object: Choice Object * Menu Object: Menu Object * XPopup: XPopup  File: xforms.info, Node: Choice Object, Next: Menu Object, Up: Part III Deprecated Objects 23.1 Choice Object ================== A choice object is an object that allows the user the choose among a number of choices. The current choice is shown in the box of the choice object. The user can either cycle through the list of choices using the middle or right mouse button or get the list as a menu using the left mouse button. * Menu: * Adding Choice Objects: Adding Choice Objects * Choice Types: Choice Types * Choice Interaction: Choice Interaction * Other Choice Routines: Other Choice Routines * Choice Attributes: Choice Attributes * Remarks: Choice Remarks  File: xforms.info, Node: Adding Choice Objects, Next: Choice Types, Up: Choice Object 23.1.1 Adding Choice Objects ---------------------------- To add a choice object to a form use the routine FL_OBJECT *fl_add_choice(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); It shows a box on the screen with the label to the left of it and the current choice (empty in the beginning), centered in the box.  File: xforms.info, Node: Choice Types, Next: Choice Interaction, Prev: Adding Choice Objects, Up: Choice Object 23.1.2 Choice Types ------------------- The following types are available: `FL_NORMAL_CHOICE' Middle/right mouse button shortcut. `FL_NORMAL_CHOICE2' Same as `FL_NORMAL_CHOICE' except drawn differently. `FL_DROPLIST_CHOICE' Menu is activated only by pressing and releasing the mouse on the arrow.  File: xforms.info, Node: Choice Interaction, Next: Other Choice Routines, Prev: Choice Types, Up: Choice Object 23.1.3 Choice Interaction ------------------------- Beside simply opening up the popup behind the choice object and selecting an entry with the left mouse button you can also use the middle and right mouse buttons and the scroll wheel: a short click with the middle mouse button selects the entry before the currently selected one, a click with the right mouse button the next. Keeping the middle or right mouse button pressed down slowly cycles trough the entries, backward or forward. The same can be down with the sroll wheel. In both cases, whenever a choice entry is selected (even when it is the original one) the object is returned to the application program. But you can control the condition under which the choice object gets returned to the application by using the function int fl_set_object_return(FL_OBJECT *obj, unsigned int when) where `when' can have the following values `*note FL_RETURN_NONE::' Never return or invoke callback. `*note FL_RETURN_END_CHANGED::' Return or invoke callback if end of interaction and selection of an item coincide. `*note FL_RETURN_CHANGED::' Return or invoke callback whenever an item is selected (this is the default). `*note FL_RETURN_END::' Return or invoke callback on end of an interaction. `*note FL_RETURN_ALWAYS::' Return (or invoke callback) whenever the interaction ends and/or an item is selected.  File: xforms.info, Node: Other Choice Routines, Next: Choice Attributes, Prev: Choice Interaction, Up: Choice Object 23.1.4 Other Choice Routines ---------------------------- There are a number of routines to change the list of possible choices. To add a line to a choice object use int fl_addto_choice(FL_OBJECT *obj, const char *text); int fl_addto_choice_f(FL_OBJECT *obj, const char *fmt, ...); The function returns the number of the new item. The items in the list are numbered in the order in which they were inserted. The first item has number 1, etc. The two functions differ in that the first one accepts just a simple string while for the second the text is assembled from a format string as used by `printf()' etc. and the following arguments. Note that, because a choice object uses a popup, the string passed with `*note fl_addto_choice()::' cann also contain some additional information not directly shown in the entries text. E.g., you can create several entries as once if the string you pass to `*note fl_addto_choice()::' contains `'|'' characters - these aren't shown but instead are treated as separators between the strings for the entries. Some extra control sequences, starting with the character `'%'' can also be embedded (*note Creating XPopups::), thus a literal `'%'' in a string must be escaped by doubling it. To delete a line use: void fl_delete_choice(FL_OBJECT *obj, int line); Whenever the application program wants to clear the complete list of choices it should use the routine void fl_clear_choice(FL_OBJECT *obj) One can also replace a line using void fl_replace_choice(FL_OBJECT *obj, int line, const char *text); void fl_replace_choice(FL_OBJECT *obj, int line, const char *fmt, ...); (The second function assembles the new text from a format string as used for `printf()' etc. and the following arguments.) To obtain the currently selected item in the choice object use the call int fl_get_choice(FL_OBJECT *obj); The function returns the number of the current choice (0 if there is no choice). You can also obtain the text of the currently selected choice item using the call const char *fl_get_choice_text(FL_OBJECT *obj); `NULL' is returned when there is no current choice. To obtain the text of an arbitrary choice item, use the following routine const char *fl_get_choice_item_text(FL_OBJECT *obj, int n); To obtain the total number of choice items, use the following function int fl_get_choice_maxitems(FL_OBJECT *obj); One can set various attributes of an item using the following routine void fl_set_choice_item_mode(FL_OBJECT *obj, int numb, int mode); Here `mode' is the same as that used for menu objects (see above). See also *note XPopup::, for details. To find about those settings use int fl_get_choice_item_mode(FL_OBJECT *obj, int numb); You can use the follow routine to populate a choice object at once, including mode and shortcut, by using int fl_set_choice_entries(FL_OBJECT *obj, FL_PUP_ENTRY *entries); where `entries' is a pointer to a `FL_PUP_ENTRY' structure (terminated by a `NULL' text field) as already described above for the function `*note fl_set_menu_entries()::'. Also see *note XPopup::, for more details. Please note that for choice objects no nested entries are permitted and the item callback functions are ignored. The function returns the number of items added to the choice object. Finally, the application program can set the currently selected entry of the choice using a call of void fl_set_choice(FL_OBJECT *obj, int line); void fl_set_choice_text(FL_OBJECT *obj, const char *txt) void fl_set_choice_text_f(FL_OBJECT *obj, const char *fmt, ...) where `txt' (for `fl_set_choice_text()' or the text resulting from the expansion of the `printf()'-compatible format string and the following arguments for `fl_set_choice_text_f()' must must be the text of exactly one of the choice items. For example, after the following choice is created fl_addto_choice(obj,"item1|item2|item3"); You can select the second item by using any of the following lines fl_set_choice(obj, 2); fl_set_choice_text(obj, "item2"); fl_set_choice_text_f(obj, "item%d", 2 );  File: xforms.info, Node: Choice Attributes, Next: Choice Remarks, Prev: Other Choice Routines, Up: Choice Object 23.1.5 Choice Attributes ------------------------ Don't use `FL_NO_BOX' as the boxtype for a choice object. The first color argument (`col1' to `*note fl_set_object_color()::' controls the color of the box and the second (`col2') the color of the text in the box. The current choice by default is shown centered in the box. To change the alignment of the choice text in the box, use the following routine void fl_set_choice_align(FL_OBJECT *obj, int align); To set the font size used inside the choice object use void fl_set_choice_fontsize(FL_OBJECT *obj, int size); To set the font style used inside the choice object use void fl_set_choice_fontstyle(FL_OBJECT *obj, int style); Note that the above functions only change the font inside the choice object, not the font used in the popup. To change the font used in the popup, use the XPopup functions `*note fl_setpup_default_fontsize()::' and `*note fl_setpup_default_fontstyle()::'. Note that these functions influence the font settings of all popups! *Note Label Attributes and Fonts::, for details on font sizes and styles. Normally the pop-up shown for the choice objects will be displayed at the current mouse position or, for those of type ``FL_DROPLIST_CHOICE'', directly below the choice object. This can be modified by a call of the function int fl_set_choice_align_bottom(GL_OBJECT *obj, int flag); If `flag' is `0' the normal behaviour is used, but when `flag' is `1' the popup will be displayed with its lower right hand corner at the current mouse position or, for objects of type ``FL_DROPLIST_CHOICE'' above the choise object. The function returns the previously set value for `flag'.  File: xforms.info, Node: Choice Remarks, Prev: Choice Attributes, Up: Choice Object 23.1.6 Remarks -------------- See `choice.c' for an example of the use of choice objects.  File: xforms.info, Node: Menu Object, Next: XPopup, Prev: Choice Object, Up: Part III Deprecated Objects 23.2 Menu Object ================ Also menus can be added to forms. These menus can be used to let the user choose from many different possibilities. Each menu object has a box with a label in it in the form. Whenever the user presses the mouse inside the box (or moves the mouse on top of the box) a pop-up menu appears. The user can then make a selection from the menu. * Menu: * Adding Menu Objects: Adding Menu Objects * Menu Types: Menu Types * Menu Interaction: Menu Interaction * Other Menu Routines: Other Menu Routines * Menu Attributes: Menu Attributes * Remarks: Menu Remarks  File: xforms.info, Node: Adding Menu Objects, Next: Menu Types, Up: Menu Object 23.2.1 Adding Menu Objects -------------------------- To add a menu to a form use the routine FL_OBJECT *fl_add_menu(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); It shows a box on the screen with the label centered in it.  File: xforms.info, Node: Menu Types, Next: Menu Interaction, Prev: Adding Menu Objects, Up: Menu Object 23.2.2 Menu Types ----------------- The following types are available: `FL_PUSH_MENU' The menu appears when the user presses a mouse button on it. `FL_PULLDOWN_MENU' The menu appears when the user presses a mouse button on it. `FL_TOUCH_MENU' The menu appears when the user move the mouse inside it. `FL_PUSH_MENU' and `FL_PULLDOWN_MENU' behave rather similar. When you click on a `FL_PUSH_MENU' per default a pop-up window gets opened on top of the `FL_PUSH_MENU' menu's box that has a label at the top, indicating the currently selected menu item. The pop-up window stays open until you either select an item or press a mouse button somewhere outside the pop-up window. When you click on `FL_PULLDOWN_MENU' also a pop-up window is shown, but directly below the menu's box. This pop-up window has no label and it only stays open until you release the mouse button. `FL_PUSH_MENU' and `FL_PULLDOWN_MENU' can be made even more similar by using the `*note fl_set_menu_notitle()::' function (see below). This changes it's properties so that the pop-up window also appears below the menu's box and that no label is shown in the pop-up window. The only remaining difference then is that a `FL_PUSH_MENU' only gets closed when a menu item is selected or the user presses the mouse outside of the pop-up window while a `FL_PULLDOWN_MENU' also gets closed when the mouse button is released.  File: xforms.info, Node: Menu Interaction, Next: Other Menu Routines, Prev: Menu Types, Up: Menu Object 23.2.3 Menu Interaction ----------------------- When the menu appears the user can make a selection using the left mouse button or make no selection by clicking outside the menu (or by simply releasing the mouse button in case of a `FL_PULLDOWN_MENU' type menu. Normally when he makes a selection the menu object is returned by the interaction routines. You can control the condition under which the menu object gets returned to the application by using the function int fl_set_object_return(FL_OBJECT *obj, unsigned int when) where `when' can have the following values `*note FL_RETURN_NONE::' Never return the object or invoke its callback. `*note FL_RETURN_END_CHANGED::' Return or invoke callback if end of interaction and selection of an item coincide (this is the default for all menu objects except those of type `FL_TOUCH_MENU'). `*note FL_RETURN_CHANGED::' Return or invoke callback whenever an item is selected (this is the default for all menu objects of type `FL_TOUCH_MENU'). `*note FL_RETURN_END::' Return or invoke callback on end of an interaction. `*note FL_RETURN_ALWAYS::' Return (or invoke callback) whenever the interaction ends and/or an item is selected.  File: xforms.info, Node: Other Menu Routines, Next: Menu Attributes, Prev: Menu Interaction, Up: Menu Object 23.2.4 Other Menu Routines -------------------------- There are two ways to populate a menu, i.e., add items. The first one is a bit more complex but allows for more flexibility, e.g., later adding and removing items, associating callbacks with individual items etc. For the more simple (and in many cases sufficient) method see the function `*note fl_set_menu_entries()::'. To set the actual menu for a menu object, use the routine void fl_set_menu(FL_OBJECT *obj, const char *menustr, ...); `menustr' describes the menu in the form used by XPopups (*note XPopup::). In the simplest case it just contains the texts for the menu items, separated by a bar (`'|''), e.g., `"First|Second|Third"'. But it's also possible to employ special tags (*note Creating XPopups::) that can be used to indicate special attributes (radio, toggle and greyed-out, for example). For this usage the unspecified arguments (the `...' in the function call) can be used t add neceassary information. Whenever the user selects a menu item, a pointer to the menu object it belongs to is returned to the application program. Please note that if you call `*note fl_set_menu()::' on a menu that already contains items the existing items are replaced by the new ones - the function calls `*note fl_clear_menu()::' internally before the new items are added. If you explicitely assign a menu item ID to a menu, using the special tag `%x', it is your responsibility to make sure that this ID isn't already used by a different menu item in the same menu. Failure to do so may make it impossible to use the menu properly. All functions working on items expect the menu item ID as one of their arguments. Also note that only values that fit into a `char' can be used, so the range is restricted to the interval `[-128, 127]' on most machines with a signed `char' type and to `[0, 255]' on those with an unsigned `char' type. For portability reasons it's thus to be recommended to restrict the range to `[0, 127]'. In case you don't set menu item IDs they are assigned automatically with the first item obtaining the menu item ID 1, the next 2 etc., i.e., it directly reflects the position of the item in the menu. It is also possible to add menu items to an existing menu using a call of int fl_addto_menu(FL_OBJECT *obj, const char *menustr, ...); where `menustr' is a string of the same form as used in `*note fl_set_menu()::' (you can add one or more new menu items this way). Also routines exist to delete a particular menu item or change it: void fl_delete_menu_item(FL_OBJECT *obj, int miid); void fl_replace_menu_item(FL_OBJECT *obj, int miid, const char *menustr, ...); `miid' is the menu item ID. `menustr' must be a string as used in `*note fl_set_menu()::' with the only difference that only a single menu item can be specified. Please note: when deleting a menu item all other items keep their menu item IDs. The menu item ID of the deleted menu item isn't re-used when new items are added later. Instead for each menu an internal counter exists that gets incremented for each menu item added and which value is used for the menu item ID unless one is explicitely assigned to the menu item. The counter oly gets reset to 1 when the menu is cleared used `*note fl_clear_menu()::'. The menu item ID of a menu item changed by using `*note fl_replace_menu_item()::' does not change unless the library is explicitely asked to via `%x' in `menustr'. For most applications, the following routine may be easier to use at the expense of somewhat restrictive value a menu item can have as well as a loss of the ability to delete menu items or associate callbacks with menu items. int fl_set_menu_entries(FL_OBJECT *obj, FL_PUP_ENTRY *ent); where `ent' is a pointer to an array of structure of the following type, terminated by an element, where at least the `text' member is a `NULL' pointer: typedef struct { const char *text; FL_PUP_CB callback; const char *shortcut; int mode; } FL_PUP_ENTRY; The meaning of each member is explained in Section 21.3. For menus, item callback function can be `NULL' if the menu callback handles the interaction results. See demo program `popup.c' for an example use of `*note fl_set_menu_entries()::'. The function `*note fl_set_menu_entries()::' works by creating and associating a popup menu with the menu object. The popup ID is returned by the function. Whenever the function is called, the old popup associated with the object (if one exists) is freed and a new one is created. Although you can manipulate the menu either through the menu API (but adding and removing menu items is not supported for menus created this way ) or popup API, the application should not free the popup directly and use `*note fl_clear_menu()::' instead. To clear the whole menu use void fl_clear_menu(FL_OBJECT *obj); To find the menu item selected by the user use int fl_get_menu(FL_OBJECT *obj); The the function returns the menu item ID. In the simplest possible case this is just the position of the menu item (starting at 1). This stops to be true when either IDs have been explicitely assigned to items or items have been deleted. In that case the following rules apply: 1. A menu item ID may have been assigned to a menu item using `%xn' in the string for the text of the menu item. 2. Menu items can get associated with a callback function that is executed when the menu item is selected. The callback function is of type `*note FL_PUP_CB::' and receives the menu item ID of the selected menu. If such a callback is set for a menu item the return value of `*note fl_get_menu()::' is the return value of this function instead of the menu item ID that would have been returned otherwise. To obtain the text of any item, use the following routine const char *fl_get_menu_item_text(FL_OBJECT *obj, int miid); where `miid' is the menu item ID. If `n' isn't a valid menu iem ID item `NULL' is returned. To obtain the text of the selected enu item use const char *fl_get_menu_text(FL_OBJECT *obj); To obtain the total number of menu items, use the function int fl_get_menu_maxitems(FL_OBJECT *obj); One can change the appearance of different menu items. In particular, it is sometimes desirable to make grey-out menu items and make them unselectable or to put boxes with and without checkmarks in front of them. This can be done using the routine: void fl_set_menu_item_mode(FL_OBJECT *obj, int miid, unsigned mode); `miid' is the menu index ID of the memu item you want to change. `mode' represents the special properties you want to apply to the chosen item. You can specify more than one at a time by adding or bitwise OR-ing these values together. For this parameter, the following symbolic constants exist: `FL_PUP_NONE' No special display characteristic, the default. `FL_PUP_BOX' "Binary" entry, i.e., an entry that stands for a choice that can be switched on and off. Displayed with an unchecked box to the left. `FL_PUP_RADIO' "Radio" item belonging to a group, so that gets automatically switched off when another item of the group is selected. Displayed with a diamoned-shaped box at the left. `FL_PUP_GREY' To be OR-ed with one of the above to make that item appear greyed-out and disable it (i.e., not selectable anymore). `FL_PUP_CHECK' To be OR-ed with one of `FL_PUP_BOX' and `FL_PUP_RADIO' to make the box to the left appear checked or pushed. There is also a routine that can be used to obtain the current mode of an item after interaction, mostly useful for toggle or radio items: unsigned int fl_get_menu_item_mode(FL_OBJECT *obj, int miid); While a callback associated with a menu entry can be set when it is created it can also set later on or be changed. For this use the function FL_PUP_CB fl_set_menu_item_callback(FL_OBJECT *ob, int numb, FL_PUP_CB cb); where `numb' is the menu entries ID and `cb' is the callback function of type `*note FL_PUP_CB::' (or `NULL' to disable a callback). The return value is a pointer to the previously used callback function (or `NULL'). It is often useful to define keyboard shortcuts for particular menu items. For example, it would be nice to have `s' behave like selecting "Save" from a menu. This can be done using the following routine: void fl_set_menu_item_shortcut(FL_OBJECT *obj, int miid, const char *str); `miid' is the menu item ID of the menu item under consideration. `str' contains the shortcut for the item. (Actually, it can contain more shortcuts for the same item.) *Note Shortcuts::, for more information about shortcuts. Finally there is the routine: void fl_show_menu_symbol(FL_OBJECT *obj, int yes_no); With this routine you can indicate whether to show a menu symbol at the right of the menu label. By default no symbol is shown. xforms-1.2.4/doc/part0_preface.texi0000644000175000017500000003342012261251071014127 00000000000000@node Preface @unnumbered @emph{Preface} The Forms Library for the X Window system (or XForms for short) is a GUI toolkit with a rather long history. It was developed in the last decade of the last millenium by @strong{Dr.@: T.@: C.@: Zhao} (then at the Department of Physics, University of Wisconsin-Milwaukee, USA) and @strong{Prof.@: Dr.@: Mark Overmars} (Department of Computer Science, Utrecht University, Netherlands) at a time when there were hardly any alternatives except expensive packages. While at first being closed source it became open source software in 2002, distributed according to the Lesser GNU Public License (LGPLv2). While development slowed down a bit while other toolkits became available and matured, XForms is still used, and development continues. While it may not be as polished as newer toolkits it has the advantage of being relatively small and thus easier to get started with it. The XForms home page is at @center @url{http://xforms-toolkit.org/} The sources and mailing list are hosted on @center @url{https://savannah.nongnu.org/projects/xforms/} The source package can be downloaded from @center @url{http://download.savannah.gnu.org/releases/xforms/} while the @code{git} repository can be accessed via @center @url{git://git.savannah.nongnu.org/xforms.git} @center @url{http://git.savannah.gnu.org/cgit/xforms.git} @center @url{ssh://git.sv.gnu.org/srv/git/xforms.git} There also is a mailing list. You can subscribe to it at @center @url{http://lists.nongnu.org/mailman/listinfo/xforms-development} The archive of the mailing list can be found at @center @url{http://lists.gnu.org/archive/html/xforms-development/} The archive of messages from before August 2009 and going back until 1996 is at @center @url{http://xforms-toolkit.org/old-archive} Please write to the mailing list if you have questions or find bugs. This document is based on the documentation for version 0.89 of the Forms Library. It has been reconstructed from the PDF version (the original sources seem to have been lost) and has been updated to cover all changes introduced since version 0.89. In the following the preface for the last available version of the documentation (version 0.89 from June 2000) is reproduced. Please note that quite a bit of the information there-in is outdated. Many of the URLs mentioned don't exist anymore, email addresses have changed and the restrictions on the distribution of the library have been removed by the original authors in favor of the LGPL. @sp 4 @strong{Preface of Version 0.89 (June 2000)} Window-based user interfaces are becoming a common and required feature for most computer systems, and as a result, users have come to expect all applications to have polished user-friendly interfaces. Unfortunately, constructing user interfaces for programs is in general a time consuming process. In the last few years a number of packages have appeared that help build up graphical user interfaces (so-called GUI's) in a simple way. Most of them, though, are difficult to use and/or expensive to buy and/or limited in their capabilities. The Forms Library was constructed to remedy this problem. The design goals when making the Forms Library were to create a package that is intuitive, simple to use, powerful, graphically good looking and easily extendible. The main notion in the Forms Library is that of a form. A form is a window on which different objects are placed. Such a form is displayed and the user can interact with the different objects on the form to indicate his/her wishes. Many different classes of objects exist, like buttons (of many different flavors) that the user can push with the mouse, sliders with which the user can indicate a particular setting, input fields in which the user can provide textual input, menus from which the user can make choices, browsers in which the user can scroll through large amounts of text (e.g., help files), etc. Whenever the user changes the state of a particular object on one of the forms displayed the application program is notified and can take action accordingly. There are a number of different ways in which the application program can interact with the forms, ranging from very direct (waiting until something happens) to the use of callback routines that are called whenever an object changes state. The application program has a large amount of control over how objects are drawn on the forms. It can set color, shape, text style, text size, text color, etc. In this way forms can be fine tuned to one's liking. The Forms Library consists of a large number of C-routines to build up interaction forms with buttons, sliders, input fields, dials, etc. in a simple way. The routines can be used both in C and in C++ programs. The library uses only the services provided by the Xlib and should run on all workstations that have X installed on them. The current version needs 4bits of color (or grayscale) to look nice, but it will function properly on workstations having less depth (e.g., XForms works on B&W X-terminals). The library is easy to use. Defining a form takes a few lines of code and interaction is fully handled by the library routines. A number of demo programs are provided to show how easy forms are built and used. For simple forms and those that may be frequently used in application programs, e.g., to ask a question or select a file name, special routines are provided. For example, to let the user choose a file in a graphical way (allowing him/her to walk through the directory hierarchy with a few mouse clicks) the application program needs to use just one line of code. To make designing forms even easier a Form Designer is provided. This is a program that lets you interactively design forms and generate the corresponding C-code. You simply choose the objects you want to place on the forms from a list and draw them on a form. Next you can set attributes, change size and position of the objects, etc., all using the mouse. Although this document describes all you need to know about using the Forms Library for X, it is not an X tutorial. On the contrary, details of programming in X are purposely hidden in the Forms Library interfaces, and one need not be an X-expert to use the Forms Library, although some knowledge of how X works would help to understand the inner workings of the Forms Library. Forms Library and all the programs either described in this document or distributed as demos have been tested under X11 R4, R5 & R6 on all major UNIX platforms, including SGI, SUN, HP, IBM RS6000/AIX, Dec Alpha/OSF1, Linux(i386, alpha, m68k and sparc) as well as FreeBSD, NetBSD (i386, m68k and sparc), OpenBSD(i386, pmax, sparc, alpha), SCO and Unixware. Due to access and knowledge, testing on non-unix platforms such as OpenVMS, OS/2 and Microsoft/NT are less than comprehensive. This document consists of four parts. The first part is a tutorial that provides an easy, informal introduction to the Forms Library. This part should be read by everybody that wants to use the library. You are encouraged to try variations of the demo programs distributed in the Forms Library package. Part II describes the Form Designer with which you can design forms interactively and haveForm Designer write code for you. Part III gives an overview of all object classes currently available in the library. The tutorial part only mentions the most basic classes but here you find a complete overview. Adding new object classes to the system is not very complicated. Part IV describes how this should be done. @strong{Version Note} The authors request that the following name(s) be used when referring to this toolkit @center Forms Library for X, @center Forms Library @center or simply @center XForms Forms Library is not public domain. It is copyright (c) by T.C. Zhao and Mark Overmars, and others, with all published and unpublished rights reserved. However, permission to use for non-commercial and not-for-profit purposes is granted. You may not use xforms commercially (including in-house and contract/consulting use) without contacting (xforms@@world.std.com) for a license arrangement. Use of xforms for the sole purpose of running a publically available free software that requires it is not considered a commercial use, even in a commercial setting. You may not "bundle" and distribute this software with commercial systems without prior consent of the authors. Permission to distribute this software with other free software that requires it, including Linux CD distribution, is granted. Further, permission to re-package the software is granted. This software is provided "as is" without warranty of any kind, either expressed or implied. The entire risk as to the quality and performance of the software is with you. Should the software prove defective, you assume the cost of all necessary servicing, repair or correction and under no circumstance shall the authors be liable for any damages resulting from the use or mis-use of this software. It would be appreciated if credit to the authors is acknowledged in published articles on applications based on the library. A reprint of the article would also be appreciated. The development environment for xforms consists of Linux 1.0.8/a.out X11R5 and Linux 2.0/ELF X11R6 with additional testing and validation on SGI R8000 and occasionally IBM RS6000/AIX and other machines. For every public release, most of the demos and some internal testing programs are run on each platform to ensure quality of the distribution. Figures in this document were produced by fd2ps, a program that takes the output of the form designer and converts the form definition into an encapsulated POSTSCRIPT file. fd2ps as ofXForms V0.85 is included in the distribution. This document is dated June 12, 2000. @strong{Support} Although XForms has gone through extensive testing, there are most likely a number of bugs remaining. Your comments would be greatly appreciated. Please send any bug reports or suggestions to T.C. Zhao (tc_zhao@@yahoo.com or xforms@@world.std.com but not both). Please do not expect an immediate response, but we do appreciate your input and will do our best. @strong{Bindings to other languages} As of this writing, the authors are aware of the following bindings perl binding by Martin Bartlett () ada95 binding by G. Vincent Castellano () Fortran binding by G. Groten () and Anke Haeming () pascal binding by Michael Van Canneyt () scm/guile binding by Johannes Leveling () python binding by Roberto Alsina (). (Seems the author has stopped working on this binding). Follow the links on XForms's home page to get more info on these bindings. @strong{Archive Sites} Permanent home for the Forms Library is at @example ftp://ncmir.ucsd.edu/pub/xforms ftp://ftp.cs.ruu.nl/pub/XFORMS (Primary mirror site) @end example The primary site is mirrored by many sites around the world. The following are some of the mirror sites @example ftp://ftp.fu-berlin.de/unix/X11/gui/xforms ftp://gd.tuwien.ac.at/hci/xforms ftp://ftp.st.ryukoku.ac.jp/pub/X11/xforms ftp://ftp.via.ecp.fr/pub2/xforms ftp://ftp.unipi.it/pub/mirror/xforms ftp://ftp.uni-trier.de/pub/unix/X11/xforms @end example Additional mirrors, html version of this document, news and other information related to XForms can be accessed through www via the following URL @example http://world.std.com/~xforms @end example In addition to ftp and www server, a mail server is available for those who do not have direct internet access. To use the mail server, send a message to or the old-fashioned path alternative . The message should be something like the following @example begin path fred@@stone.age.edu (substitute your address) send help end @end example To get a complete listing of the archive tree, issue send ls-lR.Z. @strong{Mailing List} A mailing list for news and discussions about XForms is available. To subscribe or un-subscribe, send a message to with one of the following commands as the mail body @example help subscribe unsubscribe @end example To use the mailing list, send mail to . Please remember that the message will be sent to hundreds of people. Please Do not send subscribe/unsubscribe messages to the mailing list, send them to . The mailing list archive is at @code{http://bob.usuhs.mil/mailserv/list-archives}. @strong{Thanks} Many people contributed, in one way or another, to the development of Forms Library, without whose testing, bug reports and suggestions, Forms Library would not be what it is today and would certainly not be in the relatively bug free state it is in now. We thank Steve Lamont of UCSD (), for his numerous suggestions and voluminous contributions to the mailing list. We thank Erik Van Riper (), formerly of CUNY, and Dr.@: Robert Williams of USUHS () for running the mailing list and keeping it running smoothly. We also thank every participant on the mailing list who contributed by asking questions and challenging our notion of what typical use of the Forms Library is. The html version of the document, undoubtedly browsed by the thousands, is courtesy of Danny Uy (). We appreciate the accurate and detailed bug reports, almost always accompanied with a demo program, from Gennady Sorokopud () and Rouben Rostamian (). We also thank Martin Bartlett (), who, in addition to marrying Forms Library to perl, made several xforms API suggestions, Last but certainly not least, we thank Henrik Klagges () for his numerous suggestions during the early stages of the development. xforms-1.2.4/doc/part2_getting_started.texi0000644000175000017500000001423012252532770015721 00000000000000@node Part II Getting Started @chapter Getting Started To start up the Form Designer simply type fdesign without any arguments. (If nothing happens, check whether the package has been installed correctly.) A black window (the main window) will appear on the screen. This is the window in which you can create your forms. Next the control panel appears on the screen. No form is shown yet. @ifhtml @center @image{xforms_images/fdesign} @end ifhtml @ifnothtml @center @image{xforms_images/fdesign,14cm} @end ifnothtml The control panel consists of five parts. The first part is the menu bar, consisting of several groups of menus from which you can make selections or give commands to the program. Directly below the menu you have a row of buttons for alignment, testing and getting help, see below. Then there's a panel with three browsers. At the left there is a list of all existing forms. When the program is started without an already existing file as an argument the list is empty, indicating that there are no forms yet. There's no upper limit to the number of forms that can be created but you can only work on exactly one form at a time. Use this list to switch between the different forms. Below the forms list is another list showing all groups in the form you're currently working on. It will be empty for a new form because there are no groups yet. Ignore this at the moment as we will come back to groups and their uses later. Just right of those two lists you find a list of all the different classes of objects that can be placed into the form. Use the mouse to select the class of a new object you want to add to the form. On the right side beside the panel with the browsers you find a number of buttons to give commands to the program. Each of these buttons is bound to a function key. You can either press the buttons with the mouse or press the corresponding function keys on the keyboard (while the keyboard focus is on the window with the form). The functions of these keys will be described below. To create a new form select the "New Form" entry in the "Form" menu. A little popup box will appear, prompting you for the name of the new form. This is the name under which the program you're going to write will know the form. Thus you will have to provide a name which must be a legal C variable name. Type in the name and press @code{}. Now the color of the window for showing the form you're working on changes to that of the default background color of forms. (Actually, each new form gets created with a box already covering its entire area, what you see is the color of this box. You can change most properties of this box using the methods described below. Just its size is fixed to the size of the form, which can be simply changed by resizing the window.) Note that the form's name is added to the list of forms in the control panel. To add an object to the form select its class in the control panel by selecting an item the list of object classes. Then move the mouse into the window with the form you are working on and drag the mouse while pressing the left mouse button. By keeping the mouse button pressed you create a box that has the size of the object to be created. Release the button and the object will appear. Note that a red outline appears around the new object. This indicates that the object is selected. In this way you can put all kinds of objects on the form. Object already created can be modified in several ways. You can move them around, change their sizes or their attributes. To this end first select the object by left-clicking on it. But this only works if there isn't an obkect class selected in the object class browser in the control panel. To get rid of such a selection either click on the selected entry in this browser or by right-click somewhere in the window with the new form. When the object is selected a red outline appears around it. You now will be able to drag the object around with the mouse. By grabbing the object at one of the four red corners you can change its size. It is also possible to select multiple objects and move or scale them simultaneously. See below for details. To change the object's attributes, e.g., its label, simply double-click on it with the left mouse button. Or single-click on it and then press the function key @code{} (or click on the button labeled "F1 attribs" in the control panel or select "Object attributes" from the "Object" menu). A new form appears in which you can change all the different attributes. Their meanings should be clear (if you have read the documentation on the Forms Library). Change the attributes you want to change and finally press the button labeled "Accept". To reset all attributes to their original values press "Restore" (or "Cancel" if you also want to close the window for modifying the attributes). See below for more information about changing attributes. In this way you can create the forms you want to have. Note that you can have more than one form. Just add another form in the way described above and use the list of forms to switch between them. After you have created all your forms select "Save" or "Save As"from the "File" menu to save them to disk. It will ask you for a file name using the file selector. In this file selector you can walk through the directory tree to locate the place where you want to save the file. Next, you can type in the name of the file (or point to it when you want to overwrite an existing file). The name should end with @code{.fd}. So for example, choose @file{ttt.fd}. The program now creates three files: @file{ttt.c}, @file{ttt.h} and @file{ttt.fd}. @file{ttt.c} contains a readable piece of C code that creates the forms you designed. The file @file{ttt.h} contains the corresponding header file for inclusion in your application program. The file @file{ttt.fd} contains a description of the forms in such a way that the Form Designer can read it back in later. The application program now simply has to call the routines with names like @code{create_form_xxx()} (replace @code{xxx} with the names you gave to the forms) to create the different forms you designed. These are the basic ideas behind the Form Designer. In the following chapters we describe the program in more detail. xforms-1.2.4/doc/xforms.info-40000664000175000017500000054435512353624333013104 00000000000000This is xforms.info, produced by makeinfo version 4.13 from xforms.texi. INFO-DIR-SECTION Development START-INFO-DIR-ENTRY * XForms: (xforms). A Graphical user interface toolkit for X END-INFO-DIR-ENTRY  File: xforms.info, Node: Warping, Next: General Pixel Transformation, Prev: Scaling, Up: Simple Image Processing 37.7.7 Warping -------------- Image warping (or texture mapping in 2D) refers to the transformation of pixel coordinates. Rotation, scaling and shearing etc. are examples of (linear and non-perspective) image warping. In typical applications some of the commonly used pixel coordinate transformations are implemented using more efficient algorithms instead of a general warping. For example, image rotation is often implemented using three shears rather than a general warp (Forms Library implements rotation via image warping). Non-perspective linear image warping in general is characterized by a 2x2 warp matrix `W' and a translation vector `T' with two elements as follows P' = W * P + T where `P' is a vector describing a position via it's x and y coordinates and `P'' is the position after warping. The elements `w[i][j]' of the warp matrix are constants (if the warp matrix isn't constant or is of higher order, we usually call such a transformation morphing rather than warping). Since our destination for the warped image is an array of pixels rather than a properly defined coordinate system (such as a window) the translation has no meaning. For the following discussion, we assume the translation vector is zero. (In doing the actual warping, the warped image is indeed shifted so it starts at the (0,0) element of the array representing it). Although, theoretically, any 2D matrix can be used as a warp matrix, there are practical constraints in image warping due to the discreteness of pixel coordinates. First of all, we have to snap all pixel coordinates onto a 2D rectangular integer grid. This in general will leave holes in the warped image because two pixels may get mapped to a single destination location, leaving a hole in the destination image. Secondly, truncation or rounding the resulting floating point values introduces errors. Because of these reasons, image warping is performed in reverse. That is, instead of looping over all pixel coordinates in the original image and transforming those into new coordinates, we start from the new coordinates and use inverse warping to obtain the coordinates of the pixel in the original image. This requires that the inverse of the warp matrix must exist (which is the case if `w[0][0] * w[1][1] != w[0][1] * w[1][0]', i.e., the warp matrix has a non-vanishing determinante). With inverse warping the transformation becomes a re-sampling of the original image, and subpixel sampling (anti-aliasing) can be easily implemented. The following function is available in the library to perform warping int flimage_warp(FL_IMAGE *im, float matrix[][2], int neww, int newh, int subpixel); where `matrix' is the warp matrix. `neww' and `newh' specify the warped image size. To have the warp function figure out the minimum enclosing rectangle of the warped image you can pass zeros for the new width and height. Nevertheless, you can specify whatever size you want and the warp function will fill the empty grid location with the fill color. This is how the aspect ratio preserving scaling is implemented. In general, the warped image will not be rectangular in shape. To make the image rectangular the function fills the empty regions. The fill color is specified by setting the `image->fill_color' field with a packed RGB color. The last argument, `subpixel' specifies if subpixel sampling should be used. Although subpixel sampling adds processing time, it generally improves image quality significantly. The valid values for this parameter is any logical OR of `FLIMAGE_NOSUBPIXEL', `FLIMAGE_SUBPIXEL' and `FLIMAGE_NOCENTER'. `FLIMAGE_NOCENTER' is only useful if you specify an image dimension that is larger than the warped image, and in that case the warped image is flushed top-left within the image grid, otherwise it is centered. To illustrate how image warping can be used, we show how an image rotation by an angle `deg' can be implemented: float m[2][2]; m[0][0] = m[1][1] = cos(deg * M_PI / 180.0); m[0][1] = sin(deg * M_PI / 180.0); m[1][0] = -m[0][1]; flimage_warp(im, mat, 0, 0, FLIMAGE_SUBPIXEL); Please note that the transformation is done in-place, i.e., after the function returns the image structure pointer, `im', points to the rotated image. If you specify a warp matrix with the off-diagonal elements being zero (scaling matrix), the image will only be scaled (in x-direction by `m[0][0]' and in y-direction by `m[1][1]') without being also rotated. By experimenting with various warp matrices you can obtain some interesting images. Just keep in mind that large values of the warp matrix elements tend to make the final image larger.  File: xforms.info, Node: General Pixel Transformation, Next: Image Annotation, Prev: Warping, Up: Simple Image Processing 37.7.8 General Pixel Transformation ----------------------------------- Many image processing tasks can be implemented as seperate RGB transformations. These transformations can be done very efficiently through the use of lookup tables. For this reason the following routine exists: int flimage_transform_pixels(FL_IMAGE *im, int *red, int *green, int *blue); where `red', `green' and `blue' are the lookup tables of a length of at least `FL_PCMAX + 1' (typically 256). The function returns a postive number on success and the image will be replaced. Note that this routine notices the settings of the subimage, i.e., you can transform a portion of the image. To illustrate the use of this routine let's look at how a simple contrast adjustment may be implemented: #include #include int AdjustContrast(FL_IMAGE *im) { int r[FL_PCMAX+1], g[FL_PCMAX+1], b[FL_PCMAX+1]; int i, scale = 10; /* in this example rgb are adjusted the same way */ for ( i = 0; i <= FL_PCMAX; i++) r[i] = g[i] = b[i] = i * log10(1 + i * scale / FL_PCMAX ) / log10( 1 + scale ); return flimage_transform_pixels(im, r, g, b); }  File: xforms.info, Node: Image Annotation, Next: Write Your Own Routines, Prev: General Pixel Transformation, Up: Simple Image Processing 37.7.9 Image Annotation ----------------------- You can annotate an image with text or simple markers (arrows etc.). The location of the annotation can either be in pixel coordinate system or some application defined coordinate system. * Menu: * Using Text Strings:: * Using Markers:: * Pixelizing the Annotation::  File: xforms.info, Node: Using Text Strings, Next: Using Markers, Up: Image Annotation 37.7.9.1 Using Text Strings ........................... To place text into the image, use the following routine int flimage_add_text(FL_IMAGE *im, const char *str, int len, int fstyle, int fsize, unsigned tcolor, unsigned bcolor, int nobk, double tx, double ty, int rotation); where `fstyle' and `fsize' are the same as the label font style and size defined earlier in Section 3.11.3. `tcolor' and `bcolor' specify the colors to use for the text `str' and the background if the `nobk' argument is false. If `nobk' is true the text is drawn without a background. `tx' and `ty' specify the location of the text relative to the image origin. The location specified is the lower-right corner of the text. Note that the location specified can be in some physical space other than pixel space. For example, if the pixel-pixel distance represents 10 miles on a map, you'd like to be able to specify the text location in miles rather than pixels. The location is converted into pixel space using the following code tx_pixel = im->xdist_scale * tx + im->xdist_offset; ty_pixel = im->ydist_scale * ty + im->ydist_offset; By default, the offsets `im->xdist_offset' and `im->yxdist_offset' are initialized to 0 and the scales `im->xdist_scale' and `im->ydist_scale' to 1. The function returns the current number of strings for the image. The interpretation of text used also used elsewhere applies, i.e., if `str' starts with character `@' a symbol is drawn. There is another function, maybe more convenient depending on the application, that you can use int flimage_add_text_struct(FL_IMAGE *im, const FLIMAGE_TEXT *text); With this function instead of passing all the parameters individual;y you pass a `FLIMAGE_TEXT' structure to the function. The structure has the following fields: `str' The string to append to the image. `len' Length of the string in bytes. `x, y' A location relative to the image origin, given in pixels (no conversion from other coordinate systems is done) `align' Specifies the alignment of the string relative to the give location. `style, size' The font style and size to use. `color' The text color `bcolor' The background color `nobk' If true indicates that no background is to be drawn. `angle' Angle (in thenth of a degree) the text is to be rotated from the default horizontal orientation. Currently only PostScript output handles this correctly. To delete the all texts you added to an image, use void flimage_delete_all_text(FL_IMAGE *im); You also can suppress the display of annotation text without deleting it. To do this, simply set `im->dont_display_text' to true.  File: xforms.info, Node: Using Markers, Next: Pixelizing the Annotation, Prev: Using Text Strings, Up: Image Annotation 37.7.9.2 Using Markers ...................... In addition to text strings you can also add simple markers (arrows, circles etc) to your image. To add a marker to an image use the following routines int flimage_add_marker(FL_IMAGE *im, const char *name, double x, double y, double w, double h, int linestyle, int fill, int rotation, FL_COLOR, FL_COLOR bcol); int flimage_add_marker_struct(FL_IMAGE *im, const FLIMAGE_MARKER *m); where `name' is the marker name (see below for a list of built-in markers). The marker name must consist of regular ASCII characters. `linestyle' indicates the line style (`FL_SOLID', `FL DOT' etc., see Chapter 27 for a complete list. `fill' indicates if the marker should be filled or not. `x' and `y' are the coordinates of the center of the marker in physical coordinates (i.e., the same transformation as described above for annotated texts is applied), `w' and `h' are the size of the bounding box of the marker, again in physical coordinates. Every marker has a natural orientation from which you can rotate it. The angle of rotation is given by `rotation' in tenth of a degree. `col' is the color of the marker, in packed RGB format. `bcol' is currently un-used. The second function takes a structure that specifies the marker. The members of the structure are as follows: `name' The name of the marker. `x, y' Position of center of the marker in pixel coordinates, relative to the origin of the image. `w, h' The size of the bounding box in pixel coordinates. `color' The color of the marker in packed RGB format. `fill' If true the marker is filled. `thickness' The line line thickness used for drawing. `style' The line style to be used for drawing. `angle' Angle of rotation in tenth of a degree from the marker's nature orientation. If successful both functions return the number of markers that are currently associated with the image, otherwise a negative number. Some built-in markers in different orientations are shown in Fig. 22.1. To delete all markers added to an image use the function void flimage_delete_all_markers(FL_IMAGE *im); Of course the library would not be complete without the ability for applications to define new markers. The following function is provided so you can define your own markers: int flimage_define_marker(const char *name, void (*draw) (FLIMAGE_MARKER *marker), const char *psdraw); When the marker is to be drawn the function `draw()' is called with the marker structure. In addition to the fields listed above the following fields are filled by the library to facilitate the operation of drawing the marker `display' The display to be drawn on. `gc' The GC to be used in drawing `win' The window to draw to. `psdraw' A string that draws a marker in a square with the corner coordinates (-1, -1), (-1, 1), (1, 1) and (1, -1) in PostScript. For example the rectangle marker has the following `psdraw' string: -1 -1 moveto -1 1 lineto 1 1 lineto 1 -1 lineto closepath Defining new markers is the preferred method of placing arbitary drawings onto an image as it works well with double-buffering and pixelization of the markers.  File: xforms.info, Node: Pixelizing the Annotation, Prev: Using Markers, Up: Image Annotation 37.7.9.3 Pixelizing the Annotation .................................. Annotations placed on the image are kept seperate from the image pixels themselves. The reasons for doing so are twofold. First, keeping the annotation seperate makes it possible to later edit the annotations. The second reason is that typically the screen has a lower resolutions than other output devices. By keeping the annotations seperate from the pixels makes it possible to obtain better image qualities when the annotations are rendered on higher-resolution devices (for example a PostScript printer). If for some reason making the annotations a part of the image pixels is desired, use the following routine int flimage_render_annotation(FL_IMAGE *image, FL_WINDOW win); The function returns -1 if an error occurs. The parameter `win' is used to create the appropriate pixmap. After the function returns the annotations are rendered into the image pixels (thus an annotation or a part of it that was outside of the image is lost). Note that during rendering the image type may change depending on the capabilities of `win'. Annotations that were kept separately are deleted. Note that the image must have been displayed at least once prior to calling this function for it to work correctly. You can always enlarge the image first via the cropping function with some solid borders. Then you can put annotation outside of the original image but within the enlarged image. Not all image formats support the storage of text and markers. This means if you attempt to save an image that has associated text and markers into an image format that does not support it, you may lose the annotation. All pnm formats supports the storage of annotations. To find out if a particular format supports annotation storage, look at the annotation field of the `FLIMAGE_FORMAT_INFO' structure. A zero value indicates it does not support it.  File: xforms.info, Node: Write Your Own Routines, Prev: Image Annotation, Up: Simple Image Processing 37.7.10 Write Your Own Routines ------------------------------- The only communication required between an image processing routine and the rest of the image routines is to let the display routine know that the image has been modified by setting `image->modified' to 1. This information is used by the display routine to invalidate any buffered displayable images that were created from the original image. After displaying, `image->modified' is reset by the display routine.  File: xforms.info, Node: Utilities, Prev: Simple Image Processing, Up: Part VI Images 37.8 Utilities ============== In the following some of the utilities that may come in handy when you're writing image manipulation routines are described. * Menu: * Memory Allocation:: * Color Quantization:: * Remarks::  File: xforms.info, Node: Memory Allocation, Next: Color Quantization, Up: Utilities 37.8.1 Memory Allocation ------------------------ To create a matrix to be used in several of the functions listed above use either `*note fl_get_matrix()::' described above or void *fl_make_matrix(int nrow, int ncol, unsigned int esize, void *inMem); where `nrow' and `ncol' are the number of rows and columns of the matrix respectively. `esize' is the size (in bytes) of each matrix element. Both functions return a two-dimensional array of entities of size `esize'. The first function initializes all elements to zero. The second function does not allocate nor initialize memory for the matrix itself. Instead it uses the memory with address `inMem' that is supplied by the caller, which should be a one-dimensional array of length `nrow * ncol * esize'. You can use the returned pointer as a regular two-dimensional array (`matrix[r][c]') or as a single array of length `nrow *ncol', starting from at `matrix[0]': short **matrix = fl_get_matrix(nrow, ncol, sizeof **matrix); /* access the matrix as a 2-d array */ matrix[3][4] = 5; /* or access it as 1D array */ *(matrix[0] + 3 * ncol + 4) = 5; /* most useful in image processing to use it as 1D array */ memcpy(saved, matrix, nrow * ncol * sizeof **matrix); To free a matrix allocated using one the above functions, use void fl_free_matrix(void *matrix); The function frees all memory allocated. After the function returns the matrix cab not be de-referenced anymore. In the case where the matrix was created by `*note fl_make_matrix()::' the function will only free the memory that's allocated to hold the matrix indices but not the memory supplied by the caller. It is the caller's responsibility to free that part of the memory. There are also some useful functions that manipulate images directly. The following is a brief summary of them. FL_IMAGE *flimage_dup(FL_IMAGE *im); This function duplicates an image `im' and returns the duplicated image. At the moment, only the first image is duplicated even if the input image has multiple frames. Furthermore, markers and annotations are not duplicated. Pixmap flimage_to_pixmap(FL_IMAGE *im, FL_WINDOW win); int flimage_from_pixmap(FL_IMAGE *im, Pixmap pixmap); The first function converts an image into a Pixmap (a server side resource) that can be used in the pixmap object (see pixmap-class???). The second function does the reverse. `im' must be a properly allocated image.  File: xforms.info, Node: Color Quantization, Next: Remarks, Prev: Memory Allocation, Up: Utilities 37.8.2 Color Quantization ------------------------- In order to display a RGB image on a color-mapped device of limited depth, the number of colors in the original image will have to be reduced. Color quantization is one way of doing this. Two color quantization algorithms are available in the Forms Library. One uses Heckbert's median cut algorithm followed by Floyd-Steinberg dithering after which the pixels are mapped to the colors selected. The code implementing this is from the Independent JPEG Group's two pass quantizer (`jquant2.c' in the IJG's distribution), which under copyright (c) 1991-1996 by Thomas G. Lane and the IJG. Another method is based on the Octree quantization algorithm with no dithering and is implemented by Steve Lamont (`spl@ucsd.edu') and is under vopyright (c) 1998 by Steve Lamont and the National Center for Microscopy and Imaging Research. This quantization library is available from `ftp://ncmir.ucsd.edu/pub/quantize/libquantize.html'. The quantizer based on this library is not compiled into the image support. The source code for using this quantizer is in `image' subdirectory. By default, the median cut algorithm is used. You can switch to the octree based algorithm using the following call void flimage_select_octree_quantizer(void); To switch back to the median cut quantizer use void flimage_select_mediancut_quantizer(void); The median-cut quantizer tends to give better images because of the dithering step. However, in this particular implementation, the number of quantized colors is limited to 256. There is no such limit with the octree quantizer implementation.  File: xforms.info, Node: Remarks, Prev: Color Quantization, Up: Utilities 37.8.3 Remarks -------------- See `itest.c' and `ibrowser.c' for example use of the image support in Forms Library. `iconvert.c' is a program that converts between different file formats and does not require an X connection. Due to access limitations, not all combinations of display depth and bits per pixel (bpp) are tested. Depths of 1 bit (1 bpp), 4 bits (8 bpp), 8 bits (8 bpp), 16 bits (16 bpp), 24 bits (32 bpp), 30 bits (32 bpp) were tested. Although it works in 12 bit PseudoColor mode, due to limitations of the default quantizer the display function does not take full advantage of the larger lookup table. Special provisions were made so a gray12 image will be displayed in 4096 shades of gray if the hardware supports 12-bit grayscale. If JPEG support (`image_jpeg.c') is not compiled into the Forms Library, you can obtain the jpeg library source from `ftp://ftp.uu.net/graphics/jpeg'.  File: xforms.info, Node: Index of Functions, Next: Index of Global Variables, Prev: Part VI Images, Up: Top Index of Functions ****************** [index] * Menu: * fl_activate_all_forms() <1>: Doing Interaction. (line 254) * fl_activate_all_forms(): Dealing With Multiple Windows. (line 44) * fl_activate_event_callbacks() <1>: Doing Interaction. (line 323) * fl_activate_event_callbacks(): Using Callback Functions. (line 120) * fl_activate_form() <1>: Doing Interaction. (line 250) * fl_activate_form(): Dealing With Multiple Windows. (line 20) * fl_activate_glcanvas(): OpenGL Canvas. (line 56) * fl_activate_object() <1>: Doing Interaction. (line 276) * fl_activate_object(): Deactivating and Triggering Objects. (line 12) * fl_add_bitmap(): Adding Bitmap Objects. (line 6) * fl_add_bitmapbutton(): Adding Button Objects. (line 6) * fl_add_box() <1>: Adding Box Objects. (line 6) * fl_add_box(): Boxes. (line 9) * fl_add_browser(): Adding Browser Objects. (line 6) * fl_add_browser_line(): Other Browser Routines. (line 12) * fl_add_browser_line_f(): Other Browser Routines. (line 12) * fl_add_button() <1>: Adding Button Objects. (line 6) * fl_add_button(): Buttons. (line 11) * fl_add_button_class(): Part IV New Buttons. (line 72) * fl_add_canvas(): Adding Canvas Objects. (line 6) * fl_add_canvas_handler(): Canvas Interaction. (line 21) * fl_add_chart(): Adding Chart Objects. (line 6) * fl_add_chart_value(): Other Chart Routines. (line 10) * fl_add_checkbutton(): Adding Button Objects. (line 6) * fl_add_child(): Part IV The Type FL_OBJECT. (line 363) * fl_add_choice(): Adding Choice Objects. (line 6) * fl_add_clock(): Adding Clock Objects. (line 6) * fl_add_counter(): Adding Counter Objects. (line 6) * fl_add_dial(): Adding Dial Objects. (line 6) * fl_add_event_callback() <1>: Doing Interaction. (line 308) * fl_add_event_callback(): Using Callback Functions. (line 99) * fl_add_formbrowser(): Adding FormBrowser Objects. (line 6) * fl_add_frame(): Adding Frame Objects. (line 6) * fl_add_free(): Free Object. (line 6) * fl_add_fselector_appbutton(): File Selector. (line 127) * fl_add_glcanvas(): OpenGL Canvas. (line 11) * fl_add_input() <1>: Adding Input Objects. (line 6) * fl_add_input(): Input Fields. (line 9) * fl_add_io_callback(): Handling Other Input Sources. (line 12) * fl_add_labelbutton(): Adding Button Objects. (line 6) * fl_add_labelframe(): Adding LabelFrame Objects. (line 6) * fl_add_lightbutton(): Adding Button Objects. (line 6) * fl_add_menu(): Adding Menu Objects. (line 6) * fl_add_nmenu(): Adding Nmenu Objects. (line 6) * fl_add_nmenu_items(): Adding Nmenu Objects. (line 30) * fl_add_nmenu_items2(): Other Nmenu Routines. (line 59) * fl_add_object() <1>: Creating Forms. (line 77) * fl_add_object(): Adding and Removing Objects. (line 32) * fl_add_pixmap(): Adding Pixmap Objects. (line 6) * fl_add_pixmapbutton(): Adding Button Objects. (line 6) * fl_add_positioner(): Adding Positioner Objects. (line 6) * fl_add_round3dbutton(): Adding Button Objects. (line 6) * fl_add_roundbutton(): Adding Button Objects. (line 6) * fl_add_scrollbar(): Adding Scrollbar Objects. (line 6) * fl_add_scrollbutton(): Adding Button Objects. (line 6) * fl_add_select(): Adding Select Objects. (line 6) * fl_add_select_items(): Adding Select Objects. (line 28) * fl_add_signal_callback(): Signals. (line 16) * fl_add_slider() <1>: Adding Slider Objects. (line 6) * fl_add_slider(): Sliders. (line 7) * fl_add_spinner(): Adding Spinner Objects. (line 6) * fl_add_symbol(): Symbols. (line 84) * fl_add_tabfolder(): Adding Folder Objects. (line 6) * fl_add_text() <1>: Adding Text Objects. (line 6) * fl_add_text(): Texts. (line 8) * fl_add_thumbwheel(): Adding Thumbwheel Objects. (line 6) * fl_add_timeout() <1>: Idle Callbacks and Timeouts. (line 36) * fl_add_timeout(): Periodic Events and Non-blocking Interaction. (line 48) * fl_add_timer(): Adding Timer Objects. (line 6) * fl_add_valslider() <1>: Adding Slider Objects. (line 9) * fl_add_valslider(): ValSliders. (line 10) * fl_add_xyplot(): Adding XYPlot Objects. (line 6) * fl_add_xyplot_overlay(): Other XYPlot Routines. (line 159) * fl_add_xyplot_overlay_file(): Other XYPlot Routines. (line 168) * fl_add_xyplot_text(): Other XYPlot Routines. (line 225) * fl_addto_browser(): Other Browser Routines. (line 22) * fl_addto_browser_chars(): Other Browser Routines. (line 31) * fl_addto_browser_chars_f(): Other Browser Routines. (line 31) * fl_addto_browser_f(): Other Browser Routines. (line 22) * fl_addto_choice(): Other Choice Routines. (line 7) * fl_addto_choice_f(): Other Choice Routines. (line 7) * fl_addto_command_log(): Command Log. (line 88) * fl_addto_command_log_f(): Command Log. (line 88) * fl_addto_form() <1>: Creating Forms. (line 66) * fl_addto_form(): Adding and Removing Objects. (line 9) * fl_addto_formbrowser(): Other FormBrowser Routines. (line 6) * fl_addto_group() <1>: Creating Forms. (line 66) * fl_addto_group(): Grouping Objects. (line 36) * fl_addto_menu(): Other Menu Routines. (line 45) * fl_addto_selected_xevent(): Using Callback Functions. (line 132) * fl_addto_tabfolder(): Other Folder Routines. (line 6) * fl_addtopup(): Creating XPopups. (line 136) * fl_adjust_form_size(): Initialization. (line 359) * fl_app_signal_direct(): Signals. (line 64) * fl_arc(): Drawing Functions. (line 91) * fl_arcf(): Drawing Functions. (line 91) * fl_bgn_form() <1>: Creating Forms. (line 6) * fl_bgn_form(): Starting and Ending a Form Definition. (line 7) * fl_bgn_group() <1>: Creating Forms. (line 39) * fl_bgn_group(): Grouping Objects. (line 7) * fl_bk_color(): Color Handling. (line 21) * fl_call_object_callback() <1>: Object Attributes. (line 222) * fl_call_object_callback(): Using Callback Functions. (line 57) * fl_calloc(): The Routine fl_add_NEW(). (line 35) * fl_canvas_yield_to_shortcut(): Other Canvas Routines. (line 66) * fl_check_command(): Command Log. (line 52) * fl_check_forms() <1>: Doing Interaction. (line 235) * fl_check_forms(): Periodic Events and Non-blocking Interaction. (line 80) * fl_check_only_forms(): Doing Interaction. (line 242) * fl_circ(): Drawing Functions. (line 83) * fl_circbound(): Drawing Functions. (line 83) * fl_circf(): Drawing Functions. (line 83) * fl_clear_browser(): Other Browser Routines. (line 9) * fl_clear_canvas(): Other Canvas Routines. (line 69) * fl_clear_chart(): Other Chart Routines. (line 7) * fl_clear_choice(): Other Choice Routines. (line 31) * fl_clear_command_log(): Command Log. (line 84) * fl_clear_menu(): Other Menu Routines. (line 98) * fl_clear_nmenu(): Other Nmenu Routines. (line 81) * fl_clear_select(): Other Select Routines. (line 79) * fl_clear_xyplot(): Other XYPlot Routines. (line 289) * fl_color(): Color Handling. (line 18) * fl_create_animated_cursor(): Cursors. (line 51) * fl_create_bitmap_cursor(): Cursors. (line 39) * fl_create_colormap(): Other Canvas Routines. (line 49) * fl_create_from_bitmapdata(): Other Bitmap Routines. (line 16) * fl_create_from_pixmapdata(): Pixmap Remarks. (line 21) * fl_create_generic_button(): Part IV New Buttons. (line 20) * fl_current_event(): Object Attributes. (line 240) * fl_current_pup(): Creating XPopups. (line 207) * fl_dashedlinestyle(): Drawing Functions. (line 182) * fl_deactivate_all_forms() <1>: Doing Interaction. (line 254) * fl_deactivate_all_forms(): Dealing With Multiple Windows. (line 44) * fl_deactivate_form() <1>: Doing Interaction. (line 250) * fl_deactivate_form(): Dealing With Multiple Windows. (line 17) * fl_deactivate_object() <1>: Doing Interaction. (line 276) * fl_deactivate_object(): Deactivating and Triggering Objects. (line 9) * fl_default_window(): General Remarks. (line 43) * fl_defpup(): Creating XPopups. (line 6) * fl_delete_browser_line(): Other Browser Routines. (line 62) * fl_delete_choice(): Other Choice Routines. (line 27) * fl_delete_folder(): Other Folder Routines. (line 72) * fl_delete_folder_byname(): Other Folder Routines. (line 72) * fl_delete_folder_byname_f(): Other Folder Routines. (line 72) * fl_delete_folder_bynumber(): Other Folder Routines. (line 72) * fl_delete_formbrowser(): Other FormBrowser Routines. (line 32) * fl_delete_formbrowser_bynumber(): Other FormBrowser Routines. (line 32) * fl_delete_menu_item(): Other Menu Routines. (line 50) * fl_delete_nmenu_item(): Other Nmenu Routines. (line 34) * fl_delete_object() <1>: Creating Forms. (line 73) * fl_delete_object(): Adding and Removing Objects. (line 19) * fl_delete_select_item(): Other Select Routines. (line 47) * fl_delete_symbol(): Symbols. (line 115) * fl_delete_xyplot_overlay(): Other XYPlot Routines. (line 220) * fl_delete_xyplot_text(): Other XYPlot Routines. (line 237) * fl_deselect_browser(): Other Browser Routines. (line 109) * fl_deselect_browser_line(): Other Browser Routines. (line 109) * fl_diagline(): Drawing Functions. (line 130) * fl_disable_fselector_cache(): File Selector. (line 62) * fl_do_forms() <1>: Doing Interaction. (line 227) * fl_do_forms(): Simple Interaction. (line 9) * fl_do_only_forms(): Doing Interaction. (line 242) * fl_dopup(): Creating XPopups. (line 145) * fl_draw_box(): Drawing Functions. (line 238) * fl_draw_frame(): Drawing Functions. (line 249) * fl_draw_object_label(): Drawing Functions. (line 303) * fl_draw_object_label_outside(): Drawing Functions. (line 303) * fl_draw_symbol(): Symbols. (line 75) * fl_draw_text(): Drawing Functions. (line 255) * fl_draw_text_beside(): Drawing Functions. (line 255) * fl_draw_text_cursor(): Drawing Functions. (line 279) * fl_drawmode(): Drawing Functions. (line 207) * fl_end_all_command(): Command Log. (line 47) * fl_end_command(): Command Log. (line 39) * fl_end_form(): Starting and Ending a Form Definition. (line 17) * fl_end_form();: Creating Forms. (line 34) * fl_end_group() <1>: Creating Forms. (line 44) * fl_end_group(): Grouping Objects. (line 9) * fl_enumerate_fonts(): Label Attributes and Fonts. (line 118) * fl_exe_command(): Command Log. (line 12) * fl_find_formbrowser_form_number(): Other FormBrowser Routines. (line 64) * fl_finish(): Initialization. (line 408) * fl_fit_object_label(): Initialization. (line 380) * fl_flip_yorigin(): Initialization. (line 233) * fl_for_all_objects(): Displaying a Form. (line 263) * fl_form_is_activated(): Doing Interaction. (line 258) * fl_form_is_iconified(): Doing Interaction. (line 184) * fl_form_is_visible() <1>: Doing Interaction. (line 220) * fl_form_is_visible(): Displaying a Form. (line 298) * FL_FormDisplay(): General Remarks. (line 79) * fl_free(): The Routine fl_add_NEW(). (line 35) * fl_free_colors() <1>: Color Handling. (line 33) * fl_free_colors(): Color. (line 130) * fl_free_dirlist(): File Selector. (line 249) * fl_free_form() <1>: Creating Forms. (line 91) * fl_free_form(): Freeing Objects. (line 13) * fl_free_matrix(): Memory Allocation. (line 36) * fl_free_object() <1>: Creating Forms. (line 81) * fl_free_object(): Freeing Objects. (line 7) * fl_free_pixels(): Color Handling. (line 41) * fl_free_pixmap(): Pixmap Remarks. (line 34) * fl_free_pixmap_focus_pixmap(): Other Button Routines. (line 140) * fl_free_pixmap_pixmap(): Other Pixmap Routines. (line 19) * fl_free_pixmapbutton_pixmap(): Other Button Routines. (line 102) * fl_freepup(): Creating XPopups. (line 214) * fl_freeze_all_forms(): Object Attributes. (line 160) * fl_freeze_form() <1>: Object Attributes. (line 152) * fl_freeze_form(): Changing Many Attributes. (line 19) * fl_get_active_folder(): Folder Interaction. (line 41) * fl_get_active_folder_name(): Folder Interaction. (line 41) * fl_get_active_folder_number(): Folder Interaction. (line 41) * fl_get_align_xy(): Drawing Functions. (line 291) * fl_get_app_mainform(): Doing Interaction. (line 114) * fl_get_app_resources(): Current Support. (line 29) * fl_get_border_width(): Initialization. (line 197) * fl_get_browser(): Other Browser Routines. (line 137) * fl_get_browser_dimension(): Browser Attributes. (line 179) * fl_get_browser_line(): Other Browser Routines. (line 94) * fl_get_browser_line_yoffset(): Other Browser Routines. (line 190) * fl_get_browser_maxline(): Other Browser Routines. (line 118) * fl_get_browser_rel_xoffset(): Other Browser Routines. (line 183) * fl_get_browser_rel_yoffset(): Other Browser Routines. (line 183) * fl_get_browser_screenlines(): Other Browser Routines. (line 130) * fl_get_browser_scrollbar_repeat(): Browser Attributes. (line 187) * fl_get_browser_topline(): Other Browser Routines. (line 145) * fl_get_browser_xoffset(): Other Browser Routines. (line 183) * fl_get_browser_yoffset(): Other Browser Routines. (line 183) * fl_get_button() <1>: Other Button Routines. (line 19) * fl_get_button(): Buttons. (line 70) * fl_get_button_mouse_buttons(): Other Button Routines. (line 45) * fl_get_button_numb(): Other Button Routines. (line 24) * fl_get_canvas_colormap(): Other Canvas Routines. (line 16) * fl_get_canvas_depth(): Other Canvas Routines. (line 16) * fl_get_canvas_id(): Canvas Interaction. (line 77) * fl_get_char_height(): Getting the Size. (line 15) * fl_get_char_width(): Getting the Size. (line 15) * fl_get_chart_bounds(): Other Chart Routines. (line 51) * fl_get_choice(): Other Choice Routines. (line 40) * fl_get_choice_item_mode(): Other Choice Routines. (line 62) * fl_get_choice_item_text(): Other Choice Routines. (line 51) * fl_get_choice_maxitems(): Other Choice Routines. (line 54) * fl_get_choice_text(): Other Choice Routines. (line 46) * fl_get_clipping(): Clipping. (line 28) * fl_get_clock(): Other Clock Routines. (line 7) * fl_get_cmdline_args(): Initialization. (line 89) * fl_get_colormap(): Global Variables and Macros. (line 72) * fl_get_command_log_fdstruct(): Command Log. (line 98) * fl_get_coordunit(): Initialization. (line 164) * fl_get_counter_bounds(): Other Counter Routines. (line 26) * fl_get_counter_min_repeat(): Other Counter Routines. (line 64) * fl_get_counter_precision(): Other Counter Routines. (line 34) * fl_get_counter_repeat(): Other Counter Routines. (line 64) * fl_get_counter_speedjump(): Other Counter Routines. (line 82) * fl_get_counter_step(): Other Counter Routines. (line 26) * fl_get_counter_value(): Other Counter Routines. (line 23) * fl_get_decoration_sizes(): Doing Interaction. (line 175) * fl_get_dial_angles(): Other Dial Routines. (line 25) * fl_get_dial_bounds(): Other Dial Routines. (line 12) * fl_get_dial_direction(): Other Dial Routines. (line 47) * fl_get_dial_step(): Other Dial Routines. (line 39) * fl_get_dial_value(): Other Dial Routines. (line 12) * fl_get_directory(): File Selector. (line 112) * fl_get_dirlist(): File Selector. (line 203) * fl_get_display(): General Remarks. (line 79) * fl_get_dpi(): Global Variables and Macros. (line 59) * fl_get_drawmode((): Drawing Functions. (line 231) * fl_get_filename(): File Selector. (line 112) * fl_get_focus_object() <1>: Object Attributes. (line 212) * fl_get_focus_object(): Input Fields. (line 40) * fl_get_folder(): Folder Interaction. (line 55) * fl_get_folder_area(): Other Folder Routines. (line 100) * fl_get_folder_name(): Folder Interaction. (line 55) * fl_get_folder_number(): Folder Interaction. (line 55) * fl_get_font_name(): Label Attributes and Fonts. (line 105) * fl_get_fontstruct(): Font Handling. (line 8) * fl_get_form_background_color(): Creating Forms. (line 26) * fl_get_form_mouse(): Mouse Handling. (line 11) * fl_get_form_vclass(): General Remarks. (line 58) * fl_get_formbrowser_area(): Other FormBrowser Routines. (line 112) * fl_get_formbrowser_form(): Other FormBrowser Routines. (line 70) * fl_get_formbrowser_numforms(): Other FormBrowser Routines. (line 20) * fl_get_formbrowser_topform(): Other FormBrowser Routines. (line 100) * fl_get_formbrowser_xoffset(): Other FormBrowser Routines. (line 129) * fl_get_formbrowser_yoffset(): Other FormBrowser Routines. (line 129) * fl_get_fselector_fdstruct(): File Selector. (line 150) * fl_get_fselector_form(): File Selector. (line 144) * fl_get_glcanvas_attributes(): OpenGL Canvas. (line 36) * fl_get_glcanvas_context(): OpenGL Canvas. (line 40) * fl_get_glcanvas_defaults(): OpenGL Canvas. (line 26) * fl_get_glcanvas_xvisualinfo(): OpenGL Canvas. (line 61) * fl_get_global_clipping(): Clipping. (line 43) * fl_get_icm_color() <1>: Initialization. (line 399) * fl_get_icm_color(): Color. (line 87) * fl_get_input() <1>: Other Input Routines. (line 26) * fl_get_input(): Input Fields. (line 53) * fl_get_input_color(): Input Attributes. (line 17) * fl_get_input_cursorpos(): Other Input Routines. (line 64) * fl_get_input_editkeymap(): Input Attributes. (line 85) * fl_get_input_format(): Input Interaction. (line 201) * fl_get_input_numberoflines(): Other Input Routines. (line 126) * fl_get_input_screenlines(): Other Input Routines. (line 132) * fl_get_input_scrollbarsize(): Input Attributes. (line 28) * fl_get_input_selected_range(): Other Input Routines. (line 50) * fl_get_input_topline(): Other Input Routines. (line 129) * fl_get_input_xoffset(): Other Input Routines. (line 119) * fl_get_label_char_at_mouse(): Object Attributes. (line 251) * fl_get_linestyle((): Drawing Functions. (line 231) * fl_get_linewidth(): Drawing Functions. (line 231) * fl_get_matrix(): Creating Images. (line 35) * fl_get_menu(): Other Menu Routines. (line 101) * fl_get_menu_item_mode(): Other Menu Routines. (line 162) * fl_get_menu_item_text(): Other Menu Routines. (line 119) * fl_get_menu_maxitems(): Other Menu Routines. (line 127) * fl_get_menu_popup(): Menu Attributes. (line 31) * fl_get_menu_text(): Other Menu Routines. (line 124) * fl_get_mouse() <1>: Mouse Handling. (line 22) * fl_get_mouse(): Dealing With Multiple Windows. (line 159) * fl_get_nmenu_item(): Other Nmenu Routines. (line 6) * fl_get_nmenu_item_by_label(): Other Nmenu Routines. (line 15) * fl_get_nmenu_item_by_text(): Other Nmenu Routines. (line 15) * fl_get_nmenu_item_by_value(): Other Nmenu Routines. (line 15) * fl_get_nmenu_popup(): Nmenu Attributes. (line 27) * fl_get_object_bbox() <1>: Object Attributes. (line 75) * fl_get_object_bbox(): Getting the Size. (line 9) * fl_get_object_boxtype(): Object Attributes. (line 30) * fl_get_object_bw() <1>: Object Attributes. (line 36) * fl_get_object_bw(): Bounding Boxes. (line 26) * fl_get_object_color() <1>: Object Attributes. (line 21) * fl_get_object_color(): Color. (line 29) * fl_get_object_component(): Object Attributes. (line 86) * fl_get_object_dblclick(): Object Attributes. (line 182) * fl_get_object_geometry(): Object Attributes. (line 60) * fl_get_object_gravity() <1>: Object Attributes. (line 140) * fl_get_object_gravity(): Displaying a Form. (line 257) * fl_get_object_label() <1>: Object Attributes. (line 110) * fl_get_object_label(): Label Attributes and Fonts. (line 200) * fl_get_object_lalign(): Object Attributes. (line 110) * fl_get_object_lcolor(): Object Attributes. (line 110) * fl_get_object_lsize(): Object Attributes. (line 110) * fl_get_object_lstyle(): Object Attributes. (line 110) * fl_get_object_objclass(): Object Attributes. (line 13) * fl_get_object_position(): Object Attributes. (line 42) * fl_get_object_resize() <1>: Object Attributes. (line 140) * fl_get_object_resize(): Displaying a Form. (line 257) * fl_get_object_return_state() <1>: Browser Attributes. (line 155) * fl_get_object_return_state(): Simple Interaction. (line 146) * fl_get_object_size(): Object Attributes. (line 53) * fl_get_object_type(): Object Attributes. (line 13) * fl_get_pattern(): File Selector. (line 112) * fl_get_pixel(): Color Handling. (line 11) * fl_get_pixmap_pixmap(): Other Pixmap Routines. (line 26) * fl_get_pixmapbutton_pixmap(): Other Button Routines. (line 108) * fl_get_positioner_mouse_buttons(): Positioner Interaction. (line 43) * fl_get_positioner_numb(): Positioner Interaction. (line 51) * fl_get_positioner_xbounds(): Other Positioner Routines. (line 74) * fl_get_positioner_xstep(): Other Positioner Routines. (line 87) * fl_get_positioner_xvalue(): Other Positioner Routines. (line 74) * fl_get_positioner_ybounds(): Other Positioner Routines. (line 74) * fl_get_positioner_ystep(): Other Positioner Routines. (line 87) * fl_get_positioner_yvalue(): Other Positioner Routines. (line 74) * fl_get_real_object_window(): Part IV Events. (line 51) * fl_get_resource(): Resources Example. (line 39) * fl_get_scrollbar_bounds(): Other Scrollbar Routines. (line 22) * fl_get_scrollbar_increment(): Other Scrollbar Routines. (line 38) * fl_get_scrollbar_repeat(): Other Scrollbar Routines. (line 41) * fl_get_scrollbar_size(): Scrollbar Attributes. (line 23) * fl_get_scrollbar_value(): Other Scrollbar Routines. (line 22) * fl_get_select_item(): Other Select Routines. (line 6) * fl_get_select_item_by_label(): Other Select Routines. (line 14) * fl_get_select_item_by_label_f(): Other Select Routines. (line 14) * fl_get_select_item_by_text(): Other Select Routines. (line 14) * fl_get_select_item_by_text_f(): Other Select Routines. (line 14) * fl_get_select_item_by_value(): Other Select Routines. (line 14) * fl_get_select_popup(): Select Attributes. (line 43) * fl_get_select_text_align(): Select Attributes. (line 17) * fl_get_select_text_color(): Select Attributes. (line 10) * fl_get_select_text_font(): Select Attributes. (line 26) * fl_get_slider_bounds(): Other Slider Routines. (line 21) * fl_get_slider_mouse_buttons(): Other Slider Routines. (line 32) * fl_get_slider_size(): Slider Attributes. (line 22) * fl_get_slider_value() <1>: Other Slider Routines. (line 21) * fl_get_slider_value(): Sliders. (line 22) * fl_get_spinner_bounds(): Other Spinner Routines. (line 15) * fl_get_spinner_down_button(): Spinner Attributes. (line 19) * fl_get_spinner_input(): Spinner Attributes. (line 19) * fl_get_spinner_precision(): Other Spinner Routines. (line 34) * fl_get_spinner_step(): Other Spinner Routines. (line 27) * fl_get_spinner_up_button(): Spinner Attributes. (line 19) * fl_get_spinner_value(): Other Spinner Routines. (line 6) * fl_get_string_dimension(): Getting the Size. (line 46) * fl_get_string_height(): Getting the Size. (line 27) * fl_get_string_width(): Getting the Size. (line 27) * fl_get_tabfolder_folder_byname(): Other Folder Routines. (line 32) * fl_get_tabfolder_folder_byname_f(): Other Folder Routines. (line 32) * fl_get_tabfolder_folder_bynumber(): Other Folder Routines. (line 32) * fl_get_tabfolder_numfolders(): Other Folder Routines. (line 69) * fl_get_tabfolder_offset(): Other Folder Routines. (line 50) * fl_get_text_clipping(: Clipping. (line 49) * fl_get_thumbwheel_bounds(): Other Thumbwheel Routines. (line 13) * fl_get_thumbwheel_step(): Other Thumbwheel Routines. (line 31) * fl_get_thumbwheel_value(): Other Thumbwheel Routines. (line 13) * fl_get_timer(): Other Timer Routines. (line 11) * fl_get_vclass(): General Remarks. (line 58) * fl_get_visual(): Global Variables and Macros. (line 66) * fl_get_visual_depth: Misc. Functions. (line 39) * fl_get_win_mouse() <1>: Mouse Handling. (line 11) * fl_get_win_mouse(): Dealing With Multiple Windows. (line 166) * fl_get_wingeometry() <1>: Windowing Support. (line 153) * fl_get_wingeometry(): Dealing With Multiple Windows. (line 151) * fl_get_winorigin() <1>: Windowing Support. (line 153) * fl_get_winorigin(): Dealing With Multiple Windows. (line 151) * fl_get_winsize() <1>: Windowing Support. (line 153) * fl_get_winsize(): Dealing With Multiple Windows. (line 151) * fl_get_xyplot(): XYPlot Interaction. (line 40) * fl_get_xyplot_data(): XYPlot Interaction. (line 79) * fl_get_xyplot_data_pointer(): Other XYPlot Routines. (line 193) * fl_get_xyplot_data_size(): XYPlot Interaction. (line 79) * fl_get_xyplot_mouse_buttons(): Other XYPlot Routines. (line 338) * fl_get_xyplot_numdata(): Other XYPlot Routines. (line 207) * fl_get_xyplot_overlay_data(): Other XYPlot Routines. (line 181) * fl_get_xyplot_screen_area(): Other XYPlot Routines. (line 318) * fl_get_xyplot_world_area(): Other XYPlot Routines. (line 318) * fl_get_xyplot_xbounds(): Other XYPlot Routines. (line 149) * fl_get_xyplot_xmapping(): Other XYPlot Routines. (line 298) * fl_get_xyplot_ybounds(): Other XYPlot Routines. (line 149) * fl_get_xyplot_ymapping(): Other XYPlot Routines. (line 298) * fl_getmcolor() <1>: Color Handling. (line 46) * fl_getmcolor(): Color. (line 115) * fl_getpup_items(): Other XPopup Routines. (line 58) * fl_getpup_mode(): Other XPopup Routines. (line 18) * fl_getpup_text(): Other XPopup Routines. (line 24) * fl_gettime(): Misc. Functions. (line 23) * fl_hide_alert(): Messages and Questions. (line 52) * fl_hide_choice(): Messages and Questions. (line 131) * fl_hide_command_log(): Command Log. (line 71) * fl_hide_form() <1>: Doing Interaction. (line 216) * fl_hide_form(): Displaying a Form. (line 295) * fl_hide_fselector(): File Selector. (line 35) * fl_hide_input(): Messages and Questions. (line 158) * fl_hide_message(): Messages and Questions. (line 33) * fl_hide_object() <1>: Object Attributes. (line 186) * fl_hide_object(): Hiding and Showing. (line 7) * fl_hide_oneliner(): Messages and Questions. (line 37) * fl_hide_question(): Messages and Questions. (line 93) * fl_hidepup(): XPopup Attributes. (line 70) * fl_iconify(): Windowing Support. (line 176) * fl_initial_wingeometry(): Windowing Support. (line 101) * fl_initial_winsize(): Windowing Support. (line 60) * fl_initial_winstate(): Windowing Support. (line 72) * fl_initialize(): Initialization. (line 6) * fl_input_end_return_handling(): Input Interaction. (line 153) * fl_insert_browser_line(): Other Browser Routines. (line 45) * fl_insert_browser_line_f(): Other Browser Routines. (line 45) * fl_insert_chart_value(): Other Chart Routines. (line 29) * fl_insert_formbrowser(): Other FormBrowser Routines. (line 57) * fl_insert_nmenu_items(): Other Nmenu Routines. (line 45) * fl_insert_nmenu_items2(): Other Nmenu Routines. (line 59) * fl_insert_select_items(): Other Select Routines. (line 69) * fl_insert_xyplot_data(): Other XYPlot Routines. (line 211) * fl_interpolate(): XYPlot Remarks. (line 7) * fl_invalidate_fselector_cache(): File Selector. (line 58) * fl_is_center_lalign(): Label Attributes and Fonts. (line 170) * fl_is_clipped(): Clipping. (line 21) * fl_is_global_clipped(): Clipping. (line 43) * fl_is_inside_lalign(): Label Attributes and Fonts. (line 170) * fl_is_outside_lalign(): Label Attributes and Fonts. (line 170) * fl_is_text_clipped(: Clipping. (line 49) * fl_isselected_browser_line(): Other Browser Routines. (line 115) * fl_last_event() <1>: Object Attributes. (line 235) * fl_last_event(): Dealing With Multiple Windows. (line 143) * fl_library_version(): Version Information. (line 18) * fl_line(): Drawing Functions. (line 125) * fl_lines(): Drawing Functions. (line 134) * fl_linestyle(): Drawing Functions. (line 151) * fl_linewidth(): Drawing Functions. (line 151) * fl_load_browser(): Other Browser Routines. (line 99) * fl_lower_form(): Doing Interaction. (line 156) * fl_make_matrix(): Memory Allocation. (line 7) * fl_make_object(): Part IV The Type FL_OBJECT. (line 329) * fl_malloc(): The Routine fl_add_NEW(). (line 35) * fl_mapcolor() <1>: Color Handling. (line 46) * fl_mapcolor(): Color. (line 99) * fl_mapcolorname() <1>: Color Handling. (line 46) * fl_mapcolorname(): Color. (line 111) * fl_mode_capable(): Misc. Functions. (line 29) * fl_mouse_button(): Dealing With Multiple Windows. (line 121) * fl_move_object(): Object Attributes. (line 48) * fl_msleep(): Misc. Functions. (line 42) * fl_newpup(): Creating XPopups. (line 6) * fl_noborder(): Windowing Support. (line 132) * fl_now(): Misc. Functions. (line 19) * fl_object_is_active() <1>: Doing Interaction. (line 282) * fl_object_is_active(): Deactivating and Triggering Objects. (line 15) * fl_object_is_automatic(): Object Attributes. (line 173) * fl_object_is_visible() <1>: Object Attributes. (line 193) * fl_object_is_visible(): Hiding and Showing. (line 19) * fl_object_ps_dump(): Object Attributes. (line 263) * FL_ObjWin(): Canvas Interaction. (line 79) * fl_oval(): Drawing Functions. (line 74) * fl_ovalarc(: Drawing Functions. (line 115) * fl_ovalbound(): Drawing Functions. (line 62) * fl_ovalf(): Drawing Functions. (line 62) * fl_ovall(): Drawing Functions. (line 62) * fl_pclose(): Command Log. (line 61) * fl_pieslice(): Drawing Functions. (line 104) * fl_point(): Drawing Functions. (line 138) * fl_points(): Drawing Functions. (line 138) * fl_polybound(): Drawing Functions. (line 43) * fl_polyf(): Drawing Functions. (line 43) * fl_polyl(): Drawing Functions. (line 43) * fl_popen(): Command Log. (line 61) * fl_popup_add(): Adding Popups. (line 13) * fl_popup_add_entries(): Adding Popups. (line 28) * fl_popup_add_items(): Adding Popups. (line 553) * fl_popup_create(): Adding Popups. (line 415) * fl_popup_entry_clear_state(): Other Popup Routines. (line 77) * fl_popup_entry_delete(): Adding Popups. (line 386) * fl_popup_entry_get_by_label(): Other Popup Routines. (line 114) * fl_popup_entry_get_by_label_f(): Other Popup Routines. (line 114) * fl_popup_entry_get_by_position(): Other Popup Routines. (line 136) * fl_popup_entry_get_by_text(): Other Popup Routines. (line 98) * fl_popup_entry_get_by_text_f(): Other Popup Routines. (line 98) * fl_popup_entry_get_by_user_data(): Other Popup Routines. (line 130) * fl_popup_entry_get_by_value(): Other Popup Routines. (line 125) * fl_popup_entry_get_group(): Popup Attributes. (line 133) * fl_popup_entry_get_state(): Other Popup Routines. (line 60) * fl_popup_entry_get_subpopup(): Popup Attributes. (line 152) * fl_popup_entry_set_callback(): Other Popup Routines. (line 35) * fl_popup_entry_set_enter_callback(): Other Popup Routines. (line 35) * fl_popup_entry_set_font(): Popup Attributes. (line 29) * fl_popup_entry_set_group(): Popup Attributes. (line 139) * fl_popup_entry_set_leave_callback(): Other Popup Routines. (line 35) * fl_popup_entry_set_shortcut(): Popup Attributes. (line 118) * fl_popup_entry_set_state(): Other Popup Routines. (line 60) * fl_popup_entry_set_subpopup(): Popup Attributes. (line 152) * fl_popup_entry_set_text(): Popup Attributes. (line 112) * fl_popup_entry_set_user_data(): Popup Attributes. (line 128) * fl_popup_entry_set_value(): Popup Attributes. (line 123) * fl_popup_get_bw(): Popup Attributes. (line 52) * fl_popup_get_color(): Popup Attributes. (line 75) * fl_popup_get_min_width(): Popup Attributes. (line 42) * fl_popup_get_policy(): Popup Interaction. (line 81) * fl_popup_get_size(): Other Popup Routines. (line 18) * fl_popup_get_title(): Popup Attributes. (line 6) * fl_popup_get_title_font(): Popup Attributes. (line 17) * fl_popup_insert_items(): Adding Popups. (line 553) * fl_popup_raise_clear_state(): Other Popup Routines. (line 77) * fl_popup_set_bw(): Popup Attributes. (line 52) * fl_popup_set_callback(): Other Popup Routines. (line 28) * fl_popup_set_color(): Popup Attributes. (line 75) * fl_popup_set_cursor(): Popup Attributes. (line 63) * fl_popup_set_min_width(): Popup Attributes. (line 42) * fl_popup_set_policy(): Popup Interaction. (line 66) * fl_popup_set_position(): Other Popup Routines. (line 8) * fl_popup_set_title(): Popup Attributes. (line 6) * fl_popup_set_title_f(): Popup Attributes. (line 6) * fl_popup_set_title_font(): Popup Attributes. (line 17) * fl_popup_toggle_clear_state(): Other Popup Routines. (line 77) * fl_prepare_form_window() <1>: Doing Interaction. (line 134) * fl_prepare_form_window(): Displaying a Form. (line 174) * fl_prepare_form_window_f(): Doing Interaction. (line 134) * fl_print_xevent_name(): Dealing With Multiple Windows. (line 170) * fl_raise_form(): Doing Interaction. (line 153) * fl_read_bitmapfile(): Other Bitmap Routines. (line 16) * fl_read_pixmapfile(): Pixmap Remarks. (line 7) * fl_realloc(): The Routine fl_add_NEW(). (line 35) * fl_rect(): Drawing Functions. (line 23) * fl_rectbound(): Drawing Functions. (line 32) * fl_rectf(): Drawing Functions. (line 23) * fl_redraw_form() <1>: Doing Interaction. (line 292) * fl_redraw_form(): Redrawing. (line 16) * fl_redraw_object() <1>: Doing Interaction. (line 285) * fl_redraw_object(): Redrawing. (line 13) * fl_refresh_fselector(): File Selector. (line 138) * fl_register_raw_callback(): Form Events. (line 13) * fl_remove_canvas_handler(): Canvas Interaction. (line 68) * fl_remove_event_callback() <1>: Doing Interaction. (line 308) * fl_remove_event_callback(): Using Callback Functions. (line 149) * fl_remove_fselector_appbutton(): File Selector. (line 134) * fl_remove_io_callback(): Handling Other Input Sources. (line 38) * fl_remove_selected_xevent(): Using Callback Functions. (line 132) * fl_remove_signal_callback(): Signals. (line 44) * fl_remove_timeout() <1>: Idle Callbacks and Timeouts. (line 50) * fl_remove_timeout(): Periodic Events and Non-blocking Interaction. (line 59) * fl_replace_browser_line(): Other Browser Routines. (line 65) * fl_replace_browser_line_f(): Other Browser Routines. (line 65) * fl_replace_chart_value(): Other Chart Routines. (line 38) * fl_replace_choice(): Other Choice Routines. (line 34) * fl_replace_choice_f(): Other Choice Routines. (line 34) * fl_replace_formbrowser(): Other FormBrowser Routines. (line 48) * fl_replace_menu_item(): Other Menu Routines. (line 50) * fl_replace_nmenu_item(): Other Nmenu Routines. (line 37) * fl_replace_nmenu_items2(): Other Nmenu Routines. (line 59) * fl_replace_select_item(): Other Select Routines. (line 53) * fl_replace_xyplot_point(): Other XYPlot Routines. (line 153) * fl_request_clipboard(): Clipboard. (line 45) * fl_reset_cursor(): Cursors. (line 29) * fl_reset_focus_object(): Object Attributes. (line 208) * fl_reset_positioner: Other Positioner Routines. (line 11) * fl_reset_winconstraints(): Windowing Support. (line 149) * fl_resume_timer(): Other Timer Routines. (line 24) * fl_ringbell(): Misc. Functions. (line 7) * fl_roundrect(): Drawing Functions. (line 37) * fl_roundrectf(): Drawing Functions. (line 37) * fl_scale_form() <1>: Doing Interaction. (line 161) * fl_scale_form(): Displaying a Form. (line 186) * fl_select_browser_line(): Other Browser Routines. (line 109) * fl_set_app_mainform() <1>: Doing Interaction. (line 109) * fl_set_app_mainform(): Displaying a Form. (line 167) * fl_set_app_nomainform(): Doing Interaction. (line 123) * fl_set_atclose(): Displaying a Form. (line 320) * fl_set_background(): Color Handling. (line 25) * fl_set_bitmap_data(): Other Bitmap Routines. (line 6) * fl_set_bitmap_file(): Other Bitmap Routines. (line 6) * fl_set_bitmapbutton_data(): Other Button Routines. (line 85) * fl_set_bitmapbutton_file(): Other Button Routines. (line 85) * fl_set_border_width() <1>: Initialization. (line 186) * fl_set_border_width(): Bounding Boxes. (line 48) * fl_set_browser_bottomline(): Other Browser Routines. (line 164) * fl_set_browser_dblclick_callback(): Other Browser Routines. (line 156) * fl_set_browser_fontsize(): Browser Attributes. (line 13) * fl_set_browser_fontstyle(): Browser Attributes. (line 16) * fl_set_browser_hscroll_callback(): Browser Attributes. (line 130) * fl_set_browser_hscrollbar(): Browser Attributes. (line 108) * fl_set_browser_rel_xoffset(): Other Browser Routines. (line 171) * fl_set_browser_rel_yoffset(): Other Browser Routines. (line 171) * fl_set_browser_scrollbar_repeat(): Browser Attributes. (line 187) * fl_set_browser_scrollbarsize(): Browser Attributes. (line 162) * fl_set_browser_specialkey(): Browser Attributes. (line 101) * fl_set_browser_topline(): Other Browser Routines. (line 164) * fl_set_browser_vscroll_callback(): Browser Attributes. (line 130) * fl_set_browser_vscrollbar(): Browser Attributes. (line 108) * fl_set_browser_xoffset(): Other Browser Routines. (line 171) * fl_set_browser_yoffset(): Other Browser Routines. (line 171) * fl_set_button() <1>: Other Button Routines. (line 7) * fl_set_button(): Buttons. (line 59) * fl_set_button_mouse_buttons(): Other Button Routines. (line 38) * fl_set_button_shortcut(): Other Button Routines. (line 54) * fl_set_canvas_attributes(): Other Canvas Routines. (line 9) * fl_set_canvas_colormap(): Other Canvas Routines. (line 16) * fl_set_canvas_depth(): Other Canvas Routines. (line 16) * fl_set_canvas_visual(): Other Canvas Routines. (line 16) * fl_set_chart_autosize(): Other Chart Routines. (line 55) * fl_set_chart_baseline(): Chart Attributes. (line 9) * fl_set_chart_bounds(): Other Chart Routines. (line 48) * fl_set_chart_lcolor(): Other Chart Routines. (line 22) * fl_set_chart_lsize(): Other Chart Routines. (line 22) * fl_set_chart_lstyle(): Other Chart Routines. (line 22) * fl_set_chart_maxnumb(): Other Chart Routines. (line 59) * fl_set_choice(): Other Choice Routines. (line 76) * fl_set_choice_align(): Choice Attributes. (line 13) * fl_set_choice_align_bottom(): Choice Attributes. (line 32) * fl_set_choice_entries(): Other Choice Routines. (line 66) * fl_set_choice_fontsize(): Choice Attributes. (line 16) * fl_set_choice_fontstyle(): Choice Attributes. (line 19) * fl_set_choice_item_mode(): Other Choice Routines. (line 57) * fl_set_choice_text(): Other Choice Routines. (line 76) * fl_set_choice_text_f(): Other Choice Routines. (line 76) * fl_set_choices_shortcut(): Messages and Questions. (line 131) * fl_set_clipping(): Clipping. (line 6) * fl_set_clock_adjustment(): Other Clock Routines. (line 13) * fl_set_clock_ampm(): Other Clock Routines. (line 20) * fl_set_color_leak(): Color. (line 139) * fl_set_command_log_position(): Command Log. (line 79) * fl_set_coordunit(): Initialization. (line 164) * fl_set_counter_bounds(): Other Counter Routines. (line 7) * fl_set_counter_filter(): Other Counter Routines. (line 39) * fl_set_counter_min_repeat(): Other Counter Routines. (line 60) * fl_set_counter_precision(): Other Counter Routines. (line 31) * fl_set_counter_repeat(): Other Counter Routines. (line 58) * fl_set_counter_speedjump(): Other Counter Routines. (line 75) * fl_set_counter_step(): Other Counter Routines. (line 7) * fl_set_counter_value(): Other Counter Routines. (line 7) * fl_set_cursor(): Cursors. (line 6) * fl_set_cursor_color(): Cursors. (line 32) * fl_set_default_tabfolder_corner(): Folder Remarks. (line 9) * fl_set_defaults(): Initialization. (line 105) * fl_set_dial_angles(): Other Dial Routines. (line 18) * fl_set_dial_bounds(): Other Dial Routines. (line 6) * fl_set_dial_crossover(): Other Dial Routines. (line 29) * fl_set_dial_direction(): Other Dial Routines. (line 43) * fl_set_dial_step(): Other Dial Routines. (line 34) * fl_set_dial_value(): Other Dial Routines. (line 6) * fl_set_directory(): File Selector. (line 118) * fl_set_dirlist_filter(): File Selector. (line 272) * fl_set_dirlist_filterdir(): File Selector. (line 278) * fl_set_dirlist_sort(): File Selector. (line 285) * fl_set_error_handler(): Initialization. (line 284) * fl_set_error_logfp(): Initialization. (line 295) * fl_set_event_callback() <1>: Doing Interaction. (line 302) * fl_set_event_callback(): Using Callback Functions. (line 82) * fl_set_focus_object() <1>: Object Attributes. (line 200) * fl_set_focus_object(): Input Fields. (line 37) * fl_set_folder(): Other Folder Routines. (line 87) * fl_set_folder_byname(): Other Folder Routines. (line 87) * fl_set_folder_byname_f(): Other Folder Routines. (line 87) * fl_set_folder_bynumber(): Other Folder Routines. (line 87) * fl_set_font_name() <1>: Initialization. (line 310) * fl_set_font_name(): Label Attributes and Fonts. (line 76) * fl_set_font_name_f() <1>: Initialization. (line 310) * fl_set_font_name_f(): Label Attributes and Fonts. (line 76) * fl_set_foreground(): Color Handling. (line 25) * fl_set_form_atactivate() <1>: Doing Interaction. (line 263) * fl_set_form_atactivate(): Dealing With Multiple Windows. (line 32) * fl_set_form_atclose(): Displaying a Form. (line 329) * fl_set_form_atdeactivate() <1>: Doing Interaction. (line 263) * fl_set_form_atdeactivate(): Dealing With Multiple Windows. (line 32) * fl_set_form_background_color(): Creating Forms. (line 26) * fl_set_form_callback() <1>: Object Attributes. (line 227) * fl_set_form_callback(): Using Callback Functions. (line 62) * fl_set_form_dblbuffer(): Initialization. (line 271) * fl_set_form_geometry() <1>: Doing Interaction. (line 161) * fl_set_form_geometry(): Displaying a Form. (line 101) * fl_set_form_hotobject(): Displaying a Form. (line 121) * fl_set_form_hotspot(): Displaying a Form. (line 121) * fl_set_form_icon() <1>: Doing Interaction. (line 201) * fl_set_form_icon(): Displaying a Form. (line 286) * fl_set_form_maxsize(): Doing Interaction. (line 191) * fl_set_form_minsize(): Doing Interaction. (line 191) * fl_set_form_position() <1>: Doing Interaction. (line 161) * fl_set_form_position(): Displaying a Form. (line 97) * fl_set_form_size() <1>: Doing Interaction. (line 161) * fl_set_form_size(): Displaying a Form. (line 99) * fl_set_form_title() <1>: Doing Interaction. (line 209) * fl_set_form_title(): Displaying a Form. (line 281) * fl_set_form_title_f() <1>: Doing Interaction. (line 209) * fl_set_form_title_f(): Displaying a Form. (line 281) * fl_set_formbrowser_hscrollbar(): Other FormBrowser Routines. (line 75) * fl_set_formbrowser_scroll(): Other FormBrowser Routines. (line 90) * fl_set_formbrowser_topform(): Other FormBrowser Routines. (line 104) * fl_set_formbrowser_topform_bynumber(): Other FormBrowser Routines. (line 104) * fl_set_formbrowser_vscrollbar(): Other FormBrowser Routines. (line 75) * fl_set_formbrowser_xoffset(): Other FormBrowser Routines. (line 119) * fl_set_formbrowser_yoffset(): Other FormBrowser Routines. (line 119) * fl_set_fselector_border(): File Selector. (line 101) * fl_set_fselector_callback(): File Selector. (line 83) * fl_set_fselector_filetype_marker(): File Selector. (line 183) * fl_set_fselector_fontsize(): File Selector. (line 47) * fl_set_fselector_fontstyle(): File Selector. (line 47) * fl_set_fselector_placement(): File Selector. (line 95) * fl_set_fselector_title(): File Selector. (line 55) * fl_set_gc_clipping(): Clipping. (line 57) * fl_set_glcanvas_attributes(): OpenGL Canvas. (line 30) * fl_set_glcanvas_defaults(): OpenGL Canvas. (line 22) * fl_set_glcanvas_direct(): OpenGL Canvas. (line 46) * fl_set_goodies_font(): Messages and Questions. (line 155) * fl_set_icm_color() <1>: Initialization. (line 395) * fl_set_icm_color(): Color. (line 76) * fl_set_idle_callback() <1>: Idle Callbacks and Timeouts. (line 10) * fl_set_idle_callback(): Periodic Events and Non-blocking Interaction. (line 22) * fl_set_idle_delta(): Idle Callbacks and Timeouts. (line 23) * fl_set_input() <1>: Other Input Routines. (line 7) * fl_set_input(): Input Fields. (line 45) * fl_set_input_color() <1>: Input Attributes. (line 12) * fl_set_input_color(): Input Fields. (line 49) * fl_set_input_cursor_visible(): Other Input Routines. (line 123) * fl_set_input_cursorpos(): Other Input Routines. (line 76) * fl_set_input_editkeymap(): Input Attributes. (line 72) * fl_set_input_f() <1>: Other Input Routines. (line 7) * fl_set_input_f(): Input Fields. (line 45) * fl_set_input_fieldchar(): Other Input Routines. (line 137) * fl_set_input_filter(): Input Interaction. (line 171) * fl_set_input_format(): Input Interaction. (line 201) * fl_set_input_hscrollbar(): Other Input Routines. (line 87) * fl_set_input_maxchars(): Input Interaction. (line 162) * fl_set_input_mode(): Input Interaction. (line 239) * fl_set_input_scroll(): Other Input Routines. (line 105) * fl_set_input_scrollbarsize(): Input Attributes. (line 22) * fl_set_input_selected(): Other Input Routines. (line 37) * fl_set_input_selected_range(): Other Input Routines. (line 37) * fl_set_input_topline(): Other Input Routines. (line 110) * fl_set_input_vscrollbar(): Other Input Routines. (line 87) * fl_set_input_xoffset(): Other Input Routines. (line 113) * fl_set_menu(): Other Menu Routines. (line 12) * fl_set_menu_entries(): Other Menu Routines. (line 73) * fl_set_menu_item_callback(): Other Menu Routines. (line 167) * fl_set_menu_item_mode(): Other Menu Routines. (line 133) * fl_set_menu_item_shortcut(): Other Menu Routines. (line 178) * fl_set_menu_notitle(): Menu Attributes. (line 40) * fl_set_menu_popup(): Menu Attributes. (line 22) * fl_set_mouse(): Mouse Handling. (line 27) * fl_set_nmenu_hl_text_color(): Nmenu Attributes. (line 12) * fl_set_nmenu_items(): Adding Nmenu Objects. (line 50) * fl_set_nmenu_policy(): Nmenu Interaction. (line 55) * fl_set_nmenu_popup(): Adding Nmenu Objects. (line 130) * fl_set_object_automatic(): Object Attributes. (line 170) * fl_set_object_boxtype() <1>: Object Attributes. (line 25) * fl_set_object_boxtype(): Bounding Boxes. (line 10) * fl_set_object_bw() <1>: Object Attributes. (line 36) * fl_set_object_bw(): Bounding Boxes. (line 23) * fl_set_object_callback() <1>: Object Attributes. (line 215) * fl_set_object_callback(): Using Callback Functions. (line 17) * fl_set_object_color() <1>: Object Attributes. (line 19) * fl_set_object_color(): Color. (line 6) * fl_set_object_dblbuffer(): Initialization. (line 271) * fl_set_object_dblclick(): Object Attributes. (line 177) * fl_set_object_geometry(): Object Attributes. (line 60) * fl_set_object_gravity() <1>: Object Attributes. (line 140) * fl_set_object_gravity(): Displaying a Form. (line 196) * fl_set_object_helper() <1>: Object Attributes. (line 117) * fl_set_object_helper(): Tool Tips. (line 13) * fl_set_object_helper_f() <1>: Object Attributes. (line 117) * fl_set_object_helper_f(): Tool Tips. (line 13) * fl_set_object_label() <1>: Object Attributes. (line 101) * fl_set_object_label(): Label Attributes and Fonts. (line 190) * fl_set_object_label_f() <1>: Object Attributes. (line 101) * fl_set_object_label_f(): Label Attributes and Fonts. (line 190) * fl_set_object_lalign() <1>: Object Attributes. (line 101) * fl_set_object_lalign(): Label Attributes and Fonts. (line 136) * fl_set_object_lcolor() <1>: Object Attributes. (line 101) * fl_set_object_lcolor(): Label Attributes and Fonts. (line 7) * fl_set_object_lsize() <1>: Object Attributes. (line 101) * fl_set_object_lsize(): Label Attributes and Fonts. (line 10) * fl_set_object_lstyle() <1>: Object Attributes. (line 101) * fl_set_object_lstyle(): Label Attributes and Fonts. (line 28) * fl_set_object_position(): Object Attributes. (line 42) * fl_set_object_posthandler() <1>: Object Events. (line 42) * fl_set_object_posthandler(): Part IV Using a Pre-emptive Handler. (line 26) * fl_set_object_prehandler() <1>: Object Events. (line 20) * fl_set_object_prehandler(): Part IV Using a Pre-emptive Handler. (line 26) * fl_set_object_resize() <1>: Object Attributes. (line 140) * fl_set_object_resize(): Displaying a Form. (line 196) * fl_set_object_return(): Simple Interaction. (line 89) * fl_set_object_shortcut(): Shortcuts. (line 11) * fl_set_object_shortcutkey(): Shortcuts. (line 45) * fl_set_object_size(): Object Attributes. (line 53) * fl_set_oneliner_color(): Messages and Questions. (line 47) * fl_set_oneliner_font(): Messages and Questions. (line 50) * fl_set_pattern(): File Selector. (line 118) * fl_set_pixmap_align(): Other Pixmap Routines. (line 46) * fl_set_pixmap_colorcloseness(): Pixmap Attributes. (line 12) * fl_set_pixmap_data(): Other Pixmap Routines. (line 11) * fl_set_pixmap_file(): Other Pixmap Routines. (line 11) * fl_set_pixmap_pixmap(): Other Pixmap Routines. (line 33) * fl_set_pixmapbutton_align(): Other Button Routines. (line 113) * fl_set_pixmapbutton_data(): Other Button Routines. (line 91) * fl_set_pixmapbutton_file(): Other Button Routines. (line 91) * fl_set_pixmapbutton_focus_data(): Other Button Routines. (line 124) * fl_set_pixmapbutton_focus_file(): Other Button Routines. (line 124) * fl_set_pixmapbutton_focus_outline(): Other Button Routines. (line 135) * fl_set_pixmapbutton_focus_pixmap(): Other Button Routines. (line 124) * fl_set_pixmapbutton_pixmap(): Other Button Routines. (line 91) * fl_set_positioner_mouse_buttons(): Positioner Interaction. (line 36) * fl_set_positioner_validator(): Other Positioner Routines. (line 33) * fl_set_positioner_values(): Other Positioner Routines. (line 63) * fl_set_positioner_xbounds(): Other Positioner Routines. (line 18) * fl_set_positioner_xstep(): Other Positioner Routines. (line 81) * fl_set_positioner_xvalue(): Other Positioner Routines. (line 63) * fl_set_positioner_ybounds(): Other Positioner Routines. (line 18) * fl_set_positioner_ystep(): Other Positioner Routines. (line 81) * fl_set_positioner_yvalue(): Other Positioner Routines. (line 63) * fl_set_resource() <1>: Resources Example. (line 54) * fl_set_resource(): Messages and Questions. (line 183) * fl_set_scrollbar_bounds(): Other Scrollbar Routines. (line 7) * fl_set_scrollbar_increment(): Other Scrollbar Routines. (line 28) * fl_set_scrollbar_repeat(): Other Scrollbar Routines. (line 41) * fl_set_scrollbar_size(): Scrollbar Attributes. (line 16) * fl_set_scrollbar_type(): Initialization. (line 202) * fl_set_scrollbar_value(): Other Scrollbar Routines. (line 7) * fl_set_select_item(): Other Select Routines. (line 43) * fl_set_select_items(): Adding Select Objects. (line 109) * fl_set_select_policy(): Select Interaction. (line 72) * fl_set_select_popup(): Adding Select Objects. (line 131) * fl_set_select_text_align(): Select Attributes. (line 17) * fl_set_select_text_color(): Select Attributes. (line 10) * fl_set_select_text_font(): Select Attributes. (line 26) * fl_set_slider_bounds() <1>: Other Slider Routines. (line 6) * fl_set_slider_bounds(): Sliders. (line 17) * fl_set_slider_filter(): Slider Attributes. (line 34) * fl_set_slider_mouse_buttons(): Other Slider Routines. (line 26) * fl_set_slider_precision(): Slider Attributes. (line 25) * fl_set_slider_size(): Slider Attributes. (line 14) * fl_set_slider_value() <1>: Other Slider Routines. (line 6) * fl_set_slider_value(): Sliders. (line 17) * fl_set_spinner_bounds(): Other Spinner Routines. (line 15) * fl_set_spinner_precision(): Other Spinner Routines. (line 34) * fl_set_spinner_step(): Other Spinner Routines. (line 27) * fl_set_spinner_value(): Other Spinner Routines. (line 6) * fl_set_tabfolder_autofit(): Other Folder Routines. (line 112) * fl_set_tabfolder_offset(): Other Folder Routines. (line 50) * fl_set_tabstop(): Initialization. (line 254) * fl_set_text_clipping(): Clipping. (line 49) * fl_set_thumbwheel_bounds(): Other Thumbwheel Routines. (line 7) * fl_set_thumbwheel_crossover(): Other Thumbwheel Routines. (line 21) * fl_set_thumbwheel_step(): Other Thumbwheel Routines. (line 26) * fl_set_thumbwheel_value(): Other Thumbwheel Routines. (line 7) * fl_set_timer(): Other Timer Routines. (line 6) * fl_set_timer_countup(): Other Timer Routines. (line 17) * fl_set_timer_filter(): Other Timer Routines. (line 31) * fl_set_tooltip_boxtype() <1>: Object Attributes. (line 128) * fl_set_tooltip_boxtype(): Tool Tips. (line 24) * fl_set_tooltip_color() <1>: Object Attributes. (line 128) * fl_set_tooltip_color(): Tool Tips. (line 24) * fl_set_tooltip_font() <1>: Object Attributes. (line 128) * fl_set_tooltip_font(): Tool Tips. (line 24) * fl_set_tooltip_lalign(): Tool Tips. (line 24) * fl_set_visualID(): Initialization. (line 72) * fl_set_xyplot_alphaxtics(): Other XYPlot Routines. (line 34) * fl_set_xyplot_alphaytics(): Other XYPlot Routines. (line 34) * fl_set_xyplot_data(): XYPlot Interaction. (line 51) * fl_set_xyplot_data_double(): XYPlot Interaction. (line 51) * fl_set_xyplot_file(): XYPlot Interaction. (line 68) * fl_set_xyplot_fixed_xaxis(): Other XYPlot Routines. (line 83) * fl_set_xyplot_fixed_yaxis(): Other XYPlot Routines. (line 83) * fl_set_xyplot_grid_linestyle(): Other XYPlot Routines. (line 74) * fl_set_xyplot_inspect(): XYPlot Interaction. (line 88) * fl_set_xyplot_interpolate(): Other XYPlot Routines. (line 267) * fl_set_xyplot_key(): Other XYPlot Routines. (line 244) * fl_set_xyplot_key_font(): Other XYPlot Routines. (line 264) * fl_set_xyplot_key_position(): Other XYPlot Routines. (line 248) * fl_set_xyplot_keys(): Other XYPlot Routines. (line 256) * fl_set_xyplot_linewidth(): Other XYPlot Routines. (line 276) * fl_set_xyplot_log_minor_xtics(): Other XYPlot Routines. (line 24) * fl_set_xyplot_log_minor_ytics(): Other XYPlot Routines. (line 24) * fl_set_xyplot_mark_active(): XYPlot Interaction. (line 47) * fl_set_xyplot_maxoverlays(): Other XYPlot Routines. (line 201) * fl_set_xyplot_mouse_buttons(): Other XYPlot Routines. (line 332) * fl_set_xyplot_overlay_type(): Other XYPlot Routines. (line 175) * fl_set_xyplot_symbol(): Other XYPlot Routines. (line 104) * fl_set_xyplot_symbolsize(): Other XYPlot Routines. (line 98) * fl_set_xyplot_xbounds(): Other XYPlot Routines. (line 141) * fl_set_xyplot_xgrid(): Other XYPlot Routines. (line 60) * fl_set_xyplot_xscale(): Other XYPlot Routines. (line 282) * fl_set_xyplot_xtics(): Other XYPlot Routines. (line 8) * fl_set_xyplot_ybounds(): Other XYPlot Routines. (line 141) * fl_set_xyplot_ygrid(): Other XYPlot Routines. (line 60) * fl_set_xyplot_yscale(): Other XYPlot Routines. (line 282) * fl_set_xyplot_ytics(): Other XYPlot Routines. (line 8) * fl_setpup_align_bottom(): Other XPopup Routines. (line 44) * fl_setpup_bw(): XPopup Attributes. (line 45) * fl_setpup_cursor(): XPopup Attributes. (line 30) * fl_setpup_default_bw();: XPopup Attributes. (line 15) * fl_setpup_default_checkcolor(): XPopup Attributes. (line 61) * fl_setpup_default_color(): XPopup Attributes. (line 54) * fl_setpup_default_cursor(): XPopup Attributes. (line 23) * fl_setpup_default_fontsize() <1>: XPopup Attributes. (line 15) * fl_setpup_default_fontsize(): Menu Attributes. (line 16) * fl_setpup_default_fontstyle() <1>: XPopup Attributes. (line 15) * fl_setpup_default_fontstyle(): Menu Attributes. (line 16) * fl_setpup_entercb(): XPopup Interaction. (line 63) * fl_setpup_entries(): Creating XPopups. (line 217) * fl_setpup_itemcb(): XPopup Interaction. (line 40) * fl_setpup_leavecb(): XPopup Interaction. (line 63) * fl_setpup_maxpups(): XPopup Attributes. (line 65) * fl_setpup_menucb(): XPopup Interaction. (line 40) * fl_setpup_mode(): Other XPopup Routines. (line 10) * fl_setpup_position(): Other XPopup Routines. (line 31) * fl_setpup_selection(): Other XPopup Routines. (line 53) * fl_setpup_shadow(): XPopup Attributes. (line 39) * fl_setpup_shortcut(): XPopup Interaction. (line 21) * fl_setpup_softedge(): XPopup Attributes. (line 45) * fl_setpup_submenu(): XPopup Interaction. (line 78) * fl_setpup_title(): XPopup Attributes. (line 6) * fl_setpup_title_f(): XPopup Attributes. (line 6) * fl_share_canvas_colormap(): Other Canvas Routines. (line 35) * fl_show_alert(): Messages and Questions. (line 52) * fl_show_alert_f(): Messages and Questions. (line 61) * fl_show_browser_line(): Other Browser Routines. (line 150) * fl_show_choice(): Messages and Questions. (line 131) * fl_show_choices(): Messages and Questions. (line 131) * fl_show_color_chooser(): Color Chooser. (line 13) * fl_show_colormap(): Colormap. (line 11) * fl_show_command_log(): Command Log. (line 71) * fl_show_errors(): Initialization. (line 305) * fl_show_form() <1>: Doing Interaction. (line 6) * fl_show_form(): Displaying a Form. (line 9) * fl_show_form_f(): Doing Interaction. (line 6) * fl_show_form_window() <1>: Doing Interaction. (line 146) * fl_show_form_window(): Displaying a Form. (line 179) * fl_show_fselector(): File Selector. (line 8) * fl_show_input(): Messages and Questions. (line 158) * fl_show_menu_symbol(): Other Menu Routines. (line 186) * fl_show_message(): Messages and Questions. (line 7) * fl_show_messages(): Messages and Questions. (line 13) * fl_show_messages_f(): Messages and Questions. (line 18) * fl_show_object() <1>: Object Attributes. (line 186) * fl_show_object(): Hiding and Showing. (line 12) * fl_show_oneliner(): Messages and Questions. (line 37) * fl_show_question(): Messages and Questions. (line 93) * fl_show_simple_input(): Messages and Questions. (line 177) * fl_showpup(): XPopup Attributes. (line 70) * fl_signal_caught(): Signals. (line 72) * fl_strdup(): The Routine fl_add_NEW(). (line 45) * fl_stuff_clipboard(): Clipboard. (line 26) * fl_suspend_timer(): Other Timer Routines. (line 22) * fl_to_inside_lalign(): Label Attributes and Fonts. (line 151) * fl_to_outside_lalign(): Label Attributes and Fonts. (line 159) * fl_transient(): Windowing Support. (line 132) * fl_trigger_object() <1>: Object Attributes. (line 196) * fl_trigger_object(): Deactivating and Triggering Objects. (line 25) * fl_unfreeze_all_forms(): Object Attributes. (line 160) * fl_unfreeze_form() <1>: Object Attributes. (line 152) * fl_unfreeze_form(): Changing Many Attributes. (line 21) * fl_unset_clipping(): Clipping. (line 38) * fl_unset_gc_clipping(): Clipping. (line 57) * fl_unset_text_clipping(): Clipping. (line 49) * fl_update_display(): Displaying a Form. (line 21) * fl_use_fselector(): File Selector. (line 42) * fl_validate_input(): Input Interaction. (line 217) * fl_whoami(): Misc. Functions. (line 15) * fl_win_to_form(): General Remarks. (line 90) * fl_winaspect(): Windowing Support. (line 110) * fl_winbackground(): Windowing Support. (line 137) * fl_winclose(): Windowing Support. (line 188) * fl_wincreate(): Windowing Support. (line 11) * fl_winfocus(): Windowing Support. (line 204) * fl_wingeometry(): Windowing Support. (line 101) * fl_winget(): Drawing Functions. (line 10) * fl_winhide(): Windowing Support. (line 183) * fl_winicon(): Windowing Support. (line 127) * fl_winicontitle(): Windowing Support. (line 123) * fl_winicontitle_f(): Windowing Support. (line 123) * fl_winisvalid(): Windowing Support. (line 196) * fl_winmaxsize(): Windowing Support. (line 81) * fl_winminsize(): Windowing Support. (line 81) * fl_winmove(): Windowing Support. (line 169) * fl_winopen(): Windowing Support. (line 26) * fl_winposition(): Windowing Support. (line 95) * fl_winreparent(): Windowing Support. (line 52) * fl_winreshape(): Windowing Support. (line 172) * fl_winresize(): Windowing Support. (line 162) * fl_winset(): Drawing Functions. (line 10) * fl_winshow(): Windowing Support. (line 11) * fl_winsize(): Windowing Support. (line 60) * fl_winstepsize(): Windowing Support. (line 141) * fl_wintitle(): Windowing Support. (line 115) * fl_wintitle_f(): Windowing Support. (line 115) * fl_XEventsQueued(): Dealing With Multiple Windows. (line 66) * fl_XNextEvent(): Dealing With Multiple Windows. (line 66) * fl_XPeekEvent(): Dealing With Multiple Windows. (line 66) * fl_XPutbackEvent(): Dealing With Multiple Windows. (line 66) * fl_xyplot_s2w(): Other XYPlot Routines. (line 308) * fl_xyplot_w2s(): Other XYPlot Routines. (line 308) * flimage_add_format(): Adding New Formats. (line 12) * flimage_add_marker(): Using Markers. (line 9) * flimage_add_marker_struct(): Using Markers. (line 9) * flimage_add_text(): Using Text Strings. (line 6) * flimage_add_text_struct(): Using Text Strings. (line 33) * flimage_alloc(): Creating Images. (line 14) * flimage_autocrop(): Cropping. (line 6) * flimage_close(): Setup and Configuration. (line 144) * flimage_convert(): Supported image types. (line 61) * flimage_convolve(): Convolution. (line 6) * flimage_convolvea(): Convolution. (line 16) * flimage_crop(): Cropping. (line 6) * flimage_define_marker(): Using Markers. (line 66) * flimage_delete_all_markers(): Using Markers. (line 61) * flimage_delete_all_text(): Using Text Strings. (line 70) * flimage_description_via_filter(): Adding New Formats. (line 169) * flimage_display(): The Basic Image Support API. (line 68) * flimage_dump(): The Basic Image Support API. (line 31) * flimage_dup(): Memory Allocation. (line 48) * flimage_enable_bmp(): Built-in support. (line 33) * flimage_enable_fits(): Built-in support. (line 33) * flimage_enable_genesis(): Built-in support. (line 33) * flimage_enable_gif(): Built-in support. (line 33) * flimage_enable_gzip(): Built-in support. (line 33) * flimage_enable_jpeg(): Built-in support. (line 33) * flimage_enable_png(): Built-in support. (line 33) * flimage_enable_pnm(): Built-in support. (line 33) * flimage_enable_ps(): Built-in support. (line 33) * flimage_enable_sgi(): Built-in support. (line 33) * flimage_enable_tiff(): Built-in support. (line 33) * flimage_enable_xbm(): Built-in support. (line 33) * flimage_enable_xpm(): Built-in support. (line 33) * flimage_enable_xwd(): Built-in support. (line 33) * flimage_error(): Setup and Configuration. (line 84) * flimage_flip(): Image Flipping. (line 12) * flimage_free(): The Basic Image Support API. (line 62) * flimage_from_pixmap(): Memory Allocation. (line 54) * flimage_get_autocrop(): Cropping. (line 35) * flimage_get_format_info(): Queries. (line 14) * flimage_get_number_of_formats(): Queries. (line 10) * flimage_getmem(): Creating Images. (line 35) * flimage_gif_output_options(): Built-in support. (line 65) * flimage_is_supported(): The Basic Image Support API. (line 148) * flimage_jpeg_output_options(): Built-in support. (line 48) * flimage_load(): The Basic Image Support API. (line 31) * flimage_open(): Setup and Configuration. (line 132) * flimage_pnm_output_options(): Built-in support. (line 59) * flimage_ps_options(): Built-in support. (line 70) * flimage_read(): Setup and Configuration. (line 137) * flimage_render_annotation(): Pixelizing the Annotation. (line 16) * flimage_rotate(): Rotation. (line 6) * flimage_scale(): Scaling. (line 14) * flimage_sdisplay(): The Basic Image Support API. (line 68) * flimage_select_mediancut_quantizer(): Color Quantization. (line 29) * flimage_select_octree_quantizer(): Color Quantization. (line 26) * flimage_setup(): Setup and Configuration. (line 17) * flimage_tint(): Tint. (line 8) * flimage_to_pixmap(): Memory Allocation. (line 54) * flimage_transform_pixels(): General Pixel Transformation. (line 9) * flimage_type_name(): Supported image types. (line 57) * flimage_warp(): Warping. (line 49) * flimage_windowlevel(): Supported image types. (line 49) * flimage_write_via_filter(): Adding New Formats. (line 169) * flps_init(): Object Attributes. (line 284)  File: xforms.info, Node: Index of Global Variables, Next: Index of Constants, Prev: Index of Functions, Up: Top Index of Global Variables ************************* [index] * Menu: * fl_colormap: Global Variables and Macros. (line 72) * fl_current_form: Global Variables and Macros. (line 17) * fl_display: Global Variables and Macros. (line 20) * fl_dpi: Global Variables and Macros. (line 59) * FL_EVENT: Global Variables and Macros. (line 9) * fl_root: Global Variables and Macros. (line 33) * fl_screen: Global Variables and Macros. (line 29) * fl_scrh: Global Variables and Macros. (line 41) * fl_scrw: Global Variables and Macros. (line 41) * fl_state: Global Variables and Macros. (line 53) * fl_ul_magic_char: Global Variables and Macros. (line 78) * fl_visual: Global Variables and Macros. (line 66) * fl_vmode: Global Variables and Macros. (line 44) * fl_vroot: Global Variables and Macros. (line 36)  File: xforms.info, Node: Index of Constants, Prev: Index of Global Variables, Up: Top Index of Constants ****************** [index] * Menu: * FD_FSELECTOR: File Selector. (line 150) * FL DASH: Drawing Functions. (line 160) * FL DOT: Drawing Functions. (line 157) * FL DOTDASH: Drawing Functions. (line 163) * FL LONGDASH: Drawing Functions. (line 166) * FL PUP NONE: Creating XPopups. (line 256) * FL SOLID: Drawing Functions. (line 156) * FL USERDASH: Drawing Functions. (line 169) * FL USERDOUBLEDASH: Drawing Functions. (line 174) * FL_ACTIVE_XYPLOT: XYPlot Types. (line 33) * FL_ALIGN_BOTTOM: Label Attributes and Fonts. (line 141) * FL_ALIGN_CENTER: Label Attributes and Fonts. (line 142) * FL_ALIGN_INSIDE: Label Attributes and Fonts. (line 156) * FL_ALIGN_LEFT: Label Attributes and Fonts. (line 139) * FL_ALIGN_LEFT_BOTTOM: Label Attributes and Fonts. (line 144) * FL_ALIGN_LEFT_TOP: Label Attributes and Fonts. (line 146) * FL_ALIGN_RIGHT: Label Attributes and Fonts. (line 139) * FL_ALIGN_RIGHT_BOTTOM: Label Attributes and Fonts. (line 143) * FL_ALIGN_RIGHT_TOP: Label Attributes and Fonts. (line 145) * FL_ALIGN_TOP: Label Attributes and Fonts. (line 140) * FL_ALL_FREE: Free Object. (line 162) * FL_ALPHASORT: File Selector. (line 289) * FL_ALT_MASK: Input Attributes. (line 96) * FL_ANALOG_CLOCK: Clock Types. (line 7) * FL_APPEVENT_CB <1>: Idle Callbacks and Timeouts. (line 10) * FL_APPEVENT_CB <2>: Doing Interaction. (line 302) * FL_APPEVENT_CB <3>: Using Callback Functions. (line 82) * FL_APPEVENT_CB: Periodic Events and Non-blocking Interaction. (line 28) * FL_ATTRIB: Part IV Events. (line 167) * FL_AUTO <1>: Other FormBrowser Routines. (line 83) * FL_AUTO <2>: Browser Attributes. (line 116) * FL_AUTO: Other Input Routines. (line 91) * FL_BAR_CHART: Chart Types. (line 7) * FL_BEGIN_GROUP <1>: Creating Forms. (line 42) * FL_BEGIN_GROUP: The Routine fl_add_NEW(). (line 33) * FL_BEING_HIDDEN: Displaying a Form. (line 307) * FL_BITMAPBUTTON: Adding Button Objects. (line 58) * FL_BLACK: Color. (line 36) * FL_BLUE: Color. (line 49) * FL_BOLD_STYLE: Label Attributes and Fonts. (line 33) * FL_BOLDITALIC_STYLE: Label Attributes and Fonts. (line 35) * FL_BOOL: Current Support. (line 43) * FL_BORDER_BOX <1>: Box Types. (line 16) * FL_BORDER_BOX: Boxes. (line 22) * FL_BORDER_FRAME <1>: LabelFrame Types. (line 14) * FL_BORDER_FRAME: Frame Types. (line 14) * FL_BOTTOM_BCOL: Color. (line 40) * FL_BOTTOM_TABFOLDER: Folder Types. (line 10) * FL_BROWSER_SCROLL_CALLBACK: Browser Attributes. (line 130) * FL_BUTTON: Adding Button Objects. (line 37) * FL_BUTTON_NMENU: Adding Nmenu Objects. (line 19) * FL_BUTTON_STRUCT: Part IV New Buttons. (line 33) * FL_BUTTON_TOUCH_NMENU: Adding Nmenu Objects. (line 24) * FL_CALLBACKPTR: Using Callback Functions. (line 17) * FL_CASEALPHASORT: File Selector. (line 308) * FL_CHART_MAX: Other Chart Routines. (line 59) * FL_CHARTREUSE: Color. (line 65) * FL_CHECKBUTTON: Adding Button Objects. (line 53) * FL_CIRCLE_XYPLOT: XYPlot Types. (line 11) * FL_CLICK_TIMEOUT: Part IV Events. (line 111) * FL_CMD_OPT: Current Support. (line 16) * FL_COL1: Color. (line 39) * FL_CONTINUOUS_FREE: Free Object. (line 157) * FL_CONTROL_MASK: Input Attributes. (line 95) * FL_COORD_centiMM: Initialization. (line 167) * FL_COORD_centiPOINT: Initialization. (line 167) * FL_COORD_MM: Initialization. (line 167) * FL_COORD_PIXEL: Initialization. (line 167) * FL_COORD_POINT: Initialization. (line 167) * FL_CYAN: Color. (line 53) * FL_DARKCYAN: Color. (line 60) * FL_DARKER_COL1: Color. (line 45) * FL_DARKGOLD: Color. (line 58) * FL_DARKORANGE: Color. (line 63) * FL_DARKTOMATO: Color. (line 61) * FL_DARKVIOLET: Color. (line 66) * FL_DASHED_XYPLOT: XYPlot Types. (line 21) * FL_DATE_INPUT: Input Types. (line 20) * FL_DBLCLICK <1>: Part IV Events. (line 109) * FL_DBLCLICK: Free Object. (line 91) * FL_DEEPPINK: Color. (line 64) * FL_DESELECTABLE_HOLD_BROWSER: Browser Types. (line 19) * FL_DIAL_CCW: Other Dial Routines. (line 45) * FL_DIAL_CW: Other Dial Routines. (line 45) * FL_DIGITAL_CLOCK: Clock Types. (line 8) * FL_Dirlist: File Selector. (line 203) * FL_DIRLIST_FILTER: File Selector. (line 272) * FL_DODGERBLUE: Color. (line 68) * FL_DOS_INPUT_MODE: Input Interaction. (line 242) * FL_DOTDASHED_XYPLOT: XYPlot Types. (line 27) * FL_DOTTED_XYPLOT: XYPlot Types. (line 24) * FL_DOWN_BOX <1>: Box Types. (line 10) * FL_DOWN_BOX: Boxes. (line 19) * FL_DOWN_FRAME <1>: LabelFrame Types. (line 11) * FL_DOWN_FRAME: Frame Types. (line 11) * FL_DRAW <1>: Part IV Events. (line 13) * FL_DRAW: Free Object. (line 34) * FL_DRAWLABEL <1>: Part IV Events. (line 59) * FL_DRAWLABEL: Free Object. (line 57) * FL_DROPLIST_CHOICE: Choice Types. (line 13) * FL_DROPLIST_SELECT: Adding Select Objects. (line 20) * FL_East: Displaying a Form. (line 229) * FL_EditKeymap: Input Attributes. (line 43) * FL_EMBOSSED_BOX: Boxes. (line 34) * FL_EMBOSSED_FRAME <1>: LabelFrame Types. (line 20) * FL_EMBOSSED_FRAME: Frame Types. (line 20) * FL_EMBOSSED_STYLE: Label Attributes and Fonts. (line 46) * FL_EMPTY_XYPLOT: XYPlot Types. (line 37) * FL_END_GROUP: Creating Forms. (line 44) * FL_ENGRAVED_FRAME <1>: LabelFrame Types. (line 17) * FL_ENGRAVED_FRAME: Frame Types. (line 17) * FL_ENGRAVED_STYLE: Label Attributes and Fonts. (line 45) * FL_ENLARGE_ONLY: Other Folder Routines. (line 119) * FL_ENTER <1>: Part IV Events. (line 65) * FL_ENTER: Free Object. (line 64) * FL_EXCEPT: Handling Other Input Sources. (line 27) * FL_FILL_DIAL: Dial Types. (line 14) * FL_FILL_XYPLOT: XYPlot Types. (line 14) * FL_FILLED_CHART: Chart Types. (line 14) * FL_FIT: Other Folder Routines. (line 116) * FL_FIXED_STYLE: Label Attributes and Fonts. (line 36) * FL_FIXEDBOLD_STYLE: Label Attributes and Fonts. (line 37) * FL_FIXEDBOLDITALIC_STYLE: Label Attributes and Fonts. (line 39) * FL_FIXEDITALIC_STYLE: Label Attributes and Fonts. (line 38) * FL_FLAT_BOX <1>: Box Types. (line 13) * FL_FLAT_BOX: Boxes. (line 37) * FL_FLOAT: Current Support. (line 52) * FL_FLOAT_INPUT: Input Types. (line 10) * FL_FLOAT_SPINNER: Spinner Types. (line 11) * FL_FOCUS <1>: Part IV Events. (line 123) * FL_FOCUS: Free Object. (line 107) * FL_FORM_ATACTIVATE <1>: Doing Interaction. (line 263) * FL_FORM_ATACTIVATE: Dealing With Multiple Windows. (line 32) * FL_FORM_ATDEACTIVATE <1>: Doing Interaction. (line 263) * FL_FORM_ATDEACTIVATE: Dealing With Multiple Windows. (line 32) * FL_FRAME_BOX <1>: Box Types. (line 19) * FL_FRAME_BOX: Boxes. (line 28) * FL_FREE_COL1: Color. (line 69) * FL_FREE_SIZE: Displaying a Form. (line 89) * FL_FREEMEM <1>: Part IV Events. (line 179) * FL_FREEMEM: Free Object. (line 128) * FL_FULLBORDER <1>: Doing Interaction. (line 84) * FL_FULLBORDER: Displaying a Form. (line 132) * FL_GREEN: Color. (line 50) * FL_GRID_MAJOR: Other XYPlot Routines. (line 65) * FL_GRID_MINOR: Other XYPlot Routines. (line 68) * FL_GRID_NONE: Other XYPlot Routines. (line 64) * FL_HANDLE_CANVAS: Canvas Interaction. (line 21) * FL_HANDLEPTR <1>: Object Events. (line 20) * FL_HANDLEPTR <2>: Part IV Using a Pre-emptive Handler. (line 26) * FL_HANDLEPTR: Part IV The Type FL_OBJECT. (line 329) * FL_HIDDEN_BUTTON: Button Types. (line 23) * FL_HIDDEN_INPUT: Input Types. (line 31) * FL_HIDDEN_RET_BUTTON: Button Types. (line 32) * FL_HIDDEN_TIMER: Timer Types. (line 13) * FL_HOLD_BROWSER: Browser Types. (line 15) * FL_HOR_BROWSER_SLIDER: Slider Types. (line 28) * FL_HOR_FILL_SLIDER: Slider Types. (line 16) * FL_HOR_NICE_SCROLLBAR: Scrollbar Types. (line 22) * FL_HOR_NICE_SLIDER: Slider Types. (line 22) * FL_HOR_PLAIN_SCROLLBAR: Scrollbar Types. (line 28) * FL_HOR_PROGRESS_BAR: Slider Types. (line 34) * FL_HOR_SCROLLBAR: Scrollbar Types. (line 10) * FL_HOR_SLIDER: Slider Types. (line 10) * FL_HOR_THIN_SCROLLBAR: Scrollbar Types. (line 16) * FL_HOR_THUMBWHEEL: Thumbwheel Types. (line 11) * FL_HORBAR_CHART: Chart Types. (line 8) * FL_HUGE_SIZE: Label Attributes and Fonts. (line 23) * FL_IMAGE: The FL_IMAGE Structure. (line 9) * FL_IMAGE_CI: Supported image types. (line 13) * FL_IMAGE_FLEX: Supported image types. (line 13) * FL_IMAGE_GRAY: Supported image types. (line 13) * FL_IMAGE_GRAY16: Supported image types. (line 13) * FL_IMAGE_MONO: Supported image types. (line 13) * FL_IMAGE_PACKED: Supported image types. (line 13) * FL_IMAGE_RGB: Supported image types. (line 13) * FL_IMPULSE_XYPLOT: XYPlot Types. (line 30) * FL_INACTIVE: Color. (line 55) * FL_INACTIVE_FREE: Free Object. (line 144) * FL_INCLUDE_VERSION: Version Information. (line 14) * FL_INDIANRED: Color. (line 47) * FL_INOUT_BUTTON: Button Types. (line 26) * FL_INPUT_DDMM: Input Interaction. (line 209) * FL_INPUT_END_EVENT_ALWAYS: Input Interaction. (line 155) * FL_INPUT_END_EVENT_CLASSIC: Input Interaction. (line 156) * FL_INPUT_FREE: Free Object. (line 148) * FL_INPUT_MMDD: Input Interaction. (line 209) * FL_INPUT_VALIDATOR: Input Interaction. (line 171) * FL_INT: Current Support. (line 46) * FL_INT_INPUT: Input Types. (line 15) * FL_INT_SPINNER: Spinner Types. (line 8) * FL_INVALID: Input Interaction. (line 180) * FL_INVISIBLE: Displaying a Form. (line 301) * FL_INVISIBLE_CURSOR: Cursors. (line 20) * FL_INVISIBLE_POSITIONER: Positioner Types. (line 13) * FL_IO_CALLBACK: Handling Other Input Sources. (line 12) * FL_IOPT: Initialization. (line 105) * FL_ITALIC_STYLE: Label Attributes and Fonts. (line 34) * FL_JUMP_SCROLL: Other FormBrowser Routines. (line 96) * FL_KEY_ALL: Shortcuts. (line 101) * FL_KEY_NORMAL: Shortcuts. (line 87) * FL_KEY_SPECIAL: Shortcuts. (line 96) * FL_KEY_TAB: Shortcuts. (line 92) * FL_KEYPRESS <1>: Part IV Events. (line 131) * FL_KEYPRESS: Free Object. (line 114) * FL_LABELBUTTON: Adding Button Objects. (line 68) * FL_LARGE_SIZE: Label Attributes and Fonts. (line 22) * FL_LEAVE <1>: Part IV Events. (line 75) * FL_LEAVE: Free Object. (line 74) * FL_LEFT_BCOL: Color. (line 43) * FL_LEFT_MOUSE: Part IV Events. (line 89) * FL_LIGHTBUTTON: Adding Button Objects. (line 40) * FL_LIGHTER_COL1: Color. (line 44) * FL_LINE_CHART: Chart Types. (line 11) * FL_LINE_DIAL: Dial Types. (line 11) * FL_LINEAR: Other XYPlot Routines. (line 285) * FL_LINEPOINTS_XYPLOT: XYPlot Types. (line 18) * FL_LOG: Other XYPlot Routines. (line 285) * FL_LONG: Current Support. (line 49) * FL_LOSE_SELECTION_CB: Clipboard. (line 26) * FL_MAGENTA: Color. (line 52) * FL_MAX_COLORS: Color. (line 85) * FL_MAX_FSELECTOR: File Selector. (line 38) * FL_MAX_XYPLOTOVERLAY: Other XYPlot Routines. (line 162) * FL_MAXPUPI: Creating XPopups. (line 131) * FL_MBUTTON1: Part IV Events. (line 89) * FL_MBUTTON2: Part IV Events. (line 92) * FL_MBUTTON3: Part IV Events. (line 95) * FL_MBUTTON4: Part IV Events. (line 98) * FL_MBUTTON5: Part IV Events. (line 101) * FL_MCOL: Color. (line 42) * FL_MEDIUM_SIZE: Label Attributes and Fonts. (line 21) * FL_MENU_BUTTON: Button Types. (line 14) * FL_MENU_SELECT: Adding Select Objects. (line 15) * FL_MIDDLE_MOUSE: Part IV Events. (line 92) * FL_MOTION <1>: Part IV Events. (line 79) * FL_MOTION: Free Object. (line 78) * FL_MTIMESORT: File Selector. (line 295) * FL_MULTI_BROWSER: Browser Types. (line 23) * FL_MULTILINE_INPUT: Input Types. (line 24) * FL_NO: Other Folder Routines. (line 115) * FL_NO_BOX <1>: Box Types. (line 37) * FL_NO_BOX: Boxes. (line 15) * FL_NO_FRAME <1>: LabelFrame Types. (line 7) * FL_NO_FRAME: Frame Types. (line 7) * FL_NOBORDER <1>: Doing Interaction. (line 91) * FL_NOBORDER: Displaying a Form. (line 138) * FL_NOEVENT: Object Attributes. (line 246) * FL_NoGravity: Displaying a Form. (line 223) * FL_NONE: File Selector. (line 288) * FL_NORMAL_BITMAP: Bitmap Types. (line 6) * FL_NORMAL_BROWSER: Browser Types. (line 8) * FL_NORMAL_BUTTON <1>: Button Types. (line 7) * FL_NORMAL_BUTTON: Buttons. (line 17) * FL_NORMAL_CANVAS: Canvas Types. (line 6) * FL_NORMAL_CHOICE: Choice Types. (line 7) * FL_NORMAL_CHOICE2: Choice Types. (line 10) * FL_NORMAL_COUNTER: Counter Types. (line 8) * FL_NORMAL_DIAL: Dial Types. (line 8) * FL_NORMAL_FORMBROWSER: FormBrowser Types. (line 6) * FL_NORMAL_FREE: Free Object. (line 142) * FL_NORMAL_INPUT: Input Types. (line 7) * FL_NORMAL_INPUT_MODE: Input Interaction. (line 241) * FL_NORMAL_NMENU: Adding Nmenu Objects. (line 10) * FL_NORMAL_PIXMAP: Pixmap Types. (line 6) * FL_NORMAL_POSITIONER: Positioner Types. (line 7) * FL_NORMAL_SELECT: Adding Select Objects. (line 10) * FL_NORMAL_SIZE: Label Attributes and Fonts. (line 20) * FL_NORMAL_STYLE: Label Attributes and Fonts. (line 33) * FL_NORMAL_TEXT: Text Types. (line 6) * FL_NORMAL_TIMER: Timer Types. (line 7) * FL_NORMAL_TOUCH_NMENU: Adding Nmenu Objects. (line 14) * FL_NORMAL_XYPLOT: XYPlot Types. (line 7) * FL_North: Displaying a Form. (line 226) * FL_NorthEast: Displaying a Form. (line 227) * FL_NorthWest: Displaying a Form. (line 225) * FL_OFF <1>: Other FormBrowser Routines. (line 80) * FL_OFF <2>: Browser Attributes. (line 113) * FL_OFF: Other Input Routines. (line 95) * FL_ON <1>: Other FormBrowser Routines. (line 79) * FL_ON <2>: Browser Attributes. (line 112) * FL_ON: Other Input Routines. (line 92) * FL_ORCHID: Color. (line 59) * FL_OTHER <1>: Part IV Events. (line 184) * FL_OTHER: Free Object. (line 132) * FL_OVAL3D_DOWNBOX: Boxes. (line 60) * FL_OVAL3D_UPBOX: Boxes. (line 57) * FL_OVAL_BOX <1>: Box Types. (line 34) * FL_OVAL_BOX: Boxes. (line 48) * FL_OVAL_FRAME <1>: LabelFrame Types. (line 26) * FL_OVAL_FRAME: Frame Types. (line 26) * FL_OVERLAY_POSITIONER: Positioner Types. (line 10) * FL_PACKED: The FL_IMAGE Structure. (line 9) * FL_PALEGREEN: Color. (line 57) * FL_PCBITS: The FL_IMAGE Structure. (line 9) * FL_PCMAX: The FL_IMAGE Structure. (line 9) * FL_PIE_CHART: Chart Types. (line 20) * FL_PIXMAPBUTTON: Adding Button Objects. (line 62) * FL_PLACE GEOMETRY: Doing Interaction. (line 33) * FL_PLACE ICONIC: Doing Interaction. (line 74) * FL_PLACE_ASPECT <1>: Doing Interaction. (line 39) * FL_PLACE_ASPECT: Displaying a Form. (line 48) * FL_PLACE_CENTER <1>: Doing Interaction. (line 49) * FL_PLACE_CENTER: Displaying a Form. (line 58) * FL_PLACE_CENTERFREE <1>: Doing Interaction. (line 70) * FL_PLACE_CENTERFREE: Displaying a Form. (line 79) * FL_PLACE_FREE <1>: Doing Interaction. (line 59) * FL_PLACE_FREE: Displaying a Form. (line 68) * FL_PLACE_FULLSCREEN <1>: Doing Interaction. (line 54) * FL_PLACE_FULLSCREEN: Displaying a Form. (line 63) * FL_PLACE_GEOMETRY: Displaying a Form. (line 43) * FL_PLACE_HOTSPOT <1>: Doing Interaction. (line 65) * FL_PLACE_HOTSPOT: Displaying a Form. (line 74) * FL_PLACE_ICONIC: Displaying a Form. (line 83) * FL_PLACE_MOUSE <1>: Doing Interaction. (line 43) * FL_PLACE_MOUSE: Displaying a Form. (line 52) * FL_PLACE_POSITION <1>: Doing Interaction. (line 29) * FL_PLACE_POSITION: Displaying a Form. (line 39) * FL_PLACE_SIZE <1>: Doing Interaction. (line 25) * FL_PLACE_SIZE: Displaying a Form. (line 35) * FL_POINT: Drawing Functions. (line 43) * FL_POINTS_XYPLOT: XYPlot Types. (line 17) * FL_POPUP: Adding Popups. (line 350) * FL_POPUP_BACKGROUND_COLOR: Popup Attributes. (line 80) * FL_POPUP_CB: Adding Popups. (line 211) * FL_POPUP_CHECKED <1>: Other Popup Routines. (line 53) * FL_POPUP_CHECKED <2>: Adding Popups. (line 341) * FL_POPUP_CHECKED: Adding Nmenu Objects. (line 96) * fl_popup_delete(): Adding Popups. (line 405) * FL_POPUP_DISABLED <1>: Other Popup Routines. (line 49) * FL_POPUP_DISABLED: Adding Popups. (line 334) * FL_POPUP_DISABLED_TEXT_COLOR: Popup Attributes. (line 95) * fl_popup_do(): Popup Interaction. (line 6) * FL_POPUP_DRAG_SELECT <1>: Popup Interaction. (line 71) * FL_POPUP_DRAG_SELECT <2>: Nmenu Interaction. (line 62) * FL_POPUP_DRAG_SELECT: Select Interaction. (line 80) * FL_POPUP_DSABLED: Adding Nmenu Objects. (line 89) * FL_POPUP_ENTRY: Adding Popups. (line 292) * FL_POPUP_HIDDEN <1>: Other Popup Routines. (line 50) * FL_POPUP_HIDDEN <2>: Adding Popups. (line 338) * FL_POPUP_HIDDEN: Adding Nmenu Objects. (line 92) * FL_POPUP_HIGHLIGHT_COLOR: Popup Attributes. (line 81) * FL_POPUP_HIGHLIGHT_TEXT_COLOR: Popup Attributes. (line 91) * fl_popup_insert_entries(): Adding Popups. (line 393) * FL_POPUP_ITEM: Adding Popups. (line 423) * FL_POPUP_LINE: Adding Popups. (line 326) * FL_POPUP_NONE <1>: Adding Popups. (line 333) * FL_POPUP_NONE: Adding Nmenu Objects. (line 86) * FL_POPUP_NORMAL <1>: Adding Popups. (line 311) * FL_POPUP_NORMAL: Adding Nmenu Objects. (line 69) * FL_POPUP_NORMAL_SELECT <1>: Popup Interaction. (line 69) * FL_POPUP_NORMAL_SELECT <2>: Nmenu Interaction. (line 58) * FL_POPUP_NORMAL_SELECT: Select Interaction. (line 76) * FL_POPUP_RADIO <1>: Adding Popups. (line 316) * FL_POPUP_RADIO: Adding Nmenu Objects. (line 76) * FL_POPUP_RADIO_COLOR: Popup Attributes. (line 99) * FL_POPUP_RETURN: Adding Popups. (line 238) * FL_POPUP_SUB: Adding Popups. (line 321) * FL_POPUP_TEXT_COLOR: Popup Attributes. (line 88) * FL_POPUP_TITLE_COLOR: Popup Attributes. (line 85) * FL_POPUP_TOGGLE <1>: Adding Popups. (line 312) * FL_POPUP_TOGGLE: Adding Nmenu Objects. (line 72) * FL_POSITIONER_INVALID: Other Positioner Routines. (line 42) * FL_POSITIONER_REPLACED: Other Positioner Routines. (line 46) * FL_POSITIONER_VALID: Other Positioner Routines. (line 44) * FL_POSITIONER_VALIDATOR: Other Positioner Routines. (line 33) * FL_PREEMPT <1>: Form Events. (line 47) * FL_PREEMPT: Part IV Using a Pre-emptive Handler. (line 46) * FL_PULLDOWN_MENU: Menu Types. (line 10) * FL_PUP_BOX <1>: Creating XPopups. (line 261) * FL_PUP_BOX: Other Menu Routines. (line 143) * FL_PUP_CB: XPopup Interaction. (line 40) * FL_PUP_CHECK <1>: Creating XPopups. (line 268) * FL_PUP_CHECK: Other Menu Routines. (line 157) * FL_PUP_ENTERCB: XPopup Interaction. (line 63) * FL_PUP_ENTRY <1>: Creating XPopups. (line 221) * FL_PUP_ENTRY: Other Menu Routines. (line 77) * FL_PUP_GREY <1>: Creating XPopups. (line 257) * FL_PUP_GREY: Other Menu Routines. (line 153) * FL_PUP_LEAVECB: XPopup Interaction. (line 63) * FL_PUP_NONE: Other Menu Routines. (line 140) * FL_PUP_RADIO <1>: Creating XPopups. (line 264) * FL_PUP_RADIO: Other Menu Routines. (line 148) * FL_PUSH <1>: Part IV Events. (line 84) * FL_PUSH: Free Object. (line 83) * FL_PUSH_BUTTON <1>: Button Types. (line 11) * FL_PUSH_BUTTON: Buttons. (line 17) * FL_PUSH_MENU: Menu Types. (line 7) * FL_RADIO_BUTTON <1>: Button Types. (line 20) * FL_RADIO_BUTTON: Buttons. (line 17) * FL_RALPHASORT: File Selector. (line 292) * FL_RAW_CALLBACK: Form Events. (line 13) * FL_RCASEALPHASORT: File Selector. (line 311) * FL_READ: Handling Other Input Sources. (line 21) * FL_RED: Color. (line 48) * FL_RELEASE <1>: Part IV Events. (line 104) * FL_RELEASE: Free Object. (line 87) * FL_RESIZE_ALL: Displaying a Form. (line 212) * FL_RESIZE_NONE: Displaying a Form. (line 203) * FL_RESIZE_X: Displaying a Form. (line 206) * FL_RESIZE_Y: Displaying a Form. (line 209) * FL_resource: Current Support. (line 32) * FL_RETURN_ALWAYS: Simple Interaction. (line 116) * FL_RETURN_BUTTON: Button Types. (line 29) * FL_RETURN_CHANGED: Simple Interaction. (line 94) * FL_RETURN_DESELECTION: Simple Interaction. (line 112) * FL_RETURN_END: Simple Interaction. (line 99) * FL_RETURN_END_CHANGED: Simple Interaction. (line 104) * FL_RETURN_NONE: Simple Interaction. (line 120) * FL_RETURN_SELECTION: Simple Interaction. (line 108) * FL_REVISION: Version Information. (line 11) * FL_RFLAT_BOX <1>: Box Types. (line 28) * FL_RFLAT_BOX: Boxes. (line 41) * FL_RIGHT_BCOL: Color. (line 41) * FL_RIGHT_MOUSE: Part IV Events. (line 95) * FL_RINGBELL: Input Interaction. (line 185) * FL_RMTIMESORT: File Selector. (line 298) * FL_ROUND3DBUTTON: Adding Button Objects. (line 49) * FL_ROUNDBUTTON: Adding Button Objects. (line 44) * FL_ROUNDED3D_DOWNBOX: Boxes. (line 54) * FL_ROUNDED3D_UPBOX: Boxes. (line 51) * FL_ROUNDED_BOX <1>: Box Types. (line 25) * FL_ROUNDED_BOX: Boxes. (line 31) * FL_ROUNDED_FRAME <1>: LabelFrame Types. (line 23) * FL_ROUNDED_FRAME: Frame Types. (line 23) * FL_RSHADOW_BOX <1>: Box Types. (line 31) * FL_RSHADOW_BOX: Boxes. (line 45) * FL_RSIZESORT: File Selector. (line 305) * FL_RTYPE: Current Support. (line 41) * FL_SCROLLBARBUTTON: Adding Button Objects. (line 72) * FL_SCROLLDOWN_MOUSE: Part IV Events. (line 101) * FL_SCROLLUP_MOUSE: Part IV Events. (line 98) * FL_SECRET_INPUT: Input Types. (line 27) * FL_SELECT_BROWSER: Browser Types. (line 11) * FL_SELECTION_CB: Clipboard. (line 45) * FL_SHADOW_BOX <1>: Box Types. (line 22) * FL_SHADOW_BOX: Boxes. (line 25) * FL_SHADOW_STYLE: Label Attributes and Fonts. (line 44) * FL_SHORT: Current Support. (line 42) * FL_SHORTCUT <1>: Part IV Events. (line 142) * FL_SHORTCUT <2>: Other Button Routines. (line 31) * FL_SHORTCUT <3>: Free Object. (line 124) * FL_SHORTCUT: Dealing With Multiple Windows. (line 129) * FL_SIGNAL_HANDLER: Signals. (line 16) * FL_SIMPLE_COUNTER: Counter Types. (line 11) * FL_SIZESORT: File Selector. (line 302) * FL_SLATEBLUE: Color. (line 46) * FL_SLIDER_MAX_PREC: Slider Attributes. (line 29) * FL_SLIDER_WIDTH <1>: Scrollbar Attributes. (line 18) * FL_SLIDER_WIDTH: Slider Attributes. (line 17) * FL_SMALL_SIZE: Label Attributes and Fonts. (line 19) * FL_SMOOTH_SCROLL: Other FormBrowser Routines. (line 93) * FL_South: Displaying a Form. (line 231) * FL_SouthEast: Displaying a Form. (line 232) * FL_SouthWest: Displaying a Form. (line 230) * FL_SPECIALPIE_CHART: Chart Types. (line 23) * FL_SPIKE_CHART: Chart Types. (line 17) * FL_SPRINGGREEN: Color. (line 67) * FL_SQUARE_XYPLOT: XYPlot Types. (line 8) * FL_State: General Remarks. (line 18) * FL_STEP <1>: Part IV Events. (line 146) * FL_STEP: Free Object. (line 118) * FL_STRING: Current Support. (line 55) * FL_TIMEOUT_CALLBACK <1>: Idle Callbacks and Timeouts. (line 36) * FL_TIMEOUT_CALLBACK: Periodic Events and Non-blocking Interaction. (line 48) * FL_TIMER_FILTER: Other Timer Routines. (line 31) * FL_TIMES_STYLE: Label Attributes and Fonts. (line 40) * FL_TIMESBOLD_STYLE FL: Label Attributes and Fonts. (line 41) * FL_TIMESBOLDITALIC_STYLE: Label Attributes and Fonts. (line 43) * FL_TIMESITALIC_STYLE: Label Attributes and Fonts. (line 42) * FL_TINY_SIZE: Label Attributes and Fonts. (line 19) * FL_TOMATO: Color. (line 54) * FL_TOP_BCOL: Color. (line 56) * FL_TOP_TABFOLDER: Folder Types. (line 7) * FL_TOUCH_BUTTON <1>: Button Types. (line 17) * FL_TOUCH_BUTTON: Buttons. (line 17) * FL_TOUCH_MENU: Menu Types. (line 13) * FL_TRANSIENT <1>: Doing Interaction. (line 87) * FL_TRANSIENT: Displaying a Form. (line 135) * FL_TRIGGER: Object Attributes. (line 243) * FL_TRPLCLICK <1>: Part IV Events. (line 117) * FL_TRPLCLICK: Free Object. (line 95) * FL_UNFOCUS <1>: Part IV Events. (line 128) * FL_UNFOCUS: Free Object. (line 111) * FL_UP_BOX <1>: Box Types. (line 7) * FL_UP_BOX: Boxes. (line 16) * FL_UP_FRAME <1>: LabelFrame Types. (line 8) * FL_UP_FRAME: Frame Types. (line 8) * FL_UPDATE <1>: Part IV Events. (line 155) * FL_UPDATE: Free Object. (line 100) * FL_USER_CLASS_START: The Routine fl_add_NEW(). (line 33) * FL_VALID: Input Interaction. (line 180) * FL_VALUE_TIMER: Timer Types. (line 9) * FL_VERSION: Version Information. (line 8) * FL_VERT_BROWSER_SLIDER: Slider Types. (line 25) * FL_VERT_FILL_SLIDER: Slider Types. (line 13) * FL_VERT_NICE_SCROLLBAR: Scrollbar Types. (line 19) * FL_VERT_NICE_SLIDER: Slider Types. (line 19) * FL_VERT_PLAIN_SCROLLBAR: Scrollbar Types. (line 25) * FL_VERT_PROGRESS_BAR: Slider Types. (line 31) * FL_VERT_SCROLLBAR: Scrollbar Types. (line 7) * FL_VERT_SLIDER: Slider Types. (line 7) * FL_VERT_THIN_SCROLLBAR: Scrollbar Types. (line 13) * FL_VERT_THUMBWHEEL: Thumbwheel Types. (line 8) * FL_VISIBLE: Displaying a Form. (line 304) * FL_West: Displaying a Form. (line 228) * FL_WHEAT: Color. (line 62) * FL_WHITE: Color. (line 38) * FL_WRITE: Handling Other Input Sources. (line 24) * FL_XYPLOT_SYMBOL: Other XYPlot Routines. (line 104) * FL_YELLOW: Color. (line 51) * FLIMAGE_ASPECT: Scaling. (line 24) * FLIMAGE_AUTOCOLOR: Cropping. (line 15) * FLIMAGE_CENTER: Scaling. (line 27) * FLIMAGE_Description: Adding New Formats. (line 12) * FLIMAGE_FORMAT_INFO: Queries. (line 14) * FLIMAGE_Identify: Adding New Formats. (line 12) * FLIMAGE_JPEG_OPTIONS: Built-in support. (line 48) * FLIMAGE_NOCENTER <1>: Warping. (line 67) * FLIMAGE_NOCENTER: Scaling. (line 30) * FLIMAGE_NOSUBPIXEL <1>: Warping. (line 67) * FLIMAGE_NOSUBPIXEL <2>: Scaling. (line 20) * FLIMAGE_NOSUBPIXEL: Rotation. (line 12) * FLIMAGE_Read_Pixels: Adding New Formats. (line 12) * FLIMAGE_SETUP: Setup and Configuration. (line 20) * FLIMAGE_SHARPEN: Convolution. (line 31) * FLIMAGE_SMOOTH: Convolution. (line 30) * FLIMAGE_SUBPIXEL <1>: Warping. (line 67) * FLIMAGE_SUBPIXEL <2>: Scaling. (line 21) * FLIMAGE_SUBPIXEL: Rotation. (line 12) * FLIMAGE_TEXT: Using Text Strings. (line 33) * FLIMAGE_Write_Image: Adding New Formats. (line 12) * FLPS_CONTROL: Object Attributes. (line 284) * ForgetGravity: Displaying a Form. (line 233) * FT_BLK: File Selector. (line 237) * FT_CHR: File Selector. (line 240) * FT_DIR: File Selector. (line 225) * FT_FIFO: File Selector. (line 231) * FT_FILE: File Selector. (line 224) * FT_LINK: File Selector. (line 234) * FT_SOCK: File Selector. (line 228) xforms-1.2.4/doc/part4_events.texi0000644000175000017500000003761312252564505014053 00000000000000@node Part IV Events @chapter Events As indicated above, the main module of the Forms Library communicates with the objects by calling the associated handling routine with, as one of the arguments, the particular event for which action must be taken. In the following we assume that @code{obj} is the object to which the event is sent. The following types of events can be sent to an object: @table @code @tindex FL_DRAW @anchor{FL_DRAW} @item FL_DRAW The object has to be (re)drawn. To figure out the actual size of the object you can use the fields @code{obj->x}, @code{obj->y}, @code{obj->w} and @code{obj->h}. Many Xlib drawing routines require a window ID, which you can obtain from the object pointer using @code{FL_ObjWin(obj)}. Some other aspects might also influence the way the object has to be drawn. E.g., you might want to draw the object differently when the mouse is on top of it or when the mouse is pressed on it. This can be figured out the following way: The field @code{obj->belowmouse} tells you whether the object is below the mouse. The field @code{obj->pushed} indicates whether the object is currently being pushed with the mouse. Finally, @code{obj->focus} indicate whether input focus is directed towards this object. Note that drawing of the object is the full responsibility of the object class, including the bounding box and the label, which can be found in the field @code{obj->label}. The Forms Library provides a large number of routines to help you draw object. @xref{Part IV Drawing Objects, , Drawing Objects}, for more details on drawing objects and an overview of all available routines. One important caution about your draw event handling code: none of the high level routines (@code{@ref{fl_freeze_form()}}, @code{@ref{fl_deactivate_form()}}) etc.@: can be used. The only routines allowed to be used are (direct) drawing functions and object internal book keeping routines. Attribute modifying routines, such as @code{@ref{fl_set_object_color()}} etc.@: are not allowed (using them can lead to infinite recursions). In addition, (re)drawing of other objects using @code{@ref{fl_redraw_object()}} while handling @code{@ref{FL_DRAW}} will also not work. Due to the way double buffering is handled, at the time the @code{FL_DRAW} event is passed to the handling function (and only then) @code{FL_ObjWin(obj)} might return a pixmap used as the backbuffer (at least if the object is double buffered). What that means is that @code{FL_ObjWin(obj)} should not be used when a real window is needed. For a real window you can change the window's cursor or query the mouse position within it. You can't do either of these with the backbuffer pixmap. If there is a need to obtain the real window ID the following routine can be used: @findex fl_get_real_object_window() @anchor{fl_get_real_object_window()} @example Window fl_get_real_object_window(FL_OBJECT *) @end example To summarize: use @code{FL_ObjWin(obj)} when drawing and use @code{@ref{fl_get_real_object_window()}} for cursor or pointer routines. This distinction is important only while handling @code{FL_DRAW} events, @code{FL_ObjWin(obj)} should be used anywhere else. @tindex FL_DRAWLABEL @anchor{FL_DRAWLABEL} @item FL_DRAWLABEL This event typically follows @code{FL_DRAW} and indicates that the object label needs to be (re)drawn. If the object in question always draws its label inside the bounding box and this is taken care of by handing @code{FL_DRAW}, you can ignore this event. @tindex FL_ENTER @anchor{FL_ENTER} @item FL_ENTER This event is sent when the mouse has entered the bounding box and might require some action. Note also that the field @code{obj->belowmouse} in the object is being set. If entering an objects area only changes its appearance, redrawing it normally suffices. Don't do this directly! Always redraw the object by calling @code{@ref{fl_redraw_object()}}. It will send an @code{FL_DRAW} event to the object but also does some other things (like setting window IDs and taking care of double buffering etc.). @tindex FL_LEAVE @anchor{FL_LEAVE} @item FL_LEAVE The mouse has left the bounding box. Again, normally a redraw is enough (or nothing at all). @tindex FL_MOTION @anchor{FL_MOTION} @item FL_MOTION Motion events get sent between @code{FL_ENTER} and @code{FL_LEAVE} events when the mouse position changes on the object. The mouse position is given as an argument to the handle routine. @tindex FL_PUSH @anchor{FL_PUSH} @item FL_PUSH The user has pushed a mouse button on the object. Normally this requires some actual action. The number of the mouse button pushed is given in the @code{key} parameter, having one of the following values: @table @code @tindex FL_LEFT_MOUSE @anchor{FL_LEFT_MOUSE} @tindex FL_MBUTTON1 @item FL_LEFT_MOUSE, FL_MBUTTON1 Left mouse button was pressed. @tindex FL_MIDDLE_MOUSE @anchor{FL_MIDDLE_MOUSE} @tindex FL_MBUTTON2 @item FL_MIDDLE_MOUSE, FL_MBUTTON2 Middle mouse button was pressed. @tindex FL_RIGHT_MOUSE @anchor{FL_RIGHT_MOUSE} @tindex FL_MBUTTON3 @item FL_RIGHT_MOUSE, FL_MBUTTON3 Right mouse button was pressed. @tindex FL_SCROLLUP_MOUSE @anchor{FL_SCROLLUP_MOUSE} @tindex FL_MBUTTON4 @item FL_SCROLLUP_MOUSE, FL_MBUTTON4 Mouse scroll wheel was rotated in up direction. @tindex FL_SCROLLDOWN_MOUSE @anchor{FL_SCROLLDOWN_MOUSE} @tindex FL_MBUTTON5 @item FL_SCROLLDOWN_MOUSE, FL_MBUTTON5 Mouse scroll wheel was rotated in down direction. @end table @tindex FL_RELEASE @anchor{FL_RELEASE} @item FL_RELEASE The user has released the mouse button. This event is only sent if a @code{@ref{FL_PUSH}} event was sent before. @code{@ref{FL_PUSH}} event. @tindex FL_DBLCLICK @anchor{FL_DBLCLICK} @item FL_DBLCLICK The user has pushed a mouse button twice within a certain time limit @tindex FL_CLICK_TIMEOUT (@code{FL_CLICK_TIMEOUT}), which by default is @w{400 msec}. This event is sent after two @code{FL_PUSH}, @code{FL_RELEASE} sequence. Note that @code{FL_DBLCLICK} is only generated for objects that have non-zero @code{obj->click timeout} fields and it will not be generated for events from the scroll wheel. @tindex FL_TRPLCLICK @anchor{FL_TRPLCLICK} @item FL_TRPLCLICK The user has pushed a mouse button three times within a certain time window. This event is sent after a @code{@ref{FL_DBLCLICK}}, @code{@ref{FL_PUSH}}, @code{@ref{FL_RELEASE}} sequence. Set click timeout to none-zero to activate @code{FL_TRPLCLICK}. @tindex FL_FOCUS @anchor{FL_FOCUS} @item FL_FOCUS Input got focussed to this object. This type of event and the next two are only sent to objects for which the field @code{obj->input} is set to 1 (see below). @tindex FL_UNFOCUS @anchor{FL_UNFOCUS} @item FL_UNFOCUS Input is no longer focussed on the object. @tindex FL_KEYPRESS @anchor{FL_KEYPRESS} @item FL_KEYPRESS A key was pressed. The ASCII value (or KeySym if non-ASCII) is passed to the routine via the @code{key} argument, modifier keys can be retrieved from the @code{state} member of the XEvent also passed to the function via @code{xev}. This event only happens between @code{@ref{FL_FOCUS}} and @code{@ref{FL_UNFOCUS}} events. Not all objects are sent keyboard events, only those that have non-zero value in field @code{obj->input} or @code{obj->wantkey}. @tindex FL_SHORTCUT @anchor{FL_SHORTCUT} @item FL_SHORTCUT The user used a keyboard shortcut. The shortcut used is given in the parameter key. See below for more on shortcuts. @tindex FL_STEP @anchor{FL_STEP} @item FL_STEP A @code{FL_STEP} event is sent all the time (typically about 20 times a second but possibly less often because of system delays and other time-consuming tasks) to objects for which the field @code{obj->automatic} has been set to a non-zero value. The handling routine receives a synthetic @code{MotionNotify} event as the XEvent. This can be used to make an object change appearance without user action. Clock and timer objects use this type of event. @tindex FL_UPDATE @anchor{FL_UPDATE} @item FL_UPDATE An @code{FL_UPDATE} event, like the @code{@ref{FL_STEP}} event, also gets send about every @w{50 msec} (but less often under high load) to objects while they are "pushed", i.e., between receiving a @code{@ref{FL_PUSH}} and a @code{@ref{FL_RELEASE}} event if their @code{obj->want_update} field is set. Like for the @code{FL_STEP} event the handling routine receives a synthetic @code{MotionNotify} event as the XEvent. This is typically used by objects that have to perform tasks at regular time intervals while they are "pushed" (e.g., counters that need to count up or down while the mouse is pushed on one of its buttons). @tindex FL_ATTRIB @anchor{FL_ATTRIB} @item FL_ATTRIB An @code{FL_ATTRIB} event is sent to an object (via calling the handler function each object type must define for this purpose) whenever one of it's properties changes, be it its size, position, box type, border width, colors, label, label color, style or alignment etc. This can e.g., be used by the object to do preparations for later drawing of it or check that what got set is reasonable. It should not use this event to actually draw anything (this is to be done only when an @code{@ref{FL_DRAW}} event is received). When the handler function for events is called all the arguments it gets passed are @code{0}. @tindex FL_FREEMEM @anchor{FL_FREEMEM} @tindex FL_FREEMEM @item FL_FREEMEM This event is sent when the object is to be freed. All memory allocated for the object internally must be freed when this event is received. @tindex FL_OTHER @anchor{FL_OTHER} @item FL_OTHER Events other than the above. These events currently include ClientMessage, Selection and possibly other window manager events. All information about the event is contained in @code{xev} parameter and @code{mx} and @code{my} may or may not reflect the actual position of the mouse. @end table Many of these events might make it necessary that the object has to be redrawn or partially redrawn. Always do this using the routine @code{@ref{fl_redraw_object()}}. @ifnottex @menu * Shortcuts:: @end menu @end ifnottex @node Shortcuts @section Shortcuts The Forms Library has a mechanism of dealing with keyboard shortcuts. In this way the user can use the keyboard rather than the mouse for particular actions. Obviously, only "active" objects can have shortcuts (i.e., not objects like boxes, texts etc.). The mechanism works as follows. There is a routine @findex fl_set_object_shortcut() @anchor{fl_set_object_shortcut()} @example void fl_set_object_shortcut(FL_OBJECT *obj, const char *str, int showit); @end example @noindent with which one can bind a series of keys to an object. E.g., when @code{str} is @code{"acE#d^h"} the keys @code{'a'}, @code{'c'}, @code{'E'}, @code{d} and @code{h} are associated with the object. The precise format is as follows: Any character in the string is considered as a shortcut, except @code{'^'} and @code{'#'}, which stand for combinations with the @code{} and @code{} keys. (The case of the key following @code{'#'} or @code{'^'} is not important, i.e., no distiction is made between e.g., @code{"^C"} and @code{"^c"}, both encode the key combination @code{C} as well as @code{C}.) The key @code{'^'} itself can be set as a shortcut key by using @code{"^^"} in the string defining the shortcut. The key @code{'#'} can be obtained as a shortcut by using th string @code{"^#"}. So, e.g., @code{"#^#"} encodes @code{#}. The @code{} key can be given as @code{"^["}. Another special character not mentioned yet is @code{'&'}, which indicates function and arrow keys. Use a sequence starting with @code{'&'} and directly followed by a number between 1 and 35 to represent one of the function keys. For example, @code{"&2"} stands for the @code{} function key. The four cursors keys (up, down, right, and left) can be given as @code{"&A"}, @code{"&B"}, @code{"&C"} and @code{"&D"}, respectively. The key @code{'&'} itself can be obtained as a shortcut by prefixing it with @code{'^'}. The argument @code{showit} tells whether the shortcut letter in the object label should be underlined if a match exists. Although the entire object label is searched for matches, only the first alphanumerical character in the shortcut string is used. E.g., for the object label @code{"foobar"} the shortcut @code{"oO"} would result in a match at the first @code{o} in @code{"foobar"} while @code{"Oo"} would not. However, @code{"^O"} and @code{"#O"} would match since for keys used in combination with @code{} and @code{} no distiction is made between upper and lower case. To use other special keys not described above as shortcuts, the following routine must be used @findex fl_set_object_shortcutkey() @anchor{fl_set_object_shortcutkey()} @example void fl_set_object_shortcutkey(FL_OBJECT *obj, unsigned int key); @end example @noindent where @code{key} is an X KeySym, for example @code{XK_Home}, @code{XK_F1} etc. Note that the function @code{@ref{fl_set_object_shortcutkey()}} always appends the key specified to the current shortcuts while @code{@ref{fl_set_object_shortcut()}} resets the shortcuts. Of course, special keys can't be underlined. Now, whenever the user presses one of these keys, an @code{@ref{FL_SHORTCUT}} event is sent to the object. The key pressed is passed to the handle routine (in the argument @code{key}). Combinations with the @code{} key are given by adding @code{@ref{FL_ALT_MASK}} (currently the 25th bit, i.e., @code{0x1000000}) to the ASCII value of the key. E.g., the key combinations @code{E} and @code{e} are passed as @code{@ref{FL_ALT_MASK} + 'E'}. The object can now take action accordingly. If you use shortcuts to manipulate class object specific things, you will need to create a routine to communicate with the user, e.g., @code{fl_set_NEW_shortcut()}, and do your own internal bookkeeping to track what keys do what and then call @code{@ref{fl_set_object_shortcut()}} to register the shortcut in the event dispatching module. The idea is NOT that the user himself calls @code{@ref{fl_set_object_shortcut()}} but that the class provides a routine for this that also keeps track of the required internal bookkeeping. Of course, if there is no internal bookkeeping, a macro to this effect will suffice. For example @code{@ref{fl_set_button_shortcut()}} is defined as @code{@ref{fl_set_object_shortcut()}}. The order in which keys are handled is as follows: First for a key it is tested whether any object in the form has the key as a shortcut. If yes, the first of those objects gets the shortcut event. Otherwise, the key is checked to see if it is @code{} or @code{}. If it is, the @code{obj->wantkey} field is checked. If the field does not contain @code{@ref{FL_KEY_TAB}} bit, input is focussed on the next input field. Otherwise the key is sent to the current input field. This means that input objects only get a @code{} or @code{} key sent to them if in the @code{obj->wantkey} field the @code{@ref{FL_KEY_TAB}} bit is set. This is e.g., used in multi-line input fields. If the object wants all cursor keys (including @code{} etc.), the @code{obj->wantkey} field must have the @code{@ref{FL_KEY_SPECIAL}} bit set. To summarize, the @code{obj->wantkey} field can take on the following values (or the bit-wise or of them): @table @code @tindex FL_KEY_NORMAL @anchor{FL_KEY_NORMAL} @item FL_KEY_NORMAL The default. The object receives left and right cursor, @code{} and @code{} keys plus all normal keys (0-255) except @code{} @code{}. @tindex FL_KEY_TAB @anchor{FL_KEY_TAB} @item FL_KEY_TAB Object receives the @code{}, @code{} as well as the @code{} and @code{} cursor keys. @tindex FL_KEY_SPECIAL @anchor{FL_KEY_SPECIAL} @item FL_KEY_SPECIAL The object receives all keys with a KeySym above 255 which aren't already covered by @code{FL_KEY_NORMAL} and @code{FL_KEY_TAB} (e.g., function keys etc.) @tindex FL_KEY_ALL @anchor{FL_KEY_ALL} @item FL_KEY_ALL Object receives all keys. @end table @noindent This way it is possible for a non-input object (i.e., if @code{obj->input} is zero) to obtain special keyboard event by setting @code{obj->wantkey} to @code{@ref{FL_KEY_SPECIAL}}. xforms-1.2.4/doc/part4_preemptive_handler.texi0000644000175000017500000000722011665175511016415 00000000000000@node Part IV Using a Pre-emptive Handler @chapter Using a Pre-emptive Handler Pre-emptive handlers came into being due to reasons not related to developing new classes. They are provided for the application programs to have access to the current state or event of a particular object. However, with some care, this preemptive handler can be used to override parts of the original built-in handler thus yielding a new class of objects. As mentioned earlier, an object module communicates with the main module via events. Central part of the module is the event handler, which determines how an object responds to various events such as mouse clicks or a key presses. Now a pre-emptive handler is a function which, if installed, gets called first by the main module when an event for the object occurs. The pre-emptive handler has the option to override the built-in handler by informing the main module not to call the built-in handler (and a possibly also installed post handler), thus altering the behavior of the object. A post handler, on the other hand, is called when the object handler has finished its tasks and thus does not offer the capability of overriding the built-in handler. It is much safer, however. The API to install a pre- or post-handler for an object is as follows @tindex FL_HANDLEPTR @findex fl_set_object_prehandler() @anchor{fl_set_object_prehandler()} @findex fl_set_object_posthandler() @anchor{fl_set_object_posthandler()} @example typedef int (*FL_HANDLEPTR)(FL_OBJECT *obj, int event, FL_Coord mx, FL_Coord my, int key, void *raw_event); void fl_set_object_prehandler(FL_OBJECT *obj, FL_HANDLEPTR pre_handler); void fl_set_object_posthandler(FL_OBJECT *obj, FL_HANDLEPTR post_handler); @end example @noindent @code{event} is a generic event of the Forms Library, that is, @code{@ref{FL_DRAW}}, @code{@ref{FL_ENTER}} etc. Parameters @code{mx} and @code{my} are the mouse position and @code{key} is the key pressed. The last parameter @code{raw_event} is a pointer to the XEvent (cast to a void pointer due to the different types of Xevents) that caused the invocation of the pre- or post-handler. But note: not all events of the Form Library have a corresponding Xevent and thus dereferencing of @code{xev} should only be done after making sure it is not @code{NULL}. The pre- and post-handler have the same function prototype as the built-in handler. Actually they are called with exactly the same parameters by the event dispatcher. The pre-handler should return @tindex FL_PREEMPT @anchor{FL_PREEMPT} @code{FL_PREEMPT} to prevent the dispatcher from calling the normal object handler for events and @code{!FL_PREEMPT} if the objects handler for is to be invoked next. The post-handler may return whatever it wants since the return value is not used. Note that a post-handler will receive all events even if the object the post-handler is registered for does not. For example, a post-handler for a box (a static object that only receives @code{@ref{FL_DRAW}}) receives all events. Note that when an object has been de-activated using @code{@ref{fl_deactivate_object()}} (or the whole form the object belongs to is de-activated via calls of @code{@ref{fl_deactivate_form()}} or @code{@ref{fl_deactivate_all_forms()}}) also pre-emptive and post-handlers won't get invoked for the object. See the demo programs @file{preemptive.c} and @file{xyplotall.c} for examples. Bear in mind that modifying the built-in behavior is in general not a good idea. Using a pre-emptive handler for the purpose of "peeking", however, is quite legitimate and can be useful in some situations. xforms-1.2.4/doc/part5_dirty_tricks.texi0000644000175000017500000001506312252534260015250 00000000000000@node Part V Dirty Tricks @chapter Dirty Tricks This chapter describes some of the routines that may be used in special situations where more power or flexibility from Forms Library is needed. These routines are classified as "dirty tricks" either because they can easily mess up the normal operation of Forms Library or they depend on internal information that might change in the future, or they rely too much on the underlying window systems. Thus whenever possible, try not to use these routines. @ifnottex @menu * Interaction:: * Other:: @end menu @end ifnottex @node Interaction @section Interaction @ifnottex @menu * Form Events:: * Object Events:: @end menu @end ifnottex @node Form Events @subsection Form Events It is possible to by-pass the form event processing entirely by setting a "raw callback" that sits between the event reading and dispatching stage, thus a sneak preview can be implemented and optionally the event can even be consumed before the libraries internal form processing machinery gets to it. Use the following routines to register such a preemptive processing routine @tindex FL_RAW_CALLBACK @findex fl_register_raw_callback() @anchor{fl_register_raw_callback()} @example typedef int (*FL_RAW_CALLBACK)(FL_FORM *, void *xevent); FL_RAW_CALL_BACK fl_register_raw_callback(FL_FORM *form, unsigned long mask, FL_RAW_CALLBACK callback); @end example @noindent where @code{mask} is the event mask you are interested in (same as the XEvent mask). The function returns the old handler for the event. Currently only handlers for the following events are supported @itemize @bullet @item @code{KeyPressMask} and @code{KeyReleaseMask} @item @code{ButtonPressMask} and @code{ButtonReleaseMask} @item @code{EnterWindowMask} and @code{LeaveWindowMask} @item @code{ButtonMotionMask} and @code{PointerMotionMask} @item @code{FL ALL EVENT} (see below) @end itemize Further, there is only one handler for each event pair, (e.g., @code{ButtonPress} and @code{ButtonRelease}), thus you can't have two separate handlers for each pair although it is possible to register a handler only for one of them (but almost always a mistake) if you know what you're doing. If you register a single handler for more than one pair of events, e.g., setting mask to @code{KeyPressMask|ButtonPressMask}, the returned old handler is random. A special constant, @code{FL_ALL_EVENT}, is defined so that the handler registered will received all events that are selected. To select events, use @code{@ref{fl_addto_selected_xevent()}}. Once an event handler is registered and the event is detected, then instead of doing the default processing by the dispatcher, the registered handler function is invoked. The handler function must return either @tindex FL_PREEMPT @code{FL_PREEMPT} if the event is consumed) and @code{0} otherwise so that the internal processing of the event can continue. See the demo program @file{minput2.c} for an example. Since these kind of handlers work on a rather low level there's a chance that they interfere with some mechanisms of the library. Consider the case of setting a raw callback handler for mouse press and release events, in which the handler returns @code{0} for mouse press events but @code{FL_PREEMPT} on relese events. In that case the mouse press event results in the normal processing and e.g., a button below the mouse will receive it (and be drawn correspondingly). To be drawn again in its normal way it also needs to receive the release event (even if the mouse isn't on top of it anymore when the mouse button is released). But when the handler function doesn't also let the release event propagate to the normal handling of events then the button will never receive the expected release event and will stay drawn in the way as if the release event never happened. Thus one should avoid having different return values from the handler for pairs of related events. @node Object Events @subsection Object Events Just as you can by-pass the internal event processing for a particular form, you can also do so for an object. Unlike in raw callbacks, you can not select individual events. The mechanism provided is via the registration of a pre-handler for an object. The pre-handler will be called before the built-in object handler. By electing to handle some of the events, a pre-handler can, in effect, replace part of the built-in handler. In @ref{Part IV Using a Pre-emptive Handler, , the chapter about pre-emptive handlers} the API was already discussed in detail, so here we just repeat the discussion for completeness as any use of pre-emptive handler is considered "dirty tricks". To register a pre-handler, use the following routine @tindex FL_HANDLEPTR @findex fl_set_object_prehandler() @example typedef int (*FL_HANDLEPTR)(FL_OBJECT *obj, int event, FL_Coord mx, FL_Coord my, int key, void *raw_event); void fl_set_object_prehandler(FL_OBJECT *, FL_HANDLEPTR prehandler); @end example @noindent where @code{event} is the generic event in the Forms Library, that is, @code{FL DRAW}, @code{FL ENTER} etc. The arguments @code{mx} and @code{my} are the mouse position and @code{key} is the key pressed. The last parameter, @code{raw_event} is a pointer to the XEvent that caused the invocation of the pre-handler. cast to a void pointer. Notice that the pre-handler has the same function prototype as the built-in handler. Actually they are called with the exact same parameters by the event dispatcher. The prehandler should return @code{0} if the processing by the built-in handler should continue. A return value of @code{FL PREEMPT} will prevent the dispatcher from calling the built-in handler. See demo program @file{preemptive.c} for an example. A similar mechanism exists for registering a post-handler, i.e., a handler invoked after the built-in handler is finished, by using @findex fl_set_object_posthandler() @example void fl_set_object_posthandler(FL_OBJECT *, FL_HANDLEPTR prehandler); @end example @noindent Whenever possible a post-handler should be used instead of a pre-handler. @node Other @section Other As stated earlier, @code{@ref{fl_set_defaults()}} can be used to modify the Forms Library's defaults prior to calling @code{@ref{fl_initialize()}}. Actually, this routine can also be used after @code{@ref{fl_initialize()}} to override the values set on the command line or in the application databases. However, overriding users' preferences should be done with discretion. Further, setting @code{privateColormap} after @code{@ref{fl_initialize()}} has no effect. xforms-1.2.4/doc/part1.texi0000644000175000017500000000034711665175504012462 00000000000000@node Part I @unnumbered @emph{Part I - Using the Forms Library} @menu * Part I Introduction:: * Part I Getting Started:: * Part I Defining Forms:: * Part I Doing Interaction:: * Part I Free Objects:: * Part I Goodies:: @end menu xforms-1.2.4/doc/part3_deprecated_objects.texi0000664000175000017500000015522112337325620016352 00000000000000@node Part III Deprecated Objects @chapter Deprecated Objects In this chapter describes object types that have been replaced by newer ones. But they will remain part of XForms and also can be used in new programs. But there probably will be not more support for these objects than bug fixes etc. @ifnottex @menu * Choice Object: Choice Object * Menu Object: Menu Object * XPopup: XPopup @end menu @end ifnottex @node Choice Object @section Choice Object A choice object is an object that allows the user the choose among a number of choices. The current choice is shown in the box of the choice object. The user can either cycle through the list of choices using the middle or right mouse button or get the list as a menu using the left mouse button. @ifnottex @menu * Adding Choice Objects: Adding Choice Objects * Choice Types: Choice Types * Choice Interaction: Choice Interaction * Other Choice Routines: Other Choice Routines * Choice Attributes: Choice Attributes * Remarks: Choice Remarks @end menu @end ifnottex @node Adding Choice Objects @subsection Adding Choice Objects To add a choice object to a form use the routine @findex fl_add_choice() @anchor{fl_add_choice()} @example FL_OBJECT *fl_add_choice(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent It shows a box on the screen with the label to the left of it and the current choice (empty in the beginning), centered in the box. @node Choice Types @subsection Choice Types The following types are available: @table @code @tindex FL_NORMAL_CHOICE @anchor{FL_NORMAL_CHOICE} @item FL_NORMAL_CHOICE Middle/right mouse button shortcut. @tindex FL_NORMAL_CHOICE2 @anchor{FL_NORMAL_CHOICE2} @item FL_NORMAL_CHOICE2 Same as @code{FL_NORMAL_CHOICE} except drawn differently. @tindex FL_DROPLIST_CHOICE @anchor{FL_DROPLIST_CHOICE} @item FL_DROPLIST_CHOICE Menu is activated only by pressing and releasing the mouse on the arrow. @end table @node Choice Interaction @subsection Choice Interaction Beside simply opening up the popup behind the choice object and selecting an entry with the left mouse button you can also use the middle and right mouse buttons and the scroll wheel: a short click with the middle mouse button selects the entry before the currently selected one, a click with the right mouse button the next. Keeping the middle or right mouse button pressed down slowly cycles trough the entries, backward or forward. The same can be down with the sroll wheel. In both cases, whenever a choice entry is selected (even when it is the original one) the object is returned to the application program. But you can control the condition under which the choice object gets returned to the application by using the function @example int fl_set_object_return(FL_OBJECT *obj, unsigned int when) @end example where @code{when} can have the following values @table @code @item @ref{FL_RETURN_NONE} Never return or invoke callback. @item @ref{FL_RETURN_END_CHANGED} Return or invoke callback if end of interaction and selection of an item coincide. @item @ref{FL_RETURN_CHANGED} Return or invoke callback whenever an item is selected (this is the default). @item @ref{FL_RETURN_END} Return or invoke callback on end of an interaction. @item @ref{FL_RETURN_ALWAYS} Return (or invoke callback) whenever the interaction ends and/or an item is selected. @end table @node Other Choice Routines @subsection Other Choice Routines There are a number of routines to change the list of possible choices. To add a line to a choice object use @findex fl_addto_choice() @anchor{fl_addto_choice()} @findex fl_addto_choice_f() @anchor{fl_addto_choice_f()} @example int fl_addto_choice(FL_OBJECT *obj, const char *text); int fl_addto_choice_f(FL_OBJECT *obj, const char *fmt, ...); @end example @noindent The function returns the number of the new item. The items in the list are numbered in the order in which they were inserted. The first item has number 1, etc. The two functions differ in that the first one accepts just a simple string while for the second the text is assembled from a format string as used by @code{printf()} etc. and the following arguments. Note that, because a choice object uses a popup, the string passed with @code{@ref{fl_addto_choice()}} cann also contain some additional information not directly shown in the entries text. E.g., you can create several entries as once if the string you pass to @code{@ref{fl_addto_choice()}} contains @code{'|'} characters - these aren't shown but instead are treated as separators between the strings for the entries. Some extra control sequences, starting with the character @code{'%'} can also be embedded (@pxref{Creating XPopups}), thus a literal @code{'%'} in a string must be escaped by doubling it. To delete a line use: @findex fl_delete_choice() @anchor{fl_delete_choice()} @example void fl_delete_choice(FL_OBJECT *obj, int line); @end example Whenever the application program wants to clear the complete list of choices it should use the routine @findex fl_clear_choice() @anchor{fl_clear_choice()} @example void fl_clear_choice(FL_OBJECT *obj) @end example One can also replace a line using @findex fl_replace_choice() @anchor{fl_replace_choice()} @findex fl_replace_choice_f() @anchor{fl_replace_choice_f()} @example void fl_replace_choice(FL_OBJECT *obj, int line, const char *text); void fl_replace_choice(FL_OBJECT *obj, int line, const char *fmt, ...); @end example @noindent (The second function assembles the new text from a format string as used for @code{printf()} etc. and the following arguments.) To obtain the currently selected item in the choice object use the call @findex fl_get_choice() @anchor{fl_get_choice()} @example int fl_get_choice(FL_OBJECT *obj); @end example @noindent The function returns the number of the current choice (0 if there is no choice). You can also obtain the text of the currently selected choice item using the call @findex fl_get_choice_text() @anchor{fl_get_choice_text()} @example const char *fl_get_choice_text(FL_OBJECT *obj); @end example @noindent @code{NULL} is returned when there is no current choice. To obtain the text of an arbitrary choice item, use the following routine @findex fl_get_choice_item_text() @anchor{fl_get_choice_item_text()} @example const char *fl_get_choice_item_text(FL_OBJECT *obj, int n); @end example To obtain the total number of choice items, use the following function @findex fl_get_choice_maxitems() @anchor{fl_get_choice_maxitems()} @example int fl_get_choice_maxitems(FL_OBJECT *obj); @end example One can set various attributes of an item using the following routine @findex fl_set_choice_item_mode() @anchor{fl_set_choice_item_mode()} @example void fl_set_choice_item_mode(FL_OBJECT *obj, int numb, int mode); @end example @noindent Here @code{mode} is the same as that used for menu objects (see above). See also @ref{XPopup}, for details. To find about those settings use @findex fl_get_choice_item_mode() @anchor{fl_get_choice_item_mode()} @example int fl_get_choice_item_mode(FL_OBJECT *obj, int numb); @end example You can use the follow routine to populate a choice object at once, including mode and shortcut, by using @findex fl_set_choice_entries() @anchor{fl_set_choice_entries()} @example int fl_set_choice_entries(FL_OBJECT *obj, FL_PUP_ENTRY *entries); @end example @noindent where @code{entries} is a pointer to a @code{FL_PUP_ENTRY} structure (terminated by a @code{NULL} text field) as already described above for the function @code{@ref{fl_set_menu_entries()}}. Also see @ref{XPopup}, for more details. Please note that for choice objects no nested entries are permitted and the item callback functions are ignored. The function returns the number of items added to the choice object. Finally, the application program can set the currently selected entry of the choice using a call of @findex fl_set_choice() @anchor{fl_set_choice()} @findex fl_set_choice_text() @anchor{fl_set_choice_text()} @findex fl_set_choice_text_f() @anchor{fl_set_choice_text_f()} @example void fl_set_choice(FL_OBJECT *obj, int line); void fl_set_choice_text(FL_OBJECT *obj, const char *txt) void fl_set_choice_text_f(FL_OBJECT *obj, const char *fmt, ...) @end example @noindent where @code{txt} (for @code{fl_set_choice_text()} or the text resulting from the expansion of the @code{printf()}-compatible format string and the following arguments for @code{fl_set_choice_text_f()} must must be the text of exactly one of the choice items. For example, after the following choice is created @example fl_addto_choice(obj,"item1|item2|item3"); @end example @noindent You can select the second item by using any of the following lines @example fl_set_choice(obj, 2); fl_set_choice_text(obj, "item2"); fl_set_choice_text_f(obj, "item%d", 2 ); @end example @node Choice Attributes @subsection Choice Attributes Don't use @code{FL_NO_BOX} as the boxtype for a choice object. The first color argument (@code{col1} to @code{@ref{fl_set_object_color()}} controls the color of the box and the second (@code{col2}) the color of the text in the box. The current choice by default is shown centered in the box. To change the alignment of the choice text in the box, use the following routine @findex fl_set_choice_align() @anchor{fl_set_choice_align()} @example void fl_set_choice_align(FL_OBJECT *obj, int align); @end example To set the font size used inside the choice object use @findex fl_set_choice_fontsize() @anchor{fl_set_choice_fontsize()} @example void fl_set_choice_fontsize(FL_OBJECT *obj, int size); @end example To set the font style used inside the choice object use @findex fl_set_choice_fontstyle() @anchor{fl_set_choice_fontstyle()} @example void fl_set_choice_fontstyle(FL_OBJECT *obj, int style); @end example Note that the above functions only change the font inside the choice object, not the font used in the popup. To change the font used in the popup, use the XPopup functions @code{@ref{fl_setpup_default_fontsize()}} and @code{@ref{fl_setpup_default_fontstyle()}}. Note that these functions influence the font settings of all popups! @xref{Label Attributes and Fonts}, for details on font sizes and styles. Normally the pop-up shown for the choice objects will be displayed at the current mouse position or, for those of type @code{@code{FL_DROPLIST_CHOICE}}, directly below the choice object. This can be modified by a call of the function @findex fl_set_choice_align_bottom() @anchor{fl_set_choice_align_bottom()} @example int fl_set_choice_align_bottom(GL_OBJECT *obj, int flag); @end example @noindent If @code{flag} is @code{0} the normal behaviour is used, but when @code{flag} is @code{1} the popup will be displayed with its lower right hand corner at the current mouse position or, for objects of type @code{@code{FL_DROPLIST_CHOICE}} above the choise object. The function returns the previously set value for @code{flag}. @node Choice Remarks @subsection Remarks See @file{choice.c} for an example of the use of choice objects. @node Menu Object @section Menu Object Also menus can be added to forms. These menus can be used to let the user choose from many different possibilities. Each menu object has a box with a label in it in the form. Whenever the user presses the mouse inside the box (or moves the mouse on top of the box) a pop-up menu appears. The user can then make a selection from the menu. @ifnottex @menu * Adding Menu Objects: Adding Menu Objects * Menu Types: Menu Types * Menu Interaction: Menu Interaction * Other Menu Routines: Other Menu Routines * Menu Attributes: Menu Attributes * Remarks: Menu Remarks @end menu @end ifnottex @node Adding Menu Objects @subsection Adding Menu Objects To add a menu to a form use the routine @findex fl_add_menu() @anchor{fl_add_menu()} @example FL_OBJECT *fl_add_menu(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent It shows a box on the screen with the label centered in it. @node Menu Types @subsection Menu Types The following types are available: @table @code @tindex FL_PUSH_MENU @anchor{FL_PUSH_MENU} @item FL_PUSH_MENU The menu appears when the user presses a mouse button on it. @tindex FL_PULLDOWN_MENU @anchor{FL_PULLDOWN_MENU} @item FL_PULLDOWN_MENU The menu appears when the user presses a mouse button on it. @tindex FL_TOUCH_MENU @anchor{FL_TOUCH_MENU} @item FL_TOUCH_MENU The menu appears when the user move the mouse inside it. @end table @code{FL_PUSH_MENU} and @code{FL_PULLDOWN_MENU} behave rather similar. When you click on a @code{FL_PUSH_MENU} per default a pop-up window gets opened on top of the @code{FL_PUSH_MENU} menu's box that has a label at the top, indicating the currently selected menu item. The pop-up window stays open until you either select an item or press a mouse button somewhere outside the pop-up window. When you click on @code{FL_PULLDOWN_MENU} also a pop-up window is shown, but directly below the menu's box. This pop-up window has no label and it only stays open until you release the mouse button. @code{FL_PUSH_MENU} and @code{FL_PULLDOWN_MENU} can be made even more similar by using the @code{@ref{fl_set_menu_notitle()}} function (see below). This changes it's properties so that the pop-up window also appears below the menu's box and that no label is shown in the pop-up window. The only remaining difference then is that a @code{FL_PUSH_MENU} only gets closed when a menu item is selected or the user presses the mouse outside of the pop-up window while a @code{FL_PULLDOWN_MENU} also gets closed when the mouse button is released. @node Menu Interaction @subsection Menu Interaction When the menu appears the user can make a selection using the left mouse button or make no selection by clicking outside the menu (or by simply releasing the mouse button in case of a @code{FL_PULLDOWN_MENU} type menu. Normally when he makes a selection the menu object is returned by the interaction routines. You can control the condition under which the menu object gets returned to the application by using the function @example int fl_set_object_return(FL_OBJECT *obj, unsigned int when) @end example where @code{when} can have the following values @table @code @item @ref{FL_RETURN_NONE} Never return the object or invoke its callback. @item @ref{FL_RETURN_END_CHANGED} Return or invoke callback if end of interaction and selection of an item coincide (this is the default for all menu objects except those of type @code{FL_TOUCH_MENU}). @item @ref{FL_RETURN_CHANGED} Return or invoke callback whenever an item is selected (this is the default for all menu objects of type @code{FL_TOUCH_MENU}). @item @ref{FL_RETURN_END} Return or invoke callback on end of an interaction. @item @ref{FL_RETURN_ALWAYS} Return (or invoke callback) whenever the interaction ends and/or an item is selected. @end table @node Other Menu Routines @subsection Other Menu Routines There are two ways to populate a menu, i.e., add items. The first one is a bit more complex but allows for more flexibility, e.g., later adding and removing items, associating callbacks with individual items etc. For the more simple (and in many cases sufficient) method see the function @code{@ref{fl_set_menu_entries()}}. To set the actual menu for a menu object, use the routine @findex fl_set_menu() @anchor{fl_set_menu()} @example void fl_set_menu(FL_OBJECT *obj, const char *menustr, ...); @end example @noindent @code{menustr} describes the menu in the form used by XPopups (@pxref{XPopup}). In the simplest case it just contains the texts for the menu items, separated by a bar (@code{'|'}), e.g., @code{"First|Second|Third"}. But it's also possible to employ special tags (@pxref{Creating XPopups}) that can be used to indicate special attributes (radio, toggle and greyed-out, for example). For this usage the unspecified arguments (the @code{...} in the function call) can be used t add neceassary information. Whenever the user selects a menu item, a pointer to the menu object it belongs to is returned to the application program. Please note that if you call @code{@ref{fl_set_menu()}} on a menu that already contains items the existing items are replaced by the new ones - the function calls @code{@ref{fl_clear_menu()}} internally before the new items are added. If you explicitely assign a menu item ID to a menu, using the special tag @code{%x}, it is your responsibility to make sure that this ID isn't already used by a different menu item in the same menu. Failure to do so may make it impossible to use the menu properly. All functions working on items expect the menu item ID as one of their arguments. Also note that only values that fit into a @code{char} can be used, so the range is restricted to the interval @w{@code{[-128, 127]}} on most machines with a signed @code{char} type and to @w{@code{[0, 255]}} on those with an unsigned @code{char} type. For portability reasons it's thus to be recommended to restrict the range to @w{@code{[0, 127]}}. In case you don't set menu item IDs they are assigned automatically with the first item obtaining the menu item ID 1, the next 2 etc., i.e., it directly reflects the position of the item in the menu. It is also possible to add menu items to an existing menu using a call of @findex fl_addto_menu() @anchor{fl_addto_menu()} @example int fl_addto_menu(FL_OBJECT *obj, const char *menustr, ...); @end example @noindent where @code{menustr} is a string of the same form as used in @code{@ref{fl_set_menu()}} (you can add one or more new menu items this way). Also routines exist to delete a particular menu item or change it: @findex fl_delete_menu_item() @anchor{fl_delete_menu_item()} @findex fl_replace_menu_item() @anchor{fl_replace_menu_item()} @example void fl_delete_menu_item(FL_OBJECT *obj, int miid); void fl_replace_menu_item(FL_OBJECT *obj, int miid, const char *menustr, ...); @end example @code{miid} is the menu item ID. @code{menustr} must be a string as used in @code{@ref{fl_set_menu()}} with the only difference that only a single menu item can be specified. Please note: when deleting a menu item all other items keep their menu item IDs. The menu item ID of the deleted menu item isn't re-used when new items are added later. Instead for each menu an internal counter exists that gets incremented for each menu item added and which value is used for the menu item ID unless one is explicitely assigned to the menu item. The counter oly gets reset to 1 when the menu is cleared used @code{@ref{fl_clear_menu()}}. The menu item ID of a menu item changed by using @code{@ref{fl_replace_menu_item()}} does not change unless the library is explicitely asked to via @code{%x} in @code{menustr}. For most applications, the following routine may be easier to use at the expense of somewhat restrictive value a menu item can have as well as a loss of the ability to delete menu items or associate callbacks with menu items. @findex fl_set_menu_entries() @anchor{fl_set_menu_entries()} @example int fl_set_menu_entries(FL_OBJECT *obj, FL_PUP_ENTRY *ent); @end example @noindent where @code{ent} is a pointer to an array of structure of the following type, terminated by an element, where at least the @code{text} member is a @code{NULL} pointer: @tindex FL_PUP_ENTRY @example typedef struct @{ const char *text; FL_PUP_CB callback; const char *shortcut; int mode; @} FL_PUP_ENTRY; @end example The meaning of each member is explained in Section 21.3. For menus, item callback function can be @code{NULL} if the menu callback handles the interaction results. See demo program @file{popup.c} for an example use of @code{@ref{fl_set_menu_entries()}}. The function @code{@ref{fl_set_menu_entries()}} works by creating and associating a popup menu with the menu object. The popup ID is returned by the function. Whenever the function is called, the old popup associated with the object (if one exists) is freed and a new one is created. Although you can manipulate the menu either through the menu API (but adding and removing menu items is not supported for menus created this way ) or popup API, the application should not free the popup directly and use @code{@ref{fl_clear_menu()}} instead. To clear the whole menu use @findex fl_clear_menu() @anchor{fl_clear_menu()} @example void fl_clear_menu(FL_OBJECT *obj); @end example To find the menu item selected by the user use @findex fl_get_menu() @anchor{fl_get_menu()} @example int fl_get_menu(FL_OBJECT *obj); @end example @noindent The the function returns the menu item ID. In the simplest possible case this is just the position of the menu item (starting at 1). This stops to be true when either IDs have been explicitely assigned to items or items have been deleted. In that case the following rules apply: @enumerate @item A menu item ID may have been assigned to a menu item using @code{%xn} in the string for the text of the menu item. @item Menu items can get associated with a callback function that is executed when the menu item is selected. The callback function is of type @code{@ref{FL_PUP_CB}} and receives the menu item ID of the selected menu. If such a callback is set for a menu item the return value of @code{@ref{fl_get_menu()}} is the return value of this function instead of the menu item ID that would have been returned otherwise. @end enumerate To obtain the text of any item, use the following routine @findex fl_get_menu_item_text() @anchor{fl_get_menu_item_text()} @example const char *fl_get_menu_item_text(FL_OBJECT *obj, int miid); @end example @noindent where @code{miid} is the menu item ID. If @code{n} isn't a valid menu iem ID item @code{NULL} is returned. To obtain the text of the selected enu item use @findex fl_get_menu_text() @anchor{fl_get_menu_text()} @example const char *fl_get_menu_text(FL_OBJECT *obj); @end example To obtain the total number of menu items, use the function @findex fl_get_menu_maxitems() @anchor{fl_get_menu_maxitems()} @example int fl_get_menu_maxitems(FL_OBJECT *obj); @end example One can change the appearance of different menu items. In particular, it is sometimes desirable to make grey-out menu items and make them unselectable or to put boxes with and without checkmarks in front of them. This can be done using the routine: @findex fl_set_menu_item_mode() @anchor{fl_set_menu_item_mode()} @example void fl_set_menu_item_mode(FL_OBJECT *obj, int miid, unsigned mode); @end example @noindent @code{miid} is the menu index ID of the memu item you want to change. @code{mode} represents the special properties you want to apply to the chosen item. You can specify more than one at a time by adding or bitwise OR-ing these values together. For this parameter, the following symbolic constants exist: @table @code @tindex FL_PUP_NONE @anchor{FL_PUP_NONE} @item FL_PUP_NONE No special display characteristic, the default. @tindex FL_PUP_BOX @anchor{FL_PUP_BOX} @item FL_PUP_BOX "Binary" entry, i.e., an entry that stands for a choice that can be switched on and off. Displayed with an unchecked box to the left. @tindex FL_PUP_RADIO @anchor{FL_PUP_RADIO} @item FL_PUP_RADIO "Radio" item belonging to a group, so that gets automatically switched off when another item of the group is selected. Displayed with a diamoned-shaped box at the left. @tindex FL_PUP_GREY @anchor{FL_PUP_GREY} @item FL_PUP_GREY To be OR-ed with one of the above to make that item appear greyed-out and disable it (i.e., not selectable anymore). @tindex FL_PUP_CHECK @anchor{FL_PUP_CHECK} @item FL_PUP_CHECK To be OR-ed with one of @code{FL_PUP_BOX} and @code{FL_PUP_RADIO} to make the box to the left appear checked or pushed. @end table There is also a routine that can be used to obtain the current mode of an item after interaction, mostly useful for toggle or radio items: @findex fl_get_menu_item_mode() @anchor{fl_get_menu_item_mode()} @example unsigned int fl_get_menu_item_mode(FL_OBJECT *obj, int miid); @end example While a callback associated with a menu entry can be set when it is created it can also set later on or be changed. For this use the function @findex fl_set_menu_item_callback() @anchor{fl_set_menu_item_callback()} @example FL_PUP_CB fl_set_menu_item_callback(FL_OBJECT *ob, int numb, FL_PUP_CB cb); @end example @noindent where @code{numb} is the menu entries ID and @code{cb} is the callback function of type @code{@ref{FL_PUP_CB}} (or @code{NULL} to disable a callback). The return value is a pointer to the previously used callback function (or @code{NULL}). It is often useful to define keyboard shortcuts for particular menu items. For example, it would be nice to have @code{s} behave like selecting "Save" from a menu. This can be done using the following routine: @findex fl_set_menu_item_shortcut() @anchor{fl_set_menu_item_shortcut()} @example void fl_set_menu_item_shortcut(FL_OBJECT *obj, int miid, const char *str); @end example @noindent @code{miid} is the menu item ID of the menu item under consideration. @code{str} contains the shortcut for the item. (Actually, it can contain more shortcuts for the same item.) @xref{Shortcuts}, for more information about shortcuts. Finally there is the routine: @findex fl_show_menu_symbol() @anchor{fl_show_menu_symbol()} @example void fl_show_menu_symbol(FL_OBJECT *obj, int yes_no); @end example @noindent With this routine you can indicate whether to show a menu symbol at the right of the menu label. By default no symbol is shown. @node Menu Attributes @subsection Menu Attributes Any boxtype can be used for a menu except for those of type @code{FL_PULLDOWN_MENU}, for which @code{FL_NO_BOX} should not be used. Using the functiond The first color argument (@code{col1}) to @code{@ref{fl_set_object_color()}} controls the color of the menu's box when not open and the second (@code{col2}) is the color when the menu is shown. To change the font style and size used in the popup menus (not the menu label), use the following routines @findex fl_setpup_default_fontstyle() @findex fl_setpup_default_fontsize() @example void fl_setpup_default_fontstyle(int style); void fl_setpup_default_fontsize(int size); @end example @noindent These settings apply to all menus at once. If desired, you can attach an external popup to a menu object via the following routine @findex fl_set_menu_popup() @anchor{fl_set_menu_popup()} @example void fl_set_menu_popup(FL_OBJECT *obj, int pupID); @end example @noindent where @code{pupID} is the ID returned by @code{@ref{fl_newpup()}} or @code{@ref{fl_defpup()}}. @xref{XPopup}, for more details on popup creation. For a menu created this way only @code{@ref{fl_get_menu()}} and @code{@ref{fl_get_menu_text()}} work as expected. Other services such as mode setting and query etc. should be done via the popup routines. To obtain the popup ID associated with a menu, use the following routine @findex fl_get_menu_popup() @anchor{fl_get_menu_popup()} @example int fl_get_menu_popup(FL_OBJECT *obj); @end example @noindent The function returns the popup ID if the menu was created using @code{@ref{fl_set_menu_popup()}} or @code{@ref{fl_set_menu_entries()}}, otherwise it returns -1. The callback associated with a menu Normally in the popup opened for a menu a title is shown. This can be switched off (and back on again by using the function @findex fl_set_menu_notitle() @anchor{fl_set_menu_notitle()} @example fl_set_menu_notitle(FL_OBJECT *obj, int off); @end example @node Menu Remarks @subsection Remarks See @file{menu.c} for an example of the use of menus. You can also use @code{FL_MENU_BUTTON} to initiate a callback and use an XPopup directly within the callback. See @file{pup.c} for an example of this approach. @node XPopup @section XPopup XPopup is not really an object class, but because it is used by menu and choice objects and can function stand-alone, it is documented here. XPopups are simple transient windows that show a number of choices the user can click on to select the desired option. @ifnottex @menu * Creating XPopups: Creating XPopups * XPopup Interaction: XPopup Interaction * Other XPopup Routines: Other XPopup Routines * XPopup Attributes: XPopup Attributes * Remarks: XPopup Remarks @end menu @end ifnottex @node Creating XPopups @subsection Creating XPopups To define a new popup, use the following routines @findex fl_newpup() @anchor{fl_newpup()} @findex fl_defpup() @anchor{fl_defpup()} @example int fl_newpup(Window parent); int fl_defpup(Window parent, const char *str, ...); @end example @noindent Both functions allocate and initialize a new popup menu and return the XPopup identifier (or -1 on failure). @code{@ref{fl_defpup()}} in addition accepts a pointer @code{str} to the texts for menu items (optionally also some more arguments, see below). More than one item can be specified by using a vertical bar (@code{|}) between the items, e.g., @code{"foo|bar"} adds two menu items. The @code{parent} parameter specifies the window to which the XPopup belongs. In a situation where the XPopup is used inside an object callback @code{FL_ObjWin(obj)} will do. If @code{parent} is @code{None} the root window will be used. Calling @code{@ref{fl_defpup()}} with the @code{str} argument set to @code{NULL} is equivalent to calling @code{@ref{fl_newpup()}}. It is possible to specify XPopup and item properties, such as shortcuts, callbacks etc., together with the items texts using a format string system similar as used for e.g., @code{oprint(3)}. If XPopup or item properties require arguments, they must be passed to @code{@ref{fl_defpup()}} following the @code{str} argument. The following item properties are supported: @table @code @item %t Marks the item text as the XPopup title string. @item %F Binds a callback function to the XPopup as a whole that is called for every selection made from this XPopup. You must specify the function to be invoked in the parameters following @code{str}. The value of the selected item is passed as the only argument to the invoked callback function. The callback function must return a non-negative integer. If such a callback function has been registered for a XPopup and you select its third item, in the simplest case 3 will be passed as a parameter to the callback function (more complicated situations would involve that the item had been assigned a different value. e.g., using @code{%x}, see below, or that there's also a callback bound to the item itself, in which case the global XPopup callback would receive the return value of the items callback function). @item %f Binds a callback to this particular item which is invoked if the item is selected. The routine must be supplied in the parameters following @code{str}. It has to return a non-negative integer. The value of the selected item is passed as a parameter to this function. If you have also bound the entire XPopup to a callback function via @code{%F}, then the function specified via @code{%f} is called first with the items value and its return value (if larger then @code{0} is then passed as the parameter to to the function bound to the whole XPopup (as set via @code{%F}). @item %i Disables and greys-out the item. @code{%d} can be used instead of @code{%i}. @item %l Adds a line under the current entry. This is useful in providing visual clues to groups of entries @item %m Whenever this item is selected another (already defined) XPopup is bound to the item so that the sub-XPopup is opened when the user moves the mouse onto the item, This can be used to create cascading menus. The identifier of the sub-XPopup to be shown must be provided in the arguments following @code{str}. It is the programmers responsibility to make sure that the item values of the sub-XPopup don't clash with those of the higher-level XPopup or it may be impossible to determine which item was selected. @item %h Specify a "hotkeys" that can be used to select this item. Hotkeys must be given in the arguments following @code{str} as a pointer to a string. Use @code{#} to specify that a key must be pressed together with the @code{} key, @code{^} for simultaneous pressing of @code{} and @code{&n} for the function key @code{Fn}. @code{%s} can be used instead of @code{%h}. @item %xn Assigns a numerical value to this item. This value must be positive. This new value overrides the default position-based value assigned to this item. Different from most other flags, the value @code{n} must be entered as part of the text string (i.e., do not try to use the arguments following @code{str} to specify this value!) and must be number larger than 0. It is the programmers responsibility to make sure that the items value does not clash with those of other items of the XPopup or determining which item was selected may be impossible. @item %b Indicates this item is "binary item" (toggle), currently in off state. When displayed, binary items will be drawn with a small box to the left. See also @code{FL_PUP_BOX}. @item %B Same as @code{%b} except that it also signifies that this item is in on or "true" state and consequently is drawn with a checked box on the left. See also @code{FL_PUP_BOX | FL_PUP_CHECK}. @item %rg Specifies this menu item is a "radio item" belonging to group with number @code{g}, currently not being selected. The group number @code{g}, that must be part of the string directly following @code{%r} (and not specified via the arguments following the string), must be a non-zero, positive number. Radio items are drawn with a small diamond box to the left (empty while not active). See also @code{FL_PUP_RADIO}. @item %Rg Same as @code{%rg} except that it also sets the state of the radio item as selected or "pushed", the item is drawn with a filled diamond box to the left. See also @code{@ref{fl_setpup_selection()}}. See also @code{FL_PUP_RADIO | FL_PUP_CHECK}. @item %% Use this if you need a @code{%} character in the string. @item H (@code{\010}) Same as @code{%l} except that the character must precede the item label, i.e., use @code{"\010Abc"} and not @code{"Abc\010"}. @end table Due to the use of variable arguments error checking can only be minimal. Also note that if @code{%x} is used to specify a value that happens to be identical to a position-based value, the result is unpredictable when subsequent references to these items are made. There is currently a limit of @tindex FL_MAXPUPI @code{FL_MAXPUPI} (64) items per popup. Tabs characters (@code{'\t'}) can be embedded in the item string to align different fields. You can add more items to an existing XPopup using the following routine @findex fl_addtopup() @anchor{fl_addtopup()} @example int fl_addtopup(int popup_id, const char *str, ...); @end example @noindent where @code{popup_id} is the value returned by @code{@ref{fl_newpup()}} or @code{@ref{fl_defpup()}} for the XPopup. Again, @code{str} can contain information for one or more new items, including the special sequences described earlier. The function returns -1 if invalid arguments are detected (as far as possible for a function with a variable number of arguments). To display a popup, use @findex fl_dopup() @anchor{fl_dopup()} @example int fl_dopup(int popup_id); @end example @noindent This function displays the specified XPopup until the user makes a selection or clicks somewhere outside of the XPopups box. The value returned is the value of the item selected or -1 if no item (or a disabled one) was selected. However, if there is a function bound to the XPopup as a whole or to the selected item itself, this function is invoked with the item value as the argument and the value returned by @code{@ref{fl_dopup()}} is then the return value of this function. If a callback function for both the selected item and the XPopup as a whole exists, the callback function for the item is called first with the item value as the argument and then the return value of this item specific callback function is passed to the XPopups callback function. @code{@ref{fl_dopup()}} then finally returns the return value of this second function call. Normally a XPopup get opened when the left mouse button has been pressed down and get closed again when the left mouse button is released. But there are a number of ways to achieve a "hanging" XPopup, i.e., that the XPopup that says open, even though the left mouse button isn't pressed down anymore. This happens e.g., when the user releases the mouse button in the title area of the XPopup or when the XPopup was opened via a keyboard shortcut. In that case it's also possible to navigate through the items and select via the keyboard. A typical procedure may look as follows: @example int item3_cb(int n) @{ return n + 7; @} /* define the menu */ int menu = fl_newpup(parent); fl_addtopup(menu, "Title %t|Item1%rg1|Item2%Rg1|Item3%x10%f|Item4", item3_cb); switch (fl_dopup(menu)) @{ case 1: /* item1 is selected */ /* handle it */ break; case 2: /* handle it */ break; case 4: /* handle it */ case 17: /* item 3 call back has been executed */ @} @end example @noindent Here callback function @code{item3_cb()} is bound to the third item and this item has been assigned the number 10. Thus, when it is selected @code{@ref{fl_dopup()}} does not return 3 or 10. Instead the callback function @code{item3_cb()} is invoked with 10 as its argument. And this function in turn returns @code{10 + 7}, which is the value @code{@ref{fl_dopup()}} finally returns. Note also that items 1 and 2 both are radio items, belonging to the same group (numbered 1). Item 2 is currently the active item of this group. Sometimes it might be necessary to obtain the popup ID inside an item callback function. To this end, the following function available: @findex fl_current_pup() @anchor{fl_current_pup()} @example int fl_current_pup(void); @end example @noindent If no popup is active, the function returns -1. Until all callback functions have been run the function returns the ID of the XPopup the items belong to. To destroy a popup menu and release all memory used, use the following routine @findex fl_freepup() @anchor{fl_freepup()} @example void fl_freepup(int popup_id); @end example For most applications, the following simplified API may be easier to use @findex fl_setpup_entries() @anchor{fl_setpup_entries()} @example void fl_setpup_entries(int popup_id, FL_PUP_ENTRIES *entries); @end example where @code{popup_id} is the popup ID returned by @code{@ref{fl_newpup()}} or @code{@ref{fl_defpup()}} and @code{entries} is an array of the following structures @tindex FL_PUP_ENTRY @example typedef struct @{ const char * item_text; /* item text label */ FL_PUP_CB callback; /* item callback routine */ const char * shortcut; /* shortcut for this item */ unsigned int mode; /* item mode */ @} FL_PUP_ENTRY; @end example @noindent The meaning of each member of the structure is as follows: @table @code @item text This is the text of a XPopup item. If text is @code{NULL}, it signifies the end of this popup menu. The first letter of the text string may have a special meaning if it is one of the following: @table @code @item '/' This indicates the beginning of a sub-popup, starting with the next item and ending with the next item with @code{text} being @code{NULL}. @item '_' Indicates that a line should be drawn below this item (typically as a visual reminder of logical groupings of items). @end table @item callback This is the callback function that will be called when this particular item is selected by the user. @code{@ref{fl_dopup()}} returns the value returned by this callback. If the callback is @code{NULL}, the item number will be returned directly by @code{@ref{fl_dopup()}}. @item shortcut Specifies the keyboard shortcut. @item mode Specifies special attributes of this item. This can be one or a combination by bitwise OR of one of the following: @table @code @tindex FL PUP NONE @item FL PUP NONE No special characteristics, the default. @tindex FL_PUP_GREY @item FL_PUP_GREY Item is greyed-out an can't be selected. Trying to select it results in @code{@ref{fl_dopup()}} returning -1. @tindex FL_PUP_BOX @item FL_PUP_BOX "Binary item", drawn with a little box to its left. @tindex FL_PUP_RADIO @item FL_PUP_RADIO "Radio item", drawn with a little diamond-shaped box to its left. All radio items of the XPopup belong to the same group. @tindex FL_PUP_CHECK @item FL_PUP_CHECK OR this value with @code{FL_PUP_BOX} or @code{FL_PUP_RADIO} to have the box to the left drawn as checked or pushed. @end table @end table With this simplified API, popup item values start from 1 and are the index in the entries array for the item plus 1. For example, the third element (with index 2) of the array of structure has an item value of 3. Please note that also elements of the array that end a submenu and thus don't appear as visible items in the XPopup get counted. This way, the application can relate the value returned by fl_dopup() to the array easily. See demo program @file{popup.c} for an example use of the API. To illustrate the usage of @code{@ref{fl_setpup_entries()}}, Fig 21.2 shows the popup created with the array of structures defined in the following code example: @example FL_PUP_ENTRY entries[ ] = @{ @{"Top item1", callback@}, /* item number 1 */ @{"Top item2", callback@}, @{"Top item3", callback@}, @{"/Top item4", callback@}, @{"Sub1 item1", callback@}, /* item number 5 */ @{"Sub1 item2", callback@}, @{"Sub1 item3", callback@}, @{"Sub1 item4", callback@}, @{"/Sub1 item5", callback@}, @{"Sub2 item1", callback@}, /* item number 10 */ @{"Sub2 item2", callback@}, @{"Sub2 item3", callback@}, @{NULL, NULL @}, /* end of level2, item number 13 */ @{NULL, NULL @}, /* end of sublevel1, item nuber 14 */ @{"Top item5", callback@}, /* item number 15 */ @{NULL, NULL @} /* end of popup */ @}; @end example @node XPopup Interaction @subsection XPopup Interaction To select an item, move the mouse to the item to be selected while keeping the mouse button pressed down and then release the mouse button on top of the item to be selected. If you don't want to make a selection release the mouse button somewhere outside the area of the XPopup. If you have a "hanging" XPopup, i.e., a XPopup that's open even though the mouse button isn't pressed anymore you can select by clicking on an item or use the cursor @code{Up} and @code{Down} keys to navigate through the items and select by pressing the @code{} key. The @code{} and @code{} keys allow you to jump to the first or last selectable item, respectively. Use @code{} to close the popup without selecting an item. It is also possible to use convenience functions to bind keyboard keys to items (the "hotkeys") instead of using @code{%s} with @code{@ref{fl_defpup()}}: @findex fl_setpup_shortcut() @anchor{fl_setpup_shortcut()} @example void fl_setpup_shortcut(int popup_id, int item_val, const char *hotkeys); @end example @noindent where @code{item_val} is the value associated with the item (either due to its position or set with @code{%x}) and hotkeys is a string specifying all the hotkey combinations. @xref{Shortcuts}, for details. Briefly, within that string @code{#} and @code{^} denote the @code{} and @code{} keys, respectively. @code{&n} with @code{n = 1, 2} etc.@: can be used to denote the function key numbered @code{n}. Thus if hotkeys is set to @code{"#a^A}, both @code{A} and @code{A} are bound to the item. One additional property of the hotkey is the underlining of corresponding letters in the item string. Again, only the first key in the hotkey string is used. Therefore, the hotkey strings @code{"Cc"}, @code{"#C"} and @code{"^C"} will result in the character @code{C} in the item string @code{"A Choice"} being underlined, while the the hotkey strings @code{"cC"} and @code{"#c"} will not since there's no @code{c} in the item string. There is a limit of maximum 8 shortcut keys. Two convenience functions are available to set the callback functions for items of a XPopup and the XPopup as a whole (called whenever a selection is made): @tindex FL_PUP_CB @anchor{FL_PUP_CB} @findex fl_setpup_itemcb() @anchor{fl_setpup_itemcb()} @findex fl_setpup_menucb() @anchor{fl_setpup_menucb()} @example typedef int (*FL_PUP_CB)(int); FL_PUP_CB fl_setpup_itemcb(int popup_id, int item_val, FL_PUP_CB cb); FL_PUP_CB fl_setpup_menucb(int popup_id, FL_PUP_CB cb); @end example These functions thus allow to change the popup and item callback functions set at creation of the popup with @code{%F} and @code{%f}. As usual, @code{popup_id} is the ID of the XPopup, @code{item_val} the value associated with the item (position or value set via @code{%x}), and @code{cb} is the address of the callback function. Please note that Xpopup objects are a bit special in XForms. Normal objects get returned by e.g., @code{@ref{fl_do_forms()}} (or an associated callback gets invoked). But since Xpopup objects are meant to be sub-objects of other objects (like @code{FL_CHOICE} and @code{L_MENU} objects) and don't get invoked directly by a call of e.g., @code{@ref{fl_do_forms()}} but instead by a call of @code{@ref{fl_dopup()}} they can't get returned to the application. Instead the caller of @code{@ref{fl_dopup()}} (normally some internal function of a @code{FL_CHOICE} or @code{FL_MENU} object) has to deal with the return value. Furthermore, also callback functions can be set that get invoked whenever an item in the XPopup is entered or left, even without a selection being made. The following functions can be used to register these item enter/leave callbacks: @tindex FL_PUP_ENTERCB @tindex FL_PUP_LEAVECB @findex fl_setpup_entercb() @anchor{fl_setpup_entercb()} @findex fl_setpup_leavecb() @anchor{fl_setpup_leavecb()} @example typedef void (*FL_PUP_ENTERCB)(int item_val, void *data); typedef void (*FL_PUP_LEAVECB)(int item_val, void *data); FL_PUP_ENTERCB fl_setpup_entercb(int popup_id, FL_PUP_ENTERCB cb, void *data); FL_PUP_LEAVECB fl_setpup_leavecb(int popup_id, FL_PUP_LEAVECB cb, void *data); @end example @noindent The function @code{cb} will be called when the mouse enters or leaves an (non-disabled) item of the XPopup @code{popup_id}. Two parameters are passed to the callback function. The first parameter is the item number enter/leave applies to and the second parameter is a data pointer. To remove an enter/leave callback, call the functions with the callback function argument @code{cb} set to @code{NULL}. There is also a function to associate a XPopup item with a sub-XPopup @findex fl_setpup_submenu() @anchor{fl_setpup_submenu()} @example void fl_setpup_submenu(int popup_id, int item_val, int subpopup_id); @end example @noindent If a sub-XPopup is associated with item @code{item_val} that item can't be selected anymore (releasing the mouse button on this item makes @code{@ref{fl_dopup()}} return -1 but instead a new XPopup is opened beside the item and you can now make selections within this sub-XPopup. It is the programmers responsibility to make sure that the item values of the sub-XPopup don't clash with those of the higher-level XPopup or it may be impossible to determine which item was selected. @node Other XPopup Routines @subsection Other XPopup Routines Note that most of the setpup/getpup routines are recursive in nature and the function will search the menu and all its submenus for the item. It is possible to modify the display characteristics of a given XPopup item after its creation using the following routine @findex fl_setpup_mode() @anchor{fl_setpup_mode()} @example void fl_setpup_mode(int popup_id, int item_val, unsigned mode); @end example @noindent As usual @code{popup_id} is the XPopup ID as returned by @code{@ref{fl_newpup()}} or @code{@ref{fl_defpup()}} and @code{item_val} the value of the item. @code{mode} is one of @code{FL PUP NONE}, @code{FL PUP GREY}, @code{FL PUP BOX} or @code{FL PUP RADIO} (one of the later two can be bitwise ORed with @code{FL_PUP_CHECK}, as already discussed above. To obtain the mode of a particular menu item, use the following routine @findex fl_getpup_mode() @anchor{fl_getpup_mode()} @example unsigned int fl_getpup_mode(int popup_id, int item_val) @end example @noindent This comes in handy to check if a binary or radio item is set @example if (fl_getpup_mode(popupd, item_val) & FL_PUP_CHECK) /* item is set */ @end example There exists also a routine that can be used to obtain an items text @findex fl_getpup_text() @anchor{fl_getpup_text()} @example const char *fl_getpup_text(int popup_id, int item_val); @end example In some situations, especially when the popup is activated by non-pointer events (e.g., as a result of a keyboard shortcut), the default placement of popups based on mouse location might not be adequate or appropriate, thus XPopup provides the following routine to override the default placement @findex fl_setpup_position() @anchor{fl_setpup_position()} @example void fl_setpup_position(int x, int y); @end example @noindent where @code{x} and @code{y} specify the location where the top-left corner of the popup should be. @code{x} and @code{y} must be given in screen coordinates (i.e., relative to the root window) with the origin at the top-left corner of the screen. This routine should be used immediately before invoking @code{@ref{fl_dopup()}}, the position is not remembered afterwards. If @code{x} or @code{y} is negative, the absolute value is taken to mean the desired location relative to the right or bottom corner of the popup (not the screen!). Another function exists for controlling the positon of the popup. When the fuunction @findex fl_setpup_align_bottom() @anchor{fl_setpup_align_bottom()} @example void fl_setpup_align_bottom(void); @end example @noindent then the pop-up will appear with its lower right hand corner aligned aligned with the mouse position or, if also @code{@ref{fl_setpup_position()}} is active, the postion set this way will be interpreted to mean the lower right hand position of the popu-up. A radio item in a group can be initialized to be in "pushed" state by using @code{%R}. But you can also switch a such a radio item to "pushed state also programmatically using @findex fl_setpup_selection() @anchor{fl_setpup_selection()} @example void fl_setpup_selection(int popup_id, int item_val); @end example @noindent Of course, other radio items of the XPopup belonging to the same group are reset to "unpushed" state. To obtain the number of items in a popup, use the following routine @findex fl_getpup_items() @anchor{fl_getpup_items()} @example int fl_getpup_items(int popup_id) @end example @node XPopup Attributes @subsection XPopup Attributes The title of a XPopup can be set using the functions @findex fl_setpup_title() @anchor{fl_setpup_title()} @findex fl_setpup_title_f() @anchor{fl_setpup_title_f()} @example void fl_setpup_title(int popup_id, const char *title); void fl_setpup_title_f(int popup_id, const char *fmt, ...); @end example @noindent They only differ in the way the new title is passed to the function, the first one accepts a simple string while the second expects a format string as used for @code{printf()} etc., followed by the appropriate number of (unspecified) arguments. Use the following routines to modify the default popup font style, font size and border width: @findex fl_setpup_default_fontsize() @anchor{fl_setpup_default_fontsize()} @findex fl_setpup_default_fontstyle() @anchor{fl_setpup_default_fontstyle()} @findex fl_setpup_default_bw(); @anchor{fl_setpup_default_bw()} @example int fl_setpup_default_fontsize(int size); int fl_setpup_default_fontstyle(int style); int fl_setpup_default_bw(int bw); @end example @noindent The functions return the old size, style or border width value, respectively. All XPopups by default use a right arrow cursor. To change the default cursor, use @findex fl_setpup_default_cursor() @anchor{fl_setpup_default_cursor()} @example Cursor fl_setpup_default_cursor(int cursor); @end example @noindent where you can use for @code{cursor} any of the standard cursors defined in @code{} like @code{XC_watch} etc. The function returns the previously cursor. To change the cursor of a particular XPopup only , use the following routine @findex fl_setpup_cursor() @anchor{fl_setpup_cursor()} @example Cursor fl_setpup_cursor(int popup_id, int cursor); @end example @noindent For example, after the following sequence, @example id = fl_defpup(win, "item1|item2"); fl_setpup_cursor(id, XC_hand2); @end example @noindent the popup with ID @code{id} will use a "hand" instead of the default arrow cursor. In versions before 1.0.91 XPopups were drawn with a heavy shadow around the box. Drawing of this shadow could be controlled via @findex fl_setpup_shadow() @anchor{fl_setpup_shadow()} @example void fl_setpup_shadow(int popup_id, int yes_no); @end example @noindent Nowadays this function still exists for backward-compatibility but does nothing. The appearance of XPopups (and their associated sub-popups) can be change by the following routines: @findex fl_setpup_bw() @anchor{fl_setpup_bw()} @findex fl_setpup_softedge() @anchor{fl_setpup_softedge()} @example void fl_setpup_bw(int popup_id, int bw); void fl_setpup_softedge(int pupup_id, int yes_no); @end example @noindent The first sets the border width for a XPopup. Calling @code{@ref{fl_setpup_softedge()}} with a true argument for @code{yes_no} has the same effect as using a negative border width while using a false (0) argument is equivalent to using a positive one (so this function isn't very useful). The background color and text color of a popup can be changed using @findex fl_setpup_default_color() @anchor{fl_setpup_default_color()} @example void fl_setpup_default_color(FL_COLOR bgcolor, FL_COLOR tcolor); @end example @noindent By default, the background color @code{bgcolor} is @code{FL_COL1} and the text color @code{tcolor} is @code{FL_BLACK}. For "binary" or radio items, that have check box associated with them, the "checked" or "pushed" color (default is @code{FL_BLUE}) can be changed with the following routine @findex fl_setpup_default_checkcolor() @anchor{fl_setpup_default_checkcolor()} @example void fl_setpup_default_checkcolor(FL_COLOR checkcolor); @end example There is by default a limit of 32 XPopups per process. To enlarge the number of XPopups allowed, use the following routine @findex fl_setpup_maxpups() @anchor{fl_setpup_maxpups()} @example int fl_setpup_maxpups(int new_max); @end example @noindent The function returns the previous limit. It is possible to use XPopups as a message facility using the following routines @findex fl_showpup() @anchor{fl_showpup()} @findex fl_hidepup() @anchor{fl_hidepup()} @example void fl_showpup(int popup_id); void fl_hidepup(int popup_id); @end example @noindent No interaction takes place with a XPopup shown by @code{@ref{fl_showpup()}} and it can only be removed from the screen programmatically via @code{@ref{fl_hidepup()}}. @node XPopup Remarks @subsection Remarks Take care to make sure all items, including the items on submenus, of a XPopup have unique values and are positive. XPopups are used indirectly in the demo programs @file{menu.c}, @file{boxtype.c}, @file{choice.c} and others. For a direct pop-up demo see @file{popup.c}. xforms-1.2.4/doc/part4_global_structure.texi0000644000175000017500000002014412252564473016122 00000000000000@node Part IV Global Structure @chapter Global Structure The Forms Library defines the basic architecture of an object class. This architecture allows different object classes developed by different programmers to work together without complications. The Forms Library consists of a main module and a number of object class modules. The object class modules are completely independent from the main module. So new object class modules can be added without any change (nor recompilation) of the main module. The main module takes care of all the global bookkeeping and the handling of events. The object class modules have to take care of all the object specific aspects, like drawing the object, reacting to particular types of user actions, etc. For each class there exists a file that contains the object class module. For example, there are files @file{slider.c}, @file{box.c}, @file{text.c}, @file{button.c}, etc. The main module communicates with the object class modules by means of events (messages if you prefer). Each object has to have a handle routine known to the main module so that it can be called whenever something needs to be done. One of the arguments passed to the handle routine is the type of event, e.g., @code{FL_DRAW}, indicating that the object needs to be redrawn. Each object class consists of two components. One component, both its data and functions, is common to all object classes in the Forms Library. The other component is specific to the object class in question and is typically opaque. So for typical object classes, there should be routines provided by the object class to manipulate the object class specific data. Since C lacks inheritance as a language construct, inheritance is implemented in the Forms Library by pointers and the global function @code{@ref{fl_make_object()}}@footnote{There are other ways to simulate inheritance, such as including a pointer to generic objects as part of the instance specific data.}. It is helpful to understand the global architecture and the object-oriented approach of the Forms Library, it makes reading the C code easier and also adds perspective on why some of the things are implemented the way they are. In this chapter it is assumed that we want to create a new class with the name @code{NEW}. Creating a new object class mainly consists of writing the handle routine. There also should be a routine that adds an object of the new class to a form and associates the handle routine to it. This routine should have the following basic form: @example FL_OBJECT *fl_add_NEW(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example This routine must add an object of class @code{NEW} to the current form. It receives the parameters @code{type}, indicating the type of the object within the class (see below), @code{x}, @code{y}, @code{w}, and @code{h}, indicating the bounding box of the object in the current active units (mm, point or pixels), and @code{label} which is the label of the object. This is the routine the programmer uses to add an object of class @code{NEW} to a form. See below for the precise actions this routine should take. One of the tasks of @code{fl_add_NEW()} is to bind the event handling routine to the object. For this it will need a routine: @example static int handle_NEW(FL_OBJECT *obj, int event, FL_Coord mx, FL_Coord my, int key, void *xev); @end example This routine is the same as the handle routine for free objects and should handle particular events for the object. @code{mx} and @code{my} contain the current mouse position and @code{key} the key that was pressed (if this information is related to the event). @xref{Part IV Events, , Events}, for the types of events and the actions that should be taken. @code{xev} is the XEvent that caused the invocation of the handler. Note that some of the events may have a @code{NULL} @code{xev} parameter, so @code{xev} should be checked before dereferencing it. The routine should return whether the status of the object is changed, i.e., whether the event dispatcher should invoke this object's callback or, if no callback is set for the object, whether the object is to be returned to the application program by @code{@ref{fl_do_forms()}} or @code{@ref{fl_check_forms()}}. What constitutes a status change is obviously dependent on the specific object class and possibly its types within this class. For example, a mouse push on a radio button is considered a status change while it is not for a normal button where a status change occurs on release. Moreover, most classes have a number of other routines to change settings of the object or get information about it. In particular the following two routines often exist: @example void fl_set_NEW(FL_OBJECT *obj, ...); @end example @noindent that sets particular values for the object and @example fl_get_NEW(FL_OBJECT *obj, ...); @end example @noindent that returns some particular information about the object. See e.g., the routines @code{@ref{fl_set_button()}} and @code{@ref{fl_get_button()}}. @ifnottex @menu * The Routine fl_add_NEW():: @end menu @end ifnottex @node The Routine fl_add_NEW() @section The Routine @code{fl_add_NEW()} @code{fl_add_NEW()} has to add a new object to the form and bind its handle routine to it. To make it consistent with other object classes and also more flexible, there should in fact be two routines: @code{fl_create_NEW()} that creates the object and @code{fl_add_NEW()} that actually adds it to the form. They normally look as follows: @example typedef struct @{ /* instance specific record */ @} SPEC; FL_OBJECT *fl_create_NEW(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) @{ FL_OBJECT *obj; /* create a generic object */ obj = fl_make_object(FL_COLBOX, type, x, y, w, h, label, handle_NEW); /* fill in defaults */ obj->boxtype = FL_UP_BOX; /* allocate instance-specific storage and fill it with defaults */ obj->spec_size = sizeof SPEC; obj->spec = fl_calloc(1, obj->spec_size); return obj; @} @end example The constant @code{FL_NEW} will indicate the object class. It should be an integer. The numbers 0 to @tindex FL_USER_CLASS_START @code{FL_USER_CLASS_START - 1} (1000) and @tindex FL_BEGIN_GROUP @code{FL_BEGIN_GROUP} (10000) and higher are reserved for the system and should not be used. Also it is preferable to use @findex fl_malloc() @anchor{fl_malloc()} @findex fl_calloc() @anchor{fl_calloc()} @findex fl_realloc() @anchor{fl_realloc()} @findex fl_free() @anchor{fl_free()} @code{fl_malloc()}, @code{fl_calloc()}, @code{fl_realloc()} and @code{fl_free()} to allocate/free the memory for the instance specific structures. These routines have the same prototypes and work the same way as those in the standard library and may offer additional debugging capabilities in future versions of the Forms Library. Also note that these functions are actually function pointers, and if desired, the application is free to assign these pointers to its own memory allocation routines. There's also a version equivalent to the @code{strdup()} POSIX function which used @code{@ref{fl_malloc()}}: @findex fl_strdup() @anchor{fl_strdup()} @example char * fl_strdup(const char *s); @end example The object pointer returned by @code{@ref{fl_make_object()}} will have all of its fields set to some defaults (@pxref{Part IV The Type FL_OBJECT, , The Type @code{FL_OBJECT}}). In other words, the newly created object inherits many attributes of a generic one. Any class specific defaults that are different from the generic one can be changed after @code{@ref{fl_make_object()}}. Conversion of units, if different from the default pixel, is performed within @code{@ref{fl_make_object()}} and a class module never needs to know what the prevailing unit is. After the object is created, it has to be added to a form: @example FL_OBJECT *fl_add_NEW(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) @{ FL_OBJECT *obj; obj = fl_create_NEW(type, x, y, w, h, label); fl_add_object(fl_current_form, obj); return obj; @} @end example xforms-1.2.4/doc/part1_doing_interaction.texi0000664000175000017500000015463212353623325016244 00000000000000@node Part I Doing Interaction @chapter Doing Interaction @ifnottex @menu * Displaying a Form:: * Simple Interaction:: * Periodic Events and Non-blocking Interaction:: * Dealing With Multiple Windows:: * Using Callback Functions:: * Handling Other Input Sources:: @end menu @end ifnottex @node Displaying a Form @section Displaying a Form After having defined the forms the application program can use them to interact with the user. As a first step the program has to display the forms with which it wants the user to interact. This is done using the routine @findex fl_show_form() @example Window fl_show_form(FL_FORM *form, int place, int border, const char *name); @end example @noindent It opens a (top-level) window on the screen in which the form is shown. The parameter @code{name} is the title of the form (and its associated icon if any). The routine returns the ID of the forms window. You normally never need this. Immediately after the form becomes visible, a full draw of all objects on the form is performed. Due to the two way buffering mechanism of Xlib, if @code{@ref{fl_show_form()}} is followed by something that blocks (e.g., waiting for a device other than X devices to come online), the output buffer might not be properly flushed, resulting in the form only being partially drawn. If your program works this way, use the following function after @code{@ref{fl_show_form()}} @findex fl_update_display() @anchor{fl_update_display()} @example void fl_update_display(int blocking); @end example @noindent where @code{blocking} is false (0), the function flushes the X buffer so the drawing requests are on their way to the server. When @code{blocking} is true (1), the function flushes the buffer and waits until all the events are received and processed by the server. For typical programs that use @code{@ref{fl_do_forms()}} or @code{@ref{fl_check_forms()}} after @code{@ref{fl_show_form()}}, flushing is not necessary as the output buffer is flushed automatically. Excessive call to @code{@ref{fl_update_display()}} degrades performace. The location and size of the window to be shown on the call of @code{@ref{fl_show_form()}} are determined by the @code{place} argument. The following possibilities exist: @table @code @anchor{FL_PLACE_SIZE} @tindex FL_PLACE_SIZE @item FL_PLACE_SIZE The user can control the position but the size is fixed. Interactive resizing is not allowed once the form becomes visible. @anchor{FL_PLACE_POSITION} @tindex FL_PLACE_POSITION @item FL_PLACE_POSITION Initial position used will be the one set via @code{@ref{fl_set_form_position()}}. Interactive resizing is possible. @anchor{FL_PLACE_GEOMETRY} @tindex FL_PLACE_GEOMETRY @item FL_PLACE_GEOMETRY Place at the latest position and size (see also below) or the geometry set via @code{@ref{fl_set_form_geometry()}}. A form so shown will have a fixed size and interactive resizing is not allowed. @anchor{FL_PLACE_ASPECT} @tindex FL_PLACE_ASPECT @item FL_PLACE_ASPECT Allows interactive resizing but any new size will have the aspect ratio as that of the initial size. @anchor{FL_PLACE_MOUSE} @tindex FL_PLACE_MOUSE @item FL_PLACE_MOUSE The form is placed centered below the mouse. Interactive resizing will not be allowed unless this option is accompanied by @code{@ref{FL_FREE_SIZE}} as in @code{@ref{FL_PLACE_MOUSE}|@ref{FL_FREE_SIZE}}. @anchor{FL_PLACE_CENTER} @tindex FL_PLACE_CENTER @item FL_PLACE_CENTER The form is placed in the center of the screen. If @code{@ref{FL_FREE_SIZE}} is also specified, interactive resizing will be allowed. @anchor{FL_PLACE_FULLSCREEN} @tindex FL_PLACE_FULLSCREEN @item FL_PLACE_FULLSCREEN The form is scaled to cover the full screen. If @code{@ref{FL_FREE_SIZE}} is also specified, interactive resizing will be allowed. @anchor{FL_PLACE_FREE} @tindex FL_PLACE_FREE @item FL_PLACE_FREE Both the position and size are completely free. The initial size used is the designed size. Initial position, if setvia @code{@ref{fl_set_form_position()}}, will be used otherwise interactive positioning may be possible if the window manager allows it. @anchor{FL_PLACE_HOTSPOT} @tindex FL_PLACE_HOTSPOT @item FL_PLACE_HOTSPOT The form is placed so that mouse is on the form's "hotspot". If @code{@ref{FL_FREE_SIZE}} is also specified, interactive resizing will be allowed. @anchor{FL_PLACE_CENTERFREE} @tindex FL_PLACE_CENTERFREE @item FL_PLACE_CENTERFREE Same as @code{@ref{FL_PLACE_CENTER}|@ref{FL_FREE_SIZE}}, i.e., place the form at the center of the screen and allow resizing. @anchor{FL_PLACE_ICONIC} @tindex FL_PLACE_ICONIC @item FL_PLACE_ICONIC The form is shown initially iconified. The size and location used are the window manager's default. @end table As mentioned above, some of the settings will result in a fixed size of the form (i.e., a size that can't be changed by the user per default). In some cases this can be avoided by OR'ing the value with @anchor{FL_FREE_SIZE} @tindex FL_FREE_SIZE @code{FL_FREE_SIZE} as a modifier. If no size was specified, the designed (or later scaled) size will be used. Note that the initial position is dependent upon the window manager used. Some window managers allow interactive placement of the windows but some don't. You can set the position or size to be used via the following calls @findex fl_set_form_position() @example void fl_set_form_position(FL_FORM *form, FL_Coord x, FL_Coord y); @end example @noindent and @findex fl_set_form_size() @example void fl_set_form_size(FL_FORM *form, FL_Coord w, FL_Coord h); @end example @noindent or, combining both these two functions, @findex fl_set_form_geometry() @example void fl_set_form_geometry(FL_FORM form*, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h); @end example @noindent before placing the form on the screen. (Actually the routines can also be called while the form is being displayed. They will change the position and/or size of the form.) @code{x}, @code{y}, @code{w} and @code{h} indicate the position of the form on the screen and its size@footnote{The parameters should be sensitive to the coordinate unit in effect at the time of the call, but at present, they are not, i.e., the function takes only values in pixel units.}. The position is measured from the top-left corner of the screen. When the position is negative the distance from the right or the bottom is indicated. Next the form should be placed on the screen using @code{@ref{FL_PLACE_GEOMETRY}}, @code{@ref{FL_PLACE_FREE}}. E.g., to place a form at the lower-right corner of the screen use @example fl_set_form_position(form, -1, -1); fl_show_form(form, FL_PLACE_GEOMETRY, FL_TRANSIENT, "formName"); @end example @noindent (Following the X convention for specifying geometries a negative @code{x}-position specifies the distance of the right eside of the form from the right side of the screen and a negative @code{y}-position the distance of the bottom of the form from the bottom of the screen.) To show a form so that a particular object or point is under the mouse, use one of the following two routines to set the "hotspot" @findex fl_set_form_hotspot() @anchor{fl_set_form_hotspot()} @findex fl_set_form_hotobject() @anchor{fl_set_form_hotobject()} @example void fl_set_form_hotspot(FL_FORM *form, FL_Coord x, FL_Coord y); void fl_set_form_hotobject(FL_FORM *form, FL_OBJECT *obj); @end example @noindent and then use @code{@ref{FL_PLACE_HOTSPOT}} for the @code{place} argument in the call of @code{@ref{fl_show_form()}}. The coordinates @code{x} and @code{y} are relative to the upper-left hand corner of the form (within the window decorations). In the call @code{@ref{fl_show_form()}} the argument @code{border} indicates whether or not to request window manager's decoration. @code{border} should take one of the following values: @table @code @anchor{FL_FULLBORDER} @tindex FL_FULLBORDER @item FL_FULLBORDER Full border decorations. @anchor{FL_TRANSIENT} @tindex FL_TRANSIENT @item FL_TRANSIENT Borders with (possibly) less decorations. @anchor{FL_NOBORDER} @tindex FL_NOBORDER @item FL_NOBORDER No decoration at all. @end table For some dialogs, such as demanding an answer etc., you probably do not want the window manager's full decorations. Use @code{@ref{FL_TRANSIENT}} for this. A window border is useful to let the user iconify a form, move it around or resize it. If a form is transient or has no border, it is normally more difficult (or even impossible) to move the form. A transient form typically should have less decoration, but not necessarily so. It depends on the window managers as well as their options. @code{@ref{FL_NOBORDER}} is guaranteed to have no border@footnote{Provided the window manager is compliant. If the window manager isn't compliant all bets are off.} and is immune to iconification request. Because of this, borderless forms can be hostile to other applications@footnote{Actually, they are also hostile to their sibling forms. @xref{Part V Overview of Main Functions, , Overview of Main Functions}.}, so use this only if absolutely necessary. There are other subtle differences between the different decoration requests. For instance, (small) transient forms always have @code{save_under} (see @code{XSetWindowAttributes()}) set to true by default. Some window properties, @code{WM_COMMAND} in particular, are only set for full-bordered forms and will only migrate to other full-bordered forms when the original form having the property becomes unmapped. The library has a notion of a "main form" of an application, roughly the form that would be on the screen the longest. By default, the first full-bordered form shown becomes the main form of the application. All transient windows shown afterwards will stay on top of the main form. The application can set or change the main form anytime using the following routine @findex fl_set_app_mainform() @example void fl_set_app_mainform(FL_FORM *form); @end example @noindent Setting the main form of an application will cause the @code{WM_COMMAND} property set for the form if no other form has this property. Sometimes it is necessary to have access to the window resource ID before the window is mapped (shown). For this, the following routine can be used @findex fl_prepare_form_window() @example Window fl_prepare_form_window(FL_FORM *form, int place, int border, const char *name); @end example @noindent This routine creates a window that obeys any and all constraints just as @code{@ref{fl_show_form()}} does but remains unmapped. To map such a window, the following must be used @findex fl_show_form_window() @example Window fl_show_form_window(FL_FORM *form); @end example @noindent Between these two calls, the application program has full access to the window and can set all attributes, such as icon pixmaps etc., that are not set by @code{@ref{fl_show_form()}}. You can also scale the form and all objects on it programmatically using the following routine @findex fl_scale_form() @example void fl_scale_form(FL_FORM *form, double xsc, double ysc); @end example @noindent where you indicate a scaling factor in the x- and y-direction with respect to the current size. See @file{rescale.c} for an example. When a form is scaled, either programmatically or interactively, all objects on the form per default will also be scaled. This includes both the sizes and positions of the objects. For most cases, this default behavior is adequate. In some cases, e.g., to keep a group of objects together, more control is needed. To this end, the following routines can be used @findex fl_set_object_resize() @findex fl_set_object_gravity() @example void fl_set_object_resize(FL_OBJECT *obj, unsigned how_resize); void fl_set_object_gravity(FL_OBJECT *obj, unsigned nw_gravity, unsigned se_gravity); @end example The @code{how_resize} argument of @code{@ref{fl_set_object_resize()}} can be one of @table @code @anchor{FL_RESIZE_NONE} @tindex FL_RESIZE_NONE @item FL_RESIZE_NONE don't resize the object at all @anchor{FL_RESIZE_X} @tindex FL_RESIZE_X @item FL_RESIZE_X resize it in x- (horizontal) direction only @anchor{FL_RESIZE_Y} @tindex FL_RESIZE_Y @item FL_RESIZE_Y resize it in y- (vertical) direction only @anchor{FL_RESIZE_ALL} @tindex FL_RESIZE_ALL @item FL_RESIZE_ALL is an alias for @code{@ref{FL_RESIZE_X}|@ref{FL_RESIZE_Y}} and makes the object resizable in both dimension. @end table The arguments @code{nw_gravity} and @code{se_gravity} of @code{fl_set_object_gravity()} control the positioning of the upper-left and lower-right corner of the object and work analogously to the @code{win_gravity} in Xlib. The details are as follows: Let @code{P} be the corner the gravity applies to, @code{(dx1,dy1)} the distance to the upper-left corner of the form, @code{(dx2,dy2)} the distance to the lower-right corner of the form, then, @multitable @columnfractions 0.4 0.1 0.5 @headitem Value @tab @tab Effect @anchor{FL_NoGravity} @tindex FL_NoGravity @item @code{FL_NoGravity} @tab @tab Default linear scaling, see below @anchor{FL_NorthWest} @tindex FL_NorthWest @item @code{FL_NorthWest} @tab @tab @code{dx1}, @code{dy1} constant @anchor{FL_North} @tindex FL_North @item @code{FL_North} @tab @tab @code{dy1} constant @anchor{FL_NorthEast} @tindex FL_NorthEast @item @code{FL_NorthEast} @tab @tab @code{dy1}, @code{dx2} constant @anchor{FL_West} @tindex FL_West @item @code{FL_West} @tab @tab @code{dx1} constant @anchor{FL_East} @tindex FL_East @item @code{FL_East} @tab @tab @code{dx2} constant @anchor{FL_SouthWest} @tindex FL_SouthWest @item @code{FL_SouthWest} @tab @tab @code{dx1}, @code{dy2} constant @anchor{FL_South} @tindex FL_South @item @code{FL_South} @tab @tab @code{dy2} constant @anchor{FL_SouthEast} @tindex FL_SouthEast @item @code{FL_SouthEast} @tab @tab @code{dx2}, @code{dy2} constant @anchor{ForgetGravity} @tindex ForgetGravity @item @code{ForgetGravity} @tab @tab don't consider the setting for this argument @end multitable @ifhtml @center @image{xforms_images/gravity} @end ifhtml @ifnothtml @center @image{xforms_images/gravity,7cm} @end ifnothtml Default for all object is @code{@ref{FL_RESIZE_ALL}} and @code{@ref{ForgetGravity}}. Note that the three parameters are not orthogonal and the positioning request will always override the scaling request in case of conflict. This means the resizing settings for an object are considered only if one (or both) of the gravities is @code{@ref{FL_NoGravity}}. For the special case where @code{how_resize} is @code{@ref{FL_RESIZE_NONE}} and both gravities are set to @code{ForgetGravity}, the object is left un-scaled, but the object is moved so that the new position keeps the center of gravity of the object constant relative to the form. Again, since all sizing requests go though the window manager, there is no guarantee that your request will be honored. If a form is placed with @code{@ref{FL_PLACE_GEOMETRY}} or other size-restricting options, resizing it later via @code{@ref{fl_set_form_size()}} will likely be rejected. To determine the gravity and resize settings for an object use the functions @findex fl_get_object_gravity() @findex fl_get_object_resize() @example void fl_get_object_gravity(FL_OBJECT *obj, unsigned int *nw, unsigned int *se); void fl_get_object_resize(FL_OBJECT *obj, unsigned int *resize ); @end example Sometimes, you may want to change an attribute for all objects on a particular form, to this end, the following iterator is available @findex fl_for_all_objects() @anchor{fl_for_all_objects()} @example void fl_for_all_objects(FL_FORM *form, int (*operate)(FL_OBJECT *obj, void *data), void *data); @end example @noindent where function @code{operate} is called for every object of the form @code{form} unless @code{operate()} returns nonzero, which terminates the iterator. Multiple forms can be shown at the same moment and the system will interact with all of them simultaneously. The graphical mode in which the form is shown depends on the type of machine. In general, the visual chosen by XForms is the one that has the most colors. Application programs have many ways to change this default, either through command line options, resources or programmatically. See the Part V for details. If for any reason, you would like to change the form title (as well as its associated icon) after it is shown, the following functions can be used @findex fl_set_form_title() @findex fl_set_form_title_f() @example void fl_set_form_title(FL_FORM *form, const char *name) void fl_set_form_title_f(FL_FORM *form, const char *fmt, ...) @end example To set or change the icon shown when a form is iconified, use the following routine @findex fl_set_form_icon() @example void fl_set_form_icon(FL_FORM *form, Pixmap icon, Pixmap mask); @end example @noindent where @code{icon} and @code{mask} can be any valid Pixmap ID. (See @ref{Other Pixmap Routines} for some of the routines that can be used to create Pixmaps.) Note that an @code{icon} previously setvia this function (if it exists) is not freed or modified in anyway. See the demo program @file{iconify.c} for an example. If the application program wants to stop interacting with a form and remove it from the screen, it has to use the call @findex fl_hide_form() @example void fl_hide_form(FL_FORM *form); @end example To check if a form is visible or not, use the following call @findex fl_form_is_visible() @example int fl_form_is_visible(FL_FORM *form); @end example @noindent The function returns one of @table @code @anchor{FL_INVISIBLE} @tindex FL_INVISIBLE @item FL_INVISIBLE if the form is not visible (0), @anchor{FL_VISIBLE} @tindex FL_VISIBLE @item FL_VISIBLE if the form is visible (1) and @anchor{FL_BEING_HIDDEN} @tindex FL_BEING_HIDDEN @item FL_BEING_HIDDEN if the form is visible but is in the process of being hidden (-1). @end table Note that if you don't need a form anymore you can deallocate its memory using the call @code{@ref{fl_free_form()}} described earlier. Window managers typically have a menu entry labeled "delete" or "close" meant to terminate an application program gently by informing the application program with a @code{WM_DELETE_WINDOW} protocol message. Although the Forms Library catches this message, it does not do anything except terminating the application. This can cause problems if the application has to do some record keeping before exiting. To perform record keeping or to elect to ignore this message, register a callback function using the following routine @findex fl_set_atclose() @anchor{fl_set_atclose()} @example int fl_set_atclose(int (*at_close)(FL_FORM *, void *), void *data); @end example @noindent The callback function @code{at_close} will be called before the Forms Library terminates the application. The first parameter of the callback function is the form that received the @code{WM_DELETE_WINDOW} message. To prevent the Forms Library from terminating the application, the callback function should return the constant @code{FL_IGNORE}. Any other value (e.g., @code{FL_OK}) will result in the termination of the application. Similar mechanism exists for individual forms @findex fl_set_form_atclose() @anchor{fl_set_form_atclose()} @example int fl_set_form_atclose(FL_FORM *, int (*at_close)(FL_FORM *, void *), void *data); @end example @noindent except that @code{FL_OK} does not terminate the application, it results in the form being closed. Of course, if you'd like to terminate the application, you can always call @code{exit(3)} yourself within the callback function. @node Simple Interaction @section Simple Interaction Once one or more forms are shown it is time to give control to the library to handle the interaction with the forms. There are a number of different ways of doing this. The first one, appropriate for most programs, is to call of @findex fl_do_forms() @example FL_OBJECT *fl_do_forms(void); @end example @noindent It controls the interaction until some object in one of the forms changes state. In this case a pointer to the changed object is returned. A change occurs in the following cases: @table @asis @item box A box never changes state and, hence, is never returned by @code{@ref{fl_do_forms()}}. @item text Also a text never changes state. @item button A button is returned when the user presses a mouse button on it and then releases the button. The change is not reported before the user releases the mouse button, except with touch buttons which are returned all the time as long as the user keeps the mouse pressed on it. (See e.g., @file{touchbutton.c} for the use of touch buttons.) @item slider A slider per default is returned whenever its value is changed, so whenever the user clicks on it and moves the mouse the slider object gets returned. @item input An input field is returned per default when it is deactivated, i.e., the user has selected it and then starts interacting with another object that has the ability to get returned. @end table (This list just contains a small number of objects that exist, see Part III for a list of all objects and the documentation of the exact behaviour of them.) When the (address of the) object is returned by @code{@ref{fl_do_forms()}} the application program can take action accordingly. See some of the demo programs for examples of use. Normally, after the action is taken by the application program @code{@ref{fl_do_forms()}} is called again to continue the interaction. Hence, simpler programs have the following global form: @example /* define the forms */ /* display the forms */ while (! ready) @{ obj = fl_do_forms(); if (obj == obj1) /* handle the change in obj1 */ else if (obj == obj2) /* handle the change in obj2 */ .... @} @end example For more complex programs interaction via callbacks is often preferable. For such programs, the global structure looks something like the following @example /* define callbacks */ void callback(FL_OBJECT *obj, long data) @{ /* perform tasks */ @} void terminate_callback(FL_OBJECT *obj, long data) @{ /* cleanup application */ fl_finish(); exit(0); @} main(int argc, char *argv[]) @{ /* create form and bind the callbacks to objects */ /* enter main loop */ fl_do_forms(); return 0; @} @end example @noindent In this case, @code{@ref{fl_do_forms()}} handles the interaction indefinitely and never returns. The program exits via one of the callback functions. There is also the possibility to conrol under which exact conditions the object gets returned. An application that e.g., doesn't want to be notified about each change of a slider but instead only want a single notification after the mouse button has been released and the value of the slider was changed in the process would call the function @findex fl_set_object_return() @anchor{fl_set_object_return()} @example int fl_set_object_return(FL_OBJECT *obj, unsigned int when); @end example with @code{when} set to @code{FL_RETURN_END_CHANGED}. There are several values @code{when} can take: @table @code @anchor{FL_RETURN_CHANGED} @tindex FL_RETURN_CHANGED @item FL_RETURN_CHANGED Return (or call object callback) whenever there is a change in the state of the object (button was pressed, input field was changed, slider was moved etc.). @anchor{FL_RETURN_END} @tindex FL_RETURN_END @item FL_RETURN_END Return (or invoke callback) at the end of the interaction (typically when the user releases the mouse button) regardless if the objects state was changed or not. @anchor{FL_RETURN_END_CHANGED} @tindex FL_RETURN_END_CHANGED @item FL_RETURN_END_CHANGED Return (or call object callback) when interaction stops @strong{and} the state of the object changed. @anchor{FL_RETURN_SELECTION} @tindex FL_RETURN_SELECTION @item FL_RETURN_SELECTION Return when e.g., a line in a @code{@ref{FL_MULTI_BROWSER}} browser was selected. @anchor{FL_RETURN_DESELECTION} @tindex FL_RETURN_DESELECTION @item FL_RETURN_DESELECTION Return when e.g., a line in a @code{@ref{FL_MULTI_BROWSER}} browser was deselected. @anchor{FL_RETURN_ALWAYS} @tindex FL_RETURN_ALWAYS @item FL_RETURN_ALWAYS Return (or invoke callback) on any of the events that can happen to the object. @anchor{FL_RETURN_NONE} @tindex FL_RETURN_NONE @item FL_RETURN_NONE Never notiy the application about interactions with this object (i.e., never return it nor invoke its callback). Note: this is not meant for deactivation of an object, it will still seem to work as normal, it just doesn't get returned to the application nor does is callbak get invoked. @end table Since for different objects only subsets of these conditions make sense please read the more detailed descriptions for each of the object types in Part III. All of the values above, except @code{@ref{FL_RETURN_END_CHANGED}}, @code{@ref{FL_RETURN_ALWAYS}} and @code{@ref{FL_RETURN_NONE}} can be logically @code{OR}'ed. @code{@ref{FL_RETURN_END_CHANGED}} is different in that it only can be returned when the conditions for @code{@ref{FL_RETURN_END}} and @code{@ref{FL_RETURN_CHANGED}} are satisfied at once. If this is requested both @code{@ref{FL_RETURN_END}} and @code{@ref{FL_RETURN_CHANGED}} will automatically become deselected. So if you want notifications about the conditions that lead to @code{@ref{FL_RETURN_END}} or @code{@ref{FL_RETURN_CHANGED}} (or both at once) ask instead for the logical @code{OR} of these two. @code{@ref{FL_RETURN_ALWAYS}} includes all conditions except @code{@ref{FL_RETURN_END_CHANGED}}. Once an object has been returned (or its callback is invoked) you can determine the reason why it was returned by calling @findex fl_get_object_return_state() @anchor{fl_get_object_return_state()} @example int fl_get_object_return_state(FL_OBBJECT *obj); @end example This returns the logical @code{OR} of the conditions that led to the object being returned, where the conditions can be @code{@ref{FL_RETURN_CHANGED}}, @code{@ref{FL_RETURN_END}}, @code{@ref{FL_RETURN_SELECTION}} and @code{@ref{FL_RETURN_DESELECTION}}. (The @code{@ref{FL_RETURN_END_CHANGED}} condition is satisfied if both @code{@ref{FL_RETURN_END}} and @code{@ref{FL_RETURN_CHANGED}} are set.) Please note that calling this function only makes sense in a callback for an object or when the object has been just returned by e.g., @code{@ref{fl_do_forms()}}. Further interactions with the object overwrite the value! @node Periodic Events and Non-blocking Interaction @section Periodic Events and Non-blocking Interaction The interaction mentioned above is adequate for many application programs but not for all. When the program also has to perform tasks when no user action takes place (e.g., redrawing a rotating image all the time), some other means of interaction are needed. There exist two different, but somewhat similar, mechanisms in the library that are designed specifically for generating and handling periodic events or achieving non-blocking interaction. Depending on the application, one method may be more appropriate than the other. For periodic tasks, e.g., rotating an image, checking the status of some external device or application state etc., interaction via an idle callback comes in very handy. An idle callback is an application function that is registered with the system and is called whenever there are no events pending for forms (or application windows). To register an idle callback, use the following routine @findex fl_set_idle_callback() @example FL_APPEVENT_CB fl_set_idle_callback(FL_APPEVENT_CB callback, void *user_data); @end example After the registration, whenever the main loop (@code{@ref{fl_do_forms()}}) is idle, i.e., no user action or light user action, the callback function of type @code{FL_APPEVENT_CB} is called @tindex FL_APPEVENT_CB @anchor{FL_APPEVENT_CB} @example typedef int (*FL_APPEVENT_CB)(XEvent *xev, void *user_data); @end example @noindent i.e., a function with the signature @example int idle_callback(XEvent *xev, void *user_data); @end example @noindent where @code{user_data} is the void pointer passed to the system in @code{@ref{fl_set_idle_callback()}} through which some information about the application can be passed. The return value of the callback function is currently not used. @code{xev} is a pointer to a synthetic@footnote{I.e., @code{xev->xmotion.send_event} is true.} @code{MotionNotify} event from which some information about mouse position etc. can be obtained. To remove the idle callback, use @code{@ref{fl_set_idle_callback()}} with callback set to @code{NULL}. Timeouts are similar to idle callbacks but with somewhat more accurate timing. Idle callbacks are called whenever the system is idle, the time interval between any two invocations of the idle callback can vary a great deal depending upon many factors. Timeout callbacks, on the other hand, will never be called before the specified time is elapsed. You can think of timeouts as regularized idle callbacks, and further you can have more than one timeout callbacks. To add a timeout callback, use the following routine @tindex FL_TIMEOUT_CALLBACK @findex fl_add_timeout() @example typedef void (*FL_TIMEOUT_CALLBACK)(int, void *); int fl_add_timeout(long msec, FL_TIMEOUT_CALLBACK callback, void *data); @end example @noindent The function returns the timeout's ID@footnote{The function will not return 0 or -1 as timeout IDs, so the application program can use these values to tag invalid or expired timeouts.}. When the time interval specified by @code{msec} (in milli-seconds) has elapsed the timeout is removed, then the callback function is called. The timeout ID is passed to the callback function as the first parameter. The second parameter the callback function is passed is the data pointer that was passed to @code{@ref{fl_add_timeout()}}. To remove a timeout before it triggers, use the following routine @findex fl_remove_timeout() @example void fl_remove_timeout(int id); @end example @noindent where @code{id} is the timeout ID returned by @code{@ref{fl_add_timeout()}}. There is also an @code{FL_OBJECT}, the @code{FL_TIMER} object, especially the invisible type, that can be used to do timeout. Since it is a proper Forms Library object, it may be easier to use simply because it has the same API as any other GUI elements and is supported by the Form Designer. @xref{Timer Object}, for complete information on the @code{FL_TIMER} object. Note that idle callback and timeout are not appropriate for tasks that block or take a long time to finish because during the busy or blocked period, no interaction with the GUI can take place (both idle callback and timeout are invoked by the main loop, blockage or busy executing application code prevents the main loop from performing its tasks). So what to do in situations where the application program does require a lengthy computation while still wanting to have the ability to interact with the user interface (for example, a Stop button to terminate the lengthy computation)? In these situations, the following routine can be used: @findex fl_check_forms() @example FL_OBJECT *fl_check_forms(void); @end example @noindent This function is similar to @code{@ref{fl_do_forms()}} in that it takes care of handling events and appropriate callbacks, but it does not block. Instead it always returns to the application program immediately. If a change has occurred in some object the object is returned as with @code{@ref{fl_do_forms()}}. But when no change has occurred control is also returned but this time a @code{NULL} object is returned. Thus, by inserting this statement in the middle of the computation in appropriate places in effect "polls" the user interface. The downside of using this function is that if used excessively, as with all excessive polls, it can chew up considerable CPU cycles. Therefore, it should only be used outside the inner most loops of the computation. If all objects have callbacks bound to them, @code{@ref{fl_check_forms()}} always returns @code{NULL}, otherwise, code similar to the following is needed: @example obj = fl_check_forms(); if (obj == obj1) /* handle it */ ... @end example @noindent Depending on the applications, it may be possible to partition the computation into smaller tasks that can be performed within an idle callback one after another, thus eliminating the need of using @code{@ref{fl_check_forms()}}. Handling intensive computation while maintaining user interface responsiveness can be tricky and by no means the above methods are the only options. You can, for example, fork a child process to do some of the tasks and communicate with the interface via pipes and/or signals, both of which can be handled with library routines documented later, or use multi-thread (but be careful to limit Xserver access within one thread). Be creative and have fun. For running external executables while maintaining responsiveness of the interface, see @code{@ref{fl_exe_command()}} and @code{@ref{fl_popen()}} documented later in @ref{Command Log}. @node Dealing With Multiple Windows @section Dealing With Multiple Windows It is not atypical that an application program may need to take interaction from more than one form at the same time, Forms Library provides a mechanism with which precise control can be exercised. By default, @code{@ref{fl_do_forms()}} takes interaction from all forms that are shown. In certain situations, you might not want to have interaction with all of them. For example, when the user presses a quit button in a form you might want to ask a confirmation using another form. You don't want to hide the main form because of that but you also don't want the user to be able to press buttons, etc. in this form. The user first has to give the confirmation. So you want to temporarily deactivate the main form. This can be done using the call @findex fl_deactivate_form() @example void fl_deactivate_form(FL_FORM *form); @end example To reactivate the form later again use @findex fl_activate_form() @example void fl_activate_form(FL_FORM *form); @end example It is a good idea to give the user a visual clue that a form is deactivated. This is not automatically done mainly for performance reasons. Experience shows that graying out some important objects on the form is in general adequate. Graying out an object can be accomplished by using @code{@ref{fl_set_object_lcolor()}} (see @file{objinactive.c}. What objects to gray out is obviously application dependent. The following two functions can be used to register two callbacks that are called whenever the activation status of a form is changed: @tindex FL_FORM_ATACTIVATE @tindex FL_FORM_ATDEACTIVATE @findex fl_set_form_atactivate() @findex fl_set_form_atdeactivate() @example typedef void (*FL_FORM_ATACTIVATE)(FL_FORM *, void *); FL_FORM_ATACTIVATE fl_set_form_atactivate(FL_FORM *form, FL_FORM_ATACTIVATE callback, void *data); typedef void (*FL_FORM_ATDEACTIVATE)(FL_FORM *, void *); FL_FORM_ATDEACTIVATE fl_set_form_atdeactivate(FL_FORM *form, FL_FORM_ATDEACTIVATE callback, void *data); @end example It is also possible to deactivate all current forms and reactivate them again. To this end use the functions: @findex fl_deactivate_all_forms() @findex fl_activate_all_forms() @example void fl_deactivate_all_forms(void); void fl_activate_all_forms(void); @end example @noindent Note that deactivation works in an additive way, i.e., when deactivating a form say 3 times it also has to be activated 3 times to become active again. One problem remains. Mouse actions etc. are presented to a program in the form of events in an event queue. The library routines @code{@ref{fl_do_forms()}} and @code{@ref{fl_check_forms()}} read this queue and handle the events. When the application program itself also opens windows, these windows will rather likely receive events as well. Unfortunately, there is only one event queue. When both the application program and the library routines would read events from this one queue problems would occur and events missed. Hence, the application program should not read the event queue itself.. To solve this problem, the library maintains (or appears to maintain) a separate event queue for the user. This queue behaves in exactly the same way as the normal event queue. To access it, the application program must use replacements for the usual Xlib routines. Instead of using @code{XNextEvent()}, the program will use @code{@ref{fl_XNextEvent()}}, with the same parameters except the @code{Display *} argument. The following is a list of all replacement routines: @findex fl_XNextEvent() @anchor{fl_XNextEvent()} @findex fl_XPeekEvent() @anchor{fl_XPeekEvent()} @findex fl_XEventsQueued() @anchor{fl_XEventsQueued()} @findex fl_XPutbackEvent() @anchor{fl_XPutbackEvent()} @example int fl_XNextEvent(XEvent *xev); int fl_XPeekEvent(XEvent *xev); int fl_XEventsQueued(int mode); int fl_XPutbackEvent(XEvent *xev); @end example @noindent Note that these routines normally return @code{1}, but after a call of @code{@ref{fl_finish()}} they return @code{1} instead. Other events routines may be directly used if proper care is taken to make sure that only events for the application windows not handled by the library are removed. These routines include @code{XWindowEvent()}, @code{XCheckWindowEvent()} etc. To help find out when an event has occurred, whenever @code{@ref{fl_do_forms()}} and @code{@ref{fl_check_forms()}} encounter an event that is not meant for handling by the library but by the application program itself they return a special object @code{@ref{FL_EVENT}}. Upon receiving this special event, the application program can and must remove the pending event from the queue using @code{@ref{fl_XNextEvent()}}. So the basis of a program with its own windows would look as follows: @example /* define the forms */ /* display the forms */ /* open your own window(s) */ while (! ready) @{ obj = fl_do_forms(); /* or fl_check_forms() */ if (obj == FL_EVENT) @{ fl_XNextEvent(&xevent); switch (xevent.type) @{ /* handle the event */ @} @} else if (obj != NULL) /* handle the change in obj */ /* update other things */ @} @} @end example In some situations you may not want to receive these "user" events. For example, you might want to write a function that pops up a form to change some settings. This routine might not want to be concerned with any redrawing of the main window, etc., but you also not want to discard any events. In this case you can use the routines @code{@ref{fl_do_only_forms()}} and @code{@ref{fl_check_only_forms()}} that will never return @code{@ref{FL_EVENT}}. The events don't disappear but will be returned at later calls to the normal routines @code{@ref{fl_do_forms()}} etc. It can't be over-emphasized that it is an error to ignore @code{@ref{FL_EVENT}} or use @code{@ref{fl_XNextEvent()}} without seeing @code{@ref{FL_EVENT}}. Sometimes an application program might need to find out more information about the event that triggered a callback, e.g., to implement mouse button number sensitive functionalities. To this end, the following routines may be called @findex fl_mouse_button() @anchor{fl_mouse_button()} @example long fl_mouse_button(void); @end example @noindent This function, if needed, should be called from within a callback. The function returns one of the constants @code{@ref{FL_LEFT_MOUSE}}, @code{@ref{FL_MIDDLE_MOUSE}}, @code{@ref{FL_RIGHT_MOUSE}}, @code{@ref{FL_SCROLLUP_MOUSE}} or @code{@ref{FL_SCROLLDOWN_MOUSE}}, indicating which mouse button was pushed or released. If the callback is triggered by a shortcut, the function returns the keysym (ascii value if ASCII) of the key plus @tindex FL_SHORTCUT @code{@ref{FL_SHORTCUT}}. For example, if a button has a shortcut @code{C} (ASCII value is 3), the button number returned upon activation of the shortcut would be @code{FL_SHORTCUT + 3}. @code{@ref{FL_SHORTCUT}} can be used to determine if the callback is triggered by a shortcut or not @example if (fl_mouse_button() >= FL_SHORTCUT) /* handle shortcut */ else switch (fl_mouse_button()) @{ case FL_LEFTMOUSE: .... @} @end example More information can be obtained by using the following routine that returns the last @code{XEvent} @findex fl_last_event() @example const XEvent *fl_last_event(void); @end example @noindent Note that if this routine is used outside of a callback function, the value returned may not be the real "last event" if the program was idling and, in this case, it returns a synthetic @code{MotionNotify} event. Some of the utilities used internally by the Forms Library can be used by the application programs, such as window geometry queries etc. Following is a partial list of the available routines: @findex fl_get_winorigin() @findex fl_get_winsize() @findex fl_get_wingeometry() @example void fl_get_winorigin(Window win, FL_Coord *x, FL_Coord *y); void fl_get_winsize(Window win, FL_Coord *w, FL_Coord *h); void fl_get_wingeometry(Window win, FL_Coord *x, FL_Coord *y, FL_Coord *w, FL_Coord *h); @end example @noindent All positions are relative to the root window. There are also routines that can be used to obtain the current mouse position relative to the root window: @findex fl_get_mouse() @example Window fl_get_mouse(FL_Coord *x, FL_Coord *y, unsigned int *keymask); @end example @noindent where @code{keymask} is the same as used in @code{XQueryPointer(3X11)}. The function returns the window ID the mouse is in. To obtain the mouse position relative to an arbitrary window, the following routine may be used @findex fl_get_win_mouse() @example Window fl_get_win_mouse(Window win, FL_Coord *x, FL_Coord *y, unsigned int *keymask); @end example To print the name of an XEvent, the following routine can be used: @findex fl_print_xevent_name() @anchor{fl_print_xevent_name()} @example XEvent *fl_print_xevent_name(const char *where, const XEvent *xev); @end example @noindent The function takes an XEvent, prints out its name and some other info, e.g., @code{expose, count=n}. Parameter @code{where} can be used to indicate where this function is called: @example fl_print_xevent_name("In tricky.c", &xevent); @end example @node Using Callback Functions @section Using Callback Functions As stated earlier, the recommended method of interaction is to use callback functions. A callback function is a function supplied to the library by the application program that binds a specific condition (e.g., a button is pushed) to the invocation of the function by the system. The application program can bind a callback routine to any object. Once a callback function is bound and the specified condition is met, @code{@ref{fl_do_forms()}} or @code{@ref{fl_check_forms()}} invokes the callback function instead of returning the object. To bind a callback routine to an object, use the following @tindex FL_CALLBACKPTR @findex fl_set_object_callback() @example typedef void (*FL_CALLBACKPTR)(FL_OBJECT *obj, long argument); FL_CALLBACKPTR fl_set_object_callback(FL_OBJECT *obj, FL_CALLBACKPTR callback, long argument); @end example @noindent where @code{callback} is the callback function. @code{argument} is an argument that is passed to the callback routine so that it can take different actions for different objects. The function returns the old callback routine already bound to the object. You can change the callback routine anytime using this function. See, for example, demo program @file{timer.c}. The callback routine should have the form @example void callback(FL_OBJECT *obj, long argument); @end example @noindent The first argument to every callback function is the object to which the callback is bound. The second parameter is the argument specified by the application program in the call to @code{@ref{fl_set_object_callback()}}. See program @file{yesno_cb.c} for an example of the use of callback routines. Note that callback routines can be combined with normal objects. It is possible to change the callback routine at any moment. Sometimes it is necessary to access other objects on the form from within the callback function. This presents a difficult situation that calls for global variables for all the objects on the form. This runs against good programming methodology and can make a program hard to maintain. Forms Library solves (to some degree) this problem by creating three fields, @code{void *u_vdata}, @code{char *u_cdata} and @code{long u_ldata}, in the @code{FL_OBJECT} structure that you can use to hold the necessary data to be used in the callback function. A better and more general solution to the problem is detailed in Part II of this documentation where all objects on a form is are grouped into a single structure which can then be "hang" off of @code{u_vdata} or some field in the @code{FL_FORM} structure. Another communication problem might arise when the callback function is called and, from within the callback function, some other objects' state is explicitly changed, say, via @code{@ref{fl_set_button()}}, @code{@ref{fl_set_input()}} etc. You probably don't want to put the state change handling code of these objects in another object's callback. To handle this situation, you can simply call @findex fl_call_object_callback() @example void fl_call_object_callback(FL_OBJECT *obj); @end example When dealing with multiple forms, the application program can also bind a callback routine to an entire form. To this end it should use the routine @findex fl_set_form_callback() @example void fl_set_form_callback(FL_FORM *form, void (*callback)(FL_OBJECT *, void *), void *data); @end example Whenever @code{@ref{fl_do_forms()}} or @code{@ref{fl_check_forms()}} would return an object in form they call the routine callback instead, with the object as an argument. So the callback should have the form @example void callback(FL_OBJECT *obj, void *data); @end example With each form you can associate its own callback routine. For objects that have their own callbacks the object callbacks have priority over the form callback. When the application program also has its own windows (via Xlib or Xt), it most likely also wants to know about XEvents for the window. As explained earlier, this can be accomplished by checking for @code{@ref{FL_EVENT}} objects. Another (and better) way is to add an event callback routine. This routine will be called whenever an XEvent is pending for the application's own window. To setup an event callback routine (of type @code{@ref{FL_APPEVENT_CB}} use the call @tindex FL_APPEVENT_CB @findex fl_set_event_callback() @example typedef int (*FL_APPEVENT_CB)(XEvent *, void *); FL_APPEVENT_CB fl_set_event_callback(int (*callback)(XEvent *ev, void *data), void *data); @end example @noindent Whenever an event happens the callback function is invoked with the event as the first argument and a pointer to data you want it to receive. So the callback should have the form @example int callback(XEvent *xev, void *data); @end example This assumes the application program solicits the events and further, the callback routine should be prepared to handle all XEvent for all non-form windows. The callback function normally should return @code{0} unless the event isn't for one of the applcation-managed windows. This could be undesirable if more than one application window is active. To further partition and simplify the interaction, callbacks for a specific event on a specific window can be registered: @findex fl_add_event_callback() @example FL_APPEVENT_CB fl_add_event_callback(Window window, int xev_type, FL_APPEVENT_CB callback, void *user_data); @end example @noindent where @code{window} is the window for which the callback routine is to be registered. @code{xev_type} is the XEvent type you're interested in, e.g., @code{Expose} etc. If @code{xev_type} is 0, it is taken to mean that the callback routine will handle all events for the window. The newly installed callback replaces the callback already installed. Note that this function only works for windows created directly by the application program (i.e., it won't work for forms' windows or windows created by the canvas object). It is possible to access the raw events that happen on a form's window via @code{@ref{fl_register_raw_callback()}} discussed in @ref{Form Events}. @code{@ref{fl_add_event_callback()}} does not alter the window's event mask nor does it solicit events for you. That's mainly for the reason that an event type does not always correspond to a unique event mask, also in this way, the user can solicit events at window's creation and use 0 to register all the event handlers. To let XForms handle solicitation for you, call the following routine @findex fl_activate_event_callbacks() @example void fl_activate_event_callbacks(Window win); @end example @noindent This function activates the default mapping of events to event masks built-in in the Forms Library, and causes the system to solicit the events for you. Note however, the mapping of events to masks are not unique and depending on applications, the default mapping may or may not be the one you want. For example, @code{MotionNotify} event can be mapped into @code{ButtonMotionMask} or @code{PointerMotionMask}. Forms Library will use both. It is possible to control the masks you want precisely by using the following function, which can also be used to add or remove solicited event masks on the fly without altering other masks already selected: @findex fl_addto_selected_xevent() @anchor{fl_addto_selected_xevent()} @findex fl_remove_selected_xevent() @anchor{fl_remove_selected_xevent()} @example long fl_addto_selected_xevent(Window win, long mask); long fl_remove_selected_xevent(Window win, long mask); @end example Both functions return the resulting event masks that are currently selected. If event callback functions are registered via both @code{fl_set_event_callback()} and @code{@ref{fl_add_event_callback()}}, the callback via the latter is invoked first and the callback registered via @code{@ref{fl_set_event_callback()}} is called only if the first attempt is unsuccessful, that is, the handler for the event is not present. For example, after the following sequence @example fl_add_event_callback(winID, Expose, expose_cb, 0); fl_set_event_callback(event_callback); @end example and all @code{Expose} events on window @code{winID} are consumed by @code{expose_cb} then @code{event_callback()} would never be invoked as a result of an @code{Expose} event. To remove a callback, use the following routine @findex fl_remove_event_callback() @example void fl_remove_event_callback(Window win, int xev_type); @end example @noindent All parameters have the usual meaning. Again, this routine does not modify the window's event mask. If you like to change the events the window is sensitive to after removing the callback, use @code{@ref{fl_activate_event_callbacks()}}. If @code{xev_type} is 0, all callbacks for window @code{win} are removed. This routine is called automatically if @code{@ref{fl_winclose()}} is called to unmap and destroy a window. Otherwise, you must call this routine explicitly to remove all event callbacks before destroying a window using @code{XDestroyWindow()}. A program using all of these has the following basic form: @example void event_cb(XEvent *xev, void *mydata1) @{ /* Handles an X-event. */ @} void expose_cb(XEvent *xev, void *mydata2) @{ /* handle expose */ @} void form1_cb(FL_OBJECT *obj) @{ /* Handles object obj in form1. */ @} void form2_cb(FL_OBJECT *obj) @{ /* Handles object obj in form2. */ @} main(int argc, char *argv[]) @{ /* initialize */ /* create form1 and form2 and display them */ fl_set_form_callback(form1, form1cb); fl_set_form_callback(form2, form2cb); /* create your own window, winID and show it */ fl_addto_selected_xevent(winID, ExposureMask | ButtonPressMask |... ); fl_winshow(winID); fl_set_event_callback(event_cb, whatever); fl_add_event_callback(winID, Expose, expose_cb, data); fl_do_forms(); return 0; @} @end example @noindent The routine @code{@ref{fl_do_forms()}} will never return in this case. See @file{demo27.c} for a program that works this way. It is recommended that you set up your programs using callback routines (either for the objects or for entire forms). This ensures that no events are missed, events are treated in the correct order, etc. Note that different event callback routines can be written for different stages of the program and they can be switched when required. This provides a progressive path for building up programs. Another possibility is to use a free object so that the application window is handled automatically by the internal event processing mechanism just like any other forms. @node Handling Other Input Sources @section Handling Other Input Sources It is not uncommon that X applications may require input from sources other than the X event queue. Outlined in this section are two routines in the Forms Library that provide a simple interface to handle additional input sources. Applications can define input callbacks to be invoked when input is available from a specified file descriptor. The function @tindex FL_IO_CALLBACK @findex fl_add_io_callback() @anchor{fl_add_io_callback()} @example typedef void (*FL_IO_CALLBACK)(int fd, void *data); void fl_add_io_callback(int fd, unsigned condition, FL_IO_CALLBACK callback, void *data); @end example @noindent registers an input callback with the system. The argument @code{fd} must be a valid file descriptor on a UNIX-based system or other operating system dependent device specification while @code{condition} indicates under what circumstance the input callback should be invoked. The condition must be one of the following constants @table @code @tindex FL_READ @item FL_READ File descriptor has data available. @tindex FL_WRITE @item FL_WRITE File descriptor is available for writing. @tindex FL_EXCEPT @item FL_EXCEPT an I/O error has occurred. @end table When the given condition occurs, the Forms Library invokes the callback function specified by @code{callback}. The @code{data} argument allows the application to provide some data to be passed to the callback function when it is called (be sure that the storage pointed to by data has global (or static) scope). To remove a callback that is no longer needed or to stop the Forms Library's main loop from watching the file descriptor, use the following function @findex fl_remove_io_callback() @anchor{fl_remove_io_callback()} @example void fl_remove_io_callback(int fd, unsigned condition, FL_IO_CALLBACK callback); @end example The procedures outlined above work well with pipes and sockets, but can be a CPU hog on real files. To workaround this problem, you may wish to check the file periodically and only from within an idle callback. xforms-1.2.4/doc/part2_language_filters.texi0000644000175000017500000000652412202244634016046 00000000000000@node Part II Language Filters @chapter Language Filters @strong{Please note: This chapter is probably completely outdated!} This chapter discusses the language filter support in Form Designer, targeted primarily to the developers of bindings to other language. As of this writing, the authors are aware of the following bindings @table @code @item ada95 by G.@: Vincent Castellano @email{gvc@@ocsystems.com} @item perl by Martin Bartlett @email{martin@@nitram.demon.co.uk} @item Fortran by G.@: Groten @email{zdv017@@zam212.zam.kfa-juelich.de} and Anke Haeming @email{A.Haeming@@kfa-juelich.de} @item pascal by Michael Van Canneyt @email{michael@@tfdec1.fys.kuleuven.ac.be} @item scm/guile by Johannes Leveling @email{Johannes.Leveling@@Informatik.Uni-Oldenburg.DE} @item python by Roberto Alsina @email{ralsina@@ultra7.unl.edu.ar}. It would appear that author of python binding is no longer working on it. @end table These bindings are of varying degree of beta-ness and support. It appears to the authors that the most convenient and flexible way of getting output in the targeted language is through external filters that are invoked transparently by fdesign. This way, developers of the binding would have complete control over the translation of the default output from the fdesign to the target language and at the same time have the translation done transparently. @ifnottex @menu * External Filters:: * Command Line Arguments of the Filter:: @end menu @end ifnottex @node External Filters @section External Filters An external filter is a stand-alone program that works on the output of Form Designer and translates the output to the target language. The filter can elect to work on the @code{.fd} or the C output or both simultaneously. However, in non-testing situations, the c output from Form Designer probably should be deleted by the filter once the translation is complete. By default, Form Designer only outputs the @code{.fd} and C files. If the presence of @code{-ada}, @code{-perl}, @code{-python}, @code{-fortran}, @code{-pascal} or @code{-scm} command line options to Form Designer is detected, then after emitting the default output, Form Designer invokes the the external filter with the root filename (without the @code{.fd} extension) as an argument, together with possible other flags, to the filter. Any runtime error messages are presented to the user in a browser. The filter name by default is @code{fd2xxxx} where @code{xxxx} is the language name (such as @code{fd2perl} etc.), which can be changed using the @code{-filter} command line option (or equivalent resources). The resources that are relevant to the filter are listed below @multitable @columnfractions 0.3 0.3 0.3 Resource Type Default @item language @tab string @tab C @item filter @tab string @tab None @end multitable @node Command Line Arguments of the Filter @section Command Line Arguments of the Filter Form Designer passes along the options that affect the output format to the filter. These options may or may not apply to the filter, most likely not if the filter works on the C file. For those that do not apply, the filter can simply ignore them, but shouldn't stop running because of these options. @table @code @item -callback callback stubs are generated @item -main main stub is generated @item -altformat output in alternate format @item -compensate emit size compensation code @end table xforms-1.2.4/doc/part6_images.texi0000644000175000017500000025351212344275260014013 00000000000000@node Part VI Images @chapter Images Although images are not typically a part of the GUI, they are often part of an application. For this reason and others, image support is part of Forms Library. It is not unusual that the users of a graphical user interface want some graphics support. The most important reason to have image support in the library is the amount of questions/requests on the mailing list of the Forms Library about images. It convinced us that having image support will make many Forms Library users life easier. The second reason has something to do with image support in X, which at best is cumbersome to use as the API reflects the underlying hardware, which, at the level of Xlib, is quite appropriate, but not quite what an application programmer wants to deal with. Image support in Forms Library for the large part is hardware independent. This is possible because xforms makes distinction between the real image it keeps and the image being displayed. At the expense of some flexibility and memory requirement, the high-level image support API should prove to be useful for most situations. The third reason is that image support as it is now in the library is well isolated and is only linked into an application when it is actually being used. This is not a trivial point in the consideration to include image support in the library proper. @ifnottex @menu * The Basic Image Support API:: * The FL_IMAGE Structure:: * Supported image types:: * Creating Images:: * Supported Image Formats:: * Setup and Configuration:: * Simple Image Processing:: * Utilities:: @end menu @end ifnottex @node The Basic Image Support API @section The Basic Image Support API Reading and displaying images are quite easy. It can be as simple as a couple of lines of code: @example FL_IMAGE *image; if ((image = flimage_load("imagefilename")) image->display(image, win); @end example @noindent In this example, an image is created from a file, then the image is displayed in a window, @code{win}. For most casual uses, this is really what is needed to load and display an image. As you may have guessed, an image in Forms Library is represented by a structure of type @code{FL_IMAGE}. In addition to the pixels in the image, it also keeps a variety of information about the image such as its type, dimension, lookup tables etc. Further, if the image can not be displayed directly on the display hardware (for example, the image is 24 bits, while the display is only capable of 8 bits), a separate displayable image is created and displayed. Any manipulation of the image is always performed on the original high-resolution image, and a new displayable image will be created if necessary. Writing an image is just as simple @example if (flimage_dump(image, "filename", "jpeg") < 0) fprintf(stderr,"image write failed"); @end example @noindent In this code snippet, an image in memory is written to a file in JPEG format. As you might have noticed by now, all image routines start with flimage. The exact APIs for reading and writing an image are as follows @findex flimage_load() @anchor{flimage_load()} @findex flimage_dump() @anchor{flimage_dump()} @example FL_IMAGE *flimage_load(const char *filename); int flimage_dump(FL_IMAGE *im, const char *filename, const char *fmt); @end example @noindent The function @code{@ref{flimage_load()}} takes a filename and attempts to read it. If successful, an image (or multiple images) is created and returned. If for any reason the image can't be created (no permission to read, unknown file format, out of memory etc), a null pointer is returned. As will be documented later, error reporting and progress report can be configured so these tasks are performed inside the library. The function @code{@ref{flimage_dump()}} takes an image, either returned by @code{@ref{flimage_load()}} (possibly after some processing) or created on the fly by the application, attempts to create a file to store the image. The image format written is controlled by the third parameter @code{fmt}q, which should be either the formal name or the short name of one of the supported formats (such as jpeg, ppm, gif, bmp etc., see section 23.3) or some other formats the application knows how to write. If this parameter is @code{NULL}, the original format the image was in is used. If the image is successfully written, a non-negative number is returned, otherwise a negative number. Depending on how the image support is configured, error reporting may have already occurred before the function returns. Given these two routines, a file converter (i.e., changing the image file format) is simple @example if ((image = flimage_load("inputfile")) flimage_dump(image, "outfile", "newformat"); @end example @noindent See the demo program @file{iconvert.c} for a flexible and usable image converter. To free an image, use the following routine @findex flimage_free() @anchor{flimage_free()} @example void flimage_free(FL_IMAGE *image); @end example @noindent The function first frees all memory allocated for the image, then the image structure itself. After the function returns, the image should not be referenced. The following routines are available to display an image in a window @findex flimage_display() @anchor{flimage_display()} @findex flimage_sdisplay() @anchor{flimage_sdisplay()} @example int flimage_display(FL_IMAGE *image, FL_WINDOW win); int flimage_sdisplay(FL_IMAGE *image, FL_WINDOW win); @end example @noindent where @code{win} is a window ID. If the image(s) is successfully displayed, a non-negative integer is returned, a negative integer otherwise. The difference between the two display routines is that @code{@ref{flimage_sdisplay()}} only displays a single image while @code{@ref{flimage_display()}}, built on top of @code{flimage_sdisplay()}, can display single or multiple images. For typical use, @code{@ref{flimage_display()}} or @code{image->display} should be used. @code{@ref{flimage_sdisplay()}} is useful only if you're coding your own multi-image display routine. For example, @code{@ref{flimage_display()}} is built roughly like the following @example int flimage_display(FL_IMAGE *im, FL_WINDOW win) @{ int err; for (err = 0; err >=0 && im; im = im->next) @{ err = flimage_sdisplay(im, win); fl_update_display(0); fl_msleep(im->setup->delay); @} return err; @} @end example And you can build your own multi-frame image display routine to suit your application's needs. Despite the display routine's simple look, this function performs tasks that involve the details of dealing with different hardware capabilities, a daunting task for beginners. For PseudoColor displays (i.e., using color maps or color lookup tables), a color quantization or dithering step may be performed by the function to reduce the number of colors in the image (of course, the colorreduced image is kept only for display, the original image is untouched so future processing is carried out on the original full resolution image, rather than the displayed, an approximate of the original image). In general, when the information in an image is reduced in order to display it, the original image is not altered in any way. For example, this function can display a 24bit image on a 1bit display without losing any information on the original 24bit image. By default, the entire image is displayed at the top-left corner of the window. To display the image at other locations within the window (perhaps to center it), use the @code{image->wx} and @code{image->wy} fields of the @code{FL_IMAGE} structure. These two fields specify where in the window the origin of the image should be. By repeatedly changing @code{image->wx} and @code{image->wy} and displaying, image panning can be implemented. It is also possible to display a subimage by specifying non-zero value for @code{(image->sx,image->sy)} and @code{(image->sw, image->sh)}. You can view the image as a 2D space with the origin at the top left corner. The positive y axis of the image space is pointing downward. @code{(image->sx,image->sy)} specify the subimage offset into the image (they must be non-negative) and @code{(image->sw,image->sh)} specify the width and height of the subimage. Taken the window offset and the subimage together, the more accurate statement of the functionality of the the function @code{@ref{flimage_display()}} is that it displays a subimage specified by @code{(image->sx,image->sy)} and @code{(image->sw,image->sh)} starting at @code{(image->wx, image->wy)}. You can also use clipping to display a subimage by utilizing the following functions and @code{image->gc} @example fl_set_gc_clipping(image->gc, x, y, w, h); fl_unset_gc_clipping(image->gc); @end example @noindent where the coordinates are window coordinates. Of course, by manipulating @code{image->gc} directly, more interesting clipping or masking can be achieved. Since the GC is visual dependent, a newly created image before displaying may not yet have a valid GC assoiated with it. If you must set some clipping before displaying, you can set the @code{image->gc} yourself beforehand. Note that you if you free the GC, make sure you reset it to @code{None}. To display an image in a canvas, the following can be used @example flimage_display(image, FL_ObjWin(canvas)); @end example @noindent Since this function only knows about window IDs, and writes to the window directly, it may not be sensitive to the status of the form the canvas is on, e.g., a frozen form. In your application, you should check the status of the form before calling this function. Sometimes it may be useful to find out if a specific file is an image file before attempting to read it (for example, as a file filter). To this end, the following routine exists @findex flimage_is_supported() @anchor{flimage_is_supported()} @example int flimage_is_supported(const char *file); @end example @noindent The function returns true if the specified file is a known image file. If the file is not a known image or not readable for any reason, the function return 0. @node The FL_IMAGE Structure @section The @code{FL_IMAGE} Structure Before we go into more details on image support, some comments on the image structure are in order. The image structure contains the following basic fields that describe fully the image in question and how it should be displayed. @tindex FL_IMAGE @tindex FL_PCBITS @tindex FL_PCMAX @tindex FL_PACKED @example typedef unsigned char FL_PCTYPE; /* primary color type */ #define FL_PCBITS 8 /* primary color bits */ #define FL_PCMAX ((1<map len}. Although @code{alpha lut} is always allocated for a color index image, it's currently not used by the Forms Library. @item map_len The length of the colormap (lookup table). @item app_background A packed RGB value indicating the preferred color to use for the background of an image (also known as transparent color). This field is initialized to an illegal value. Since there is no portable way to obtain the window background the application has to set this field if transparency is to be achieved. In future versions of image support, other means of doing transparency will be explored and implemented. @item wx, wy The window offset to use to display the image. @item sx, sy, sw, sh The subimage to display. @item comments This is typically set by the loading routines to convey some information about the image. The application is free to choose how to display the comment, which may have embedded newlines in it. @item io_spec This field is meant for the reading/writing routine to place format specific state information that otherwise needs to be static or global. @item spec_size This field should be set to the number of bytes @code{io_spec} contains. @item display A function you can use to display an image. The image loading routine sets this function. @item next This is a link to the next image. This is how @code{@ref{flimage_load()}} chains multiple image together. @item double_buffer If true, the display function will double-buffer the image by using a pixmap. For typical image display it's not necessary to enable double-buffering as it is very expensive (memory and speed). Double-buffering may be useful in image editing. @item pixmap The backbuffer pixmap if double-buffered. @end table Although it is generally not necessary for an application to access individual pixels, the need to do so may arise. In doing so, it is important to consult the @code{image->type} field before dereferencing any of the pixel field. That is, you should access @code{image->ci} only if you know that the image type is @code{FL_IMAGE_CI} or @code{FL_IMAGE_MONO}. @node Supported image types @section Supported image types Forms Library supports all common and not-so-common image types. For example, the supported images range from the simple @w{1 bit} bitmap to full @w{24 bit} RGB images. @w{12 bit} gray scale images (common in medical imaging) are also supported. The supported image types are denoted using the following constants, all of them (except @code{FL_IMAGE_FLEX}) using a different bit, so they can be bitwise ORed together: @tindex FL_IMAGE_MONO @tindex FL_IMAGE_GRAY @tindex FL_IMAGE_GRAY16 @tindex FL_IMAGE_CI @tindex FL_IMAGE_RGB @tindex FL_IMAGE_PACKED @tindex FL_IMAGE_FLEX @example FL_IMAGE_MONO, /* 1 bit bitmaps */ FL_IMAGE_GRAY, /* gray-scale image (8 bit) */ FL_IMAGE_GRAY16, /* gray-scale image (9 to 16 bit) */ FL_IMAGE_CI, /* generic color index image */ FL_IMAGE_RGB, /* 24 bit RGB(A) image */ FL_IMAGE_PACKED, /* 24 bit RGB(A) image. Packed storage */ FL_IMAGE_FLEX, /* All of the above */ @end example For the @w{24 bit} variety another @w{8 bit} (@code{image->alpha} and the top-most byte of the packed integer) is available for the application, perhaps storing the alpha values into it. The Forms Library does not modify or reference this extra byte. Mono (b&w) images are stored as a colormap image with a lut of length 2. The @code{FL_IMAGE_FLEX} type is mainly for the reading and loading routines to indicate the types they are capable of handling. For example, if you're coding an output routine, you use @code{FL_IMAGE_FLEX} to indicate that the output routine can take any type the image. Otherwise the driver will convert the image type before handing the image over to the actual output routine. In displaying an image of type @code{FL_IMAGE_GRAY16}, window leveling, a technique to visualize specific ranges of the data, is employed. Basically, you specify a window level (@code{level}) and a window width (@code{wwidth}) and the display function will map all pixels that fall within @code{level-width/2} and @code{level+width/2} linearly to the whole dynamic range of the intensities the hardware is capable of displaying. For example, if the display device can only display 256 shades of gray, @code{level-width/2} is mapped to 0 and @code{level+width/2} is mapped to 255, and pixels values between @code{level-width/2} and @code{level+width/2} are linearly mapped to values between 0 and 255. Pixel values that fall below @code{level-width/2} are mapped to zero and those that larger than @code{level+width/2} are mapped to 255. Use the following routine to set the window level @findex flimage_windowlevel() @anchor{flimage_windowlevel()} @example int flimage_windowlevel(FL_IMAGE *im, int level, int wwidth); @end example @noindent The function returns 1 if window level parameters are modified, otherwise 0 is returned. Setting @code{wwidth} to zero disables window leveling. Note that if @code{im} points to a multiple image, window level parameters are changed for all images. To obtain the image type name in string format, e.g., for reporting purposes, use the following routine @findex flimage_type_name() @anchor{flimage_type_name()} @example const char *flimage_type_name(int type); @end example To convert between different types of images, the following routine is available @findex flimage_convert() @anchor{flimage_convert()} @example int flimage_convert(FL_IMAGE *image, int newtype, int ncolors); @end example @noindent The parameter @code{newtype} should be one of the supported image types mentioned earlier in this section. Parameter @code{ncolors} is meaningful only if @code{newtype} is @code{FL_IMAGE_CI}. In this case, it specifies the number of colors to generate, most likely from a color quantization process. If the conversion is successful a non-negative integer is returned, otherwise a negative integaer. Depending on which quantization function is used, the number of quantized colors may not be more than 256. To keep information loss to a minimum, @code{@ref{flimage_convert()}} may elect to keep the original image in memory even if the conversion is successful. For example, converting a full color image (@w{24 bit}) into a @w{8 bit} image and then converting back can lose much information of the image if the converting function does not keep the original image. What this means is that the following sequence gets back the original image @example /* the current image is RGB. Now we reduce the full color image to 8 bit color index image. The conversion routine will keep the 24 bit color. */ flimage_convert(image, FL_IMAGE_CI, 256); /* Now convert back to RGB for image processing. The con- version routine will notice that the input image was originally converted from a 24bit image. Instead of doing the conversion, it simply retrieves the saved image and returns. */ flimage_convert(image, FL_IMAGE_RGB, 0); @end example @noindent This behavior might not always be what the application wants. To override it, you can set @code{image->force_convert} to 1 before calling the conversion routine. Upon function return the flag is reset to zero. @node Creating Images @section Creating Images With the basic fields in the image structure and image types explained, we're now in a position to tackle the problem of creating images on the fly. The data may have come from some simulations or some other means, the task now is to create an image from the data and try to display/visualize it. The first task involved in creating an image is to create an image structure that is properly initialized. To this end, the following routine is available @findex flimage_alloc() @anchor{flimage_alloc()} @example FL_IMAGE *flimage_alloc(void); @end example @noindent The function returns a pointer to a piece of dynamically allocated memory that's properly initialized. The task next is to put the existing data into the structure. This involves several steps. The first step is to figure out what type of image to create. For scalar data, there are two logical choices, either a gray-scale intensity image or a color index image with the data being interpreted as indices into some lookup table. Both of these may be useful. Gray-scale imagse are straight forward to create and the meaning of the pixel values is well defined and understood. On the other hand with color-mapped image you can selectively enhance the data range you want to visualize by choosing appropriate color-maps. For vector data, RGB image probably makes most sense. In any case it's strictly application's decision. All that is needed to make it work with Forms Library is to set the @code{image->type} field to a valid value. Of course the image dimension (width and height) also needs to be set. Once this is done, we need to copy the data into the image structure. Before we copy the data we create the destination storage using one of the following routines @findex fl_get_matrix() @anchor{fl_get_matrix()} @findex flimage_getmem() @anchor{flimage_getmem()} @example void *fl_get_matrix(int nrows, int ncols, unsigned int elem_size); int flimage_getmem(FL_IMAGE *image); @end example @noindent The @code{@ref{fl_get_matrix()}} function creates a 2-dimensional array of entities of size @code{elem_size}. The array is of @code{nrows} by @code{ncols} in size. The 2D array can be passed as a pointer to pointer and indexed as a real 2D arrays. The @code{@ref{flimage_getmem()}} routine allocates the proper amount of memory appropriate for the image type, including colormaps when needed. After the destination storage is allocated, copying the data into it is simple @example image->type = FL_IMAGE_GRAY; image->w = data_columns; image->h = data_row; flimage_getmem(image); /* or you can use the instead im->gray = fl_get_matrix(im->h, im->w, sizeof **im->gray); */ for (row = 0; row < image->h; row++) for (col = 0; col < image->w; col++) image->gray[row][col] = data_at_row_and_col; @end example Of course, if data is stored row-by-row, a @code{memcpy(3)} instead of a loop over columns may be more efficient. Also if your data are stored in a single array, @code{@ref{fl_make_matrix()}} might be a lot faster as it does not copy the data. If the created image is a color index image, in addition to copying the data to @code{image->ci}, you also need to set the lookup table length @code{image->map_len}, which should reflect the dynamic range of the data: @example image->type = FL_IMAGE_CI; image->w = A; image->h = B; image->map_len = X; flimage_getmem(image); /* this will allocate ci and lut */ for (row = 0; row < image->h; row++) for (col = 0; col < image->w; col++) image->ci[row][col] = data; for (i = 0; i < image->map_len; i++) @{ image->red_lut[i] = some_value_less_than_FL_PCMAX; image->green_lut[i] = some_value_less_than_FL_PCMAX; image->blue_lut[i] = some_value_less_than_FL_PCMAX; @} @end example If the type is @code{FL_IMAGE_GRAY16}, you also need to set @code{image->gray_maxval} to the maximum value in the data. Now we're ready to display the image @example flimage_display(image, win); @end example As mentioned before, the display routine may create a buffered, display hardware specific and potentially lower-resolution image than the original image. If for any reason, you need to modify the image, either the pixels or the lookup tables, you need to inform the library to invalidate the buffered image: @example image->modified = 1; @end example @node Supported Image Formats @section Supported Image Formats There are many file formats for image storage. The popularity, flexibility and cleanness of the different formats varies. Forms Library supports several popular ones, but these are not the only ones that are popular. Toward the end of this section, it will be outlined how to extend the image support in the Forms Library so more image file can be read by @code{@ref{flimage_load()}}. @ifnottex @menu * Built-in support:: * Adding New Formats:: * Queries:: @end menu @end ifnottex @node Built-in support @subsection Built-in support Each image file format in Forms Library is identified by any one of three pieces of information, the formal name, the short name, and the file extension. For example, for the GIF format, the formal name is @code{"CompuServe GIF"}@footnote{The Graphics Interchange Format (c) is the Copyright property of CompuServe Incorporated. GIF(sm) is a Service Mark property of CompuServe Incorporated.}, the short name is @code{"GIF"}, and file extension is @code{"gif"}. This information is used to specify the output format for @code{@ref{flimage_dump()}}. The following table summarizes the supported file formats with comments @multitable @columnfractions 0.35 0.2 0.2 0.3 @headitem FormalName @tab ShortName @tab Extension @tab Comments @item Portable Pixmap @tab ppm @tab ppm @item Portable Graymap @tab pgm @tab pgm @item Portable Bitmap @tab pbm @tab pbm @item CompuServe GIF @tab gif @tab gif @item Windows/OS2 BMP file @tab bmp @tab bmp @item JPEG/JFIF format @tab jpeg @tab jpg @item X Window Bitmap @tab xbm @tab xbm @item X Window Dump @tab xwd @tab xwd @item X PixMap @tab xpm @tab xpm @tab XPM3 only @item NASA/NOST FITS @tab fits @tab fits @tab Standard FITS and IMAGE extension @item Portable Network Graphics @tab png @tab png @tab needs netpbm @item SGI RGB format @tab iris @tab rgb @tab need pbmplus/netpbm package @item PostScript format @tab ps @tab ps @tab needs gs for reading @item Tagged Image File Format @tab tiff @tab tif @tab no compression support @end multitable @findex flimage_enable_bmp() @anchor{flimage_enable_bmp()} @findex flimage_enable_pnm() @anchor{flimage_enable_pnm()} @findex flimage_enable_genesis() @anchor{flimage_enable_genesis()} @findex flimage_enable_fits() @anchor{flimage_enable_fits()} @findex flimage_enable_gif() @anchor{flimage_enable_gif()} @findex flimage_enable_gzip() @anchor{flimage_enable_gzip()} @findex flimage_enable_jpeg() @anchor{flimage_enable_jpeg()} @findex flimage_enable_png() @anchor{flimage_enable_png()} @findex flimage_enable_ps() @anchor{flimage_enable_ps()} @findex flimage_enable_sgi() @anchor{flimage_enable_sgi()} @findex flimage_enable_tiff() @anchor{flimage_enable_tiff()} @findex flimage_enable_xbm() @anchor{flimage_enable_xbm()} @findex flimage_enable_xpm() @anchor{flimage_enable_xpm()} @findex flimage_enable_xwd() @anchor{flimage_enable_xwd()} To avoid executable bloating with unnecessary code, only ppm, pgm, pbm and compression filters (gzip and compress) are enabled by default. To enable other formats, call @code{flimage_enable_xxx()} once anywhere after @code{@ref{fl_initialize()}}, where @code{xxx} is the short name for the format. For example, to enable BMP format, @code{flimage_enable_bmp()} should be called. Further, if you enable GIF support, you're responsible for any copyright/patent and intellectual property dispute arising from it. Under no circumstance should the authors of the Forms Library be liable for the use or misuse of the GIF format. Usually there are choices on how the image should be read and written. The following is a rundown of the built-in options that control some aspects of image support. Note that these options are persistent in nature and once set they remain in force until reset. @tindex FLIMAGE_JPEG_OPTIONS @findex flimage_jpeg_output_options() @anchor{flimage_jpeg_output_options()} @example typedef struct @{ int quality; int smoothing; @} FLIMAGE_JPEG_OPTIONS; void flimage_jpeg_output_options(FLIMAGE_JPEG_OPTIONS *option); @end example @noindent The default quality factor for JPEG output is 75. In general, the higher the quality factor rhe better the image is, but the file size gets larger. The default smoothing factor is 0. @findex flimage_pnm_output_options() @anchor{flimage_pnm_output_options()} @example void flimage_pnm_output_options(int raw_format); @end example For PNM (ppm, pgm, and pbm) output, two variants are supported, the binary (raw) and ASCII format. The raw format is the default. If the output image is of type @code{FL_IMAGE_GRAY16}, ASCII format is always output. @findex flimage_gif_output_options() @anchor{flimage_gif_output_options()} @example void flimage_gif_output_options(int interlace); @end example @noindent If @code{interlace} is true, an interlaced output is generated. Transparency, comments, and text are controlled, respectively, by @code{image->tran_rgb}, @code{image->comments} and @code{image->text}. PostScript options affect both reading and writing. @findex flimage_ps_options() @anchor{flimage_ps_options()} @example FLIMAGE_PS_OPTION *flimage_ps_options(void); @end example @noindent where the control structure has the following members @table @code @item int orientation The orientation of the generated image on paper. Valid options are @code{FLPS_AUTO}, @code{FLPS_PORTRAIT} and @code{FLPS_LANDSCAPE}. The default is @code{FLPS_AUTO}. @item int auto_fit By default, the output image is scaled to fit the paper if necessary. Set it to false (0) to turn auto-scaling off. @item float xdpi, ydpi These two are the screen resolution. Typical screens these days have resolutions about @w{80 dpi}. The settings of these affect both reading and writing. @item float paper_w The paper width, in inches. The default is @w{8.5 in}. @item float paper_h The paper height, in inches. The default is @w{11.0 in} @item char* tmpdir A directory name where temporary working files go. The default is @file{/tmp}. @item float hm, vm Horizontal and vertical margins, in inches, to leave when writing images. The default is @w{0.4 in} (about @w{1 cm}). @item float xscale Default is 1.0. @item float yscale Default is 1.0. @item int first_page_only If set, only the first page of the document will be loaded even if the document is multi-paged. The default setting is false. @end table To change an option, simply call @code{@ref{flimage_ps_options()}} and change the field from the pointer returned by the function: @example void SetMyPageSize(float w, float h) @{ FLIMAGE_PS_OPTION *options = flimage_ps_options(); options->paper_w = w; options->paper_h = h; @} @end example All these option setting routines can be used either as a configuration routine or an image-by-image basis by always calling one of these routines before @code{@ref{flimage_dump()}}. For example, @example flimage_jpeg_output_options(option_for_this_image); flimage_dump(im, "file","jpeg"); @end example You can also utilize the @code{image->pre_write} function to set the options. This function, if set, is always called inside @code{@ref{flimage_dump()}} before the actual output begins. @node Adding New Formats @subsection Adding New Formats It is possible for application to add new formats to the library so @code{@ref{flimage_load()}} and @code{@ref{flimage_dump()}} know how to handle them. Basically, the application program tells the library how to identify the image format, and the image dimension, and how to read and write pixels. The API for doing so is the following @tindex FLIMAGE_Identify @tindex FLIMAGE_Description @tindex FLIMAGE_Read_Pixels @tindex FLIMAGE_Write_Image @findex flimage_add_format() @anchor{flimage_add_format()} @example typedef int (*FLIMAGE_Identify) (FILE *); typedef int (*FLIMAGE_Description) (FL_IMAGE *); typedef int (*FLIMAGE_Read_Pixels) (FL_IMAGE *); typedef int (*FLIMAGE_Write_Image) (FL_IMAGE *); int flimage_add_format(const char *formal_name, const char *short_name, const char *extension, int type, FLIMAGE_Identify identify, FLIMAGE_Description description, FLIMAGE_Read_Pixels read_pixels, FLIMAGE_Write_Image write_image); @end example @noindent where we have @table @code @item formal_name The formal name of the image format @item short_name An abbreviated name for the image format @item extension File extension, if this field is @code{NULL}, @code{short_name} will be substituted @item type The image type. This field generally is one of the supported image types (e.g., @code{FL_IMAGE_RGB}), but it does not have to. For image file formats that are capable of holding more than one type of images, this field can be set to indicate this by ORing the supported types together (e.g., @code{FL_IMAGE_RGB|FL_IMAGE_GRAY}). However, when description returns, the image type should be set to the actual type in the file. @item identify This function should return 1 if the file pointed to by the file pointer passed in is the expected image format (by checking signature etc.). It should return a negative number if the file is not recognized. The decision if the file pointer should be rewound or not is between this function and the description function. @item description This function in general should set the image dimension and type fields (and colormap length for color index images) if successful, so the driver can allocate the necessary memory for read pixel. Of course, if @code{read_pixels} elects to allocate memory itself, the @code{description} function does not have to set any fields. However, if reading should continue, the function should return 1 otherwise a negative number. The function should read from input file stream @code{image->fpin}. It is likely that some information obtained in this function needs to be passed to the actual pixel reading routine. The easiest way is, of course, to make these information static within the file, but if a GUI system is in place, all the reading routines should try to be reentrant. The method to avoid static variables is to use the @code{image->io_spec} field to keep these information. If this field points to some dynamically allocated memory, you do not need to free it after @code{read_pixels} function finishes. However, if you free it or this field points to static memory, you should set to this field to @code{NULL} when finished. The following is a short example showing how this field may be utilized. @example typedef struct @{ int bits_per_pixel; int other_stuff; @} SPEC; static int description(FL_IMAGE *im) @{ SPEC *sp = fl_calloc(1, sizeof *sp); im->io_spec = sp; im->spec_size = sizeof *sp; sp->bits_per_pixel = read_from_file(im->fpin); return 0; @} static int read_pixels(FL_IMAGE *im) @{ SPEC *sp = im->io_spec; int bits_per_pixel = sp->bits_per_pixel; read_file_based_on_bits_per_pixel(im->fpin); /* You don't have to free im->io_spec, but if you do remember to set it to NULL before returning */ return 0; @} @end example @item read_pixels This function reads the pixels from the file and fills one of the pixel matrix in the image structure depending on the type. If reading is successful, a non-negative number should be returned otherwise a negative number should be returned. Upon entry, @code{image->completed} is set to zero. The function should not close the file. @item write_image This function takes an image structure and should write the image out in a format it knows. Prior to calling this routine, the driver will have already converted the image type to the type it wants. The function should return 1 on success and a negative number otherwise. If only reading of the image format is supported this parameter can be set to @code{NULL}. The function should write to file stream @code{image->fpout}. @end table By calling @code{@ref{flimage_add_format()}} the newly specified image format is added to a "recognized image format" pool in the library. When @code{@ref{flimage_load()}} is called the library, after verifying that the file is readable, loops over each of the formats and calls the @code{identify} routine until a format is identified or the pool exhausted. If the file is recognized as one of the supported formats the @code{description} routine is called to obtain the image dimension and type. Upon its return the library allocates all memory needed, then calls @code{read_pixels}. If the image format pool is exhausted before the file is recognized @code{@ref{flimage_load()}} fails. On output, when @code{@ref{flimage_dump()}} is called, the requested format name is used to look up the output routine from the image format pool. Once an output routine for the requested format is found, the library looks the image type the output is capable of writing. If the current image type is not among the types supported by the format the library converts image to the type needed prior to calling the output routine @code{write_image()}. So what @code{@ref{flimage_dump()}} does is @example int flimage_dump(FL_IMAGE *im, const char *filename, const char *formatName) @{ format = search_image_format_pool(formatName); if (!format) return -1; im->fpout = fopen(filename); if (im->pre_write) im->pre_write(im); convert image type if necessary(im); format->write_pixels(im); ... @} @end example If the name of the image format supplied by @code{@ref{flimage_add_format()}} is identical to one that is already supported, the new routines replace those that are in the pool. This way, the application can override the built-in supports. For a non-trivial example of adding a new format, see file @file{flimage_jpeg.c}. Another way of adding image formats is through external filters that convert an unsupported format into one that is. All you need to do is inform the library what external filter to use. @code{pbmplus} or @code{netpbm} are excellent packages for this purpose. The library has two functions that deal with external filters @findex flimage_description_via_filter() @anchor{flimage_description_via_filter()} @findex flimage_write_via_filter() @anchor{flimage_write_via_filter()} @example int flimage_description_via_filter(FL_IMAGE * im, char *const *cmds, const char *what, int verbose); int flimage_write_via_filter(FL_IMAGE *im, char *const *cmds, char *const formats[], int verbose); @end example @noindent where @code{cmds} are a list of shell commands (filters) that convert the format in question into one of the supported formats. Parameter @code{what} is for reporting purposes and parameter @code{verbose} controls if some information and error messages should be printed. This is mainly for debugging purposes. Let us go through one example to show how this filter facility can be used. In this example, we support SGI's rgb format via the @code{netpbm} package. As with regular image format, we first define a function that identifies the image format: @example static int IRIS_identify(FILE *fp) @{ char buf[2]; fread(buf, 1, 2, fp); return (buf[0] == '\001' && buf[1] == '\332') || (buf[0] == '\332' && buf[1] == '\001'); @} @end example Then we need to define the filter(s) that can convert a RGB file into one that's supported. Here we use @code{sgitopnm}, but you can use diferent filters if available. Function @code{@ref{flimage_description_via_filter()}} will try all the filters specified until one of them succeeds. If none does an error code is returned: @example static int IRIS_description(FL_IMAGE *im) @{ static char *cmds[] = @{"sgitopnm %s > %s", NULL /* sentinel, indicating end of list of filters */ @}; return flimage_description_via_filter(im, cmds, "Reading RGB...", 0); @} @end example All commands should be suitable format strings for function @code{sprintf()} and contain @code{%s} twice. The first one will be replaced by the input file name, the second by a filename which will be supplied by the library to hold the converted image. The list must be terminate with a @code{NULL} element. In the above example, @code{sgitopnm %s > %s} specifies the external command, @code{sgitopnm}, and how it operates. Basically, the library will do a @code{sprintf(cmdbuf, cmd[i], irisfile, tmpfile)} and then execute @code{cmdbuf}. There is really no need for a load function as the filter will have already invoked the correct load function when it returns. For the record of capability queries, a dummy load function is needed: @example static int IRIS_load(FL_IMAGE * im) @{ fprintf(stderr, "We should never get here...\n"); return -1; @} @end example Writing an image is similar: @example static int IRIS_dump(FL_IMAGE *im) @{ static char *cmds[] = @{"pnmtosgi %s > %s", NULL@}; static char *cmds_rle[] = @{"pnmtosgi -rle %s > %s", NULL@}; static char *formats[] = @{"ppm", "pgm", "pbm", NULL@}; return flimage_write_via_filter(im, rle ? cmds_rle : cmds, formats, 0); @} @end example Again, the external commands should accept two arguments. The first argument will be supplied by the library, a temporary file that holds the converted image in a format the filter understands, and the second argument will be the requested output filename. For output, an additional argument is required. The additional argument @code{formats} specifies the image format accepted by the external filter. In this case, this is the pnm format. It is important that if the filter accepts more than one format, you should specify the formats in decreasing generality, i.e., ppm, pgm, pbm. With these functions in place, finally we're ready to add iris support into the library @example void add_iris(void) @{ flimage_add_format("SGI Iris", "iris", "rgb", FL_IMAGE_RGB|FL_IMAGE_GRAY|FL_IMAGE_MONO, IRIS_identify, IRIS_description, IRIS_load, IRIS_dump); @} @end example @noindent After a call of @code{add_iris()} you can now use @code{@ref{flimage_load()}} and @code{@ref{flimage_dump()}} to read and write SGI iris format just like any other format. @node Queries @subsection Queries Since the number of formats supported by the library is dynamic in nature, some query routines are available to obtain support information. To obtain the number of currently supported image formats, use the routine @findex flimage_get_number_of_formats() @anchor{flimage_get_number_of_formats()} @example int flimage_get_number_of_formats(void); @end example @noindent The functions returns the number of formats supported, for reading or writing or both. To obtain detailed information for each format, the following can be used @tindex FLIMAGE_FORMAT_INFO @findex flimage_get_format_info() @anchor{flimage_get_format_info()} @example typedef struct @{ const char * formal_name; const char * short_name; const char * extension; int type; int read_write; int annotation; @} FLIMAGE_FORMAT_INFO; const FLIMAGE_FORMAT_INFO *flimage_get_format_info(int n); @end example where parameter @code{n} is an integer between 1 and the return value of @code{@ref{flimage_get_number_of_formats()}} . Upon function return a static buffer is returned containing the basic information about the image. The read_write field can be one of the following combinations thereof @table @code @item FLIMAGE_READABLE supports reading @item FLIMAGE_WRITABLE supports writing @end table @noindent or the bitwise OR of both. These two routines are most useful for reporting or presenting capabilities to the user @example FLIMAGE_FORMAT_INFO *info; int n = flimage_get_number_of_formats(); fprintf(stderr,"FL supports the following format\n"); for (; n; n--) @{ info = flimage_get_format_info(n); fprintf(stderr,"%s format\t(%c%c)\n", info->short_name, (info->read_write & FLIMAGE_READABLE) ? 'r' : ' ', (info->read_write & FLIMAGE_WRITABLE) ? 'w' : ' '); @} @end example @node Setup and Configuration @section Setup and Configuration Although the image support is designed with integration into a GUI system in mind, it neither assumes what the GUI system is nor does it need a GUI system to work. As a matter of fact, for the most part it doesn't even need an X connection to work (obviously without a connection, you won't be able to display images). For this reason, some of the typical (and necessary) tasks, such as progress and error reporting, are by default implemented only to use text output (i.e., to @code{stderr}). Obviously, with a GUI in place this is not quite adequate. Hooks are available for application program to re-define what to do with these tasks. The interface to the library configuration is as follows @findex flimage_setup() @anchor{flimage_setup()} @example void flimage_setup(FLIMAGE_SETUP *setup); @end example @noindent where the parameter @code{setup} is a pointer to a structure defined as follows: @tindex FLIMAGE_SETUP @example typedef struct @{ void * app_data; int (*visual_cue) (FL_IMAGE *im, const char *msg); void (*error_message) (FL_IMAGE *im, const char *msg); const char * rgbfile; int do_not_clear; int max_frames; int delay; int double_buffer; int add_extension; @} FLIMAGE_SETUP; @end example @noindent with @table @code @item app_data The application can use this field to set a value so the field @code{image->app_data} in all image structures returned by the library will have this value. It's most useful to set this field to something that's persistent during the application run, such as the @code{fdui} structure of the main control panel. Note that @code{image->app_data} is different from @code{image->u_vdata} in that all image structures returned by the library have the same value of @code{image->app_data}, which is set by the library. In contrast, @code{image->u_vdata} is set by the application on an image-by-image basis. @item visual_cue This is the function that will be called by all image reading, writing and processing routines. The function is meant to give the user some visual feedback about what is happening. For lengthy tasks, this function is called repeatedly and periodically to indicate what percentage of the task is completed and to give the application program a chance to check and process GUI activities (for example, via @code{@ref{fl_check_forms()}}). The first parameter to the function is the image currently being worked on and the second parameter is a short message, indicating the name of the task, such as "Reading JPG" etc. Two fields in the image structure can be used to obtain progress information. The member fields @code{image->total} indicates the total amount of work to be done in some arbitrary units (usually number of rows in the image). @code{image->completed} indicates how much of the task has been completed. The percentage of how much is completed is then simply the ratio of @code{image->completed} and @code{image->total}, multiplied by 100. At the begin of a task @code{image->completed} is set to a value less or equal 1, and at the end of the task, @code{image->completed} is set to @code{image->total}. A special value of -1 for @code{image->completed} may be used to indicate a task of unknown length. @item error_message This is a function that is called when an error (of all severities) has occurred inside the library. It is recommanded that the application provide a means to show the messages to the user by sypplying this function. The first parameter is a pointer to the image that's being worked on, and the second parameter is a brief message, such as "memory allocation failed" etc. A convenience function, @findex flimage_error() @anchor{flimage_error()} @code{@ref{flimage_error()}}, is provided to call the error message handler. @item rgbfile This field should be set to the full path to the color name database (@file{rgb.txt}) if your system has it in non-standard locations. On most systems, this file is @file{/usr/lib/X11/rgb.txt}, which is the default if this field is not set.@footnote{The routine where this field is used searches some more locations than the default and should work on most systems automagically.} @item do_not_clear By default, @code{@ref{flimage_display()}} clears the window before displaying the image. Set this member to 1 to disable window clearing. @item no_auto_extension By default, @code{@ref{flimage_dump()}} changes the filename extension to reflect the format. Set this member to 1 to disable extension substitution. @item double_buffer If set, all image display will by default double-buffered. Double-buffering an image is very expensive (in terms of both resource and speed) as the backbuffer is simulated using a pixmap. If there are no annotations, double-buffering an image does not really improve anything. It is far better to turn double-buffering on and off on a image-by-image basis using the @code{image->double_bufffer} field. @item max_frames This field specifies the maximum number of frames to read by @code{@ref{flimage_load()}}. The default maximum is 30 frames. @item delay This field specifies the delay (in milliseconds) between successive frames. It is used by the @code{@ref{flimage_display()}} routine. @end table Note that it is always a good idea to clear the setup structure before initializing and using it @example FLIMAGE_SETUP mysetup; memset(mysetup, 0, sizeof mysetup); mysetup.max_frames = 100; mysetup.delay = 10; flimage_setup(&mysetup); @end example It is possible to modify the image loading process by utilizing the following routines @code{@ref{flimage_load()}} is based on: @findex flimage_open() @anchor{flimage_open()} @example FL_IMAGE *flimage_open(const char *name); @end example @noindent This function takes a file name and returns an image sturcture pointer if the file is a recognized image file. Otherwise @code{NULL} is returned. The function @findex flimage_read() @anchor{flimage_read()} @example FL_IMAGE *flimage_read(FL_IMAGE *im); @end example @noindent takes an image structure returned by @code{@ref{flimage_open()}} and fills the image structure. Between @code{@ref{flimage_open()}} and @code{@ref{flimage_read()}} you can inspect or modify fields in the image structure. @findex flimage_close() @anchor{flimage_close()} @example int flimage_close(FL_IMAGE *im); @end example @noindent This function closes all file streams used to create the image. @node Simple Image Processing @section Simple Image Processing Some simple image processing capabilities are present in the Forms Library image support. All the image processing routines take an image as a parameter and process it in place. If appropriate, only the subimage specified by @code{(image->subx, image->suby)} and @code{(image->subw, image->subw)} is affected (note these are different fields from those for subimage displaying). The subimage fields are best set via user interaction, perhaps by having a rubber band that the user can drag to set the size. In the following, each routine will be briefly explained. @ifnottex @menu * Convolution:: * Tint:: * Rotation:: * Image Flipping:: * Cropping:: * Scaling:: * Warping:: * General Pixel Transformation:: * Image Annotation:: * Write Your Own Routines:: @end menu @end ifnottex @node Convolution @subsection Convolution Convolution or filtering can be done easily using the following routine @findex flimage_convolve() @anchor{flimage_convolve()} @example int flimage_convolve(FL_IMAGE *im, int **kernel, int krow, int kcol); @end example This function takes a convolution kernel of @code{krow} by @code{kcol} and convolves it with the image. The result replaces the input image. The kernel size should be odd. If successful, the function returns a positive integer, otherwise a negative number. The kernel should be allocated by @code{@ref{fl_get_matrix()}}. To use a kernel that's a C 2-dimensional array (cast to a pointer to int), use the following function @findex flimage_convolvea() @anchor{flimage_convolvea()} @example int flimage_convolvea(FL_IMAGE *im, int *kernel, int krow, int kcol); @end example The difference between these two functions is in their usage syntax: @example int **kernel1 = fl_get_matrix(sizeof **kernel, n, m); int kernel2[n][m]; kernel1[x][y] = z; kernel2[x][y] = z; flimage_convolve(im, kernel1, n, m); flimage_convolvea(im, (int*) kernel2, n, m); /* note the cast */ @end example Two special built-in kernels are designated with the following symbolic constants @table @code @tindex FLIMAGE_SMOOTH @item FLIMAGE_SMOOTH indicates a 3 by 3 smoothing kernel @tindex FLIMAGE_SHARPEN @item FLIMAGE_SHARPEN indicates a 3 by 3 sharpening kernel @end table @node Tint @subsection Tint Tint as implemented in the Forms Library emulates the effect of looking at an image through a piece of colored glass. You can specify the color and transparency of the glass: @findex flimage_tint() @anchor{flimage_tint()} @example int flimage_tint(FL_IMAGE *im, unsigned int packed, double opacity); @end example where the parameter @code{packed} is a packed RGB color, specifying the color of the glass. @code{opacity} specifies how much the color of the image is absorbed by the glass. A value of 0 means the glass is totally transparent, i.e., the glass has no effect3, while a value of 1.0 means total opaqueness, i.e., all you see is the color of the glass. Any value between these two extremes results in a color that is a combination of the pixel color and the glass color. For example, to tint a part of the image bluish, you can set @code{packed} to @code{FL_PACK(0,0,200)} and use an opacity of 0@footnote{Strictly speaking, a piece of glass that is totally transparent can't have colors.}. Tint is most useful in cases where you want to put some annotations on the image, but do not want to use a uniform and opaque background that completely obscures the image behind. By using tint, you can have a background that provides some contrast to the text, yet not obscures the image beneath completely. Tint operation uses the subimage settings. @node Rotation @subsection Rotation Image rotation can be easily done with the following routine @findex flimage_rotate() @anchor{flimage_rotate()} @example int flimage_rotate(FL_IMAGE *im, int angle, int subpixel); @end example @noindent where @code{angle} is the angle in one-tenth of a degree (i.e., a 45 degree rotation should be specified as 450) with a positive sign for counter-clock rotation. The parameter @code{subpixel} should be one of the following, specifying if subpixel sampling should be enabled. It can be set to either @tindex FLIMAGE_NOSUBPIXEL @code{FLIMAGE_NOSUBPIXEL} or @tindex FLIMAGE_SUBPIXEL @code{FLIMAGE_SUBPIXEL}. If subpixel sampling is enabled, the resulting image pixels are interpolated from the original pixels. This usually has an "anti-aliasing" effect that leads to less severe jagged edges and similar artifacts commonly encountered in rotations. However, it also means that a color indexed image gets converted to a RGB image. If preserving the pixel value is important, you should not turn subpixel sampling on. @code{@ref{flimage_rotate()}} return a negative number if it for some reason (usually due to running out of memory) fails to perform the rotation. Since the rotated image has to be on a rectangular grid, the regions that are not occupied by the image are filled with a fill color, where the default is black. If a different fill color is desired you can set the @code{image->fill_ccolor} field to a packed RGB color before calling the rotation function. Note that even for color indexed images the fill color should be specified in RGB. The rotation function will search the colormap for the appropriate index if no subpixel sampling is used. Repeated rotations should be avoided if possible. If you have to call it more than once it's a good idea to crop after rotations in order to get rid of the regions that contain only fill color. @node Image Flipping @subsection Image Flipping Image flipping refers to the mirror operation in x- or y-direction at the center. For example, to flip the columns of an image, the left and right of the image are flipped (just like having a vertical mirror in the center of the image) thus the first pixel on any given row becomes the last, and the last pixel becomes the first etc. The API for flipping is as follows @findex flimage_flip() @anchor{flimage_flip()} @example int flimage_flip(FL_IMAGE *im, int what); @end example @noindent where @code{what} can be @code{'c'} or @code{'r'}. indicating if column and row flipping is desired. @node Cropping @subsection Cropping There are two functions available to crop an image @findex flimage_autocrop() @anchor{flimage_autocrop()} @findex flimage_crop() @anchor{flimage_crop()} @example int flimage_autocrop(FL_IMAGE *im, unsigned int background); int flimage_crop(FL_IMAGE *im, int xl, int yt, int xr, int yb); @end example The first function, as its name suggests, automatically crops an image using the background as the color to crop. The function works by searching the image from all four sides and removing all contiguous regions of the uniform background from the sides. The image is modified in place. If cropping is successful, a non-negative integer is returned, otherwise -1. If @code{background} is specified as the constant @tindex FLIMAGE_AUTOCOLOR @code{FLIMAGE_AUTOCOLOR}, the background is chosen as the first pixel of the image. The second function uses the parameters supplied by the user to crop the image. @code{xl} and @code{xr} are the offsets into the image from the left and the right sides, respectively, i.e., if both @code{xl} and @code{xr} are 1, the cropping removes the first column and the last column from the image. Parameters @code{yt} and @code{yb} specify the offsets into the image from the top and bottom of the image respectively. Note the offsets do not have to be positive. When they are negative, they indicate enlargement of the image. The additional regions are filled with the uniform color specified by @code{image->fill_color}, a packed RGB color. This can be quite useful to add a couple of pixels of border to an image. For example, the following adds a 1 pixel wide yellow border to an image @example image->fill_color = FL_PACK(255,255,0); flimage_crop(image, -1, -1, -1, -1); @end example Another function is available that can be used to obtain the auto-cropping offsets @findex flimage_get_autocrop() @anchor{flimage_get_autocrop()} @example int flimage_get_autocrop(FL_IMAGE *im, unsigned background, int *xl, int *yt, int *xl, int *yb); @end example @noindent This function works the same way as @code{@ref{flimage_autocrop()}}, except that no actual cropping is performed. Upon function return the parameters @code{xl}, @code{yt}, @code{xl} and @code{yb} are set to the offsets found by the function. The application can then make adjustment to these offsets and call @code{@ref{flimage_crop()}}. @node Scaling @subsection Scaling An image can be scaled to any desired size with or without subpixel sampling. Without subpixel sampling simple pixel replication is used, otherwise a box average algorithm is employed that yields an anti-aliased image with much less artifacts. A special option is available that scales the image to the desired size but keeps the aspect ratio of the image the same by filling the part of the image that would otherwise be empty. The main entry point to the scaling function is @findex flimage_scale() @anchor{flimage_scale()} @example int flimage_scale(FL_IMAGE *im, int newwidth, int newheight, int option); @end example @noindent where the parameters @code{newwidth} and @code{newheight} specify the desired image size. Parameter @code{option}q can be one of the following constants or the bitwise OR of them: @table @code @tindex FLIMAGE_NOSUBPIXEL @item FLIMAGE_NOSUBPIXEL scale the image with no subpixel sampling @tindex FLIMAGE_SUBPIXEL @item FLIMAGE_SUBPIXEL scale the image with subpixel sampling @tindex FLIMAGE_ASPECT @item FLIMAGE_ASPECT scale the image with no aspect ratio change @tindex FLIMAGE_CENTER @item FLIMAGE_CENTER center the scaled image if aspect @tindex FLIMAGE_NOCENTER @item FLIMAGE_NOCENTER do not center the scaled image @end table For example, @code{FLIMAGE_ASPECT|FLIMAGE_SUBPIXEL} requests fitting the image to the new size with subpixel sampling. @code{FLIMAGE_ASPECT} specifies a scaling that results in an image of the requested size (even if the scales are different for width and height) without changing the aspect ratio of the original image by filling in the stretched regions with the fill color @code{image->fill_color}, a packed RGB color: @example im->fill_color = FL_PACK(255,0,0); flimage_scale(im, im->w+2, im->h, FLIMAGE_SUBPIXEL|FLIMAGE_ASPECT); @end example @noindent This code generates an image that is two pixels wider than the original image but with the same aspect ratio. The two additional pixel columns on each side of the image are filled with the fill color (red), yielding a red border. The fitting can be useful in turning a series of images of unequal sizes into images of equal sizes with no perceptible change in image quality. Depending on what the application requires, simple scaling (zooming) with no subpixel sampling is much faster than box averaging or blending, but subpixel sampling tends to yield smoother images with less scaling artifacts. @node Warping @subsection Warping Image warping (or texture mapping in 2D) refers to the transformation of pixel coordinates. Rotation, scaling and shearing etc. are examples of (linear and non-perspective) image warping. In typical applications some of the commonly used pixel coordinate transformations are implemented using more efficient algorithms instead of a general warping. For example, image rotation is often implemented using three shears rather than a general warp (Forms Library implements rotation via image warping). Non-perspective linear image warping in general is characterized by a 2x2 warp matrix @code{W} and a translation vector @code{T} with two elements as follows @example P' = W * P + T @end example where @code{P} is a vector describing a position via it's x and y coordinates and @code{P'} is the position after warping. The elements @code{w[i][j]} of the warp matrix are constants (if the warp matrix isn't constant or is of higher order, we usually call such a transformation morphing rather than warping). Since our destination for the warped image is an array of pixels rather than a properly defined coordinate system (such as a window) the translation has no meaning. For the following discussion, we assume the translation vector is zero. (In doing the actual warping, the warped image is indeed shifted so it starts at the (0,0) element of the array representing it). Although, theoretically, any 2D matrix can be used as a warp matrix, there are practical constraints in image warping due to the discreteness of pixel coordinates. First of all, we have to snap all pixel coordinates onto a 2D rectangular integer grid. This in general will leave holes in the warped image because two pixels may get mapped to a single destination location, leaving a hole in the destination image. Secondly, truncation or rounding the resulting floating point values introduces errors. Because of these reasons, image warping is performed in reverse. That is, instead of looping over all pixel coordinates in the original image and transforming those into new coordinates, we start from the new coordinates and use inverse warping to obtain the coordinates of the pixel in the original image. This requires that the inverse of the warp matrix must exist (which is the case if @code{w[0][0] * w[1][1] != w[0][1] * w[1][0]}, i.e., the warp matrix has a non-vanishing determinante). With inverse warping the transformation becomes a re-sampling of the original image, and subpixel sampling (anti-aliasing) can be easily implemented. The following function is available in the library to perform warping @findex flimage_warp() @anchor{flimage_warp()} @example int flimage_warp(FL_IMAGE *im, float matrix[][2], int neww, int newh, int subpixel); @end example @noindent where @code{matrix} is the warp matrix. @code{neww} and @code{newh} specify the warped image size. To have the warp function figure out the minimum enclosing rectangle of the warped image you can pass zeros for the new width and height. Nevertheless, you can specify whatever size you want and the warp function will fill the empty grid location with the fill color. This is how the aspect ratio preserving scaling is implemented. In general, the warped image will not be rectangular in shape. To make the image rectangular the function fills the empty regions. The fill color is specified by setting the @code{image->fill_color} field with a packed RGB color. The last argument, @code{subpixel} specifies if subpixel sampling should be used. Although subpixel sampling adds processing time, it generally improves image quality significantly. The valid values for this parameter is any logical OR of @tindex FLIMAGE_NOSUBPIXEL @tindex FLIMAGE_SUBPIXEL @tindex FLIMAGE_NOCENTER @code{FLIMAGE_NOSUBPIXEL}, @code{FLIMAGE_SUBPIXEL} and @code{FLIMAGE_NOCENTER}. @code{FLIMAGE_NOCENTER} is only useful if you specify an image dimension that is larger than the warped image, and in that case the warped image is flushed top-left within the image grid, otherwise it is centered. To illustrate how image warping can be used, we show how an image rotation by an angle @code{deg} can be implemented: @example float m[2][2]; m[0][0] = m[1][1] = cos(deg * M_PI / 180.0); m[0][1] = sin(deg * M_PI / 180.0); m[1][0] = -m[0][1]; flimage_warp(im, mat, 0, 0, FLIMAGE_SUBPIXEL); @end example @noindent Please note that the transformation is done in-place, i.e., after the function returns the image structure pointer, @code{im}, points to the rotated image. If you specify a warp matrix with the off-diagonal elements being zero (scaling matrix), the image will only be scaled (in x-direction by @code{m[0][0]} and in y-direction by @code{m[1][1]}) without being also rotated. By experimenting with various warp matrices you can obtain some interesting images. Just keep in mind that large values of the warp matrix elements tend to make the final image larger. @node General Pixel Transformation @subsection General Pixel Transformation Many image processing tasks can be implemented as seperate RGB transformations. These transformations can be done very efficiently through the use of lookup tables. For this reason the following routine exists: @findex flimage_transform_pixels() @anchor{flimage_transform_pixels()} @example int flimage_transform_pixels(FL_IMAGE *im, int *red, int *green, int *blue); @end example @noindent where @code{red}, @code{green} and @code{blue} are the lookup tables of a length of at least @code{FL_PCMAX + 1} (typically 256). The function returns a postive number on success and the image will be replaced. Note that this routine notices the settings of the subimage, i.e., you can transform a portion of the image. To illustrate the use of this routine let's look at how a simple contrast adjustment may be implemented: @example #include #include int AdjustContrast(FL_IMAGE *im) @{ int r[FL_PCMAX+1], g[FL_PCMAX+1], b[FL_PCMAX+1]; int i, scale = 10; /* in this example rgb are adjusted the same way */ for ( i = 0; i <= FL_PCMAX; i++) r[i] = g[i] = b[i] = i * log10(1 + i * scale / FL_PCMAX ) / log10( 1 + scale ); return flimage_transform_pixels(im, r, g, b); @} @end example @node Image Annotation @subsection Image Annotation You can annotate an image with text or simple markers (arrows etc.). The location of the annotation can either be in pixel coordinate system or some application defined coordinate system. @ifnottex @menu * Using Text Strings:: * Using Markers:: * Pixelizing the Annotation:: @end menu @end ifnottex @node Using Text Strings @subsubsection Using Text Strings To place text into the image, use the following routine @findex flimage_add_text() @anchor{flimage_add_text()} @example int flimage_add_text(FL_IMAGE *im, const char *str, int len, int fstyle, int fsize, unsigned tcolor, unsigned bcolor, int nobk, double tx, double ty, int rotation); @end example @noindent where @code{fstyle} and @code{fsize} are the same as the label font style and size defined earlier in Section 3.11.3. @code{tcolor} and @code{bcolor} specify the colors to use for the text @code{str} and the background if the @code{nobk} argument is false. If @code{nobk} is true the text is drawn without a background. @code{tx} and @code{ty} specify the location of the text relative to the image origin. The location specified is the lower-right corner of the text. Note that the location specified can be in some physical space other than pixel space. For example, if the pixel-pixel distance represents 10 miles on a map, you'd like to be able to specify the text location in miles rather than pixels. The location is converted into pixel space using the following code @example tx_pixel = im->xdist_scale * tx + im->xdist_offset; ty_pixel = im->ydist_scale * ty + im->ydist_offset; @end example @noindent By default, the offsets @code{im->xdist_offset} and @code{im->yxdist_offset} are initialized to 0 and the scales @code{im->xdist_scale} and @code{im->ydist_scale} to 1. The function returns the current number of strings for the image. The interpretation of text used also used elsewhere applies, i.e., if @code{str} starts with character @code{@@} a symbol is drawn. There is another function, maybe more convenient depending on the application, that you can use @tindex FLIMAGE_TEXT @findex flimage_add_text_struct() @anchor{flimage_add_text_struct()} @example int flimage_add_text_struct(FL_IMAGE *im, const FLIMAGE_TEXT *text); @end example @noindent With this function instead of passing all the parameters individual;y you pass a @code{FLIMAGE_TEXT} structure to the function. The structure has the following fields: @table @code @item str The string to append to the image. @item len Length of the string in bytes. @item x, y A location relative to the image origin, given in pixels (no conversion from other coordinate systems is done) @item align Specifies the alignment of the string relative to the give location. @item style, size The font style and size to use. @item color The text color @item bcolor The background color @item nobk If true indicates that no background is to be drawn. @item angle Angle (in thenth of a degree) the text is to be rotated from the default horizontal orientation. Currently only PostScript output handles this correctly. @end table To delete the all texts you added to an image, use @findex flimage_delete_all_text() @anchor{flimage_delete_all_text()} @example void flimage_delete_all_text(FL_IMAGE *im); @end example You also can suppress the display of annotation text without deleting it. To do this, simply set @code{im->dont_display_text} to true. @node Using Markers @subsubsection Using Markers In addition to text strings you can also add simple markers (arrows, circles etc) to your image. To add a marker to an image use the following routines @findex flimage_add_marker() @anchor{flimage_add_marker()} @findex flimage_add_marker_struct() @anchor{flimage_add_marker_struct()} @example int flimage_add_marker(FL_IMAGE *im, const char *name, double x, double y, double w, double h, int linestyle, int fill, int rotation, FL_COLOR, FL_COLOR bcol); int flimage_add_marker_struct(FL_IMAGE *im, const FLIMAGE_MARKER *m); @end example @noindent where @code{name} is the marker name (see below for a list of built-in markers). The marker name must consist of regular ASCII characters. @code{linestyle} indicates the line style (@code{FL_SOLID}, @code{FL DOT} etc., see Chapter 27 for a complete list. @code{fill} indicates if the marker should be filled or not. @code{x} and @code{y} are the coordinates of the center of the marker in physical coordinates (i.e., the same transformation as described above for annotated texts is applied), @code{w} and @code{h} are the size of the bounding box of the marker, again in physical coordinates. Every marker has a natural orientation from which you can rotate it. The angle of rotation is given by @code{rotation} in tenth of a degree. @code{col} is the color of the marker, in packed RGB format. @code{bcol} is currently un-used. The second function takes a structure that specifies the marker. The members of the structure are as follows: @table @code @item name The name of the marker. @item x, y Position of center of the marker in pixel coordinates, relative to the origin of the image. @item w, h The size of the bounding box in pixel coordinates. @item color The color of the marker in packed RGB format. @item fill If true the marker is filled. @item thickness The line line thickness used for drawing. @item style The line style to be used for drawing. @item angle Angle of rotation in tenth of a degree from the marker's nature orientation. @end table If successful both functions return the number of markers that are currently associated with the image, otherwise a negative number. Some built-in markers in different orientations are shown in Fig. 22.1. To delete all markers added to an image use the function @findex flimage_delete_all_markers() @anchor{flimage_delete_all_markers()} @example void flimage_delete_all_markers(FL_IMAGE *im); @end example Of course the library would not be complete without the ability for applications to define new markers. The following function is provided so you can define your own markers: @findex flimage_define_marker() @anchor{flimage_define_marker()} @example int flimage_define_marker(const char *name, void (*draw) (FLIMAGE_MARKER *marker), const char *psdraw); @end example @noindent When the marker is to be drawn the function @code{draw()} is called with the marker structure. In addition to the fields listed above the following fields are filled by the library to facilitate the operation of drawing the marker @table @code @item display The display to be drawn on. @item gc The GC to be used in drawing @item win The window to draw to. @item psdraw A string that draws a marker in a square with the corner coordinates (-1, -1), (-1, 1), (1, 1) and (1, -1) in PostScript. For example the rectangle marker has the following @code{psdraw} string: @example -1 -1 moveto -1 1 lineto 1 1 lineto 1 -1 lineto closepath @end example @end table Defining new markers is the preferred method of placing arbitary drawings onto an image as it works well with double-buffering and pixelization of the markers. @node Pixelizing the Annotation @subsubsection Pixelizing the Annotation Annotations placed on the image are kept seperate from the image pixels themselves. The reasons for doing so are twofold. First, keeping the annotation seperate makes it possible to later edit the annotations. The second reason is that typically the screen has a lower resolutions than other output devices. By keeping the annotations seperate from the pixels makes it possible to obtain better image qualities when the annotations are rendered on higher-resolution devices (for example a PostScript printer). If for some reason making the annotations a part of the image pixels is desired, use the following routine @findex flimage_render_annotation() @anchor{flimage_render_annotation()} @example int flimage_render_annotation(FL_IMAGE *image, FL_WINDOW win); @end example @noindent The function returns -1 if an error occurs. The parameter @code{win} is used to create the appropriate pixmap. After the function returns the annotations are rendered into the image pixels (thus an annotation or a part of it that was outside of the image is lost). Note that during rendering the image type may change depending on the capabilities of @code{win}. Annotations that were kept separately are deleted. Note that the image must have been displayed at least once prior to calling this function for it to work correctly. You can always enlarge the image first via the cropping function with some solid borders. Then you can put annotation outside of the original image but within the enlarged image. Not all image formats support the storage of text and markers. This means if you attempt to save an image that has associated text and markers into an image format that does not support it, you may lose the annotation. All pnm formats supports the storage of annotations. To find out if a particular format supports annotation storage, look at the annotation field of the @code{FLIMAGE_FORMAT_INFO} structure. A zero value indicates it does not support it. @node Write Your Own Routines @subsection Write Your Own Routines The only communication required between an image processing routine and the rest of the image routines is to let the display routine know that the image has been modified by setting @code{image->modified} to 1. This information is used by the display routine to invalidate any buffered displayable images that were created from the original image. After displaying, @code{image->modified} is reset by the display routine. @node Utilities @section Utilities In the following some of the utilities that may come in handy when you're writing image manipulation routines are described. @ifnottex @menu * Memory Allocation:: * Color Quantization:: * Remarks:: @end menu @end ifnottex @node Memory Allocation @subsection Memory Allocation To create a matrix to be used in several of the functions listed above use either @code{@ref{fl_get_matrix()}} described above or @findex fl_make_matrix() @anchor{fl_make_matrix()} @example void *fl_make_matrix(int nrow, int ncol, unsigned int esize, void *inMem); @end example @noindent where @code{nrow} and @code{ncol} are the number of rows and columns of the matrix respectively. @code{esize} is the size (in bytes) of each matrix element. Both functions return a two-dimensional array of entities of size @code{esize}. The first function initializes all elements to zero. The second function does not allocate nor initialize memory for the matrix itself. Instead it uses the memory with address @code{inMem} that is supplied by the caller, which should be a one-dimensional array of length @code{nrow * ncol * esize}. You can use the returned pointer as a regular two-dimensional array (@code{matrix[r][c]}) or as a single array of length @code{nrow *ncol}, starting from at @code{matrix[0]}: @example short **matrix = fl_get_matrix(nrow, ncol, sizeof **matrix); /* access the matrix as a 2-d array */ matrix[3][4] = 5; /* or access it as 1D array */ *(matrix[0] + 3 * ncol + 4) = 5; /* most useful in image processing to use it as 1D array */ memcpy(saved, matrix, nrow * ncol * sizeof **matrix); @end example To free a matrix allocated using one the above functions, use @findex fl_free_matrix() @anchor{fl_free_matrix()} @example void fl_free_matrix(void *matrix); @end example @noindent The function frees all memory allocated. After the function returns the matrix cab not be de-referenced anymore. In the case where the matrix was created by @code{@ref{fl_make_matrix()}} the function will only free the memory that's allocated to hold the matrix indices but not the memory supplied by the caller. It is the caller's responsibility to free that part of the memory. There are also some useful functions that manipulate images directly. The following is a brief summary of them. @findex flimage_dup() @anchor{flimage_dup()} @example FL_IMAGE *flimage_dup(FL_IMAGE *im); @end example @noindent This function duplicates an image @code{im} and returns the duplicated image. At the moment, only the first image is duplicated even if the input image has multiple frames. Furthermore, markers and annotations are not duplicated. @findex flimage_to_pixmap() @anchor{flimage_to_pixmap()} @findex flimage_from_pixmap() @anchor{flimage_from_pixmap()} @example Pixmap flimage_to_pixmap(FL_IMAGE *im, FL_WINDOW win); int flimage_from_pixmap(FL_IMAGE *im, Pixmap pixmap); @end example The first function converts an image into a Pixmap (a server side resource) that can be used in the pixmap object (see pixmap-class???). The second function does the reverse. @code{im} must be a properly allocated image. @node Color Quantization @subsection Color Quantization In order to display a RGB image on a color-mapped device of limited depth, the number of colors in the original image will have to be reduced. Color quantization is one way of doing this. Two color quantization algorithms are available in the Forms Library. One uses Heckbert's median cut algorithm followed by Floyd-Steinberg dithering after which the pixels are mapped to the colors selected. The code implementing this is from the Independent JPEG Group's two pass quantizer (@file{jquant2.c} in the IJG's distribution), which under copyright (c) 1991-1996 by Thomas G. Lane and the IJG. Another method is based on the Octree quantization algorithm with no dithering and is implemented by Steve Lamont (@code{spl@@ucsd.edu}) and is under vopyright (c) 1998 by Steve Lamont and the National Center for Microscopy and Imaging Research. This quantization library is available from @url{ftp://ncmir.ucsd.edu/pub/quantize/libquantize.html}. The quantizer based on this library is not compiled into the image support. The source code for using this quantizer is in @code{image} subdirectory. By default, the median cut algorithm is used. You can switch to the octree based algorithm using the following call @findex flimage_select_octree_quantizer() @anchor{flimage_select_octree_quantizer()} @example void flimage_select_octree_quantizer(void); @end example To switch back to the median cut quantizer use @findex flimage_select_mediancut_quantizer() @anchor{flimage_select_mediancut_quantizer()} @example void flimage_select_mediancut_quantizer(void); @end example The median-cut quantizer tends to give better images because of the dithering step. However, in this particular implementation, the number of quantized colors is limited to 256. There is no such limit with the octree quantizer implementation. @node Remarks @subsection Remarks See @file{itest.c} and @file{ibrowser.c} for example use of the image support in Forms Library. @file{iconvert.c} is a program that converts between different file formats and does not require an X connection. Due to access limitations, not all combinations of display depth and bits per pixel (bpp) are tested. Depths of @w{1 bit} (@w{1 bpp}), @w{4 bits} (@w{8 bpp}), @w{8 bits} (@w{8 bpp}), @w{16 bits} (@w{16 bpp}), @w{24 bits} (@w{32 bpp}), @w{30 bits} (@w{32 bpp}) were tested. Although it works in @w{12 bit} PseudoColor mode, due to limitations of the default quantizer the display function does not take full advantage of the larger lookup table. Special provisions were made so a gray12 image will be displayed in 4096 shades of gray if the hardware supports 12-bit grayscale. If JPEG support (@file{image_jpeg.c}) is not compiled into the Forms Library, you can obtain the jpeg library source from @url{ftp://ftp.uu.net/graphics/jpeg}. xforms-1.2.4/doc/part4_introduction.texi0000644000175000017500000000467011665175503015270 00000000000000@node Part IV Introduction @chapter Introduction Earlier chapters discussed ways to build user interfaces by combining suitable objects from the Forms Library, defining a few object callbacks and using Xlib functions. However, there is always a possibility that the built-in objects of the Forms Library might not be enough. Although free objects in principle provide all the flexibility a programmer needs, there can be situations where it is beneficial to create new types of objects, for example switches or joysticks or other types of sliders, etc. In these cases, a programmer can use the architecture defined by the Forms Library to create a new object class that will work smoothly with the built-in or user-created object classes. Creating such new object classes and adding them to the library is simpler than it sounds. In fact it is almost the same as making a free object. This part gives you all the details of how to add new classes. In chapter 24 a global architectural overview is given of how the Forms Library works and how it communicates with the different object classes by means of events (messages). Chapter 25 describes in detail what type of events objects can receive and how they should react to them. Chapter 26 describes in detail the structure of the type @code{FL_OBJECT} which plays a crucial role, a role equivalent to a superclass (thus all other object classes have @code{FL_OBJECT} as their parent class) in object-oriented programming. One of the important aspects of an object is how to draw it on the screen. Chapter 27 gives all the details on drawing objects. The Forms Library contains a large number of routines that help you draw objects. In this chapter an overview is given of all of them. Chapter 28 gives an example illustrating on how to create a new object class. Due to the importance of button classes, special routines are provided by the Forms Library to facilitate the creation of this particular class of objects. Chapter 29 illustrates by two examples the procedures of creating new button classes using the special services. One of the examples is taken from the Forms Library itself and the other offers actual usability. Sometimes it might be desirable to alter the behavior of a built-in class slightly. Obviously a full-blown (re)implementation from scratch of the original object class is not warranted. Chapter 30.1 discusses the possibilities of using the pre-emptive handler of an object to implement derived objects. xforms-1.2.4/doc/xforms.info-10000664000175000017500000111765012353624333013074 00000000000000This is xforms.info, produced by makeinfo version 4.13 from xforms.texi. INFO-DIR-SECTION Development START-INFO-DIR-ENTRY * XForms: (xforms). A Graphical user interface toolkit for X END-INFO-DIR-ENTRY  File: xforms.info, Node: Top, Next: Preface, Up: (dir) XForms (Forms Library) - Version 1.2 (Rev. 4) A Graphical User Interface Toolkit for X **************************************** * Menu: * Preface: Preface * Part I - Using The Forms Library: Part I * Introduction: Part I Introduction * Getting Started: Part I Getting Started * Defining Forms: Part I Defining Forms * Doing Interaction: Part I Doing Interaction * Free Objects: Part I Free Objects * Free Objects: Part I Goodies * Part II - The Form Designer: Part II * Introduction: Part II Introduction * Getting Started: Part II Getting Started * Command Line Arguments: Part II Command Line Arguments * Creating Forms: Part II Creating Forms * Saving and Loading Forms: Part II Saving and Loading Forms * Language Filters: Part II Language Filters * Generating Hardcopies: Part II Generating Hardcopies * Part III - Object Classes: Part III * Introduction: Part III Introduction * Static Objects: Part III Static Objects * Button-like Objects: Part III Button-like Objects * Valuator Objects: Part III Valuator Objects * Input Objects: Part III Input Objects * Choice Objects: Part III Choice Objects * Container Objects: Part III Container Objects * Other Objects: Part III Other Objects * Popups: Part III Popups * Deprecated Objects: Part III Deprecated Objects * Part IV - Designing Object Classes: Part IV * Introduction: Part IV Introduction * Global Structure: Part IV Global Structure * Events: Part IV Events * The Type `FL_OBJECT': Part IV The Type FL_OBJECT * Drawing Objects: Part IV Drawing Objects * An Example: Part IV An Example * New Buttons: Part IV New Buttons * Using a Pre-emptive Handler: Part IV Using a Pre-emptive Handler * Part V - General Informations: Part V * Overview of Main Functions: Part V Overview of Main Functions * Some Useful Functions: Part V Some Useful Functions * Resources for Forms Library: Part V Resources for Forms Library * Dirty Tricks: Part V Dirty Tricks * Trouble Shooting: Part V Trouble Shooting * Part VI - Image Supprt API: Part VI * Part VI Images:: * Index of Functions:: * Index of Global Variables:: * Index of Constants::  File: xforms.info, Node: Preface, Next: Part I, Prev: Top, Up: Top _Preface_ ********* The Forms Library for the X Window system (or XForms for short) is a GUI toolkit with a rather long history. It was developed in the last decade of the last millenium by *Dr. T. C. Zhao* (then at the Department of Physics, University of Wisconsin-Milwaukee, USA) and *Prof. Dr. Mark Overmars* (Department of Computer Science, Utrecht University, Netherlands) at a time when there were hardly any alternatives except expensive packages. While at first being closed source it became open source software in 2002, distributed according to the Lesser GNU Public License (LGPLv2). While development slowed down a bit while other toolkits became available and matured, XForms is still used, and development continues. While it may not be as polished as newer toolkits it has the advantage of being relatively small and thus easier to get started with it. The XForms home page is at `http://xforms-toolkit.org/' The sources and mailing list are hosted on `https://savannah.nongnu.org/projects/xforms/' The source package can be downloaded from `http://download.savannah.gnu.org/releases/xforms/' while the `git' repository can be accessed via `git://git.savannah.nongnu.org/xforms.git' `http://git.savannah.gnu.org/cgit/xforms.git' `ssh://git.sv.gnu.org/srv/git/xforms.git' There also is a mailing list. You can subscribe to it at `http://lists.nongnu.org/mailman/listinfo/xforms-development' The archive of the mailing list can be found at `http://lists.gnu.org/archive/html/xforms-development/' The archive of messages from before August 2009 and going back until 1996 is at `http://xforms-toolkit.org/old-archive' Please write to the mailing list if you have questions or find bugs. This document is based on the documentation for version 0.89 of the Forms Library. It has been reconstructed from the PDF version (the original sources seem to have been lost) and has been updated to cover all changes introduced since version 0.89. In the following the preface for the last available version of the documentation (version 0.89 from June 2000) is reproduced. Please note that quite a bit of the information there-in is outdated. Many of the URLs mentioned don't exist anymore, email addresses have changed and the restrictions on the distribution of the library have been removed by the original authors in favor of the LGPL. *Preface of Version 0.89 (June 2000)* Window-based user interfaces are becoming a common and required feature for most computer systems, and as a result, users have come to expect all applications to have polished user-friendly interfaces. Unfortunately, constructing user interfaces for programs is in general a time consuming process. In the last few years a number of packages have appeared that help build up graphical user interfaces (so-called GUI's) in a simple way. Most of them, though, are difficult to use and/or expensive to buy and/or limited in their capabilities. The Forms Library was constructed to remedy this problem. The design goals when making the Forms Library were to create a package that is intuitive, simple to use, powerful, graphically good looking and easily extendible. The main notion in the Forms Library is that of a form. A form is a window on which different objects are placed. Such a form is displayed and the user can interact with the different objects on the form to indicate his/her wishes. Many different classes of objects exist, like buttons (of many different flavors) that the user can push with the mouse, sliders with which the user can indicate a particular setting, input fields in which the user can provide textual input, menus from which the user can make choices, browsers in which the user can scroll through large amounts of text (e.g., help files), etc. Whenever the user changes the state of a particular object on one of the forms displayed the application program is notified and can take action accordingly. There are a number of different ways in which the application program can interact with the forms, ranging from very direct (waiting until something happens) to the use of callback routines that are called whenever an object changes state. The application program has a large amount of control over how objects are drawn on the forms. It can set color, shape, text style, text size, text color, etc. In this way forms can be fine tuned to one's liking. The Forms Library consists of a large number of C-routines to build up interaction forms with buttons, sliders, input fields, dials, etc. in a simple way. The routines can be used both in C and in C++ programs. The library uses only the services provided by the Xlib and should run on all workstations that have X installed on them. The current version needs 4bits of color (or grayscale) to look nice, but it will function properly on workstations having less depth (e.g., XForms works on B&W X-terminals). The library is easy to use. Defining a form takes a few lines of code and interaction is fully handled by the library routines. A number of demo programs are provided to show how easy forms are built and used. For simple forms and those that may be frequently used in application programs, e.g., to ask a question or select a file name, special routines are provided. For example, to let the user choose a file in a graphical way (allowing him/her to walk through the directory hierarchy with a few mouse clicks) the application program needs to use just one line of code. To make designing forms even easier a Form Designer is provided. This is a program that lets you interactively design forms and generate the corresponding C-code. You simply choose the objects you want to place on the forms from a list and draw them on a form. Next you can set attributes, change size and position of the objects, etc., all using the mouse. Although this document describes all you need to know about using the Forms Library for X, it is not an X tutorial. On the contrary, details of programming in X are purposely hidden in the Forms Library interfaces, and one need not be an X-expert to use the Forms Library, although some knowledge of how X works would help to understand the inner workings of the Forms Library. Forms Library and all the programs either described in this document or distributed as demos have been tested under X11 R4, R5 & R6 on all major UNIX platforms, including SGI, SUN, HP, IBM RS6000/AIX, Dec Alpha/OSF1, Linux(i386, alpha, m68k and sparc) as well as FreeBSD, NetBSD (i386, m68k and sparc), OpenBSD(i386, pmax, sparc, alpha), SCO and Unixware. Due to access and knowledge, testing on non-unix platforms such as OpenVMS, OS/2 and Microsoft/NT are less than comprehensive. This document consists of four parts. The first part is a tutorial that provides an easy, informal introduction to the Forms Library. This part should be read by everybody that wants to use the library. You are encouraged to try variations of the demo programs distributed in the Forms Library package. Part II describes the Form Designer with which you can design forms interactively and haveForm Designer write code for you. Part III gives an overview of all object classes currently available in the library. The tutorial part only mentions the most basic classes but here you find a complete overview. Adding new object classes to the system is not very complicated. Part IV describes how this should be done. *Version Note* The authors request that the following name(s) be used when referring to this toolkit Forms Library for X, Forms Library or simply XForms Forms Library is not public domain. It is copyright (c) by T.C. Zhao and Mark Overmars, and others, with all published and unpublished rights reserved. However, permission to use for non-commercial and not-for-profit purposes is granted. You may not use xforms commercially (including in-house and contract/consulting use) without contacting (xforms@world.std.com) for a license arrangement. Use of xforms for the sole purpose of running a publically available free software that requires it is not considered a commercial use, even in a commercial setting. You may not "bundle" and distribute this software with commercial systems without prior consent of the authors. Permission to distribute this software with other free software that requires it, including Linux CD distribution, is granted. Further, permission to re-package the software is granted. This software is provided "as is" without warranty of any kind, either expressed or implied. The entire risk as to the quality and performance of the software is with you. Should the software prove defective, you assume the cost of all necessary servicing, repair or correction and under no circumstance shall the authors be liable for any damages resulting from the use or mis-use of this software. It would be appreciated if credit to the authors is acknowledged in published articles on applications based on the library. A reprint of the article would also be appreciated. The development environment for xforms consists of Linux 1.0.8/a.out X11R5 and Linux 2.0/ELF X11R6 with additional testing and validation on SGI R8000 and occasionally IBM RS6000/AIX and other machines. For every public release, most of the demos and some internal testing programs are run on each platform to ensure quality of the distribution. Figures in this document were produced by fd2ps, a program that takes the output of the form designer and converts the form definition into an encapsulated POSTSCRIPT file. fd2ps as ofXForms V0.85 is included in the distribution. This document is dated June 12, 2000. *Support* Although XForms has gone through extensive testing, there are most likely a number of bugs remaining. Your comments would be greatly appreciated. Please send any bug reports or suggestions to T.C. Zhao (tc_zhao@yahoo.com or xforms@world.std.com but not both). Please do not expect an immediate response, but we do appreciate your input and will do our best. *Bindings to other languages* As of this writing, the authors are aware of the following bindings perl binding by Martin Bartlett () ada95 binding by G. Vincent Castellano () Fortran binding by G. Groten () and Anke Haeming () pascal binding by Michael Van Canneyt () scm/guile binding by Johannes Leveling () python binding by Roberto Alsina (). (Seems the author has stopped working on this binding). Follow the links on XForms's home page to get more info on these bindings. *Archive Sites* Permanent home for the Forms Library is at ftp://ncmir.ucsd.edu/pub/xforms ftp://ftp.cs.ruu.nl/pub/XFORMS (Primary mirror site) The primary site is mirrored by many sites around the world. The following are some of the mirror sites ftp://ftp.fu-berlin.de/unix/X11/gui/xforms ftp://gd.tuwien.ac.at/hci/xforms ftp://ftp.st.ryukoku.ac.jp/pub/X11/xforms ftp://ftp.via.ecp.fr/pub2/xforms ftp://ftp.unipi.it/pub/mirror/xforms ftp://ftp.uni-trier.de/pub/unix/X11/xforms Additional mirrors, html version of this document, news and other information related to XForms can be accessed through www via the following URL http://world.std.com/~xforms In addition to ftp and www server, a mail server is available for those who do not have direct internet access. To use the mail server, send a message to or the old-fashioned path alternative . The message should be something like the following begin path fred@stone.age.edu (substitute your address) send help end To get a complete listing of the archive tree, issue send ls-lR.Z. *Mailing List* A mailing list for news and discussions about XForms is available. To subscribe or un-subscribe, send a message to with one of the following commands as the mail body help subscribe unsubscribe To use the mailing list, send mail to . Please remember that the message will be sent to hundreds of people. Please Do not send subscribe/unsubscribe messages to the mailing list, send them to . The mailing list archive is at `http://bob.usuhs.mil/mailserv/list-archives'. *Thanks* Many people contributed, in one way or another, to the development of Forms Library, without whose testing, bug reports and suggestions, Forms Library would not be what it is today and would certainly not be in the relatively bug free state it is in now. We thank Steve Lamont of UCSD (), for his numerous suggestions and voluminous contributions to the mailing list. We thank Erik Van Riper (), formerly of CUNY, and Dr. Robert Williams of USUHS () for running the mailing list and keeping it running smoothly. We also thank every participant on the mailing list who contributed by asking questions and challenging our notion of what typical use of the Forms Library is. The html version of the document, undoubtedly browsed by the thousands, is courtesy of Danny Uy (). We appreciate the accurate and detailed bug reports, almost always accompanied with a demo program, from Gennady Sorokopud () and Rouben Rostamian (). We also thank Martin Bartlett (), who, in addition to marrying Forms Library to perl, made several xforms API suggestions, Last but certainly not least, we thank Henrik Klagges () for his numerous suggestions during the early stages of the development.  File: xforms.info, Node: Part I, Next: Part I Introduction, Prev: Preface, Up: Top _Part I - Using the Forms Library_ ********************************** * Menu: * Part I Introduction:: * Part I Getting Started:: * Part I Defining Forms:: * Part I Doing Interaction:: * Part I Free Objects:: * Part I Goodies::  File: xforms.info, Node: Part I Introduction, Next: Part I Getting Started, Prev: Part I, Up: Top 1 Introduction ************** The Forms Library is a library of C-routines that allows you to build up interaction forms with buttons, sliders, input fields, dials, etc. in a very simple way. Following the X tradition, Forms Library does not enforce the look and feel of objects although in its default state, it does provide a consistent look and feel for all objects. The Forms Library only uses the services provided by Xlib and should be compilable on all machines that have X installed and have an ANSI compatible compiler. Being based on Xlib,Forms Library is small and efficient. It can be used in both C and C++ programs and soon it will be available for other languages(1). The basic procedure of using the Forms Library is as follows. First one or more forms are defined, by indicating what objects should be placed on them and where. Types of objects that can be placed on the forms include: boxes, texts, sliders, buttons, dials, input fields and many more. Even a clock can be placed on a form with one command. After the form has been defined it is displayed on the screen and control is given to a library call `*note fl_do_forms()::'. This routine takes care of the interaction between the user and the form and returns as soon as some change occurs in the status of the form due to some user action. In this case control is returned to the program (indicating that the object changed) and the program can take action accordingly, after which control is returned again to the `*note fl_do_forms()::' routine. Multiple forms can be handled simultaneously by the library and can be combined with windows of the application program. More advanced event handling via object callbacks is also supported. The Forms Library is simple to use. Defining a form takes a few lines of code and interaction is fully handled by the library routines. A number of demo programs are provided to show how to piece together various parts of the library and demonstrate how easy forms are built and used. They can be found in the directory `demos'. Studying these demos is a good way of learning the system. If you only have very simple applications for the Forms Library, e.g., to ask the user for a file name, or ask him a question or give him a short message, *note Goodies: Part I Goodies. contains some even more simple routines for this. So, e.g., a form with the question "Do you want to quit?" can be made with one line of code. To make designing forms even easier a Form Designer is provided. As its name implies, this is a program that lets you interactively design forms and generate the corresponding C-code. *Note Introduction: Part II Introduction, and the following chapters for its use. The current version of the software is already quite extended but we are working on further improvements. In particular, we plan on designing new classes of objects that can be placed on the forms. Adding classes to the system is not very complicated. Part IV of this document describes in detail how to do this yourself. The following chapters will describe the basic application programmer's interface to the Forms Library and lead you through the different aspects of designing and using forms. In *note Part I Getting Started:: we give some small and easy examples of the design and use of forms. In *note Defining Forms: Part I Defining Forms. we describe how to define forms. This chapter just contains the basic classes of objects that can be placed on forms. Also, for some classes only the basic types are described and not all. For an overview of all classes and types of objects see Part III of this document. *note Doing Interaction: Part I Doing Interaction. describes how to set up interaction with forms. A very specific class of objects are free objects and canvases. The application program has full control over their appearance and interaction. They can be used to place anything on forms that is not supported by the standard objects. *note Free Objects: Part I Free Objects. describes their use. Finally, *note Goodies: Part I Goodies. describes some built-in routines for simple interaction like asking questions and prompting for choices etc. ---------- Footnotes ---------- (1) As of this writing, perl, Ada95, scheme, pascal, Fortran and python bindings are in beta testing.  File: xforms.info, Node: Part I Getting Started, Next: Part I Defining Forms, Prev: Part I Introduction, Up: Top 2 Getting Started ***************** This chapter introduces the typographical conventions used throughout the manual and then continues with showing a few, simple examples on using the Forms Library. It concludes with a short resumee of the programming model typically found in programs using the library. * Menu: * Naming Conventions:: * Some Examples:: * Programming Model::  File: xforms.info, Node: Naming Conventions, Next: Some Examples, Up: Part I Getting Started 2.1 Naming Conventions ====================== The names of all Forms Library functions and user-accessible data structures begin with `fl_' or `FL_', and use an "underscore-between-words" convention, that is when function and variable names are composed of more than one word, an underscore is inserted between each word. For example, fl_state fl_set_object_label() fl_show_form() All Forms Library macros, constants and types also follow this convention, except that (at least) the first two letters are capitalized. For example, FL_min() FL_NORMAL_BUTTON FL_OBJECT The term "form" often can be taken to mean a window of your application. But be aware that there are also can be forms that themselves contain further forms, so "form" and "window" aren't necessarily synonyms. The only exceptions from the above convention are names of functions related to image manipulations - they start with `flimage_'. And then there's a single function called `*note flps_init()::' that allows customization of the way hardcopies are created from an existing user interface.  File: xforms.info, Node: Some Examples, Next: Programming Model, Prev: Naming Conventions, Up: Part I Getting Started 2.2 Some Examples ================= Before using forms for interaction with the user you first have to define them. Next you can display them and perform interaction with them. Both stages are simple. Before explaining all the details let us first look at some examples. A very simple form definition would look as FL_FORM *simpleform; simpleform = fl_bgn_form(FL_UP_BOX, 230, 160); fl_add_button(FL_NORMAL_BUTTON, 40, 50, 150, 60, "Push Me"); fl_end_form(); The first line indicates the start of the form definition. `simpleform' will later be used to identify the form. The type of the form is `FL_UP_BOX'. This means that the background of the form is a raised box that looks like it is coming out of the screen. The form has a size of 230 by 160 pixels. Next we add a button to the form. The type of the button is `FL_NORMAL_BUTTON' which will be explained below in detail. It is positioned in the form by virtue of the button geometry supplied and has "Push Me" as its label. After having defined the form we can display it using the call fl_show_form(simpleform, FL_PLACE_MOUSE, FL_NOBORDER, "SimpleForm"); [image src="xforms_images/pushme.png"] This will show the form on the screen at the mouse position. (The third argument indicates whether the form gets window manager's decoration and the fourth is the window title.) Next we give the control over the interaction to the Forms Library's main event loop by calling fl_do_forms(); This will handle interaction with the form until you press and release the button with the mouse, at which moment control is returned to the program. Now the form can be removed from the screen (and have its associated window destroyed) using fl_hide_form(simpleform); The complete program is given in the file `pushme.c' in the subdirectory `demos'. All demonstration programs can be found in this directory. Studying them is a good way of learning how the library works. Compile and run it to see the effect. To compile a program using the Forms Library use the following command or something similar cc -o pushme pushme.c -lforms Please note that linking against the Forms library requires some other libraries to be istalled, at least the `X11' and the `Xpm' library. Some applications may also require the `JPEG' and/or the `GL' library. These libraries don't need to be specified explicitely in the linker command but must be available since the Forms library depends on them. If not installed contact your systems administrator. This simple example is, of course, of little use. Let us look at a slightly more complicated one (the program can be found in `yesno.c'.) #include int main(int argc, char *argv[]) { FL_FORM *form; FL_OBJECT *yes, *no, *but; fl_initialize(&argc, argv, "FormDemo", 0, 0); form = fl_bgn_form(FL_UP_BOX, 320, 120); fl_add_box(FL_NO_BOX, 160, 40, 0, 0, "Do you want to Quit?"); yes = fl_add_button(FL_NORMAL_BUTTON, 40, 70, 80, 30, "Yes"); no = fl_add_button(FL_NORMAL_BUTTON, 200, 70, 80, 30, "No"); fl_end_form(); fl_show_form(form, FL_PLACE_MOUSE, FL_TRANSIENT, "Question"); while (1) { if (fl_do_forms() == yes) { printf("Yes is pushed\n"); break; } else printf("No is pushed\n"); } fl_finish(); return 0; } It creates a form with a simple text and two buttons. After displaying the form `*note fl_do_forms()::' is called. This routine returns the object being pushed. Simply checking whether this is object `yes' or `no' determines whether we should quit. [image src="xforms_images/yesno.png"] As you see, the program starts by calling the routine `*note fl_initialize()::'. This routine should be called before any other calls to the library are made (except for `*note fl_set_defaults()::'). One of the things this routine does is to establish a connection to the X server and initialize a resource database used by the X resource manager. It also does many other things, such as parsing command line options and initializing internal Forms Library structures. For now, it suffices to know that by calling this routine, a program automatically recognizes the following command line options Option Value type Meaning ---------------------------------------------------------------------------- `-display' host:dpy string Remote host `-name' appname string change application name `-visual' class string TrueColor, PseudoColor etc. `-depth' depth integer Preferred visual depth `-private' none Force a private colormap `-shared' none Always share colormap `-stdcmap' none Use standard colormap `-fldebug' level integer Print some debug information `-flhelp' none Print out these options `-sync' none Force synchronous mode Note that the executable name `argv[0]' should not contain period or `*'. *Note Overview of Main Functions: Part V Overview of Main Functions, for further details. The above program can in fact be made a lot simpler, using the goodies described in *note Goodies: Part I Goodies. You can simply write: while (!fl_show_question("Do you want to Quit?", 0)) /* empty */ ; Except printing out a message telling which button was pressed it will have exactly the same effect. The above program only shows one of the event handling methods provided by the library. The direct method of event handling shown is appropriate for simple programs. But, obviously, already for a program with just a few nmore objects it would become rather tedious to have to check each time `*note fl_do_forms()::' returns each of those objects to find out which of them was responsible and react accordingly. Utilizing object callback functions is then typically much easier and thus os strongly recommended. We demonstrate the use of object callbacks using the previous example with some modifications so that event processing via callbacks is utilized. It is recommended and also typical of a good XForms application to separate the UI components and the application program itself. Typically the UI components are generated by the bundled GUI builder and the application program consists mostly of callbacks and some glue code that combines the UI and the program. To use callbacks, a typical procedure would be to define all the callback functions first, then register them with the system using `*note fl_set_object_callback()::'. After the form is realized (shown), control is handed to Forms Library's main loop `*note fl_do_forms()::', which responds to user events indefinitely and never returns. After modifications are made to utilize object callbacks, the simple question example looks as follows: #include #include #include void yes_callback(FL_OBJECT *obj, long user_data) { printf("Yes is pushed\n"); fl_finish(); exit(0); } void no_callback(FL_OBJECT *obj, long user_data) { printf("No is pushed\n"); } int main(int argc, char *argv[]) { FL_FORM *form; FL_OBJECT *obj; fl_initialize(&argc, argv, "FormDemo", 0, 0); form = fl_bgn_form(FL_UP_BOX, 320, 120); fl_add_box(FL_NO_BOX, 160, 40, 0, 0, "Do you want to Quit?"); obj = fl_add_button(FL_NORMAL_BUTTON, 40, 70, 80, 30,"Yes"); fl_set_object_callback(obj, yes_callback, 0); obj = fl_add_button(FL_NORMAL_BUTTON, 200, 70, 80, 30,"No"); fl_set_object_callback(obj, no_callback, 0); fl_end_form(); fl_show_form(form, FL_PLACE_MOUSE, FL_TRANSIENT, "Question"); fl_do_forms(); return 0; } In this example, callback routines for both the yes and no buttons are first defined. Then they are registered with the system using `*note fl_set_object_callback()::'. After the form is shown, the event handling is again handed to the main loop in Forms Library via `*note fl_do_forms()::'. In this case, whenever the buttons are pushed, the callback routine is invoked with the object being pushed as the first argument to the callback function, and `*note fl_do_forms()::' never returns. You might also have noticed that in this example both buttons are made anonymous, that is, it is not possible to reference the buttons outside of the creating routine. This is often desirable when callback functions are bound to objects as the objects themselves will not be referenced except as callback arguments. By creating anonymous objects a program avoids littering itself with useless identifiers. The callback model presented above is the preferred way of interaction for typical programs and it is strongly recommended that programs using XForms be coded using object callbacks.  File: xforms.info, Node: Programming Model, Prev: Some Examples, Up: Part I Getting Started 2.3 Programming Model ===================== To summarize, every Forms Library application program must perform several basic steps. These are Initialize the Forms Library This step establishes a connection to the X server, allocates resources and otherwise initializes the Forms Library's internal structures, which include visual selection, font initialization and command line parsing. Defining forms Every program creates one or more forms and all the objects on them to construct the user interface. This step may also include callback registration and per object initialization such as setting bounds for sliders etc. Showing forms This step makes the designed user interface visible by creating and mapping the window (and subwindows) used by the forms. Main loop Most Forms Library applications are completely event-driven and are designed to respond to user events indefinitely. The Forms Library main loop, usually invoked by calling `*note fl_do_forms()::', retrieves events from the X event queue, dispatches them to the appropriate objects and notifies the application of what action, if any, should be taken. The actual notification method depends on how the interaction is set up, which could be done by calling an object callback or by returning the object whose status has changed to the application program. The following chapters will lead you through each step of the process with more details.  File: xforms.info, Node: Part I Defining Forms, Next: Part I Doing Interaction, Prev: Part I Getting Started, Up: Top 3 Defining Forms **************** In this chapter we will describe the basics of defining forms. Not all possible classes of objects are described here, only the most common ones. Also, for most classes only a subset of the available types are described. See Part III for a complete overview of all object classes currently available. Normally you will almost never have to write the code to define forms yourself because the package includes a Form Designer that does this for you (see Part II). Still it is useful to read through this chapter because it explains what some of the different object classes are and how to work with them. * Menu: * Starting and Ending a Form Definition:: * Boxes:: * Texts:: * Buttons:: * Sliders:: * ValSliders:: * Input Fields:: * Grouping Objects:: * Hiding and Showing:: * Deactivating and Triggering Objects:: * Changing Attributes:: * Adding and Removing Objects:: * Freeing Objects::  File: xforms.info, Node: Starting and Ending a Form Definition, Next: Boxes, Up: Part I Defining Forms 3.1 Starting and Ending a Form Definition ========================================= A form consists of a collection of objects. A form definition is started with the routine FL_FORM *fl_bgn_form(int type, FL_Coord w, FL_Coord h); `w' and `h' indicate the width and height of the form (in pixels by default). Positions in the form will be indicated by integers between 0 and `w-1' or `h-1'. The actual size of the form when displayed on the screen can still be varied. `type' indicates the type of the background drawn in the form. The background of each form is a box. See the next section for the different types available. The routine returns a pointer to the form just defined. This pointer must be used, for example, when drawing the form or doing interaction with it. The form definition ends with void fl_end_form(void); Between these two calls objects are added to the form. The following sections describe some of the more common classes of objects that can be added to a form. there's no built-in upper limit on the number of forms that can be defined and displayed when required. Normally you probably will first define all your forms before starting the actual work but it's no problem to define new forms also later on.  File: xforms.info, Node: Boxes, Next: Texts, Prev: Starting and Ending a Form Definition, Up: Part I Defining Forms 3.2 Boxes ========= The probably simplest type of objects are boxes. Boxes are used to give the forms and objects a nicer appearance. They can be used to visually group other objects together. The background of each form is a box. To add a box to a form you use the routine FL_OBJECT *fl_add_box(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); where `type' indicates the shape of the box. The Forms Library at the moment supports the following types of boxes: `FL_NO_BOX' No box at all (it's transparent), just a label `FL_UP_BOX' A box that comes out of the screen `FL_DOWN_BOX' A box that goes down into the screen `FL_BORDER_BOX' A flat box with a border `FL_SHADOW_BOX' A flat box with a shadow `FL_FRAME_BOX' A flat box with an engraved frame `FL_ROUNDED_BOX' A rounded box `FL_EMBOSSED_BOX' A flat box with an embossed frame `FL_FLAT_BOX' A flat box without a border (normally invisible unless given a different color than the surroundings) `FL_RFLAT_BOX' A rounded box without a border (normally invisible unless given a different color than the surroundings) `FL_RSHADOW_BOX' A rounded box with a shadow `FL_OVAL_BOX' A box shaped like an ellipse `FL_ROUNDED3D_UPBOX' A rounded box coming out of the screen `FL_ROUNDED3D_DOWNBOX' A rounded box going into the screen `FL_OVAL3D_UPBOX' An oval box coming out of the screen `FL_OVAL3D_DOWNBOX' An oval box going into the screen [image src="xforms_images/boxtypes.png"] The arguments `x' and `y' in the call of `*note fl_add_box()::'indicate the upper left corner of the box in the form while `w' and `h' are its width and height. `label' is a text that is placed in the center of the box. If you don't want a label in the box use an empty string or a `NULL' pointer. The label can be either one line or multiple lines. To obtain multi-line labels, insert newline characters (`\n') in the label string. It is also possible to underline the label or one of the characters in the label. This is accomplished by embedding ` H' (`\010' or `'\b'') after the letter that needs to be underlined. If the very first character of the label is `H', the entire label is underlined. The routine `*note fl_add_box()::' returns a pointer to the box object. (All routines that add objects return a pointer to the object.) This pointer can be used for later references to the object. It is possible to change the appearance of a box in a form. First of all, it is possible to change the color of the box and secondly, it is possible to change color, size and position of the label inside the box. Details on changing attributes of objects can be found in *note Changing Attributes::. Just a simple example has to suffice here. Assume we want to create a red box, coming out of the screen with the large words "I am a Box" in green in the center: FL_OBJECT *thebox; thebox = fl_add_box(FL_UP_BOX, 20, 20, 100, 100, "I am a Box"); fl_set_object_color(thebox, FL_RED, 0 ); /* make box red */ fl_set_object_lcolor(thebox, FL_GREEN ); /* make label green */ fl_set_object_lsize(thebox, FL_LARGE_SIZE); /* make label large */ Of course, this has to be placed inside a form definition (but the functions for changing the object attributes can also used anywhere else within the program).  File: xforms.info, Node: Texts, Next: Buttons, Prev: Boxes, Up: Part I Defining Forms 3.3 Texts ========= A second type of object is text. Text can be placed at any place on the form in any color you like. Placing a text object is done with the routine FL_OBJECT *fl_add_text(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); where `type' indicates the shape of the text. The Forms Library at the moment supports only one type of text: `FL_NORMAL_TEXT'. The text can be placed inside a box using the routine `*note fl_set_object_boxtype()::' to be described in *note Changing Attributes::. Again, the text can be multi-lined or underlined by embedding respectively the newline (`\n') or `H' (`\010' or `'\b'') in the label. The style, size and color of the text can be controlled and changed in many ways, *note Label Attributes and Fonts::. Note that there is almost no difference between a box with a label and a text. The only difference lies in the position where the text is placed object. Text is normally placed inside the box at the left side. This helps you put different lines of text below each other. Labels inside boxes are by default centered in the box. You can change the position of the text inside the box using the routines in *note Label Attributes and Fonts::. Note that, when not using any box around the text there is no need to specify a width and height of the box, they can both be 0.  File: xforms.info, Node: Buttons, Next: Sliders, Prev: Texts, Up: Part I Defining Forms 3.4 Buttons =========== A very important class of objects are buttons. Buttons are placed on the form such that the user can push them with the mouse. Different types of buttons exist: buttons that return to their normal position when the user releases the mouse, buttons that stay pushed until the user pushes them again and radio buttons that make other buttons be released. Adding a button to a form can be done using the following routine FL_OBJECT *fl_add_button(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); `label' is the text placed inside (or next to) the button. `type' indicates the type of the button. The Forms Library at the moment supports a number of types of buttons. The most important ones are: FL_NORMAL_BUTTON FL_PUSH_BUTTON FL_TOUCH_BUTTON FL_RADIO_BUTTON They all look the same on the screen but their functions are quite different. Each of these buttons get pushed down when the user presses the mouse on top of them. What actually happens when the user does so depends on the type of button. A normal button returns to its normal position when the user releases the mouse button. A push button remains pushed and is only released when the user pushes it again. A touch button is like a normal button except that as long as the user keeps the mouse pressed it is returned to the application program (*note Doing Interaction: Part I Doing Interaction. on the details of interaction). A radio button is a push button with additional extra property: Whenever the user pushes a radio button, all other pushed radio buttons in the form (or at least in the group, see below) they belong to are released. In this way the user can make a choice among some mutually exclusive possibilities. Whenever the user pushes a button and then releases the mouse, the interaction routine `*note fl_do_forms()::' is interrupted and returns a pointer to the button that was pushed and released. If a callback routine is present for the object being pushed, this routine will be invoked. In either case, the application program knows that the button was pushed and can take action accordingly. In the first case, control will have to be returned to `*note fl_do_forms()::' again after the appropriate action is performed; and in the latter, `*note fl_do_forms()::' would never return. *Note Doing Interaction: Part I Doing Interaction, for details on the interaction with forms. Different types of buttons are used in all the example programs provided. The application program can also set a button to appear pushed or not without user action. This is of course only useful for push buttons and radio buttons. To set or reset a push or radio button use the routine void fl_set_button(FL_OBJECT *obj, int pushed); `pushed' indicates whether the button should appear to be pushed (1) or released (0). Note that this does not invoke a callback routine bound to the button or results in the button getting returned to the program, i.e., only the visual appearance of the button is changed and what it returns when asked for its state (and, in the case of a radio button, possibly that of another radio button in the same group). To also get the callback invoked or the button returned to the program additonally call e.g., `*note fl_trigger_object()::'. To figure out whether a button appears as pushed or not use int fl_get_button(FL_OBJECT *obj); See the program `pushbutton.c' for an example of the use of push buttons and setting and getting button information. The color and label of buttons can again be changed using the routines in *note Changing Attributes::. There are other classes of buttons available that behave the same way as buttons but only look different. Light buttons have a small "light" (colored area) in the button. Pushing the button switches the light on, and releasing the button switches it off. To add a light button use `*note fl_add_lightbutton()::' with the same parameters as for normal buttons. The other routines are exactly the same as for normal buttons. The color of the light can be controlled with the routine `*note fl_set_object_color()::', *note Changing Attributes::. Round buttons are buttons that are round. Use `*note fl_add_roundbutton()::' to add a round button to a form. Round3d buttons are buttons that are round and 3D-ish looking. Round and light buttons are nice as radio and push buttons. Check buttons are buttons that have a small checkbox the user can push. To add a check button, use `*note fl_add_checkbutton()::'. More stylish for a group of radio buttons. Bitmap buttons are buttons that have a bitmap on top of the box. Use routine `*note fl_add_bitmapbutton()::' to add a bitmap button to a form. Pixmap buttons are buttons that have a pixmap on top of the box. Use routine `*note fl_add_pixmapbutton()::' to add a pixmap button to a form. Playing with different boxtypes, colors, etc., you can make many different types of buttons. See `buttonall.c' for some examples. Fig. 16.1 shows all buttons in their default states.  File: xforms.info, Node: Sliders, Next: ValSliders, Prev: Buttons, Up: Part I Defining Forms 3.5 Sliders =========== Sliders are useful in letting the user indicate a value between some fixed bounds. A slider is added to a form using the routine FL_OBJECT *fl_add_slider(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); The two most important types of sliders are `FL_VERT_SLIDERM' and `FL_HOR_SLIDER'. The former displays a slider that can be moved vertically and the latter gives a slider that moves horizontally. In both cases the label is placed below the slider. Default value of the slider is 0.5 and can vary between 0.0 and 1.0. These values can be changed using the routines: void fl_set_slider_value(FL_OBJECT *obj, double val); void fl_set_slider_bounds(FL_OBJECT *obj, double min, double max); Whenever the value of the slider is changed by the user, it results in the slider being returned to the application program or the callback routine invoked. The program can read the slider value using the call double fl_get_slider_value(FL_OBJECT *obj); and take action accordingly. See the example program `demo05.c' for the use of these routines. [image src="xforms_images/slider.png"]  File: xforms.info, Node: ValSliders, Next: Input Fields, Prev: Sliders, Up: Part I Defining Forms 3.6 ValSliders ============== A valslider is almost identical with a normal slider. The only difference is the way the slider is drawn. For valsliders, in addition to the slider itself, its current value is also shown. To add a valslider, use FL_OBJECT *fl_add_valslider(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); For all other interaction with a valslider the same function as for normal sliders can be used.  File: xforms.info, Node: Input Fields, Next: Grouping Objects, Prev: ValSliders, Up: Part I Defining Forms 3.7 Input Fields ================ It is often required to obtain textual input from the user, e.g., a file name, some fields in a database, etc. To this end input fields exist in the Forms Library. An input field is a field that can be edited by the user using the keyboard. To add an input field to a form use FL_OBJECT *fl_add_input(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); The main type of input field available is `FL_NORMAL_INPUT'. The input field normally looks like an `FL_DOWN_BOX'. This can be changed using the routine `*note fl_set_object_boxtype()::' to be described in *note Changing Attributes::. Whenever the user presses the mouse inside an input field a cursor will appear in it (and it will change color). Further input will appear inside this field. Full emacs(1) style editing is supported. When the user presses `' or `' the input field is returned to the application program and further input is directed to the next input field. (The `' key only works if there are no default buttons in the form. See the overview of object classes. The `' key always works.) [image src="xforms_images/input.png"] The user can use the mouse to select parts of the input field which will be removed when the user types the erase character or replaced by any new input the user types in. Also the location of the cursor can be moved in the input field using the mouse. The input field is fully integrated with the X Selection mechanism. Use the left button to cut from and the middle button to paste into an input field. The application program can direct the focus to a particular object using the call void fl_set_focus_object(FL_FORM *form, FL_OBJECT *obj); It puts the input focus in the form form onto object `obj'. To obtain the focus object, the following routine is available FL_OBJECT *fl_get_focus_object(FL_FORM *form); Note that the label is not the default text in the input field. The label is (by default) placed in front of the input field. To set the contents of the input field use the routines void fl_set_input(FL_OBJECT *obj, const char *str); void fl_set_input_f(FL_OBJECT *obj, const char *fmt, ...); To change the color of the input text or the cursor use void fl_set_input_color(FL_OBJECT *obj, int tcol, int ccol); Here `tcol' indicates the color of the text and `ccol' is the color of the cursor. To obtain the string in the field (when the user has changed it) use: const char *fl_get_input(FL_OBJECT *obj); See the program `demo06.c' for an example of the use of input fields.  File: xforms.info, Node: Grouping Objects, Next: Hiding and Showing, Prev: Input Fields, Up: Part I Defining Forms 3.8 Grouping Objects ==================== Objects inside a form definition can be grouped together. To this end we place them in between the routines FL_OBJECT *fl_bgn_group(void); and void fl_end_group(void); The first function returns a pointer to a pseudo-object that represents the start of the group (its class is `FL_BEGIN_GROUP'). It can be used in a number of functions to work on the whole group at once. Also the second creates a pseudo-object (of class `FL_END_GROUP'), marking the groups end, but since this object can't be used its address isn't returned. Groups can't be nested. Groups are useful for two reasons. First of all it is possible to hide groups of objects. (*note Hiding and Showing:: below.) This is often very handy. We can, for example, display part of a form only when the user asks for it (see demo program `group.c'. Some attributes are naturally multi-objects, e.g., to glue several objects together using the gravity attribute. Instead of setting the gravity for each object, you can place all related objects inside a group and set the resize/gravity attribute of the group. The second reason is for using radio buttons. As indicated in section 3.4 pushing a radio button makes the currently pushed radio button released. In fact, this happens only with radio buttons in the particular group. So to make two pairs (or more) of radio buttons, simply put each pair in a different group so that they won't interfere with each other. See, e.g., the example program `buttonall.c'. It is a good idea to always put radio buttons in a group, even if you have only one set of them. It is possible to add objects to an existing group FL_OBJECT *fl_addto_group(FL_OBJECT *group); where `group' is the object returned by `*note fl_bgn_group()::'. After this call, you can start adding objects to the group (e.g., `*note fl_add_button()::' etc.). The newly added objects are appended at the end of the group. When through with adding, use `*note fl_end_group()::' as before.  File: xforms.info, Node: Hiding and Showing, Next: Deactivating and Triggering Objects, Prev: Grouping Objects, Up: Part I Defining Forms 3.9 Hiding and Showing ====================== It is possible to temporarily hide certain objects or groups of objects. To this end, use the routine void fl_hide_object(FL_OBJECT *obj); `obj' is the object to hide or the group of objects to hide. Hidden objects don't play any role anymore. All routines on the form act as if the object does not exist. To make the object or group of objects visible again use void fl_show_object(FL_OBJECT *obj); Hiding and showing (groups of) objects are useful to change the appearance of a form depending on particular information provided by the user. You can also make overlapping groups in the form and take care that only one of them is visible. If you want to know if an object is shown you can use int fl_object_is_visible(FL_OBJECT *obj); Please note for an object to be visible also the form it belongs to must be shown, which isn't factored into the return value.  File: xforms.info, Node: Deactivating and Triggering Objects, Next: Changing Attributes, Prev: Hiding and Showing, Up: Part I Defining Forms 3.10 Deactivating and Triggering Objects ======================================== Sometimes you might want a particular object to be temporarily inactive, e.g., you want to make it impossible for the user to press a particular button or to type input in a particular field. For this you can use the routine void fl_deactivate_object(FL_OBJECT *obj); `obj' is the object to be deactivated. When `obj' is a group the whole group is deactivated. To reactivate the group or button use the routine void fl_activate_object(FL_OBJECT *obj); To find out if an object is in active state use the function int fl_object_is_active(FL_OBJECT *obj); Normally you also want to give the user a visual indication that the object is not active. This can, for example, be done by changing the label color to grey (see below). This is not done automatically, so unless you set e.g., a different color the objects appearance won't change on deactivation (or re-activation). It is possible to simulate the action of an object being triggered from within the program by using the following routine void fl_trigger_object(FL_OBJECT *obj); Calling this routine on an object `obj' results in the object returned to the application program or its callback being called if it exists. Note however, there is no visual feedback, i.e., `fl_trigger_object(button)' will not make the button object named `button' appear to be pushed.  File: xforms.info, Node: Changing Attributes, Next: Adding and Removing Objects, Prev: Deactivating and Triggering Objects, Up: Part I Defining Forms 3.11 Changing Attributes ======================== There are a number of general routines that can be used to alter the appearance of any object. * Menu: * Color:: * Bounding Boxes:: * Label Attributes and Fonts:: * Tool Tips:: * Redrawing:: * Changing Many Attributes:: * Symbols::  File: xforms.info, Node: Color, Next: Bounding Boxes, Up: Changing Attributes 3.11.1 Color ------------ To change the color of a particular object use the routine void fl_set_object_color(FL_OBJECT *obj, FL_COLOR col1, FL_COLOR col2); `col1' and `col2' are indices into a colormap. Which colors are actually changed depends on the type of the object. For box and text only `col1' is important. It indicates the color of the box or of the box in which the text is placed. For buttons, `col1' is the color of the button when released and `col2' is the color of the button when pushed. (Note that when changing the color of a button the nice property that the color of a button changes when the mouse moves over it disappears.) For light buttons the two colors indicate the color of the light when off and when on. For bitmap buttons, `col1' is the color of the box and `col2' is the color of the bitmap. For sliders `col1' is the color of the background of the slider and `col2' is the color of the slider itself. Finally, for input objects `col1' is the color of the input field when it is not selected and `col2' is the color when it has input focus, i.e., the user can enter text. For all types of objects, the default colors can be found in the file `forms.h'. For example, for input fields the default colors are `FL_INPUT_COL1' and `FL_INPUT_COL2'. Form Designer comes in very handy in familiarizing you with various attributes since you can change all attributes of an object and immediately see the difference by "test"ing the object. To find out the colors of an object use void fl_get_object_color(FL_OBJECT *obj, FL_COLOR *col1, FL_COLOR *col2); The following pre-defined color symbols can be used in all color change requests. If the workstation does not support this many colors, substitution by the closest color will happen. Name RGB triple --------------------------------------------------------------------- `FL_BLACK' `( 0, 0, 0)' [image src="xforms_images/FL_BLACK.png"] `FL_WHITE' `(255, 255, 255)', [image src="xforms_images/FL_WHITE.png"] `FL_COL1' `(173, 173, 173)' [image src="xforms_images/FL_COL1.png"] `FL_BOTTOM_BCOL' `( 89, 89, 89)' [image src="xforms_images/FL_BOTTOM_BCOL.png"] `FL_RIGHT_BCOL' `( 41, 41, 41)' [image src="xforms_images/FL_RIGHT_BCOL.png"] `FL_MCOL' `(191, 191, 191)' [image src="xforms_images/FL_MCOL.png"] `FL_LEFT_BCOL' `(222, 222, 222)' [image src="xforms_images/FL_LEFT_BCOL.png"] `FL_LIGHTER_COL1' `(204, 204, 204)' [image src="xforms_images/FL_LIGHTER_COL1.png"] `FL_DARKER_COL1' `(161, 161, 161)' [image src="xforms_images/FL_DARKER_COL1.png"] `FL_SLATEBLUE' `(113, 113, 198)' [image src="xforms_images/FL_SLATEBLUE.png"] `FL_INDIANRED' `(198, 113, 113)' [image src="xforms_images/FL_INDIANARED.png"] `FL_RED' `(255, 0, 0)' [image src="xforms_images/FL_RED.png"] `FL_BLUE' `( 0, 0, 255)' [image src="xforms_images/FL_BLUE.png"] `FL_GREEN' `( 0, 255, 0)' [image src="xforms_images/FL_GREEN.png"] `FL_YELLOW' `(255, 255, 0)' [image src="xforms_images/FL_YELLOW.png"] `FL_MAGENTA' `(255, 0, 255)' [image src="xforms_images/FL_MAGENTA.png"] `FL_CYAN' `( 0, 255, 255)' [image src="xforms_images/FL_CYAN.png"] `FL_TOMATO' ` 255, 99, 71' [image src="xforms_images/FL_TOMATO.png"] `FL_INACTIVE' `(110, 110, 110)' [image src="xforms_images/FL_INACTIVE.png"] `FL_TOP_BCOL' `(204, 204, 204)' [image src="xforms_images/FL_TOP_BCOL.png"] `FL_PALEGREEN' `(113, 198, 113)' [image src="xforms_images/FL_PALEGREEN.png"] `FL_DARKGOLD' `(205, 149, 10)' [image src="xforms_images/FL_DARKGOLD.png"] `FL_ORCHID' `(205, 105, 201)' [image src="xforms_images/FL_ORCHID.png"] `FL_DARKCYAN' `(40, 170, 175)' [image src="xforms_images/FL_DARKCYAN.png"] `FL_DARKTOMATO' `(139, 54, 38)' [image src="xforms_images/FL_DARKTOMATO.png"] `FL_WHEAT' `(255, 231, 155)' [image src="xforms_images/FL_WHEAT.png"] `FL_DARKORANGE' `(255, 128, 0)' [image src="xforms_images/FL_DARKORANGE.png"] `FL_DEEPPINK' `(255, 0, 128)' [image src="xforms_images/FL_DARKPINK.png"] `FL_CHARTREUSE' `(128, 255, 0)' [image src="xforms_images/FL_CHARTEUSE.png"] `FL_DARKVIOLET' `(128, 0, 255)' [image src="xforms_images/FL_DARKVIOLET.png"] `FL_SPRINGGREEN' `( 0, 255, 128)' [image src="xforms_images/FL_SPRINGGREEN.png"] `FL_DODGERBLUE' `( 0, 128, 255)' [image src="xforms_images/FL_DODGERBLUE.png"] `FL_FREE_COL1' `( ?, ?, ?)' Of all the colors listed in the table above `FL_FREE_COL1' has the largest numerical value, and all color with indices smaller than that are used (or can potentially be used) by the Forms Library although, if you wish, they can also be changed using the following routine prior to `*note fl_initialize()::': void fl_set_icm_color(FL_COLOR index, int r, int g, int b); Note that although the color of an object is indicated by a single index, it is not necessarily true that the Forms Library is operating in PseudoColor. Forms Library is capable of operating in all visuals and as a matter of fact the Forms Library will always select TrueColor or DirectColor if the hardware is capable of it. The actual color is handled by an internal colormap of `FL_MAX_COLORS' entries (default is 1024). To change or query the values of this internal colormap use the call void fl_set_icm_color(FL_COLOR index, int r, int g, int b); void fl_get_icm_color(FL_COLOR index, int *r, int *g, int *b); Call `*note fl_set_icm_color()::' before `*note fl_initialize()::' to change XForms's default colormap. Note that these two routines do not communicate with the X server, they only populate/return information about the internal colormap, which is made known to the X server by the initialization routine `*note fl_initialize()::'. To change the colormap and make a color index active so that it can be used in various drawing routines after `*note fl_initialize()::' initialization, use the following function unsigned long fl_mapcolor(FL_COLOR i, int red, int green, int blue); This function frees the previous allocated pixel corresponding to color index `i' and re-allocates a pixel with the RGB value specified. The pixel value is returned by the function. It is recommended that you use an index larger than `FL_FREE_COL1' for your remap request to avoid accidentally freeing the colors you have not explicitly allocated. Indices larger than 224 are reserved and should not be used. Sometimes it may be more convenient to associate an index with a colorname, e.g., "red" etc., which may have been obtained via resources. To this end, the following routine exists long fl_mapcolorname(FL_COLOR i, const char *name); where `name' is the color name(1). The function returns -1 if the colorname name is not resolved. You can obtain the RGB values of an index by using the following routine unsigned long fl_getmcolor(FL_COLOR i, int *red, int *green, int *blue); The function returns the pixel value as known by the Xserver. If the requested index, `i', is never mapped or is freed, the RGB values as well as the pixel value are random. Since this function communicates with the Xserver to obtain the pixel information, it has a two-way traffic overhead. If you're only interested in the internal colormap of XForms, `*note fl_get_icm_color()::' is more efficient. Note that the current version only uses the lower byte of the primary color. Thus all primary colors in the above functions should be specified in the range of 0-255 inclusive. To free any colors that you no longer need, the following routine should be used void fl_free_colors(FL_COLOR colors[], int ncolors); Prior to XForms version 0.76, there is a color "leakage" in the implementation of the internal colormap that prevents the old index from being freed in the call `*note fl_mapcolor()::', resulting in accelerated colormap overflow and some other undesirable behavior. Since there may still be some applications based on older versions of the Forms Library, a routine is provided to force the library to be compatible with the (buggy) behavior: void fl_set_color_leak(int flag); Due to the use of an internal colormap and the simplified user interface, changing the colormap value for the index may not result in a change of the color for the object. An actual redraw of the object (see below) whose color is changed may be required to have the change take effect. Therefore, a typical sequence of changing the color of a visible object is as follows: fl_mapcolor(newcol, red, green, blue); /* obj uses newcol */ fl_redraw_object(obj); ---------- Footnotes ---------- (1) Standard color names are listed in a file named `rgb.txt' and usually resides in `/usr/lib/X11/'  File: xforms.info, Node: Bounding Boxes, Next: Label Attributes and Fonts, Prev: Color, Up: Changing Attributes 3.11.2 Bounding Boxes --------------------- Each object has a bounding box. This bounding box can have different shapes. For boxes it is determined by the type. For text it is normally not visible. For input fields it normally is a `FL_DOWN_BOX', etc. The shape of the box can be changed using the routine void fl_set_object_boxtype(FL_OBJECT *obj, int boxtype); `boxtype' should be one of the following: `FL_UP_BOX', `FL_DOWN_BOX', `FL_FLAT_BOX', `FL_BORDER_BOX', `FL_SHADOW_BOX', `FL_ROUNDED_BOX', `FL_RFLAT_BOX', `FL_RSHADOW_BOX' and `FL_NO_BOX', with the same meaning as the type for boxes. Some care has to be taken when changing boxtypes. In particular, for objects like sliders, input fields, etc. never use the boxtype `FL_NO_BOX'. Don't change the boxtype of objects that are visible on the screen. It might have undesirable effects. If you must do so, redraw the entire form after changing the boxtype of an object (see below). See the program `boxtype.c' for the effect of the boxtype on the different classes of objects. It is possible to alter the appearance of an object by changing the border width attribute void fl_set_object_bw(FL_OBJECT *obj, int bw); To find out about the current setting for the border width of an object call int fl_get_object_bw(FL_OBJECT *obj); Border width controls the "height" of an object, e.g., a button having a border width of 3 pixels appears more pronounced than one having a border width of 2. The Forms Library's default is `FL_BOUND_WIDTH' (1) pixels (before version 1.0.91 the default was 3). Note that the border width can be negative. Negative border width does not make a down box, rather, it makes the object having an upbox appear less pronounced and "softer". See program `borderwidth.c' for the effect of border width on different objects. All applications developed using XForms accept a command line option `-bw', followed by an integer number, the user can use to select the preferred border width. It is recommended that you document this flag in your application documentation. If you prefer a certain border width, use `*note fl_set_defaults()::' or `*note fl_set_border_width()::' before `*note fl_initialize()::' to set the border width instead of hard-coding it on a per form or per object basis so the user has the option to change it at run time via the `-bw' flag. [image src="xforms_images/borderwidth.png"] There also exists a call that changes the object border width for the entire application void fl_set_border_width(int border_width);  File: xforms.info, Node: Label Attributes and Fonts, Next: Tool Tips, Prev: Bounding Boxes, Up: Changing Attributes 3.11.3 Label Attributes and Fonts --------------------------------- There are also a number of routines to change the appearance of the label. The first one is void fl_set_object_lcolor(FL_OBJECT *obj, FL_COLOR lcol); It sets the color of the label. The default is black (`FL_BLACK'). The font size of the label can be changed using the routine void fl_set_object_lsize(FL_OBJECT *obj, int lsize); where `lsize' gives the size in points. Depending on the server and fonts installed, arbitrary sizes may or may not be possible. Fig 3.5 shows the font sizes that are standard with MIT/XConsortium distribution. So use of these values is encouraged. In any case, if a requested size can not be honored, substitution will be made. The default size for XForms is 10pt. `FL_TINY_SIZE' 8pt `FL_SMALL_SIZE' 10pt `FL_NORMAL_SIZE' 12pt `FL_MEDIUM_SIZE' 14pt `FL_LARGE_SIZE' 18pt `FL_HUGE_SIZE' 24pt [image src="xforms_images/fontsize.png"] Labels can be drawn in many different font styles. The style of the label can be controlled with the routine void fl_set_object_lstyle(FL_OBJECT *obj, int lstyle); The default font for the Forms Library is Helvetica at 10pt. Additional styles are available: `FL_NORMAL_STYLE' Normal text `FL_BOLD_STYLE' Boldface text `FL_ITALIC_STYLE' Guess what `FL_BOLDITALIC_STYLE' BoldItalic `FL_FIXED_STYLE' Fixed width (good for tables) `FL_FIXEDBOLD_STYLE' `FL_FIXEDITALIC_STYLE' `FL_FIXEDBOLDITALIC_STYLE' `FL_TIMES_STYLE' Times-Roman like font `FL_TIMESBOLD_STYLE FL' `FL_TIMESITALIC_STYLE' `FL_TIMESBOLDITALIC_STYLE' `FL_SHADOW_STYLE' Text casting a shadow `FL_ENGRAVED_STYLE' Text engraved into the form `FL_EMBOSSED_STYLE' Text standing out The last three styles are special in that they are modifiers, i.e., they do not cause font changes themselves, they only modify the appearance of the font already active. E.g., to get a bold engraved text, set `lstyle' to `FL_BOLD_STYLE|FL_ENGRAVED_STYLE'. Other styles correspond to the first 12 fonts. The package, however, can handle up to 48 different fonts. The first 16 (numbers 0-15) have been pre-defined. The following table gives their names: 0 helvetica-medium-r 1 helvetica-bold-r 2 helvetica-medium-o 3 helvetica-bold-o 4 courier-medium-r 5 courier-bold-r 6 courier-medium-o 7 courier-bold-o 8 times-medium-r 9 times-bold-r 10 times-medium-o 11 times-bold-o 12 charter-medium-r 13 charter-bold-r 14 charter-medium-i 15 Symbol The other 32 fonts (numbers 16-47) can be filled in by the application program. Actually, the application program can also change the first 16 fonts if required (e.g., to force a particular resolution). To change a font for the the entire application, use one of the following routines: int fl_set_font_name(int index, const char *name); int fl_set_font_name(int index, const char *fmt, ...); The first form accepts just a simple string for the font name while the second assembles the name from a format string as it's used with `printf()' etc. and the following arguments. The first argument, `index', is the number of the font (between 0 and `FL_MAXFONTS-1') and the font name should be a valid font name (with the exception of the size field). If you are defining a completely different font family starting at index `k', it's a good idea to define `k + FL_BOLD_STYLE' to be the corresponding bold font in the family , and `k + FL_ITALIC_STYLE' the corresponding italic font in the family (so object like browser can obtain correct style when switching font styles): #define Pretty 30 #define PrettyBold (Pretty + FL_BOLD_STYLE) #define PrettyItalic (Pretty + FL_ITALIC_STYLE) fl_set_font_name(Pretty, fontname); fl_set_font_name(PrettyBold, boldfontname); fl_set_font_name(PrettyItalic, italicfontname); ... fl_set_object_lstyle(obj, PrettyBold); The function returns a negative value if the requested font is invalid or otherwise can't be loaded. Note however, if this routine is called before `*note fl_initialize()::', it will return 0, but may fail later if the font name is not valid. To change the default font (helvetica-medium), a program should change font `FL_NORMAL_STYLE'. To get the name of a font at a certain index use const char *fl_get_font_name(int index); If a font name in XLFD is given, a question mark (`?') in the point size position (i.e.; between the eighth and the nineth dash) informs the Forms Library that a scalable font should be requested later. It is preferable that the complete XLFD name (i.e., with 14 dashes and possibly wildcards) be given because a complete name has the advantage that the font may be re-scalable if scalable fonts are available. This means that although both "-*-helvetica-medium-r-*-*-*-?-*-*-*-*-*-*" "-*-helvetica-medium-r-*-*-*-?-*-*" are valid font names, the first form may be re-scalable while the the second is not. To obtain the actual built-in font names, use the following function int fl_enumerate_fonts(void (*cb)(const char *f), int shortform); where `cb' is a callback function that gets called once for every built-in font name. The font name is passed to the callback function as the string pointer parameter while `shortform' selects if a short form of the name should be used. XForms only specifies the absolutely needed parts of the font names, and assumes the font path is set so that the server always chooses the most optimal fonts for the system. If this is not true, you can use `*note fl_set_font_name()::' or `*note fl_set_font_name_f()::' to select the exact font you want. In general, this is not recommended if your application is to be run/displayed on different servers. See `fonts.c' for a demonstration of all the built-in font styles available. You can change the alignment of the label with respect to the bounding box of the object. For this you should use the routine void fl_set_object_lalign(FL_OBJECT *obj, int align); with the following values for the `align' argument: `FL_ALIGN_LEFT' To the left of the box. `FL_ALIGN_RIGHT' To the right of the box. `FL_ALIGN_TOP' To the top of the box. `FL_ALIGN_BOTTOM' To the bottom of the box. `FL_ALIGN_CENTER' In the middle of the box. `FL_ALIGN_RIGHT_BOTTOM'To the right and bottom of the box. `FL_ALIGN_LEFT_BOTTOM' To the left and bottom of the box. `FL_ALIGN_RIGHT_TOP' To the right and top of the box. `FL_ALIGN_LEFT_TOP' To the left and top of the box. Alignment requests with the abpve constants place the text outside the box (except for `*note FL_ALIGN_CENTER::'). To get a value that can be used to align the label within the object the function int fl_to_inside_lalign(int align); can be used, which returns the necessary value for the corresponding inside alignment. Except for the case of `*note FL_ALIGN_CENTER::' (which is always inside the object) the result is the original value, logically or'ed with the constant . There's also a function for the reverse conversion, i.e., from a calue for inside to outside alignment int fl_to_outside_lalign(int align); Using this functions is a bit simpler than combining the value with the `*note FL_ALIGN_INSIDE::' constant, especially when it comes to `*note FL_ALIGN_CENTER::' (which doesn't has the this bit set, even though labels with this alignment will always be shown within the object. Both functions return `-1' if an invalid value for the alignment is passed to them. There exist also three functions to test for the inside or outside alignment: int fl_is_inside_lalign(int align); int fl_is_outside_lalign(int align); int fl_is_center_lalign(int align); Note that these functions return `0' also in the case that the alignment value passed to them is invalid. Not all objects accept all kinds of label alignment. For example for sliders, inputs etc. it doesn't make sense to have the label within the object und in these cases a request for an inside label is ignored (or, more precisely, converted to the corresponding request for an outside label or, on a request with `*note FL_ALIGN_CENTER::', the reversion to the default label position). On the other hand, some objects like the text object (where the text to be shown is the label's text) accept only inside alignment and a request for an outside alignment will automatically replaced by the corresponding inside alignment. See also the demo program `lalign.c' for an example of the positioning of labels using the above constants. Finally, the routines void fl_set_object_label(FL_OBJECT *obj, const char *label); void fl_set_object_label_f(FL_OBJECT *obj, const char *fmt, ...); change the label of a given object. Whilw the first function expects a simple string for the label. the second one accepts a format string with the same format specifiers as `printf()' etc., followed by as many additional arguments as there are format specifiers. An internal copy of the label for the object is made. As mentioned earlier, newline (`\n') can be embedded in the label to generate multiple lines. By embedding `H' (`\010') in the label, the entire label or one of the characters in the label can be underlined. The function const char * fl_get_object_label(FL_OBJECT *obj); returns the label string.  File: xforms.info, Node: Tool Tips, Next: Redrawing, Prev: Label Attributes and Fonts, Up: Changing Attributes 3.11.4 Tool Tips ---------------- As will be seen later, an object can be decorated by icons instead of labels. For this kind of object, it is helpful to show a text string that explains the function the object controls under appropriate conditions. Forms Library elected to show the message after the mouse enters the object for about 600 milli-seconds. The text is removed when the mouse leaves the object or when the mouse is pressed. To set the text, use the following routines void fl_set_object_helper(FL_OBJECT *obj, const char *helpmsg); void fl_set_object_helper_f(FL_OBJECT *obj, const char *fmt, ...); where `helpmsg' is a text string (with possible embedded newlines in it) that will be shown when the mouse enters the object, after about a 600 milli-second delay. The second form of the function accepts instead a format string like `printf()' etc., followed by the appropriate number of arguments. In both cases an internal copy of the string is made. The boxtype, color and font for the message display can be customized further using the following routines void fl_set_tooltip_boxtype(int boxtype); void fl_set_tooltip_color(FL_COLOR textcolor, FL_COLOR background); void fl_set_tooltip_font(int style, int size); void fl_set_tooltip_lalign(int align); where `boxtype' is the backface of the form that displays the text. The default is `FL_BORDER_BOX'. `textcolor' and `background' specify the colors of the text string and the backface. The defaults for these are `FL_BLACK' and `FL_YELLOW' respectively. The `style' and `size' parameters are the font style and size of the text. `align' is the alignment of the text string with respective to the box. The default is `FL_ALIGN_LEFT | FL_ALIGN_INSIDE' .  File: xforms.info, Node: Redrawing, Next: Changing Many Attributes, Prev: Tool Tips, Up: Changing Attributes 3.11.5 Redrawing Objects ------------------------ A word of caution is required. It is possible to change the attributes of an object at any time. But when the form is already displayed on the screen some care has to be taken. Whenever attributes change the system redraws the object. This is fine when drawing the object erases the old one but this is not always the case. For example, when placing labels outside the box (not using `FL_ALIGN_CENTER') they are not correctly erased. It is always possible to force the system to redraw an object using void fl_redraw_object(FL_OBJECT *obj); When the object is a group it redraws the complete group. To redraw an entire form, use void fl_redraw_form(FL_FORM *form); Use of these routines is normally not necessary and should be kept to an absolute minimum.  File: xforms.info, Node: Changing Many Attributes, Next: Symbols, Prev: Redrawing, Up: Changing Attributes 3.11.6 Changing Many Attributes ------------------------------- Whenever you change an attribute of an object in a visible form the object is redrawn immediately to make the change visible. This can be undesirable when you change a number of attributes of the same object. You only want the changed object to be drawn after the last change. Drawing it after each change will give a flickering effect on the screen. This gets even worse when you, for example, just want to hide a few objects. After each object you hide the entire form is redrawn. In addition to the flickering, it is also time consuming. Thus it is more efficient to tell the library to temporarily not redraw the form while changes are being made. This can be done by "freezing" the form. While a form is being frozen it is not redrawn, all changes made are instead buffered internally. Only when you unfreeze the form, all changes made in the meantime are drawn at once. For freezing and unfreezing two calls exist: void fl_freeze_form(FL_FORM *form); and void fl_unfreeze_form(FL_FORM *form); It is a good practice to place multiple changes to the contents of a form always between calls to these two procedures. Further, it is better to complete modifying the attributes of one object before starting work on the next.  File: xforms.info, Node: Symbols, Prev: Changing Many Attributes, Up: Changing Attributes 3.11.7 Symbols -------------- Rather than using text as a label it is possible to place symbols like an arrows etc. on objects. This is done in the following way: When the label starts with the character `@' instead of the text a particular symbol is drawn(1). The rest of the label string indicates the symbol. A number of pre-defined symbols are available: `->' Normal arrow pointing to the right. `<-' Normal arrow pointing to the left. `>' Triangular arrow pointing to the right. `<' Triangular arrow pointing to the left. `>>' Double triangle pointing to the right. `<<' Double triangle pointing to the left. `<->' Arrow pointing left and right. `->|' A normal arrow with a bar at the end. `>|' A triangular arrow with a bar at the end. `-->' A thin arrow pointing to the right. `=' Three embossed lines. `arrow' Same as `-->'. `returnarrow' `' key symbol. `square' A square. `circle' A circle. `line' A horizontal line. `plus' A plus sign (can be rotated to get a cross). `UpLine' An embossed line. `DnLine' An engraved line. `UpArrow' An embossed arrow. `DnArrow' An engraved arrow. See Fig. 3.6 for how some of them look. It is possible to use the symbols in different orientations. When the symbol name is preceded by a digit `1'-`9' it is rotated like on the numerical keypad, i.e., `6' (and also `5') result in no rotation, `9' a rotation of 45 degrees counter-clockwise, `8' a rotation of 90 degrees, etc. Hence the order is `6', `9', `8', `7', `4', `1', `2', `3'. (Just think of the keypad as consisting of arrow keys with 6 pointing in the default orientation, i.e., to the right). So to get an arrow that is pointing to the left top use a label `@7->'. To put the symbol in other orientations, put a 0 after the `@', followed by the angle (counter-clockwise). E.g., to draw an arrow at an angle of 30 degrees you can use `@030->'. The symbol will be scaled to fit in the bounding box. When the bounding box is not square, scaling in the x- and y-directions will be different. If keeping the aspect ratio is desired, put a sharp (`#') immediately after the . E.g., `@#9->'. Two additional prefixes, `+' and `-', followed by a single digit, can be used to make small symbol size adjustment. A `+' indicates an increase of the symbol size while a `-' a decrease. The single digit following the prefix is the amount of increment (or decrement) in pixels. For example, to draw a square that is 3 pixels smaller in size than the default size use `@-3square'. If a single sequence of `+' or `-' and a single digit does not suffice, it can repeated, the effect is cumulative. Of course, this can also be combined with a rotation etc., so i.e., `@-9-3030->' (the order in which the different sequences are used doesn't matter) will result in an arrow drawn 12 pixels smaller than normal and rotated by 30 degrees counter-clockwise. As already stated the "default" size of a symbol is (this at least holds for the built-in ones) one where it fits autoatically into the box it is to be drawn into, with a bit of room left around it. Thus the size of the symbol should in most cases be fine without any further fine-tuning. If you increase the size for whatever reasons please consider that the symbol automatically gets clipped to the area it is will be drawn into, i.e., increments that result in the symbol becoming larger than the box it is to be drawn into should be avoided. [image src="xforms_images/symbols.png"] In addition to using symbols as object labels, symbols can also be drawn directly using int fl_draw_symbol(const char *symbolname, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_Color col); (the function returns `1' on success and `0' on failure when the symbol name isn't valid) or indirectly via `*note fl_draw_text()::'. Drawing is clipped automatically to the area given by the arguments. The application program can also add symbols to the system which it can then use to display symbols on objects that are not provided by the Forms Library. To add a symbol, use the call int fl_add_symbol(const char *name, void (*drawit)(),int sc); `name' is the name under which the symbol should be known, which may not have a `@', a `#' or a digit at the start (or `+' or `-', directly followed by a digit). `drawit()' is the routine to be called for drawing the symbol. `sc' is reserved and currently has no meaning. Best set it to `0'. The routine `drawit()' should have the form void drawit(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle, FL_COLOR col); `col' is the color in which to draw the symbol. This is the label color that can be provided and changed by the application program. The routine should draw the symbol centered inside the box by `x', `y', `w', `h' and rotated from its natural position by `angle' degrees. The draw function can call all types of drawing routines, including `*note fl_draw_symbol()::'. Before it is called clipping is set to the area given by the first four arguments. If the new symbol name is the same as that of a built-in or of one previously defined, the new definition overrides the built-in or previously defined one. The function returns `1' on success and `0' on failure (due to invalid arguments). The symbol handling routines really should be viewed as a means of associating an arbitrary piece of text (the label) with arbitrary graphics, application of which can be quite pleasant given the right tasks. A symbol (built-in or previously defined) can also be deleted using int fl_delete_symbol(const char *name); On success `1' is returned, otherwise `0'. ---------- Footnotes ---------- (1) If you want a literal `@' character as the first character of a label text, escape it with another `@' character.  File: xforms.info, Node: Adding and Removing Objects, Next: Freeing Objects, Prev: Changing Attributes, Up: Part I Defining Forms 3.12 Adding and Removing Objects ================================ In some situations you might want to add objects to an already existing form (i.e., a form for which ``fl_end_form()'' has already been called. Reopening a form for the addition of further objects can be done by using the call FL_FORM *fl_addto_form(FL_FORM *form); After this call you can again add objects to the form with the usual functions for adding objects (like `*note fl_add_button()::' etc.). When done with adding objects to the form again call `*note fl_end_form()::'. It is possible to add objects to forms that are being displayed, but this is not always a good idea because not everything behaves well (e.g., strange things might happen when a group is started but not yet finished). To remove an object from a form simply use void fl_delete_object(FL_OBJECT *obj); It removes the object from the form it currently belongs to and also from a group it may belong to. The argument can also be the pseudo-object starting a group (i.e., the return value of `*note fl_bgn_group()::') in which case the whole group of objects will be removed from the form. Contrary to what the name of the function may hint at the object itself isn't deleted but it remains available (except if it's an object that marks the start or end of a group) and thus it can be added again to the same or another form (without having to call `*note fl_addto_form()::' first and `*note fl_end_form()::' afterwards) using the function void fl_add_object(FL_FORM *form, FL_OBJECT *obj); Normally, this function should only be used within object classes to add a newly created object to the form currently under construction. It can not be used for pseude-objects representing the start or end of a group.  File: xforms.info, Node: Freeing Objects, Prev: Adding and Removing Objects, Up: Part I Defining Forms 3.13 Freeing Objects ==================== If the application program does not need an object anymore it can completely delete it, freeing all memory used for it, using a call of void fl_free_object(FL_OBJECT *obj); After this the object is truely destroyed and can no longer be used. If you hadn't removed the object from the form it did belong to using `*note fl_delete_object()::' before this will be done automatically. To free the memory used by an entire form use a call of void fl_free_form(FL_FORM *form); This will delete and free all the objects of the form and the form itself. A freed form can not be referenced anymore.  File: xforms.info, Node: Part I Doing Interaction, Next: Part I Free Objects, Prev: Part I Defining Forms, Up: Top 4 Doing Interaction ******************* * Menu: * Displaying a Form:: * Simple Interaction:: * Periodic Events and Non-blocking Interaction:: * Dealing With Multiple Windows:: * Using Callback Functions:: * Handling Other Input Sources::  File: xforms.info, Node: Displaying a Form, Next: Simple Interaction, Up: Part I Doing Interaction 4.1 Displaying a Form ===================== After having defined the forms the application program can use them to interact with the user. As a first step the program has to display the forms with which it wants the user to interact. This is done using the routine Window fl_show_form(FL_FORM *form, int place, int border, const char *name); It opens a (top-level) window on the screen in which the form is shown. The parameter `name' is the title of the form (and its associated icon if any). The routine returns the ID of the forms window. You normally never need this. Immediately after the form becomes visible, a full draw of all objects on the form is performed. Due to the two way buffering mechanism of Xlib, if `*note fl_show_form()::' is followed by something that blocks (e.g., waiting for a device other than X devices to come online), the output buffer might not be properly flushed, resulting in the form only being partially drawn. If your program works this way, use the following function after `*note fl_show_form()::' void fl_update_display(int blocking); where `blocking' is false (0), the function flushes the X buffer so the drawing requests are on their way to the server. When `blocking' is true (1), the function flushes the buffer and waits until all the events are received and processed by the server. For typical programs that use `*note fl_do_forms()::' or `*note fl_check_forms()::' after `*note fl_show_form()::', flushing is not necessary as the output buffer is flushed automatically. Excessive call to `*note fl_update_display()::' degrades performace. The location and size of the window to be shown on the call of `*note fl_show_form()::' are determined by the `place' argument. The following possibilities exist: `FL_PLACE_SIZE' The user can control the position but the size is fixed. Interactive resizing is not allowed once the form becomes visible. `FL_PLACE_POSITION' Initial position used will be the one set via `*note fl_set_form_position()::'. Interactive resizing is possible. `FL_PLACE_GEOMETRY' Place at the latest position and size (see also below) or the geometry set via `*note fl_set_form_geometry()::'. A form so shown will have a fixed size and interactive resizing is not allowed. `FL_PLACE_ASPECT' Allows interactive resizing but any new size will have the aspect ratio as that of the initial size. `FL_PLACE_MOUSE' The form is placed centered below the mouse. Interactive resizing will not be allowed unless this option is accompanied by `*note FL_FREE_SIZE::' as in `*note FL_PLACE_MOUSE::|*note FL_FREE_SIZE::'. `FL_PLACE_CENTER' The form is placed in the center of the screen. If `*note FL_FREE_SIZE::' is also specified, interactive resizing will be allowed. `FL_PLACE_FULLSCREEN' The form is scaled to cover the full screen. If `*note FL_FREE_SIZE::' is also specified, interactive resizing will be allowed. `FL_PLACE_FREE' Both the position and size are completely free. The initial size used is the designed size. Initial position, if setvia `*note fl_set_form_position()::', will be used otherwise interactive positioning may be possible if the window manager allows it. `FL_PLACE_HOTSPOT' The form is placed so that mouse is on the form's "hotspot". If `*note FL_FREE_SIZE::' is also specified, interactive resizing will be allowed. `FL_PLACE_CENTERFREE' Same as `*note FL_PLACE_CENTER::|*note FL_FREE_SIZE::', i.e., place the form at the center of the screen and allow resizing. `FL_PLACE_ICONIC' The form is shown initially iconified. The size and location used are the window manager's default. As mentioned above, some of the settings will result in a fixed size of the form (i.e., a size that can't be changed by the user per default). In some cases this can be avoided by OR'ing the value with `FL_FREE_SIZE' as a modifier. If no size was specified, the designed (or later scaled) size will be used. Note that the initial position is dependent upon the window manager used. Some window managers allow interactive placement of the windows but some don't. You can set the position or size to be used via the following calls void fl_set_form_position(FL_FORM *form, FL_Coord x, FL_Coord y); and void fl_set_form_size(FL_FORM *form, FL_Coord w, FL_Coord h); or, combining both these two functions, void fl_set_form_geometry(FL_FORM form*, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h); before placing the form on the screen. (Actually the routines can also be called while the form is being displayed. They will change the position and/or size of the form.) `x', `y', `w' and `h' indicate the position of the form on the screen and its size(1). The position is measured from the top-left corner of the screen. When the position is negative the distance from the right or the bottom is indicated. Next the form should be placed on the screen using `*note FL_PLACE_GEOMETRY::', `*note FL_PLACE_FREE::'. E.g., to place a form at the lower-right corner of the screen use fl_set_form_position(form, -1, -1); fl_show_form(form, FL_PLACE_GEOMETRY, FL_TRANSIENT, "formName"); (Following the X convention for specifying geometries a negative `x'-position specifies the distance of the right eside of the form from the right side of the screen and a negative `y'-position the distance of the bottom of the form from the bottom of the screen.) To show a form so that a particular object or point is under the mouse, use one of the following two routines to set the "hotspot" void fl_set_form_hotspot(FL_FORM *form, FL_Coord x, FL_Coord y); void fl_set_form_hotobject(FL_FORM *form, FL_OBJECT *obj); and then use `*note FL_PLACE_HOTSPOT::' for the `place' argument in the call of `*note fl_show_form()::'. The coordinates `x' and `y' are relative to the upper-left hand corner of the form (within the window decorations). In the call `*note fl_show_form()::' the argument `border' indicates whether or not to request window manager's decoration. `border' should take one of the following values: `FL_FULLBORDER' Full border decorations. `FL_TRANSIENT' Borders with (possibly) less decorations. `FL_NOBORDER' No decoration at all. For some dialogs, such as demanding an answer etc., you probably do not want the window manager's full decorations. Use `*note FL_TRANSIENT::' for this. A window border is useful to let the user iconify a form, move it around or resize it. If a form is transient or has no border, it is normally more difficult (or even impossible) to move the form. A transient form typically should have less decoration, but not necessarily so. It depends on the window managers as well as their options. `*note FL_NOBORDER::' is guaranteed to have no border(2) and is immune to iconification request. Because of this, borderless forms can be hostile to other applications(3), so use this only if absolutely necessary. There are other subtle differences between the different decoration requests. For instance, (small) transient forms always have `save_under' (see `XSetWindowAttributes()') set to true by default. Some window properties, `WM_COMMAND' in particular, are only set for full-bordered forms and will only migrate to other full-bordered forms when the original form having the property becomes unmapped. The library has a notion of a "main form" of an application, roughly the form that would be on the screen the longest. By default, the first full-bordered form shown becomes the main form of the application. All transient windows shown afterwards will stay on top of the main form. The application can set or change the main form anytime using the following routine void fl_set_app_mainform(FL_FORM *form); Setting the main form of an application will cause the `WM_COMMAND' property set for the form if no other form has this property. Sometimes it is necessary to have access to the window resource ID before the window is mapped (shown). For this, the following routine can be used Window fl_prepare_form_window(FL_FORM *form, int place, int border, const char *name); This routine creates a window that obeys any and all constraints just as `*note fl_show_form()::' does but remains unmapped. To map such a window, the following must be used Window fl_show_form_window(FL_FORM *form); Between these two calls, the application program has full access to the window and can set all attributes, such as icon pixmaps etc., that are not set by `*note fl_show_form()::'. You can also scale the form and all objects on it programmatically using the following routine void fl_scale_form(FL_FORM *form, double xsc, double ysc); where you indicate a scaling factor in the x- and y-direction with respect to the current size. See `rescale.c' for an example. When a form is scaled, either programmatically or interactively, all objects on the form per default will also be scaled. This includes both the sizes and positions of the objects. For most cases, this default behavior is adequate. In some cases, e.g., to keep a group of objects together, more control is needed. To this end, the following routines can be used void fl_set_object_resize(FL_OBJECT *obj, unsigned how_resize); void fl_set_object_gravity(FL_OBJECT *obj, unsigned nw_gravity, unsigned se_gravity); The `how_resize' argument of `*note fl_set_object_resize()::' can be one of `FL_RESIZE_NONE' don't resize the object at all `FL_RESIZE_X' resize it in x- (horizontal) direction only `FL_RESIZE_Y' resize it in y- (vertical) direction only `FL_RESIZE_ALL' is an alias for `*note FL_RESIZE_X::|*note FL_RESIZE_Y::' and makes the object resizable in both dimension. The arguments `nw_gravity' and `se_gravity' of `fl_set_object_gravity()' control the positioning of the upper-left and lower-right corner of the object and work analogously to the `win_gravity' in Xlib. The details are as follows: Let `P' be the corner the gravity applies to, `(dx1,dy1)' the distance to the upper-left corner of the form, `(dx2,dy2)' the distance to the lower-right corner of the form, then, Value Effect --------------------------------------------------------------------------- `FL_NoGravity' Default linear scaling, see below `FL_NorthWest' `dx1', `dy1' constant `FL_North' `dy1' constant `FL_NorthEast' `dy1', `dx2' constant `FL_West' `dx1' constant `FL_East' `dx2' constant `FL_SouthWest' `dx1', `dy2' constant `FL_South' `dy2' constant `FL_SouthEast' `dx2', `dy2' constant `ForgetGravity' don't consider the setting for this argument [image src="xforms_images/gravity.png"] Default for all object is `*note FL_RESIZE_ALL::' and `*note ForgetGravity::'. Note that the three parameters are not orthogonal and the positioning request will always override the scaling request in case of conflict. This means the resizing settings for an object are considered only if one (or both) of the gravities is `*note FL_NoGravity::'. For the special case where `how_resize' is `*note FL_RESIZE_NONE::' and both gravities are set to `ForgetGravity', the object is left un-scaled, but the object is moved so that the new position keeps the center of gravity of the object constant relative to the form. Again, since all sizing requests go though the window manager, there is no guarantee that your request will be honored. If a form is placed with `*note FL_PLACE_GEOMETRY::' or other size-restricting options, resizing it later via `*note fl_set_form_size()::' will likely be rejected. To determine the gravity and resize settings for an object use the functions void fl_get_object_gravity(FL_OBJECT *obj, unsigned int *nw, unsigned int *se); void fl_get_object_resize(FL_OBJECT *obj, unsigned int *resize ); Sometimes, you may want to change an attribute for all objects on a particular form, to this end, the following iterator is available void fl_for_all_objects(FL_FORM *form, int (*operate)(FL_OBJECT *obj, void *data), void *data); where function `operate' is called for every object of the form `form' unless `operate()' returns nonzero, which terminates the iterator. Multiple forms can be shown at the same moment and the system will interact with all of them simultaneously. The graphical mode in which the form is shown depends on the type of machine. In general, the visual chosen by XForms is the one that has the most colors. Application programs have many ways to change this default, either through command line options, resources or programmatically. See the Part V for details. If for any reason, you would like to change the form title (as well as its associated icon) after it is shown, the following functions can be used void fl_set_form_title(FL_FORM *form, const char *name) void fl_set_form_title_f(FL_FORM *form, const char *fmt, ...) To set or change the icon shown when a form is iconified, use the following routine void fl_set_form_icon(FL_FORM *form, Pixmap icon, Pixmap mask); where `icon' and `mask' can be any valid Pixmap ID. (See *note Other Pixmap Routines:: for some of the routines that can be used to create Pixmaps.) Note that an `icon' previously setvia this function (if it exists) is not freed or modified in anyway. See the demo program `iconify.c' for an example. If the application program wants to stop interacting with a form and remove it from the screen, it has to use the call void fl_hide_form(FL_FORM *form); To check if a form is visible or not, use the following call int fl_form_is_visible(FL_FORM *form); The function returns one of `FL_INVISIBLE' if the form is not visible (0), `FL_VISIBLE' if the form is visible (1) and `FL_BEING_HIDDEN' if the form is visible but is in the process of being hidden (-1). Note that if you don't need a form anymore you can deallocate its memory using the call `*note fl_free_form()::' described earlier. Window managers typically have a menu entry labeled "delete" or "close" meant to terminate an application program gently by informing the application program with a `WM_DELETE_WINDOW' protocol message. Although the Forms Library catches this message, it does not do anything except terminating the application. This can cause problems if the application has to do some record keeping before exiting. To perform record keeping or to elect to ignore this message, register a callback function using the following routine int fl_set_atclose(int (*at_close)(FL_FORM *, void *), void *data); The callback function `at_close' will be called before the Forms Library terminates the application. The first parameter of the callback function is the form that received the `WM_DELETE_WINDOW' message. To prevent the Forms Library from terminating the application, the callback function should return the constant `FL_IGNORE'. Any other value (e.g., `FL_OK') will result in the termination of the application. Similar mechanism exists for individual forms int fl_set_form_atclose(FL_FORM *, int (*at_close)(FL_FORM *, void *), void *data); except that `FL_OK' does not terminate the application, it results in the form being closed. Of course, if you'd like to terminate the application, you can always call `exit(3)' yourself within the callback function. ---------- Footnotes ---------- (1) The parameters should be sensitive to the coordinate unit in effect at the time of the call, but at present, they are not, i.e., the function takes only values in pixel units. (2) Provided the window manager is compliant. If the window manager isn't compliant all bets are off. (3) Actually, they are also hostile to their sibling forms. *Note Overview of Main Functions: Part V Overview of Main Functions.  File: xforms.info, Node: Simple Interaction, Next: Periodic Events and Non-blocking Interaction, Prev: Displaying a Form, Up: Part I Doing Interaction 4.2 Simple Interaction ====================== Once one or more forms are shown it is time to give control to the library to handle the interaction with the forms. There are a number of different ways of doing this. The first one, appropriate for most programs, is to call of FL_OBJECT *fl_do_forms(void); It controls the interaction until some object in one of the forms changes state. In this case a pointer to the changed object is returned. A change occurs in the following cases: box A box never changes state and, hence, is never returned by `*note fl_do_forms()::'. text Also a text never changes state. button A button is returned when the user presses a mouse button on it and then releases the button. The change is not reported before the user releases the mouse button, except with touch buttons which are returned all the time as long as the user keeps the mouse pressed on it. (See e.g., `touchbutton.c' for the use of touch buttons.) slider A slider per default is returned whenever its value is changed, so whenever the user clicks on it and moves the mouse the slider object gets returned. input An input field is returned per default when it is deactivated, i.e., the user has selected it and then starts interacting with another object that has the ability to get returned. (This list just contains a small number of objects that exist, see Part III for a list of all objects and the documentation of the exact behaviour of them.) When the (address of the) object is returned by `*note fl_do_forms()::' the application program can take action accordingly. See some of the demo programs for examples of use. Normally, after the action is taken by the application program `*note fl_do_forms()::' is called again to continue the interaction. Hence, simpler programs have the following global form: /* define the forms */ /* display the forms */ while (! ready) { obj = fl_do_forms(); if (obj == obj1) /* handle the change in obj1 */ else if (obj == obj2) /* handle the change in obj2 */ .... } For more complex programs interaction via callbacks is often preferable. For such programs, the global structure looks something like the following /* define callbacks */ void callback(FL_OBJECT *obj, long data) { /* perform tasks */ } void terminate_callback(FL_OBJECT *obj, long data) { /* cleanup application */ fl_finish(); exit(0); } main(int argc, char *argv[]) { /* create form and bind the callbacks to objects */ /* enter main loop */ fl_do_forms(); return 0; } In this case, `*note fl_do_forms()::' handles the interaction indefinitely and never returns. The program exits via one of the callback functions. There is also the possibility to conrol under which exact conditions the object gets returned. An application that e.g., doesn't want to be notified about each change of a slider but instead only want a single notification after the mouse button has been released and the value of the slider was changed in the process would call the function int fl_set_object_return(FL_OBJECT *obj, unsigned int when); with `when' set to `FL_RETURN_END_CHANGED'. There are several values `when' can take: `FL_RETURN_CHANGED' Return (or call object callback) whenever there is a change in the state of the object (button was pressed, input field was changed, slider was moved etc.). `FL_RETURN_END' Return (or invoke callback) at the end of the interaction (typically when the user releases the mouse button) regardless if the objects state was changed or not. `FL_RETURN_END_CHANGED' Return (or call object callback) when interaction stops *and* the state of the object changed. `FL_RETURN_SELECTION' Return when e.g., a line in a `*note FL_MULTI_BROWSER::' browser was selected. `FL_RETURN_DESELECTION' Return when e.g., a line in a `*note FL_MULTI_BROWSER::' browser was deselected. `FL_RETURN_ALWAYS' Return (or invoke callback) on any of the events that can happen to the object. `FL_RETURN_NONE' Never notiy the application about interactions with this object (i.e., never return it nor invoke its callback). Note: this is not meant for deactivation of an object, it will still seem to work as normal, it just doesn't get returned to the application nor does is callbak get invoked. Since for different objects only subsets of these conditions make sense please read the more detailed descriptions for each of the object types in Part III. All of the values above, except `*note FL_RETURN_END_CHANGED::', `*note FL_RETURN_ALWAYS::' and `*note FL_RETURN_NONE::' can be logically `OR''ed. `*note FL_RETURN_END_CHANGED::' is different in that it only can be returned when the conditions for `*note FL_RETURN_END::' and `*note FL_RETURN_CHANGED::' are satisfied at once. If this is requested both `*note FL_RETURN_END::' and `*note FL_RETURN_CHANGED::' will automatically become deselected. So if you want notifications about the conditions that lead to `*note FL_RETURN_END::' or `*note FL_RETURN_CHANGED::' (or both at once) ask instead for the logical `OR' of these two. `*note FL_RETURN_ALWAYS::' includes all conditions except `*note FL_RETURN_END_CHANGED::'. Once an object has been returned (or its callback is invoked) you can determine the reason why it was returned by calling int fl_get_object_return_state(FL_OBBJECT *obj); This returns the logical `OR' of the conditions that led to the object being returned, where the conditions can be `*note FL_RETURN_CHANGED::', `*note FL_RETURN_END::', `*note FL_RETURN_SELECTION::' and `*note FL_RETURN_DESELECTION::'. (The `*note FL_RETURN_END_CHANGED::' condition is satisfied if both `*note FL_RETURN_END::' and `*note FL_RETURN_CHANGED::' are set.) Please note that calling this function only makes sense in a callback for an object or when the object has been just returned by e.g., `*note fl_do_forms()::'. Further interactions with the object overwrite the value!  File: xforms.info, Node: Periodic Events and Non-blocking Interaction, Next: Dealing With Multiple Windows, Prev: Simple Interaction, Up: Part I Doing Interaction 4.3 Periodic Events and Non-blocking Interaction ================================================ The interaction mentioned above is adequate for many application programs but not for all. When the program also has to perform tasks when no user action takes place (e.g., redrawing a rotating image all the time), some other means of interaction are needed. There exist two different, but somewhat similar, mechanisms in the library that are designed specifically for generating and handling periodic events or achieving non-blocking interaction. Depending on the application, one method may be more appropriate than the other. For periodic tasks, e.g., rotating an image, checking the status of some external device or application state etc., interaction via an idle callback comes in very handy. An idle callback is an application function that is registered with the system and is called whenever there are no events pending for forms (or application windows). To register an idle callback, use the following routine FL_APPEVENT_CB fl_set_idle_callback(FL_APPEVENT_CB callback, void *user_data); After the registration, whenever the main loop (`*note fl_do_forms()::') is idle, i.e., no user action or light user action, the callback function of type `FL_APPEVENT_CB' is called typedef int (*FL_APPEVENT_CB)(XEvent *xev, void *user_data); i.e., a function with the signature int idle_callback(XEvent *xev, void *user_data); where `user_data' is the void pointer passed to the system in `*note fl_set_idle_callback()::' through which some information about the application can be passed. The return value of the callback function is currently not used. `xev' is a pointer to a synthetic(1) `MotionNotify' event from which some information about mouse position etc. can be obtained. To remove the idle callback, use `*note fl_set_idle_callback()::' with callback set to `NULL'. Timeouts are similar to idle callbacks but with somewhat more accurate timing. Idle callbacks are called whenever the system is idle, the time interval between any two invocations of the idle callback can vary a great deal depending upon many factors. Timeout callbacks, on the other hand, will never be called before the specified time is elapsed. You can think of timeouts as regularized idle callbacks, and further you can have more than one timeout callbacks. To add a timeout callback, use the following routine typedef void (*FL_TIMEOUT_CALLBACK)(int, void *); int fl_add_timeout(long msec, FL_TIMEOUT_CALLBACK callback, void *data); The function returns the timeout's ID(2). When the time interval specified by `msec' (in milli-seconds) has elapsed the timeout is removed, then the callback function is called. The timeout ID is passed to the callback function as the first parameter. The second parameter the callback function is passed is the data pointer that was passed to `*note fl_add_timeout()::'. To remove a timeout before it triggers, use the following routine void fl_remove_timeout(int id); where `id' is the timeout ID returned by `*note fl_add_timeout()::'. There is also an `FL_OBJECT', the `FL_TIMER' object, especially the invisible type, that can be used to do timeout. Since it is a proper Forms Library object, it may be easier to use simply because it has the same API as any other GUI elements and is supported by the Form Designer. *Note Timer Object::, for complete information on the `FL_TIMER' object. Note that idle callback and timeout are not appropriate for tasks that block or take a long time to finish because during the busy or blocked period, no interaction with the GUI can take place (both idle callback and timeout are invoked by the main loop, blockage or busy executing application code prevents the main loop from performing its tasks). So what to do in situations where the application program does require a lengthy computation while still wanting to have the ability to interact with the user interface (for example, a Stop button to terminate the lengthy computation)? In these situations, the following routine can be used: FL_OBJECT *fl_check_forms(void); This function is similar to `*note fl_do_forms()::' in that it takes care of handling events and appropriate callbacks, but it does not block. Instead it always returns to the application program immediately. If a change has occurred in some object the object is returned as with `*note fl_do_forms()::'. But when no change has occurred control is also returned but this time a `NULL' object is returned. Thus, by inserting this statement in the middle of the computation in appropriate places in effect "polls" the user interface. The downside of using this function is that if used excessively, as with all excessive polls, it can chew up considerable CPU cycles. Therefore, it should only be used outside the inner most loops of the computation. If all objects have callbacks bound to them, `*note fl_check_forms()::' always returns `NULL', otherwise, code similar to the following is needed: obj = fl_check_forms(); if (obj == obj1) /* handle it */ ... Depending on the applications, it may be possible to partition the computation into smaller tasks that can be performed within an idle callback one after another, thus eliminating the need of using `*note fl_check_forms()::'. Handling intensive computation while maintaining user interface responsiveness can be tricky and by no means the above methods are the only options. You can, for example, fork a child process to do some of the tasks and communicate with the interface via pipes and/or signals, both of which can be handled with library routines documented later, or use multi-thread (but be careful to limit Xserver access within one thread). Be creative and have fun. For running external executables while maintaining responsiveness of the interface, see `*note fl_exe_command()::' and `*note fl_popen()::' documented later in *note Command Log::. ---------- Footnotes ---------- (1) I.e., `xev->xmotion.send_event' is true. (2) The function will not return 0 or -1 as timeout IDs, so the application program can use these values to tag invalid or expired timeouts.  File: xforms.info, Node: Dealing With Multiple Windows, Next: Using Callback Functions, Prev: Periodic Events and Non-blocking Interaction, Up: Part I Doing Interaction 4.4 Dealing With Multiple Windows ================================= It is not atypical that an application program may need to take interaction from more than one form at the same time, Forms Library provides a mechanism with which precise control can be exercised. By default, `*note fl_do_forms()::' takes interaction from all forms that are shown. In certain situations, you might not want to have interaction with all of them. For example, when the user presses a quit button in a form you might want to ask a confirmation using another form. You don't want to hide the main form because of that but you also don't want the user to be able to press buttons, etc. in this form. The user first has to give the confirmation. So you want to temporarily deactivate the main form. This can be done using the call void fl_deactivate_form(FL_FORM *form); To reactivate the form later again use void fl_activate_form(FL_FORM *form); It is a good idea to give the user a visual clue that a form is deactivated. This is not automatically done mainly for performance reasons. Experience shows that graying out some important objects on the form is in general adequate. Graying out an object can be accomplished by using `*note fl_set_object_lcolor()::' (see `objinactive.c'. What objects to gray out is obviously application dependent. The following two functions can be used to register two callbacks that are called whenever the activation status of a form is changed: typedef void (*FL_FORM_ATACTIVATE)(FL_FORM *, void *); FL_FORM_ATACTIVATE fl_set_form_atactivate(FL_FORM *form, FL_FORM_ATACTIVATE callback, void *data); typedef void (*FL_FORM_ATDEACTIVATE)(FL_FORM *, void *); FL_FORM_ATDEACTIVATE fl_set_form_atdeactivate(FL_FORM *form, FL_FORM_ATDEACTIVATE callback, void *data); It is also possible to deactivate all current forms and reactivate them again. To this end use the functions: void fl_deactivate_all_forms(void); void fl_activate_all_forms(void); Note that deactivation works in an additive way, i.e., when deactivating a form say 3 times it also has to be activated 3 times to become active again. One problem remains. Mouse actions etc. are presented to a program in the form of events in an event queue. The library routines `*note fl_do_forms()::' and `*note fl_check_forms()::' read this queue and handle the events. When the application program itself also opens windows, these windows will rather likely receive events as well. Unfortunately, there is only one event queue. When both the application program and the library routines would read events from this one queue problems would occur and events missed. Hence, the application program should not read the event queue itself.. To solve this problem, the library maintains (or appears to maintain) a separate event queue for the user. This queue behaves in exactly the same way as the normal event queue. To access it, the application program must use replacements for the usual Xlib routines. Instead of using `XNextEvent()', the program will use `*note fl_XNextEvent()::', with the same parameters except the `Display *' argument. The following is a list of all replacement routines: int fl_XNextEvent(XEvent *xev); int fl_XPeekEvent(XEvent *xev); int fl_XEventsQueued(int mode); int fl_XPutbackEvent(XEvent *xev); Note that these routines normally return `1', but after a call of `*note fl_finish()::' they return `1' instead. Other events routines may be directly used if proper care is taken to make sure that only events for the application windows not handled by the library are removed. These routines include `XWindowEvent()', `XCheckWindowEvent()' etc. To help find out when an event has occurred, whenever `*note fl_do_forms()::' and `*note fl_check_forms()::' encounter an event that is not meant for handling by the library but by the application program itself they return a special object `*note FL_EVENT::'. Upon receiving this special event, the application program can and must remove the pending event from the queue using `*note fl_XNextEvent()::'. So the basis of a program with its own windows would look as follows: /* define the forms */ /* display the forms */ /* open your own window(s) */ while (! ready) { obj = fl_do_forms(); /* or fl_check_forms() */ if (obj == FL_EVENT) { fl_XNextEvent(&xevent); switch (xevent.type) { /* handle the event */ } } else if (obj != NULL) /* handle the change in obj */ /* update other things */ } } In some situations you may not want to receive these "user" events. For example, you might want to write a function that pops up a form to change some settings. This routine might not want to be concerned with any redrawing of the main window, etc., but you also not want to discard any events. In this case you can use the routines `*note fl_do_only_forms()::' and `*note fl_check_only_forms()::' that will never return `*note FL_EVENT::'. The events don't disappear but will be returned at later calls to the normal routines `*note fl_do_forms()::' etc. It can't be over-emphasized that it is an error to ignore `*note FL_EVENT::' or use `*note fl_XNextEvent()::' without seeing `*note FL_EVENT::'. Sometimes an application program might need to find out more information about the event that triggered a callback, e.g., to implement mouse button number sensitive functionalities. To this end, the following routines may be called long fl_mouse_button(void); This function, if needed, should be called from within a callback. The function returns one of the constants `*note FL_LEFT_MOUSE::', `*note FL_MIDDLE_MOUSE::', `*note FL_RIGHT_MOUSE::', `*note FL_SCROLLUP_MOUSE::' or `*note FL_SCROLLDOWN_MOUSE::', indicating which mouse button was pushed or released. If the callback is triggered by a shortcut, the function returns the keysym (ascii value if ASCII) of the key plus `*note FL_SHORTCUT::'. For example, if a button has a shortcut `C' (ASCII value is 3), the button number returned upon activation of the shortcut would be `FL_SHORTCUT + 3'. `*note FL_SHORTCUT::' can be used to determine if the callback is triggered by a shortcut or not if (fl_mouse_button() >= FL_SHORTCUT) /* handle shortcut */ else switch (fl_mouse_button()) { case FL_LEFTMOUSE: .... } More information can be obtained by using the following routine that returns the last `XEvent' const XEvent *fl_last_event(void); Note that if this routine is used outside of a callback function, the value returned may not be the real "last event" if the program was idling and, in this case, it returns a synthetic `MotionNotify' event. Some of the utilities used internally by the Forms Library can be used by the application programs, such as window geometry queries etc. Following is a partial list of the available routines: void fl_get_winorigin(Window win, FL_Coord *x, FL_Coord *y); void fl_get_winsize(Window win, FL_Coord *w, FL_Coord *h); void fl_get_wingeometry(Window win, FL_Coord *x, FL_Coord *y, FL_Coord *w, FL_Coord *h); All positions are relative to the root window. There are also routines that can be used to obtain the current mouse position relative to the root window: Window fl_get_mouse(FL_Coord *x, FL_Coord *y, unsigned int *keymask); where `keymask' is the same as used in `XQueryPointer(3X11)'. The function returns the window ID the mouse is in. To obtain the mouse position relative to an arbitrary window, the following routine may be used Window fl_get_win_mouse(Window win, FL_Coord *x, FL_Coord *y, unsigned int *keymask); To print the name of an XEvent, the following routine can be used: XEvent *fl_print_xevent_name(const char *where, const XEvent *xev); The function takes an XEvent, prints out its name and some other info, e.g., `expose, count=n'. Parameter `where' can be used to indicate where this function is called: fl_print_xevent_name("In tricky.c", &xevent);  File: xforms.info, Node: Using Callback Functions, Next: Handling Other Input Sources, Prev: Dealing With Multiple Windows, Up: Part I Doing Interaction 4.5 Using Callback Functions ============================ As stated earlier, the recommended method of interaction is to use callback functions. A callback function is a function supplied to the library by the application program that binds a specific condition (e.g., a button is pushed) to the invocation of the function by the system. The application program can bind a callback routine to any object. Once a callback function is bound and the specified condition is met, `*note fl_do_forms()::' or `*note fl_check_forms()::' invokes the callback function instead of returning the object. To bind a callback routine to an object, use the following typedef void (*FL_CALLBACKPTR)(FL_OBJECT *obj, long argument); FL_CALLBACKPTR fl_set_object_callback(FL_OBJECT *obj, FL_CALLBACKPTR callback, long argument); where `callback' is the callback function. `argument' is an argument that is passed to the callback routine so that it can take different actions for different objects. The function returns the old callback routine already bound to the object. You can change the callback routine anytime using this function. See, for example, demo program `timer.c'. The callback routine should have the form void callback(FL_OBJECT *obj, long argument); The first argument to every callback function is the object to which the callback is bound. The second parameter is the argument specified by the application program in the call to `*note fl_set_object_callback()::'. See program `yesno_cb.c' for an example of the use of callback routines. Note that callback routines can be combined with normal objects. It is possible to change the callback routine at any moment. Sometimes it is necessary to access other objects on the form from within the callback function. This presents a difficult situation that calls for global variables for all the objects on the form. This runs against good programming methodology and can make a program hard to maintain. Forms Library solves (to some degree) this problem by creating three fields, `void *u_vdata', `char *u_cdata' and `long u_ldata', in the `FL_OBJECT' structure that you can use to hold the necessary data to be used in the callback function. A better and more general solution to the problem is detailed in Part II of this documentation where all objects on a form is are grouped into a single structure which can then be "hang" off of `u_vdata' or some field in the `FL_FORM' structure. Another communication problem might arise when the callback function is called and, from within the callback function, some other objects' state is explicitly changed, say, via `*note fl_set_button()::', `*note fl_set_input()::' etc. You probably don't want to put the state change handling code of these objects in another object's callback. To handle this situation, you can simply call void fl_call_object_callback(FL_OBJECT *obj); When dealing with multiple forms, the application program can also bind a callback routine to an entire form. To this end it should use the routine void fl_set_form_callback(FL_FORM *form, void (*callback)(FL_OBJECT *, void *), void *data); Whenever `*note fl_do_forms()::' or `*note fl_check_forms()::' would return an object in form they call the routine callback instead, with the object as an argument. So the callback should have the form void callback(FL_OBJECT *obj, void *data); With each form you can associate its own callback routine. For objects that have their own callbacks the object callbacks have priority over the form callback. When the application program also has its own windows (via Xlib or Xt), it most likely also wants to know about XEvents for the window. As explained earlier, this can be accomplished by checking for `*note FL_EVENT::' objects. Another (and better) way is to add an event callback routine. This routine will be called whenever an XEvent is pending for the application's own window. To setup an event callback routine (of type `*note FL_APPEVENT_CB::' use the call typedef int (*FL_APPEVENT_CB)(XEvent *, void *); FL_APPEVENT_CB fl_set_event_callback(int (*callback)(XEvent *ev, void *data), void *data); Whenever an event happens the callback function is invoked with the event as the first argument and a pointer to data you want it to receive. So the callback should have the form int callback(XEvent *xev, void *data); This assumes the application program solicits the events and further, the callback routine should be prepared to handle all XEvent for all non-form windows. The callback function normally should return `0' unless the event isn't for one of the applcation-managed windows. This could be undesirable if more than one application window is active. To further partition and simplify the interaction, callbacks for a specific event on a specific window can be registered: FL_APPEVENT_CB fl_add_event_callback(Window window, int xev_type, FL_APPEVENT_CB callback, void *user_data); where `window' is the window for which the callback routine is to be registered. `xev_type' is the XEvent type you're interested in, e.g., `Expose' etc. If `xev_type' is 0, it is taken to mean that the callback routine will handle all events for the window. The newly installed callback replaces the callback already installed. Note that this function only works for windows created directly by the application program (i.e., it won't work for forms' windows or windows created by the canvas object). It is possible to access the raw events that happen on a form's window via `*note fl_register_raw_callback()::' discussed in *note Form Events::. `*note fl_add_event_callback()::' does not alter the window's event mask nor does it solicit events for you. That's mainly for the reason that an event type does not always correspond to a unique event mask, also in this way, the user can solicit events at window's creation and use 0 to register all the event handlers. To let XForms handle solicitation for you, call the following routine void fl_activate_event_callbacks(Window win); This function activates the default mapping of events to event masks built-in in the Forms Library, and causes the system to solicit the events for you. Note however, the mapping of events to masks are not unique and depending on applications, the default mapping may or may not be the one you want. For example, `MotionNotify' event can be mapped into `ButtonMotionMask' or `PointerMotionMask'. Forms Library will use both. It is possible to control the masks you want precisely by using the following function, which can also be used to add or remove solicited event masks on the fly without altering other masks already selected: long fl_addto_selected_xevent(Window win, long mask); long fl_remove_selected_xevent(Window win, long mask); Both functions return the resulting event masks that are currently selected. If event callback functions are registered via both `fl_set_event_callback()' and `*note fl_add_event_callback()::', the callback via the latter is invoked first and the callback registered via `*note fl_set_event_callback()::' is called only if the first attempt is unsuccessful, that is, the handler for the event is not present. For example, after the following sequence fl_add_event_callback(winID, Expose, expose_cb, 0); fl_set_event_callback(event_callback); and all `Expose' events on window `winID' are consumed by `expose_cb' then `event_callback()' would never be invoked as a result of an `Expose' event. To remove a callback, use the following routine void fl_remove_event_callback(Window win, int xev_type); All parameters have the usual meaning. Again, this routine does not modify the window's event mask. If you like to change the events the window is sensitive to after removing the callback, use `*note fl_activate_event_callbacks()::'. If `xev_type' is 0, all callbacks for window `win' are removed. This routine is called automatically if `*note fl_winclose()::' is called to unmap and destroy a window. Otherwise, you must call this routine explicitly to remove all event callbacks before destroying a window using `XDestroyWindow()'. A program using all of these has the following basic form: void event_cb(XEvent *xev, void *mydata1) { /* Handles an X-event. */ } void expose_cb(XEvent *xev, void *mydata2) { /* handle expose */ } void form1_cb(FL_OBJECT *obj) { /* Handles object obj in form1. */ } void form2_cb(FL_OBJECT *obj) { /* Handles object obj in form2. */ } main(int argc, char *argv[]) { /* initialize */ /* create form1 and form2 and display them */ fl_set_form_callback(form1, form1cb); fl_set_form_callback(form2, form2cb); /* create your own window, winID and show it */ fl_addto_selected_xevent(winID, ExposureMask | ButtonPressMask |... ); fl_winshow(winID); fl_set_event_callback(event_cb, whatever); fl_add_event_callback(winID, Expose, expose_cb, data); fl_do_forms(); return 0; } The routine `*note fl_do_forms()::' will never return in this case. See `demo27.c' for a program that works this way. It is recommended that you set up your programs using callback routines (either for the objects or for entire forms). This ensures that no events are missed, events are treated in the correct order, etc. Note that different event callback routines can be written for different stages of the program and they can be switched when required. This provides a progressive path for building up programs. Another possibility is to use a free object so that the application window is handled automatically by the internal event processing mechanism just like any other forms.  File: xforms.info, Node: Handling Other Input Sources, Prev: Using Callback Functions, Up: Part I Doing Interaction 4.6 Handling Other Input Sources ================================ It is not uncommon that X applications may require input from sources other than the X event queue. Outlined in this section are two routines in the Forms Library that provide a simple interface to handle additional input sources. Applications can define input callbacks to be invoked when input is available from a specified file descriptor. The function typedef void (*FL_IO_CALLBACK)(int fd, void *data); void fl_add_io_callback(int fd, unsigned condition, FL_IO_CALLBACK callback, void *data); registers an input callback with the system. The argument `fd' must be a valid file descriptor on a UNIX-based system or other operating system dependent device specification while `condition' indicates under what circumstance the input callback should be invoked. The condition must be one of the following constants `FL_READ' File descriptor has data available. `FL_WRITE' File descriptor is available for writing. `FL_EXCEPT' an I/O error has occurred. When the given condition occurs, the Forms Library invokes the callback function specified by `callback'. The `data' argument allows the application to provide some data to be passed to the callback function when it is called (be sure that the storage pointed to by data has global (or static) scope). To remove a callback that is no longer needed or to stop the Forms Library's main loop from watching the file descriptor, use the following function void fl_remove_io_callback(int fd, unsigned condition, FL_IO_CALLBACK callback); The procedures outlined above work well with pipes and sockets, but can be a CPU hog on real files. To workaround this problem, you may wish to check the file periodically and only from within an idle callback.  File: xforms.info, Node: Part I Free Objects, Next: Part I Goodies, Prev: Part I Doing Interaction, Up: Top 5 Free Objects ************** In some applications the standard object classes as provided by the Forms Library may not be enough for your task. There are three ways of solving this problem. First of all, the application program can also open its own window or use a canvas (the preferred way) in which it does interaction with the user). A second way is to add your own object classes (see Part IV). This is especially useful when your new type of objects is of general use. The third way is to add free objects to your form. Free objects are objects for which the application program handles the drawing and interaction. This chapter will give all the details needed to design and use free objects. * Menu: * Free Object:: Free Object * Example:: An Example  File: xforms.info, Node: Free Object, Next: Example, Up: Part I Free Objects 5.1 Free Object =============== To add a free object to a form use the call FL_OBJECT *fl_add_free(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label, int (*handle)()); `type' indicates the type of free object, see below for a list and their meaning. `x', `y', `w' and `h' are the bounding box. The `label' is normally not drawn unless the `handle' routine takes care of this. `handle' is the routine that does the redrawing and handles the interaction with the free object. The application program must supply this routine. This routine `handle' is called by the library whenever an action has to be performed. The routine should have the form: int handle(FL_OBJECT *obj, int event, FL_Coord mx, FL_Coord my, int key, void *xev); where `obj' is the object to which the event applies. `event' indicates what has to happen to the object. See below for a list of possible events. `mx' and `my' indicate the position of the mouse (only meaningful with mouse related events) relative to the form origin and `key' is the KeySym of the key typed in by the user (only for `FL_KEYPRESS' events). `xev' is the (cast) XEvent that causes the invocation of this handler. `event' and `xev->type' can both be used to obtain the event types. The routine should return whether the status of the object has changed, i.e., whether `*note fl_do_forms()::' or `*note fl_check_forms()::' should return this object. The following types of events exist for which the routine must take action: `FL_DRAW' The object has to be redrawn. To figure out the size of the object you can use the fields `obj->x', `obj->y', `obj->w' and `obj->h'. Some other aspects might also influence the way the object has to be drawn. E.g., you might want to draw the object differently when the mouse is on top of it or when the mouse is pressed on it. This can be figured out as follows. The field `obj->belowmouse' indicates whether the object is below the mouse. The field `obj->pushed' indicates whether the object is currently being pushed with the mouse. Finally, `obj->focus' indicates whether input focus is directed towards this object. When required, the label should also be drawn. This label can be found in the field `obj->label'. The drawing should be done such that it works correctly in the visual/depth the current form is in. Complete information is available on the state of the current form as well as several routines that will help you to tackle the trickiest (also the most tedious) part of X programming. In particular, the return value of `*note fl_get_vclass()::' can be used as an index into a table of structures, `*note fl_state::[]', from which all information about current active visual can be obtained. *Note Drawing Objects: Part IV Drawing Objects, for details on drawing objects and the routines. `FL_DRAWLABEL' This event is not always generated. It typically follows `FL_DRAW' and indicates the object label needs to be (re)drawn. You can ignore this event if (a) the object handler always draws the label upon receiving `FL_DRAW' or (b) the object label is not drawn at all(1). `FL_ENTER' This event is sent when the mouse has entered the bounding box. This might require some action. Note that also the field `belowmouse' in the object is being set. If entering only changes the appearance redrawing the object normally suffices. Don't do this directly! Always redraw the object using the routine `fl_redraw_object()'. It will send an `FL_DRAW' event to the object but also does some other things (like setting window id's, taking care of double buffering and some other bookkeeping tasks). `FL_LEAVE' The mouse has left the bounding box. Again, normally a redraw is enough (or nothing at all). `FL_MOTION' A motion event is sent between `FL_ENTER' and `FL_LEAVE' events when the mouse position changes on the object. The mouse position is given with the routine. `FL_PUSH' The user has pushed a mouse button in the object. Normally this requires some action. `FL_RELEASE' The user has released the mouse button. This event is only sent if a `FL_PUSH' event was sent earlier. `FL_DBLCLICK' The user has pushed a mouse button twice within a certain time limit (`FL_CLICK_TIMEOUT'), which by default is about 400 msec. `FL_TRPLCLICK' The user has pushed a mouse button three times within a certain time window between each push. This event is sent after a `FL_DBLCLICK', `FL_PUSH', `FL_RELEASE' sequence. `FL_UPDATE' The mouse position has changed. This event is sent to an object between an `FL_PUSH' and an `FL_RELEASE' event (actually this event is sent periodically, even if mouse has not moved). The mouse position is given as the parameter `mx' and `my' and action can be taken based on the position. `FL_FOCUS' Input got focussed to this object. This event and the next two are only sent to a free object of type `FL_INPUT_FREE' (see below). `FL_UNFOCUS' Input is no longer focussed on this object. `FL_KEYPRESS' A key was pressed. The KeySym is given with the routine. This event only happens between `FL_FOCUS' and `FL_UNFOCUS' events. `FL_STEP' A step event is sent all the time (at most 50 times per second but often less because of time consuming redraw operations) to a free object of type `FL_CONTINUOUS_FREE' such that it can update its state or appearance. `FL_SHORTCUT' Hotkeys for the object have been triggered. Typically this should result in the returning of the free object. `FL_FREEMEM' Upon receiving this event, the handler should free all object class specific memory allocated. `FL_OTHER' Some other events typically caused by window manager events or inter-client events. All information regarding the details of the events is in `xev'. Many of these events might make it necessary to (partially) redraw the object. Always do this using the routine `*note fl_redraw_object()::'. As indicated above not all events are sent to all free objects. It depends on their types. The following types exist (all objects are sent `FL_OTHER' when it occurs): `FL_NORMAL_FREE' The object will receive the events `FL_DRAW', `FL_ENTER', `FL_LEAVE', `FL_MOTION', `FL_PUSH', `FL_RELEASE' and `FL_MOUSE'. `FL_INACTIVE_FREE' The object only receives `FL_DRAW' events. This should be used for objects without interaction (e.g., a picture). `FL_INPUT_FREE' Same as `FL_NORMAL_FREE' but the object also receives `FL_FOCUS', `FL_UNFOCUS' and `FL_KEYPRESS' events. The `obj->wantkey' is by default set to `FL_KEY_NORMAL', i.e., the free object will receive all normal keys (0-255) except `' and `' key. If you're interested in `' or `' key, you need to change `obj->wantkey' to `FL_KEY_TAB' or `FL_KEY_ALL'. *Note Events: Part IV Events, for details. `FL_CONTINUOUS_FREE' Same as `FL_NORMAL_FREE' but the object also receives `FL_STEP' events. This should be used for objects that change themselves continuously. `FL_ALL_FREE' The object receives all types of events. See `free1.c' for a (terrible) example of the use of free objects. See also `freedraw.c', which is a nicer example of the use of free objects. Free objects provide all the generality you want from the Forms Library. Because free objects behave a lot like new object classes it is recommended that you also read part IV of this documentation before designing free objects. ---------- Footnotes ---------- (1) Label for free objects can't be drawn outside of the bounding box because of the clippings by the dispatcher.  File: xforms.info, Node: Example, Prev: Free Object, Up: Part I Free Objects 5.2 An Example ============== We conclude our discussion of the free object by examining a simple drawing program capable of drawing simple geometric figures like squares, circles, and triangles of various colors and sizes, and of course it also utilizes a free object. The basic UI consists of three logical parts. A drawing area onto which the squares etc. are to be drawn; a group of objects that control what figure to draw and with what size; and a group of objects that control the color with which the figure is to be drawn. The entire UI is designed interactively using the GUI builder `fdesign' with most objects having their own callbacks. `fdesign' writes two files, one is a header file containing forward declarations of callback functions and other function prototypes: #ifndef FD_drawfree_h_ #define FD_drawfree_h_ extern void change_color(FL_OBJECT *, long); extern void switch_figure(FL_OBJECT *, long); /* more callback declarations omitted */ typedef struct { FL_FORM * drawfree; FL_OBJECT * freeobj; FL_OBJECT * figgrp; FL_OBJECT * colgrp; FL_OBJECT * colorobj; FL_OBJECT * miscgrp; FL_OBJECT * sizegrp; FL_OBJECT * wsli; FL_OBJECT * hsli; FL_OBJECT * drobj[3]; void * vdata; long ldata; } FD_drawfree; extern FD_drawfree *create_form_drawfree(void); #endif /* FD_drawfree_h_ */ The other file contains the actual C-code that creates the form when compiled and executed. Since free objects are not directly supported by fdesign, a box was used as a stub for the location and size of the drawing area. After the C-code was generated, the box was changed manually to a free object by replacing `fl_add_box(FL_DOWN_BOX,...)' with `fl_add_free(FL_NORMAL_FREE,...)'. We list below the output generated by fdesign with some comments: FD_drawfree *create_form_drawfree(void) { FL_OBJECT *obj; FD_drawfree *fdui = fl_calloc(1, sizeof *fdui); fdui->drawfree = fl_bgn_form(FL_NO_BOX, 530, 490); obj = fl_add_box(FL_UP_BOX, 0, 0, 530, 490, ""); This is almost always the same for any form definition: we allocate a structure that will hold all objects on the form as well as the form itself. In this case, the first object on the form is a box of type `FL_UP_BOX'. fdui->figgrp = fl_bgn_group(); obj = fl_add_button(FL_RADIO_BUTTON, 10, 60, 40, 40, "@#circle"); fl_set_object_lcolor(obj,FL_YELLOW); fl_set_object_callback(obj, switch_figure, 0); obj = fl_add_button(FL_RADIO_BUTTON, 50, 60, 40, 40, "@#square"); fl_set_object_lcolor(obj, FL_YELLOW); fl_set_object_callback(obj, switch_figure, 1); obj = fl_add_button(FL_RADIO_BUTTON, 90, 60, 40, 40, "@#8*>"); fl_set_object_lcolor(obj, FL_YELLOW); fl_set_object_callback(obj, switch_figure, 2); fl_end_group(); This creates three buttons that control what figures are to be drawn. Since figure selection is mutually exclusive, we use `RADIO_BUTTON' for this. Further, the three buttons are placed inside a group so that they won't interfere with other radio buttons on the same form. Notice that the callback function `switch_figure()' is bound to all three buttons but with different arguments. Thus the callback function can resolve the associated object via the callback function argument. In this case, 0 is used for circle, 1 for square and 2 for triangle. This association of a callback function with a piece of user data can often reduce the amount of code substantially, especially if you have a large group of objects that control similar things. The advantage will become clear as we proceed. Next we add three sliders to the form. By using appropriate colors for these sliding bars (red, green, blue), there is no need to label them. There's also no need to store their addresses as their callback routine `change_color()' will receive them automatically. fdui->colgrp = fl_bgn_group(); obj = fl_add_slider(FL_VERT_FILL_SLIDER, 25, 170, 30, 125, ""); fl_set_object_color(obj, FL_COL1, FL_RED); fl_set_object_callback(obj, change_color, 0); obj = fl_add_slider(FL_VERT_FILL_SLIDER, 55, 170, 30, 125, ""); fl_set_object_color(obj, FL_COL1, FL_GREEN); fl_set_object_callback(obj, change_color, 1); obj = fl_add_slider(FL_VERT_FILL_SLIDER, 85, 170, 30, 125, ""); fl_set_object_color(obj, FL_COL1, FL_BLUE); fl_set_object_callback(obj, change_color, 2); fdui->colorobj = obj = fl_add_box(FL_BORDER_BOX, 25, 140, 90, 25, ""); fl_set_object_color(obj, FL_FREE_COL1, FL_FREE_COL1); fl_end_group(); Again, a single callback function, `change_color()', is bound to all three sliders. In addition to the sliders, a box object is added to the form. This box is set to use the color indexed by `FL_FREE_COL1' and will be used to show visually what the current color setting looks like. This implies that in the `change_color()' callback function, the entry `FL_FREE_COL1' in the Forms Library's internal colormap will be changed. We also place all the color related objects inside a group even though they are not of radio buttons. This is to facilitate gravity settings which otherwise require setting the gravities of each individual object. Next we create our drawing area which is simply a free object of type `NORMAL_FREE' with a handler to be written obj = fl_add_frame(FL_DOWN_FRAME, 145, 30, 370, 405, ""); fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast); fdui->freeobj = obj = fl_add_free(FL_NORMAL_FREE, 145, 30, 370, 405, "", freeobject_handler); fl_set_object_boxtype(obj, FL_FLAT_BOX); fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast); The frame is added for decoration purposes only. Although a free object with a down box would appear the same, the down box can be written over by the free object drawing while the free object can't draw on top of the frame since the frame is outside of the free object. Notice the gravity settings. This kind of setting maximizes the real estate of the free object when the form is resized. Next, we need to have control over the size of the object. For this, two sliders are added, using the same callback function but with different user data (0 and 1 in this case): fdui->sizegrp = fl_bgn_group(); fdui->wsli = obj = fl_add_valslider(FL_HOR_SLIDER, 15, 370, 120, 25, "Width"); fl_set_object_lalign(obj, FL_ALIGN_TOP); fl_set_object_callback(obj, change_size, 0); fdui->hsli = obj = fl_add_valslider(FL_HOR_SLIDER, 15, 55, 410,25, "Height"); fl_set_object_lalign(obj, FL_ALIGN_TOP); fl_set_object_callback(obj, change_size, 1); fl_end_group(); The rest of the UI consists of some buttons the user can use to exit the program, elect to draw outlined instead of filled figures etc. The form definition ends with `*note fl_end_form()::'. The structure that holds the form as well as all the objects within it is returned to the caller: fdui->miscgrp = fl_bgn_group(); obj = fl_add_button(FL_NORMAL_BUTTON, 395, 445, 105, 30, "Quit"); fl_set_button_shortcut(obj, "Qq#q", 1); obj = fl_add_button(FL_NORMAL_BUTTON, 280, 445, 105, 30, "Refresh"); fl_set_object_callback(obj, refresh_cb, 0); obj = fl_add_button(FL_NORMAL_BUTTON, 165, 445, 105, 30, "Clear"); fl_set_object_callback(obj,clear_cb,0); fl_end_group(); obj = fl_add_checkbutton(FL_PUSH_BUTTON, 15, 25, 100, 35, "Outline"); fl_set_object_color(obj, FL_MCOL, FL_BLUE); fl_set_object_callback(obj, fill_cb, 0); fl_set_object_gravity(obj, FL_NorthWest, FL_NorthWest); fl_end_form(); return fdui; } After creating the UI we need to write the callback functions and the free object handler. The callback functions are relatively easy since each object is designed to perform a very specific task. Before we proceed to code the callback functions we first need to define the overall data structure that will be used to glue together the UI and the routines that do real work. The basic structure is the DrawFigure structure that holds the current drawing function as well as object attributes such as size and color: #define MAX_FIGURES 500 typedef void (*DrawFunc)(int /* fill */, int, int, int, int, /* x,y,w,h */ FL_COLOR /* color */ ); typedef struct { DrawFunc drawit; /* how to draw this figure */ int fill, /* is it to be filled? */ x, y, w, h; /* position and sizes */ int pc[3]; /* primary color R,G,B */ int newfig; /* indicate a new figure */ FL_COLOR col; /* color index */ } DrawFigure; static DrawFigure saved_figure[MAX_FIGURES], *cur_fig; static FD_drawfree *drawui; int max_w = 30, /* max size of figures */ max_h = 30; All changes to the figure attributes will be buffered in `cur_fig' and when the actual drawing command is issued (mouse click inside the free object), `cur_fig' is copied into `saved_figure' array buffer. Forms Library contains some low-level drawing routines that can draw and optionally fill arbitrary polygonal regions, so in principle, there is no need to use Xlib calls directly. To show how Xlib drawing routines are combined with Forms Library, we use Xlib routines to draw a triangle: void draw_triangle(int fill, int x, int y, int w, int h, FL_COLOR col) { XPoint xp[4]; GC gc = fl_state[fl_get_vclass()].gc[0]; Window win = fl_winget(); Display *disp = fl_get_display(); xp[0].x = x; xp[0].y = y + h - 1; xp[1].x = x + w / 2; xp[1].y = y; xp[2].x = x + w - 1; xp[2].y = y + h - 1; XSetForeground(disp, gc, fl_get_pixel(col)); if (fill) XFillPolygon(disp, win, gc, xp, 3, Nonconvex, Unsorted); else { xp[3].x = xp[0].x; xp[3].y = xp[0].y; XDrawLines(disp, win, gc, xp, 4, CoordModeOrigin); } } Although more or less standard stuff, some explanation is in order. As you have probably guessed, `*note fl_winget()::' returns the current "active" window, defined to be the window the object receiving the dispatcher's messages (`FL_DRAW' etc.) belongs to(1). Similarly the routine `*note fl_get_display()::' returns the current connection to the X server. Part IV has more details on the utility functions in the Forms Library. The array of structures `*note fl_state::[]' keeps much "inside" information on the state of the Forms Library. For simplicity, we choose to use the Forms Library's default GC. There is no fundamental reason that this has be so. We certainly can copy the default GC and change the foreground color in the copy. Of course unlike using the default GC directly, we might have to set the clip mask in the copy whereas the default GC always have the proper clip mask (in this case, to the bounding box of the free object). We use the Forms Library's built-in drawing routines to draw circles and rectangles. Then our drawing functions can be defined as follows: static DrawFunc drawfunc[] = { fl_oval, fl_rectangle, draw_triangle }; Switching what figure to draw is just changing the member `drawit' in `cur_fig'. By using the proper object callback argument, figure switching is achieved by the following callback routine that is bound to all figure buttons void switch_object(FL_OBJECT *obj, long which) { cur_fig->drawit = drawfunc[which]; } So this takes care of the drawing functions. Similarly, the color callback function can be written as follows void change_color(FL_OBJECT *obj, long which) { cur_fig->c[which] = 255 * fl_get_slider_value(obj); fl_mapcolor(cur_fig->col, cur_fig->c[0], cur_fig->c[1], cur_fig->c[2]); fl_mapcolor(FL_FREE_COL1, cur_fig->c[0], cur_fig->c[1], cur_fig->c[2]); fl_redraw_object(drawui->colorobj); } The first call of `*note fl_mapcolor()::' defines the RGB components for index `cur_fig->col' and the second `*note fl_mapcolor()::' call defines the RGB component for index `FL_FREE_COL1', which is the color index used by `colorobj' that serves as current color visual feedback. Object size is taken care of in a similar fashion by using a callback function bound to both size sliders: void change_size(FL_OBJECT * obj, long which) { if (which == 0) cur_fig->w = fl_get_slider_value(obj); else cur_fig->h = fl_get_slider_value(obj); } Lastly, we toggle the fill/outline option by querying the state of the push button void outline_callback(FL_OBJECT *obj, long data) { cur_fig->fill = !fl_get_button(obj); } To clear the drawing area and delete all saved figures, a Clear button is provided with the following callback: void clear_cb(FL_OBJECT *obj, long notused) { saved_figure[0] = *cur_fig; /* copy attributes */ cur_fig = saved_figure; fl_redraw_object(drawui->freeobj); } To clear the drawing area and redraw all saved figures, a Refresh button is provided with the following callback: void refresh_cb(FL_OBJECT *obj, long notused) { fl_redraw_object(drawui->freeobj); } With all attributes and other services taken care of, it is time to write the free object handler. The user can issue a drawing command inside the free object by clicking either the left or right mouse button. int freeobject_handler(FL_OBJECT *obj, int event, FL_Coord mx, FL_Coord my, int key, void *xev) { DrawFigure *dr; switch (event) { case FL_DRAW: if (cur_fig->newfig == 1) cur_fig->drawit(cur_fig->fill, cur_fig->x + obj->x, cur_fig->y + obj->y, cur_fig->w, cur_fig->h, cur_fig->col); else { fl_draw_box(obj->boxtype, obj->x, obj->y, obj->w, obj->h, obj->col1, obj->bw); for (dr = saved_figure; dr < cur_fig; dr++) { fl_mapcolor(FL_FREE_COL1, dr->c[0], dr->c[1], dr->c[2]); dr->drawit(dr->fill,dr->x + obj->x, dr->y + obj->y, dr->w, dr->h, dr->col); } } cur_fig->newfig = 0; break; case FL_PUSH: if (key == FL_MIDDLE_MOUSE) break; cur_fig->x = mx - cur_fig->w / 2; cur_fig->y = my - cur_fig->h / 2; /* convert figure center to relative to the object*/ cur_fig->x -= obj->x; cur_fig->y -= obj->y; cur_fig->newfig = 1; fl_redraw_object(obj); *(cur_fig + 1) = *cur_fig; fl_mapcolor(cur_fig->col + 1, cur_fig->c[0], cur_fig->c[1], cur_fig->c[2] ); cur_fig++; cur_fig->col++; break; } return FL_RETURN_NONE; } In this particular program, we are only interested in mouse clicks and redraw. The event dispatching routine cooks the X event and drives the handler via a set of events (messages). For a mouse click inside the free object, its handler is notified with an FL_PUSH together with the current mouse position mx, my. In addition, the driver also sets the clipping mask to the bounding box of the free object prior to sending `FL_DRAW'. Mouse position (always relative to the origin of the form) is directly usable in the drawing function. However, it is a good idea to convert the mouse position so it is relative to the origin of the free object if the position is to be used later. The reason for this is that the free object can be resized or moved in ways unknown to the handler and only the position relative to the free object is meaningful in these situations. It is tempting to call the drawing function in response to `FL_PUSH' since it is `FL_PUSH' that triggers the drawing. However, it is a (common) mistake to do this. The reason is that much bookkeeping is performed prior to sending `FL_DRAW', such as clipping, double buffer preparation and possibly active window setting etc. All of these is not done if the message is anything else than `FL_DRAW'. So always use `*note fl_redraw_object()::' to draw unless it is a response to `FL_DRAW'. Internally `*note fl_redraw_object()::' calls the handler with `FL_DRAW' (after some bookkeeping), so we only need to mark `FL_PUSH' with a flag `newfig' and let the drawing part of the handler draw the newly added figure. `FL_DRAW' has two parts. One is simply to add a figure indicated by `newfig' being true and in this case, we only need to draw the figure that is being added. The other branch might be triggered as a response to damaged drawing area resulting from `Expose' event or as a response to `Refresh' command. We simply loop over all saved figures and (re)draw each of them. The only thing left to do is to initialize the program, which includes initial color and size, and initial drawing function. Since we will allow interactive resizing and also some of the objects on the form are not resizeable, we need to take care of the gravities. void draw_initialize(FD_drawfree *ui) { fl_set_form_minsize(ui->drawfree, 530, 490); fl_set_object_gravity(ui->colgrp, FL_West, FL_West); fl_set_object_gravity(ui->sizegrp, FL_SouthWest, FL_SouthWest); fl_set_object_gravity(ui->figgrp, FL_NorthWest, FL_NorthWest); fl_set_object_gravity(ui->miscgrp, FL_South, FL_South); fl_set_object_resize(ui->miscgrp, FL_RESIZE_NONE); cur_fig = saved_figure; cur_fig->pc[0] = cur_fig->pc[1] = cur_fig->pc[2] = 127; cur_fig->w = cur->fig->h = 30; cur_fig->drawit = fl_oval; cur_fig->col = FL_FREE_COL1 + 1; cur_fig->fill = 1; fl_set_button(ui->drobj[0], 1); /* show current selection */ fl_mapcolor(cur_fig->col, cur_fig->pc[0], cur->fig->pc[1], cur->fig->pc[2]); fl_mapcolor(FL_FREE_COL1, cur_fig->pc[0], cur->fig->pc[1], cur->fig->pc[2]); fl_set_slider_bounds(ui->wsli, 1, max_w); fl_set_slider_bounds(ui->hsli, 1, max_h); fl_set_slider_precision(ui->wsli, 0); fl_set_slider_precision(ui->hsli, 0); fl_set_slider_value(ui->wsli, cur_fig->w); fl_set_slider_value(ui->hsli, cur_fig->h); } With all the parts in place, the main program simply creates, initializes and shows the UI, then enters the main loop: int main(int argc, char *argv[]) { fl_initialize(&argc, argv, "FormDemo", 0, 0); drawui = create_form_drawfree(); draw_initialize(drawui); fl_show_form(drawui->drawfree, FL_PLACE_CENTER|FL_FREE_SIZE, FL_FULLBORDER, "Draw"); fl_do_forms(); return 0; } Since the only object that does not have a callback is the Quit button, `*note fl_do_forms()::' will return only if that button is pushed. Full source code to this simple drawing program can be found in `demos/freedraw.c'. ---------- Footnotes ---------- (1) If `*note fl_winget()::' is called while not handling messages, the return value must be checked.  File: xforms.info, Node: Part I Goodies, Next: Part II, Prev: Part I Free Objects, Up: Top 6 Goodies ********* A number of special routines are provided that make working with simple forms even simpler. All these routines build simple forms and handle the interaction with the user. * Menu: * Messages and Questions:: * Command Log:: * Colormap:: * Color Chooser:: * File Selector::  File: xforms.info, Node: Messages and Questions, Next: Command Log, Up: Part I Goodies 6.1 Messages and Questions ========================== The following routines are meant to give messages to the user and to ask simple questions: void fl_show_message(const char *s1, const char *s2, const char *s3); It shows a simple form with three lines of text and a button labeled OK on it. The form is so shown such that the mouse pointer is on the button. Sometimes, it may be more convenient to use the following routine void fl_show_messages(const char *str); when the message is a single line or when you know the message in advance. Embed newlines in `str' to get multi-line messages. As a third alternative you can also use void fl_show_messages_f(const char * fmt, ...); The only required argument `fmt' is a format string as you would use it for e.g., `printf(3)', which then is followed by as many arguments as there are format specifiers in the format string. The string resulting from expanding the format string, using the remaining arguments, can have arbitrary length and embedded newline characters (`'\n''), producing line breaks. The size of the message box is automatically made to fit the whole text. Both of the message routines block execution and do not return immediately (but idle callbacks and asynchronous IO continue to be run and checked). Execution resumes when the OK button is pressed or `' is hit, or when the message form is removed from the screen by the following routine (for example, triggered by a timeout or idle callback): void fl_hide_message(void) There is also a routine that can be used to show a one-line message that can only be removed programmatically void fl_show_oneliner(const char *str, FL_Coord x, FL_Coord y); void fl_hide_oneliner(void); where `str' is the message and `x' and `y' are the coordinates (relative to the root window) the message should be placed. Note that multi-line messages are possible by embedding the newline character into `str'. See the demo program `preemptive.c' for an example of its use. By default, the background of the message is yellow and the text black. To change this default, use the following routine void fl_set_oneliner_color(FL_COLOR background, FL_COLOR textcol); A similar routine exists to change the font style and size void fl_set_oneliner_font(int style, int size); void fl_show_alert(const char *s1, const char *s2, const char *s3, int centered); void fl_hide_alert(void); work the same as `*note fl_show_messages()::' goodie except that an alert icon (!) is added and the first string is shown bold-faced. The extra parameter `centered' controls whether to display the form centered on the screen. As in the case of messages also another function is avaialble void fl_show_alert2(int centered, const char *fmt, ...); `centered' controls if the alert message is centered and `fmt' must be a format string as e.g., used for `printf(3)'. After the format string as many further arguments are required as there are format specifiers in the format string. The string resulting from expanding the format string, using the rest of the arguments, can have arbitrary length and the first embedded form-feed character (`'\f'') is used as the separator between the title string and the message of the alert box. Embedded newline characters (`'\n'') produce line breaks. In combination with `*note fl_add_timeout()::', it is easy to develop a timed alert routine that goes away when the user pushes the OK button or when a certain time has elapsed: static void dismiss_alert(int ID, void *data) { fl_hide_alert(); } void show_timed_alert(const char *s1, const char *s2, const char *s3, int centered) { fl_add_timeout( 10000, dismiss_alert, 0 ); /* ten seconds */ /* fl_show_alert blocks, and returns only when the OK button is pushed or when the timeout, in this case, 10 seconds, has elapsed */ fl_show_alert(s1, s2, s3, centered); } Then you can use `show_timed_alert()' just as ``fl_show_alert()'' but with added functionality that the alert will remove itself after 10 seconds even if the user does not push the OK button. int fl_show_question(const char *message, int def); void fl_hide_question(void); Again shows a message (with possible embedded newlines in it) but this time with a Yes and a No button. `def' controls which button the mouse pointer should be on: 1 for Yes, 0 for No and any other value causes the form to be shown so the mouse pointer is at the center of the form. It returns whether the user pushed the Yes button. The user can also press the `' key to mean Yes and the `' key to mean No. If the question goodie is removed programmatically via `*note fl_hide_question()::', the default `def' as given in `*note fl_show_question()::' is taken. If no default is set, 0 is returned by `*note fl_show_question()::'. The following code segment shows one way of using `*note fl_hide_question()::' void timeout_yesno(int id, void *data) { fl_hide_question(); } ... fl_add_timeout(5000, timeout_yesno, 0); /* show_question blocks until either timeouts or one of the buttons is pushed */ if (fl_show_question("Want to Quit ?", 1)) exit(0); /* no is selected, continue */ ... /* rest of the code *. In the above example, the user is given 5 seconds to think if he wants to quit. If within the 5 seconds he can't decide what to do, the timeout is triggered and `*note fl_show_question()::' returns 1. If, on the other hand, he pushes the No button before the timeout triggers, `*note fl_show_question()::' returns normally and `*note fl_hide_question()::' becomes a no-op. int fl_show_choice(const char *s1, const char *s2, const char *s3, int numb, const char *b1, const char *b2, const char *b3, int def); int fl_show_choices(const char *s, int numb, const char *b1, const char *b2, const char *b3, int def); void fl_set_choices_shortcut(const char *s1, const char *s2, const char *s3); void fl_hide_choice(void); The first routine shows a message (up to three lines) with one, two or three buttons. `numb' indicates the number of buttons. `b1', `b2' and `b3' are the labels of the buttons. `def' can be 1, 2 or 3, indicating the default choice. The second routine is similar to the first except that the message is passed as a single string with possible embedded newlines in it. Both routines return the number of the button pressed (1, 2 or 3). The user can also press the `<1>', `<2>' or `<3>' key to indicate the first, second, or third button. More mnemonic hotkeys can be defined using the shortcut routine, `s1', `s2' and `s3' are the shortcuts to bind to the three buttons. If the choice goodie is removed by `*note fl_hide_choice()::', the default `def' is returned. To change the font used in all messages, use the following routine void fl_set_goodies_font(int style, int size); To obtain some text from the user, use the following routine const char *fl_show_input(const char *str1, const char *defstr); void fl_hide_input(void); This shows a box with one line of message (indicated by `str1'), and an input field into which the user can enter a string. `defstr' is the default input string placed in the input box. In addition, three buttons, labeled `Cancel', `OK' and `Clear' respectively, are added. The button labeled `Clear' deletes the string in the input field. The routine returns the string in the input field when the user presses the `OK' button or the `' key. The function also returns when button `Cancel' is pressed. In this case, instead of returning the text in the input field, `NULL' is returned. This routine can be used to have the user provide all kinds of textual input. Removing the input field programmatically by calling `*note fl_hide_input()::' results in `NULL' being returned by `*note fl_show_input()::', i.e., it's equivalent to pressing the `Cancel' button. A similar but simpler routine can also be used to obtain textual input const char *fl_show_simple_input(const char *str1, const char *defstr); The form shown in this case only has the `OK' button. The example program `goodies.c' shows you these goodies. It is possible to change some of the built-in button labels via the following resource function with proper resource names void fl_set_resource(const char *res_str, const char *value) To, for example, change the label of the `Dismiss' button to `"Go"' in the alert form, code similar to the following can be used after calling `*note fl_initialize()::' but before any use of the alert goodie: fl_set_resource("flAlert.dismiss.label", "Go"); Currently the following goodies resources are supported: `flAlert.title' The window title of the alert goodie `flAlert.dismiss.label' The label of the `Dismiss' button `flQuestion.yes.label' The label of the `Yes' button `flQuestion.no.label' The label of the `No' button `flQuestion.title' The window title of the Question goodie `flChoice.title' The window title of the Choice goodie `*.ok.label' The label of the `OK' button Note that all goodies are shown with `FL_TRANSIENT' and not all window managers decorate such forms with titles. Thus the title setting in the above listing may not apply.  File: xforms.info, Node: Command Log, Next: Colormap, Prev: Messages and Questions, Up: Part I Goodies 6.2 Command Log =============== In a number of situations, a GUI is created specifically to make an existing command-line oriented program easier to use. For stylistic considerations, you probably don't want to have the output (`stderr' and `stdout') as a result of running the command printed on the terminal. Rather you want to log all the messages to a browser so the user can decide if and when to view the log. For this, a goodie is available long fl_exe_command(const char *cmd, int block); This function, similar to a `system(3)' call, forks a new process that runs the command `cmd', which must be a (null-terminated) string containing a command line passed to the (sh) shell. The output (both `stderr' and `stdout') of `cmd' is logged into a browser, which can be presented to the user when appropriate (see below). The `block' argument is a flag indicating if the function should wait for the child process to finish. If the argument `block' is true (non-zero), the function waits until the command `cmd' completes and then returns the exit status of the command `cmd' (i.e., the status one gets form `wait()' or `waitpid()', so use `WEXITSTATUS()' on it if you want the return or `exit()' value from the program started)). If the argument `block' is false (0), the function returns immediately without waiting for the command to finish. In this case, the function returns the process ID of the child process or -1 if an error occured. Unlike other goodies, `*note fl_exe_command()::' does not deactivate other forms even in blockng mode. This means that the user can interact with the GUI while `*note fl_exe_command()::' waits for the child process to finish. If this is not desired, you can use `*note fl_deactivate_all_forms()::' and `*note fl_activate_all_forms()::' to wrap the function. If `*note fl_exe_command()::' is called in non-blocking mode, the following function should be called to clean up related processes and resources before the caller exits (otherwise a zombie process may result) int fl_end_command(long pid); where `pid' is the process ID returned by `*note fl_exe_command()::'. The function suspends the current process and waits until the child process is completed, then it returns the exit status of the child process or -1 if an error has occurred. There is another routine that will wait for all the child processes initiated by `*note fl_exe_command()::' to complete int fl_end_all_command(void) The function returns the status of the last child process. You can also poll the status of a child process using the following routine int fl_check_command(long pid); where `pid' is the process ID returned by `*note fl_exe_command()::'. The function returns the following values: 0 if the child process is finished; 1 if the child process still exists (running or stopped) and -1 if an error has occurred inside the function. If some interaction with the command being executed is desired, the following functions may be more appropriate. These functions operates almost exactly as the `popen(3)' and `pclose(3)' functions: FILE *fl_popen(const char *command, const char *type); int fl_pclose(FILE *stream); The `*note fl_popen()::' function executes the command in a child process, and logs the `stderr' messages into the command log. Further, if type is `"w"', `stdout' will also be logged into the command browser. `*note fl_pclose()::' should be used to clean up the child process. To show or hide the logs of the command output, use the following functions int fl_show_command_log(int border); void fl_hide_command_log(void); where `border' is the same as that used in `*note fl_show_form()::'. These two routines can be called anytime anywhere after `*note fl_initialize()::' has been invoked. The command log is by default placed at the top-right corner of the screen. To change the default placement, use the following routine void fl_set_command_log_position(int x, int y); where `x' and `y' are the coordinates of the upper-left corner of the form relative to the root window. The logging of the output is accumulative, i.e., `*note fl_exe_command()::' does not clear the browser. To clear the browser, use the following routine void fl_clear_command_log(void); It is possible to add arbitrary text to the command browser via the following routine void fl_addto_command_log(const char *txt); void fl_addto_command_log_f(const char *fmt, ...); where `txt' for `fl_addto_command_log()' is a string and `fmt' for `fl_addto_command_log_f()' is a format string like for `printf()' that gets expanded using the following arguments. This string, with possible embedded newlines, gets added to the last line of the browser using `*note fl_addto_browser_chars()::'. Finally, there is a routine that can be used to obtain the GUI structure of the command browser typedef struct { FL_FORM * form; /* the form */ FL_OBJECT * browser; /* the browser */ FL_OBJECT * close_browser; /* the close button */ FL_OBJECT * clear_browser; /* the clear button */ } FD_CMDLOG; FD_CMDLOG *fl_get_command_log_fdstruct(void); From the information returned the application program can change various attributes of the command browser and its associated objects. Note however, that you should not hide/show the form or free any members of the structure.  File: xforms.info, Node: Colormap, Next: Color Chooser, Prev: Command Log, Up: Part I Goodies 6.3 Colormap ============ In a number of applications the user has to select a color from the colormap. For this a goody has been created. It shows the first 64 entries of the colormap. The user can scroll through the colormap to see more entries. Once the user presses the mouse one of the entries the corresponding index is returned and the colormap is removed from the screen. To display the colormap use the routine int fl_show_colormap(int oldcol); `oldcol' should be the current or default color. The user can decide not to change this color by pressing the `Cancel' button in the form. The procedure returns the index of the color selected (or the index of the old color).  File: xforms.info, Node: Color Chooser, Next: File Selector, Prev: Colormap, Up: Part I Goodies 6.4 Color Chooser ================= It's also not uncommon that an application lets the user use an arbitrary color (not necessarily already in the colormap). The color chooser shows a form that allows the user to select a new color either using a HSV color wheel and a slider for the intensity or by entering HSV or RGB values directly. [image src="xforms_images/colchooser.png"] To show such a form call int fl_show_color_chooser(const int *rgb_in, int * rgb_out); The first argument is a pointer to an array with the 3 RGB values to use for the color to be displayed when the color chooser is shown. If it is `NULL' white is used. The second argument is another pointer to an array for the 3 RGB values of the selected color to be returned on success. On success the function returns 1 (and sets the `rgb_out' array), but if the user clicked on the "Cancel" button 0 gets returns (and the `rgb_out' array is not modified. Please keep in mind that there's no 1-to-1 mapping between the HSV and RGB color space, there are a lot more HSV than RGB triples and some colors don't even have a unique representation in HSV space like, for example, all shades of grey, including white and black.  File: xforms.info, Node: File Selector, Prev: Color Chooser, Up: Part I Goodies 6.5 File Selector ================= The most extended predefined form is the file selector. It provides an easy and interactive way to let the user select files. It is called as follows: const char *fl_show_fselector(const char *message, const char *directory, const char *pattern, const char *default); A form will be shown in which all files in directory `directory' are listed that satisfy the pattern `pattern' (see Fig 6.1). `pattern' can be any kind of regular expression, e.g., `[a-f]*.c', which would list all files starting with a letter between `a' and `f' and ending with `.c'. `default' is the default file name. `message' is the message string placed at the top of the form. The user can choose a file from the list given and the function then returns a pointer to a static buffer that contains the filename selected, or `NULL' if the `Cancel' button is pressed (see below). The user can also walk through the directory structure, either by clicking on the box with the name of the currently displayed directory to edit it manually, or by double-clicking on the name of a directory (shown with a 'D' in front of it) shown in the list. If the directory content changes while it is being displayed in the file selector the `ReScan' button can be used to request a rescan of the directory. [image src="xforms_images/fselect.png"] In a typical application, once the file selector goodie is shown, it is up to the user when the file selector should be dismissed by pushing `Ready' or `Cancel' button. In some situations the application may want to remove the file selector on it's own. To this end, the following routine is available void fl_hide_fselector(void); The effect of removing the file selector programmatically is the same as pushing the `Cancel' button. There are total of `FL_MAX_FSELECTOR' (6) file selectors in the Forms Library with each having its own current directory and content cache. All the file selector functions documented manipulate the currently active file selector, which can be set using the following routine int fl_use_fselector(int n); where `n' is a number between 0 and `FL_MAX_FSELECTOR - 1'. To change the font the file selector uses, the following routine can be used: void fl_set_fselector_fontsize(int font_size); void fl_set_fselector_fontstyle(int font_style); These routines change the font for all the objects on the form. It is possible to change the font for some of the objects (e.g., browser only) using `*note fl_get_fselector_fdstruct()::' explained later. The window title of the file selector can be changed anytime using the following routine void fl_set_fselector_title(const char *title); To force an update programmatically, call void fl_invalidate_fselector_cache(void); before `*note fl_show_fselector()::'. Note that this call only forces an update once, and on the directory that is to be browsed. To disable caching altogether, the following routine can be used: void fl_disable_fselector_cache(int yes); A false (0) parameter (re)enables directory caching. The user can also change the pattern by clicking the mouse on top of it it. Note that directories are shown independent of whether they satisfy the pattern. He can also type in a file name directly. Complete keyboard navigation is built-in. E.g., you can use `d' to change the directory instead of using the mouse. When the user is satisfied, i.e., found the correct directory and indicated the file name required, he can press the button labeled `Ready' or press the `' key. He can also double click on the file name in the browser. The full path to the filename is returned by the procedure. If the user presses the `Cancel' button `NULL' is returned. It is also possible to set a callback routine so that whenever the user double clicks on a filename, instead of returning the filename, the callback routine is invoked with the filename as the argument. To set such a callback, use the following routine void fl_set_fselector_callback(int (*callback)(const char *, void *), void *user_data); where the second argument of the callback is the `user data'. The return value of the callback function is currently not used. Note that the behavior of the file selector is slightly different when a callback is present. Without the callback, a file selector is always modal. Please note that when a file selector has a callback installed the field for manually entering a file name isn't shown. The placement of the file selector is by default centered on the screen, which can be changed by the following routine void fl_set_fselector_placement(int place); where place is the placement request same as in `*note fl_show_form()::'. The default is `FL_PLACE_CENTER | FL_FREE_SIZE'. By default, an fselector is displayed with transient property set. To change the default, use the following routine void fl_set_fselector_border(int border); The `border' request by this function is the same as in `*note fl_show_form()::', but `FL_NOBORDER' is ignored. If the arguments `directory', `pattern' or `default' passed to `*note fl_show_form()::' are empty strings or `NULL', the previous value is used (with some reasonable defaults getting used when this happens the first time). Thus the file selector "remembers" all the settings the selector had last time. The application program can figure out the directory, pattern and file name (without the path) after the user changed them using the routines const char *fl_get_directory(void); const char *fl_get_pattern(void); const char *fl_get_filename(void); It is also possible to programatically set new values for the default directory and pattern by using the functions int fl_set_directory( const char * dir ); void fl_set_pattern( const char * pattern ); `*note fl_set_directory()::' returns 0 on success and 1 on failure, either because the argument was a `NULL' pointer or not a valid directory. There are other routines that make the fselector more flexible. The most important of which is the ability to accommodate up to three application specific button: void fl_add_fselector_appbutton(const char *label, void (*callback)(void *), void *data); The argument `data' is passed to the callback. Whenever this application specific button is pushed, the callback function is invoked. To remove an application specific button, use the following routine void fl_remove_fselector_appbutton(const char *label); Within the callback function, in addition to using the routines mentioned above, the following routines can be used: void fl_refresh_fselector(void); This function causes the file selector to re-scan the current directory and to list all entries in it. If, for whatever reasons, there is a need to get the fselector's form the following routine can be used: FL_FORM *fl_get_fselector_form(void); See `fbrowse.c' for the use of the file selector. Although discouraged, it is recognized that direct access to the individual objects of a fselector's form maybe necessary. To this end, the following routine exists typedef struct { FL_FORM * fselect; void * vdata; char * cdata; long ldata; FL_OBJECT * browser, * input, * prompt, * resbutt; FL_OBJECT * patbutt, * dirbutt, * cancel, * ready; FL_OBJECT * dirlabel, * patlabel; FL_OBJECT * appbutt[3]; } FD_FSELECTOR; FD_FSELECTOR *fl_get_fselector_fdstruct(void); You can, for example, change the default label strings of various buttons via members of the `FD_FSELECTOR' structure: FD_FSELECTOR *fs = fl_get_fselector_fdstruct(); fl_set_object_label(fs->ready, "Go !"); fl_fit_object_label(fs->ready, 1, 1); Since the return value of `*note fl_get_fselector_fdstruct()::' is a pointer to an internal structures, the members of this structure should not be modified. In the listing of files in a directory special files are marked with a prefix in the browser (for example, `D' for directories, `p' for pipes etc.). To change the prefix, use the following routine void fl_set_fselector_filetype_marker(int dir, int fifo, int socket, int cdev, int bdev); where `dir' is the marker character for directories, `fifo' the marker for pipes and FIFOs, `socket' the marker for sockets, `cdev' the marker for character device files and, finally, `bdev' the marker character for block device files. Although file systems under Unix are similar, they are not identical. In the implementation of the file selector, the subtle differences in directory structures are isolated and conditionally compiled so an apparent uniform interface to the underlying directory structure is achieved. To facilitate alternative implementations of file selectors, the following (internal) routines can be freely used: To get a directory listing, the following routine can be used const FL_Dirlist *fl_get_dirlist(const char *dirname, const char *pattern, int *nfiles, int rescan); where `dirname' is the directory name; `pattern' is a regular expression that is used to filter the directory entries; `nfiles' on return is the total number of entries in directory `dirname' that match the pattern specified by `pattern' (not exactly true, see below). The function returns the address of an array of type `FL_Dirlist' with `nfiles' if successful and `NULL' otherwise. By default, directory entries are cached. Passing the function a true (non-zero) value for the `rescan' argument requests a re-read. `FL_Dirlist' is a structure defined as follows typedef struct { char * name; /* file name */ int type; /* file type */ long dl_mtime; /* file modification time */ unsigned long dl_size; /* file size in bytes */ } FL_Dirlist; where `type' is one of the following file types `FT_FILE' a regular file `FT_DIR' a directory `FT_SOCK' a socket `FT_FIFO' a pipe or FIFO `FT_LINK' a symbolic link `FT_BLK' a block device `FT_CHR' a character device `FT_OTHER' ? To free the list cache returned by `*note fl_get_dirlist()::', use the following call void fl_free_dirlist(FL_Dirlist *dl); Note that a cast may be required to get rid of compiler warnings due to the `const' qualifier of the return value of `*note fl_get_dirlist()::'. See demo program `dirlist.c' for an example use of `*note fl_get_dirlist()::'. Per default not all types of files are returned by `*note fl_get_dirlist()::'. The specific rules for which types of file are returned are controlled by an additional filter after the pattern filter. It has the type int default_filter(const char *name, int type); and is called for each entry found in the directory that matched the pattern. This filter function should return true (non-zero) if the entry is to be included in the directory list. The default filter is similar to the following int ffilter(const char *name, int type) { return type == FT_DIR || type == FT_FILE || type == FT_LINK; } i.e., per default only directories, normal files and symbolic links are shown (the first argument of the function, the file name, isn't used by the default filter). To change the default filter, use the following routine typedef int (*FL_DIRLIST_FILTER)(const char *, int); FL_DIRLIST_FILTER fl_set_dirlist_filter(FL_DIRLIST_FILTER filter); As noted before, directories are by default not subject to filtering. If, for any reason, it is desirable to filter also directories, use the following routine with a true flag int fl_set_dirlist_filterdir(int flag); The function returns the old setting. Since there is only one filter active at any time in XForms, changing the filter affects all subsequent uses of file browsers. By default, the files returned are sorted alphabetically. You can change the default sorting using the following routine: int fl_set_dirlist_sort(int method); where `method' can be one of the following `FL_NONE' Don't sort the entries `FL_ALPHASORT' Sort the entries in alphabetic order - this is the default `FL_RALPHASORT' Sort the entries in reverse alphabetic order `FL_MTIMESORT' Sort the entries according to the modification time `FL_RMTIMESORT' Sort the entries according to the modification time, but reverse the order, i.e., latest first. `FL_SIZESORT' Sort the entries in increasing size order `FL_RSIZESORT' Sort the entries in decreasing size order `FL_CASEALPHASORT' Sort the entries in alphabetic order with no regard to case `FL_RCASEALPHASORT' Sort the entries in reverse alphabetic order with no regard to case. The function returns the old sort method. For directories having large numbers of files, reading the directory can take quite a long time due to sorting and filtering. Electing not to sort and (to a lesser degree) not to filter the directory entries (by setting the filter to `NULL') can speed up the directory reading considerably.  File: xforms.info, Node: Part II, Next: Part II Introduction, Prev: Part I Goodies, Up: Top _Part II - The Form Designer_ ***************************** * Menu: * Part II Introduction:: * Part II Getting Started:: * Part II Command Line Arguments:: * Part II Creating Forms:: * Part II Saving and Loading Forms:: * Part II Language Filters:: * Part II Generating Hardcopies::  File: xforms.info, Node: Part II Introduction, Next: Part II Getting Started, Prev: Part II, Up: Top 7 Introduction ************** This part of the documentation describes the Form Designer, a GUI builder meant to help you interactively design dialogue forms for use with the Forms Library. This part assumes the reader is familiar with the Forms Library and has read Part I of this document. Even though designing forms is quite easy and requires only a relatively small number of lines of C-code, it can be time consuming to figure out all required positions and sizes of the objects. The Form Designer was written to facilitate the construction of forms. With Form Designer, there is no longer any need to calculate or guess where the objects should be. The highly interactive and WYSIWYG (What You See Is What You Get) nature of the Form Designer relieves the application programmer from the time consuming process of user interface construction so that he/she can concentrate more on what the application program intends to accomplish. Form Designer provides the abilities to interactively place, move and scale objects on a form, also the abilities to set all attributes of an object. Once satisfactory forms are constructed, the Form Designer generates a piece of C-code that can then be included in the application program. This piece of code will contain one procedure create_form_xxx() for each form, where xxx indicates the form name. The application only needs to call it to generate the form designed. The code produced is easily readable. The Form Designer also lets the user identify each object with C variables for later reference in the application program and allows advanced object callback bindings all within the Form Designer. All actions are performed with the mouse or the function keys. It uses a large number of forms itself to let the user make choices, set attributes, etc. Most of these forms were designed using the Form Designer itself. It is important to note that the Form Designer only helps you in designing the layout of your forms. It does not allow you to specify the actions that have to be taken when, e.g., a button is pushed. You can indicate the callback routine to call but the application program has to supply this callback routine. Also, the current version is mostly a layout tool and not a programming environment, not yet anyway. This means that the Form Designer does not allow you to initialize all your objects. You can, however, initialize some objects, e.g., you can set the bounds of a slider inside the Form Designer. Eventually full support of object initialization will be implemented.  File: xforms.info, Node: Part II Getting Started, Next: Part II Command Line Arguments, Prev: Part II Introduction, Up: Top 8 Getting Started ***************** To start up the Form Designer simply type fdesign without any arguments. (If nothing happens, check whether the package has been installed correctly.) A black window (the main window) will appear on the screen. This is the window in which you can create your forms. Next the control panel appears on the screen. No form is shown yet. [image src="xforms_images/fdesign.png"] The control panel consists of five parts. The first part is the menu bar, consisting of several groups of menus from which you can make selections or give commands to the program. Directly below the menu you have a row of buttons for alignment, testing and getting help, see below. Then there's a panel with three browsers. At the left there is a list of all existing forms. When the program is started without an already existing file as an argument the list is empty, indicating that there are no forms yet. There's no upper limit to the number of forms that can be created but you can only work on exactly one form at a time. Use this list to switch between the different forms. Below the forms list is another list showing all groups in the form you're currently working on. It will be empty for a new form because there are no groups yet. Ignore this at the moment as we will come back to groups and their uses later. Just right of those two lists you find a list of all the different classes of objects that can be placed into the form. Use the mouse to select the class of a new object you want to add to the form. On the right side beside the panel with the browsers you find a number of buttons to give commands to the program. Each of these buttons is bound to a function key. You can either press the buttons with the mouse or press the corresponding function keys on the keyboard (while the keyboard focus is on the window with the form). The functions of these keys will be described below. To create a new form select the "New Form" entry in the "Form" menu. A little popup box will appear, prompting you for the name of the new form. This is the name under which the program you're going to write will know the form. Thus you will have to provide a name which must be a legal C variable name. Type in the name and press `'. Now the color of the window for showing the form you're working on changes to that of the default background color of forms. (Actually, each new form gets created with a box already covering its entire area, what you see is the color of this box. You can change most properties of this box using the methods described below. Just its size is fixed to the size of the form, which can be simply changed by resizing the window.) Note that the form's name is added to the list of forms in the control panel. To add an object to the form select its class in the control panel by selecting an item the list of object classes. Then move the mouse into the window with the form you are working on and drag the mouse while pressing the left mouse button. By keeping the mouse button pressed you create a box that has the size of the object to be created. Release the button and the object will appear. Note that a red outline appears around the new object. This indicates that the object is selected. In this way you can put all kinds of objects on the form. Object already created can be modified in several ways. You can move them around, change their sizes or their attributes. To this end first select the object by left-clicking on it. But this only works if there isn't an obkect class selected in the object class browser in the control panel. To get rid of such a selection either click on the selected entry in this browser or by right-click somewhere in the window with the new form. When the object is selected a red outline appears around it. You now will be able to drag the object around with the mouse. By grabbing the object at one of the four red corners you can change its size. It is also possible to select multiple objects and move or scale them simultaneously. See below for details. To change the object's attributes, e.g., its label, simply double-click on it with the left mouse button. Or single-click on it and then press the function key `' (or click on the button labeled "F1 attribs" in the control panel or select "Object attributes" from the "Object" menu). A new form appears in which you can change all the different attributes. Their meanings should be clear (if you have read the documentation on the Forms Library). Change the attributes you want to change and finally press the button labeled "Accept". To reset all attributes to their original values press "Restore" (or "Cancel" if you also want to close the window for modifying the attributes). See below for more information about changing attributes. In this way you can create the forms you want to have. Note that you can have more than one form. Just add another form in the way described above and use the list of forms to switch between them. After you have created all your forms select "Save" or "Save As"from the "File" menu to save them to disk. It will ask you for a file name using the file selector. In this file selector you can walk through the directory tree to locate the place where you want to save the file. Next, you can type in the name of the file (or point to it when you want to overwrite an existing file). The name should end with `.fd'. So for example, choose `ttt.fd'. The program now creates three files: `ttt.c', `ttt.h' and `ttt.fd'. `ttt.c' contains a readable piece of C code that creates the forms you designed. The file `ttt.h' contains the corresponding header file for inclusion in your application program. The file `ttt.fd' contains a description of the forms in such a way that the Form Designer can read it back in later. The application program now simply has to call the routines with names like `create_form_xxx()' (replace `xxx' with the names you gave to the forms) to create the different forms you designed. These are the basic ideas behind the Form Designer. In the following chapters we describe the program in more detail.  File: xforms.info, Node: Part II Command Line Arguments, Next: Part II Creating Forms, Prev: Part II Getting Started, Up: Top 9 Command Line Arguments ************************ To start the Form Designer simply type fdesign [-xformoptions] [-fdesignoptions] [files[.fd]] An initial window will be created and mapped. Depending on the window manager, you may have the option to interactively select where to place the window if the `-geometry' option is not given. Next the program places the control panel on the screen. You can move this panel, if required, to the place you want (you can also change the default placement of the control panel via resources). fdesign accepts all of the XForms command line options as well as the following `-geometry geom' This option specifies the initial placement and size of the working area. `-convert fd-file-list' Normally fdesign does its work interactively. This option causes it to simply read a list of fdesign output files (the `.fd' files) and emit the corresponding C-routines and header files. This can be useful e.g., in automatically compiling packages in Makefiles. Note that the input `.fd' will only be read but never modified when this option is used. `-migrate fd-file-list' When fdesign is invoked with the `-convert' option it just creates new `.c' and `.h' files but leaves the `.fd' files unmodified. In some situations, e.g., if you also want to automatically upgrade `.fd' files created with older versions of fdesign, you can instead use the `-migrate' option which does all what the `-convert' option does but also writes out a new version of the `.fd' file it just read in. It also does a few extra checks, e.g., it will test if XBM and XPM image files used for bitmaps and pixmaps actually exist (if they don't the newly generated `.fd' file won't reference them anymore, so carefully look out for error messages and, if necessary, restore it from the generated `.fd.bak' backup file). `-version' Prints current version and quits. `-help' Prints a brief help message on command line options. `-altformat' Generates an alternative output format. `-border' Forces decorations on some types of windows so that you can move them (only necessary with some window managers). `-unit point|pixel|mm|cp|cmm' Outputs object sizes in units other than pixels. cp and cmm stand for centi-point (1/100 of a point) and centi-mm (1/100 of a milli-meter). For typical displays, pixel and mm are too coarse and subject to round-off errors. `-nocode' Suppresses the output of UI code. Sometimes useful if the UI code is not to be generated interactively, but rather generated by the make process using "fdesign -convert". `-I header' Changes the output include file from `' to header. Per default, the header file name will be enclosed in angle brackets ('`<'' and '`>'') unless the name of the include file specified is already enclosed in double quote ('`"''). Useful on systems where `forms.h' is renamed to something else or if you need an application header file with e.g., definitions of constants/defines for the UI that itself includes the `forms.h' file. `-main' Emits a main program with callback stubs. Can be useful for simple programs. `-callback' Emits callback function template in a separate file. `-lax' Suppresses checking of variable and callback function names for being aceptable C variable names `-bw borderwidth' Changes the default border width of the forms created. Note that `-help', `-version' and `-convert' do not require a connection to an X server. If an output unit other than the default (pixel) is selected, all object sizes in the output file will be in the unit requested. This kind of UI has a fixed and device resolution independent size (in theory at least) and can be useful for drawing applications. fdesign recognizes the following resources: `workingArea.geometry' string Geometry `control.border' bool XForms borderwidth `control.geometry' string Control window geometry (position only) `attributes.geometry' string Attributes window Geometry (position only) `attributes.background'string (e.g., Attributes window background gray80) `align.geometry' string Align window geometry (position only) `help.geometry' string Help window geometry (position only) `convert' bool Convert `unit' string Unit `altformat' bool AltFormat `xformHeader' string Header file name `helpFontSize' int Help font size `main' bool Main Note that resource specification of convert requires an X connection. In addition, all XForms's resources specification can be used to influence the appearance of various panels. The most useful ones are the font sizes `*XForm.FontSize' all label font sizes `XForm.PupFontSize' all pup font sizes  File: xforms.info, Node: Part II Creating Forms, Next: Part II Saving and Loading Forms, Prev: Part II Command Line Arguments, Up: Top 10 Creating Forms ***************** * Menu: * Creating and Changing Forms:: * Adding Objects:: * Selecting Objects:: * Moving and Scaling:: * Aligning Objects:: * Raising and Lowering:: * Setting Attributes:: * Generic Attributes:: * Object Specific Attributes:: * Cut, Copy and Paste: Copy and Paste * Groups:: * Hiding and Showing Objects:: * Testing Forms::  File: xforms.info, Node: Creating and Changing Forms, Next: Adding Objects, Up: Part II Creating Forms 10.1 Creating and Changing Forms ================================ To create a new form use the "New Form" entry in the "Form" menu at the top. When asked for the new form's name enter a (unique) name that is a valid C identifier. The form is shown in the main window and objects can be added to it. There are two ways to change the size of a form. The easiest way is to simply change the size of the main window displaying the form and the form will resize itself to fit the new size. Otherwise you can use the "Resize Form" entry in the "Form" menu, in which case you can enter the width and height of the form manually. To change the name of the current visible form use the "Rename Form" entry in the "Form" menu. You will be prompted for the new form name. To delete a form use the "Delete Form" entry in the "Form" menu . The current form will be removed after a box asking you if you're sure had been shown.  File: xforms.info, Node: Adding Objects, Next: Selecting Objects, Prev: Creating and Changing Forms, Up: Part II Creating Forms 10.2 Adding Objects =================== To add an object choose the class of the new object from the list of object classes in the middle of the control panel. Next drag the left mouse button within the main form. A rubber box outlining the size of the new object will appear. When the size is correct release the mouse button. Note that the position and size of the object is rounded to multiples of 10 pixels per default. How to change the default is described below in the context of alignments.  File: xforms.info, Node: Selecting Objects, Next: Moving and Scaling, Prev: Adding Objects, Up: Part II Creating Forms 10.3 Selecting Objects ====================== To perform operations on objects that are already visible in the form, we first have to select them. Any mouse button can be used for selecting objects. Simply single-click on the object you want to select. A red outline will appear, indicating that the object is selected. Another way of selecting objects is to use the `' or `' keys or the button labeled `F11', all of which iterates over the object list and selects the next object upon each press (the only object not selected this way is the backface object). It is also possible to select multiple objects. To this end draw a box by dragging the mouse around all the objects you want to select. All objects that lie fully inside the box will be selected. Each selected object will get a red outline and a red bounding box is drawn around all of them. To add objects to an already existing selection, hold down the `' key and press the left mouse button inside the object. You can remove objects from the selection by doing the same on an already selected object. It is possible to select all objects (except for the backface object) at once using the function key `'. One note on the backface of the form: Although this is a normal object it can not be treated in the same way as the other objects. It can be selected, but never in combination with other objects. Only changing its attributes is allowed.  File: xforms.info, Node: Moving and Scaling, Next: Aligning Objects, Prev: Selecting Objects, Up: Part II Creating Forms 10.4 Moving and Scaling ======================= To move an object (or a collection of objects) to a new place, first select it (them) as described above. Next press the left mouse button inside the bounding box (not too near to one of the corners) and move the box to its new position. To scale the object or objects, pick up the bounding box near one of its corners (inside the red squares) and scale it by dragging the mouse. When holding the `' key while moving an object or group of objects, first a copy of the object(s) is made and the copy is moved. This allows for a very fast way of duplicating (cloning) objects on the form: First put one on the form, change the attributes as required and next copy it. For precise object movement the cursor keys can be used. Each press of the four directional cursors keys moves the selected object by 10 pixels per default. To change the step sizepress one of the numbers from 0 to 9 with 0 indicating 10 pixels. If the `' key is kept pressed down instead of moving the object its size is increased or decreased by the step size.  File: xforms.info, Node: Aligning Objects, Next: Raising and Lowering, Prev: Moving and Scaling, Up: Part II Creating Forms 10.5 Aligning Objects ===================== Sometimes you have a number of objects and you want to align them in some way, e.g., centered or all starting at the same left position, etc. To this end press the button labeled "Align". A special form will appear in the top right corner. You can leave this form visible as long as you want. You can hide it using the button labeled "Dismiss" on the form or by clicking the "Align" button again. First select the objects you want to align. Next, press one of the alignment buttons in the form. The buttons in the top row have the following meaning: flush left, center horizontally, flush right, and make the objects have equal distances in horizontal direction (see below). The buttons in the bottom row mean: align to bottom, center vertically, align to top, and make all objects have the same vertical distance. Note that alignments are relative to the selection box, not to the form. Equal distance alignment means that between all the objects an equal sized gap is placed. The objects are kept in the same left to right or bottom to top order. [image src="xforms_images/fd_align.png"] The "Undo" button undoes the last alignment change. It is an undo with a depth of 1, i.e., you can only undo the last change and an undo after an undo will undo itself. Note however, that any modification to the selected objects invalidates the undo buffer. In the alignment form you can also indicate the "snapping size" when moving or resizing objects, using the counter at the bottom. Default snapping is 10 pixels. Snapping helps in making objects of the same size and aligning them nicely.  File: xforms.info, Node: Raising and Lowering, Next: Setting Attributes, Prev: Aligning Objects, Up: Part II Creating Forms 10.6 Raising and Lowering ========================= The objects in a form are drawn in the order in which they are added. Sometimes this is undesirable. For example, you might decide at a later stage to put a box around some buttons. Because you add this box later it will be drawn over the buttons, thus hiding the buttons (if you put a framebox over a button, the button will be visible but appears to be inactive!). This is definitely not what you want. The Form Designer makes it possible to raise objects (bring them to the top) or lower them (put them at the bottom). So you can lower e.g., a box to move it under some buttons. Raising or lowering objects is very simple. First select the objects and next press the function key `' to lower the selection or `' to raise it. Another use of raising and lowering is to change the order in which input field receive focus via the `' key. Input fields focus order is the same as the order in which they were added to the form. This can become a problem if another input field is needed after the form is designed because this extra input field will always be the last among all input field on the form. Raising the objects becomes handy to solve this problem. What really happens when a object is raised is that the raised object becomes the last object added to the form. This means you can re-arrange the focus order by raising all input fields one by one in the exact order you want the focus order to be, and they will be added to the form in the order you raised them, thus the input focus order is what you intended.  File: xforms.info, Node: Setting Attributes, Next: Generic Attributes, Prev: Raising and Lowering, Up: Part II Creating Forms 10.7 Setting Attributes ======================= To set attributes like type, color, label, etc., of an object first select it (using the left mouse button) and next press the function key `' (or click on the button labeled "F1"). Also a double click (with the left mouse button) selects the object and opens up the form for changing the objects attributes. If only one object is selected you can change all its attributes, including its label, name, etc. It is also possible to change the attributes of multiple objects as long as they all are of the same object class. In this case you cannot change the labels, names, etc. because you probably want them to remain different for the different objects. The form for changing object attributes allows you to modify all the different settings. Before we continue, the organization of the attributes form and classification of attributes needs a little explanation. Attributes of an object are divided into two categories. The generic attributes are shared by all objects. These include type, colors, label, callback function etc. The other class of attributes are those that are specific to a particular object class, such as slider bounds, precision etc. When the attribute form is first shown, only the generic attributes are shown. Press on the tab rider "Spec" to get to a second form for the object class specific attributes (press the tab rider "Generic" to switch back to the generic attributes part).  File: xforms.info, Node: Generic Attributes, Next: Object Specific Attributes, Prev: Setting Attributes, Up: Part II Creating Forms 10.8 Generic Attributes ======================= The form for setting generic attributes contains four fields for setting different groups of generic properties, discussed in the following. Once you are satisfied with the settings, press the button labeled "Accept" and the form will disappear. If you don't want to change the attributes after all press the button labeled "Cancel". You may also reset the values to what they were when you started editing them by clicking on the "Undo" button. [image src="xforms_images/genattr.png"] * Menu: * Basic Attributes:: * Font:: * Misc. Attributes:: * Colors::  File: xforms.info, Node: Basic Attributes, Next: Font, Up: Generic Attributes 10.8.1 Basic Attributes ----------------------- The basic attributes include the type, boxtype, name, label string, the callback function with its arguments associated with the object and a shortcut. For most object classes several different types exist. The type of the object under consideration can be selected via a choice object. Most objects can also be drawn using different boxtypes. Normally, the default should do, but using the choice object labeled "BoxType" you can switch to a different box type (but note that not all choices may result in a different way the object is drawn and some may look rather ugly). Nearly all objects have a label that can be drawn at different positions within or outside of the object. The input field labeled "Label" lets you set the label string (it may also include return characters, i.e., `\n', for line breaks). An object may have a name by which it can be accessed within the program. This name must be a valid C (or simple C++) variable identifier and can be set via the input field labeled "Name". You need to make sure that there are no objects with the same name! If instead of having e.g., the function `*note fl_do_forms()::' return when an object is triggered a callback may be invoked instead. You can set the name of the callback function in the input field labeled "Callback". Obviously, this must be a valid C or C++ function name. When a callback function is set you must also specify the argument passed to the callback function together with the object's address via the input field labeled "Argument". This normally will be a (long) integer (defaulting to 0 if not specified). Using this value it is e.g., possible to distinguish between different objects when all use the same callback function.  File: xforms.info, Node: Font, Next: Misc. Attributes, Prev: Basic Attributes, Up: Generic Attributes 10.8.2 Font ----------- In the field labeled "Font" you can set properties of the font to be used for the label of the object. You can select between different types of fonts, the style the label is drawn in (normal, shadowed, engraved or embossed) and the size of the font to be used. All three types of properties can be selected via choice objects.  File: xforms.info, Node: Misc. Attributes, Next: Colors, Prev: Font, Up: Generic Attributes 10.8.3 Misc. Attributes ----------------------- The field labeled "Misc. Attributes" allows the setting of a number of attributes that don't fit into any other category. First you can set the alignment of the object's label. It can be placed inside the object or outside of it and in 9 different positions. Use the choice objects labeled "Label/Align" and "In/Out" for this purpose. Another important property of an object is how it reacts if the size of the form it belongs to is changed. It may keep its original size or may be resized in x- or y-direction or both. The details are controlled via its resize and gravity properties as described in chapter 4. With the choice objects labeled "Resize" you can control if an object is to be resized in x- or y-direction or both or none. You may also specify if the object's upper left hand corner or its lower right hand corner is supposed to keep a fixed distance from the form's borders via the choice objects labeled "NW Gravity" and "SE Gravity". Please note that these properties aren't orthogonal, with the NWGravity and SEGravity overriding the resize property if necessary (also see the program `grav' in the `demo' directory that lets you experiment with these properties).  File: xforms.info, Node: Colors, Prev: Misc. Attributes, Up: Generic Attributes 10.8.4 Colors ------------- Within the "Color" field you can set three colors for the object. The colors of the object itself are controlled via the buttons labeled "Color 1" and "Color 2", while the button labeled "LabelColor" is for setting the color the label is drawn in. Clicking on any of the three buttons will result in a new form being shown in which you can select one of the predefined colors from the internal colormap. You also can select one of the "free" colors but since these colors aren't set yet they will appear as black in the form for selecting the color. While it's rather obvious what the label color is, the meaning of "Color 1" and "Color 2" varies a bit with the class and type of the object. E.g., for (normal buttons the first color is the normal color of the button while the second one is the color it's drawn in while the button is pressed, while for a browser that allows selection the first color is the background color and the second color is the color selected lines are highlighted with. Since there are too many combinations of object classes and types to be discussed here comprehensively please refer to a following chapter where the exact properties of all objects are described in detail.  File: xforms.info, Node: Object Specific Attributes, Next: Copy and Paste, Prev: Generic Attributes, Up: Part II Creating Forms 10.9 Object Specific Attributes =============================== Many objects have attributes that are specific to its object class, such as slider bounds, precision etc. You can access these attributes (if existent) via the tab rider labeled "Spec". In most cases the meaning of these attributes hopefully is self-explanatory (otherwise see the detailed description of the different object classes in Part III) and all changes made are shown immediately so you can see what effects the changes have on the object. Once satisfactory results have been achieved the press button labeled "Accept" to accept the settings (clicking on the tab rider "Generic" has the same effect). Two additional buttons, "Cancel" and "Restore", are available to cancel the changes (and quit the attribute settings form) and restore the defaults, respectively. One particular aspect of the pixmap/bitmap button initialization needs a little more explanation as the setting of button labeled "Use data" has no effect on the appearance of the button in fdesign but nonetheless affects the generated code. By default, the "Use data" button is off, indicating the pixmap/bitmap file specified is to be loaded dynamically at run time via `*note fl_set_pixmapbutton_file()::' (or the bitmap counterpart function). If "Use data" is on, the specified file and its associated data will be `#include''d at compile time so the data becomes part of the code. Depending on the application setup, you may choose one method over the other. In general, including the data in the code will make the code slightly larger, but it avoids problems with finding the specified file at runtime. The button labeled "Full Path" only applies if "Use Data" is on. If "Full Path" is also on, the pixmap file will be `#include''d using the full path, otherwise only the filename is used, presumably the compile process will take care of the path via the `-I' flag in some system dependent way.  File: xforms.info, Node: Copy and Paste, Next: Groups, Prev: Object Specific Attributes, Up: Part II Creating Forms 10.10 Cut, Copy and Paste ========================= You can remove objects from the form by first selecting them and then pressing the `' function key or simply by double-clicking on it with the right mouse button. The object(s) will disappear but in fact will be saved in a buffer. You can put it back into the form (or in another form) by pasting, using `'. Note that only the last collection of deleted objects is saved in the buffer. It is also possible to put a copy of the selection (i.e., without removing the original object(s)) into the buffer using `'. The content of the bufer can now be put into the same or another form. This allows for a simple mechanism of making multiple copies of a set of objects and for moving information from one form to another. To clone the currently selected object, hold down the `' key and then drag the selected object to a new position. The cloned object will have exactly the same attributes as the original object except for its name and shortcut keys (would these also be cloned, the generated code would not be compilable or cause runtime misbehavior). When you copy objects belonging to a common group just the individual objects of the group will be copied, but they won't belong to a common group anymore.  File: xforms.info, Node: Groups, Next: Hiding and Showing Objects, Prev: Copy and Paste, Up: Part II Creating Forms 10.11 Groups ============ As described in the tutorial about the Forms Library, sets of radio buttons must be placed inside groups. Groups are also useful for other purposes. E.g., you can hide a group inside an application program with one command. Hence, the Form Designer has some mechanism to deal with groups. In the control panel there is a list of groups in the current form. As long as you don't have groups, this list will be empty. To create a group, select the objects that should become members of the group and press the function key `'. You will be prompted for the name of the group. This should be a legal C variable name (under which the group will be known to the application program) or should be left empty. This name will be added to the list. In this way you can create many groups. Note that each object can be member of only one group. So if you select it again and put it in a new group, it will be removed from its old group. Groups that become empty this way automatically disappear from the list. (When putting objects in a group they will be raised. This is unavoidable due to the structure of groups.) In the list of groups it is always indicated which groups are part of the current selection. (Only the groups that are fully contained in the selection are indicated, not those that are only partially contained in it.) It is also possible to add or delete groups in the current selection by pushing the mouse on their name in the list. A simple click on a groups name will select this group and deselect all objects not belonging to it. Clicking on a groups name while the `' key is pressed down adds the group to the cuurent selection. Note that there is no mechanism to add an object to a group directly. This can, however, be achieved using the following procedure: select the group and the new object and press `' to group them. The old group will be discarded and a new group will be created. You only have to type in the group name again. You can use the menu "Rename group" from the "Group" menu to change the name of a selected group. Only a single group may be selected when changing the name.  File: xforms.info, Node: Hiding and Showing Objects, Next: Testing Forms, Prev: Groups, Up: Part II Creating Forms 10.12 Hiding and Showing Objects ================================ Sometimes it is useful to temporarily hide some objects in your form, in particular when you have sets of overlapping objects. To this end, select the objects you want to hide and press `'. The objects (though still selected) are now invisible. To show them again press `'. A problem might occur here: when you press `' only the selected objects will be shown again. But once an object is invisible it can no longer be selected. Fortunately, you can always use `' to select all objects, including the invisible ones, and then press `'. A possibly better way is to first group the objects before hiding them. Now you can select them by pressing the mouse on the group name in the group browser and then 'unhide' them.  File: xforms.info, Node: Testing Forms, Prev: Hiding and Showing Objects, Up: Part II Creating Forms 10.13 Testing Forms =================== To test the current form, press the button labeled "Test". The form will be displayed in the center of the screen anf a panel appears at the top right corner of the screen. This panel shows you the objects returned and callback routines invoked when working with the form. In this way you can verify whether the form behaves correctly and whether all objects have either callback routines or names (or both) associated with them. You can also resize the form (if the backface of the form allows resizing) to test the gravity and resizing behaviour. You can play with the form as long as you want. When ready, press the "Stop Testing" button. Note that any changes you made to the form while testing (including its size) do not show up when saving the form. E.g., filling in an input field or setting a slider does not mean that in the saved code the input field will be filled in or the slider's preset value.  File: xforms.info, Node: Part II Saving and Loading Forms, Next: Part II Language Filters, Prev: Part II Creating Forms, Up: Top 11 Saving and Loading Forms *************************** To save the set of forms created select the item "Save" or "Save As" from the "File" menu. You will be prompted for a file name using the file selector if the latter is selected. Choose a name that ends with `.fd', e.g., `ttt.fd'. The program will now generate three files: `ttt.c', `ttt.h' and `ttt.fd'. If these files already exist, backup copies of them are made (by appending `.bak' to the already existing file names). `ttt.c' contains a piece of C-code that builds up the forms and `ttt.h' contains all the object and form names as indicated by the user. It also contains declaration of the defined callback routines. Depending on the options selected from the "Options" menu, two more files may be emitted, namely the main program and callback function templates. They are named `ttt_main.c' and `ttt_cb.c' respectively. There are two different kind of formats for the C-code generated. The default format allows more than one instance of the form created and uses no global variables. The other format, activated by the `altformat' option given on the command line or switched on via the "Options" menu by selecting "Alt Format", uses global variables and does not allow more than one instantiation of the designed forms. However, this format has a global routine that creates all the forms defined, which by default is named `create_the_forms()' but that can be changed (see below). Depending on which format is output, the application program typically only needs to include the header file and call the form creation routine. To illustrate the differences between the two output formats and the typical way an application program is setup, we look at the following hypothetical situation: We have two forms, `foo' and `bar', each of which contains several objects, say `fnobj1', `fnobj2' etc. where `n = 1, 2'. The default output format will generate the following header file (`foobar.h'): #ifndef FD_foobar_h_ #define FD_foobar_h_ /* call back routines if any */ extern void callback(FL_OBJECT *, long); typedef struct { FL_FORM * foo; void * vdata; char * cdata; long ldata; FL_OBJECT * f1obj1; FL_OBJECT * f1obj2; } FD_foo; typedef struct { FL_FORM * bar; void * vdata; char * cdata; long ldata; FL_OBJECT * f2obj1; FL_OBJECT * f2obj2; } FD_bar; extern FD_foo *create_form_foo(void); extern FD_bar *create_form_bar(void); #endif /* FD_foobar_h */ and the corresponding C file: #include #include "foobar.h" FD_foo *create_form_foo(void) { FD_foo *fdui = fl_calloc(1, sizeof *fdui); fdui->foo = fl_bgn_form(....); fdui->f1obj1 = fl_add_aaaa(....); fdui->f1obj1 = fl_add_bbbb(....); fl_end_form(); fdui->foo->fdui = fdui; return fdui; } FD_bar *create_form_foo(void) { FD_bar *fdui = fl_calloc(1, sizeof *fdui); fdui->bar = fl_bgn_form(....); fdui->f2obj1 = fl_add_cccc(....); fdui->f2obj2 = fl_add_dddd(....); fl_end_form(); fdui->bar->fdui = fdui; return fdui; } The application program would look something like the following: #include #include "foobar.h" /* add call back routines here */ int main(int argc, char *argv[]) { FD_foo *fd_foo; FD_bar *fd_bar; fl_initialize(...); fd_foo = create_form_foo(); init_fd_foo(fd_foo); /* application UI init routine */ fd_bar = create_form_bar(); init_fd_bar(fd_bar) /* application UI init routine */ fl_show_form(fd_foo->foo, ...); /* rest of the program */ } As you see, `fdesign' generates a structure that groups together all objects on a particular form and the form itself into a structure for easy maintenance and access. The other benefit of doing this is that the application program can create more than one instance of the form if needed. It is difficult to avoid globals in an event-driven callback scheme with most difficulties occurring inside the callback function where another object on the same form may need to be accessed. The current setup makes it possible and relatively painless to achieve this. There are a couple of ways to do this. The easiest and most robust way is to use the member `form->fdui', which fdesign sets up to point to the `FD_' structure of which the form (pointer) is a member. To illustrate how this is done, let's take the above two forms and try to access a different object from within a callback function. fd_foo = create_form_foo(); ... and in the callback function of `ob' on form `foo', you can access other objects as follows: void callback(FL_OBJECT *obj, long data) { FD_foo *fd_foo = obj->form->fdui; fl_set_object_dddd(fd_foo->f1obj2, ....); } Of course this setup still leaves the problems accessing objects on other forms unsolved although you can manually set the `form->u_vdata' to the other `FD_' structure: fd_foo->form->u_vdata = fd_bar; or use the `vdata' field in the `FD_' structure itself: fd_foo->vdata = fd_bar; The other method, not as easy as using `form->fdui' (because you get no help from fdesign), but just as workable, is simply using the `u_vdata' field in the `FD_' structure to hold the address of the object that needs to be accessed. In case of need to access multiple objects, there is a field `u_vdata' in both the `FL_FORM' and `FL_OBJECT' structures you can use. You simply use the field to hold the `FD_' structure: fd_foo = create_form_foo(); fd_foo->foo->u_vdata = fd_foo; ... and in the callback function you can access other objects as follows: void callback(FL_OBJECT *obj, long data) { FD_foo *fd_foo = obj->form->u_vdata; fl_set_object_dddd(fd_foo->f1obj2, ....); } Not pretty, but adequate for practical purposes. Note that the `FD_' structure always has a pointer to the form as the first member, followed by `vdata', `cdata' and `ldata'. There's also a `typedef' for a structure of type `FD_Any' in `forms.h': typedef struct { FL_FORM * form; void * vdata; char * cdata; long ldata; } FD_Any; you can use a cast to a specific `FD_' structure to get at `vdata' etc. Another alternative is to use the `FD_' structure as the user data in the callback(1) fl_set_object_callback(obj, callback, (long) fdui); and use the callback as follows void callback(FL_OBJECT *obj, long arg) { FD_foo *fd_foo = (FD_foo *) arg; fl_set_object_lcolor(fd + foo->f1obj1, FL_RED); ... } Avoiding globals is, in general, a good idea, but as everything else, also an excess of a good things can be bad. Sometimes simply making the `FD_' structure global makes a program clearer and more maintainable. There still is another difficulty that might arise with the current setup. For example, in `f1obj1''s callback we change the state of some other object, say, `f1obj2' via `*note fl_set_button()::' or `*note fl_set_input()::'. Now the state of `f1obj2' is changed and it needs to be handled. You probably don't want to put much code for handling `f1obj2' in `f1obj1''s callback. In this situation, the following function is handy void fl_call_object_callback(FL_OBJECT *obj); `fl_call_object_callback(fdfoo->f1obj2)' will invoke the callback for `f1obj2' callback in exactly the same way the main loop would do and as far as `f1obj2' is concerned, it just handles the state change as if the user changed it. The alternative format outputs something like the following: /* callback routines */ extern void callback(FL_OBJECT *, long); extern FL_FORM *foo, *bar; extern FL_OBJECT *f1obj1, *f1obj2, ...; extern FL_OBJECT *f2obj1, *f2obj2, ...; extern void create_form_foo(void); extern create_form_bar(void); extern void create_the_forms(void); The C-routines: FL_FORM *foo, *bar; FL_OBJECT *f1obj1, *f1obj2, ...; FL_OBJECT *f2obj1, *f2obj2, ...; void create_form_foo(void) { if (foo) return; foo = fl_bgn_form(....); ... } void create_form_bar(void) { if (bar) return; bar = fl_bgn_form(....); ... } void create_the_forms(void) { create_form_foo(); create_form_bar(); } Normally the application program would look something like this: #include #include "foobar.h" /* Here go the callback routines */ .... int main(int argc, char *argv[]) { fl_initialize(....); create_the_forms(); /* rest of the program follows*/ ... } Note that although the C-routine file in both cases is easily readable, editing it is strongly discouraged. If you were to do so, you will have to redo the changes whenever you call fdesign again to modify the layout. The third file created, `ttt.fd', is in a format that can be read in by the Form Designer. It is easy readable ASCII but you had better not change it because not much error checking is done when reading it in. To load such a file select the "Open" item from the "File" menu. You will be prompted for a file name using the file selector. Press your mouse on the file you want to load and press the button labeled "Ready". The current set of forms will be discarded, and replaced by the new set. You can also merge the forms in a file with the current set. To this end select "Merge" from the "File" menu. ---------- Footnotes ---------- (1) Unfortunately, this scheme isn't legal C as a pointer may be longer than a long, but in practice, it should work out ok on virtually all platforms.  File: xforms.info, Node: Part II Language Filters, Next: Part II Generating Hardcopies, Prev: Part II Saving and Loading Forms, Up: Top 12 Language Filters ******************* *Please note: This chapter is probably completely outdated!* This chapter discusses the language filter support in Form Designer, targeted primarily to the developers of bindings to other language. As of this writing, the authors are aware of the following bindings `ada95' by G. Vincent Castellano `perl' by Martin Bartlett `Fortran' by G. Groten and Anke Haeming `pascal' by Michael Van Canneyt `scm/guile' by Johannes Leveling `python' by Roberto Alsina . It would appear that author of python binding is no longer working on it. These bindings are of varying degree of beta-ness and support. It appears to the authors that the most convenient and flexible way of getting output in the targeted language is through external filters that are invoked transparently by fdesign. This way, developers of the binding would have complete control over the translation of the default output from the fdesign to the target language and at the same time have the translation done transparently. * Menu: * External Filters:: * Command Line Arguments of the Filter::  File: xforms.info, Node: External Filters, Next: Command Line Arguments of the Filter, Up: Part II Language Filters 12.1 External Filters ===================== An external filter is a stand-alone program that works on the output of Form Designer and translates the output to the target language. The filter can elect to work on the `.fd' or the C output or both simultaneously. However, in non-testing situations, the c output from Form Designer probably should be deleted by the filter once the translation is complete. By default, Form Designer only outputs the `.fd' and C files. If the presence of `-ada', `-perl', `-python', `-fortran', `-pascal' or `-scm' command line options to Form Designer is detected, then after emitting the default output, Form Designer invokes the the external filter with the root filename (without the `.fd' extension) as an argument, together with possible other flags, to the filter. Any runtime error messages are presented to the user in a browser. The filter name by default is `fd2xxxx' where `xxxx' is the language name (such as `fd2perl' etc.), which can be changed using the `-filter' command line option (or equivalent resources). The resources that are relevant to the filter are listed below Resource Type Default language string C filter string None  File: xforms.info, Node: Command Line Arguments of the Filter, Prev: External Filters, Up: Part II Language Filters 12.2 Command Line Arguments of the Filter ========================================= Form Designer passes along the options that affect the output format to the filter. These options may or may not apply to the filter, most likely not if the filter works on the C file. For those that do not apply, the filter can simply ignore them, but shouldn't stop running because of these options. `-callback' callback stubs are generated `-main' main stub is generated `-altformat' output in alternate format `-compensate' emit size compensation code  File: xforms.info, Node: Part II Generating Hardcopies, Next: Part III, Prev: Part II Language Filters, Up: Top 13 Generating Hardcopies ************************ A variety of tools are available that can be used to turn your carefully constructed (and hopefully pleasing) user interfaces into printed hardcopies or something appropriate for inclusion in your program document. Most of these involves saving a snapshot of your interface on the screen into a file. Then this file is translated into something that a printer can understand, such as `PostScript'. Another approach is to design the printing capabilities into the objects themselves so the GUI is somewhat output device independent in that it can render to different devices and X or the printer is just one of the devices. While this approach works better than screen snapshot, in general, it bloats the library unnecessarily. It is our observation that most of the time when a hardcopy of the interface is desired, it is for use in the application documentation. Thus we believe that there are ways to meet the needs of wanting hardcopies without bloating the library. Of course, some object classes, such as xyplot, charts and possibly canvas (if vector graphics), that are dynamic in nature, probably should have some hardcopy output support in the library, but even then, the relevant code should only be loaded when these specific support is actually used. This fattening problem is becoming less troublesome as computers get faster and typically have more RAMs nowadays. `fd2ps' was designed to address the need of having a hardcopy of the interface for application documentation development. Basically, `fd2ps' is a translator that translates the Form Designer output directly into `PostScript' or `Encapsulated PostScript' in full vector graphics. The result is a small, maybe even editable, `PostScript' file that you can print on a printer or include into other documents. The translation can be done in two ways. One way is to simply give the Form Designer the command line option `-ps' to have it output `PostScript' directly. or you can run `fd2ps' stand alone using the command fd2ps fdfile where `fdfile' is the Form Designer output with or without the `.fd' extension. The output is written into a file named `fdfile.ps'. `fd2ps' accepts the following command line options when run as a stand-alone program `-h' This option prints a brief help message. `-p' This option requests Portrait output. By default, the orientation is switched to landscape automatically if the output would not fit on the page. This option overrides the default. `-l' This option requests landscape orientation. `-gray' This option requests all colors be converted to gray levels. By default, `fd2ps' outputs colors as specified in the `.fd' file. `-bw width' This option specifies the object border width. By default, the border width specified in the `.fd' file is used. `-dpi res' This option specifies the screen resolution on which the user interface was designed. You can use this flag to enlarge or shrink the designed size by giving a DPI value smaller or larger than the actual screen resolution. The default DPI is 85. If the `.fd' file is specified in device independent unit (point, mm etc), this flag has no effect. Also this flag does not change text size. `-G gamma' This option specifies a value (gamma) that will be used to adjust the builtin colors. The larger the value the brighter the colors. The default gamma is 1. `-rgb file' The option specifies the path to the colorname database `rgb.txt'. (It is used in parsing the colornames in XPM file). The default is `/usr/lib/X11/rgb.txt'. The environment variable `RGBFile' can be used to change this default. `-pw width' This option changes the paper width used to center the GUI on a printed page. By default the width is that of US Letter (i.e., 8.5 inches) unless the environment variable `PAPER' is defined. `-ph height' This option changes the paper height used to center the output on the printed page. The default height is that of US Letter (i.e., 11 inches) unless the environment variable `PAPER' is defined. `-paper format' This option specifies one of the standard paper names (thus setting the paper width and height simultaneously). The current understood paper formats are Letter 8.5 x 11 inch. Legal 8.5 x 14 inch A4 210 x 295mm B4 257 x 364mm B5 18 x 20 cm B 11 x 17 inch Note 4 x 5inch The `fd2ps' program understands the environment variable `PAPER', which should be one of the above paper names.  File: xforms.info, Node: Part III, Next: Part III Introduction, Prev: Part II Generating Hardcopies, Up: Top _Part III - Object Classes_ *************************** * Menu: * Part III Introduction:: * Part III Static Objects:: * Part III Button-like Objects:: * Part III Valuator Objects:: * Part III Input Objects:: * Part III Choice Objects:: * Part III Container Objects:: * Part III Other Objects:: * Part III Popups:: * Part III Deprecated Objects::  File: xforms.info, Node: Part III Introduction, Next: Part III Static Objects, Prev: Part III, Up: Top 14 Introduction *************** This part describes all different object classes that are available in the Forms Library. All available object classes are summarized in a table below. For each class there is a section in this document that describes it. The section starts with a short description of the object, followed by the routine(s) to add it to a form. For (almost) all classes this routine has the same form FL_OBJECT *fl_add_CLASS(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); Here `type' is the type of the object in its class. Most classes have many different types. They are described in the section. `x', `y', `w' and `h' give the left upper corner and the width and height of the bounding box of the object. `label' is the label that is placed inside or next to the object. For each object class the default placement of the label is described. When the label starts with the character `@' the label is not printed but replaced by a symbol instead. For each object class there is also a routine FL_OBJECT *fl_create_CLASS(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); that only creates the object but does not put it in the form. This routine is useful for building hierarchical object classes. The routine is not described in the following sections. An important aspect of objects is how interaction is performed with them. First, there is the way in which the user interacts with the object, and second there's the question under which circumstances an object changes its state and how this is returned to the application program. All this is described in detail in the following sections. Object attributes can be divided into generic and object specific ones. For generic attributes (e.g., the object label size), the routines that change them always start with `fl_set_object_xxx()' where `xxx' is the name of the attribute. When a specific object is created and added to a form, it inherits many aspects of the generic object or initializes the object attributes to its needed defaults. Object classes can be roughly divided into static object classes (Box, Frame, LabelFrame, Text, Bitmap, Pixmap, Clock and Chart), Buttons, valuator objects classes (Slider, Scrollbar, Dial, Positioner, Counter, Thumbwheel), Inputs, choice object classes (Menu, Choice, Browser), container object classes (Tabbed Folder, Form Browser, Menu bar) and, finally, other object classes (Timer, XYPlot, Canvas, Popup). Box Rectangular areas to visually group objects. Frame A box with an empty inside region. LabelFrame A frame with label on the frame. Text Simple one line labels. Bitmap Displays an X11 bitmap. Pixmap Displays a pixmap using the XPM library. Clock A clock. Chart Bar-charts, pie-charts, strip-charts, etc. Button Many different kinds and types of buttons that the user can push. Slider ValSlider Both vertical and horizontal sliders to let the user indicate some float value, possibly with a field showing the currently set value. Scrollbar Sliders plus two directional buttons. Dial A dial to let the user indicate a float value. Positioner Lets the user indicate an (x, y) position with the mouse. Counter A different way to let a user step through values. Thumbwheel Rolling a wheel to indicate float values. Input Lets the user type in an input string. Menu Both pop-up and drop-down menus can be created. Choice Can be used to let the user make a choice from a set of items. Browser A text browser with a slider. Can be used for making selections from sets of choices. Folder A (tabbed) folder is a compound object capable of holding multiple groups of objects. FormBrowser A browser you can drop forms into. Timer A timer that runs from a set time towards 0. Can e.g., be used to do default actions after some time has elapsed. XYPlot Shows simple 2D xy-plot from a tabulated function or a datafile. Data points can be interactively manipulated and retrieved. Canvas Canvases are managed plain X windows. It differs from a raw application window only in the way its geometry is managed, not in the way various interaction is set up. Popups Popup are mostly used by menus and choices, but they can also be used stand-alone to isplay context menus etc. Thus, in the following sections, only the object specific routines are documented. Routines that set generic object attributes are documented in Part V. When appropriate, the effect of certain (generic) attributes of the objects on the specific object is discussed. In particular, it is described what effect the routine `*note fl_set_object_color()::' has on the appearance of the object. Also some remarks on possible boxtypes are made.  File: xforms.info, Node: Part III Static Objects, Next: Part III Button-like Objects, Prev: Part III Introduction, Up: Top 15 Static Objects ***************** * Menu: * Box Object: Box Object * Frame Object: Frame Object * LabelFrame Object: LabelFrame Object * Text Object: Text Object * Bitmap Object: Bitmap Object * Pixmap Object: Pixmap Object * Clock Object: Clock Object * Chart Object: Chart Object  File: xforms.info, Node: Box Object, Next: Frame Object, Up: Part III Static Objects 15.1 Box Object =============== Boxes are simply used to give the dialogue forms a nicer appearance. They can be used to visually group other objects together. The bottom of each form is a box. * Menu: * Adding Box Objects: Adding Box Objects * Box Types: Box Types * Box Attributes: Box Attributes * Remarks: Box Remarks  File: xforms.info, Node: Adding Box Objects, Next: Box Types, Up: Box Object 15.1.1 Adding Box Objects ------------------------- To add a box to a form you use the routine FL_OBJECT *fl_add_box(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); The meaning of the parameters is as usual. The label is per default placed in the center of the box.  File: xforms.info, Node: Box Types, Next: Box Attributes, Prev: Adding Box Objects, Up: Box Object 15.1.2 Box Types ---------------- The following types are available: `FL_UP_BOX' A box that comes out of the screen. ``FL_DOWN_BOX'' A box that goes down into the screen. `FL_FLAT_BOX' A flat box without a border. `FL_BORDER_BOX' A flat box with just a border. `FL_FRAME_BOX' A flat box with an engraved frame. `FL_SHADOW_BOX' A flat box with a shadow. `FL_ROUNDED_BOX' A rounded box. `FL_RFLAT_BOX' A rounded box without a border. `FL_RSHADOW_BOX' A rounded box with a shadow. `FL_OVAL_BOX' An elliptic box. `FL_NO_BOX' No box at all, only a centered label.  File: xforms.info, Node: Box Attributes, Next: Box Remarks, Prev: Box Types, Up: Box Object 15.1.3 Box Attributes --------------------- The first color argument (`col1') to `*note fl_set_object_color()::' controls the color of the box, the second (`col2') is not used.  File: xforms.info, Node: Box Remarks, Prev: Box Attributes, Up: Box Object 15.1.4 Remarks -------------- No interaction takes place with boxes. Do not use `FL_NO_BOX' type if the label is to change during the execution of the program.  File: xforms.info, Node: Frame Object, Next: LabelFrame Object, Prev: Box Object, Up: Part III Static Objects 15.2 Frame Object ================= Frames are simply used to give the dialogue forms a nicer appearance. They can be used to visually group other objects together. Frames are almost the same as a box, except that the interior of the bounding box is not filled. Use of frames can speed up drawing in certain situations. For example, to place a group of radio buttons within an `FL_ENGRAVED_FRAME'. If we were to use an `FL_FRAME_BOX' to group the buttons, visually they would look the same. However, the latter is faster as we don't have to fill the interior of the bounding box and can also reduce flicker. Frames are useful in decorating free objects and canvases. * Menu: * Adding Frame Objects: Adding Frame Objects * Frame Types: Frame Types * Frame Attributes: Frame Attributes * Remarks: Frame Remarks  File: xforms.info, Node: Adding Frame Objects, Next: Frame Types, Up: Frame Object 15.2.1 Adding Frame Objects --------------------------- To add a frame to a form you use the routine FL_OBJECT *fl_add_frame(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); The meaning of the parameters is as usual except that the frame is drawn outside of the bounding box (so a flat box of the same size just fills the inside of the frame without any gaps). The label is by default placed centered inside the frame.  File: xforms.info, Node: Frame Types, Next: Frame Attributes, Prev: Adding Frame Objects, Up: Frame Object 15.2.2 Frame Types ------------------ The following types are available: `FL_NO_FRAME' Nothing is drawn. `FL_UP_FRAME' A frame appears coming out of the screen. `FL_DOWN_FRAME' A frame that goes down into the screen. `FL_BORDER_FRAME' A frame with a simple outline. `FL_ENGRAVED_FRAME' A frame appears to be engraved. `FL_EMBOSSED_FRAME' A frame appears embossed. `FL_ROUNDED_FRAME' A rounded frame. `FL_OVAL_FRAME' An elliptic box.  File: xforms.info, Node: Frame Attributes, Next: Frame Remarks, Prev: Frame Types, Up: Frame Object 15.2.3 Frame Attributes ----------------------- The first color argument (`col1') of `*note fl_set_object_color()::' controls the color of the frame if applicable, the second (`col2') is not used. The boxtype attribute does not apply to the frame class.  File: xforms.info, Node: Frame Remarks, Prev: Frame Attributes, Up: Frame Object 15.2.4 Remarks -------------- No interaction takes place with frames. It may be faster to use frames instead of boxes for text that is truly static. See `freedraw.c' for an example use of frame objects.  File: xforms.info, Node: LabelFrame Object, Next: Text Object, Prev: Frame Object, Up: Part III Static Objects 15.3 LabelFrame Object ====================== A label frame is almost the same as a frame except that the label is placed on the frame (See Fig. 15.1) instead of inside or outside of the bounding box as in a regular frame. * Menu: * Adding LabelFrame Objects: Adding LabelFrame Objects * LabelFrame Types: LabelFrame Types * LabelFrame Attributes: LabelFrame Attributes * Remarks: LabelFrames Remarks  File: xforms.info, Node: Adding LabelFrame Objects, Next: LabelFrame Types, Up: LabelFrame Object 15.3.1 Adding LabelFrame Objects -------------------------------- To add a labelframe to a form you use the routine FL_OBJECT *fl_add_labelframe(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); The meaning of the parameters is as usual except that the frame is drawn outside of the bounding box (so a flat box of the same size just fills the inside of the frame without any gaps). The label is by default placed on the upper left hand part of the frame. Its position can changed (within limits) via calls of `*note fl_set_object_lalign()::'. [image src="xforms_images/labelframe.png"]  File: xforms.info, Node: LabelFrame Types, Next: LabelFrame Attributes, Prev: Adding LabelFrame Objects, Up: LabelFrame Object 15.3.2 LabelFrame Types ----------------------- The following types are available: `FL_NO_FRAME' Nothing is drawn. `FL_UP_FRAME' A frame appears coming out of the screen. `FL_DOWN_FRAME' A frame that goes down into the screen. `FL_BORDER_FRAME' A frame with a simple outline. `FL_ENGRAVED_FRAME' A frame appears to be engraved. `FL_EMBOSSED_FRAME' A frame appears embossed. `FL_ROUNDED_FRAME' A rounded frame. `FL_OVAL_FRAME' An elliptic box.  File: xforms.info, Node: LabelFrame Attributes, Next: LabelFrames Remarks, Prev: LabelFrame Types, Up: LabelFrame Object 15.3.3 Attributes ----------------- The first color in the call of `*note fl_set_object_color()::' controls the color of the frame if applicable. The second color controls the background color of the label. Boxtype attribute does not apply to the labelframe class  File: xforms.info, Node: LabelFrames Remarks, Prev: LabelFrame Attributes, Up: LabelFrame Object 15.3.4 Remarks -------------- No interaction takes place with labelframes. You can not draw a label inside or outside of the frame box. If you try, say, by requesting `FL_ALIGN_CENTER', the label is drawn using `FL_ALIGN_TOP_LEFT'.  File: xforms.info, Node: Text Object, Next: Bitmap Object, Prev: LabelFrame Object, Up: Part III Static Objects 15.4 Text Object ================ Text objects simply consist of a label possibly placed in a box. * Menu: * Adding Text Objects: Adding Text Objects * Text Types: Text Types * Text Attributes: Text Attributes * Remarks: Text Remarks  File: xforms.info, Node: Adding Text Objects, Next: Text Types, Up: Text Object 15.4.1 Adding Text Objects -------------------------- To add a text to a form you use the routine FL_OBJECT *fl_add_text(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); The meaning of the parameters is as usual. The label is by default placed flushed left in the bounding box.  File: xforms.info, Node: Text Types, Next: Text Attributes, Prev: Adding Text Objects, Up: Text Object 15.4.2 Text Types ----------------- Only one type of text exists: `FL_NORMAL_TEXT'.  File: xforms.info, Node: Text Attributes, Next: Text Remarks, Prev: Text Types, Up: Text Object 15.4.3 Text Attributes ---------------------- To set or change the text shown, use `*note fl_set_object_label()::' or `*note fl_set_object_label_f()::'. Any boxtype can be used for text. The first color argument (`col1') of `*note fl_set_object_color()::' controls the color of the box the text is placed into, the second (`col2') is not used. The color of the text itself is controlled by calls of `*note fl_set_object_lcolor()::' as usual. If the text is to change dynamically, boxtype `NO_BOX' should not be used for the object.  File: xforms.info, Node: Text Remarks, Prev: Text Attributes, Up: Text Object 15.4.4 Remarks -------------- No interaction takes place with text objects. Don't use boxtype `FL_NO_BOX' if the text is to change dynamically. Note that there is almost no difference between a box with a label and a text. The only difference lies in the position where the text is placed and the fact that text is clipped to the bounding box. Text is normally placed inside the box at the left side. This helps you putting different lines of text below each other. Labels inside boxes are default centered in the box. You can change the position of the text inside the box using the routine `*note fl_set_object_lalign()::'. In contrast to boxes different alignments for text always place the text inside the box rather than outside the box.  File: xforms.info, Node: Bitmap Object, Next: Pixmap Object, Prev: Text Object, Up: Part III Static Objects 15.5 Bitmap Object ================== A bitmap is a simple bitmap shown on a form. * Menu: * Adding Bitmap Objects: Adding Bitmap Objects * Bitmap Types: Bitmap Types * Bitmap Interaction: Bitmap Interaction * Other Bitmap Routines: Other Bitmap Routines * Bitmap Attributes: Bitmap Attributes * Remarks: Bitmap Remarks  File: xforms.info, Node: Adding Bitmap Objects, Next: Bitmap Types, Up: Bitmap Object 15.5.1 Adding Bitmap Objects ---------------------------- To add a bitmap to a form you use the routine FL_OBJECT *fl_add_bitmap(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); The meaning of the parameters is as usual. The label is by default placed below the bitmap. The bitmap is empty on creation.  File: xforms.info, Node: Bitmap Types, Next: Bitmap Interaction, Prev: Adding Bitmap Objects, Up: Bitmap Object 15.5.2 Bitmap Types ------------------- Only the type `FL_NORMAL_BITMAP' is available.  File: xforms.info, Node: Bitmap Interaction, Next: Other Bitmap Routines, Prev: Bitmap Types, Up: Bitmap Object 15.5.3 Bitmap Interaction ------------------------- No interaction takes place with a bitmap. For bitmaps that interact see *note Adding Button Objects::, on how to create a button with a bitmap on top of it. (You can also place a hidden button over it if you want something to happen when pressing the mouse on a static bitmap.)  File: xforms.info, Node: Other Bitmap Routines, Next: Bitmap Attributes, Prev: Bitmap Interaction, Up: Bitmap Object 15.5.4 Other Bitmap Routines ---------------------------- To set the actual bitmap being displayed use void fl_set_bitmap_data(FL_OBJECT *obj, int w, int h, unsigned char *bits); void fl_set_bitmap_file(FL_OBJECT *obj, const char *file); `bits' contains the bitmap data as a character string. `file' is the name of the file that contains the bitmap data. A number of bitmaps can be found in `/usr/include/X11/bitmaps' or similar places. The X program `bitmap' can be used to create bitmaps. Two additional routines are provided to make a Bitmap from a bitmap file or data Pixmap fl_read_bitmapfile(Window win, const char *filename, unsigned *width, unsigned *height, int *hotx, int *hoty) Pixmap fl_create_from_bitmapdata(Window win, const char *data, int width, int height); where `win' is any window ID in your application and the other parameters have the obvious meanings. If there is no window created yet, the return value of `*note fl_default_window()::' may be used. Note: bitmaps created by the above routines have a depth of 1 and should be displayed using `XCopyPlane()'.  File: xforms.info, Node: Bitmap Attributes, Next: Bitmap Remarks, Prev: Other Bitmap Routines, Up: Bitmap Object 15.5.5 Bitmap Attributes ------------------------ The label color as set by `*note fl_set_object_lcolor()::' controls both the foreground color of the bitmap and the color of the label (i.e., they are always identical). The first color argument (`col1') to `*note fl_set_object_color()::' sets the background color of the bitmap (and the color of the box), the second (`col2') is not used.  File: xforms.info, Node: Bitmap Remarks, Prev: Bitmap Attributes, Up: Bitmap Object 15.5.6 Remarks -------------- See `demo33.c' for a demo of a bitmap.  File: xforms.info, Node: Pixmap Object, Next: Clock Object, Prev: Bitmap Object, Up: Part III Static Objects 15.6 Pixmap Object ================== A pixmap is a simple pixmap (color icon) shown on a form. * Menu: * Adding Pixmap Objects: Adding Pixmap Objects * Pixmap Types: Pixmap Types * Pixmap Interaction: Pixmap Interaction * Other Pixmap Routines: Other Pixmap Routines * Pixmap Attributes: Pixmap Attributes * Remarks: Pixmap Remarks  File: xforms.info, Node: Adding Pixmap Objects, Next: Pixmap Types, Up: Pixmap Object 15.6.1 Adding Pixmap Objects ---------------------------- To add a pixmap to a form use the routine FL_OBJECT *fl_add_pixmap(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) The meaning of the parameters is as usual. The label is by default placed below the pixmap. The pixmap is empty on creation.  File: xforms.info, Node: Pixmap Types, Next: Pixmap Interaction, Prev: Adding Pixmap Objects, Up: Pixmap Object 15.6.2 Pixmap Types ------------------- Only the type `FL_NORMAL_PIXMAP' is available.  File: xforms.info, Node: Pixmap Interaction, Next: Other Pixmap Routines, Prev: Pixmap Types, Up: Pixmap Object 15.6.3 Pixmap Interaction ------------------------- No interaction takes place with a pixmap. For pixmap that interacts see *note Adding Button Objects::, on how to create a button with a pixmap on top of it. (You can also place a hidden button over it if you want something to happen when pressing the mouse on a static pixmap.)  File: xforms.info, Node: Other Pixmap Routines, Next: Pixmap Attributes, Prev: Pixmap Interaction, Up: Pixmap Object 15.6.4 Other Pixmap Routines ---------------------------- A pixmap file (usually with extension `.xpm') is an ASCII file that contains the definition of the pixmap as a `char' pointer array that can be included directly into a C (or C++) source file. To set the actual pixmap being displayed, use one of the following routines: void fl_set_pixmap_file(FL_OBJECT *obj, const char *file); void fl_set_pixmap_data(FL_OBJECT *obj, char **data); In the first routine, you specify the pixmap by the filename `file' that contains it. In the second routine, you `#include' the pixmap at compile time and use the pixmap data (an array of `char' pointers) directly. Note that both of these functions do not free the old pixmaps associated with the object. If you're writing a pixmap browser type applications, be sure to free the old pixmaps by calling void fl_free_pixmap_pixmap(FL_OBJECT *obj); on the pixmap object prior to calling these two routines. This function, in addition to freeing the pixmap and the mask, also frees the colors the pixmap allocated. To obtain the pixmap ID currently being displayed, the following routine can be used Pixmap fl_get_pixmap_pixmap(FL_OBJECT *obj, Pixmap *id, Pixmap *mask); In some situations, you might already have a pixmap resource ID, e.g., from `*note fl_read_pixmapfile()::' (see below in the "Remarks" subsection). Then you can use the following routine to change the the pixmap void fl_set_pixmap_pixmap(FL_OBJECT *obj, Pixmap id, Pixmap mask); where `mask' is used for transparency (see `*note fl_read_pixmapfile()::'). Use 0 for mask if no special clipping attributes are desired. This routine does not free the pixmap ID nor the mask already associated with the object. Thus if you no longer need the old pixmaps, they should be freed prior to changing the pixmaps using the function `*note fl_free_pixmap_pixmap()::'. Pixmaps are by default displayed centered inside the bounding box. However, this can be changed using the following routine void fl_set_pixmap_align(FL_OBJECT *obj, int align, int dx, int dy); where `align' is the same as that used for labels, *note Label Attributes and Fonts:: for a list. `dx' and `dy' are extra margins to leave in addition to the object border width. By default, `dx' and `dy' are set to 3. Note that although you can place a pixmap outside of the bounding box, it probably is not a good idea.  File: xforms.info, Node: Pixmap Attributes, Next: Pixmap Remarks, Prev: Other Pixmap Routines, Up: Pixmap Object 15.6.5 Pixmap Attributes ------------------------ By default if a pixmap has more colors than that available in the colormap, the library will use substitute colors that are judged "close enough". This closeness is defined as the difference between the requested color and the color found being smaller than some pre-set threshold values between 0 and 65535 (0 means exact match). The default thresholds are 40000 for red, 30000 for green and 50000 for blue. To change these defaults, use the following routine void fl_set_pixmap_colorcloseness(int red, int green, int blue);  File: xforms.info, Node: Pixmap Remarks, Prev: Pixmap Attributes, Up: Pixmap Object 15.6.6 Remarks -------------- The following routines may be handy for reading a pixmap file into a pixmap Pixmap fl_read_pixmapfile(Window win, const char *filename, unsigned *width, unsigned *height, Pixmap *shape_mask, int *hotx, int *hoty, FL_COLOR tran); where `win' is the window in which the pixmap is to be displayed. If the window is yet to be created, you can use the default window, returned by a call of `*note fl_default_window()::'. Parameter `shape_mask' is a pointer to an already existing `Pixmap', which, if not `NULL', is used as a clipping mask to achieve transparency. `hotx' and `hoty' are the center of the pixmap (useful if the pixmap is to be used as a cursor). Parameter `tran' is currently not used. If you already have the pixmap data in memory, the following routine can be used Pixmap fl_create_from_pixmapdata(Window win, char **data, unsigned *width, unsigned *height, Pixmap *shape_mask, int *hotx, int *hoty, FL_COLOR tran); All parameters have the same meaning as for `fl_read_pixmapfile'. Note that the Forms Library handles transparency, if specified in the pixmap file or data, for pixmap and pixmapbutton objects. However, when using `*note fl_read_pixmapfile()::' or `*note fl_create_from_pixmapdata()::', the application programmer is responsible to set the clip mask in an appropriate GC. Finally there is a routine that can be used to free a Pixmap void fl_free_pixmap(Pixmap id); You will need the XPM library (version 3.4c or later)m developed by Arnaud Le Hors and Groupe Bull, to use pixmaps. The XPM library is avalialble as a package for most distributions, but can also be obtained from many X mirror sites, e.g., via anonymous FTP from (`ftp://ftp.x.org/contrib/libraries/'. Its home page is `http://old.koalateam.com/lehors/xpm.html'.  File: xforms.info, Node: Clock Object, Next: Chart Object, Prev: Pixmap Object, Up: Part III Static Objects 15.7 Clock Object ================= A clock object simply displays a clock on the form * Menu: * Adding Clock Objects: Adding Clock Objects * Clock Types: Clock Types * Clock Interaction: Clock Interaction * Other Clock Routines: Other Clock Routines * Clock Attributes: Clock Attributes * Remarks: Clock Remarks  File: xforms.info, Node: Adding Clock Objects, Next: Clock Types, Up: Clock Object 15.7.1 Adding Clock Objects --------------------------- To add a clock to a form you use the routine FL_OBJECT *fl_add_clock(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, char label[]) The meaning of the parameters is as usual. The label is placed below the clock by default.  File: xforms.info, Node: Clock Types, Next: Clock Interaction, Prev: Adding Clock Objects, Up: Clock Object 15.7.2 Clock Types ------------------ The following types are available: `FL_ANALOG_CLOCK' An analog clock complete with the second hand. `FL_DIGITAL_CLOCK' A digital clock.  File: xforms.info, Node: Clock Interaction, Next: Other Clock Routines, Prev: Clock Types, Up: Clock Object 15.7.3 Clock Interaction ------------------------ No interaction takes place with clocks.  File: xforms.info, Node: Other Clock Routines, Next: Clock Attributes, Prev: Clock Interaction, Up: Clock Object 15.7.4 Other Clock Routines --------------------------- To get the displayed time (local time as modified by the adjustment described below) use the following routine void fl_get_clock(FL_OBJECT *obj, int *h, int *m, int *s); Upon function return the parameters are set as follows: `h' is between 0-23, indicating the hour, `m' is between 0-59, indicating the minutes, and `s' is between 0-59, indicating the seconds. To display a time other than the local time, use the following routine long fl_set_clock_adjustment(FL_OBJECT *obj, long adj); where `adj' is in seconds. For example, to display a time that is one hour behind the local time, an adjustment of `3600' can be used. The function returns the old adjustment value. By default, the digital clock uses 24hr system. You can switch the display to 12hr system (am-pm) by using the following routine void fl_set_clock_ampm(FL_OBJECT *obj, int yes_no)  File: xforms.info, Node: Clock Attributes, Next: Clock Remarks, Prev: Other Clock Routines, Up: Clock Object 15.7.5 Clock Attributes ----------------------- Never use `FL_NO_BOX' as the boxtype for a digital clock. The first color argument (`col1') of `*note fl_set_object_color()::' controls the color of the background, the second (`col2') is the color of the hands.  File: xforms.info, Node: Clock Remarks, Prev: Clock Attributes, Up: Clock Object 15.7.6 Remarks -------------- See `flclock.c' for an example of the use of clocks. *Note Misc. Functions::, for other time related routines.  File: xforms.info, Node: Chart Object, Prev: Clock Object, Up: Part III Static Objects 15.8 Chart Object ================= The chart object gives you an easy way to display a number of different types of charts like bar-charts, pie-charts, line-charts etc. They can either be used to display some fixed chart or a changing chart (e.g., a strip-chart). Values in the chart can be changed and new values can be added which makes the chart move to the left, i.e., new entries appear at the right and old entries disappear at the left. This can be used to e.g., monitor processes. * Menu: * Adding Chart Objects: Adding Chart Objects * Chart Types: Chart Types * Chart Interaction: Chart Interaction * Other Chart Routines: Other Chart Routines * Chart Attributes: Chart Attributes * Remarks: Chart Remarks  File: xforms.info, Node: Adding Chart Objects, Next: Chart Types, Up: Chart Object 15.8.1 Adding Chart Objects --------------------------- To add a chart object to a form use the routine FL_OBJECT *fl_add_chart(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); It shows an empty box on the screen with the label below it.  File: xforms.info, Node: Chart Types, Next: Chart Interaction, Prev: Adding Chart Objects, Up: Chart Object 15.8.2 Chart Types ------------------ The following types are available: `FL_BAR_CHART' A bar-chart `FL_HORBAR_CHART' A horizontal bar-chart `FL_LINE_CHART' A line-chart `FL_FILLED_CHART' A line-chart but the area below curve is filled `FL_SPIKE_CHART' A chart with a vertical spike for each value `FL_PIE_CHART' A pie-chart `FL_SPECIALPIE_CHART' A pie-chart with displaced first item All charts except pie-charts can display positive and negative data. Pie-charts will ignore values that are less then or equal to 0. The maximum number of values displayed in the chart can be set using the routine `*note fl_set_chart_maxnumb()::'. The argument must be not larger than `FL_CHART_MAX' which currently is 512. Switching between different types can be done without any complications.  File: xforms.info, Node: Chart Interaction, Next: Other Chart Routines, Prev: Chart Types, Up: Chart Object 15.8.3 Chart Interaction ------------------------ No interaction takes place with charts.  File: xforms.info, Node: Other Chart Routines, Next: Chart Attributes, Prev: Chart Interaction, Up: Chart Object 15.8.4 Other Chart Routines --------------------------- There are a number of routines to change the values in the chart and to change its behavior. To clear a chart use the routine void fl_clear_chart(FL_OBJECT *obj); To add an item to a chart use void fl_add_chart_value(FL_OBJECT *obj, double val, const char *text, FL_COLOR col); Here `val' is the value of the item, `text' is the label to be associated with the item (can be empty) and `col' is an index into the colormap (`FL_RED' etc.) that is the color of this item. The chart will be redrawn each time you add an item. This might not be appropriate if you are filling a chart with values. In this case put the calls between calls of `*note fl_freeze_form()::' and `*note fl_unfreeze_form()::'. By default, the label is drawn in a tiny font in black. You can change the font style, size or color using the following routine void fl_set_chart_lstyle(FL_OBJECT *obj, int fontstyle); void fl_set_chart_lsize(FL_OBJECT *obj, int fontsize); void fl_set_chart_lcolor(FL_OBJECT *obj, FL_COLOR color); Note that `*note fl_set_chart_lcolor()::' only affects the label color of subsequent items, not the items already created. You can also insert a new value at a particular place using void fl_insert_chart_value(FL_OBJECT *obj, int index, double val, const char *text, FL_COLOR col); `index' is the index before which the new item should be inserted. The first item is number 1. So, for example, to make a strip-chart where the new value appears at the left, each time insert the new value before index 1. To replace the value of a particular item use the routine void fl_replace_chart_value(FL_OBJECT *obj, int index, double val, const char *text, FL_COLOR col); Here `index' is the index of the value to be replaced. The first value has an index of 1, etc. Normally, bar-charts and line-charts are automatically scaled in the vertical direction such that all values can be displayed. This is often not wanted when new values are added from time to time. To set the minimal and maximal value displayed use the routine void fl_set_chart_bounds(FL_OBJECT *obj, double min, double max)' To return to automatic scaling call it with both `min' and `max' being set to `0.0'. To obtain the current bounds, use the following routine void fl_get_chart_bounds(FL_OBJECT *obj, double *min, double *max)' Also the width of the bars and distance between the points in a line-chart are normally scaled. To change this use void fl_set_chart_autosize(FL_OBJECT *obj, int autosize); with `autosize' being set to false (0). In this case the width of the bars will be such that the maximum number of items fits in the box. This maximal number (defaults to `FL_CHART_MAX') can be changed using void fl_set_chart_maxnumb(FL_OBJECT *obj, int maxnumb); where `maxnumb' is the maximal number of items to be displayed, which may not be larger than `FL_CHART_MAX'.  File: xforms.info, Node: Chart Attributes, Next: Chart Remarks, Prev: Other Chart Routines, Up: Chart Object 15.8.5 Chart Attributes ----------------------- Don't use boxtype `FL_NO_BOX' for a chart object if it changes value. Normally, for bar and line chart a baseline is drawn at 0. This can be switched on and off by the function void fl_set_chart_baseline(FL_OBJECT *ob, int yes_no); The first color argument (`col1') to `*note fl_set_object_color()::' controls the (background) color of the box, the second (`col2') the color of the baseline.  File: xforms.info, Node: Chart Remarks, Prev: Chart Attributes, Up: Chart Object 15.8.6 Remarks -------------- See `chartall.c' and `chartstrip.c' for examples of the use of chart objects.  File: xforms.info, Node: Part III Button-like Objects, Next: Part III Valuator Objects, Prev: Part III Static Objects, Up: Top 16 Button-like Objects ********************** A very important set of object classes are those for buttons. Buttons are placed on the form such that the user can push them with the mouse. The different button classes mostly are distinguished by the way they are displayed. Differences in behaviour can be achieved by using different types for a button: there exist button types that make them return to their normal state when the user releases the mouse, types for buttons that stay pushed until the user pushes them again, a radio button type for buttons that are grouped with other radio buttons and of which only one can be in the on state at a time and a touch button type for buttons that "fire" repeatedly while being pressed. [image src="xforms_images/buttontypes.png"] Also different shapes of buttons exist. Normal buttons are rectangles that come out of the background. When the user pushes them they go into the background (and possibly change color). Lightbuttons have a small light inside them. Pushing these buttons switches the light on. Round buttons are simple circles and, when pushed, a colored circle appears inside of them. Bitmap and pixmap buttons are buttons with an image in addition to a text label. * Menu: * Adding Button Objects: Adding Button Objects * Button Types: Button Types * Button Interaction: Button Interaction * Other Button Routines: Other Button Routines * Button Attributes: Button Attributes * Remarks: Button Remarks  File: xforms.info, Node: Adding Button Objects, Next: Button Types, Up: Part III Button-like Objects 16.1 Adding Button Objects ========================== Adding an object To add buttons use one of the following routines: FL_OBJECT *fl_add_button(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); FL_OBJECT *fl_add_lightbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); FL_OBJECT *fl_add_roundbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); FL_OBJECT *fl_add_round3dbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); FL_OBJECT *fl_add_checkbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); FL_OBJECT *fl_add_bitmapbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); FL_OBJECT *fl_add_pixmapbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); FL_OBJECT *fl_add_labelbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); FL_OBJECT *fl_add_scrollbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); These finctions create buttons of the following classes: `FL_BUTTON' A standard normal button. `FL_LIGHTBUTTON' A button with a small embedded, colored area that changes color when the button is in the on state. `FL_ROUNDBUTTON' A circular button (with a label beside). The inner area of the circle changes color when the button is on. Often used for radio buttons. `FL_ROUND3DBUTTON' Just like the `*note FL_ROUNDBUTTON::' but the circle is dran in a 3D-fashion. `FL_CHECKBUTTON' Button shaped in the form of a rhombus slightly raised above the forms plane when off and slightly embossed (ypically with a different color) when on. `FL_BITMAPBUTTON' Button decorated with a bitmap (often read in from an X bitmap file with extension `xbm') in additional to a label. `FL_PIXMAPBUTTON' Button decorated with a pixmap (often read in from an X pixmap file with extension `xpm') in additional to a label. An additonal pixmap can be set for the case that the mouse hoovers over the button. `FL_LABELBUTTON' A button that does not appear to be a button, only its label is shown, can be used e.g., for hyperlinks. `FL_SCROLLBARBUTTON' A button mostly used at the ends of scrollbars - instead of a label it can only contain a triangle pointing up, down, left or right. The meaning of the parameters is as usual. The label is by default placed inside the button for button and lightbutton. For roundbutton, round3dbutton, bitmapbutton and pixmapbutton, it is placed to the right of the circle and to the bottom of the bitmap/pixmap respectively. For scrollbutton, the label must be of some pre-determined string that indicates the direction of the scroll arrow. xforms-1.2.4/doc/part3_other_objects.texi0000664000175000017500000015256712337325620015405 00000000000000@node Part III Other Objects @chapter Other Objects @ifnottex @menu * Timer Object: Timer Object * XYPlot Object: XYPlot Object * Canvas Object: Canvas Object @end menu @end ifnottex @node Timer Object @section Timer Object Timer objects can be used to make a timer that runs down toward 0 or runs up toward a pre-set value after which it starts blinking and returns itself to the application program. This can be used in many different ways, for example, to give a user a certain amount of time for completing a task, etc. Also hidden timer objects can be created. In this case the application program can take action at the moment the timer expires. For example, you can use this to show a message that remains visible until the user presses the "OK" button or until a certain amount of time has passed. The precision of the timer is not very high. Don't count on anything better than, say, 50 milli-seconds, especially when the system is rather busy. The timer can trigger early by up to @w{10 ms}. Run the demo @file{timerprec.c} for an actual accuracy measurement. @ifnottex @menu * Adding Timer Objects: Adding Timer Objects * Timer Types: Timer Types * Timer Interaction: Timer Interaction * Other Timer Routines: Other Timer Routines * Timer Attributes: Timer Attributes * Remarks: Timer Remarks @end menu @end ifnottex @node Adding Timer Objects @subsection Adding Timer Objects To add a timer to a form you use the routine @findex fl_add_timer() @anchor{fl_add_timer()} @example FL_OBJECT *fl_add_timer(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent The meaning of the parameters is as usual. @node Timer Types @subsection Timer Types There are at the moment three types of timers: @table @code @tindex FL_NORMAL_TIMER @item FL_NORMAL_TIMER Visible, Shows a label in a box which blinks when the timer expires. @tindex FL_VALUE_TIMER @item FL_VALUE_TIMER Visible, showing the time left or the elapsed time. Blinks if the timer expires. @tindex FL_HIDDEN_TIMER @item FL_HIDDEN_TIMER Not visible. @end table @node Timer Interaction @subsection Timer Interaction When a visible timer expires it starts blinking. The user can stop the blinking by pressing the mouse on it or by resetting the timer to 0. The timer object is returned to the application program or its callback called when the timer expired per default. You can also switch off reporting the expiry of the timer by calling @example int fl_set_object_return(FL_OBJECT *obj, unsigned int when) @end example with @code{when} set to @code{@ref{FL_RETURN_NONE}}. To re-enable reporting call it with one of @code{@ref{FL_RETURN_CHANGED}}, @code{@ref{FL_RETURN_END}}, @code{@ref{FL_RETURN_END_CHANGED}} or @code{@ref{FL_RETURN_ALWAYS}}. @node Other Timer Routines @subsection Other Timer Routines To set the timer to a particular value use @findex fl_set_timer() @anchor{fl_set_timer()} @example void fl_set_timer(FL_OBJECT *obj, double delay); @end example @noindent @code{delay} gives the number of seconds the timer should run. Use 0.0 to reset/de-blink the timer. To obtain the time left in the timer use @findex fl_get_timer() @anchor{fl_get_timer()} @example double fl_get_timer(FL_OBJECT *obj); @end example By default, a timer counts down toward zero and the value shown (for @code{FL_VALUE_TIMER}s) is the time left until the timer expires. You can change this default so the timer counts up and shows elapsed time by calling @findex fl_set_timer_countup() @anchor{fl_set_timer_countup()} @example void fl_set_timer_countup(FL_OBJECT *obj, int yes_no); @end example @noindent with a true value for the argument @code{yes_no}. A timer can be temporarily suspended (stopwatch) using the following routine @findex fl_suspend_timer() @anchor{fl_suspend_timer()} @example void fl_suspend_timer(FL_OBJECT *obj); @end example @noindent and later be resumed by @findex fl_resume_timer() @anchor{fl_resume_timer()} @example void fl_resume_timer(FL_OBJECT *obj); @end example @noindent Unlike @code{@ref{fl_set_timer()}} a suspended timer keeps its internal state (total delay, time left etc.), so when it is resumed, it starts from where it was suspended. Finally there is a routine that allows the application program to change the way the time is presented in @code{FL_VALUE_TIMER}: @tindex FL_TIMER_FILTER @findex fl_set_timer_filter() @anchor{fl_set_timer_filter()} @example typedef char *(FL_TIMER_FILTER)(FL_OBJECT *obj, double secs); FL_TIMER_FILTER fl_set_timer_filter(FL_OBJECT *obj, FL_TIMER_FILTER filter); @end example @noindent The function @code{filter} receives the timer ID and the time left for count-down timers and the elapsed time for up-counting timers (in units of seconds) and should return a string representation of the time. The default filter returns the time in a @code{hour:minutes:seconds.fraction} format. @node Timer Attributes @subsection Timer Attributes Never use @code{FL_NO_BOX} as the boxtype for @code{FL_VALUE_TIMER}s. The first color argument (@code{col1}) to @code{@ref{fl_set_object_color()}} controls the color of the timer, the second (@code{col2}) is the blinking color. @node Timer Remarks @subsection Remarks Although having different APIs and the appearance of a different interaction behaviour, the way timers and timeout callbacks work is almost identical with one exception: you can deactivate a timer by deactivating the form it belongs to. While the form is deactivated, the timers callback will not be called, even if it expires. The interaction will only resume when the form is activated again. See @file{timer.c} for the use of timers. @node XYPlot Object @section XYPlot Object A xyplot object gives you an easy way to display a tabulated function generated on the fly or from an existing data file. An active xyplot is also available to model and/or change a function. @ifnottex @menu * Adding XYPlot Objects: Adding XYPlot Objects * XYPlot Types: XYPlot Types * XYPlot Interaction: XYPlot Interaction * Other XYPlot Routines: Other XYPlot Routines * XYPlot Attributes: XYPlot Attributes * Remarks: XYPlot Remarks @end menu @end ifnottex @node Adding XYPlot Objects @subsection Adding XYPlot Objects To add an xyplot object to a form use the routine @findex fl_add_xyplot() @anchor{fl_add_xyplot()} @example FL_OBJECT *fl_add_xyplot(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent It shows an empty box on the screen with the label per default below it. @node XYPlot Types @subsection XYPlot Types The following types are available: @table @code @tindex FL_NORMAL_XYPLOT @anchor{FL_NORMAL_XYPLOT} @item FL_NORMAL_XYPLOT A solid line is drawn through the data points. @tindex FL_SQUARE_XYPLOT @anchor{FL_SQUARE_XYPLOT} @item FL_SQUARE_XYPLOT Data drawn as a solid line plus squares at data points. @tindex FL_CIRCLE_XYPLOT @anchor{FL_CIRCLE_XYPLOT} @item FL_CIRCLE_XYPLOT Data drawn as a solid line plus circles at data points. @tindex FL_FILL_XYPLOT @anchor{FL_FILL_XYPLOT} @item FL_FILL_XYPLOT Data drawn as a solid line with the area under the curve filled. @tindex FL_POINTS_XYPLOT @tindex FL_POINTS_XYPLOT @anchor{FL_POINTS_XYPLOT} Only data points are drawn with. per default, stars. @tindex FL_LINEPOINTS_XYPLOT @anchor{FL_LINEPOINTS_XYPLOT} @item FL_LINEPOINTS_XYPLOT Data drawn as a solid line plus, per default, stars at data point. @tindex FL_DASHED_XYPLOT @anchor{FL_DASHED_XYPLOT} @item FL_DASHED_XYPLOT Data drawn as a dashed line. @tindex FL_DOTTED_XYPLOT @anchor{FL_DOTTED_XYPLOT} @item FL_DOTTED_XYPLOT Data drawn as a dotted line. @tindex FL_DOTDASHED_XYPLOT @anchor{FL_DOTDASHED_XYPLOT} @item FL_DOTDASHED_XYPLOT Data drawn as a dash-dot-dash line. @tindex FL_IMPULSE_XYPLOT @anchor{FL_IMPULSE_XYPLOT} @item FL_IMPULSE_XYPLOT Data drawn by vertical lines. @tindex FL_ACTIVE_XYPLOT @anchor{FL_ACTIVE_XYPLOT} @item FL_ACTIVE_XYPLOT Data drawn as a solid line plus squares at data points, accepting manipulations. @tindex FL_EMPTY_XYPLOT @anchor{FL_EMPTY_XYPLOT} @item FL_EMPTY_XYPLOT Only the axes are drawn. @end table All xyplots per default display the curve auto-scaled to fit the plotting area. Although there is no limitation on the actual data, a non-monotonic increasing (or decreasing) x-axis might be plotted incorrectly. XYPlots of type @code{FL_POINTS_XYPLOT} and @code{FL_LINEPOINTS_XYPLOT} are special in that the application can change the symbol drawn on the data point. @node XYPlot Interaction @subsection XYPlot Interaction Only @code{FL_ACTIVE_XYPLOT} report mouse events by default. Clicking and dragging the data points (marked with little squares) will change the data and result in the object getting returned to the application (or the object's callback getting invoked). By default, the reporting happens only when the mouse is released. In some situations, reporting changes as soon as they happen might be desirable. To control when mouse events are returned use the function @example int fl_set_object_return(FL_OBJECT *obj, unsigned int when); @end example where @code{when} can have the folowing values: @table @code @item @ref{FL_RETURN_NONE} Never return or invoke callback. @item @ref{FL_RETURN_END_CHANGED} Return or invoke callback at end (mouse release) if one of the points has been moved to a different place. This is the default. @item @ref{FL_RETURN_CHANGED} Return or invoke callback whenever a point has been moved. @item @ref{FL_RETURN_END} Return or invoke callback at end (mouse release) regardless if a point has been moved is changed or not. @item @ref{FL_RETURN_ALWAYS} Return or invoke callback when a point has been moved or the mouse button has been release). @end table Please note: an object can also be in inspect mode (see function @code{@ref{fl_set_xyplot_inspect()}} below). In this case the object gets returned (or its callback invoked) for all of the above settings except (@code{@ref{FL_RETURN_NONE}}) when the mouse was released on top of one of the points. To obtain the current value of the point that has changed, use the routine @findex fl_get_xyplot() @anchor{fl_get_xyplot()} @example void fl_get_xyplot(FL_OBJECT *obj, float *x, float *y, int *i); @end example @noindent where via @code{i} the data index (starting from 0) is returned while via @code{x} and @code{y} the actual data point gets returned. If no point has changed @code{i} will be set to -1. It is possible to switch drawing of the squares that mark an active plot on and off (default is on) using the following routine @findex fl_set_xyplot_mark_active() @anchor{fl_set_xyplot_mark_active()} @example void fl_set_xyplot_mark_active(FL_OBJECT *obj, int yes_no); @end example @noindent with @code{yes_no} being set to false (0). To set or replace the data for an xyplot, use @findex fl_set_xyplot_data() @anchor{fl_set_xyplot_data()} @findex fl_set_xyplot_data_double() @anchor{fl_set_xyplot_data_double()} @example void fl_set_xyplot_data(FL_OBJECT *obj, float *x, float *y, int n, const char *title, const char *xlabel, const char *ylabel); void fl_set_xyplot_data_double(FL_OBJECT *obj, double *x, double *y, int n, const char *title, const char *xlabel, const char *ylabel); @end example @noindent (The @code{fl_set_xyplot_data_double()} function allows to pass data of type @code{double} but which get "demoted" to @code{float} type when assigned to the xyplot object.) Here @code{x}, @code{y} is the tabulated function, and @code{n} is the number of data points. If the xyplot object being set already exists old data will be cleared. Note that the tabulated function is copied internally so you can free or do whatever you want with the @code{x} and @code{y} arrays after the function has returned. @code{title} is a title that is drawn above the XYPlot and @code{xlabel} and @code{ylabel} are the labels drawn at the x- and y-axes. You can also load a tabulated function from a file using the routine @findex fl_set_xyplot_file() @anchor{fl_set_xyplot_file()} @example int fl_set_xyplot_file(FL_OBJECT *obj, const char *filename, const char *title, const char *xlabel, const char *ylabel); @end example @noindent The data file should be an ASCII file consisting of data lines. Each data line must have two columns, indicating the (x,y) pair with a space, tab or comma separating the two columns. Lines that start with any of @code{!}, @code{;} or @code{#} are considered to be comments and are ignored. The functions returns the number of data points successfully read or 0 if the file couldn't be opened. To get a copy of the current XYPLot data, use @findex fl_get_xyplot_data_size() @anchor{fl_get_xyplot_data_size()} @findex fl_get_xyplot_data() @anchor{fl_get_xyplot_data()} @example int fl_get_xyplot_data_size(FL_OBJECT *obj); void fl_get_xyplot_data(FL_OBJECT *obj, float *x, *float y, int *n); @end example @noindent The first function returns the number of data points which the second will return. The caller must supply the space for the data returned by @code{fl_get_xyplot_data()}. The last argument of that function is again the number of points that got returned. All XYPlot objects can be made aware of mouse clicks by using the following routine @findex fl_set_xyplot_inspect() @anchor{fl_set_xyplot_inspect()} @example void fl_set_xyplot_inspect(FL_OBJECT *obj, int yes_no); @end example @noindent Once an XYPlot is in inspect mode, whenever the mouse is released and the mouse position is on one of the data point, the object is returned to the caller or its callback is invoked. You then can use @code{@ref{fl_get_xyplot()}} to find out which point the mouse was clicked on. Note that for an object of type @code{@ref{FL_ACTIVE_XYPLOT}} the data can't be modified while in inspect mode! Another, perhaps even more general, way to obtain the values from an XYPlot is to use a posthandler or an overlay positioner. See demo @file{xyplotall.c} for the use of posthandler and @file{positionerXOR.c} for an example of reading-out xyplot values using an overlayed positioner. @node Other XYPlot Routines @subsection Other XYPlot Routines There are several routines to change the appearance of an XYPlot. First of all, you can change the number of tic marks using the following routine @findex fl_set_xyplot_xtics() @anchor{fl_set_xyplot_xtics()} @findex fl_set_xyplot_ytics() @anchor{fl_set_xyplot_ytics()} @example void fl_set_xyplot_xtics(FL_OBJECT *obj, int major, int minor); void fl_set_xyplot_ytics(FL_OBJECT *obj, int major, int minor); @end example @noindent where @code{major} and @code{minor} are the number of tic marks to be placed on the axis and the number of divisions between major tic marks. In particular, -1 suppresses the tic marks completely while 0 restores the default settings (which is 5 for the major and 2 for the minor tic arguments). Note that the actual scaling routine may choose a value other than that requested if it decides that this would make the plot look nicer, thus @code{major} and @code{minor} are only taken as a hint to the scaling routine. However, in almost all cases the scaling routine will not generate a major tic that differs from the requested value by more than 3. Normally the minor tics of logarithmic scales are drawn equidistant. To have them also drawn logarithmically use the functions @findex fl_set_xyplot_log_minor_xtics() @anchor{fl_set_xyplot_log_minor_xtics()} @findex fl_set_xyplot_log_minor_ytics() @anchor{fl_set_xyplot_log_minor_ytics()} @example int fl_set_xyplot_log_minor_xtics(FL_OBJECT *obj, int yesno); int fl_set_xyplot_log_minor_ytics(FL_OBJECT *obj, int yesno); @end example @noindent With this enabled e.g., the minor tics between 1 and 10 (when the interval is to be divided into 5 subintervals) will be drawn at the positions 2, 4, 6, and 8 instead of at 10^0.2, 10^0.4, 10^0.6 and 10^0.8. The functions return the previous setting. It is possible to label the major tic marks with alphanumerical characters instead of numerical values. To this end, use the following routines @findex fl_set_xyplot_alphaxtics() @anchor{fl_set_xyplot_alphaxtics()} @findex fl_set_xyplot_alphaytics() @anchor{fl_set_xyplot_alphaytics()} @example void fl_set_xyplot_alphaxtics(FL_OBJECT *obj, const char *major, const char *minor); void fl_set_xyplot_alphaytics(FL_OBJECT *obj, const char *major, const char *minor); @end example @noindent where @code{major} is a string specifying the labels with the embedded character @code{|} that specifies major divisions. For example, to label a plot with Monday, Tuesday etc, @code{major} should be given as @code{"Monday|Tuesday|..."}. Parameter @code{minor} is currently unused and the minor divisions are set to 1, i.e, no divisions between major tic marks. Naturally the number of major/minor divisions set by this routine and @code{@ref{fl_set_xyplot_xtics()}} and @code{@ref{fl_set_xyplot_ytics()}} can't be active at the same time and the one that gets used is the one that was set last. The above two functions can also be used to specify non-uniform and arbitary major divisions. To achieve this you must embed the major tic location information in the alphanumerical text. The location information is introduced by the @code{@@} symbol and followed by a float or integer number specifying the coordinates in world coordinates. The entire location info should follow the label. For example, @code{"Begin@@1|3/4@@0.75|1.9@@1.9"} will produce three major tic marks at 0.75, 1.0, and 1.9 with labels "3/4", "begin" and "1.9". To get a gridded XYPlot use the following routines @findex fl_set_xyplot_xgrid() @anchor{fl_set_xyplot_xgrid()} @findex fl_set_xyplot_ygrid() @anchor{fl_set_xyplot_ygrid()} @example void fl_set_xyplot_xgrid(FL_OBJECT *obj, int xgrid); void fl_set_xyplot_ygrid(FL_OBJECT *obj, int ygrid); @end example @noindent where @code{xgrid} and @code{ygrid} can be one of the following @table @code @tindex FL_GRID_NONE @item FL_GRID_NONE No grid. @tindex FL_GRID_MAJOR @item FL_GRID_MAJOR Grid for the major divisions only. @tindex FL_GRID_MINOR @item FL_GRID_MINOR Grid for both the major and minor divisions. @end table The grid line by default is drawn using a dotted line, which you can change using the routine @findex fl_set_xyplot_grid_linestyle() @anchor{fl_set_xyplot_grid_linestyle()} @example int fl_set_xyplot_grid_linestyle(FL_OBJECT *obj, int style); @end example @noindent where @code{style} is the line style (@code{FL_SOLID}, @code{FL_DASH} etc. @xref{Part IV Drawing Objects, , Drawing Objects}, for a complete list). The function returns the old grid linestyle. By default, the plotting area is automatically adjusted for tic labels and titles so that a maximum plotting area results. This can in certain situations be undesirable. To control the plotting area manually, the following routines can be used @findex fl_set_xyplot_fixed_xaxis() @anchor{fl_set_xyplot_fixed_xaxis()} @findex fl_set_xyplot_fixed_yaxis() @anchor{fl_set_xyplot_fixed_yaxis()} @example void fl_set_xyplot_fixed_xaxis(FL_OBJECT *obj, const char *lm, const char *rm) void fl_set_xyplot_fixed_yaxis(FL_OBJECT *obj, const char *bm, const char *tm) @end example @noindent where @code{lm} and @code{rm} specify the right and left margin, respectively, and @code{bm} and @code{tm} the bottom and top margins. The pixel amounts are computed using the current label font and size. Note that even for y-axis margins the length of the string, not the height, is used as the margin, thus to leave space for one line of text, a single character (say @code{m}) or two narrow characters (say @code{ii}) should be used. To restore automatic margin computation, set all margins to @code{NULL}. To change the size of the symbols drawn at data points, use the following routine @findex fl_set_xyplot_symbolsize() @anchor{fl_set_xyplot_symbolsize()} @example void fl_set_xyplot_symbolsize(FL_OBJECT *obj, int size); @end example @noindent where @code{size} should be given in pixels. The default is 4. For @code{FL_POINTS_XYPLOT} and @code{FL_LINEPOINTS_XYPLOT} (main plot or overlay), the application program can change the symbol using the following routine @tindex FL_XYPLOT_SYMBOL @findex fl_set_xyplot_symbol() @anchor{fl_set_xyplot_symbol()} @example typedef void (*FL_XYPLOT_SYMBOL)(FL_OBJECT *, int id, FL_POINT *p, int n, int w, int h); FL_XYPLOT_SYMBOL fl_set_xyplot_symbol(FL_OBJECT *obj, int id, FL_XYPLOT_SYMBOL symbol); @end example @noindent where @code{id} is the overlay id (0 means the main plot, and you can use -1 to indicate all), and @code{symbol} is a pointer to the function that will be called to draw the symbols on the data point. The parameters passed to this function are the object pointer, the overlay @code{id}, the center of the symbol (@code{p->x}, @code{p->y}), the number of data points (@code{n}) and the preferred symbol size (@code{w}, @code{h}). If the type of the XYPlot corresponding to @code{id} is not @code{FL_POINTS_XYPLOT} or @code{FL_LINESPOINTS_XYPLOT}, the function will not be called. To change for example a @code{FL_LINEPOINTS_XYPLOT} XYPlot to plot filled small circles instead of the default crosses, the following code could be used @example void drawsymbol(FL_OBJECT *obj, int id, FL_POINT *p, int n, int w, int h) @{ int r = (w + h) / 4; FL_POINT *ps = p + n; for (; p < ps; p++) fl_circf(p->x, p->y, r, FL_BLACK); @} ... fl_set_xyplot_symbol(xyplot, 0, drawsymbol); ... @end example If a Xlib drawing routine is used it should use the current active window (@code{FL_ObjWin(obj)}) and the current GC. Take care not to call routines inside the @code{drawsymbol()} function that could trigger a redraw of the XYPlot (such as @code{@ref{fl_set_object_color()}}, @code{@ref{fl_set_xyplot_data()}} etc.). To use absolute bounds (as opposed to the bounds derived from the data), use the following routines @findex fl_set_xyplot_xbounds() @anchor{fl_set_xyplot_xbounds()} @findex fl_set_xyplot_ybounds() @anchor{fl_set_xyplot_ybounds()} @example void fl_set_xyplot_xbounds(FL_OBJECT *obj, double min, double max); void fl_set_xyplot_ybounds(FL_OBJECT *obj, double min, double max); @end example @noindent Data that fall outside of the range set this way will be clipped. To restore autoscaling, call the function with @code{max} and @code{min} set to exactly the same value. To reverse the axes (e.g., @code{min} at right and @code{max} at left), set @code{min > max} for that axis. To get the current bounds, use the following routines @findex fl_get_xyplot_xbounds() @anchor{fl_get_xyplot_xbounds()} @findex fl_get_xyplot_ybounds() @anchor{fl_get_xyplot_ybounds()} @example void fl_get_xyplot_xbounds(FL_OBJECT *obj, float *min, float *max); void fl_get_xyplot_ybounds(FL_OBJECT *obj, float *min, float *max); @end example To replace the value of a particular point use the routine @findex fl_replace_xyplot_point() @anchor{fl_replace_xyplot_point()} @example void fl_replace_xyplot_point(FL_OBJECT *obj, int index, double x, double y); @end example @noindent Here @code{index} is the index of the value to be replaced. The first value has an index of 0. It is possible to overlay several plots together by calling @findex fl_add_xyplot_overlay() @anchor{fl_add_xyplot_overlay()} @example void fl_add_xyplot_overlay(FL_OBJECT *obj, int id, float *x, float *y, int npoints, FL_COLOR col); @end example @noindent where @code{id} must be between 1 and @tindex FL_MAX_XYPLOTOVERLAY @code{FL_MAX_XYPLOTOVERLAY} (currently 32). This limit can be raised (or lowered) by calling the function @code{@ref{fl_set_xyplot_maxoverlays()}}. Again, the data are copied to an internal buffer (old data are freed if necessary). As for the base data, a data file can be used to specify the (x,y) function @findex fl_add_xyplot_overlay_file() @anchor{fl_add_xyplot_overlay_file()} @example int fl_add_xyplot_overlay_file(FL_OBJECT *obj, int ID, const char *file, FL_COLOR col); @end example @noindent The function returns the number of data points successfully read. The type (@code{FL_NORMAL_XYPLOT} etc.) used in overlay plot is the same as the object itself. To change an overlay style, use the following call @findex fl_set_xyplot_overlay_type() @anchor{fl_set_xyplot_overlay_type()} @example void fl_set_xyplot_overlay_type(FL_OBJECT *obj, int id, int type); @end example @noindent Note that although the API of adding an overlay is similar to adding an object, an XYPlot overlay is not a separate object. It is simply a property of an already existing XYPlot object. To get the data of an overlay, use the following routine @findex fl_get_xyplot_overlay_data() @anchor{fl_get_xyplot_overlay_data()} @example void fl_get_xyplot_overlay_data(FL_OBJECT *obj, int id, float x[], float y[], int *n); @end example @noindent where @code{id} specifies the overlay number between 1 and @code{FL_MAX_XYPLOTOVERLAY} or the number set via @code{@ref{fl_set_xyplot_maxoverlays()}} (see below). (Actually, when @code{id} is zero, this function returns the base data). The caller must supply the storage space for the data. Upon function return, @code{n} will be set to the number of data points retrieved. Sometimes it may be more convenient and efficient to get the pointer to the data rather than a copy of the data. To this end, the following routine is available @findex fl_get_xyplot_data_pointer() @anchor{fl_get_xyplot_data_pointer()} @example void fl_get_xyplot_data_pointer(FL_OBJECT *obj, int id, float **x, float **y, int *n); @end example @noindent Upon function return, @code{x} and @code{y} are set to point to the data storage. You're free to modify the data and redraw the XYPlot (via @code{@ref{fl_redraw_object()}}). The pointers returned may not be freed. If needed, the maximum number of overlays an object can have (which by default is 32) can be changed using the following routine @findex fl_set_xyplot_maxoverlays() @anchor{fl_set_xyplot_maxoverlays()} @example int fl_set_xyplot_maxoverlays(FL_OBJECT *obj, int maxoverlays); @end example @noindent The function returns the previous maximum number of overlays. If the new number is smaller that what it was before overlays with IDs higher that the previous number are deleted. To obtain the number of data points, use the routine @findex fl_get_xyplot_numdata() @anchor{fl_get_xyplot_numdata()} @example int fl_get_xyplot_numdata(FL_OBJECT *obj, int id); @end example @noindent where @code{id} is the overlay ID (with 0 being the base data set). To insert a point into an xyplot, use the following routine @findex fl_insert_xyplot_data() @anchor{fl_insert_xyplot_data()} @example void fl_insert_xyplot_data(FL_OBJECT *obj, int id, int n, double x, double y); @end example @noindent where @code{id} is the overlay ID; @code{n} is the index of the point after which the data new point specified by @code{x} and @code{y} is to be inserted. Set @code{n} to -1 to insert the point in front. To append to the data, set @code{n} to be equal or larger than the return value of @code{fl_get_xyplot_numdata(obj, id)}. To delete an overlay, use the following routine @findex fl_delete_xyplot_overlay() @anchor{fl_delete_xyplot_overlay()} @example void fl_delete_xyplot_overlay(FL_OBJECT *obj, int id); @end example It is possible to place inset texts on an XYPlot using the following routine (up to @code{FL_MAX_XYPLOTOVERLAY} or the value set via @code{@ref{fl_set_xyplot_maxoverlays()}} of such insets can be accommodated): @findex fl_add_xyplot_text() @anchor{fl_add_xyplot_text()} @example void fl_add_xyplot_text(FL_OBJECT *obj, double x, double y, const char *text, int align, FL_COLOR col); @end example @noindent where @code{x} and @code{y} are the (world) coordinates where text is to be placed and align specifies the placement options relative to the specified point (See @code{@ref{fl_set_object_lalign()}} for valid options). If you for example specify @code{FL_ALIGN_LEFT}, the text will appear on the left of the point and flushed toward the point (see Fig. 21.1). This is mostly consistent with the label alignment except that now the bounding box (of the point) is of zero dimension. Normal text interpretation applies, i.e., if text starts with @code{@@} a symbol is drawn. To remove an inset text, use the following routine @findex fl_delete_xyplot_text() @anchor{fl_delete_xyplot_text()} @example void fl_delete_xyplot_text(FL_OBJECT *obj, const char *text); @end example Another kind of inset is the "keys" to the plots. A key is the combination of drawing a segment of the plot line style with a piece of text that describes what the corrsponding line represents. Obviously, keys are most useful when you have more than one plot (i.e., overlays). To add a key to a particular plot, use the following routine @findex fl_set_xyplot_key() @anchor{fl_set_xyplot_key()} @example void fl_set_xyplot_key(FL_OBJECT *obj, int id, const char *keys); @end example @noindent where @code{id} again is the overlay ID. To remove a key, set the key to @code{NULL}. All the keys will be drawn together inside a box. The position of the keys can be set via @findex fl_set_xyplot_key_position() @anchor{fl_set_xyplot_key_position()} @example void fl_set_xyplot_key_position(FL_OBJECT *obj, float x, float y, int align) @end example @noindent where @code{x} and @code{y} should be given in world coordinates. @code{align} specifies the alignment of the entire key box relative to the given position (see Fig.21.1). The following routine combines the above two functions and may be more convenient to use @findex fl_set_xyplot_keys() @anchor{fl_set_xyplot_keys()} @example void fl_set_xyplot_keys(FL_OBJECT *obj, char *keys[], float x, float y, int align); @end example @noindent where @code{keys} specifies the keys for each plot. The last element of the array must be @code{NULL} to indicate the end. The array index is the plot id, i.e., @code{key[0]} is the key for the base plot, @code{key[1]} the key for the the first overlay etc. To change the font the key text uses, the following routine is available @findex fl_set_xyplot_key_font() @anchor{fl_set_xyplot_key_font()} @example void fl_set_xyplot_key_font(FL_OBJECT *obj, int style, int size); @end example Data may be interpolated using an nth order Lagrangian polynomial: @findex fl_set_xyplot_interpolate() @anchor{fl_set_xyplot_interpolate()} @example void fl_set_xyplot_interpolate(FL_OBJECT *obj, int id, int degree, double grid); @end example @noindent where @code{id} is the overlay ID (use 0 for the base data set); @code{degree} is the order of the polynomial to use (between 2 and 7) and @code{grid} is the working grid onto which the data are to be interpolated. To restore the default linear interpolation, use @code{degree} set to 0 or 1. To change the line thickness of an xyplot (base data or overlay), the follow routine is available: @findex fl_set_xyplot_linewidth() @anchor{fl_set_xyplot_linewidth()} @example void fl_set_xyplot_linewidth(FL_OBJECT *obj, int id, int width); @end example Again, use a @code{id} of value 0 to indicate the base data. Setting @code{width} to zero restores the server default and typically is the fastest. By default, a linear scale in both the x and y direction is used. To change the scaling, use the following call @findex fl_set_xyplot_xscale() @anchor{fl_set_xyplot_xscale()} @findex fl_set_xyplot_yscale() @anchor{fl_set_xyplot_yscale()} @example void fl_set_xyplot_xscale(FL_OBJECT *obj, int scale, double base); void fl_set_xyplot_yscale(FL_OBJECT *obj, int scale, double base); @end example @noindent where the valid scaling options for scale are @tindex FL_LINEAR @tindex FL_LOG q@code{FL_LINEAR} and @code{FL_LOG}, and @code{base} is used only for @code{FL_LOG} and in that case is the base of the logarithm to be used. Use the following routine to clear an xyplot @findex fl_clear_xyplot() @anchor{fl_clear_xyplot()} @example void fl_clear_xyplot(FL_OBJECT *obj); @end example @noindent This routine frees all data associated with an XYPlot, including all overlays and all inset texts. This routine does not reset all plotting options, such as line thickness, major/minor divisions etc.@: nor does it free all memories associated with the XYPlot, for this @code{@ref{fl_free_object()}} is needed. The mapping between the screen coordinates and data can be obtained using the following routines @findex fl_get_xyplot_xmapping() @anchor{fl_get_xyplot_xmapping()} @findex fl_get_xyplot_ymapping() @anchor{fl_get_xyplot_ymapping()} @example void fl_get_xyplot_xmapping(FL_OBJECT *obj, float *a, float *b); void fl_get_xyplot_xmapping(FL_OBJECT *obj, float *a, float *b); @end example @noindent where @code{a} and @code{b} are the mapping constants and are used as follows: @example screenCoord = a * data + b (linear scale) screenCoord = a * log(data) / log(p) + b (log scale) @end example @noindent where @code{p} is the base of the requested logarithm. If you need to do conversions only occasionally (for example, converting the position of a mouse click to a data point or vice versa) the following routines might be more convenient @findex fl_xyplot_s2w() @findex fl_xyplot_w2s() @anchor{fl_xyplot_s2w()} @anchor{fl_xyplot_w2s()} @example void fl_xyplot_s2w(FL_OBJECT *obj, double sx, double sy, float *wx, float *wy); void fl_xyplot_w2s(FL_OBJECT *obj, double wx, double wy, float *sx, float *sy); @end example @noindent where @code{sx} and @code{sy} are the screen coordinates and @code{wx} and @code{wy} are the world coordinates. Finally, there's a function for returning the coordinates of the area of the object used for drawing the data (i.e., the area, when axes are displayed, which is enclosed by the axes): @findex fl_get_xyplot_screen_area() @anchor{fl_get_xyplot_screen_area()} @findex fl_get_xyplot_world_area() @anchor{fl_get_xyplot_world_area()} @example void fl_get_xyplot_screen_area(FL_OBJECT *obj, FL_COORD *llx, FL_COORD *lly, FL_COORD *urx, FL_COORD *ury); void fl_get_xyplot_world_area(FL_OBJECT *obj, float *llx, float *lly, float *urx, float *ury); @end example @noindent where via @code{llx} and @code{lly} the coordinates of the lower left hand corner and via @code{urx} and @code{ury} those of the upper right hand corner are returned. The first function returns the corner positions in screen coordinates (relative to the object), while the secoind returns them in "world" coordinates. Per default an XYPlot object only reacts to the left mouse button. But sometimes it can be useful to modify this. To set this call @findex fl_set_xyplot_mouse_buttons() @anchor{fl_set_xyplot_mouse_buttons()} @example void fl_set_xyplot_mouse_buttons(FL_OBJECT *obj, int mbuttons); @end example @noindent @code{mbuttons} is the bitwise OR of the numbers 1 for the left mouse button, 2 for the middle and 4 for the right mouse button. To determine which mouse buttons an XYPlot object reacts to use @findex fl_get_xyplot_mouse_buttons() @anchor{fl_get_xyplot_mouse_buttons()} @example void fl_get_xyplot_mouse_buttons(FL_OBJECT *obj, unsigned int *mbuttons); @end example @noindent The value returned via @code{mbuttons} is the same value as would be used in @code{@ref{fl_set_slider_mouse_buttons()}}. @node XYPlot Attributes @subsection XYPlot Attributes Don't use @code{FL_NO_BOX} as the boxtype of an XYPlot object that is to be changed dynamically. To change the font size and style for the tic labels, inset text etc., use @code{@ref{fl_set_object_lsize()}} and @code{@ref{fl_set_object_lstyle()}}. The first color argument (@code{col1}) to @code{@ref{fl_set_object_color()}} controls the color of the box and the second (@code{col2}) the actual XYPlot color. @node XYPlot Remarks @subsection Remarks The interpolation routine is public and can be used in the application program @findex fl_interpolate() @anchor{fl_interpolate()} @example int fl_interpolate(const float *inx, const float *iny, int num_in, float *outx, float *outy, double grid, int ndeg); @end example @noindent If successful, the function returns the number of points in the interpolated function (@code{(inx[num_in - 1] - inx[0]) / grid + 1.01}), otherwise it returns -1. Upon return, @code{outx} and @code{outy} are set to the interpolated values. The caller must allocate the storage for @code{outx} and @code{outy}. See @file{xyplotall.c} and @code{xyplotactive.c} for examples of the use of XYPlot objects. There is also an example program called @file{xyplotover.c}, which shows the use of overlays. In addition, @code{xyplotall.c} shows a way of getting all mouse clicks without necessarily using an active XYPlot. It is possible to generate a PostScript output of an XYPlot. See the function @code{@ref{fl_object_ps_dump()}} documented in Part V. @node Canvas Object @section Canvas Object A canvas is a managed plain X (sub)window. It it different from the free object in that a canvas is guaranteed to be associated with a window that is not shared with any other object, thus an application program has more freedom in utilizing a canvas, such as using its own colormap or rendering double-buffered OpenGL in it etc. A canvas is also different from a raw application window because a canvas is decorated differently and its geometry is managed, e.g., you can use @code{@ref{fl_set_object_resize()}} to control its position and size after its parent form is resized. You also should be aware that when using a canvas you'll probably mostly program directly using basic Xlib functions, XForms doesn't supply much more than a few helper functions. You'll rather likely draw to it with Xlib functions and will be dealing with @code{XEvent}s yourself (instead having them taken care of by XForms and cenverted to some simpler to use events that then just return the object from @code{@ref{fl_do_forms()}} or invoke an associated callback function. Thus you will typically need a basic knowledge of how to program via the X11 Xlib. @ifnottex @menu * Adding Canvas Objects: Adding Canvas Objects * Canvas Types: Canvas Types * Canvas Interaction: Canvas Interaction * Other Canvas Routines: Other Canvas Routines * Canvas Attributes: Canvas Attributes * OpenGL Canvas: OpenGL Canvas @end menu @end ifnottex @node Adding Canvas Objects @subsection Adding Canvas Objects Adding an object To add a canvas to a form you use the routine @findex fl_add_canvas() @anchor{fl_add_canvas()} @example FL_OBJECT *fl_add_canvas(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent The meaning of the parameters is as usual. The label is not drawn but used as the window name for possible resource and playback purposes. If label is empty, the window name will be generated on the fly as @code{flcanvasn}, where @code{n = 0, 1,...}. @node Canvas Types @subsection Canvas Types The only types of canvases currently available is @tindex FL_NORMAL_CANVAS @code{FL_NORMAL_CANVAS}. @node Canvas Interaction @subsection Canvas Interaction The canvas class is designed to maximize the programmer's ability to deal with situations where standard form classes may not be flexible enough. With canvases, the programmer has complete control over everything that can happen to a window. It thus doesn't work like other objects that get returned by @code{@ref{fl_do_forms()}} etc.@: or have their callbacks invoked. Instead the user can request that for specific @code{X} events (not XForms object events like @code{FL_PRESS}, @code{FL_KEYPRESS} etc.!) callbacks are invoked that receive all information about the @code{XEvent} that led to their invocation. This obviously requires some understanding of how the X Window system works. The interaction with a canvas is typically set up as follows. First, you register the @code{X} events you're interested in and their handlers using the following routine @tindex FL_HANDLE_CANVAS @findex fl_add_canvas_handler() @anchor{fl_add_canvas_handler()} @example typedef int (*FL_HANDLE_CANVAS)(FL_OBJECT *obj, Window win, int win_width, int win_height, XEvent *xev, void *user_data); void fl_add_canvas_handler(FL_OBJECT *obj, int event, FL_HANDLE_CANVAS handler, void *user_data); @end example @noindent where @code{event} is the @code{XEvent} type, e.g., @code{Expose} etc. The @code{@ref{fl_add_canvas_handler()}} function first registers a procedure with the event dispatching system of the Forms Library, then it figures out the event masks corresponding to the event @code{event} and invokes @code{@ref{fl_addto_selected_xevent()}} to solicit the event from the server. Other book keeping (e.g., drawing the box that encloses the canvas, etc.) is done by the object handler. When a canvas handler is installed the library tries to set the correct mask for the the @code{XEvent} (which then tells the X Window system which events to pass on to the Forms Library). But since translation from an @code{XEvent} to an @code{XEvent} mask is not unique, the default translation of the @code{XEvent} to a mask may or may not match exactly the intention of the application. Two events, namely @code{MotionNotify} and @code{ButtonPress}, are likely candidates that need further clarification from the application. There are two functions to add or delete from the mask, @code{@ref{fl_addto_selected_xevent()}} and @code{@ref{fl_remove_selected_xevent()}}. By default, when a mouse motion handler (i.e., for the @code{MotionNotify} events) is registered, it is assumed that, while the application wants to be informed about mouse movements, it's not interested in a continous motion monitoring (tracking), thus per default @code{MotionNotify} events are requested with @code{PointerMotionHintMask} being set in the mask to reduce the number of events generated. If this is not the case and in fact the application wants to use the mouse motion as some type of graphics control, the default behavior would appear "jerky" as not every mouse motion is reported. To change the default behavior so that every mouse motion is reported, you need to call @code{@ref{fl_remove_selected_xevent()}} with mask set to @code{PointerMotionHintMask}. Furthermore, the mouse motion is reported regardless if a mouse button is pressed or not. If the application is interested in mouse motion only when a mouse button is pressed @code{@ref{fl_remove_selected_xevent()}} should be called with a mask of @code{PointerMotionMask|PointerMotionHintMask}. With @code{ButtonPress} events you need to call @code{@ref{fl_addto_selected_xevent()}} with a mask of @code{OwnerGrabButtonMask} if you are to add or remove other canvas handlers in the button press handler. To remove a registered handler, use @findex fl_remove_canvas_handler() @anchor{fl_remove_canvas_handler()} @example void fl_remove_canvas_handler(FL_OBJECT *obj, int event, FL_CANVAS_HANDLER handler); @end example @noindent After this function call the canvas ceases to receive the events for @code{event}. The corresponding default bits in the @code{XEvent} mask as were set by @code{@ref{fl_add_canvas_handler()}} are cleared. If you added extra ones with @code{@ref{fl_addto_selected_xevent()}} you should reset them using @code{@ref{fl_remove_selected_xevent()}}. To obtain the window ID of a canvas, use @findex fl_get_canvas_id() @anchor{fl_get_canvas_id()} @example Window fl_get_canvas_id(FL_OBJECT *obj); @end example @noindent or use the generic function (macro) (recommended) @findex FL_ObjWin() @anchor{FL_ObjWin()} @example Window FL_ObjWin(FL_OBJECT *obj); @end example @noindent Of course, the window ID only has a meaning after the form/canvas is shown. When the canvas or the form the canvas is on is hidden (via @code{@ref{fl_hide_object()}} or @code{@ref{fl_hide_form()}}), the canvas window may be destroyed. If the canvas is shown again, a new window ID for the canvas may be created. Thus recording the canvas window ID in a static variable is not the right thing to do. It is much safer (and it doesn't add any run-time overhead) to obtain the canvas window ID via @code{@ref{FL_ObjWin()}} whenever it's needed. If your application must show and hide the canvas/form repeatedly, you might consider to "unmap" the window, a way of removing the window from the screen without actually destroying it and later re-mapping the window to show it. The Xlib API functions for doing this are @code{XUnmapWindow()} and @code{XMapWindow()}. Both require two arguments. the display, which you can determine by calling @code{@ref{fl_get_display()}} and the window ID, which can be obtained by using @code{form->window} if you want to (un)map a form or @code{FL_ObjWin(obj)} for a canvas. @node Other Canvas Routines @subsection Other Canvas Routines Upon canvas creation, all its window related attributes, e.g., visual, depth and colormap etc., are inherited from its parent (i.e., the window of the form the canvas belongs to). To modify any attributes of the canvas, use the following routine @findex fl_set_canvas_attributes() @anchor{fl_set_canvas_attributes()} @example void fl_set_canvas_attributes(FL_OBJECT *obj, unsigned mask, XSetWindowAttributes *xswa); @end example @noindent See @code{XSetWindowAttributes()} for the definition of the structure members. Note that this routine should not be used to manipulate events. Other functions exists that can be used to modify the color/visual property of a canvas: @findex fl_set_canvas_colormap() @anchor{fl_set_canvas_colormap()} @findex fl_get_canvas_colormap() @anchor{fl_get_canvas_colormap()} @findex fl_set_canvas_visual() @anchor{fl_set_canvas_visual()} @findex fl_set_canvas_depth() @anchor{fl_set_canvas_depth()} @findex fl_get_canvas_depth() @anchor{fl_get_canvas_depth()} @example void fl_set_canvas_colormap(FL_OBJECT *obj, Colormap map); Colormap fl_get_canvas_colormap(FL_OBJECT *obj); void fl_set_canvas_visual(FL_OBJECT *obj, Visual *vi); void fl_set_canvas_depth(FL_OBJECT *obj, int depth); int fl_get_canvas_depth(FL_OBJECT *obj); @end example @noindent Note that changing visual or depth does not generally make sense once the canvas window is created (which happens when the parent form is shown). Also, typically if you change the canvas visual, you probably should also change the canvas depth to match the visual. Caution should also applied when using @code{@ref{fl_set_canvas_colormap()}}: when the canvas window goes away, e.g., as a result of a call of @code{@ref{fl_hide_form()}}, the colormap associated with the canvas is freed (destroyed). This likely will cause problems if a single colormap is used for multiple canvases as each canvas will attempt to free the same colormap, resulting in an X error. If your application works this way, i.e., the same colormap is used on multiple canvases (via @code{@ref{fl_set_canvas_colormap()}}), you should use the following routine to prevent the canvas from freeing the colormap: @findex fl_share_canvas_colormap() @anchor{fl_share_canvas_colormap()} @example void fl_share_canvas_colormap(FL_OBJECT *obj, Colormap colormap); @end example @noindent This function works the same way as @code{@ref{fl_set_canvas_colormap()}} except that it also sets a internal flag so the colormap isn't freed when the canvas goes away. By default, canvases are decorated with an @code{FL_DOWN_FRAME}. To change the decoration, change the the boxtype of the canvas and the boxtype will be translated into a frame that best approximates the appearance of the request boxtype (e.g., a @code{FL_DOWN_BOX} is translated into a @code{FL_DOWN_FRAME} etc). Note that not all frame types are appropriate for decorations. The following routine is provided to facilitate the creation of a colormap appropriate for a given visual to be used with a canvas: @findex fl_create_colormap() @anchor{fl_create_colormap()} @example Colormap fl_create_colormap(XVisualInfo *xvinfo, int n_colors); @end example @noindent where @code{n_colors} indicates how many colors in the newly created colormap should be filled with XForms' default colors (to avoid flashing effects). Note however, that the colormap entry 0 is allocated with either black or white even if you specify 0 for @code{n_colors}. To prevent this from happening (so you get a completely empty colormap), set @code{n_colors} to -1. @xref{Part IV Drawing Objects, , Drawing Objects}, on how to obtain the @code{XVisualInfo} for the window. Depending on the window manager, a colormap other than the default may not get installed correctly. If you're working with such a window manager, you may have to install the colormap yourself when the mouse pointer enters the canvas using @code{XInstallColormap()}. By default, objects with shortcuts appearing on the same form as the canvas will "steal" keyboard inputs if they match the shortcuts. To disable this feature, use the following routine with a false (0) value for @code{yes_no}: @findex fl_canvas_yield_to_shortcut() @anchor{fl_canvas_yield_to_shortcut()} @example void fl_canvas_yield_to_shortcut(FL_OBJECT *obj, int yes_no); @end example To clear the canvas use @findex fl_clear_canvas() @anchor{fl_clear_canvas()} @example void fl_clear_canvas(FL_OBJECT *obj); @end example @noindent If @code{@ref{fl_set_object_color()}} gas been called on the object the first color passed to the function will be used to draw the background of the color, otherwise it's drawn in black. @node Canvas Attributes @subsection Canvas Attributes Some of the attributes, such as boxtype, do not apply to the canvas class. The first color argument (@code{col1}) to @code{@ref{fl_set_object_color()}} can be used to set the background color of the canvas (by default, a canvas has no background color). The second argument (@code{col2}) controls the decoration color (if applicable). @node OpenGL Canvas @subsection OpenGL Canvas Deriving specialized canvases from the general canvas object is possible. See the next subsection for general approaches how this is done. The following routines work for OpenGL (under X) as well as Mesa, a free OpenGL clone. To add an OpenGL canvas to a form, use the following routine @findex fl_add_glcanvas() @anchor{fl_add_glcanvas()} @example FL_OBJECT *fl_add_glcanvas(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent where @code{type} is the same as for a normal canvas. A "glcanvas" created this way will have the following attributes by default @example GLX_RGBA, GLX_DEPTH_SIZE: 1, GLX_RED_SIZE: 1, GLX_GREEN_SIZE: 1, GLX_BLUE_SIZE: 1, GLX_DOUBLEBUFFER @end example The application program can modify these defaults using the following routine (before the creation of glcanvases) @findex fl_set_glcanvas_defaults() @anchor{fl_set_glcanvas_defaults()} @example void fl_set_glcanvas_defaults(const int *attributes); @end example @noindent See @code{glXChooseVisual()} for a list of valid attributes. To get the current defaults use @findex fl_get_glcanvas_defaults() @anchor{fl_get_glcanvas_defaults()} @example void fl_get_glcanvas_defaults(int *attributes); @end example It is also possible to change the attributes on a canvas by canvas basis by utilizing the following routine: @findex fl_set_glcanvas_attributes() @anchor{fl_set_glcanvas_attributes()} @example void fl_set_glcanvas_attributes(FL_OBJECT *obj, const int *attributes); @end example @noindent Note that this routine can be used to change a glcanvas attributes on the fly even if the canvas is already visible and active. To obtain the attributes of a particular canvas, use the following routine @findex fl_get_glcanvas_attributes() @anchor{fl_get_glcanvas_attributes()} @example void fl_get_glcanvas_attributes(FL_OBJECT *obj, int attributes[]); @end example @noindent The caller must supply the space for the attribute values. To obtain the the glx context (for whatever purposes), use @findex fl_get_glcanvas_context() @anchor{fl_get_glcanvas_context()} @example GLXContext fl_get_glcanvas_context(FL_OBJECT *obj); @end example Note that by default the rendering context created by a glcanvas uses direct rendering (i.e., by-passing the Xserver). To change this default, i.e., to always render through the Xserver, use the following routine: @findex fl_set_glcanvas_direct() @anchor{fl_set_glcanvas_direct()} @example void fl_set_glcanvas_direct(FL_OBJECT *obj, int yes_no); @end example @noindent with the argument @code{yes_no} set to false (0). Remember that OpenGL drawing routines always draw into the window the current context is bound to. For application with a single canvas, this is not a problem. In case of multiple canvases, the canvas driver takes care of setting the proper context before invoking the expose handler. In some cases, the application may want to draw into canvases actively. In this case, explicit drawing context switching may be required. To this end, use the following routine @findex fl_activate_glcanvas() @anchor{fl_activate_glcanvas()} @example void fl_activate_glcanvas(FL_OBJECT *obj); @end example @noindent before drawing into glcanvas object. Finally there is a routine that can be used to obtain the @code{XVisual} information that is used to create the context @findex fl_get_glcanvas_xvisualinfo() @anchor{fl_get_glcanvas_xvisualinfo()} @example XVisualInfo *fl_get_glcanvas_xvisualinfo(FL_OBJECT *obj); @end example @noindent See demo program @code{gl.c} for an example use of a glcanvas. xforms-1.2.4/doc/xforms.init0000644000175000017500000001353311665175503012743 00000000000000# -debug # The integer value specifies what kind of debugging output is generated. $DEBUG = 0; # -doctype # The value is the 'SystemLiteral' which identifies the canonical DTD # for the document. # Definition: The SystemLiteral is called the entity's system # identifier. It is a URI, which may be used to retrieve the entity. # See http://www.xml.com/axml/target.html#NT-ExternalID $DOCTYPE = ''; # -expand # the @EXPAND array contains the expanded section names. #@EXPAND = ( 'html' ); # -iso # if this value is true, ISO8859 characters are used for special symbols # (like copyright, etc). $USE_ISO = 0; # -I # add a directory to the list of directories where @include files are # searched for (besides the directory of the file). additional '-I' # args are appended to this list. # (APA: Don't implicitely search ., to conform with the docs!) # my @INCLUDE_DIRS = ("."); @INCLUDE_DIRS = ( ); # -P # prepend a directory to the list of directories where @include files are # searched for before the directory of the file. additional '-P' # args are prepended to this list. @PREPEND_DIRS = ( ); # --conf-dir # append to the files searched for init files. @CONF_DIRS = ( ) ; # -top-file # This file name is used for the top-level file. # The extension is set appropriately, if necessary. # If empty, .html is used. # Typically, you would set this to "index.html". $TOP_FILE = 'index.html'; # -toc-file # This file name is used for the table of contents. The # extension is set appropriately, if necessary. # If empty, _toc.html is used. $TOC_FILE = ''; # -frames # if the value is true, HTML 4.0 "frames" are used. # A file describing the frame layout is generated, together with a file # with the short table of contents. $FRAMES = 0; # -menu | -nomenu # if the value is true the Texinfo menus are shown. $SHOW_MENU = 1; # -number | -nonumber # if this is set the sections are numbered, and section names and numbers # are used in references and menus (instead of node names). $NUMBER_SECTIONS = 1; # -use-nodes # if this is set the nodes are used as sectionning elements. # Otherwise the nodes are incorporated in sections. $USE_NODES = 0; # -node-files # if this is set one file per node is generated, which can be a target for # cross manual references. $NODE_FILES = 0; # -split section|chapter|node|none # if $SPLIT is set to 'section' (resp. 'chapter') one html file per section # (resp. chapter) is generated. If $SPLIT is set to 'node' one html file per # node or sectionning element is generated. In all these cases separate pages # for Top, Table of content (Toc), Overview and About are generated. # Otherwise a monolithic html file that contains the whole document is # created. $SPLIT = 'chapter'; # -sec-nav|-nosec-nav # if this is set then navigation panels are printed at the beginning of each # section. # If the document is split at nodes then navigation panels are # printed at the end if there were more than $WORDS_IN_PAGE words on page. # # If the document is split at sections this is ignored. # # This is most useful if you do not want to have section navigation # with -split chapter. There will be chapter navigation panel at the # beginning and at the end of chapters anyway. $SECTION_NAVIGATION = 0; # -separated-footnotes # if this is set footnotes are on a separated page. Otherwise they are at # the end of each file (if the document is split). $SEPARATED_FOOTNOTES = 0; # -toc-links # if this is set, links from headings to toc entries are created. $TOC_LINKS = 0; # -subdir # If this is set, then put result files into the specified directory. # If not set, then result files are put into the current directory. #$SUBDIR = 'html'; $SUBDIR = '.'; # -short-extn # If this is set, then all HTML files will have extension ".htm" instead of # ".html". This is helpful when shipping the document to DOS-based systems. $SHORTEXTN = 0; # -prefix # This set the output file prefix, prepended to all .html, .gif and .pl files. # By default, this is the basename of the document. $PREFIX = ''; # -o filename # If this is set a monolithic document is outputted into $filename. $OUT = ''; # -no-validate # suppress node cross-reference validation $NOVALIDATE = 0; # -short-ref # if this is set cross-references are given without section numbers. $SHORT_REF = 0; # -idx-sum # if value is set, then for each @printindex # _.idx is created which contains lines of the form # key ref sorted alphabetically (case matters). $IDX_SUMMARY = 0; # -def-table # If this is set a table construction for @def.... instead of definition # lists. # (New Option: 27.07.2000 Karl Heinz Marbaise) $DEF_TABLE = 0; # -verbose # if this is set chatter about what we are doing. $VERBOSE = 0; # -lang # use &$I('my string') if you want to have translations of 'my string' # and provide the translations in $LANGUAGES->{$LANG} with 'my string' # as key. # To add a new language use ISO 639 language codes (see e.g. perl module # Locale-Codes-1.02 for definitions). Supply translations in the # $LANGUAGES hash and put it in a file with $LANG as name in an i18n # directory. # Default's to 'en' if not set or no @documentlanguage is specified. $LANG = 'en'; # -ignore-preamble-text # If this is set the text before @node and sectionning commands is ignored. $IGNORE_PREAMBLE_TEXT = 0; # -html-xref-prefix # base directory for external manuals. #$EXTERNAL_DIR = '../'; $EXTERNAL_DIR = undef; # -css-include # All the specified css files are used. More precisely the @import sections # are added to the beginning of the CSS_LINES the remaining is added at # the end of the CSS_LINES (after the css rules generated by texi2html). # cf texinfo manual for more info. # - means STDIN @CSS_FILES = ( 'xforms.css' ); 1; xforms-1.2.4/doc/part2_saving_loading.texi0000664000175000017500000002376612252533050015526 00000000000000@node Part II Saving and Loading Forms @chapter Saving and Loading Forms To save the set of forms created select the item "Save" or "Save As" from the "File" menu. You will be prompted for a file name using the file selector if the latter is selected. Choose a name that ends with @code{.fd}, e.g., @file{ttt.fd}. The program will now generate three files: @file{ttt.c}, @file{ttt.h} and @file{ttt.fd}. If these files already exist, backup copies of them are made (by appending @code{.bak} to the already existing file names). @file{ttt.c} contains a piece of C-code that builds up the forms and @file{ttt.h} contains all the object and form names as indicated by the user. It also contains declaration of the defined callback routines. Depending on the options selected from the "Options" menu, two more files may be emitted, namely the main program and callback function templates. They are named @file{ttt_main.c} and @file{ttt_cb.c} respectively. There are two different kind of formats for the C-code generated. The default format allows more than one instance of the form created and uses no global variables. The other format, activated by the @code{altformat} option given on the command line or switched on via the "Options" menu by selecting "Alt Format", uses global variables and does not allow more than one instantiation of the designed forms. However, this format has a global routine that creates all the forms defined, which by default is named @code{create_the_forms()} but that can be changed (see below). Depending on which format is output, the application program typically only needs to include the header file and call the form creation routine. To illustrate the differences between the two output formats and the typical way an application program is setup, we look at the following hypothetical situation: We have two forms, @code{foo} and @code{bar}, each of which contains several objects, say @code{fnobj1}, @code{fnobj2} etc. where @code{n = 1, 2}. The default output format will generate the following header file (@file{foobar.h}): @example #ifndef FD_foobar_h_ #define FD_foobar_h_ /* call back routines if any */ extern void callback(FL_OBJECT *, long); typedef struct @{ FL_FORM * foo; void * vdata; char * cdata; long ldata; FL_OBJECT * f1obj1; FL_OBJECT * f1obj2; @} FD_foo; typedef struct @{ FL_FORM * bar; void * vdata; char * cdata; long ldata; FL_OBJECT * f2obj1; FL_OBJECT * f2obj2; @} FD_bar; extern FD_foo *create_form_foo(void); extern FD_bar *create_form_bar(void); #endif /* FD_foobar_h */ @end example @noindent and the corresponding C file: @example #include #include "foobar.h" FD_foo *create_form_foo(void) @{ FD_foo *fdui = fl_calloc(1, sizeof *fdui); fdui->foo = fl_bgn_form(....); fdui->f1obj1 = fl_add_aaaa(....); fdui->f1obj1 = fl_add_bbbb(....); fl_end_form(); fdui->foo->fdui = fdui; return fdui; @} FD_bar *create_form_foo(void) @{ FD_bar *fdui = fl_calloc(1, sizeof *fdui); fdui->bar = fl_bgn_form(....); fdui->f2obj1 = fl_add_cccc(....); fdui->f2obj2 = fl_add_dddd(....); fl_end_form(); fdui->bar->fdui = fdui; return fdui; @} @end example The application program would look something like the following: @example #include #include "foobar.h" /* add call back routines here */ int main(int argc, char *argv[]) @{ FD_foo *fd_foo; FD_bar *fd_bar; fl_initialize(...); fd_foo = create_form_foo(); init_fd_foo(fd_foo); /* application UI init routine */ fd_bar = create_form_bar(); init_fd_bar(fd_bar) /* application UI init routine */ fl_show_form(fd_foo->foo, ...); /* rest of the program */ @} @end example As you see, @code{fdesign} generates a structure that groups together all objects on a particular form and the form itself into a structure for easy maintenance and access. The other benefit of doing this is that the application program can create more than one instance of the form if needed. It is difficult to avoid globals in an event-driven callback scheme with most difficulties occurring inside the callback function where another object on the same form may need to be accessed. The current setup makes it possible and relatively painless to achieve this. There are a couple of ways to do this. The easiest and most robust way is to use the member @code{form->fdui}, which fdesign sets up to point to the @code{FD_} structure of which the form (pointer) is a member. To illustrate how this is done, let's take the above two forms and try to access a different object from within a callback function. @example fd_foo = create_form_foo(); ... @end example @noindent and in the callback function of @code{ob} on form @code{foo}, you can access other objects as follows: @example void callback(FL_OBJECT *obj, long data) @{ FD_foo *fd_foo = obj->form->fdui; fl_set_object_dddd(fd_foo->f1obj2, ....); @} @end example Of course this setup still leaves the problems accessing objects on other forms unsolved although you can manually set the @code{form->u_vdata} to the other @code{FD_} structure: @example fd_foo->form->u_vdata = fd_bar; @end example @noindent or use the @code{vdata} field in the @code{FD_} structure itself: @example fd_foo->vdata = fd_bar; @end example The other method, not as easy as using @code{form->fdui} (because you get no help from fdesign), but just as workable, is simply using the @code{u_vdata} field in the @code{FD_} structure to hold the address of the object that needs to be accessed. In case of need to access multiple objects, there is a field @code{u_vdata} in both the @code{FL_FORM} and @code{FL_OBJECT} structures you can use. You simply use the field to hold the @code{FD_} structure: @example fd_foo = create_form_foo(); fd_foo->foo->u_vdata = fd_foo; ... @end example @noindent and in the callback function you can access other objects as follows: @example void callback(FL_OBJECT *obj, long data) @{ FD_foo *fd_foo = obj->form->u_vdata; fl_set_object_dddd(fd_foo->f1obj2, ....); @} @end example Not pretty, but adequate for practical purposes. Note that the @code{FD_} structure always has a pointer to the form as the first member, followed by @code{vdata}, @code{cdata} and @code{ldata}. There's also a @code{typedef} for a structure of type @code{FD_Any} in @code{forms.h}: @example typedef struct @{ FL_FORM * form; void * vdata; char * cdata; long ldata; @} FD_Any; @end example @noindent you can use a cast to a specific @code{FD_} structure to get at @code{vdata} etc. Another alternative is to use the @code{FD_} structure as the user data in the callback@footnote{Unfortunately, this scheme isn't legal C as a pointer may be longer than a long, but in practice, it should work out ok on virtually all platforms.} @example fl_set_object_callback(obj, callback, (long) fdui); @end example @noindent and use the callback as follows @example void callback(FL_OBJECT *obj, long arg) @{ FD_foo *fd_foo = (FD_foo *) arg; fl_set_object_lcolor(fd + foo->f1obj1, FL_RED); ... @} @end example Avoiding globals is, in general, a good idea, but as everything else, also an excess of a good things can be bad. Sometimes simply making the @code{FD_} structure global makes a program clearer and more maintainable. There still is another difficulty that might arise with the current setup. For example, in @code{f1obj1}'s callback we change the state of some other object, say, @code{f1obj2} via @code{@ref{fl_set_button()}} or @code{@ref{fl_set_input()}}. Now the state of @code{f1obj2} is changed and it needs to be handled. You probably don't want to put much code for handling @code{f1obj2} in @code{f1obj1}'s callback. In this situation, the following function is handy @example void fl_call_object_callback(FL_OBJECT *obj); @end example @noindent @code{fl_call_object_callback(fdfoo->f1obj2)} will invoke the callback for @code{f1obj2} callback in exactly the same way the main loop would do and as far as @code{f1obj2} is concerned, it just handles the state change as if the user changed it. The alternative format outputs something like the following: @example /* callback routines */ extern void callback(FL_OBJECT *, long); extern FL_FORM *foo, *bar; extern FL_OBJECT *f1obj1, *f1obj2, ...; extern FL_OBJECT *f2obj1, *f2obj2, ...; extern void create_form_foo(void); extern create_form_bar(void); extern void create_the_forms(void); @end example The C-routines: @example FL_FORM *foo, *bar; FL_OBJECT *f1obj1, *f1obj2, ...; FL_OBJECT *f2obj1, *f2obj2, ...; void create_form_foo(void) @{ if (foo) return; foo = fl_bgn_form(....); ... @} void create_form_bar(void) @{ if (bar) return; bar = fl_bgn_form(....); ... @} void create_the_forms(void) @{ create_form_foo(); create_form_bar(); @} @end example Normally the application program would look something like this: @example #include #include "foobar.h" /* Here go the callback routines */ .... int main(int argc, char *argv[]) @{ fl_initialize(....); create_the_forms(); /* rest of the program follows*/ ... @} @end example Note that although the C-routine file in both cases is easily readable, editing it is strongly discouraged. If you were to do so, you will have to redo the changes whenever you call fdesign again to modify the layout. The third file created, @file{ttt.fd}, is in a format that can be read in by the Form Designer. It is easy readable ASCII but you had better not change it because not much error checking is done when reading it in. To load such a file select the "Open" item from the "File" menu. You will be prompted for a file name using the file selector. Press your mouse on the file you want to load and press the button labeled "Ready". The current set of forms will be discarded, and replaced by the new set. You can also merge the forms in a file with the current set. To this end select "Merge" from the "File" menu. xforms-1.2.4/doc/part1_introduction.texi0000644000175000017500000001033011665175503015253 00000000000000@node Part I Introduction @chapter Introduction The Forms Library is a library of C-routines that allows you to build up interaction forms with buttons, sliders, input fields, dials, etc. in a very simple way. Following the X tradition, Forms Library does not enforce the look and feel of objects although in its default state, it does provide a consistent look and feel for all objects. The Forms Library only uses the services provided by Xlib and should be compilable on all machines that have X installed and have an ANSI compatible compiler. Being based on Xlib,Forms Library is small and efficient. It can be used in both C and C++ programs and soon it will be available for other languages@footnote{As of this writing, perl, Ada95, scheme, pascal, Fortran and python bindings are in beta testing.}. The basic procedure of using the Forms Library is as follows. First one or more forms are defined, by indicating what objects should be placed on them and where. Types of objects that can be placed on the forms include: boxes, texts, sliders, buttons, dials, input fields and many more. Even a clock can be placed on a form with one command. After the form has been defined it is displayed on the screen and control is given to a library call @code{@ref{fl_do_forms()}}. This routine takes care of the interaction between the user and the form and returns as soon as some change occurs in the status of the form due to some user action. In this case control is returned to the program (indicating that the object changed) and the program can take action accordingly, after which control is returned again to the @code{@ref{fl_do_forms()}} routine. Multiple forms can be handled simultaneously by the library and can be combined with windows of the application program. More advanced event handling via object callbacks is also supported. The Forms Library is simple to use. Defining a form takes a few lines of code and interaction is fully handled by the library routines. A number of demo programs are provided to show how to piece together various parts of the library and demonstrate how easy forms are built and used. They can be found in the directory @code{demos}. Studying these demos is a good way of learning the system. If you only have very simple applications for the Forms Library, e.g., to ask the user for a file name, or ask him a question or give him a short message, @ref{Part I Goodies, , Goodies} contains some even more simple routines for this. So, e.g., a form with the question "Do you want to quit?" can be made with one line of code. To make designing forms even easier a Form Designer is provided. As its name implies, this is a program that lets you interactively design forms and generate the corresponding C-code. @xref{Part II Introduction, , Introduction}, and the following chapters for its use. The current version of the software is already quite extended but we are working on further improvements. In particular, we plan on designing new classes of objects that can be placed on the forms. Adding classes to the system is not very complicated. Part IV of this document describes in detail how to do this yourself. The following chapters will describe the basic application programmer's interface to the Forms Library and lead you through the different aspects of designing and using forms. In @ref{Part I Getting Started} we give some small and easy examples of the design and use of forms. In @ref{Part I Defining Forms, , Defining Forms} we describe how to define forms. This chapter just contains the basic classes of objects that can be placed on forms. Also, for some classes only the basic types are described and not all. For an overview of all classes and types of objects see Part III of this document. @ref{Part I Doing Interaction, , Doing Interaction} describes how to set up interaction with forms. A very specific class of objects are free objects and canvases. The application program has full control over their appearance and interaction. They can be used to place anything on forms that is not supported by the standard objects. @ref{Part I Free Objects, , Free Objects} describes their use. Finally, @ref{Part I Goodies, , Goodies} describes some built-in routines for simple interaction like asking questions and prompting for choices etc. xforms-1.2.4/doc/part3_input_objects.texi0000664000175000017500000007534212343651475015425 00000000000000@node Part III Input Objects @chapter Input Objects It is often required to obtain textual input from the user, e.g., a file name, some fields in a database, etc. To this end input fields exist in the Forms Library. An input field is a field that can be edited by the user using the keyboard. @ifnottex @menu * Adding Input Objects: Adding Input Objects * Input Types: Input Types * Input Interaction: Input Interaction * Other Input Routines: Other Input Routines * Input Attributes: Input Attributes * Remarks: Input Remarks @end menu @end ifnottex @node Adding Input Objects @section Adding Input Objects Adding an object To add an input field to a form you use the routine @findex fl_add_input() @anchor{fl_add_input()} @example FL_OBJECT *fl_add_input(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) @end example @noindent The meaning of the parameters is as usual. The label is by default placed in front of the input field. @node Input Types @section Input Types The following types of input fields exist: @table @code @tindex FL_NORMAL_INPUT @anchor{FL_NORMAL_INPUT} @item FL_NORMAL_INPUT Any type of text can be typed into this field. @tindex FL_FLOAT_INPUT @anchor{FL_FLOAT_INPUT} @item FL_FLOAT_INPUT Only a floating point numbers can be typed in (e.g., -23.2e12). The resulting string will be accepted by @code{strtod()} in its entirety (but may be too big to be represented by an @code{int} or @code{long}). @tindex FL_INT_INPUT @anchor{FL_INT_INPUT} @item FL_INT_INPUT Only an integers can be typed in (e.g., -86). The resulting string will be accepted by @code{strtol()} in its entirety (but may be too big to be represented by an @code{float} or @code{double}). @tindex FL_DATE_INPUT @anchor{FL_DATE_INPUT} @item FL_DATE_INPUT Only a date (MM/DD/YY or DD/MM/YY) can be typed in (and limited per default to 10 characters). @tindex FL_MULTILINE_INPUT @anchor{FL_MULTILINE_INPUT} @item FL_MULTILINE_INPUT An input field allowing for multiple lines. @tindex FL_SECRET_INPUT @anchor{FL_SECRET_INPUT} @item FL_SECRET_INPUT A normal input field that does not show the text (and limited per default to a maximum length of 16 characters). @tindex FL_HIDDEN_INPUT @anchor{FL_HIDDEN_INPUT} @item FL_HIDDEN_INPUT A normal input field but invisible. @end table A normal input field can contain one line of text, to be typed in by the user. A float input field can only contain a float number. If the user tries to type in something else than a float, it is not shown and the bell is sounded. Similarly, an int input field can only contain an integer number and a date input field can only contain a valid date (see below). A multi-line input field can contain multiple lines of text. A secret input field works like a normal input field but the text is not shown (or scrambled). Only the cursor is shown which does move while text is being entered. This can for example be used for getting passwords. Finally, a hidden input field is not shown at all but does collect text for the application program to use. @node Input Interaction @section Input Interaction Whenever the user presses the mouse inside an input field a cursor will appear in it (and the field will change color to indicate that it received the input focus). Further input will be directed into this field. The user can use the following keys (as in @code{emacs(1)}) to edit or move around inside the input field: @table @asis @item delete previous char @code{}, @code{h} @item delete next char @code{} @item delete previous word @code{} @item delete next word @code{} @item delete from cursor position to end of line @code{k} @item delete from cursor position to begin of line @code{h} @item jump to begin of line @code{a} @item jump to end of line @code{e} @item move char backward @code{b} @item move char forward @code{f} @item move to next line @code{n}, @code{} @item move to previous line @code{p}, @code{} @item move word backward @code{b} @item move word forward @code{f} @item move to begin of field @code{} @item move to end of field @code{} @item clear input field @code{u} @item paste @code{y} @end table It is possible to remap the the bindings, see below for details. A single click into the input field positions the cursor at the position of the mouse click. There are three ways to select part of the input field. Dragging, double-click and triple-click. A double-click selects the word the mouse is on and a triple-click selects the entire line the mouse is on. The selected part of the input field is removed when the user types the @code{} or @code{} key or replaced by what the user types in. One additional property of selecting part of the text field is that if the selection is done with the left mouse button the selected part becomes the primary (@code{XA PRIMARY}) selection of the X Selection mechanism, thus other applications, e.g., @code{xterm}, can request this selection. Conversely, the cut-buffers from other applications can be pasted into the input field. Use the middle mouse button for pasting. Note that @code{y} only pastes the cut-buffer generated by @code{k} and is not related to the X Selection mechanism, thus it only works within the same application. When the user presses the @code{} key the input field is returned to the application program and the input focus is directed to the next input field. This also happens when the user presses the @code{} key but only if the form does not contain a return button. The order which input fields get the focus when the @code{} is pressed is the same as the order the input fields were added to the form. From within Form Designer, using the raising function you can arrange (re-arrange) the focus order, see @ref{Raising and Lowering}, in Part II for details. If the @code{} key is pressed down when the @code{} is pressed, the focus is directed to the previous input field. Leaving an input field using the @code{}) key does not work for multi-line input fields since the @code{} key is used to start a new line. Per default the input object gets returned to the application (or the callback set for the input object is invoked) when the input field is left and has been changed. Depending on the application, other options might be useful. To change the precise condition for the object to be returned (or its callback to become invoked), the @code{@ref{fl_set_object_return()}} function can be used with one of the following values: @table @code @item @ref{FL_RETURN_NONE} Never return or invoke callback @item @ref{FL_RETURN_END_CHANGED} Default, object is returned or callback is called at the end if the field had been modified. @item @ref{FL_RETURN_CHANGED} Return or invoke the callback function whenever the field had been changed. @item @ref{FL_RETURN_END} Return or invoke the callback function at the end regardless if the field was modified or not. @item @ref{FL_RETURN_ALWAYS} Return or invoke the callback function upon each keystroke and at the end (regardless if the field was changed or not) @end table See demo @file{objreturn.c} for an example use of this. A few additional notes: when you read "the fields has been changed" this includes the case that the user e.g., deleted a character and then added it back again. Also this case is reported as a "change" (a delete alone isn't) so the term "changed" does not necessarily mean that the content of the field has changed but that the user made changes (but which still might result in the exact same content as before). Another term that may be understood differently is "end". In the versions since 1.0.91 it means that the users either hits the @code{} or the @code{} key (except for multi-line inputs) or that she clicks onto some other object that in principle allows user interaction. These events are interpreted as an indication the user is done editing the input field and thus are reported back to the program, either by returning the input object or invoking its callback. But unless the user goes to a different input object the input field edited retains the focus. Up to version 1.0.90 this was handled a bit differently: an "end of edit" event was not reported back to the program when the user clicked on a non-input object, i.e., changed to a different input object. This let to some problems when the interaction with the clicked-on non-input object dependet on the new content of the input object, just having been edited, but which hadn't been been reported back to the caller. On the other hand, some programs rely on the "old" behaviour. These programs can switch back to the traditional behaviour by calling the new function (available since 1.0.93) @findex fl_input_end_return_handling() @anchor{fl_input_end_return_handling()} @example fl_input_end_return_handling(int type); @end example @noindent where @code{type} can be either @tindex FL_INPUT_END_EVENT_ALWAYS @anchor{FL_INPUT_END_EVENT_ALWAYS} @code{FL_INPUT_END_EVENT_ALWAYS}, which is now the default, or @tindex FL_INPUT_END_EVENT_CLASSIC @anchor{FL_INPUT_END_EVENT_CLASSIC} @code{FL_INPUT_END_EVENT_CLASSIC}, which switches back to the type of handing used in versions up and including to 1.0.90. The function can be used at any time to change between the two possible types of behaviour. The function returns the previous setting. There is a routine that can be used to limit the number of characters per line for input fields of type @code{@ref{FL_NORMAL_INPUT}} @findex fl_set_input_maxchars() @anchor{fl_set_input_maxchars()} @example void fl_set_input_maxchars(FL_OBJECT *obj, int maxchars); @end example @noindent To reset the limit to unlimited, set @code{maxchars} to 0. Note that input objects of type @code{@ref{FL_DATE_INPUT}} are limited to 10 characters per default and those of type @code{@ref{FL_SECRET_INPUT}} to 16. Although an input of type @code{@ref{FL_RETURN_ALWAYS}} can be used in combination with the callback function to check the validity of characters that are entered into the input field, use of the following method may simplify this task considerably: @tindex FL_INPUT_VALIDATOR @anchor{FL_INPUT_VALIDATOR} @findex fl_set_input_filter() @anchor{fl_set_input_filter()} @example typedef int (*FL_INPUT_VALIDATOR)(FL_OBJECT *obj, const char *old, const char *cur, int c); FL_INPUT_VALIDATOR fl_set_input_filter(FL_OBJECT *obj, FL_INPUT_VALIDATOR filter); @end example @noindent @anchor{FL_VALID} @anchor{FL_INVALID} @anchor{FL_RINGBELL} The function @code{filter()} is called whenever a new (regular) character is entered. @code{old} is the string in the input field before the newly typed character @code{c} was added to form the new string @code{cur}. If the new character is not an acceptable character for the input field, the filter function should return @tindex FL_INVALID @code{FL_INVALID} otherwise @tindex FL_VALID @code{FL_VALID}. If @code{FL_INVALID} is returned, the new character is discarded and the input field remains unmodified. The function returns the old filter. While the built-in filters also sound the keyboard bell, this doesn't happpen if a custom filter only returns @code{FL_INVALID}. To also sound the keyboard bell logically or it with @tindex FL_RINGBELL @code{FL_INVALID | FL_RINGBELL}. This still leaves the possibility that the input is valid for every character entered, but the string is invalid for the field because it is incomplete. For example, 12.0e is valid for a float input field for every character typed, but the final string is not a valid floating point number. To guard against such cases the filter function is also called just prior to returning the object with the argument @code{c} (for the newly entered character) set to zero. If the validator returns @code{FL_INVALID} the object is not returned to the application program, but input focus can change to the next input field. If the return value is @code{FL_INVALID | FL_RINGBELL} the keyboard bell is sound, the object is also not returned to the application program and the input focus remains in the object. To facilitate specialized input fields using validators, the following validator dependent routines are available @findex fl_set_input_format() @anchor{fl_set_input_format()} @findex fl_get_input_format() @anchor{fl_get_input_format()} @example void fl_set_input_format(FL_OBJECT *obj, int attrib1, int attrib2); void fl_get_input_format(FL_OBJECT *obj, int *attrib1, int *attrib2); @end example @noindent These two routines more or less provide a means for the validator to store and retrieve some information about user preference or other state dependent information. @code{attrib1} and @code{attrib2} can be any validator defined variables. For the built-in class, only the one of type @code{@ref{FL_DATE_INPUT}} utilizes these to store the date format: for @code{attrib1}, it can take @tindex FL_INPUT_MMDD @code{FL_INPUT_MMDD} or @tindex FL_INPUT_DDMM @code{FL_INPUT_DDMM} and @code{attrib2} is the separator between month and day. For example, to set the date format to @code{dd/mm}, use @example fl_set_input_format(obj, FL_INPUT_DDMM, '/'); @end example For the built-in type @code{@ref{FL_DATE_INPUT}} the default is @code{FL_INPUT_MMDD} and the separator is @code{'/'}. There is no limit on the year other than it must be an integer and appear after month and day. The function @findex fl_validate_input() @anchor{fl_validate_input()} @example int fl_validate_input(FL_OBJECT *obj); @end example can be used to test if the value in an input field is valid. It returns @code{@ref{FL_VALID}} if the value is valid or if there is no validator function set for the input, otherwise @code{@ref{FL_INVALID}}. There are two slightly different input modes for input objects. In the "normal" mode, when the input field is entered not using the mouse (e.g., by using of the key) the cursor is placed again at the position it was when the field was left (or at the end of a possibly existing string when it's entered for the first time). When an input object has a maximum number of allowed characters set (via the @code{@ref{fl_set_input_maxchars()}} function) and there's no room left no new input is accepted until at least one character has been deleted. As an alternative there's an input mode that is similar to the way things were handle in DOS forms etc. Here, when the field is entered by any means but clicking into it with the mouse, the cursor is placed at the start of the text. And for fields with a maximum capacity, that contain already as many characters as possible, the character at the end of the field are removed when a new one is entered. To switch between the two modes use the function @findex fl_set_input_mode() @anchor{fl_set_input_mode()} @example int fl_set_input_mode( int mode ); @end example @noindent where @code{mode} is one of @table @code @tindex FL_NORMAL_INPUT_MODE @anchor{FL_NORMAL_INPUT_MODE} @item FL_NORMAL_INPUT_MODE The default. Use it to switch to the "normal" input mode @tindex FL_DOS_INPUT_MODE @anchor{FL_DOS_INPUT_MODE} @item FL_DOS_INPUT_MODE For selecting the DOS-like input mode (in this mode, when a maximum number of characters has been set, as many characters already have been entered, and a new character is inserted somewhere in the middle the character at the very end gets deleted to make room for the new character) @end table @noindent The function returns the previous setting. Note that the function changes the input mode for all input fields in your application. @node Other Input Routines @section Other Input Routines Note that the label is not the default text in the input field. To set the contents of the input field use one of these routines: @findex fl_set_input() @anchor{fl_set_input()} @findex fl_set_input_f() @anchor{fl_set_input_f()} @example void fl_set_input(FL_OBJECT *obj, const char *str); void fl_set_input_f(FL_OBJECT *obj, const char *fmt, ...); @end example @noindent The first one takes a simple string while the second expects a format string with format specifiers just like @code{printf()} etc. and as many (appropriate) arguments as there are format specifiers. Only a limited check on the string passed to the function is done in that only printable characters (according to the @code{isprint()} function) and, in the case of @code{@ref{FL_MULTILINE_INPUT}} objects, new-lines (@code{'\n'}) are accepted (i.e., all that don't fit are skipped). Use an empty string (or a @code{NULL} pointer as the second argument) to clear an input field. Setting the content of an input field does not trigger an object event, i.e., the object callback is not called. In some situations you might want to have the callback invoked. For this, you may use the function @code{@ref{fl_call_object_callback()}}. To obtain the string in the field (when the user has changed it) use: @findex fl_get_input() @anchor{fl_get_input()} @example const char *fl_get_input(FL_OBJECT *obj); @end example @noindent This function returns a char pointer for all input types. Thus for numerical input types e.g., @code{strtol(3)}, @code{atoi(3)}, @code{strtod(3)}, @code{atof(3)} or @code{sscanf(3)} should be used to convert the string to the proper data type you need. For multiline input, the returned pointer points to the entire content with possibly embedded newlines. The application may not modify the content pointed to by the returned pointer, it points to the internal buffer. To select or deselect the current input or part of it, the following two routines can be used @findex fl_set_input_selected() @anchor{fl_set_input_selected()} @findex fl_set_input_selected_range() @anchor{fl_set_input_selected_range()} @example void fl_set_input_selected(FL_OBJECT *obj, int flag); void fl_set_input_selected_range(FL_OBJECT *obj, int start, int end); @end example where @code{start} and @code{end} are measured in characters. When @code{start} is 0 and @code{end} equals the number of characters in the string, @code{@ref{fl_set_input_selected()}} makes the entire input field selected. However, there is a subtle difference between this routine and @code{@ref{fl_set_input_selected()}} when called with @code{flag} set to 1: @code{@ref{fl_set_input_selected()}} always places the cursor at the end of the string while @code{@ref{fl_set_input_selected_range()}q} places the cursor at the beginning of the selection. To obtain the currently selected range, either selected by the application or by the user, use the following routine @findex fl_get_input_selected_range() @anchor{fl_get_input_selected_range()} @example const char *fl_get_input_selected_range(FL_OBJECT *obj, int *start, int *end); @end example @noindent where @code{start} and @code{end}, if not @code{NULL}, are set to the begining and end position of the selected range, measured in characters. For example, if @code{start} is 5 after the function returned and @code{end} is 7, it means the selection starts at character 6 (@code{str[5]}) and ends before character 8 (@code{str[7]}), so a total of two characters are selected (i.e., character 6 and 7). The function returns the selected string (which may not be modified). If there is currently no selection, the function returns @code{NULL} and both @code{start} and @code{end} are set to -1. Note that the @code{char} pointer returned by the function points to (kind of) a static buffer, and will be overwritten by the next call. It is possible to obtain the cursor position using the following routine @findex fl_get_input_cursorpos() @anchor{fl_get_input_cursorpos()} @example int fl_get_input_cursorpos(FL_OBJECT *obj, int *xpos, int *ypos); @end example @noindent The function returns the cursor position measured in number of characters (including newline characters) in front of the cursor. If the input field does not have input focus (thus does not have a cursor), the function returns -1. Upon function return, @code{ypos} is set to the number of the line (starting from 1) the cursor is on, and @code{xpos} set to the number of characters in front of the cursor measured from the beginning of the current line as indicated by @code{ypos}. If the input field does not have input focus the @code{xpos} is set to -1. It is possible to move the cursor within the input field programmatically using the following routine @findex fl_set_input_cursorpos() @anchor{fl_set_input_cursorpos()} @example void fl_set_input_cursorpos(FL_OBJECT *obj, int xpos, int ypos); @end example @noindent where @code{xpos} and @code{ypos} are measured in characters (lines). E.g., given the input field @code{"an arbitrary string"} the call @example fl_set_input_cursorpos(ob, 4, 1); @end example @noindent places the the cursor after the first character of the word @code{"arbitrary"}, i.e., directly after the first @code{a}. By default, if an input field of type @code{@ref{FL_MULTILINE_INPUT}} contains more text than can be shown, scrollbars will appear with which the user can scroll the text around horizontally or vertically. To change this default, use the following routines @findex fl_set_input_hscrollbar() @anchor{fl_set_input_hscrollbar()} @findex fl_set_input_vscrollbar() @anchor{fl_set_input_vscrollbar()} @example void fl_set_input_hscrollbar(FL_OBJECT *obj, int how); void fl_set_input_vscrollbar(FL_OBJECT *obj, int how); @end example @noindent where @code{how} can be one of the following values @table @code @tindex FL_AUTO @item FL_AUTO The default. Shows the scrollbar only if needed. @tindex FL_ON @item FL_ON Always shows the scrollbar. @tindex FL_OFF @item FL_OFF Never show scrollbar. @end table @noindent Note however that turning off scrollbars for an input field does not turn off scrolling, the user can still scroll the field using cursor and other keys. To completely turn off scrolling for an input field (for both multiline and single line input field), use the following routine with a false value for @code{yes_no} @findex fl_set_input_scroll() @anchor{fl_set_input_scroll()} @example void fl_set_input_scroll(FL_OBJECT *obj, int yes_no); @end example There are also routines that can scroll the input field programmatically. To scroll vertically (for input fields of type @code{@ref{FL_MULTILINE_INPUT}} only), use @findex fl_set_input_topline() @anchor{fl_set_input_topline()} @example void fl_set_input_topline(FL_OBJECT *obj, int line); @end example @noindent where @code{line} is the new top line (starting from 1) in the input field. To programmatically scroll horizontally, use the following routine @findex fl_set_input_xoffset() @anchor{fl_set_input_xoffset()} @example void fl_set_input_xoffset(FL_OBJECT *obj, int pixels); @end example @noindent where @code{pixels}, which must be a positive number, indicates how many pixels to scroll to the left relative to the nominal position of the text lines. To obtain the current xoffset, use @findex fl_get_input_xoffset() @anchor{fl_get_input_xoffset()} @example int fl_get_input_xoffset(FL_OBJECT *obj); @end example It is possible to turn off the cursor of the input field using the following routine with a false value for @code{yes_no}: @findex fl_set_input_cursor_visible() @anchor{fl_set_input_cursor_visible()} @example void fl_set_input_cursor_visible(FL_OBJECT *obj, int yes_no); @end example To obtain the number of lines in the input field, call @findex fl_get_input_numberoflines() @anchor{fl_get_input_numberoflines()} @example int fl_get_input_numberoflines(FL_OBJECT *obj); @end example To obtain the current topline in the input field, use @findex fl_get_input_topline() @anchor{fl_get_input_topline()} @example int fl_get_input_topline(FL_OBJECT *obj); @end example To obtain the number of lines that fit inside the input box, use @findex fl_get_input_screenlines() @anchor{fl_get_input_screenlines()} @example int fl_get_input_screenlines(FL_OBJECT *obj); @end example For secret input field, the default is to draw the text using spaces. To change the character used to draw the text, the following function can be used @findex fl_set_input_fieldchar() @anchor{fl_set_input_fieldchar()} @example int fl_set_input_fieldchar(FL_OBJECT *obj, int field_char); @end example @noindent The function returns the old field char. @node Input Attributes @section Input Attributes Never use @code{@ref{FL_NO_BOX}} as the boxtype. The first color argument (@code{col1}) to @code{@ref{fl_set_object_color()}} controls the color of the input field when it is not selected and the second (@code{col2}) is the color when selected. To change the color of the input text or the cursor use @findex fl_set_input_color() @anchor{fl_set_input_color()} @example void fl_set_input_color(FL_OBJECT *obj, FL_COLOR tcol, FL_COLOR ccol); @end example @noindent Here @code{tcol} indicates the color of the text and @code{ccol} is the color of the cursor. If you want to know the colors of the text and cursor use @findex fl_get_input_color() @anchor{fl_get_input_color()} @example void fl_get_input_color(FL_OBJECT *obj, FL_COLOR *tcol, FL_COLOR *ccol); @end example By default, the scrollbar size is dependent on the initial size of the input box. To change the size of the scrollbars, use the following routine @findex fl_set_input_scrollbarsize() @anchor{fl_set_input_scrollbarsize()} @example void fl_set_input_scrollbarsize(FL_OBJECT *obj, int hh, int vw); @end example @noindent where @code{hh} is the horizontal scrollbar height and @code{vw} is the vertical scrollbar width in pixels. To determine the current settings for the horizontal scrollbar height and the vertical scrollbar width use @findex fl_get_input_scrollbarsize() @anchor{fl_get_input_scrollbarsize()} @example void fl_get_input_scrollbarsize(FL_OBJECT *obj, int *hh, int *vw); @end example The default scrollbar types are @code{@ref{FL_HOR_THIN_SCROLLBAR}} and @code{@ref{FL_VERT_THIN_SCROLLBAR}}. There are two ways you can change the default. One way is to use @code{@ref{fl_set_defaults()}} or @code{@ref{fl_set_scrollbar_type()}} to set the application wide default (preferred); another way is to use @code{@ref{fl_get_object_component()}} to get the object handle to the scrollbars and change the the object type forcibly. Although the second method of changing the scrollbar type is not recommended, the object handle obtained can be useful in changing the scrollbar colors etc. As mentioned earlier, it is possible for the application program to change the default edit keymaps. The editing key assignment is held in a structure of type @tindex FL_EditKeymap @anchor{FL_EditKeymap} @code{FL_EditKeymap} defined as follows: @example typedef struct @{ long del_prev_char; /* delete previous char */ long del_next_char; /* delete next char */ long del_prev_word; /* delete previous word */ long del_next_word; /* delete next word */ long del_to_eol; /* delete from cursor to end of line */ long del_to_bol; /* delete from cursor to begin of line */ long clear_field; /* delete all */ long del_to_eos; /* not implemented */ long backspace; /* alternative for del_prev_char */ long moveto_prev_line; /* one line up */ long moveto_next_line; /* one line down */ long moveto_prev_char; /* one char left */ long moveto_next_char; /* one char right */ long moveto_prev_word; /* one word left */ long moveto_next_word; /* one word right */ long moveto_prev_page; /* one page up */ long moveto_next_page; /* one page down */ long moveto_bol; /* move to begining of line */ long moveto_eol; /* move to end of line */ long moveto_bof; /* move to begin of file */ long moveto_eof; /* move to end of file */ long transpose; /* switch two char positions*/ long paste; /* paste the edit buffer */ @} FL_EditKeymap; @end example To change the default edit keymaps, the following routine is available: @findex fl_set_input_editkeymap() @anchor{fl_set_input_editkeymap()} @example void fl_set_input_editkeymap(const FL_EditKeymap *km); @end example @noindent with a filled or partially filled @code{@ref{FL_EditKeymap}} structure. The unfilled members must be set to 0 so the default mapping is retained. Change of edit keymap is global and affects all input field within the application. Calling @code{@ref{fl_set_input_editkeymap()}} with @code{km} set to @code{NULL} restores the default. All cursor keys (@code{}, @code{} etc.) are reserved and their meanings hard-coded, thus can't be used in the mapping. For example, if you try to set @code{del_prev_char} to @code{}, pressing the @code{} key will not delete the previous character. To obtain the current map of the edit keys use the function @findex fl_get_input_editkeymap() @anchor{fl_get_input_editkeymap()} @example void fl_get_input_editkeymap(FL_EditKeymap *km); @end example @noindent with the @code{km} argument pointing of a user supplied structure which after the call will be set up with the current settings for the edit keys. In filling the keymap structure, ASCII characters (i.e., characters with values below 128, including the control characters with values below 32) should be specified by their ASCII codes (@code{ C} is 3 etc.), while all others by their @code{Keysym}s (@code{XK_F1} etc.). Control and special character combinations can be obtained by adding @tindex FL_CONTROL_MASK @anchor{FL_CONTROL_MASK} @code{FL_CONTROL_MASK} to the @code{Keysym}. To specify @code{Meta} add @tindex FL_ALT_MASK @anchor{FL_ALT_MASK} @code{FL_ALT_MASK} to the key value. @example FL_EditKeymap ekm; memset(&ekm, 0, sizeof ekm); /* zero struct */ ekm.del_prev_char = 8; /* */ ekm.del_prev_word = 8 | FL_CONTROL_MASK; /* */ ekm.del_next_char = 127; /* */ ekm.del_prev_word = 'h' | FL_ALT_MASK; /* h */ ekm.del_next_word = 127 | FL_ALT_MASK; /* */ ekm.moveto_bof = XK_F1; /* */ ekm.moveto_eof = XK_F1 | FL_CONTROL_MASK; /* */ fl_set_input_editkeymap(&ekm); @end example Note: In earlier versions of XForms (all version before 1.2) the default behaviour of the edit keys was slightly different which doesn't fit modern user expectations, as was the way the way the edit keymap was to be set up. If you use XForms for some older application that makes massive use of the "classical" behaviour you can compile XForms to use the old behaviour by using the @code{--enable-classic-editkeys} option when configuring the library for compilation. @node Input Remarks @section Remarks Always make sure that the input field is high enough to contain a single line of text. If the field is not high enough, the text may get clipped, i.e., become unreadable. See the program @file{demo06.c} for an example of the use of input fields. See @file{minput.c} for multi-line input fields. See @file{secretinput.c} for secret input fields and @file{inputall.c} for all input fields. xforms-1.2.4/doc/part3_container_objects.texi0000644000175000017500000006304712252533251016233 00000000000000@node Part III Container Objects @chapter Container Objects @ifnottex @menu * Folder Object: Folder Object * FormBrowser Object: FormBrowser Object @end menu @end ifnottex @node Folder Object @section Folder Object A tabbed folder is a special container class that is capable of holding multiple groups of objects (folders) to maximize the utilization of the screen real estate. Each folder has its own tab the user can click on to call up a specific folder from which option can be selected. @ifhtml @center @image{xforms_images/folders} @end ifhtml @ifnothtml @center @image{xforms_images/folders,10cm} @end ifnothtml @ifnottex @menu * Adding Folder Objects: Adding Folder Objects * Folder Types: Folder Types * Folder Interaction: Folder Interaction * Other Folder Routines: Other Folder Routines * Remarks: Folder Remarks @end menu @end ifnottex @node Adding Folder Objects @subsection Adding Folder Objects To add a tabbed folder to a form use the routine @findex fl_add_tabfolder() @anchor{fl_add_tabfolder()} @example FL_OBJECT *fl_add_tabfolder(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent The geometry indicated by @code{x}, @code{y}, @code{w}, and @code{h} is the total area of the tabbed folders, including the area used for the tab riders. @node Folder Types @subsection Folder Types The following types are available: @table @code @tindex FL_TOP_TABFOLDER @anchor{FL_TOP_TABFOLDER} @item FL_TOP_TABFOLDER Tabs on top of the folders. @tindex FL_BOTTOM_TABFOLDER @anchor{FL_BOTTOM_TABFOLDER} @item FL_BOTTOM_TABFOLDER Tabs at the bottom of the folders. @c @tindex FL_LEFT_TABFOLDER @c @anchor{FL_LEFT_TABFOLDER} @c @item FL_LEFT_TABFOLDER @c Tabs on the left of the folders (not yet functional). @c @c @tindex FL_RIGHT_TABFOLDER @c @anchor{FL_RIGHT_TABFOLDER} @c @item FL_RIGHT_TABFOLDER @c Tabs on the right of the folders (not yet functional). @end table @node Folder Interaction @subsection Folder Interaction The folders displayed by the tabbed folder class are simply regular forms (of type @code{FL_FORM}), which in turn contain objects. Each folder is associated with a name (shown on the tab rider). The folder interacts with the user just like any other form. Different from other top-level forms is that only one folder is active at any time. The user selects different folders by clicking on the tab rider associated with a folder. To set up when the application is notified about events of the tabfolder or the tabfolders callback is invoked (if installed) use @example void fl_set_object_return(FL_OBJECT *obj, unsigned int when); @end example @noindent where the @code{when} argument can be one of @table @code @item @ref{FL_RETURN_NONE} Never report or invoke callback even if the selected folder has been changed. @item @ref{FL_RETURN_CHANGED} @item @ref{FL_RETURN_END_CHANGED} Result in a notification when a folder other that the currently active one has been selected (this is the default). @item @ref{FL_RETURN_END} @item @ref{FL_RETURN_ALWAYS} Notify when either a new or the already active folder has been selected. @end table In the releases before version 1.0.92 of the library only a callback for the folder was executed (if one was installed) on change of the selected folder bur not via e.g., @code{@ref{fl_do_forms()}} etc. This has changed with version 1.0.92. To get the old behaviour you have to build XForms with the @code{--enable-bwc-bs-hack} being set. To find out which folder is currently active the following routines the tab riders are available @findex fl_get_active_folder() @anchor{fl_get_active_folder()} @findex fl_get_active_folder_number() @anchor{fl_get_active_folder_number()} @findex fl_get_active_folder_name() @anchor{fl_get_active_folder_name()} @example FL_FORM *fl_get_active_folder(FL_OBJECT *obj); int fl_get_active_folder_number(FL_OBJECT *obj); const char *fl_get_active_folder_name(FL_OBJECT *obj); @end example @noindent All three functions essentially perform the same task, i.e., return a handle of the active folder, but the kind of handle returned is different. The first function returns the form associated with the folder, the second function the folder sequence number starting from 1 on the left, and the third the folder name. Depending on the application setup, one routine might be more convenient than the other two. To find out what the previous active folder was (which may be of similar interest as the currently active one) the following functions can be used: @findex fl_get_folder() @anchor{fl_get_folder()} @findex fl_get_folder_number() @anchor{fl_get_folder_number()} @findex fl_get_folder_name() @anchor{fl_get_folder_name()} @example FL_FORM *fl_get_folder(FL_OBJECT *obj) int fl_get_folder_number(FL_OBJECT *obj) const char *fl_get_folder_name(FL_OBJECT *obj) @end example @noindent Again, depending on the application, one might prefer one routine to the other two. @node Other Folder Routines @subsection Other Folder Routines To populate a tabbed folder, use the following routine @findex fl_addto_tabfolder() @anchor{fl_addto_tabfolder()} @example FL_OBJECT *fl_addto_tabfolder(FL_OBJECT *obj, const char *tab_name, FL_FORM *folder) @end example @noindent where @code{tab_name} is a string (with possible embedded newlines in it) indicating the text of the tab rider and @code{folder} is a regular form created between calls of @code{@ref{fl_bgn_form()}} and @code{@ref{fl_end_form()}}. Only the pointer to the form is required. This means that the application program should not destroy a form that has been added to a tabbed folder. The function returns the folder tab object, which is an object of class @code{FL_BUTTON}. The initial object color, label color, and other attributes (gravities, for example) of the tab button are inherited from the tabbed folder object @code{obj} and the location and size of the tab are determined automatically. You can change the attributes of the returned object just like any other objects, but not all possibilities result in a pleasing appearance. Note that although there is no specific requirement of what the backface of the folder/form should be, a boxtype other than @code{FL_FLAT_BOX} or @code{FL_NO_BOX} may not look nice. If the backface of the form is of @code{FL_FLAT_BOX} the associated tab will take on the color of the backface when activated. One thing to note is that each tab must have its own form, i.e., you should not associate the same form with two different tabs. However, you can create copies of a form and use these copies. To access the individual forms on the tabfolder, e.g., in order to modify something on it, use the following routines @findex fl_get_tabfolder_folder_bynumber() @anchor{fl_get_tabfolder_folder_bynumber()} @findex fl_get_tabfolder_folder_byname() @anchor{fl_get_tabfolder_folder_byname()} @findex fl_get_tabfolder_folder_byname_f() @anchor{fl_get_tabfolder_folder_byname_f()} @example FL_FORM *fl_get_tabfolder_folder_bynumber(FL_OBJECT *obj, int num); FL_FORM *fl_get_tabfolder_folder_byname(FL_OBJECT *obj, const char *name); FL_FORM *fl_get_tabfolder_folder_byname_f(FL_OBJECT *obj, const char *fnt, ...); @end example @noindent The functions take either the sequence number (the first tab on the left has a sequence number 1, the second 2 etc) or the tab name, which can either be passed directly as a string or via a format string like for @code{printf()} etc. and the corresponding (unspecified) arguments. The functions return the form associated with the number or the name. If the requested number or name is invalid, @code{NULL} is returned. If there are more tabs than that can be shown, the right-most tab will be shown as "broken". Clicking on the "broken" tab scrolls the tab to the right one per each click. To scroll to the left (if there are tabs scrolled-off screen from the left), clicking on the first tab scrolls right. How many tabs are "hidden" on the left can be determined and also set using the functions @findex fl_get_tabfolder_offset() @anchor{fl_get_tabfolder_offset()} @findex fl_set_tabfolder_offset() @anchor{fl_set_tabfolder_offset()} @example int fl_get_tabfolder_offset(FL_OBJECT *ojb); int gl_set_tabfolder_offset(FL_OBJECT *obj, int offset); @end example @noindent where @code{offset} is the number of tabs hidden on the left. Although a regular form (top-level) and a form used as a folder behave almost identically, there are some differences. In a top-level form, objects that do not have callbacks bound to them will be returned, when their states change, to the application program via @code{@ref{fl_do_forms()}} or @code{@ref{fl_check_forms()}}. When a form is used as a folder, objects that do not have a callback are ignored even when their states changes. The reason for this behavior is that presumably the application does not care while the changes take place and they only become relevant when the the folder is switched off and at that time the application program can decide what to do with these objects' states (apply or ignore for example). If immediate reaction is desired, just use callback functions for these objects. To obtain the number of folders in the tabfolder, the following routine can be used @findex fl_get_tabfolder_numfolders() @anchor{fl_get_tabfolder_numfolders()} @example int fl_get_tabfolder_numfolders(FL_OBJECT *obj); @end example To remove a folder, the following routine is available @findex fl_delete_folder() @anchor{fl_delete_folder()} @findex fl_delete_folder_bynumber() @anchor{fl_delete_folder_bynumber()} @findex fl_delete_folder_byname() @anchor{fl_delete_folder_byname()} @findex fl_delete_folder_byname_f() @anchor{fl_delete_folder_byname_f()} @example void fl_delete_folder(FL_OBJECT *obj, FL_FORM *folder); void fl_delete_folder_bynumber(FL_OBJECT *obj, int num); void fl_delete_folder_byname(FL_OBJECT *obj, const char *name); void fl_delete_folder_byname_f(FL_OBJECT *obj, const char *fmt, ...); @end example @noindent (the last two function differ in the way the tab names gets passed, the first is to be called with a simple string while the second expects a format string as used for @code{printf()} etc. and the appropriate number of arguments, from which the tab name gets constructed). wNote that after deletion, the number of folders in the tabfolder as well as the sequence numbers are updated. This means if you want to delete all folders after the second folder, you can do that by deleting the third folder repeatedly. The application program can select which folder to show by using the following routines @findex fl_set_folder() @anchor{fl_set_folder()} @findex fl_set_folder_bynumber() @anchor{fl_set_folder_bynumber()} @findex fl_set_folder_byname() @anchor{fl_set_folder_byname()} @findex fl_set_folder_byname_f() @anchor{fl_set_folder_byname_f()} @example void fl_set_folder(FL_OBJECT *obj, FL_FORM *folder); void fl_set_folder_bynumber(FL_OBJECT *obj, int num); void fl_set_folder_byname(FL_OBJECT *obj, const char *name); void fl_set_folder_byname_f(FL_OBJECT *obj, const char *fmt, ...); @end example @noindent (The latter two functions only differ in the way the tab name gets passed top them, the first accepts a simple string while the second expects a format string as used for @code{printf()} etc. and the appropriate number of (unspecified arguments, from which the tab name is constructed.) Since the area occupied by the tabbed folder contains the space for tabs, the following routine is available to obtain the actual folder size @findex fl_get_folder_area() @anchor{fl_get_folder_area()} @example void fl_get_folder_area(FL_OBJECT *obj, FL_Coord *x, FL_Coord *y, FL_OBJECT *w, FL_OBJECT *h) @end example @noindent where @code{x} and @code{y} are relative to the (top-level) form the tabbed folder belongs to. The size information may be useful for resizing the individual forms that has to go into the tabbed folder. Note that the folder area may not be constant depending on the current tabs (For example, adding a multi-line tab will reduce the area for the folders). Since tab size can vary depending on monitor/font resolutions, it is in general not possible to design the forms (folders) so they fit exactly into the folder area. To dynamically adjust the sizes of the folders so they fit, the following routine is available @findex fl_set_tabfolder_autofit() @anchor{fl_set_tabfolder_autofit()} @example int fl_set_tabfolder_autofit(FL_OBJECT *obj, int how); @end example @noindent where @code{how} can be one of the following constants: @table @code @tindex FL_NO @item FL_NO Do not scale the form. @tindex FL_FIT @item FL_FIT Always scale the form. @tindex FL_ENLARGE_ONLY @item FL_ENLARGE_ONLY Scale the form only if it is smaller than the folder area. @end table @noindent The function returns the old setting. @node Folder Remarks @subsection Remarks By default, the tab for each folder is drawn with a corner of 3 pixels so it appears to be a trapezoid rather than a square. To change the appearance of the tabs, you can adjust the corner pixels using the following routine @findex fl_set_default_tabfolder_corner() @anchor{fl_set_default_tabfolder_corner()} @example int fl_set_default_tabfolder_corner(int n); @end example @noindent where @code{n} is the number of corner pixels. A value of 1 or 0 makes the tabs appear to be squarish. The function returns the old value. A tabbed folder is a composite object consisting of a canvas and several foldertab buttons. Each individual form is shown inside the canvas. Folder switching is accomplished by some internal callbacks bound to the foldertab button. Should the application change the callback functions of the foldertab buttons, these new callback functions must take the responsibility of switching the active folder. Some visual effects like colors and label font of the tab rider buttons can be set all at once by calling the corresponding functions (i.e., @code{@ref{fl_set_object_color()}}, @code{@ref{fl_set_object_lstyle()}} etc.) with the tabbed folder object as the first argument. Individual tab rider buttons can also be modified by calling those function with the corresponding return value of @code{@ref{fl_addto_tabfolder()}} as the first argument. @code{fl_free_object(tabfolder)} does not free the individual forms that make up the tabfolder. See the demo program @file{folder.c} for an example use of tabbed folder class. A nested tabfolder might not work correctly at the moment. @node FormBrowser Object @section FormBrowser Object A form browser is another container class that is capable of holding multiple forms, the height of which in aggregate may exceed the screen height. The form browser also works obviously for a single form that has a height that is larger than the screen height. This object class was developed with contributed code from Steve Lamont of UCSD and the National Center for Microscopy and Imaging Research (@email{spl@@ucsd.edu}). @ifnottex @menu * Adding FormBrowser Objects: Adding FormBrowser Objects * FormBrowser Types: FormBrowser Types * FormBrowser Interaction: FormBrowser Interaction * Other FormBrowser Routines: Other FormBrowser Routines * Remarks: FormBrowser Remarks @end menu @end ifnottex @node Adding FormBrowser Objects @subsection Adding FormBrowser Objects Adding an object To add a formbrowser object to a form use the routine @findex fl_add_formbrowser() @anchor{fl_add_formbrowser()} @example FL_OBJECT *fl_add_formbrowser(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent The geometry indicated by @code{x}, @code{y}, @code{w} and @code{h} is the total area of the formbrowser, including scrollbars. @node FormBrowser Types @subsection FormBrowser Types There's only a single type of formbrowser available, the @tindex FL_NORMAL_FORMBROWSER @code{FL_NORMAL_FORMBROWSER}. @node FormBrowser Interaction @subsection FormBrowser Interaction Once a formbrowser is populated with forms, you can scroll the forms with the scrollbars and interact with any of the forms. All objects on the forms act, for the most part, the same way as they would if they were on separate forms, i.e., if there are callback functions bound to the objects, they will be invoked by the main loop when the states of the objects change. However, objects on the form that do not have callbacks bound to them will not be returned by @code{@ref{fl_do_forms()}} or @code{@ref{fl_check_forms()}}. Your application can be notified about changes of the scrollbars of the formbrowser. To set up under which conditions the application is notified or the formbrowsers callback is invoked (if installed) use @example void fl_set_object_return(FL_OBJECT *obj, unsigned int when); @end example @noindent where the @code{when} argument can be one of @table @code @item @ref{FL_RETURN_NONE} Never report or invoke callback (this is the default for the formbrowser object) @item @ref{FL_RETURN_CHANGED} Result in a notification whenever the position of one of the scrollbars has changed. @item @ref{FL_RETURN_END_CHANGED} Notification is sent if the position of a scrollbar has changed and the mouse button has been released. @item @ref{FL_RETURN_END} Notification on release of the mouse button. @item @ref{FL_RETURN_ALWAYS} Notify if the position of a scrollbar has changed or the mouse button has been released. @end table @node Other FormBrowser Routines @subsection Other FormBrowser Routines To populate a formbrowser, use the following routine @findex fl_addto_formbrowser() @anchor{fl_addto_formbrowser()} @example int fl_addto_formbrowser(FL_OBJECT *obj, FL_FORM *form); @end example @noindent where @code{form} is a pointer to a regular form created between calls of @code{@ref{fl_bgn_form()}} and @code{@ref{fl_end_form()}}. Only the form pointer is passed to the function, which means that the form should be valid for the duration of the formbrowser and the application program should not destroy a form that is added to a formbrowser before deleting the form from the formbrowser first. The function returns the total number of forms in the formbrowser. Note that although there is no specific requirement on what the backface of the form should be, not all boxtypes look nice. The form so added is appended to the list of forms that are already in the formbrowser. You can also use the following routine to obtain the total number of forms in a formbrowser @findex fl_get_formbrowser_numforms() @anchor{fl_get_formbrowser_numforms()} @example int fl_get_formbrowser_numforms(FL_OBJECT *formbrowser); @end example Although a regular form (top-level) and a form used inside a formbrowser behave almost identically, there are some differences. In a top-level form, objects that do not have callbacks bound to them will be returned to the application program when their states change via @code{@ref{fl_do_forms()}} or @code{@ref{fl_check_forms()}}. When a form is used as member of a formbrowser those objects that do not have callbacks are ignored even when their states change. To remove a form from the formbrowser, the following routine is available @findex fl_delete_formbrowser() @anchor{fl_delete_formbrowser()} @findex fl_delete_formbrowser_bynumber() @anchor{fl_delete_formbrowser_bynumber()} @example int fl_delete_formbrowser(FL_OBJECT *obj, FL_FORM *form); FL_FORM* fl_delete_formbrowser_bynumber(FL_OBJECT *obj, int num); @end example @noindent In the first function you specify the form to be removed from the formbrowser by a pointer to the form. If the form was removed successfully the function returns the remaining number of forms in the formbrowser, otherwise -1. In the second function, you indicate the form to be removed with a sequence number, an integer between 1 and the number of forms in the browser. The sequence number is basically the order in which forms were added to the formbrowser. After a form is removed, the sequence numbers are re-adjusted so they are always consecutive. The function returns @code{NULL} if @code{num} was invalid, otherwise it returns address of the form that was removed. To replace a form in formbrowser, the following routine is available @findex fl_replace_formbrowser() @anchor{fl_replace_formbrowser()} @example FL_FORM *fl_replace_formbrowser(FL_OBJECT *obj, int num, FL_FORM *form); @end example @noindent where @code{num} is the sequence number of the form that is to be replaced by @code{form}. For example, to replace the first form in the browser with a different form, you should use 1 for @code{num}. The function returns the form that has been replaced on success, otherwise @code{NULL} is returned. You can also insert a form into a formbrowser at arbitrary locations using the following routine @findex fl_insert_formbrowser() @anchor{fl_insert_formbrowser()} @example int fl_insert_formbrowser(FL_OBJECT *obj, int num, FL_FORM *form); @end example @noindent where @code{num} is the sequence number before which the new form @code{form} is to be inserted into the formbrowser. If successful the function returns the number of forms in the formbrowser, otherwise -1. To find out the sequence number of a particular form, the following routine is available @findex fl_find_formbrowser_form_number() @anchor{fl_find_formbrowser_form_number()} @example int fl_find_formbrowser_form_number(FL_OBJECT *obj, FL_FORM *form); @end example @noindent The function returns a number between 1 and the number of forms in the formbrowser on success, otherwise 0. To obtain the form handle from the sequence number, use the following routine @findex fl_get_formbrowser_form() @anchor{fl_get_formbrowser_form()} @example int fl_get_formbrowser_form(FL_OBJECT *obj, int num); @end example By default, if the size of the forms exceeds the size of the formbrowser, scrollbars are added automatically. You can use the following routines to control the scrollbars @findex fl_set_formbrowser_hscrollbar() @anchor{fl_set_formbrowser_hscrollbar()} @findex fl_set_formbrowser_vscrollbar() @anchor{fl_set_formbrowser_vscrollbar()} @example void fl_set_formbrowser_hscrollbar(FL_OBJECT *obj, int how); void fl_set_formbrowser_vscrollbar(FL_OBJECT *obj, int how); @end example @noindent where @code{how} can be one of the following @table @code @tindex FL_ON @item FL_ON Always on. @tindex FL_OFF @item FL_OFF Always off. @tindex FL_AUTO @item FL_AUTO On when needed. This is the default. @end table The vertical scrollbar by default scrolls a fixed number of pixels. To change it so each action of the scrollbar scrolls to the next forms, the following routine is available @findex fl_set_formbrowser_scroll() @anchor{fl_set_formbrowser_scroll()} @example void fl_set_formbrowser_scroll(FL_OBJECT *obj, int how) @end example @noindent where @code{how} can be one of the following @table @code @tindex FL_SMOOTH_SCROLL @anchor{FL_SMOOTH_SCROLL} @item FL_SMOOTH_SCROLL The default. @tindex FL_JUMP_SCROLL @anchor{FL_JUMP_SCROLL} @item FL_JUMP_SCROLL Scrolls in form increments. @end table To obtain the form that is currently the first form in the formbrowser visible to the user, the following can be used @findex fl_get_formbrowser_topform() @anchor{fl_get_formbrowser_topform()} @example FL_FORM *fl_get_formbrowser_topform(FL_OBJECT *obj); @end example You can also set which form to show by setting the top form using the following routine @findex fl_set_formbrowser_topform() @anchor{fl_set_formbrowser_topform()} @findex fl_set_formbrowser_topform_bynumber() @anchor{fl_set_formbrowser_topform_bynumber()} @example int fl_set_formbrowser_topform(FL_OBJECT *obj, FL_FORM *form); FL_FORM* fl_set_formbrowser_topform_bynumber(FL_OBJECT *obj, int num); @end example @noindent The first function returns the sequence number of the form and the second function returns the form with sequence number @code{num}. Since the area occupied by the formbrowser contains the space for the scrollbars, the following routine is available to obtain the actual size of the forms area @findex fl_get_formbrowser_area() @anchor{fl_get_formbrowser_area()} @example void fl_get_formbrowser_area(FL_OBJECT *obj, int *x, int *y, int *w, int *h); @end example @noindent where @code{x} and @code{y} are relative to the (top-level) form the formbrowser belongs to. To programatically scroll within a formbrowser in horizontal and vertical direction, the following routines are available @findex fl_set_formbrowser_xoffset() @anchor{fl_set_formbrowser_xoffset()} @findex fl_set_formbrowser_yoffset() @anchor{fl_set_formbrowser_yoffset()} @example int fl_set_formbrowser_xoffset(FL_OBJECT *obj, int offset); int fl_set_formbrowser_yoffset(FL_OBJECT *obj, int offset); @end example @noindent where @code{offset} is a positive number, measuring in pixels the offset from the the natural position from the left and the top, respectively. In other words, 0 indicates the natural position of the content within the formbrowser. An x-offset of 10 means the content is scrolled 10 pixels to the left. Similarly an y-offset of 10 means the content is scrolled by 10 pixels upwards. To obtain the current offsets, use the following routines @findex fl_get_formbrowser_xoffset() @anchor{fl_get_formbrowser_xoffset()} @findex fl_get_formbrowser_yoffset() @anchor{fl_get_formbrowser_yoffset()} @example int fl_get_formbrowser_xoffset(FL_OBJECT *obj); int fl_get_formbrowser_yoffset(FL_OBJECT *obj); @end example @node FormBrowser Remarks @subsection Remarks A call of @code{fl_free_object(formbrowser)} does not free the individual forms, it only frees the formbrowser object itself. See the demo program @file{formbrowser.c} for an example use of formbrowser class. A nested formbrowser might not work correctly at the moment. xforms-1.2.4/doc/part4.texi0000644000175000017500000000046011665175504012461 00000000000000@node Part IV @unnumbered @emph{Part IV - Designing Object Classes} @menu * Part IV Introduction:: * Part IV Global Structure:: * Part IV Events:: * Part IV The Type FL_OBJECT:: * Part IV Drawing Objects:: * Part IV An Example:: * Part IV New Buttons:: * Part IV Using a Pre-emptive Handler:: @end menu xforms-1.2.4/doc/part5_useful_functions.texi0000664000175000017500000005250312340166201016125 00000000000000@node Part V Some Useful Functions @chapter Some Useful Functions @ifnottex @menu * Misc. Functions:: * Windowing Support:: * Cursors:: * Clipboard:: @end menu @end ifnottex @node Misc. Functions @section Misc. Functions The following routine can be used to sound the keyboard bell (if capable): @findex fl_ringbell() @anchor{fl_ringbell()} @example void fl_ringbell(int percent); @end example @noindent where @code{percent} can range from -100 to 100 with 0 being the default volume setting of the keyboard. A value of 100 indicates maximum volume and a value of -100 minimum volume (off). Note that not all keyboards support volume variations. To get the user name who's running the application you can use the routine @findex fl_whoami() @anchor{fl_whoami()} @example const char *fl_whoami(void); @end example To get a string form of the current date and time, the following routine is available: @findex fl_now() @anchor{fl_now()} @example const char *fl_now(void); @end example @noindent The format of the string is of the form @code{"Wed Jun 30 21:49:08 1993"}. The following time related routine might come in handy @findex fl_gettime() @anchor{fl_gettime()} @example void fl_gettime(unsigned long *sec, unsigned long *usec); @end example @noindent Upon function return @code{sec} and @code{usec} are set to the current time, expressed in seconds and microseconds since 00:00 GMT January, 1970. This function is most useful for computing time differences. Th function @findex fl_mode_capable() @anchor{fl_mode_capable()} @example int fl_mode_capable(int mode, int warn); @end example @noindent allows to determine the visual classes the system is capable of. @code{mode} must be one of @code{GrayScale}, @code{StaticGray}, @code{PseudoColor}, @code{StaticColor}, @code{DirectColor} and @code{TrueColor} and the function returns 1 if the system is capable of displaying in this visual class and 0 otherwise. If @code{warn} is set a warning is printed out in case the capability asked for isn't available. To find out the "depth" of the current display (basically the number of bits used for colors) use the function @findex fl_get_visual_depth @anchor{fl_get_visual_depth} @example int fl_get_visual_depth(void); @end example Finally @findex fl_msleep() @anchor{fl_msleep()} @example int fl_msleep(usigned long msec); @end example @noindent allows to wait for a number of milli-seconds (with the best resolution possible on your system). @node Windowing Support @section Windowing Support Some of the following routines are also used internally by the Forms Library as an attempt to localize window system dependencies and may be of some general use. Be warned that these routines may be subject to changes, both in their API and/or functionality. You can create and show a window with the following routines @findex fl_wincreate() @anchor{fl_wincreate()} @findex fl_winshow() @anchor{fl_winshow()} @example Window fl_wincreate(const char *name); Window fl_winshow(Window win); @end example @noindent where the parameter @code{win} of @code{@ref{fl_winshow()}} is the window ID returned by @code{@ref{fl_wincreate()}}. The title of the window is set by the @code{name} argument. Between the creation and showing of the window other attributes of the window can be set. Note that a window opened this way is always a top level window and uses all the Forms Library's defaults (visual, depth etc.). Another thing about @code{@ref{fl_winshow()}} is that it will wait for and gobble up the first @code{Expose} event and you can draw into the window immediately after the function returns. It is sometimes more convenient to create and show a window in a single call using @findex fl_winopen() @anchor{fl_winopen()} @example Window fl_winopen(const char *name); @end example @noindent This will open a (top-level) window with the title @code{name}. A window so opened can be drawn into as soon as the function returns, i.e., @code{@ref{fl_winopen()}} waits until the window is ready to be drawn to. The newly opened window will have the following default attributes @table @code @item event_mask @code{ExposureMask}, @code{KeyPressMask}, @code{KeyReleaseMask}, @code{ButtonPressMask}, @code{ButtonReleaseMask}, @code{OwnerGrabButtonMask}, @code{ButtonMotionMask}, @code{PointerMotionMask}, @code{PointerMotionHintMask}, @code{StructureNotifyMask} @item backing_store as set by @code{fl_cntl.backingStore} @item class @code{InputOutput} @item visual same as Forms Library's default @item colormap same as Forms Library's default @end table To make a top-level window a sub-window of another window use the following routine @findex fl_winreparent() @anchor{fl_winreparent()} @example int fl_winreparent(Window win, Window new_parent); @end example @noindent The origin of the window @code{win} will be at the origin of the parent window @code{new_parent}. At the time of the function call, both the window and the parent window must be valid windows. By default, a newly opened window will have a size of 320 by 200 pixels and no other constraints. You can modify the default or constraints using the following routines prior to calling @code{@ref{fl_winopen()}}: @findex fl_initial_winsize() @anchor{fl_initial_winsize()} @findex fl_winsize() @anchor{fl_winsize()} @example void fl_initial_winsize(FL_Coord w, FL_Coord h); void fl_winsize(FL_Coord w, FL_Coord h); @end example @noindent These two routines set the preferred window size. @code{w} and @code{h} are the width and height of the window in pixels. @code{@ref{fl_winsize()}} in addition will make the window non-resizeable (but you can still resize the window programmatically) by setting the minimum and maximum window size to the requested size via @code{WMHints}. The effect of a window having this property is that it can't be interactively resized (provided the window manager cooperates). Also the state of the window when opening it can be influenced by the function @findex fl_initial_winstate() @anchor{fl_initial_winstate()} @example void fl_initial_winstate(int state); @end example where @code{state} is on of the XLib constants @code{NormalState} (the default) or @code{IconicState}, which will result in the opened window being iconified. The third possible constant, @code{WithdrawnState}, doesn't make much sense in this context. It is sometimes desirable to have a window that is resizeable but only within a useful range. To set such a constraint use the following functions: @findex fl_winminsize() @anchor{fl_winminsize()} @findex fl_winmaxsize() @anchor{fl_winmaxsize()} @example void fl_winminsize(Window window, FL_Coord minw, FL_Coord minh); void fl_winmaxsize(Window window, FL_Coord maxw, FL_Coord maxh); @end example @noindent These two routines can also be used after a window has become visible. For windows still to be created/opened, use @code{None} for the window parameter. For example, if we want to open a window of 640 by 480 pixels and have it remain resizeable but within a permitted range, code similar to the following can be used: @example fl_initial_winsize(640, 480); fl_winminsize(None, 100,100); fl_winmaxsize(None, 1024,768) win = fl_winopen("MyWin"); @end example In addition to the window size preference you can also set the preferred position of a window to be opened: @findex fl_winposition() @anchor{fl_winposition()} @example void fl_winposition(FL_Coord x, FL_Coord y); @end example @noindent where @code{x} and @code{y} are the coordinates of the upper-left corner of the window relative to the root window. Alternatively, you can set the geometry (position and size) in a single function call: @findex fl_initial_wingeometry() @anchor{fl_initial_wingeometry()} @findex fl_wingeometry() @anchor{fl_wingeometry()} @example void fl_initial_wingeometry(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h); void fl_wingeometry(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h); @end example @noindent Again, windows for which @code{@ref{fl_wingeometry()}} had been created will not allow interactive resizing later on. There are further routines that can be used to change other aspects of the window to be created: @findex fl_winaspect() @anchor{fl_winaspect()} @example void fl_winaspect(Window win, FL_Coord x, FL_Coord y); @end example @noindent This will set the aspect ratio of the window for later interactive resizing. To change the window title (and its associated icon title) use @findex fl_wintitle() @anchor{fl_wintitle()} @findex fl_wintitle_f() @anchor{fl_wintitle_f()} @example void fl_wintitle(Window win, const char *title); void fl_wintitle_f(Window win, const char *fmt, ...); @end example @noindent While the first function only accepts a simple string for the window title the second one allows to pass a format string just like the one used for @code{printf()} etc. and an appropriate number of further arguments which are used to construct the title. To change the icon title only use the routines @findex fl_winicontitle() @anchor{fl_winicontitle()} @findex fl_winicontitle_f() @anchor{fl_winicontitle_f()} @example void fl_winicontitle(Window win, const char *title); void fl_winicontitle_f(Window win, const char *fmt, ...); @end example To install an icon for the window use @findex fl_winicon() @anchor{fl_winicon()} @example void fl_winicon(Window win, Pixmap icon, Pixmap mask); @end example You can suppress the window manager's decoration or make a window a transient one by using the following routines prior to creating the window @findex fl_noborder() @anchor{fl_noborder()} @findex fl_transient() @anchor{fl_transient()} @example void fl_noborder(void); void fl_transient(void); @end example You can also set the background of the window to a certain color using the following call @findex fl_winbackground() @anchor{fl_winbackground()} @example void fl_winbackground(Window win, unsigned long pixel); @end example It is possible to set the steps by which the size of a window can be changed by using @findex fl_winstepsize() @anchor{fl_winstepsize()} @example void fl_winstepsize(Window win, int xunit, int yunit); @end example @noindent where @code{xunit} and @code{yunit} are the number of pixels of changes per unit in x- and y- directions, respectively. Changes to the window size will be multiples of these units after this call. Note that this only applies to interactive resizing. To change constraints (size and aspect ratio) on an active window, you can use the following routine @findex fl_reset_winconstraints() @anchor{fl_reset_winconstraints()} @example void fl_reset_winconstraints(Window win); @end example The following routines are available to get information about an active window win: @findex fl_get_winsize() @anchor{fl_get_winsize()} @findex fl_get_winorigin() @anchor{fl_get_winorigin()} @findex fl_get_wingeometry() @anchor{fl_get_wingeometry()} @example void fl_get_winsize(Window win, FL_Coord *w, FL_Coord *h); void fl_get_winorigin(Window win, FL_Coord *x, FL_Coord *y); void fl_get_wingeometry(Window win, FL_Coord *x, FL_Coord *y, FL_Coord *w, FL_Coord *h); @end example @noindent All values returned are in pixels. The origin of a window is measured from the upper left hand corner of the root window. To change the size of a window programmatically the following function is available: @findex fl_winresize() @anchor{fl_winresize()} @example void fl_winresize(Window win, FL_Coord neww, FL_Coord newh); @end example @noindent Resizing will not change the origin of the window (relative to the root window). While the window gets resized originally set restraints will remain unchanged. E.g., if a window was not permitted to be resized interactively it will continue to remain unresizeable by the user. To move a window without resizing it use the following function: @findex fl_winmove() @anchor{fl_winmove()} @example void fl_winmove(Window win, FL_Coord newx, FL_Coord newy); @end example To move and resize a window, use the following routine @findex fl_winreshape() @anchor{fl_winreshape()} @example void fl_winreshape(Window win, FL_Coord newx, FL_Coord newy, FL_Coord neww, FL_Coord newh); @end example The following routine is available to iconify a window @findex fl_iconify() @anchor{fl_iconify()} @example int fl_iconify(Window win); @end example @noindent The return value is nonzero when the message, asking for iconification of the window, was send successfully to the window manager, otherwise zero (but this may not be taken as a sure sign that the window was really iconified). To make a window invisible use @findex fl_winhide() @anchor{fl_winhide()} @example void fl_winhide(Window win); @end example @noindent A window hidden this way can be shown again later using @code{@ref{fl_winshow()}}. To hide and destroy a window, use the following calls @findex fl_winclose() @anchor{fl_winclose()} @example void fl_winclose(Window win); @end example @noindent There will be no events generated from @code{@ref{fl_winclose()}}, i.e., the function waits and gobbles up all events for window @code{win}. In addition, this routine also removes all callbacks associated with the closed window. The following routine can be used to check if a window ID is valid or not @findex fl_winisvalid() @anchor{fl_winisvalid()} @example int fl_winisvalid(Window win); @end example @noindent Note that excessive use of this function may negatively impact performance. Usually an X application should work with window managers and accepts the keyboard focus assignment. In some special situations, explicit override of the keyboard focus might be warranted. To this end, the following routine exists: @findex fl_winfocus() @anchor{fl_winfocus()} @example void fl_winfocus(Window win); @end example @noindent After this call keyboard input is directed to window @code{win}. @node Cursors @section Cursors XForms provides a convenience function to change the cursor shapes: @findex fl_set_cursor() @anchor{fl_set_cursor()} @example void fl_set_cursor(Window win, int name); @end example @noindent where @code{win} must be a valid window identifier and @code{name} is one of the symbolic cursor names (shapes) defined by standard X or the integer values returned by @code{@ref{fl_create_bitmap_cursor()}} or one of the Forms Library's pre-defined symbolic names. The X standard symbolic cursor names (all starts with @code{XC_}) are defined in @code{} (you don't need to explicitly include this as @code{} already does this for you). For example, to set a watch-shaped cursor for form @code{form} (after the form is shown), the following call may be made @example fl_set_cursor(form->window, XC_watch); @end example The Forms Library defines a special symbolic constants, @tindex FL_INVISIBLE_CURSOR @code{FL_INVISIBLE_CURSOR} that can be used to hide the cursor for window @code{win}: @example fl_set_cursor(win, FL_INVISIBLE_CURSOR); @end example Depending on the structure of the application program, a call of @code{XFlush(fl_get_display());} may be required following @code{@ref{fl_set_cursor()}}. To reset the cursor to the XForms's default (an arrow pointing northwest), use the following routine @findex fl_reset_cursor() @anchor{fl_reset_cursor()} @example void fl_reset_cursor(Window win); @end example To change the color of a cursor use the following routine @findex fl_set_cursor_color() @anchor{fl_set_cursor_color()} @example void fl_set_cursor_color(int name, FL_COLOR fg, FL_COLOR bg); @end example @noindent where @code{fg} and @code{bg} are the foreground and background color of the cursor, respectively. If the cursor is being displayed, the color change is visible immediately. It is possible to use cursors other than those defined by the standard cursor font by creating a bitmap cursor with @findex fl_create_bitmap_cursor() @anchor{fl_create_bitmap_cursor()} @example int fl_create_bitmap_cursor(const char *source, const char *mask, int w, int h, int hotx, int hoty); @end example @noindent where @code{source} and @code{mask} are two (x)bitmaps. The mask defines the shape of the cursor. The pixels set to 1 in the mask define which source pixels are displayed. If @code{mask} is @code{NULL} all bits in @code{source} are displayed. @code{hotx} and @code{hoty} are the hotspot of the cursor (relative to the source's origin). The function returns the cursor ID which can be used in calls of @code{@ref{fl_set_cursor()}} and @code{@ref{fl_set_cursor_color()}} etc. Finally, there is a routine to create animated cursors where several cursors are displayed one after another: @findex fl_create_animated_cursor() @anchor{fl_create_animated_cursor()} @example int fl_create_animated_cursor(int *cur_names, int interval); @end example @noindent The function returns the cursor name (ID) that can be shown later via @code{@ref{fl_set_cursor()}}. In the function call @code{cur_names} is an array of cursor names (either X standard cursors or cursor names returned by @code{@ref{fl_create_bitmap_cursor()}}), terminated by -1. Parameter @code{interval} indicates the time each cursor is displayed before it is replaced by the next in the array. An interval about @w{150 msec} is a good value for typical uses. Note that there is currently a limit of 24 cursors per animation sequence. Internally animated cursor works by utilizing the timeout callback. This means that if the application blocks (thus the main loop has no chance of servicing the timeouts), the animation will stop. See demo program @file{cursor.c} for an example use of the cursor routines. @node Clipboard @section Clipboard Clipboard is implemented in the Forms Library using the X selection mechanism, more specifically the @code{XA_PRIMARY} selection. X selection is a general and flexible way of sharing arbitrary data among applications on the same server (the applications are of course not necessarily running on the same machine). The basic (and over-simplified) concept of the X selection can be summarized as follows: the X Server is the central point of the selection mechanism and all applications running on the server communicate with other applications through the server. The X selection is asynchronous in nature. Every selection has an owner (an application represented by a window) and every application can become owner of the selection or lose the ownership. The clipboard in Forms Library is a lot simpler than the full-fledged X selection mechanism. The simplicity is achieved by hiding and handling some of the details and events that are of no interests to the application program. In general terms, you can think of a clipboard as a read-write buffer shared by all applications running on the server. The major functionality you want with a clipboard is the ability to post data onto the clipboard and request the content of the clipboard. To post data onto the clipboard, use the following routine @tindex FL_LOSE_SELECTION_CB @findex fl_stuff_clipboard() @anchor{fl_stuff_clipboard()} @example typedef int (*FL_LOSE_SELECTION_CB)(FL_OBJECT *obj, long type); int fl_stuff_clipboard(FL_OBJECT *obj, long type, const void *data, long size, FL_LOSE_SELECTION_CB callback); @end example @noindent where @code{size} is the size (in bytes) of the content pointed to by @code{data}. If successful, the function returns a positive value and the data will have been copied onto the clipboard. The callback is the function that will be called when another application takes ownership of the clipboard. For textual content the application that loses the clipboard should typically undo the visual cues about the selection. If no action is required when losing the ownership a @code{NULL}q callback can be passed. The @code{obj} argument is used to obtain the window (owner) of the selection. @code{type} is currently unused. At the moment the return value of @code{lose_selection_callback()} is also unused. The data posted onto the clipboard are available to all applications that manipulate @code{XA_PRIMARY}, such as xterm etc. To request the current clipboard content use the following routine @tindex FL_SELECTION_CB @findex fl_request_clipboard() @anchor{fl_request_clipboard()} @example typedef int (*FL_SELECTION_CB)(FL_OBJECT *obj, long type, const void * data, long size); int fl_request_clipboard(FL_OBJECT *obj, long type, FL_SELECTION_CB callback); @end example @noindent where @code{callback} is the callback function that gets called when the clipboard content is obtained. The content @code{data} passed to the callback function should not be modified. One thing to remember is that the operation of the clipboard is asynchronous. Requesting the content of the clipboard merely asks the owner of the content for it and you will not have the content immediately (unless the asking object happens to own the selection). XForms main event loop takes care of the communication between the requesting object and the owner of the clipboard and breaks up and re-assembles the content if it exceeds the maximum protocol request size (which has a guaranteed minimum of @w{16 kB}, but typically is larger). If the content of the clipboard is successfully obtained the main loop invokes the lose selection callback of the prior owner and then the requesting object's callback function. The function returns a positive number if the requesting object owns the selection (i.e., the callback could beinvoked before the function returned) and 0 otherwise. If there is no selection the selection callback is called with an empty buffer and the length of the buffer is set to 0. In that case @code{@ref{fl_request_clipboard()}} returns -1. xforms-1.2.4/doc/part3_popups.texi0000644000175000017500000015516612252564577014111 00000000000000@node Part III Popups @chapter Popups Popup is not an object class. In contrast to normal objects popups are only shown for a short time in their own window and, while they are shown, no interaction with other objects is possible. So they don't fit directly into the normal event loop where one waits for user actions via @code{@ref{fl_do_forms()}}. Instead, when used stand-alone (e.g., for a context menu) they are shown on a call of the function @code{@ref{fl_popup_do()}}, which returns when the the user is done with the popup and it has been removed from the screen. Only idle callbacks and timers etc.@: are executed in the background while a popup is being shown. Popups are the building blocks for menu and selector objects, which internally create and use popups. Thus it might be helpful to understand how popups work to get the most out of these objects. All functions dealing with popups have names starting with @code{'fl_popup_'}, functions for individual entries start with @code{'fl_popup_entry_'} and typedefs as well as macros with @code{'FL_POPUP_'}. @ifnottex @menu * Adding Popups: Adding Popups * Popup Interaction: Popup Interaction * Other Popup Routines: Other Popup Routines * Popup Attributes: Popup Attributes @end menu @end ifnottex @node Adding Popups @section Adding Popups There are two ways to create and populate a popup with entries. The first method, that allows more fine-grained control consists of first generating a popup and then adding entries. Using this method all the properties of entries can be set immediately. The second method, to be discussed later, is simpler and may be sufficient for many applications, and internally uses the first method. To define a new popup using the more general interface call @findex fl_popup_add() @anchor{fl_popup_add()} @example FL_POPUP *fl_popup_add(Window win, const char *title); @end example @noindent The function returns the address of the new popup on success and @code{NULL} on failure. @code{win} is the window of a parent object (use @code{@ref{FL_ObjWin()}} to find out about it). You can also use @code{@ref{fl_root}} for the root window, with @code{None} having the same effect . @code{title} is an optional string that gets shown at the top of the popup in a framed box. If not wanted pass an empty string or @code{NULL}. The function returns a pointer to a new popup or @code{NULL} on failure. The title may contain embedded newline characters, this allows to create titles that span more than one line.) There is no built-in limit to the number of popups that can be created. Once you have popup you may add one or more entries by using @findex fl_popup_add_entries() @anchor{fl_popup_add_entries()} @example FL_POPUP_ENTRY *fl_popup_add_entries(FL_POPUP *popup, const char *entries, ...); @end example @noindent On success the return value is the address of the first entry created and @code{NULL} on failure. The first argument, @code{entries}, is a pointer to the popup the new entry (or entries) is added to. The second argument, @code{entries}, encodes information about the entries to add. In the most simple case it consists just of the entries texts, separated by @code{|} characters, e.g., @w{@code{"Item 1|Item 2|Item 3"}}. This would create three simple entries in the popup with labels @code{"Item 1"}, @code{"Item 2"} and @code{"Item 3"}. The @code{entries} string may contain newline characters which allows to create entries that span more than a single line. There's no built-in limit to the number of entries than be added to a popup. @code{@ref{fl_popup_add_entries()}} can be called repeatedly to append further entries to a popup. It often is necessary to have more complex entries. E.g., one may want to have keyboard shortcuts for entries, which are shown on the right hand side of an entry, one may want to have sub-popups or set callbacks etc. This can be achieved by embedding special character sequences within the string describing the entries and passing further arguments to the function, similar to the use of a format string in e.g., @code{printf(3)}. All special sequences start with a @code{%}. The following sequences are recognized: @table @code @item %x Set a value of type @code{long int} that's passed to all callback routines for the entry. The value must be given in the arguments following the @code{entries} string. @item %u Set a @code{user_void} pointer that's passed to all callbacks of the entry. The pointer must be specified in the arguments following the @code{entries} string. @item %f Set a callback function that gets called when the entry is selected. The function is of type @example int callback(FL_POPUP_RETURN *r); @end example Information about the entry etc.@: gets passed to the callback function via the @code{FL_POPUP_RETURN} structure (see below) and the return value of the function can be used to keep the selection being reported back to the caller of @code{@ref{fl_popup_do()}} by returning a value of @code{FL_IGNORE} (-1). The functions address must be given in the arguments following the @code{entries} string. @item %E Set a callback routine that gets called each time the mouse enters the entry (as long as the entry isn't disabled or hidden). The type of the function is the same as that of the callback function for the selection of the item but it's return value is never used. The functions address must be given in the arguments following the @code{entries} string. @item %L Set a callback routine that gets called each time the mouse leaves the entry. The type of the function is the same as that of the callback function for the selection of the entry but it's return value is never used. The functions address must be given in the arguments following the @code{entries} string. @item %m When this is specified a sub-popup gets opened when the mouse enters the entry (the entry itself thus can't be selected). The sub-popup to be opened must be an already existing popup and its address must be given in the arguments following the @code{entries} string. A triangle will be drawn on the right of the entry to indicate that it's an entry for a sub-popup. Mutually exclusive with @code{%t}, @code{%T}, @code{%r}, @code{%R} and @code{%l}. @item %t @itemx %T This makes the entry a "toggle" entry, an entry that represents binary states and gets a check-mark drawn on its left if in "on" state. If created with @code{%t} its in "off" state at the start, if created with @code{"T"} its in "on" state. Switching states happens automatically when the entry is selected. Mutually exclusive with @code{%m}, @code{%r}, @code{%R} and @code{%l}. @item %r @itemx %R This makes the entry a "radio" entry, i.e., it becomes part of a group of entries of which only one can be "on" at a time. The group, an integer value (don't use @code{INT_MIN} and @code{INT_MIN}), must be given in the arguments following the @code{entries} string. Radio entries are drawn with a small circle to the left, with the one for the entry in "on" state filled with a color (blue per default). When a radio entry is selected by the user that was in "off" state the entry of the group that was is "on" state before is automatically switched to "off" state. If the entry gets created with @code{%r} the entry is in "off" state, if created with @code{%R} it's in "on" state (in that case all entries created before in "on" state are reset to "off" state, i.e., the one created last "wins"). Mutually exclusive with @code{%m}, @code{%t}, @code{%T} and @code{%l}. @item %l This creates not a real entry but indicates that a line is to be drawn to visually group other entries. While other properties can be set for such an "entry" only the "hidden" property (see below) is taken into acount. Mutually exclusive with @code{%m}, @code{%t}, @code{%T}, @code{%} and @code{%R}. @item %d Marks the entry as disabled, i.e., it can't be selected and its text is per default drawn in a different color @item %h Marks the entry as hidden, i.e., it is not shown while in this state. @item %S For entries with shortcut keys it's quite common to have them shown on the right hand side. Using @code{%S} you can split the entrys text into two parts, the first one (before @code{%S}) being drawn flushed left and the second part flushed right. Note that using this special sequence doesn't automatically sets a shortcut key, this still has to be done using @code{%s}. @item %s Sets one or more shortcut keys for an entry. Requires a string with the shortcuts in the arguments following the @code{entries} string, @pxref{Shortcuts} for details on how to define shortcuts. Please note that the character in the label identical to the shortcut character is only shown as underlined if @code{%S} isn't used. @item %% Use this to put a @code{%} character within the text of an entry. @end table Please note that since @code{@ref{fl_popup_add_entries()}} is a variadic function (i.e., it takes a variable number of arguments) only very limited error checking is possible and thus it is of importance that the arguments passed to the function have exactly the required types! The return value of @code{@ref{fl_popup_add_entries()}} is a pointer to the first of the entries created. Since entries are stored as a linked list this value can be used to iterate over the list (see below for more information about the @code{@ref{FL_POPUP_ENTRY}} structure). If the function returns @code{NULL} no entries were created. A typical piece of code creating a popup may look like this: @example int save_cb(FL_POPUP_RETURN *result) @{ ... @} int main(int argc, char *argv[]) @{ FL_POPUP *popup; File *fp; ... popup = fl_popup_add(None, NULL); fl_popup_add_entries(popup, "Save%SCtrl+S%s%f%u|" "Quit%SEsc%s|" "%l|" "Work Offline%SCtrl+O%T%s", "^S", save_cb, (void *) fp, "^[", "^O"); ... @} @end example @noindent This creates a popup with three entries. The first one has the label @code{"Save"} shown at the left and @code{"Ctrl+S"} at the right can be selected by pressing @code{S}, in which case the function @code{save_cb()} will be invoked with a pointer to a structure that, beside other informations, contains the file pointer @code{fp}. The second entry has the labels @code{"Quit"} and @code{"Esc"} and it's shortcut key is set to @code{}. Below this entry a separator line is drawn, followed by the third entry with labels @code{"Work Offline"} and @code{"Ctrl+O"} and shortcut key @code{O}. This label is a "toggle" entry in "on" state, thus a check-marker is shown beside it. A few remarks about the callback routines. All have a type of @code{FL_POPUP_CB} as given by this @code{typedef}: @anchor{FL_POPUP_CB} @tindex FL_POPUP_CB @example typedef int (*FL_POPUP_CB)(FL_POPUP_RETURN *); @end example @noindent There are three kinds of callbacks, all with the same type. Whenever an item is entered (by moving the mouse on top of it or with the keyboard) its enter callback function is invoked (if one is set). Exceptions are entries that are disabled or hidden or entries, that just stand for separator lines. When an entry that can receive enter callbacks is left, its leave callback is invoked. Leave callbacks are not called when a selection has been made. Instead, only the selection callback for the selected entry is invoked. A "sub-popup entry", i.e., an entry that when entered results in a sub-popup to open, also can have an enter callback. Its leave callback is not called when the user moves the mouse onto the sub-popup but only once the sub-popup has been closed again and the mouse has been moved off the sub-popup entry. While enter and leave callback functions are defined to return an integer value, it's never used. But for the third kind of callback, invoked on selection of an entry, this isn't true. Instead, the callbacks return value is important: if it is @code{FL_IGNORE} (-1), the selection isn't reported back to the caller (and following callbacks also aren't called). This can be useful when the callback function already does everything required and nothing is left to be done. All callbacks receive a pointer to a structure of the type @code{FL_POPUP_RETURN}: @anchor{FL_POPUP_RETURN} @tindex FL_POPUP_RETURN @example typedef struct @{ long int val; /* value assigned to entry */ void *user_data; /* pointer to user data */ const char *text; /* text of selected popup entry */ const char *label; /* text drawn on left */ const char *accel; /* text drawn on right */ const FL_POPUP_ENTRY *entry; /* selected popup entry */ const FL_POPUP *popup; /* (sub-) popup it belongs to */ @} FL_POPUP_RETURN; @end example @code{val} is the value set by @code{"%x"}. If @code{"%x"} wasn't given, it's an automatically generated value: when a popup is created with @code{@ref{fl_popup_add_entries()}} a counter is initalized to 0. Whenever an entry gets added the value of the counter is assigned to the entry and then incremented. Unless a different value is set explicitely via @code{"%x"} the first entry added to a popup thus gets a value @code{val} of 0, the second one gets 1 etc. This even holds for entries that just stand for separator lines. In simple situations the value of @code{val} is probably sufficient to identify which entry got selected. Please note: it is possible that by setting the @code{val} members two or more structures for items of the same popup get the same value. It is the programmers responsibility to avoid that (unless, of course, that's just what you intended). The @code{user_data} member of the structure is the @code{user_void} pointer set via @code{"%u"}. It allows to pass more complex data to the callback function (or have returned on selection of an entry. The @code{text} member is exactly the string used to create the entry, including all the special sequences starting with @code{'%'}. @code{label} is what's left after all those sequences as well as backspace characters have been removed, tabs replaced by single spaces and the string is split at @code{"%S"}. I.e., it's exactly what's drawn left-flushed for the entry in the popup. @code{accel} is then what's left after clean-up and came after @code{"%S"}, i.e., it's what appears as the right-flushed text of the entry. Please note that one or more of these pointers could under some circumstances be @code{NULL}. Finally, the two member @code{entry} and @code{popup} are pointers to the entry itself and the popup the callback function is invoked for - to find out the popup the selected entry itself belongs to use the @code{popup} member of the entrys @code{@ref{FL_POPUP_ENTRY}} structure. Please note: while in a callback you are only allowed to change the values of the @code{val} and @code{user_data} members. This can be useful in the case of a cascade of selection callback calls since all the selection callbacks receive the same structure (and this is also the structure that finally gets passed back to the caller of @code{@ref{fl_popup_do()}}) at the end in order to implement more complex information interchange between the callbacks involved. The elements of a @code{FL_POPUP_ENTRY} structure that might be of interest) are @anchor{FL_POPUP_ENTRY} @tindex FL_POPUP_ENTRY @example typedef @{ FL_POPUP_ENTRY *prev; /* previous popup entry */ FL_POPUP_ENTRY *next; /* next popup entry */ int type; /* normal, toggle, radio, sub-popup, line*/ unsigned int state; /* disabled, hidden, checked */ int group; /* group (for radio entries only) */ FL_POPUP *sub; /* sub-popup bound to entry */ ... @} FL_POPUP_ENTRY; @end example @noindent Note that you should not change the members of a @code{@ref{FL_POPUP_ENTRY}} structure directly! Use the appropriate functions documented below to modify them instead. @code{prev} and @code{next} are pointers to the previous and the following popup entry (or @code{NULL} if none exists). @code{type} tells what kind of popup entry this is. There are five different types: @table @code @anchor{FL_POPUP_NORMAL} @tindex FL_POPUP_NORMAL @item FL_POPUP_NORMAL Normal popup entry with no special properties @anchor{FL_POPUP_TOGGLE} @tindex FL_POPUP_TOGGLE @item FL_POPUP_TOGGLE "Toggle" or "binary" entry, drawn with a check-mark to its left if in "on" state @anchor{FL_POPUP_RADIO} @tindex FL_POPUP_RADIO @item FL_POPUP_RADIO Radio entry, drawn with a circle to its left (color-filled when "on". The @code{group} member of the @code{@ref{FL_POPUP_ENTRY}} structure determines to which group the entry belongs. @anchor{FL_POPUP_SUB} @tindex FL_POPUP_SUB @item FL_POPUP_SUB Entry for a sub-popup. The @code{sub} member of its @ref{FL_POPUP_ENTRY} structure is a pointer to the sub-popup that gets shown when the mouse enters the entry. @anchor{FL_POPUP_LINE} @tindex FL_POPUP_LINE @item FL_POPUP_LINE Not a "real" entry, just indicates that a separator line is to be drawn between the previous and the next entry. @end table Finally, the @code{state} member can have the following values: @table @code @anchor{FL_POPUP_NONE} @tindex FL_POPUP_NONE @item FL_POPUP_NONE No special state is set for the entry, the default. @anchor{FL_POPUP_DISABLED} @tindex FL_POPUP_DISABLED @item FL_POPUP_DISABLED The entry is disabled, i.e., isn't selectable (and normally is drawn in a way to indicate this). @anchor{FL_POPUP_HIDDEN} @tindex FL_POPUP_HIDDEN @item FL_POPUP_HIDDEN The entry is not drawn at all (and thus can't be selected). @anchor{FL_POPUP_CHECKED} @tindex FL_POPUP_CHECKED @item FL_POPUP_CHECKED Only relevant for toggle and radio entries. Indicates that the state of a toggle entry is "on" (drawn with a check-marker) and for a radio entry that it is the one in "on" state of its group. @end table @noindent The state can be a combination of the above constants by using a bitwise OR. The more interesting members of a @code{FL_POPUP} structure are @tindex FL_POPUP @example typedef struct @{ FL_POPUP *next; /* previously created popup */ FL_POPUP *prev; /* later created popup */ FL_POPUP *parent; /* for sub-popups: direct parent */ FL_POPUP *top_parent; /* and top-most parent */ Window win; /* window of the popup */ FL_POPUP_ENTRY *entries; /* pointer to list of entries */ char *title; /* title string of the popup */ ... @} FL_POPUP; @end example @noindent Note again that you are not supposed to change the members of the structure. Like popup entries also popups are stored in a (doubly) linked list. Thus the @code{prev} and @code{next} members of the structure are pointers to popups created earlier or later. If a popup is a sub-popup of another popup then @code{parent} points to the next higher level popup (otherwise it's @code{NULL}). In case there's a cascade of popups the @code{top_parent} member points to the "root" popup (i.e., the top-level popup), while for popups that aren't sub-popups it always points back to the popup itself (in that case @code{parent} is @code{NULL}). @code{win} is the window created for the popup. It's @code{None} (0) while the popup isn't shown, so it can be used to check if the popup is currently visible. The @code{entries} member points to the first element of the list of entries of the popup. See the @code{@ref{FL_POPUP_ENTRY}} structure documented above on how to iterate over all entries. Finally, @code{title} is the title shown at the top of the popup (if one is set). Never try to change it directly, there ars the functions @code{@ref{fl_popup_set_title()}} and @code{@ref{fl_popup_set_title_f()}}, described below, to do just that. To remove a popup entry use @findex fl_popup_entry_delete() @anchor{fl_popup_entry_delete()} @example int fl_popup_entry_delete(FL_POPUP_ENTRY *entry); @end example @noindent The function return 0 on success and -1 if it failed for some reasons. Note that the function for a sub-popup entry also deletes the popup that was associated with the entry! You may also insert one or more entries into a popup at arbitrary places using @tindex fl_popup_insert_entries() @example FL_POPUP_ENTRY *fl_popup_insert_entries(FL_POPUP *popup, FL_POPUP_ENTRY *after, const char *entries, ...); @end example @noindent @code{popup} is the popup the entries are to be inserted in, @code{after} is the entry after which the new entries are to be added (use @code{NULL} if the new entries are to be inserted at the very first position), and @code{entries} is the same kind if string as already used in @code{@ref{fl_popup_add_entries()}}, including all the available special sequences. The arguments indicated by @code{...} have to be given according to the @code{entries} string. Finally, when you don't need a popup anymore simply call @tindex fl_popup_delete() @example int fl_popup_delete(FL_POPUP *popup); @end example @noindent The function returns 0 on success and -1 on failure. It's not possible to call the function while the popup is still visible on the screen. Calling it from any callback function is problematic unless you know for sure that the popup to be deleted (and sub-popups of it) won't be used later and thus normally should be avoided. Above was described how to first generate a popup and then populate it. But there's also a (though less general) method to create and populate a popup in a single function call. For this use @findex fl_popup_create() @anchor{fl_popup_create()} @example FL_POPUP *fl_popup_create(Window win, const char *title, FL_POPUP_ITEM *items); @end example @noindent The @code{win} and @code{title} arguments are the same as used in @code{@ref{fl_popup_add()}}, i.e., they are parent window for the popup (or @code{@ref{fl_root}} or @code{None}) and the (optional, can be @code{NULL}) title for the popup. @code{items} is a pointer to an array of structures of the following form: @anchor{FL_POPUP_ITEM} @tindex FL_POPUP_ITEM @example typedef struct @{ const char *text; /* text of entry */ FL_POPUP_CB callback; /* (selection) callback */ const char *shortcut; /* keyboard shortcut description */ int type; /* type of entry */ int state; /* disabled, hidden, checked */ @} FL_POPUP_ITEM; @end example @noindent The array must contain one structure for each entry of the popup and must end in a structure where at least the @code{text} member is set to @code{NULL}. The @code{text} member describes the text of the entry. If it contains the string @code{"%S"} the text is split up at this position and the first part is used as the label drawn left-flushed for the entry and the second part for the right-flushed part (for showing accelerator keys etc.). Two more characters have a special meaning if they appear at the very start of the string (and which then do not become part of the label shown): @table @code @item '_' Draw a separator line above this entry. @item '/' This entry is a sub-popup entry and the following elements of the @code{items} array (until the first element with @code{text} set to @code{NULL} define the entries of the sub-popup. @end table @noindent Both @code{'_'} and @code{'/'} can appear at the start of the string, it doesn't matter which one comes first. The @code{callback} member is a function to be invoked when the entry is selected (irrelevant for sub-popup entries). @code{shortcut} is a string, encoding which keyboard shortcut keys can be used to select the item (@pxref{Shortcuts} for details on how such a string has to be assembled). @code{type} describes the type of the entry and must be one of @code{@ref{FL_POPUP_NORMAL}}, @code{@ref{FL_POPUP_RADIO}} (all radio entries automatically belong to the same group (numbered @code{INT_MIN}). You can't use @code{@ref{FL_POPUP_LINE}} or @code{@ref{FL_POPUP_SUB}}. If you want a sub-popup entry use @code{@ref{FL_POPUP_NORMAL}} and set @code{'/'} as the first character of the @code{text} member of the structure. If you need a separator line put a @code{'_'} at the start of the @code{text} member string of the entry which comes after the separator line. Finally, the @code{state} member can be 0 or the bitwise or of @code{@ref{FL_POPUP_DISABLED}}, @code{@ref{FL_POPUP_HIDDEN}} and @code{@ref{FL_POPUP_CHECKED}}. The first one makes the entry appear disabled and non-selectable, the second will keep the entry from being drawn at all, and the third one puts the entry into "on" state (relevant for toggle and radio entries only). If you try to set @code{@ref{FL_POPUP_CHECKED}} for more than a single radio entry the last one you set if for "wins", i.e., only this one will be in "on" state. See below for a more detailed discussion of these entry properties. @code{@ref{fl_popup_create()}} does not allow to associate values or pointers to user data to individual entries, set titles for sub-popups, have radio entries belong to different groups or set enter or leave callback functions (though there exist a number of functions to remedy the situation in case such things are needed). The function returns a pointer to the newly created popup (or @code{NULL} on failure). You are guaranteed that each entry has been assigned a unique value, starting at 0 and which is identical to the index of corresponding element in the @code{items} array, i.e., the first element results in an entry assigned 0, the second entry gets 1 etc. All functions working on popups or entries can, of course, be used on popups and their entries generated via @code{@ref{fl_popup_create()}}. They can be employed to remedy some of the limitations imposed by the simpler popup creation API. Here's an example of how to create a popup using @code{fl_popup_create()}: @example FL_POPUP *popup; FL_POPUP_ITEMS items[] = @{ @{"Item 1%S^1", NULL, "^1", FL_POPUP_NORMAL, FL_POPUP_NONE @}, @{"Item 2%S^2", NULL, "^2", FL_POPUP_RADIO, FL_POPUP_CHECKED @}, @{"Item 3%S^3", NULL, "^3", FL_POPUP_RADIO, FL_POPUP_NONE @}, @{"_/Item 4", NULL, NULL, FL_POPUP_NORMAL, FL_POPUP_NONE @}, @{"Sub-item A", cbA, "^A", FL_POPUP_NORMAL, FL_POPUP_DISABLED@}, @{"Sub-item B", cbB, "^B", FL_POPUP_TOGGLE, FL_POPUP_NONE @}, @{NULL, NULL, NULL, 0, 0 @}, @{"Item 5", NULL, NULL, FL_POPUP_NORMAL, FL_POPUP_NONE @}, @{NULL, NULL, NULL, 0, FL_POPUP_NONE @} @}; popup = fl_popup_create(None, "Test", items); @end example @noindent This creates a new popup with the title @code{"Test"} and 5 entries as well as a a sub-popup with two entries, that gets opened when the mouse is over the entry labeled @code{"Item 4"}. The first entry in the main popup has the label @code{"Item 1"} on the left and @code{"^1"} of the right side. It has no callback routine and can be selected via the @code{1} shortcut. It's just a normal menu entry. The second entry has the label @code{"Item 2"} on the left and @code{"^2"} of the right side, also no callack and @code{2} as its keyboard shortcut. It's a radio entry that is in "on" state. The third entry is like the second, labels are @code{"Item 3"} and @code{"^3"} and it reacts to @code{3}, except that it's in "off" state. The second and third label belong to the same group (with the group number set to @code{INT_MIN}), i.e., when the third entry gets selected the second one gets switched to "off" state (and vice versa). Before the fourth entry a separator line will be drawn (that's the effect of its text starting with @code{'_'}. It's a sub-popup entry (due to the @code{'/'} at the start of its text). It's label is simply @code{"Item 4"} and no right hand label (but that isn't supposed to indicate that sub-entries couldn't have shortcuts!). It has no selection callback (which wouldn't sense make sense for a sub-popup entry anyway). The following three elements of the @code{items} array are for the sub-popup that gets opened when the mouse is over the fourth item of the main popup. In the sub-popup we first have an normal entry with label @code{"Sub-item A"}. The function @code{cbA()} will be called when this entry of the sub-popup is selected. Then we have a second entry, labled @code{"Sub-item B"}, which is a currently disabled toggle entry in "off" state. If it weren't disabled its selection would result in the callback function @code{cbB()} getting called. The next element of the @code{items} array, having @code{NULL} as its @code{text} member, signifies the end of the sub-popup. Now that we're done with the sub-popup another entry in the main popup follows, a normal entry with just a left-label of @code{Item 5}. The final element of @code{items}, where @code{text} is set to @code{NULL} then signifies that this is the end of the popup. As there are functions to append to and insert entries into a popup with a kind of format string, followed by a variable list of arguments, there are also functions for adding and inserting entries using an array of @code{@ref{FL_POPUP_ITEM}}. These are @anchor{fl_popup_add_items()} @findex fl_popup_add_items() @anchor{fl_popup_insert_items()} @findex fl_popup_insert_items() @example FL_POPUP_ENTRY *fl_popup_add_items(FL_POPUP *popup, FL_POPUP_ITEM *items); FL_POPUP_ENTRY *fl_popup_insert_items(FL_POPUP *popup, FL_POPUP_ENTRY *after, FL_POPUP_ITEM *items); @end example @noindent Both functions return the address of the first entry created on success and @code{NULL} on error. The first argument is the popup the entries are to be appended to or inserted into, the last argument the array of items (as in the case of @code{@ref{fl_popup_create()}} at least the @code{text} member of the last element must be a @code{NULL} pointer to indicate the end). @code{fl_popup_insert_items()} takes another argument, @code{after}, the entry after which the new entries are to be inserted (if called with @code{after} set to @code{NULL} the new entries are inserted at the very start of the popup). @node Popup Interaction @section Popup Interaction A popup will be drawn on the screen when the function @tindex fl_popup_do() @anchor{fl_popup_do()} @example FL_POPUP_RETURN *fl_popup_do(FL_POPUP *popup); @end example @noindent is called. It only returns when the user either selects an entry or closes it in some other way (e.g., by clicking outside the popup's area). When a selection was made the function returns a pointer to a @code{@ref{FL_POPUP_RETURN}} structure with information about the entry that was selected (please note that the structure is internal storage belonging to the Forms Library and is re-used when the popup is shown again, so copy out all data you may need to keep). If no selection was made (or one of the invoked callback routines returned a value of @code{FL_IGNORE} (-1) @code{NULL} is returned. While the popup is shown the user can interact with the popup using the mouse or the keyboard. When the mouse is hovering over a selectable entry of the popup the entry is highlighted, when the mouse reaches an entry for a sub-popup, the associated sub-popup automatically gets opened. A selection is made by clicking on an entry (or, in case that the popup was opened while a mouse button was pressed down, when the mouse button is released). Clicking outside the popups window (or, depending on the "policy", see below, releasing the mouse button somewhere else than over a selectable item) closes the popup without a selection being made. Popups also can be controlled via the keyboard. First of all, on pressing a key, the shortcuts set for items are evaluated and, if a match is found, the corresponding entry is returned as selected (if the popup currently shown is a sub-popup, first the shortcuts for this sub-popup are checked, then those of its parent etc.@: until the top-most popup has been reached and checked for). The user can also navigate through the selectable entires using the @code{} and @code{} arrow keys and open and close sub-popups with the @code{} and @code{} cursor keys. Pressing the @code{} key highlights the first (selectable) entry in the popup, @code{} the last one. By using the @code{} key (or @code{} if available) the currently shown popup is closed (if an entry in a sub-popup was highlighted just this sub-popup is closed). Finally, pressing @code{} while on a selectable entry results in this entry being reported as selected. Once the user has selected an entry its callback function is invoked with a @code{@ref{FL_POPUP_RETURN}} structure as the argument. When this function returns, the callback for the popup the entry belongs to is called with exactly the same structure. If the popup is a sub-popup, next the callback for its "parent" popup is invoked, again with the same structure (except that the @code{popup} member is changed each time to indicate which popup the call is made for). Repeat until the callback for the top-most popup has been called. Finally the structure used in all those callback invocations is returned from @code{@ref{fl_popup_do()}}. This chain of callback calls is interrupted when one of the callbacks returns a value of @code{FL_IGNORE} (-1). In that case no further callbacks are invoked and @code{@ref{fl_popup_do()}} returns @code{NULL}, i.e., from the callers perspective it looks as if no selection has been made. This can be useful when one of the callbacks was already was able to do all the work required on a selection. Per default a popup stays open when the user releases the mouse button anywhere else than on a selectable entry. It only gets closed when the user either selects an entry or clicks somewhere outside of the popup area. An alternative is a "drag-down" popup that gets closed whenever the mouse button is released, even if the mouse isn't on the area of the popup or a selectable entry. To achieve this effect you can change the "policy" using the function @findex fl_popup_set_policy() @anchor{fl_popup_set_policy()} @example int fl_popup_set_policy(FL_POPUP *popup, int policy); @end example @noindent There are two values @code{policy} can have: @table @code @anchor{FL_POPUP_NORMAL_SELECT} @tindex FL_POPUP_NORMAL_SELECT @item FL_POPUP_NORMAL_SELECT Default, popup stays open until mouse button is released on a selectable entry or button is clicked outside the popups area. @anchor{FL_POPUP_DRAG_SELECT} @tindex FL_POPUP_DRAG_SELECT @item FL_POPUP_DRAG_SELECT Popup is closed when the mouse button is released anywhere. @end table @noindent The function can be called with either a (valid) popup address, in which case the policy for that popup is changed, or with a @code{NULL} pointer to change the default setting of the policy, used in the creation of new popups. The function returns the previous policy value or -1 on errors. It's also possible to determine the policy setting by using @findex fl_popup_get_policy() @anchor{fl_popup_get_policy()} @example int fl_popup_get_policy(Fl_POPUP *popup); @end example If called with the address of a (valid) popup the policy for this popup (or its parent if one exists) gets returned. If called with a @code{NULL} pointer the default policy used in creating new popups is returned. On error -1gets returned. Calling the function with @code{NULL} as the @code{popup} argument changes the default setting for the popups created afterwards. If the popup is partially off-screen the user can push the mouse at the screen borders in the direction of the currently invisible popup entries. This results in the popups window getting moved so that previosuly invisible entries become accessible. The popup window gets shifted vertically in single entry steps, in horizontal direction by a tenth of the screen width. The delay between shifts is about @w{100 ms}. @node Other Popup Routines @section Other Popup Routines When @code{@ref{fl_popup_do()}} is called the popup per default is shown with its left upper corner at the mouse position (unless the popup wouldn't fit onto the screen). Using @findex fl_popup_set_position() @anchor{fl_popup_set_position()} @example void fl_popup_set_position(FL_POPUP *popup, int x, int y); @end example @noindent the position where the popup is drawn can be changed (but if it wouldn't fit onto the screen at that position it will also changed automatically). @code{x} and @code{y}. to be given relative to the root window, define the position of the upper left hand corner. Using this function for sub-popups is useless, they always get opened as near as possible to the corresponding sub-popup entry. When setting the position of a popup it can be useful to know the exact sizes of its window in advance. These can be obtained by calling @findex fl_popup_get_size() @anchor{fl_popup_get_size()} @example int fl_popup_get_size(FL_POPUP *popup, unsigned int *w, unsigned int *h); @end example @noindent The function returns 0 on success and -1 on error (in case the supplied @code{popup} argument isn't valid). Please note that the reported values are only valid until the popup is changed, e.g., by adding, deleting or changing entries or changing the appearance of the popup. A callback function @code{cb()} of type @code{@ref{FL_POPUP_CB}}, to be called when a entry (or an entry of a sub-popup) is selected, can be associated with a popup (or changed) using @findex fl_popup_set_callback() @anchor{fl_popup_set_callback()} @example typedef int (*FL_POPUP_CB)(FL_POPUP_RETURN *); FL_POPUP_CB fl_popup_set_callback(FL_POPUP *popup, FL_POPUP_CB cb); @end example @noindent The function returns the old setting of the callback routine (on error @code{NULL} is returned, which may indistinguishable from the case that no callback was set before). For an entry all three associated callback functions can be set via @findex fl_popup_entry_set_callback() @anchor{fl_popup_entry_set_callback()} @findex fl_popup_entry_set_enter_callback() @anchor{fl_popup_entry_set_enter_callback()} @findex fl_popup_entry_set_leave_callback() @anchor{fl_popup_entry_set_leave_callback()} @example FL_POPUP_CB fl_popup_entry_set_callback(FL_POPUP_ENTRY *entry, FL_POPUP_CB cb); FL_POPUP_CB fl_popup_entry_set_enter_callback(FL_POPUP_ENTRY *entry, FL_POPUP_CB enter_cb) FL_POPUP_CB fl_popup_entry_set_leave_callback(FL_POPUP_ENTRY *entry, FL_POPUP_CB leave_cb); @end example @noindent The first function sets the callback invoked when the entry is selected, the second when the mouse enters the area of the entry and the third, when the mouse leaves that area. All function return the previously set callback or @code{NULL} when none was set or an error occured. @code{NULL} also gets returned on errors. There are three properties that can be set for a popup entry @table @code @tindex FL_POPUP_DISABLED @item FL_POPUP_DISABLED The entry is is shown as disabled and can't be selected. @tindex FL_POPUP_HIDDEN @item FL_POPUP_HIDDEN The entry is not shown when the popup is opened. @tindex FL_POPUP_CHECKED @item FL_POPUP_CHECKED Relevant only for toggle and redio entries. When set beside the label of a toggle entry a check-marker is drawn while the circle beside a radio button is drawn colored. @end table @noindent The "state" of an entry is the binary OR of these values which can be set and queried using the functions @findex fl_popup_entry_set_state() @anchor{fl_popup_entry_set_state()} @findex fl_popup_entry_get_state() @anchor{fl_popup_entry_get_state()} @example unsigned int fl_popup_entry_set_state(FL_POPUP_ENTRY *entry, unsigned int state); unsigned int fl_popup_entry_get_state(FL_POPUP_ENTRY *entry); @end example @noindent @code{@ref{fl_popup_entry_set_state()}} returns the previous state on success and @code{UINT_MAX} (a value with all bits set) on failure. Note that when setting @code{@ref{FL_POPUP_CHECKED}} for a radio entry all other radio entries belonging to the same group automatically lose their "on" (checked) property. There are also three convenience function for clearing, raising and toggling bits in the state of an entry. Normally to clear a certain bit of the state you have to first call @code{@ref{fl_popup_entry_get_state()}}, then clear the bit in the return value and finally call @code{@ref{fl_popup_entry_set_state()}} with the result to set the new state. Use of these convenience functions allows to change state bits in a single call. @findex fl_popup_entry_clear_state() @anchor{fl_popup_entry_clear_state()} @findex fl_popup_raise_clear_state() @anchor{fl_popup_raise_clear_state()} @findex fl_popup_toggle_clear_state() @anchor{fl_popup_toggle_clear_state()} @example unsigned int fl_popup_entry_clear_state(FL_POPUP_ENTRY *entry, unsigned int what); unsigned int fl_popup_entry_raise_state(FL_POPUP_ENTRY *entry, unsigned int what); unsigned int fl_popup_entry_toggle_state(FL_POPUP_ENTRY *entry, unsigned int what); @end example The @code{what} argument can be any value resulting from a bitwise OR of @code{@ref{FL_POPUP_DISABLED}}, @code{@ref{FL_POPUP_HIDDEN}} and @code{@ref{FL_POPUP_CHECKED}} (thus you can clear, set or toggle one or more bits of the state in a single call). The functions all return the original value of the state. You may search for an entry in a popup by different criteria (please note that the search also includes sub-popups of the popup, you can identify them by checking the @code{popup} member of the @ref{FL_POPUP_ENTRY} structure). The search obviously will only deliver reasonable results if what you're searching for is unique between all the entries. First, you can ask for the entry that had been created with a certain text, including all the special sequences, by calling @findex fl_popup_entry_get_by_text() @anchor{fl_popup_entry_get_by_text()} @findex fl_popup_entry_get_by_text_f() @anchor{fl_popup_entry_get_by_text_f()} @example FL_POPUP_ENTRY *fl_popup_entry_get_by_text(FL_POPUP *popup, const char *text); FL_POPUP_ENTRY *fl_popup_entry_get_by_text_f(FL_POPUP *popup, const char *fmt, ...); @end example @noindent The functions returns either a pointer to the entry found or @code{NULL} on failure (because either no entry with this text was found or the popup doesn't exist). (The functions differ in that the first one accepts just a simple string while the second assembles the text from a format string, just as it's used for @code{printf()} etc., and an appropriate number of following arguments.) You may as well search by the left-flushed label parts of the entries as shown on the screen (note that tab characters @code{'\t'} originally embedded in the text used when creating the label have been replaced by single spaces and backspace characters @code{'\b'} were removed as well as all special sequences) @findex fl_popup_entry_get_by_label() @anchor{fl_popup_entry_get_by_label()} @findex fl_popup_entry_get_by_label_f() @anchor{fl_popup_entry_get_by_label_f()} @example FL_POPUP_ENTRY *fl_popup_entry_get_by_label(FL_POPUP *popup, const char *label); FL_POPUP_ENTRY *fl_popup_entry_get_by_label_f(FL_POPUP *popup, const char *fmt, ...); @end example @noindent Thus, since an entry created via a string like @code{"I\bt%Tem\t1%SCtrl+X"} will shown with a left-flushed label part of @code{"Item 1"}, this will be found when searching with either this string or a format string fo e.g., @code{"Item %d"} and a following integer argument of @code{1}. Another way to search for an entry is by its value as either specified via the @code{"%x"} special sequence or assigned automatically by @findex fl_popup_entry_get_by_value() @anchor{fl_popup_entry_get_by_value()} @example FL_POPUP_ENTRY *fl_popup_entry_get_by_value(FL_POPUP *popup, long value); @end example Also the @code{user_data} pointer associated with the entry can be used as the search criterion: @findex fl_popup_entry_get_by_user_data() @anchor{fl_popup_entry_get_by_user_data()} @example FL_POPUP_ENTRY *fl_popup_entry_get_by_user_data(FL_POPUP *popup, void *user_data); @end example Finally one can try to find an entry by its current position in the popup (note that here sub-popups aren't taken into consideration since that would make the meaning of "position" rather hard to define) by @findex fl_popup_entry_get_by_position() @anchor{fl_popup_entry_get_by_position()} @example FL_POPUP_ENTRY *fl_popup_entry_get_by_position(FL_POPUP *popup, long position); @end example @noindent where @code{posistion} is starting with 0, so when called with 0 the first entry will be returned, when called with 1 you get the second entry etc. Note that separator lines aren't counted but entries currently being hidden are. @node Popup Attributes @section Popup Attributes Using @findex fl_popup_set_title() @anchor{fl_popup_set_title()} @findex fl_popup_set_title_f() @anchor{fl_popup_set_title_f()} @findex fl_popup_get_title() @anchor{fl_popup_get_title()} @example void fl_popup_set_title(FL_POPUP *popup, const char *title); void fl_popup_set_title_f(FL_POPUP *popup, const char *fmt, ...); const char *fl_popup_set_title(FL_POPUP *popup); @end example @noindent the title of a popup can be changed or the currently set title determined. (The two functions for setting the title are just different in the way the title is passed: the first one receives a simple string while the second one assembles the title from a format string just like the one used with @code{printf()} etc. and an appropriate number of following arguments.) To query or set the font the popups title is drawn in use @findex fl_popup_get_title_font() @anchor{fl_popup_get_title_font()} @findex fl_popup_set_title_font() @anchor{fl_popup_set_title_font()} @example void fl_popup_get_title_font(FL_POPUP *popup, int *size, int *style); void fl_popup_set_title_font(FL_POPUP *popup, int size, int style); @end example @noindent @xref{Label Attributes and Fonts}, for details about the sizes and styles that should be used. The default size and style are @code{@ref{FL_NORMAL_SIZE}} and @code{@ref{FL_EMBOSSED_STYLE}}. This setting also applies to sub-popups of the popup, thus setting a title font for sub-popups is useless. When called with the @code{popup} argument set to @code{NULL} the default settings for popups generated later are returned or set. Also the font for the entries of a popup can be queried or and set via @findex fl_popup_entry_set_font() @anchor{fl_popup_entry_set_font()} @example void fl_popup_entry_get_font(FL_POPUP *popup, int *style, int *size); void fl_popup_entry_set_font(FL_POPUP *popup, int style, int size); @end example @noindent The defalt size is @code{@ref{FL_NORMAL_SIZE}} and the default style is @code{@ref{FL_NORMAL_STYLE}}. Again, the returned or set values also apply to all sub-popups, so calling the function for sub-popups doesn't make sense. When called with @code{popup} set to @code{NULL} the default settings for popups are returned or changed. The width of a popup is calculated using the widths of the title and the entries. You can influence this width by setting a minimum width a popup should have. There are two functions for the minimum width: @findex fl_popup_get_min_width() @anchor{fl_popup_get_min_width()} @findex fl_popup_set_min_width() @anchor{fl_popup_set_min_width()} @example int fl_popup_get_min_width(FL_POPUP *popup); int fl_popup_set_min_width(FL_POPUP *popup, int min_width); @end example @noindent The first one returns the currently set minimum width (a negative return value indicates an error). The second allows sets a new minimum width. Setting the minimum width to 0 or a negative value switches the use of the minimum width off. It returns the previous value (or a negative value on error). You can query or set the border width popups are drawn width (per default it's set to @code{1}). To this purpose call @findex fl_popup_get_bw() @anchor{fl_popup_get_bw()} @findex fl_popup_set_bw() @anchor{fl_popup_set_bw()} @example int fl_popup_get_bw(FL_POPUP *popup); int fl_popup_set_bw(FL_POPUP *popup, int bw); @end example @noindent Please note that the border width setting is automatically applied also to sub-popups, so there's no good reason to call these functions for sub-popups. The default border width is the same as that for objects. The functions can also be called with @code{popup} set to @code{NULL} in which case the default setting for the border width is returned or set, respectively. To change the cursor that is displayed when a popup is shown use @findex fl_popup_set_cursor() @anchor{fl_popup_set_cursor()} @example void fl_popup_set_cursor(FL_POPUP *popup, int cursor_name); @end example @noindent Use one of the symbolic cursor names (shapes) defined by standard X or the integer value returned by @code{@ref{fl_create_bitmap_cursor()}} or one of the Forms Library's pre-defined symbolic names for the @code{cursor_name} argument. Per default the cursor named @code{"XC_sb_right_arrow"} is used. If the function is called with @code{popup} set to @code{NULL} the default cursor for popups generated afterwards is changed. There are several colors used in drawing a popup. These can be set or queried with the functions @findex fl_popup_set_color() @anchor{fl_popup_set_color()} @findex fl_popup_get_color() @anchor{fl_popup_get_color()} @example FL_COLOR fl_popup_set_color(FL_POPUP *popup, int type, FL_COLOR color); FL_COLOR fl_popup_get_color(FL_POPUP *popup, int type); @end example @noindent where @code{type} can be one of the following values: @table @code @anchor{FL_POPUP_BACKGROUND_COLOR} @tindex FL_POPUP_BACKGROUND_COLOR @item FL_POPUP_BACKGROUND_COLOR Background color of the popup, default is @code{FL_MCOL}. @anchor{FL_POPUP_HIGHLIGHT_COLOR} @tindex FL_POPUP_HIGHLIGHT_COLOR @item FL_POPUP_HIGHLIGHT_COLOR Backgroud color an entry is drawn with when it's selectable and the mouse is on top of it, default is @code{FL_BOTTOM_BCOL}. @anchor{FL_POPUP_TITLE_COLOR} @tindex FL_POPUP_TITLE_COLOR @item FL_POPUP_TITLE_COLOR Color used for the title text of a popup, default is @code{FL_BLACK}. @anchor{FL_POPUP_TEXT_COLOR} @tindex FL_POPUP_TEXT_COLOR @item FL_POPUP_TEXT_COLOR Color normal used for entry texts, default is @code{FL_BLACK}. @anchor{FL_POPUP_HIGHLIGHT_TEXT_COLOR} @tindex FL_POPUP_HIGHLIGHT_TEXT_COLOR @item FL_POPUP_HIGHLIGHT_TEXT_COLOR Color of the entry text when it's selectable and the mouse is on top of it, default is @code{FL_WHITE}. @anchor{FL_POPUP_DISABLED_TEXT_COLOR} @tindex FL_POPUP_DISABLED_TEXT_COLOR @item FL_POPUP_DISABLED_TEXT_COLOR Color for drawing the text of disabled entries, default is @code{FL_INACTIVE_COL}. @anchor{FL_POPUP_RADIO_COLOR} @tindex FL_POPUP_RADIO_COLOR @item FL_POPUP_RADIO_COLOR Color the circle drawn for radio entris in "on" state is drawn in. @end table When setting a new color the color previously used is returned by @code{@ref{fl_popup_set_color()}}. Calling these functions for sub-popups doesn't make sense since sub-popups are always drawn in the colors set for the parent popup. When called with @code{popup} set to @code{NULL} the functions return or set the default colors of popups created afterwards. To change the text of a popup entry call @findex fl_popup_entry_set_text() @anchor{fl_popup_entry_set_text()} @example int fl_popup_entry_set_text(FL_POPUP_ENTRY *entry, const char *text); @end example @noindent Please note that in the text no special sequences except @code{"%S"} (at which place the text is split to make up the left- and right-flushed part of the label drawn) are recognized. The shortcut keys for a popup label can be changed using @findex fl_popup_entry_set_shortcut() @anchor{fl_popup_entry_set_shortcut()} @example void fl_popup_entry_set_shortcut(FL_POPUP_ENTRY *entry, const char *shortcuts); @end example @noindent @xref{Shortcuts}, for details on how such a string has to look like. The value assigned to a popup entry can be changed via @findex fl_popup_entry_set_value() @anchor{fl_popup_entry_set_value()} @example long fl_popup_entry_set_value(FL_POPUP_ENTRY *entry, long value); @end example @noindent The function returns the previous value. Also the user data pointer associated with a popup entry can be modified by calling @findex fl_popup_entry_set_user_data() @anchor{fl_popup_entry_set_user_data()} @example void *fl_popup_entry_set_user_data(FL_POPUP_ENTRY *entry, void *user_data); @end example @noindent The function returns the previous setting of @code{user_data}. To determine to which group a radio entry belongs call @findex fl_popup_entry_get_group() @anchor{fl_popup_entry_get_group()} @example int fl_popup_entry_get_group(FL_POPUP_ENTRY *entry); @end example @noindent Obviously, this function only makes much sense when applied to radio entries. It returns the group number on success and @code{INT_MAX} on failure (that's why @code{INT_MAX} shouldn't be used for group numbers). To assign a radio entry to a different group call @findex fl_popup_entry_set_group() @anchor{fl_popup_entry_set_group()} @example int fl_popup_entry_set_group(FL_POPUP_ENTRY *entry, int group); @end example @noindent Again, for obvious reasons, the function should normally only be called for radio entries. It returns the previous group number on success and @code{INT_MAX} on failure. If one of the entries of the new group was in "on" state the entries state will be reset to "off" if necessary. For entries other than radio entries the group isn't used at all. So, theoretically, it could be used to store a bit of additional information. If that would be good programming practice is another question... Finally, the sub-popup associated with a sub-popup-entry can be queried or changed using the functions @findex fl_popup_entry_get_subpopup() @anchor{fl_popup_entry_get_subpopup()} @findex fl_popup_entry_set_subpopup() @anchor{fl_popup_entry_set_subpopup()} @example FL_POPUP *fl_popup_entry_get_subpopup(FL_POPUP_ENTRY *entry); FL_POPUP *fl_popup_entry_get_subpopup(FL_POPUP_ENTRY *entry, FL_POPUP *subpopup); @end example @noindent Obviously, calling these functions only makes sense for sub-popup entries. @code{@ref{fl_popup_entry_get_subpopup()}} returns the address of the sub-popup associated with the entry or @code{NULL} on failure. To change the sub-popup of an entry a valid sub-popup must be passed to @code{@ref{fl_popup_entry_set_subpopup()}}, i.e., the sub-popup must not already be a sub-popup of another entry or the popup the entry belongs to itself. You also can't set a new sub-popup while the old sub-popup associated with the entry or the popup to become the new sub-popup is shown. On success the address of the new sub-popup is returned, on failure @code{NULL}. Note that this function deletes the old sub-popup that was associated with the popup. xforms-1.2.4/doc/part3_static_objects.texi0000644000175000017500000007360212252564541015544 00000000000000@node Part III Static Objects @chapter Static Objects @ifnottex @menu * Box Object: Box Object * Frame Object: Frame Object * LabelFrame Object: LabelFrame Object * Text Object: Text Object * Bitmap Object: Bitmap Object * Pixmap Object: Pixmap Object * Clock Object: Clock Object * Chart Object: Chart Object @end menu @end ifnottex @node Box Object @section Box Object Boxes are simply used to give the dialogue forms a nicer appearance. They can be used to visually group other objects together. The bottom of each form is a box. @ifnottex @menu * Adding Box Objects: Adding Box Objects * Box Types: Box Types * Box Attributes: Box Attributes * Remarks: Box Remarks @end menu @end ifnottex @node Adding Box Objects @subsection Adding Box Objects To add a box to a form you use the routine @findex fl_add_box() @anchor{fl_add_box()} @example FL_OBJECT *fl_add_box(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent The meaning of the parameters is as usual. The label is per default placed in the center of the box. @node Box Types @subsection Box Types The following types are available: @table @code @tindex FL_UP_BOX @anchor{FL_UP_BOX} @item FL_UP_BOX A box that comes out of the screen. @tindex FL_DOWN_BOX @anchor{FL_DOWN_BOX} @item @code{FL_DOWN_BOX} A box that goes down into the screen. @tindex FL_FLAT_BOX @anchor{FL_FLAT_BOX} @item FL_FLAT_BOX A flat box without a border. @tindex FL_BORDER_BOX @anchor{FL_BORDER_BOX} @item FL_BORDER_BOX A flat box with just a border. @tindex FL_FRAME_BOX @anchor{FL_FRAME_BOX} @item FL_FRAME_BOX A flat box with an engraved frame. @tindex FL_SHADOW_BOX @anchor{FL_SHADOW_BOX} @item FL_SHADOW_BOX A flat box with a shadow. @tindex FL_ROUNDED_BOX @anchor{FL_ROUNDED_BOX} @item FL_ROUNDED_BOX A rounded box. @tindex FL_RFLAT_BOX @anchor{FL_RFLAT_BOX} @item FL_RFLAT_BOX A rounded box without a border. @tindex FL_RSHADOW_BOX @anchor{FL_RSHADOW_BOX} @item FL_RSHADOW_BOX A rounded box with a shadow. @tindex FL_OVAL_BOX @anchor{FL_OVAL_BOX} @item FL_OVAL_BOX An elliptic box. @tindex FL_NO_BOX @anchor{FL_NO_BOX} @item FL_NO_BOX No box at all, only a centered label. @end table @node Box Attributes @subsection Box Attributes The first color argument (@code{col1}) to @code{@ref{fl_set_object_color()}} controls the color of the box, the second (@code{col2}) is not used. @node Box Remarks @subsection Remarks No interaction takes place with boxes. Do not use @code{FL_NO_BOX} type if the label is to change during the execution of the program. @node Frame Object @section Frame Object Frames are simply used to give the dialogue forms a nicer appearance. They can be used to visually group other objects together. Frames are almost the same as a box, except that the interior of the bounding box is not filled. Use of frames can speed up drawing in certain situations. For example, to place a group of radio buttons within an @code{FL_ENGRAVED_FRAME}. If we were to use an @code{FL_FRAME_BOX} to group the buttons, visually they would look the same. However, the latter is faster as we don't have to fill the interior of the bounding box and can also reduce flicker. Frames are useful in decorating free objects and canvases. @ifnottex @menu * Adding Frame Objects: Adding Frame Objects * Frame Types: Frame Types * Frame Attributes: Frame Attributes * Remarks: Frame Remarks @end menu @end ifnottex @node Adding Frame Objects @subsection Adding Frame Objects To add a frame to a form you use the routine @findex fl_add_frame() @anchor{fl_add_frame()} @example FL_OBJECT *fl_add_frame(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent The meaning of the parameters is as usual except that the frame is drawn outside of the bounding box (so a flat box of the same size just fills the inside of the frame without any gaps). The label is by default placed centered inside the frame. @node Frame Types @subsection Frame Types The following types are available: @table @code @tindex FL_NO_FRAME @item FL_NO_FRAME Nothing is drawn. @tindex FL_UP_FRAME @item FL_UP_FRAME A frame appears coming out of the screen. @tindex FL_DOWN_FRAME @item FL_DOWN_FRAME A frame that goes down into the screen. @tindex FL_BORDER_FRAME @item FL_BORDER_FRAME A frame with a simple outline. @tindex FL_ENGRAVED_FRAME @item FL_ENGRAVED_FRAME A frame appears to be engraved. @tindex FL_EMBOSSED_FRAME @item FL_EMBOSSED_FRAME A frame appears embossed. @tindex FL_ROUNDED_FRAME @item FL_ROUNDED_FRAME A rounded frame. @tindex FL_OVAL_FRAME @item FL_OVAL_FRAME An elliptic box. @end table @node Frame Attributes @subsection Frame Attributes The first color argument (@code{col1}) of @code{@ref{fl_set_object_color()}} controls the color of the frame if applicable, the second (@code{col2}) is not used. The boxtype attribute does not apply to the frame class. @node Frame Remarks @subsection Remarks No interaction takes place with frames. It may be faster to use frames instead of boxes for text that is truly static. See @file{freedraw.c} for an example use of frame objects. @node LabelFrame Object @section LabelFrame Object A label frame is almost the same as a frame except that the label is placed on the frame (See Fig. 15.1) instead of inside or outside of the bounding box as in a regular frame. @ifnottex @menu * Adding LabelFrame Objects: Adding LabelFrame Objects * LabelFrame Types: LabelFrame Types * LabelFrame Attributes: LabelFrame Attributes * Remarks: LabelFrames Remarks @end menu @end ifnottex @node Adding LabelFrame Objects @subsection Adding LabelFrame Objects To add a labelframe to a form you use the routine @findex fl_add_labelframe() @anchor{fl_add_labelframe()} @example FL_OBJECT *fl_add_labelframe(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent The meaning of the parameters is as usual except that the frame is drawn outside of the bounding box (so a flat box of the same size just fills the inside of the frame without any gaps). The label is by default placed on the upper left hand part of the frame. Its position can changed (within limits) via calls of @code{@ref{fl_set_object_lalign()}}. @ifhtml @center @image{xforms_images/labelframe} @end ifhtml @ifnothtml @center @image{xforms_images/labelframe,7cm} @end ifnothtml @node LabelFrame Types @subsection LabelFrame Types The following types are available: @table @code @tindex FL_NO_FRAME @item FL_NO_FRAME Nothing is drawn. @tindex FL_UP_FRAME @item FL_UP_FRAME A frame appears coming out of the screen. @tindex FL_DOWN_FRAME @item FL_DOWN_FRAME A frame that goes down into the screen. @tindex FL_BORDER_FRAME @item FL_BORDER_FRAME A frame with a simple outline. @tindex FL_ENGRAVED_FRAME @item FL_ENGRAVED_FRAME A frame appears to be engraved. @tindex FL_EMBOSSED_FRAME @item FL_EMBOSSED_FRAME A frame appears embossed. @tindex FL_ROUNDED_FRAME @item FL_ROUNDED_FRAME A rounded frame. @tindex FL_OVAL_FRAME @item FL_OVAL_FRAME An elliptic box. @end table @node LabelFrame Attributes @subsection Attributes The first color in the call of @code{@ref{fl_set_object_color()}} controls the color of the frame if applicable. The second color controls the background color of the label. Boxtype attribute does not apply to the labelframe class @node LabelFrames Remarks @subsection Remarks No interaction takes place with labelframes. You can not draw a label inside or outside of the frame box. If you try, say, by requesting @code{FL_ALIGN_CENTER}, the label is drawn using @code{FL_ALIGN_TOP_LEFT}. @node Text Object @section Text Object Text objects simply consist of a label possibly placed in a box. @ifnottex @menu * Adding Text Objects: Adding Text Objects * Text Types: Text Types * Text Attributes: Text Attributes * Remarks: Text Remarks @end menu @end ifnottex @node Adding Text Objects @subsection Adding Text Objects To add a text to a form you use the routine @findex fl_add_text() @anchor{fl_add_text()} @example FL_OBJECT *fl_add_text(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent The meaning of the parameters is as usual. The label is by default placed flushed left in the bounding box. @node Text Types @subsection Text Types @tindex FL_NORMAL_TEXT Only one type of text exists: @code{FL_NORMAL_TEXT}. @node Text Attributes @subsection Text Attributes To set or change the text shown, use @code{@ref{fl_set_object_label()}} or @code{@ref{fl_set_object_label_f()}}. Any boxtype can be used for text. The first color argument (@code{col1}) of @code{@ref{fl_set_object_color()}} controls the color of the box the text is placed into, the second (@code{col2}) is not used. The color of the text itself is controlled by calls of @code{@ref{fl_set_object_lcolor()}} as usual. If the text is to change dynamically, boxtype @code{NO_BOX} should not be used for the object. @node Text Remarks @subsection Remarks No interaction takes place with text objects. Don't use boxtype @code{FL_NO_BOX} if the text is to change dynamically. Note that there is almost no difference between a box with a label and a text. The only difference lies in the position where the text is placed and the fact that text is clipped to the bounding box. Text is normally placed inside the box at the left side. This helps you putting different lines of text below each other. Labels inside boxes are default centered in the box. You can change the position of the text inside the box using the routine @code{@ref{fl_set_object_lalign()}}. In contrast to boxes different alignments for text always place the text inside the box rather than outside the box. @node Bitmap Object @section Bitmap Object A bitmap is a simple bitmap shown on a form. @ifnottex @menu * Adding Bitmap Objects: Adding Bitmap Objects * Bitmap Types: Bitmap Types * Bitmap Interaction: Bitmap Interaction * Other Bitmap Routines: Other Bitmap Routines * Bitmap Attributes: Bitmap Attributes * Remarks: Bitmap Remarks @end menu @end ifnottex @node Adding Bitmap Objects @subsection Adding Bitmap Objects To add a bitmap to a form you use the routine @findex fl_add_bitmap() @anchor{fl_add_bitmap()} @example FL_OBJECT *fl_add_bitmap(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example The meaning of the parameters is as usual. The label is by default placed below the bitmap. The bitmap is empty on creation. @node Bitmap Types @subsection Bitmap Types @tindex FL_NORMAL_BITMAP Only the type @code{FL_NORMAL_BITMAP} is available. @node Bitmap Interaction @subsection Bitmap Interaction No interaction takes place with a bitmap. For bitmaps that interact see @ref{Adding Button Objects}, on how to create a button with a bitmap on top of it. (You can also place a hidden button over it if you want something to happen when pressing the mouse on a static bitmap.) @node Other Bitmap Routines @subsection Other Bitmap Routines To set the actual bitmap being displayed use @findex fl_set_bitmap_data() @anchor{fl_set_bitmap_data()} @findex fl_set_bitmap_file() @anchor{fl_set_bitmap_file()} @example void fl_set_bitmap_data(FL_OBJECT *obj, int w, int h, unsigned char *bits); void fl_set_bitmap_file(FL_OBJECT *obj, const char *file); @end example @noindent @code{bits} contains the bitmap data as a character string. @code{file} is the name of the file that contains the bitmap data. A number of bitmaps can be found in @file{/usr/include/X11/bitmaps} or similar places. The X program @code{bitmap} can be used to create bitmaps. Two additional routines are provided to make a Bitmap from a bitmap file or data @findex fl_read_bitmapfile() @anchor{fl_read_bitmapfile()} @findex fl_create_from_bitmapdata() @anchor{fl_create_from_bitmapdata()} @example Pixmap fl_read_bitmapfile(Window win, const char *filename, unsigned *width, unsigned *height, int *hotx, int *hoty) Pixmap fl_create_from_bitmapdata(Window win, const char *data, int width, int height); @end example @noindent where @code{win} is any window ID in your application and the other parameters have the obvious meanings. If there is no window created yet, the return value of @code{@ref{fl_default_window()}} may be used. Note: bitmaps created by the above routines have a depth of 1 and should be displayed using @code{XCopyPlane()}. @node Bitmap Attributes @subsection Bitmap Attributes The label color as set by @code{@ref{fl_set_object_lcolor()}} controls both the foreground color of the bitmap and the color of the label (i.e., they are always identical). The first color argument (@code{col1}) to @code{@ref{fl_set_object_color()}} sets the background color of the bitmap (and the color of the box), the second (@code{col2}) is not used. @node Bitmap Remarks @subsection Remarks See @file{demo33.c} for a demo of a bitmap. @node Pixmap Object @section Pixmap Object A pixmap is a simple pixmap (color icon) shown on a form. @ifnottex @menu * Adding Pixmap Objects: Adding Pixmap Objects * Pixmap Types: Pixmap Types * Pixmap Interaction: Pixmap Interaction * Other Pixmap Routines: Other Pixmap Routines * Pixmap Attributes: Pixmap Attributes * Remarks: Pixmap Remarks @end menu @end ifnottex @node Adding Pixmap Objects @subsection Adding Pixmap Objects To add a pixmap to a form use the routine @findex fl_add_pixmap() @anchor{fl_add_pixmap()} @example FL_OBJECT *fl_add_pixmap(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label) @end example @noindent The meaning of the parameters is as usual. The label is by default placed below the pixmap. The pixmap is empty on creation. @node Pixmap Types @subsection Pixmap Types @tindex FL_NORMAL_PIXMAP Only the type @code{FL_NORMAL_PIXMAP} is available. @node Pixmap Interaction @subsection Pixmap Interaction No interaction takes place with a pixmap. For pixmap that interacts see @ref{Adding Button Objects}, on how to create a button with a pixmap on top of it. (You can also place a hidden button over it if you want something to happen when pressing the mouse on a static pixmap.) @node Other Pixmap Routines @subsection Other Pixmap Routines A pixmap file (usually with extension @code{.xpm}) is an ASCII file that contains the definition of the pixmap as a @code{char} pointer array that can be included directly into a C (or C++) source file. To set the actual pixmap being displayed, use one of the following routines: @findex fl_set_pixmap_file() @anchor{fl_set_pixmap_file()} @findex fl_set_pixmap_data() @anchor{fl_set_pixmap_data()} @example void fl_set_pixmap_file(FL_OBJECT *obj, const char *file); void fl_set_pixmap_data(FL_OBJECT *obj, char **data); @end example @noindent In the first routine, you specify the pixmap by the filename @code{file} that contains it. In the second routine, you @code{#include} the pixmap at compile time and use the pixmap data (an array of @code{char} pointers) directly. Note that both of these functions do not free the old pixmaps associated with the object. If you're writing a pixmap browser type applications, be sure to free the old pixmaps by calling @findex fl_free_pixmap_pixmap() @anchor{fl_free_pixmap_pixmap()} @example void fl_free_pixmap_pixmap(FL_OBJECT *obj); @end example @noindent on the pixmap object prior to calling these two routines. This function, in addition to freeing the pixmap and the mask, also frees the colors the pixmap allocated. To obtain the pixmap ID currently being displayed, the following routine can be used @findex fl_get_pixmap_pixmap() @anchor{fl_get_pixmap_pixmap()} @example Pixmap fl_get_pixmap_pixmap(FL_OBJECT *obj, Pixmap *id, Pixmap *mask); @end example In some situations, you might already have a pixmap resource ID, e.g., from @code{@ref{fl_read_pixmapfile()}} (see below in the "Remarks" subsection). Then you can use the following routine to change the the pixmap @findex fl_set_pixmap_pixmap() @anchor{fl_set_pixmap_pixmap()} @example void fl_set_pixmap_pixmap(FL_OBJECT *obj, Pixmap id, Pixmap mask); @end example @noindent where @code{mask} is used for transparency (see @code{@ref{fl_read_pixmapfile()}}). Use 0 for mask if no special clipping attributes are desired. This routine does not free the pixmap ID nor the mask already associated with the object. Thus if you no longer need the old pixmaps, they should be freed prior to changing the pixmaps using the function @code{@ref{fl_free_pixmap_pixmap()}}. Pixmaps are by default displayed centered inside the bounding box. However, this can be changed using the following routine @findex fl_set_pixmap_align() @anchor{fl_set_pixmap_align()} @example void fl_set_pixmap_align(FL_OBJECT *obj, int align, int dx, int dy); @end example @noindent where @code{align} is the same as that used for labels, @pxref{Label Attributes and Fonts} for a list. @code{dx} and @code{dy} are extra margins to leave in addition to the object border width. By default, @code{dx} and @code{dy} are set to 3. Note that although you can place a pixmap outside of the bounding box, it probably is not a good idea. @node Pixmap Attributes @subsection Pixmap Attributes By default if a pixmap has more colors than that available in the colormap, the library will use substitute colors that are judged "close enough". This closeness is defined as the difference between the requested color and the color found being smaller than some pre-set threshold values between 0 and 65535 (0 means exact match). The default thresholds are 40000 for red, 30000 for green and 50000 for blue. To change these defaults, use the following routine @findex fl_set_pixmap_colorcloseness() @anchor{fl_set_pixmap_colorcloseness()} @example void fl_set_pixmap_colorcloseness(int red, int green, int blue); @end example @node Pixmap Remarks @subsection Remarks The following routines may be handy for reading a pixmap file into a pixmap @findex fl_read_pixmapfile() @anchor{fl_read_pixmapfile()} @example Pixmap fl_read_pixmapfile(Window win, const char *filename, unsigned *width, unsigned *height, Pixmap *shape_mask, int *hotx, int *hoty, FL_COLOR tran); @end example @noindent where @code{win} is the window in which the pixmap is to be displayed. If the window is yet to be created, you can use the default window, returned by a call of @code{@ref{fl_default_window()}}. Parameter @code{shape_mask} is a pointer to an already existing @code{Pixmap}, which, if not @code{NULL}, is used as a clipping mask to achieve transparency. @code{hotx} and @code{hoty} are the center of the pixmap (useful if the pixmap is to be used as a cursor). Parameter @code{tran} is currently not used. If you already have the pixmap data in memory, the following routine can be used @findex fl_create_from_pixmapdata() @anchor{fl_create_from_pixmapdata()} @example Pixmap fl_create_from_pixmapdata(Window win, char **data, unsigned *width, unsigned *height, Pixmap *shape_mask, int *hotx, int *hoty, FL_COLOR tran); @end example @noindent All parameters have the same meaning as for @code{fl_read_pixmapfile}. Note that the Forms Library handles transparency, if specified in the pixmap file or data, for pixmap and pixmapbutton objects. However, when using @code{@ref{fl_read_pixmapfile()}} or @code{@ref{fl_create_from_pixmapdata()}}, the application programmer is responsible to set the clip mask in an appropriate GC. Finally there is a routine that can be used to free a Pixmap @findex fl_free_pixmap() @anchor{fl_free_pixmap()} @example void fl_free_pixmap(Pixmap id); @end example You will need the XPM library (version 3.4c or later)m developed by Arnaud Le Hors and Groupe Bull, to use pixmaps. The XPM library is avalialble as a package for most distributions, but can also be obtained from many X mirror sites, e.g., via anonymous FTP from (@uref{ftp://ftp.x.org/contrib/libraries/}. Its home page is @uref{http://old.koalateam.com/lehors/xpm.html}. @node Clock Object @section Clock Object A clock object simply displays a clock on the form @ifnottex @menu * Adding Clock Objects: Adding Clock Objects * Clock Types: Clock Types * Clock Interaction: Clock Interaction * Other Clock Routines: Other Clock Routines * Clock Attributes: Clock Attributes * Remarks: Clock Remarks @end menu @end ifnottex @node Adding Clock Objects @subsection Adding Clock Objects To add a clock to a form you use the routine @findex fl_add_clock() @anchor{fl_add_clock()} @example FL_OBJECT *fl_add_clock(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, char label[]) @end example @noindent The meaning of the parameters is as usual. The label is placed below the clock by default. @node Clock Types @subsection Clock Types The following types are available: @table @code @tindex FL_ANALOG_CLOCK @item FL_ANALOG_CLOCK An analog clock complete with the second hand. @tindex FL_DIGITAL_CLOCK @item FL_DIGITAL_CLOCK A digital clock. @end table @node Clock Interaction @subsection Clock Interaction No interaction takes place with clocks. @node Other Clock Routines @subsection Other Clock Routines To get the displayed time (local time as modified by the adjustment described below) use the following routine @findex fl_get_clock() @anchor{fl_get_clock()} @example void fl_get_clock(FL_OBJECT *obj, int *h, int *m, int *s); @end example @noindent Upon function return the parameters are set as follows: @code{h} is between 0-23, indicating the hour, @code{m} is between 0-59, indicating the minutes, and @code{s} is between 0-59, indicating the seconds. To display a time other than the local time, use the following routine @findex fl_set_clock_adjustment() @anchor{fl_set_clock_adjustment()} @example long fl_set_clock_adjustment(FL_OBJECT *obj, long adj); @end example @noindent where @code{adj} is in seconds. For example, to display a time that is one hour behind the local time, an adjustment of @code{3600} can be used. The function returns the old adjustment value. By default, the digital clock uses 24hr system. You can switch the display to 12hr system (am-pm) by using the following routine @findex fl_set_clock_ampm() @anchor{fl_set_clock_ampm()} @example void fl_set_clock_ampm(FL_OBJECT *obj, int yes_no) @end example @node Clock Attributes @subsection Clock Attributes Never use @code{FL_NO_BOX} as the boxtype for a digital clock. The first color argument (@code{col1}) of @code{@ref{fl_set_object_color()}} controls the color of the background, the second (@code{col2}) is the color of the hands. @node Clock Remarks @subsection Remarks See @file{flclock.c} for an example of the use of clocks. @xref{Misc. Functions}, for other time related routines. @node Chart Object @section Chart Object The chart object gives you an easy way to display a number of different types of charts like bar-charts, pie-charts, line-charts etc. They can either be used to display some fixed chart or a changing chart (e.g., a strip-chart). Values in the chart can be changed and new values can be added which makes the chart move to the left, i.e., new entries appear at the right and old entries disappear at the left. This can be used to e.g., monitor processes. @ifnottex @menu * Adding Chart Objects: Adding Chart Objects * Chart Types: Chart Types * Chart Interaction: Chart Interaction * Other Chart Routines: Other Chart Routines * Chart Attributes: Chart Attributes * Remarks: Chart Remarks @end menu @end ifnottex @node Adding Chart Objects @subsection Adding Chart Objects To add a chart object to a form use the routine @findex fl_add_chart() @anchor{fl_add_chart()} @example FL_OBJECT *fl_add_chart(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label); @end example @noindent It shows an empty box on the screen with the label below it. @node Chart Types @subsection Chart Types The following types are available: @table @code @tindex FL_BAR_CHART @item FL_BAR_CHART A bar-chart @tindex FL_HORBAR_CHART @item FL_HORBAR_CHART A horizontal bar-chart @tindex FL_LINE_CHART @item FL_LINE_CHART A line-chart @tindex FL_FILLED_CHART @item FL_FILLED_CHART A line-chart but the area below curve is filled @tindex FL_SPIKE_CHART @item FL_SPIKE_CHART A chart with a vertical spike for each value @tindex FL_PIE_CHART @item FL_PIE_CHART A pie-chart @tindex FL_SPECIALPIE_CHART @item FL_SPECIALPIE_CHART A pie-chart with displaced first item @end table All charts except pie-charts can display positive and negative data. Pie-charts will ignore values that are less then or equal to 0. The maximum number of values displayed in the chart can be set using the routine @code{@ref{fl_set_chart_maxnumb()}}. The argument must be not larger than @code{FL_CHART_MAX} which currently is 512. Switching between different types can be done without any complications. @node Chart Interaction @subsection Chart Interaction No interaction takes place with charts. @node Other Chart Routines @subsection Other Chart Routines There are a number of routines to change the values in the chart and to change its behavior. To clear a chart use the routine @findex fl_clear_chart() @anchor{fl_clear_chart()} @example void fl_clear_chart(FL_OBJECT *obj); @end example To add an item to a chart use @findex fl_add_chart_value() @anchor{fl_add_chart_value()} @example void fl_add_chart_value(FL_OBJECT *obj, double val, const char *text, FL_COLOR col); @end example @noindent Here @code{val} is the value of the item, @code{text} is the label to be associated with the item (can be empty) and @code{col} is an index into the colormap (@code{FL_RED} etc.) that is the color of this item. The chart will be redrawn each time you add an item. This might not be appropriate if you are filling a chart with values. In this case put the calls between calls of @code{@ref{fl_freeze_form()}} and @code{@ref{fl_unfreeze_form()}}. By default, the label is drawn in a tiny font in black. You can change the font style, size or color using the following routine @findex fl_set_chart_lstyle() @anchor{fl_set_chart_lstyle()} @findex fl_set_chart_lsize() @anchor{fl_set_chart_lsize()} @findex fl_set_chart_lcolor() @anchor{fl_set_chart_lcolor()} @example void fl_set_chart_lstyle(FL_OBJECT *obj, int fontstyle); void fl_set_chart_lsize(FL_OBJECT *obj, int fontsize); void fl_set_chart_lcolor(FL_OBJECT *obj, FL_COLOR color); @end example @noindent Note that @code{@ref{fl_set_chart_lcolor()}} only affects the label color of subsequent items, not the items already created. You can also insert a new value at a particular place using @findex fl_insert_chart_value() @anchor{fl_insert_chart_value()} @example void fl_insert_chart_value(FL_OBJECT *obj, int index, double val, const char *text, FL_COLOR col); @end example @noindent @code{index} is the index before which the new item should be inserted. The first item is number 1. So, for example, to make a strip-chart where the new value appears at the left, each time insert the new value before index 1. To replace the value of a particular item use the routine @findex fl_replace_chart_value() @anchor{fl_replace_chart_value()} @example void fl_replace_chart_value(FL_OBJECT *obj, int index, double val, const char *text, FL_COLOR col); @end example @noindent Here @code{index} is the index of the value to be replaced. The first value has an index of 1, etc. Normally, bar-charts and line-charts are automatically scaled in the vertical direction such that all values can be displayed. This is often not wanted when new values are added from time to time. To set the minimal and maximal value displayed use the routine @findex fl_set_chart_bounds() @anchor{fl_set_chart_bounds()} @example void fl_set_chart_bounds(FL_OBJECT *obj, double min, double max)' @end example @noindent To return to automatic scaling call it with both @code{min} and @code{max} being set to @code{0.0}. To obtain the current bounds, use the following routine @findex fl_get_chart_bounds() @anchor{fl_get_chart_bounds()} @example void fl_get_chart_bounds(FL_OBJECT *obj, double *min, double *max)' @end example Also the width of the bars and distance between the points in a line-chart are normally scaled. To change this use @findex fl_set_chart_autosize() @anchor{fl_set_chart_autosize()} @example void fl_set_chart_autosize(FL_OBJECT *obj, int autosize); @end example @noindent with @code{autosize} being set to false (0). In this case the width of the bars will be such that the maximum number of items fits in the box. This maximal number (defaults to @tindex FL_CHART_MAX @code{FL_CHART_MAX}) can be changed using @findex fl_set_chart_maxnumb() @anchor{fl_set_chart_maxnumb()} @example void fl_set_chart_maxnumb(FL_OBJECT *obj, int maxnumb); @end example @noindent where @code{maxnumb} is the maximal number of items to be displayed, which may not be larger than @code{FL_CHART_MAX}. @node Chart Attributes @subsection Chart Attributes Don't use boxtype @code{FL_NO_BOX} for a chart object if it changes value. Normally, for bar and line chart a baseline is drawn at 0. This can be switched on and off by the function @findex fl_set_chart_baseline() @anchor{fl_set_chart_baseline()} @example void fl_set_chart_baseline(FL_OBJECT *ob, int yes_no); @end example The first color argument (@code{col1}) to @code{@ref{fl_set_object_color()}} controls the (background) color of the box, the second (@code{col2}) the color of the baseline. @node Chart Remarks @subsection Remarks See @file{chartall.c} and @file{chartstrip.c} for examples of the use of chart objects. xforms-1.2.4/doc/part4_fl_object.texi0000644000175000017500000004472212252534161014470 00000000000000@node Part IV The Type FL_OBJECT @chapter The Type @code{FL_OBJECT} Each object has a number of attributes. Some of them are used by the main routine, some have a fixed meaning and should never be altered by the class routines and some are free for the class routines to use. Please always use accessor methods when available instead of using or changing the object's properties directly. Below we consider some of them that are likely to be used in new classes. @table @code @item int objclass This indicates the class of the object (e.g., @code{FL_BUTTON}, @code{FL_SLIDER}, @code{FL_NEW} etc.) The user can query the class of an object using the function @code{@ref{fl_get_object_objclass()}}. @item int type This indicates the type of the object within the class. Types are integer constants that should be defined in a header file named after the object class, e.g., @file{NEW.h}. Their use is completely free. For example, in the slider class the type is used to distinguish between horizontal and vertical sliders. At least one type should exist and the user should always provide it (just for consistency). They should be numbered from 0 upwards. The user can query the type of an object using the function @code{@ref{fl_get_object_type()}}. @item int boxtype This is the type of the bounding box for the object. The handling routine for the object, e.g., @code{handle_NEW()}, has to take care that this is actually drawn. Note that there is a routine for drawing boxes, see below. The user can change or query the boxtype of an object with the functions @code{@ref{fl_set_object_boxtype()}} and @code{@ref{fl_get_object_boxtype()}}. @item FL_Coord x, y, w, h These are the coordinates and sizes that indicate the bounding box of the object. They always have to be provided when adding an object. The system uses them e.g., to determine if the object is below the mouse. The class routines should use them to draw the object in the correct size, etc. Note that these values will change when the user resizes the form window. So never assume anything about their values but always recheck them when drawing the object. The routines @code{@ref{fl_get_object_geometry()}}, @code{@ref{fl_get_object_position()}} and @code{@ref{fl_get_object_size()}} should be used to determine position and/or size. To change the position and/or size of an object never change the elements of the structures directly (except in a function like @code{fl_add_NEW()}) but always use @code{@ref{fl_set_object_geometry()}}, @code{@ref{fl_set_object_position()}}, @code{@ref{fl_set_object_size()}} and @code{@ref{fl_move_object()}}! Also note that the @code{y}-member is always relative to the top of the form the object belongs to, even if the user had called @code{@ref{fl_flip_yorigin()}} - this only results in @code{y}-values passed by and returned to the user when using functions like @code{@ref{fl_set_object_position()}} or @code{@ref{fl_get_object_position()}} getting "flipped", internally always the normal coordinate system is used. @item unsigned int resize Controls if the object should be resized if the form it is on is resized. The options are @code{FL_RESIZE_NONE}, @code{FL_RESIZE_X}, @code{FL_RESIZE_Y} and @code{FL_RESIZE_ALL}. The default is @code{FL_RESIZE_ALL} which is the bitwise OR of @code{FL_RESIZE_X} and @code{FL_RESIZE_Y}. Instead of accessing this element directly better use the functions @code{@ref{fl_get_object_resize()}} and @code{@ref{fl_set_object_resize()}}. @item unsigned int nwgravity, segravity These two variables control how the object is placed relative to its position prior to resizing. Instead of accessing these elements directly use @code{@ref{fl_get_object_gravity()}} and @code{@ref{fl_set_object_gravity()}}. @item FL_COLOR col1, col2 These are two color indices in the internal color lookup table. The class routines are free to use them or not. The user can change them using the routine @code{@ref{fl_set_object_color()}} or inspect the colors with @code{@ref{fl_get_object_color()}}. The routine @code{fl_add_NEW()} should fill in defaults. @item char *label This is a pointer to an allocated text string. This can be used by class routines to provide a label for the object. The class routines may not forget to allocate storage for it when it sets the pointer itself, i.e., doesn't use @code{@ref{fl_set_object_label()}} - an empty label should be the empty string and not just a @code{NULL} pointer. The user can change it using the routines @code{@ref{fl_set_object_label()}} and @code{@ref{fl_set_object_label_f()}} or ask for it using @code{@ref{fl_get_object_label()}}. The label must be drawn by the routine handling the object when it receives a @code{FL_DRAWLABEL} event (or it could be part of the code for @code{FL_DRAW} event). For non-offsetted labels, i.e., the alignment is relative to the entire bounding box, simply calling @code{@ref{fl_draw_object_label()}} should be enough. @item FL_COLOR lcol The color of the label. The class routines can freely use this. The user can set it with @code{@ref{fl_set_object_lcolor()}} and test it with @code{@ref{fl_get_object_lcolor()}}. @item int lsize The size of the font used to draw the label. The class routines can freely use this. The user can set it with @code{@ref{fl_set_object_lsize()}}. and test it with @code{@ref{fl_get_object_lsize()}}. @item int lstyle The style of the font the label os drawn in, i.e., the number of the font in which it should be drawn. The class routines can freely use this. The user can set it with @code{@ref{fl_set_object_lstyle()}} and test it with @code{@ref{fl_get_object_lstyle()}}. @item int align The alignment of the label with respect to the object. Again it is up to the class routines to do something useful with this. The possible values are @code{@ref{FL_ALIGN_LEFT}}, @code{@ref{FL_ALIGN_RIGHT}}, @code{@ref{FL_ALIGN_TOP}}, @code{@ref{FL_ALIGN_BOTTOM}}, @code{@ref{FL_ALIGN_CENTER}}, @code{@ref{FL_ALIGN_LEFT_TOP}}, @code{@ref{FL_ALIGN_RIGHT_TOP}}, @code{@ref{FL_ALIGN_LEFT_BOTTOM}} and @code{@ref{FL_ALIGN_RIGHT_BOTTOM}}. The value should be bitwise ORed with @code{@ref{FL_ALIGN_INSIDE}} if the label will be within the bounding box of the object. The user can set this using the routine @code{@ref{fl_set_object_lalign()}} and test it with @code{@ref{fl_set_object_lalign()}}. @item int bw An integer indicating the border width of the object. Negative values indicate the up box should look "softer" (in which case no black line of 1 pixel width is drawn around the objects box). The user can set a different border width using @code{@ref{fl_set_object_bw()}}. @item long *shortcut A pointer to long containing all shortcuts (as keysyms) defined for the object (also see the previous chapter). You should never need them because they are fully handled by the main routines. @item void *spec This is a pointer that points to any class specific information. For example, for sliders it stores the minimum, maximum and current value of the slider. Most classes (except the most simple ones like boxes and texts) will need this. The function for adding a new object (@code{fl_add_NEW()}) has to allocate storage for it. Whenever the object receives the event @code{FL_FREEMEM} it should free this memory. @item int visible Indicates whether the object is visible. The class routines don't have to do anything with this variable. When the object is not visible the main routine will never try to draw it or send events to it. By default objects are visible. The visisbility of an object can be tested using the @code{@ref{fl_object_is_visible()}} function. Note that a this doesn't guarantee that the object is visible on the screen, for this also the form the object belongs to needs to be visible, in which case @code{@ref{fl_form_is_visible()}} returns true. @item int active Indicates whether the object is active, i.e., wants to receive events other than @code{FL_DRAW}. Static objects, such as text and boxes are inactive. This property should be set in the @code{fl_add_NEW()} routine if required. By default objects are active. This attribute can be changed by using the functions @code{@ref{fl_deactivate_object()}} and @code{@ref{fl_activate_object()}} and the current state can be determined by calling @code{@ref{fl_object_is_active()}}. @item int input Indicates whether this object can receive keyboard input. If not, events related to keyboard input are not sent to the object. The default value of @code{input} is false. It should be set by @code{fl_add_NEW()} if required. Note that not all keys are sent (see member @code{wantkey} below). @item int wantkey An input object normally does not receive @code{} or @code{} keystrokes or any other keys except those that have values between 0-255, the @code{} and @code{} arrow keys and @code{} and @code{} (@code{} and @code{} are normally used to switch between input objects). By setting this field to @code{FL_KEY_TAB} enforces that the object receives also these two keys as well as the @code{} and @code{} arrow keys and @code{} and @code{} when it has the focus. To receive other special keys (e.g., function keys) @code{FL_KEY_SPECIAL} must be set in @code{wantkey}. By setting @code{wantkey} to @code{FL_KEY_ALL} all keys are sent to the object. @item unsigned int click_timeout If non-zero this indicates the the maximum elapsed time (in msec) between two mouse clicks to be considered a double click. A zero value disables double/triple click detection. The user can set or query this value using the functions @code{@ref{fl_set_object_dblclick()}} and @code{@ref{fl_get_object_dblclick()}}. @c The following is incorrect. The current implementation works only @c for buttons since it explictely calls @code{@ref{fl_get_button()}}, @c so one can't create radio objects of any other sort. @c @c @item int radio This indicates whether this object is a radio @c object. This means that, whenever it is pushed, other radio objects @c in the same group in the form that are pushed are released (and @c their pushed value is reset). Radio buttons use this. The default @c is false. The @code{fl_add_NEW()} routine should set it if @c required. @item int automatic An object is automatic if it automatically (without user actions) has to change its contents. Automatic objects get a @code{FL_STEP} event about every @w{50 msec}. For example the object class @code{FL_CLOCK} is automatic. @code{automatic} by default is false. To set this property use @code{@ref{fl_set_object_automatic()}} (don't set the object member directly except from within a function like @code{fl_add_NEW()}, in other contexts some extra work is required) and to test the object for it use @code{@ref{fl_object_is_automatic()}}. @item int belowmouse This indicates whether the mouse is on this object. It is set and reset by the main routine. The class routines should never change it but can use it to draw or handle the object differently. @item int pushed This indicates whether the mouse is pushed within the bounding box of the object. It is set and reset by the main routine. Class routines should never change it but can use it to draw or handle objects differently. @item int focus Indicates whether keyboard input is sent to this object. It is set and reset by the main routine. Never change it but you can use its value. @item FL_HANDLEPTR handle This is a pointer to the interaction handling routine for the object. @code{fl_add_NEW()} sets this by providing the correct handling routine. Normally it is never used (except by the main routine) or changed although there might be situations in which you want to change the interaction handling routine for an object, due to some user action. @item FL_OBJECT *next, *prev @itemx FL_FORM *form These are pointers to other objects in the form and to the form itself. They are used by the main routines. The class routines should not change them. @item void *c_vdata A void pointer for the class routine. The main module does not reference or modify this field in any way. The object classes, including the built-in ones, may use this field. @item char *c_cdata A char pointer for the class routine. The main module does not reference or modify this field in any way. The object classes, including the built-in ones, may use this field. @item long c_ldata A long variable for the class routine. The main module does not reference or modify this field in any way. The object classes, including the built-in ones, may use this field. @item void *u_vdata A void pointer for the application program. The main module does not reference or modify this field in any way and neither should the class routines. @item char *u_cdata A char pointer for the application program. The main module does not reference or modify this field in any way and neither should the class routines. @item long u_ldata A long variable provided for the application program. @item FL_CALLBACKPTR object_callback The callback routine that the application program assigned to the object and that the system invokes when the user does something with the object. @item long argument The argument to be passed to the callback routine when invoked. @item int how_return Determines under what circumstances the object is returned by e.g., @code{@ref{fl_do_forms()}} or the callback function for the object is invoked. This can be either @table @code @item @ref{FL_RETURN_NONE} Object gets never returned or its callback invoked @item @ref{FL_RETURN_CHANGED} Return object or invoke callback when state of object changed. @item @ref{FL_RETURN_END} Return object or invoke callback at end of interaction, normally when the mouse key is released or, in the case of input objects, the object has lost focus. @item @ref{FL_RETURN_END_CHANGED} Return object or invoke callback only when interaction has ended and the state of the object has changed. @item @ref{FL_RETURN_SELECTION} Return object or invoke callback if e.g., in a browser a line was selected. @item @ref{FL_RETURN_SELECTION} Return object or invoke callback if e.g., in a browser a line was deselected. @item @ref{FL_RETURN_ALWAYS} Return object or invoke callback whenever interaction has ended or the state of the object has changed. @end table Never change this element of the structure directly but use the function @code{@ref{fl_set_object_return()}} instead! Especially in the case of objects having child objects also the corresponding settings for child objects may need changes and which automatically get adjusted when the above function is used. @item int returned Set to what calling the object handling function did return (and pruned to what the object is supposed to return according to the @code{how_return} element). Can be either @table @code @item @ref{FL_RETURN_NONE} Handling function did @code{FL_RETURN_NONE} (i.e., @code{0}). @item @ref{FL_RETURN_CHANGED} Handling function detected a change of the objects state. @item @ref{FL_RETURN_END} Handling function detected end of interaction with object. @end table @code{@ref{FL_RETURN_CHANGED}} and @code{@ref{FL_RETURN_END}} are bits that can be bitwise ored. If both are set this indicates that the objects state was changed and the interaction ended. @end table The generic object construction routine @tindex FL_HANDLEPTR @findex fl_make_object() @anchor{fl_make_object()} @example typedef int (*FL_HANDLEPTR)(FL_OBJECT *obj, int event, FL_Coord mx, FL_Coord my, int key, void *raw_event); FL_OBJECT *fl_make_object(int objclass, int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label, FL_HANDLEPTR handle); @end example @noindent allocates a chunk of memory appropriate for all object classes and initializes the newly allocated object to the following state: @example obj->resize = FL_RESIZE_X | FL_RESIZE_Y; obj->nwgravity = obj->segravity = FL_NoGravity; obj->boxtype = FL_NO_BOX; obj->align = FL_ALIGN_CENTER | FL_ALIGN_INSIDE; obj->lcol = FL_BLACK; obj->lsize = FL_DEFAULT_SIZE; obj->lstyle = FL_NORMAL_STYLE; obj->col1 = FL_COL1; obj->col2 = FL_MCOL; obj->wantkey = FL_KEY_NORMAL; obj->active = 1; obj->visible = 1; obj->bw = borderWidth_resource_set ? resource_val : FL_BOUND_WIDTH; obj->u_ldata = 0; obj->u_vdata = 0; obj->spec = NULL; obj->how_return = FL_RETURN_CHANGED @end example In some situations it can be also useful to make an object a child of another object. An example is the scrollbar object. It has three child objects, a slider and two buttons, which all three are children of the scrollbar object. To make an object @code{child} a child object of an object named @code{parent} use the function @findex fl_add_child() @anchor{fl_add_child()} @example void fl_add_child(FL_OBJECT *parent, FL_OBJECT *child); @end example When creating a composite object you will typically add callbacks for the child object that handle what happens on events for these child objects (e.g., for the scrollbar the buttons have callbacks that update the internal state for the scrollbar object and result in the slider getting shifted). Within these callback functions the @code{returned} elements of the parent can be changed to influence if and what gets reported to the application via @code{@ref{fl_do_forms()}}. There is rarely any need for the new object class to know how the object is added to a form and how the Forms Library manages the geometry, e.g., does an object have its own window etc. Nonetheless if this information is required, use @code{@ref{FL_ObjWin()}} on the object to obtain the window resource ID of the window the object belongs to. Beware that an object window ID may be shared with other objects@footnote{The only exception is the canvas class where the window ID is guaranteed to be non-shared.}. Always remove an object from the screen with @code{@ref{fl_hide_object()}}. The class routine/application may reference the following members of the @code{FL FORM} structure to obtain information on the status of the form, but should not modify them directly: @table @code @item int visible Indicates if the form is visible on the screen (mapped). Never change it directly, use @code{@ref{fl_show_form()}} or @code{@ref{fl_hide_form()}} instead. @item int deactivated Indicates if the form is deactivated. Never change it directly, use @code{@ref{fl_activate_form()}} or @code{@ref{fl_deactivate_form()}} instead. @item FL OBJECT *focusobj This pointer points to the object on the form that has the input focus. @item FL OBJECT *first The first object on the form. Pointer to a linked list. @item Window window The forms window. @end table xforms-1.2.4/doc/part5_overview.texi0000664000175000017500000024216712353623325014420 00000000000000@node Part V Overview of Main Functions @chapter Overview of Main Functions In this chapter we give a brief overview of all the main functions that are available. For an overview of all routines related to specific object classes see Part III. @ifnottex @menu * Version Information:: * Initialization:: * Creating Forms:: * Object Attributes:: * Doing Interaction:: * Signals:: * Idle Callbacks and Timeouts:: * Global Variables and Macros:: @end menu @end ifnottex @node Version Information @section Version Information The header file @file{forms.h} defines three symbolic constants which you can use to conditionally compile your application. They are @table @code @tindex FL_VERSION @anchor{FL_VERSION} @item FL_VERSION The major version number. @tindex FL_REVISION @anchor{FL_REVISION} @item FL_REVISION Revision number. @tindex FL_INCLUDE_VERSION @anchor{FL_INCLUDE_VERSION} @item FL_INCLUDE_VERSION @code{1000 * FL_VERSION + FL_REVISION} @end table There is also a routine that can be used to obtain the library version at run time: @findex fl_library_version() @anchor{fl_library_version()} @example int fl_library_version(int *version, int *revision) @end example @noindent The function returns a consolidated version information, computed as @code{1000 * version + revision}. For example, for library version 1 revision 21 (1.21), the function returns a value of 1021 with @code{version} and @code{revision} (if not @code{NULL}) set to 1 and 21, respectively. It is always a good idea to check if the header and the run time library are of the same version and take appropriate actions when they are not. This is especially important for versions less than 1. To obtain the version number of the library used in an executable, run the command with @code{-flversion} option, which will print the complete version information. @node Initialization @section Initialization The routine @findex fl_initialize() @anchor{fl_initialize()} @example Display *fl_initialize(int *argc, char *argv[], const char *appclass, XrmOptionDescList app_opt, int n_app_opt); @end example @noindent initializes the Forms Library and returns a pointer to the @code{Display} structure if a connection could be made, otherwise @code{NULL}. This function must be called before any other calls to the Forms Library (except @code{@ref{fl_set_defaults()}} and a few other functions that alter some of the defaults of the library). The meaning of the arguments is as follows @table @code @item argc, argv Number and array of the command line arguments the application was started with. The application name is derived from @code{argv[0]} by stripping leading path names and trailing period and extension, if any. Due to the way the X resources (and command line argument parsing) work, the executable name should not contain a dot @code{.} or a star @code{*}. @item appclass The application class name, which typically is the generic name for all instances of this application. If no meaningful class name exists, it is typically given (or converted to if non given) as the application name with the first letter capitalized (second if the first letter is an X). @item app_opt Specifies how to parse the application-specific resources. @item n_app_opt Number of entries in the option list. @end table The @code{@ref{fl_initialize()}} function builds the resource database, calls the Xlib @code{XrmParseCommand()} function to parse the command line arguments and performs other per display initialization. After the creation of the database, it is associated with the display via @code{XrmSetDatabase()}, so the application can get at it if necessary. All recognized options are removed from the argument list and their corresponding values set. The XForms library provides appropriate defaults for all options. The following are recognized by the library: @multitable @columnfractions 0.25 0.1 0.45 0.2 @item @strong{Option} @tab @strong{Type} @tab @strong{Meaning} @tab @strong{Default} @item @code{-fldebug} @i{level} @tab int @tab Print debug information @tab 0 (off) @item @code{-name} @i{appname} @tab string @tab Change application name @tab none @item @code{-flversion} @tab @tab Print version of the library @tab @item @code{-sync} @tab @tab Synchronous X11 mode (debug) @tab false @item @code{-display} @i{host:dpy} @tab string @tab Set (remote) host @tab @code{$DISPLAY} @item @code{-visual} @i{class} @tab string @tab TrueColor, PseudoColor... @tab best @item @code{-depth} @i{depth} @tab int @tab Set prefered visual depth @tab best @item @code{-vid} @i{id} @tab long @tab Set prefered visual ID @tab 0 @item @code{-private} @tab @tab Force use of private colormap @tab false @item @code{-shared} @tab @tab Force use of shared colormap @tab false @item @code{-stdcmap} @tab @tab Force use of standard colormap @tab false @item @code{-double} @tab @tab Enable double buffering for forms @tab false @item @code{-bw} @i{width} @tab int @tab Set object border width @tab 1 @item @code{-rgamma} @i{gamma} @tab float @tab Set red gamma @tab 1.0 @item @code{-ggamma} @i{gamma} @tab float @tab Set green gamma @tab 1.0 @item @code{-bgamma} @i{gamma} @tab float @tab Set blue gamma @tab 1.0 @end multitable In the above table "best" means the visual that has the most colors, which may or may not be the server's default. There is a special command option @code{-visual Default} that sets both the visual and depth to the X servers default. If a visual ID is requested, it overrides depth or visual if specified. The visual ID can also be requested programmatically (before @code{@ref{fl_initialize()}} is called) via the function @findex fl_set_visualID() @anchor{fl_set_visualID()} @example void fl_set_visualID(long id); @end example Note that all command line options can be abbreviated, thus if the application program uses single character options, they might clash with the built-ins. For example, if you use @code{-g} as a command line option to indicate geometry, it might not work as @code{-g} matches @code{-ggamma} in the absence of @code{-ggamma}. Thus you should avoid using single character command line options. If the border width is set to a negative number, all objects appear to have a softer appearance. Older version of the library used a larger default for the border width of 3. As mentioned the @code{@ref{fl_initialize()}} function removes all the above listed values from the command line arguments, leaving you with a cleaned-up list. To get again at the complete list you can use the function @findex fl_get_cmdline_args() @anchor{fl_get_cmdline_args()} @example char **fl_get_cmdline_args( int *arg_cnt ); @end example @noindent returning a copy to the values from the original list and their number via the @code{arg_cnt} argument. Depending on your application XForms defaults may or may not be appropriate. E.g., on machines capable of @w{24 bits} visuals, Forms Library always selects the deeper @w{24 bits} visual. If your application only uses a limited number of colors, it might be faster if a visual other than @w{24 bits} is selected. There are a couple of ways to override the default settings. You can provide an application specific resource database distributed with your program. The easiest way, however, is to set up your own program defaults programmatically without affecting the users' ability to override them with command line options. For this, you can use the following routine before calling @code{@ref{fl_initialize()}}: @findex fl_set_defaults() @anchor{fl_set_defaults()} @tindex FL_IOPT @anchor{FL_IOPT} @example void fl_set_defaults(unsigned long mask, FL_IOPT *flopt); @end example @noindent In addition to setting a preferred visual, this function can also be used to set other program defaults, such as label font size, unit of measure for form sizes etc. The following table lists the fields, masks and their meanings of @code{@ref{FL_IOPT}}: @multitable @columnfractions 0.25 0.3 0.45 @headitem Structure @tab Mask Name @tab Meaning @item @code{typedef struct @{} @tab @tab @item @code{int debug;} @tab @code{FL_PDDebug} @tab Debug level (0-5) @item @code{int depth;} @tab @code{FL_PDDepth} @tab Preferred visual depth @item @code{int vclass;} @tab @code{FL_PDVisual} @tab Prefered visual, @code{TrueColor} etc. @item @code{int doubleBuffer;} @tab @code{FL_PDDouble} @tab Simulate double buffering @item @code{int buttonFontSize;} @tab @code{FL_PDButtonFontSize} @tab Default button label font size @item @code{int menuFontSize;} @tab @code{FL_PDMenuFontSize} @tab Menu label font size @item @code{int choiceFontSize;} @tab @code{FL_PDChoiceFontSize} @tab Choice label and choice text font size @item @code{int browserFontSize;} @tab @code{FL_PDBrowserFontSize} @tab Browser label and text font size @item @code{int inputFontSize;} @tab @code{FL_PDInputFontSize} @tab Input label and text font size @item @code{int labelFontSize;} @tab @code{FL_PDLabelFontSize} @tab Label font size for all other objects (box, pixmap etc.) @item @code{int pupFontSize;} @tab @code{FL_PDPupFontSize} @tab Font size for pop-ups @item @code{int privateColormap;} @tab @code{FL_PDPrivateMap} @tab Select private colormap if appropriate @item @code{int sharedColormap;} @tab @code{FL_PDSharedMap} @tab Force use of shared colormap @item @code{int standardColormap;} @tab @code{FL_PDStandardMap} @tab Force use of standard colormap @item @code{int scrollbarType;} @tab @code{FL_PDScrollbarType} @tab Scrollbar type to use for browser and input @item @code{int ulThickness;} @tab @code{FL_PDULThickness} @tab Underline thickness @item @code{int ulPropWidth;} @tab @code{FL_PDULPropWidth} @tab Underline width, 0 for const. width fonts @item @code{int backingStore;} @tab @code{FL_PDBS} @tab Turn BackingStore on or off @item @code{int coordUnit;} @tab @code{FL_PDCoordUnit} @tab Unit of measure: pixel, mm, point @item @code{int borderWidth;} @tab @code{FL_PDBorderWidth} @tab Default border width @item @code{@} FL IOPT;} @tab @tab @end multitable A special visual designation, @code{FL_DefaultVisual} and a command line option equivalent, @code{-visual Default} are provided to set the program default to the server's default visual class and depth. If you set up your resource specifications to use class names instead of instance names, users can then list instance resources under an arbitrary name that is specified with the @code{-name} option. Coordinate units can be in pixels, points (1/72 inch), mm (millimeters), cp (centi-point, i.e., 1/100 of a point) or cmm (centi-millimeter). The the type of unit in use can be queried or set via the functions @findex fl_get_coordunit() @anchor{fl_get_coordunit()} @findex fl_set_coordunit() @anchor{fl_set_coordunit()} @example int fl_get_coordunit(void); void fl_set_coordunit(int coordUnit); @end example @noindent @code{coordUnit} can have the following values: @tindex FL_COORD_PIXEL @tindex FL_COORD_POINT @tindex FL_COORD_MM @tindex FL_COORD_centiPOINT @tindex FL_COORD_centiMM @code{FL_COORD_PIXEL}, @code{FL_COORD_POINT}, @code{FL_COORD_MM}, @code{FL_COORD_centiPOINT} and @code{FL_COORD_centiMM}. The unit in use can be changed anytime, but typically you would do this prior to creating a form, presumably to make the size of the form screen resolution independent. The basic steps in doing this may look something like the following: @example int oldcoordUnit = fl_get_coordunit(); fl_set_coordunit(FL_COORD_POINT); fl_bgn_form(...); /* add more objects */ fl_end_form(); fl_set_coordunit(oldcoordunit); @end example Some of the defaults are "magic" in that their exact values depend on the context or platform. For example, the underline thickness by default is 1 for normal fonts and 2 for bold fonts. There exists a convenience function to set the application default border width @findex fl_set_border_width() @anchor{fl_set_border_width()} @example void fl_set_border_width(int border_width) @end example @noindent which is equivalent to @example FL_IOPT fl_cntl; fl_cntl.borderWidth = border_width; fl_set_defaults(FL_PDBorderWidth, &fl_cntl); @end example Typically this function, if used, should appear before @code{@ref{fl_initialize()}} is called so the user has the option to override the default via resource or command line options. The cirrent setting of the borderwidth can also tested via @findex fl_get_border_width() @anchor{fl_get_border_width()} @example int fl_get_border_width(void); @end example To change the default scrollbar type (which is @code{THIN_SCROLLBAR}) used in browser and input object, the following convenience function can be used: @findex fl_set_scrollbar_type() @anchor{fl_set_scrollbar_type()} @example void fl_set_scrollbar_type(int type); @end example where @code{type} can be one of the following @table @code @item FL_NORMAL_SCROLLBAR Basic scrollbar @item FL_THIN_SCROLLBAR Thin scrollbar @item FL_NICE_SCROLLBAR Nice scrollbar @item FL_PLAIN_SCROLLBAR Similar to thin scrollbar, but not as fancy @end table Setting the scrollbar type before calling @code{@ref{fl_initialize()}} is equivalent to @example FL_IOPT fl_cntl; fl_cntl.scrollbarType = type; fl_set_defaults(FL_PDScrollbarType, &fl_cntl); @end example It is recommended that this function be used before @code{@ref{fl_initialize()}} so the user has the option to override the default through application resources. Prior to version 0.80 the origin of XForms' coordinate system was at the lower left-hand corner of the form. The new Form Designer will convert the form definition file to the new coordinate system, i.e., with the origin at the upper left-hand corner, so no manual intervention is required. To help those who lost the @code{.fd} files or otherwise can't use a newer version of @code{fdesign}, a compatibility function is provided @findex fl_flip_yorigin() @anchor{fl_flip_yorigin()} @example void fl_flip_yorigin(void); @end example @noindent Note however that this function must be called prior to @code{@ref{fl_initialize()}} and is a no-op after that. If this function has been called functions like @code{@ref{fl_get_object_position()}} or @code{@ref{fl_get_object_bbox()}}, reporting an objects positions and bounding box, will return @code{y}-coordinates in the old-fashioned coordinate system with the origin at the left bottom corner of the form. Similarly, the functions for setting or changing an objects position (@code{@ref{fl_set_object_position()}} and @code{@ref{fl_move_object()}}) then expect to receive arguments for the @code{y}-coordinates in this system. The @code{y}-coordinate stored in the object itself (i.e., @code{obj->y}) is always for the normal coordinate system with the origin at the top left corner. For proportional font, substituting tabs with spaces is not always appropriate because this most likely will fail to align text properly. Instead, a tab is treated as an absolute measure of distance, in pixels, and a tab stop will always end at multiples of this distance. Application program can adjust this distance by setting the tab stops using the following routine @findex fl_set_tabstop() @anchor{fl_set_tabstop()} @example void fl_set_tabstop(const char *s); @end example @noindent where @code{s} is a string whose width in pixels is to be used as the tab length. The font used to calculate the width is the same font that is used to render the string in which the tab is embedded. The default @code{"aaaaaaaa"}, i.e., eight @code{'a'}s. Before we proceed further, some comments about double buffering are in order. Since Xlib does not support double buffering, Forms Library simulates this functionality with pixmap bit-bliting. In practice, the effect is hardly distinguishable from double buffering and performance is on par with multi-buffering extensions (It is slower than drawing into a window directly on most workstations however). Bear in mind that a pixmap can be resource hungry, so use this option with discretion. In addition to using double buffering throughout an application, it is also possible to use double buffering on a per-form or per-object basis by using the following routines: @findex fl_set_form_dblbuffer() @anchor{fl_set_form_dblbuffer()} @findex fl_set_object_dblbuffer() @anchor{fl_set_object_dblbuffer()} @example void fl_set_form_dblbuffer(FL_FORM *form, int yes_no); void fl_set_object_dblbuffer(FL_OBJECT *obj, int yes_no); @end example @noindent Currently double buffering for objects having a non-rectangular box might not work well. A nonrectangular box means that there are regions within the bounding box that should not be painted, which is not easily done without complex and expensive clipping and unacceptable inefficiency. XForms gets around this by painting these regions with the form's backface color. In most cases, this should prove to be adequate. If needed, you can modify the background of the pixmap by changing @code{obj->dbl_background} after switching to double buffer. Normally the Forms Library reports errors to @code{stderr}. This can be avoided or modified by registering an error handling function @findex fl_set_error_handler() @anchor{fl_set_error_handler()} @example void fl_set_error_handler(void (*user_handler)(const char *where, const char *fmt,...)); @end example @noindent The library will call the @code{user_handler} function with a string indicating in which function an error occured and a formatting string (see @code{sprintf()}) followed by zero or more arguments. To restore the default handler, call the function again with @code{user_handler} set to @code{NULL}. You can call this function anytime and as many times as you wish. You can also instruct the default message handler to log the error to a file instead of printing to @code{stderr} @findex fl_set_error_logfp() @anchor{fl_set_error_logfp()} @example void fl_set_error_logfp(FILE *fp); @end example @noindent For example @example fl_set_error_logfp(fopen("/dev/null","w")); @end example redirects all error messages to @file{/dev/null}, effectively turning off the default error reporting to @code{stderr}. In XForms versions older than 1.0.01 for some error messages, in addition to being printed to stderr, a dialog box were shown that requires actions from the user. This could be turned off and on with the function @findex fl_show_errors() @anchor{fl_show_errors()} @example void fl_show_errors(int show); @end example @noindent where @code{show} indicates whether to show (1) or not show (0) the errors. With newer versions of the Forms Library this function has no effect. The fonts used in all forms can be changed using the routines @findex fl_set_font_name() @anchor{fl_set_font_name()} @findex fl_set_font_name_f() @anchor{fl_set_font_name_f()} @example int fl_set_font_name(int n, const char *name); int fl_set_font_name_f(int n, const char *fmt, ,,,); @end example @noindent The first function just accepts a simple string while the second constructs the font name from a format string just as it's used for @code{printf()} etc. and the following arguments. The first argument, @code{n}, must be a number between 0 and @code{FL_MAXFONTS-1}. The function returns @code{0} on success, @code{1} if called before proper initialization of the library and @code{-1} for either invalid arguments (@code{name} or the result of the expansion of the format string doesn't name an available font, @code{n} negative or not less than @code{FL_MAXFONTS}). @xref{Label Attributes and Fonts}, for details. A redraw of all forms is required to actually see the change for visible forms. Since the dimension of an object is typically given in pixels, depending on the server resolution and the font used, this can lead to unsatisfactory user interfaces. For example, a button designed to (just) contain a label in a @w{10 pt} font on a @w{75 DPI} monitor will have the label overflow the button on a @w{100 DPI} monitor. This comes about because a character of a @w{10 pt} font when rendered with @code{75 DPI} resolution may have 10 pixels while the same character in the same @w{10 pt} font with @w{100 DPI} resolution may have 14 pixels. Thus, when designing the interfaces, leave a few extra pixels for the object. Or use a resolution independent unit, such as point, or centi-point etc. Using a resolution independent unit for the object size should solve the font problems, theoretically. In practice, this approach may still prove to be vulnerable. The reason is the discreteness of both the font resolution and the monitor/server resolutions. The standard X fonts only come in two discrete resolutions, @w{75 DPI} and @w{100 DPI}. Due to the variations in monitor resolutions, the theoretically identical sized font, say a @w{10 pt} font, can vary in sizes (pixels) by up to 30%, depending on the server (rendering a font on a @w{80 DPI} monitor will cause errors in sizes regardless if a @w{75 DPI} or @w{100 DPI} font is used.) This has not even taken into account the fact that a surprising number of systems have wrong font paths (e.g., a @w{90 DPI} monitor using @w{75 DPI} fonts etc.). With the theoretical and practical problems associated with X fonts, it is not practical for XForms to hard-code default font resolution and it is not practical to use the resolution information obtained from the server either as information obtained from the server regarding monitor resolution is highly unreliable. Thus, XForms does not insist on using fonts with specific resolutions and instead it leaves the freedom to select the default fonts of appropriate resolutions to the system administrators. Given all these uncertainties regarding fonts, as a workaround, XForms provides a function that can be used to adjust the object size dynamically according to the actual fonts loaded: @findex fl_adjust_form_size() @anchor{fl_adjust_form_size()} @example double fl_adjust_form_size(FL_FORM *form); @end example This function works by computing the size (in pixels) of every object on the form that has an inside label and compares it to the size of the object. Scaling factors are computed for all object labels that don't fit. The maximum scaling factor found is then used to scale the form so every object label fits inside the object. It will never shrink a form. The function returns the resulting scaling factor. In scaling the aspect ratio of the form is left unmodified and all object gravity specifications are ignored. Since this function is meant to compensate for font size and server display resolution variations, scaling is limited to 125% per invocation. The best place to use this function is right after the creation of the forms. If the forms are properly designed this function should be a no-op on the machine the forms were designed on. Form Designer has a special option @code{-compensate} and resource @code{compensate} to request the emission of this function automatically for every form created. It is likely that this will become the default once the usefulness of it has been established. There is a similar function that works the same way, but on an object-by-object basis and further allows explicit margin specifications: @findex fl_fit_object_label() @anchor{fl_fit_object_label()} @example void fl_fit_object_label(FL_OBJECT *obj, FL_Coord hm, FL_Coord vm); @end example @noindent where @code{hm} and @code{vm} are the horizontal and vertical margins to leave on each side of the object, respectively. This function works by computing the object labels size and comparing it to the object size. If the label does not fit inside the object with the given margin, the entire form the object is on is scaled so the object label fits. In scaling the form, all gravity specification is ignored but the aspect ratio of the form (and thus of all objects) is kept. This function will not shrink a form. You can use this function on as many objects as you choose. Of course the object has to have a label inside the object for this function to work. All colors with indices smaller than @code{FL_FREE_COL1} are used (or can potentially be used) by the Forms Library. If you wish they can be changed using the following function prior to @code{@ref{fl_initialize()}}: @findex fl_set_icm_color() @anchor{fl_set_icm_color()} @example void fl_set_icm_color(FL_COLOR index, int r, int g, int b); @end example @noindent Using this function you can actually change all entries in the internal colormap (with @code{index} going up to @code{FL_MAX_COLORS-1}). You may also inspect the internal colormap using @findex fl_get_icm_color() @anchor{fl_get_icm_color()} @example void fl_get_icm_color(FL_COLOR index, int *r, int *g, int *b); @end example In some situations Forms Library may modify some of the server defaults. All modified defaults are restored as early as possible by the main loop and in general, when the application exits, all server defaults are restored. The only exception is when exiting from a callback that is activated by shortcuts. Thus it is recommended that the cleanup routine @code{@ref{fl_finish()}} is called prior to exiting an application or register it via @code{atexit()}. @findex fl_finish() @anchor{fl_finish()} @example void fl_finish(void); @end example In addition to restoring all server defaults, @code{@ref{fl_finish()}} also shuts down the connection and frees dynamically allocated memory. @node Creating Forms @section Creating Forms To start the definition of a form call @findex fl_bgn_form() @anchor{fl_bgn_form()} @example FL_FORM *fl_bgn_form(int type, FL_Coord w, FL_Coord h); @end example @noindent When the form is created it automatically acquires one object, a box object covering the full area of the form, which is used as the background of the form. The @code{type} argument is the type of this box object, so you can "style" the look of your forms (but don't use any non-rectangular box types). @code{w} and @code{h} are the width and height of the new form. The function returns a pointer to the new form. Note: if you look at the code generated by @code{fdesign} for the creation of a form you may notice that the type of this automatically assigned box is @code{@ref{FL_NO_BOX}} (which is invisible) and that for the background another box of the same size but a different (visible) type is added. This is because in @code{fdesign} the very first object can't be accessed and thus its properties can not be adjusted (like the box type or its color that then becomes the background color of the form). By using an extra box, which can be accessed from within @code{fdesign}, that problem is circumvented. There also exist functions for setting and requesting the background color of a form @findex fl_set_form_background_color() @anchor{fl_set_form_background_color()} @findex fl_get_form_background_color() @anchor{fl_get_form_background_color()} @example void fl_set_form_background_color(FL_FORM *form, FL_COLOR col); FL_COLOR fl_get_form_background_color(FL_FORM *form); @end example @noindent These functions use the color of the very first object of the form, or, if this is a box of type @code{@ref{FL_NO_BOX}} as it is the case with forms created via code generated by @code{fdesign}, the color of the second object. If these object(s) don't exist the function can't work properly. Once all objects required have been added to a form call @findex fl_end_form(); @anchor{fl_end_form()} @example void fl_end_form(void); @end example @noindent Between these two calls objects and groups of objects are added to the form with functions like @code{@ref{fl_add_button()}}. To start a new group of objects use @findex fl_bgn_group() @anchor{fl_bgn_group()} @example FL_OBJECT *fl_bgn_group(void); @end example @noindent The function returns a pointer to the group (actually to an invisible pseudo-object of class @tindex FL_BEGIN_GROUP @code{FL_BEGIN_GROUP}). Groups can't be nested. When all objects that are supposed to belong to the group are added call @tindex FL_END_GROUP @findex fl_end_group() @anchor{fl_end_group()} @example void fl_end_group(void); @end example @noindent Also this function creates an (invisible) pseudo-object, belonging to class @code{FL_END_GROUP}, but since it can't be used its address isn ot returned. Groups are useful for two reasons. First of all, it is possible to hide or deactivate groups of objects with a single function call. This is often very handy to dynamically change the appearance of a form depending on the context or selected options. In addition it can also be used as a shortcut to set some particular attributes of several objects. It is not uncommon that you want several objects to maintain their relative positioning upon form resizing. This requires to set the gravity for each object. If these objects are placed inside a group, setting the gravity attributes of the group will suffice. The second reason for use of groups is radio buttons. Radio buttons are considered related only if they belong to the same group. Using groups is the only way to place unrelated groups of radio buttons on a single form without interference from each other. Both forms and groups that have been ended by @code{@ref{fl_end_form()}} or @code{@ref{fl_end_group()}} can be "reopened" by using @findex fl_addto_form() @anchor{fl_addto_form()} @findex fl_addto_group() @anchor{fl_addto_group()} @example FL_FORM *fl_addto_form(FL_FORM *form) FL_OBJECT *fl_addto_group(FL_OBJECT *group); @end example @noindent Both functions return their argument on success and @code{NULL} on failure (e.g., because a different group or form is still open). On success further objects can be appended to the form or group. To remove an object from a form use @findex fl_delete_object() @anchor{fl_delete_object()} @example void fl_delete_object(FL_OBJECT *obj); @end example @noindent This does not yet destroy the object, it just breaks its connection to the form it did belong to, so it can still be referenced and added to the same form again or some other form using @findex fl_add_object() @anchor{fl_add_object()} @example void fl_add_object(FL_FORM *form, FL_OBJECT *obj); @end example @noindent even without "reopening" the form using @code{@ref{fl_addto_form()}}. To finally destroy an object use @findex fl_free_object() @anchor{fl_free_object()} @example void fl_free_object(FL_OBJECT *obj); @end example @noindent If @code{@ref{fl_delete_object()}} hadn't been called for the object this will happen now. The object receives a final event of type @code{@ref{FL_FREEMEM}} to allow it to free memory it did allocate and do whatever other clean-up required. Finally all memory allocated for the object is freed. After being freed an object can not be referenced anymore. A form as a whole, together with all the objects it contains can be deleted by calling @findex fl_free_form() @anchor{fl_free_form()} @example void fl_free_form(FL_FORM *form); @end example @noindent This will first hide the form (emitting warning if this is necessary), then free all of its objects and finally release memory allocated for the form. @node Object Attributes @section Object Attributes A number of general routines are available for setting and querying attributes. Unless stated otherwise, all attributes altering routines affect the appearance or geometry of the object immediately if the object is visible. Since the object class and type of an object can't be changed anymore once an object has been created there are only functions for querying these attributes: @findex fl_get_object_objclass() @anchor{fl_get_object_objclass()} @findex fl_get_object_type() @anchor{fl_get_object_type()} @example int fl_get_object_objclass(FL_OBJECT *obj); int fl_get_object_type(FL_OBJECT *obj); @end example @noindent Receiving a negative value indicates that a @code{NULL} pointer was passed to the functions. To set the two colors that influence the appearance of the object use @findex fl_set_object_color() @anchor{fl_set_object_color()} @example void fl_set_object_color(FL_OBJECT *obj, FL_COLOR col1, FL_COLOR col2); @end example @noindent and to find out about the colors of an object use @findex fl_get_object_color() @anchor{fl_get_object_color()} @example void fl_get_object_color(FL_OBJECT *obj, FL_COLOR *col1, FL_COLOR *col2); @end example @findex fl_set_object_boxtype() @anchor{fl_set_object_boxtype()} @example void fl_set_object_boxtype(FL_OBJECT *obj, int boxtype); @end example @noindent Changes the shape of the box of the object. Please note that not all possible boxtypes are suitable for all types of objects, see the documentation for the different objects for limitations. To find out the current boxtype of an object use @findex fl_get_object_boxtype() @anchor{fl_get_object_boxtype()} @example int fl_get_object_boxtype(FL_OBJECT *obj); @end example @noindent Receiving a negative value indicates that a @code{NULL} pointer was passed to the function. There are also functions to change or query the border width of an object: @findex fl_set_object_bw() @anchor{fl_set_object_bw()} @findex fl_get_object_bw() @anchor{fl_get_object_bw()} @example void fl_set_object_bw(FL_OBJECT *obj, int bw); void fl_get_object_bw(FL_OBJECT *obj, int *bw); @end example @noindent If the requested border width is 0, -1 is used. To change or inquire the objects position (relative to the form it belongs to) the functions @findex fl_set_object_position() @anchor{fl_set_object_position()} @findex fl_get_object_position() @anchor{fl_get_object_position()} @example void fl_set_object_position(FL_OBJECT *obj, FL_Coord x, FL_Coord y); void fl_get_object_position(FL_OBJECT *obj, FL_Coord *x, FL_Coord *y); @end example @noindent exist. If the object is visible it's redrawn at the new position. An object can also be moved relative to its current position using the function @findex fl_move_object() @anchor{fl_move_object()} @example void fl_move_object(FL_OBJECT *obj, FL_Coord dx, FL_Coord dy); @end example @noindent where @code{dx} and @code{dy} are the amounts by which the object is moved to the right and down. To change or inquire about the size of an object use @findex fl_set_object_size() @anchor{fl_set_object_size()} @findex fl_get_object_size() @anchor{fl_get_object_size()} @example void fl_set_object_size(FL_OBJECT *obj, FL_Coord w, FL_Coord h); void fl_get_object_size(FL_OBJECT *obj, FL_Coord *w, FL_Coord *h); @end example @noindent When changing the size of the object the position of its upper left hand corner remains unchanged. To set or query both the position and the size of an object the functions @findex fl_set_object_geometry() @anchor{fl_set_object_geometry()} @findex fl_get_object_geometry() @anchor{fl_get_object_geometry()} @example void fl_set_object_geometry(FL_OBJECT *obj, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h); void fl_get_object_geometry(FL_OBJECT *obj, FL_Coord *x, FL_Coord *y, FL_Coord (*w, FL_Coord *h); @end example @noindent can be used. Please note: always use one of the above functions to change the position and/or size of an object and don't try to change the information stored in the object directly. There's some double bookkeeping going on under the hood that makes sure that the objects position and size won't change due to rounding errors when the whole form gets resized and changing the internal information kept in the objects structure would interfere with this. There's a second function for calculation an objects geometry: @findex fl_get_object_bbox() @anchor{fl_get_object_bbox()} @example void fl_get_object_bbox(FL_OBJECT *obj, FL_Coord *x, FL_Coord *y, FL_Coord *w, FL_Coord *h); @end example @noindent The difference between this functions and @code{@ref{fl_get_object_geometry()}} is that @code{@ref{fl_get_object_bbox()}} returns the bounding box size that has the label, which could be drawn outside of the object figured in. Some objects in the library are composite objects that consist of other objects. For example, the scrollbar object is made of a slider and two scroll buttons. To get a handle to one of the components of the composite object, the following routine is available: @findex fl_get_object_component() @anchor{fl_get_object_component()} @example FL_OBJECT *fl_get_object_component(FL_OBJECT *obj, int objclass, int type, int number); @end example @noindent where @code{obj} is the composite object, @code{objclass} and @code{type} are the component object's class ID and type; and @code{number} is the sequence number of the desired object in case the composite has more than one object of the same class and type. You can use a constant -1 for @code{type} to indicate any type of class @code{objclass}. The function returns the object handle if the requested object is found, otherwise @code{NULL}. For example to obtain the object handle to the horizontal scrollbar in a browser, code similiar to the following can be used @example hscrollbar = fl_get_object_component(browser, FL_SCROLLBAR, FL_HOR_THIN_SCROLLBAR, 0) @end example To influence change the color, font size, font style, alignment and text of the label of an object use @findex fl_set_object_lcolor() @anchor{fl_set_object_lcolor()} @findex fl_set_object_lsize() @anchor{fl_set_object_lsize()} @findex fl_set_object_lstyle() @anchor{fl_set_object_lstyle()} @findex fl_set_object_lalign() @anchor{fl_set_object_lalign()} @findex fl_set_object_label() @anchor{fl_set_object_label()} @findex fl_set_object_label_f() @anchor{fl_set_object_label_f()} @example void fl_set_object_lcolor(FL_OBJECT *obj, FL_COLOR lcol); void fl_set_object_lsize(FL_OBJECT *obj, int lsize); void fl_set_object_lstyle(FL_OBJECT *obj, int lstyle); void fl_set_object_lalign(FL_OBJECT *obj, int align); void fl_set_object_label(FL_OBJECT *obj, const char *label); void fl_set_object_label(FL_OBJECT *obj, const char *fmt, ...); @end example To find out about the object labels color, font size, style, alignment and the string itself use @findex fl_get_object_lcolor() @anchor{fl_get_object_lcolor()} @findex fl_get_object_lsize() @anchor{fl_get_object_lsize()} @findex fl_get_object_lstyle() @anchor{fl_get_object_lstyle()} @findex fl_get_object_lalign() @anchor{fl_get_object_lalign()} @findex fl_get_object_label() @anchor{fl_get_object_label()} @example FL_COLOR fl_get_object_lcolor(FL_OBJECT *obj); int fl_get_object_lsize(FL_OBJECT *obj); int fl_get_object_lstyle(FL_OBJECT *obj); int fl_get_object_lalign(FL_OBJECT *obj); const char * fl_get_object_label(FL_OBJECT *obj); @end example To set a tool-tip text for an object use the following routines @findex fl_set_object_helper() @anchor{fl_set_object_helper()} @findex fl_set_object_helper_f() @anchor{fl_set_object_helper_f()} @example void fl_set_object_helper(FL_OBJECT *obj, const char *helpmsg); void fl_set_object_helper_f(FL_OBJECT *obj, const char *fmt, ...); @end example @noindent where @code{helpmsg} is a text string (with possible embedded newlines in it) that will be shown when the mouse hovers over the object for nore than about @w{600 msec}. A copy of the string is made internally. The second functions accepts instead of a simple string a format string just as it's used for @code{printf()} etc., followed by as many further arguments as the format string contains format specifiers. The boxtype, color and font for the tool-tip message displayed can be customized further using the following routines: @findex fl_set_tooltip_boxtype() @anchor{fl_set_tooltip_boxtype()} @findex fl_set_tooltip_color() @anchor{fl_set_tooltip_color()} @findex fl_set_tooltip_font() @anchor{fl_set_tooltip_font()} @example void fl_set_tooltip_boxtype(int boxtype); void fl_set_tooltip_color(FL_COLOR textcolor, FL_COLOR background); void fl_set_tooltip_font(int style, int size); @end example @noindent where @code{boxtype} is the backface of the form that displays the text. The default is @code{@ref{FL_BORDER_BOX}}. @code{textcolor} and @code{background} specify the color of the text and the color of the backface. The defaults for these are @code{FL_BLACK} and @code{FL_YELLOW}. @code{style} and @code{size} are the font style and size of the text. There are four function for controlling how an object reacts to resizing the form it belongs to or to find out what its current settings are: @findex fl_set_object_resize() @anchor{fl_set_object_resize()} @findex fl_get_object_resize() @anchor{fl_get_object_resize()} @findex fl_set_object_gravity() @anchor{fl_set_object_gravity()} @findex fl_get_object_gravity() @anchor{fl_get_object_gravity()} @example void fl_set_object_resize(FL_OBJECT *obj, unsigned int howresize); void fl_get_object_resize(FL_OBJECT *obj, unsigned int *howresize); void fl_set_object_gravity(FL_OBJECT *obj, unsigned int NWgravity, unsigned int SEgravity); void fl_get_object_gravity(FL_OBJECT *obj, unsigned int *NWgravity, unsigned int *SEgravity); @end example @noindent @xref{Part I Doing Interaction, , Doing Interaction}, for more details on the resizing behaviour of objects. If you change many attributes of a single object or many objects in a visible form the changed object is redrawn after each change. To avoid this put the changes between calls of the two functions @findex fl_freeze_form() @anchor{fl_freeze_form()} @findex fl_unfreeze_form() @anchor{fl_unfreeze_form()} @example void fl_freeze_form(FL_FORM *form); void fl_unfreeze_form(FL_FORM *form); @end example @noindent The form is automatically redrawn once it is "unfrozen", so a call of @code{@ref{fl_redraw_form()}} isn't required (and, while the form is "frozen", calling this function as well as @code{@ref{fl_redraw_object()}} has no effects). You may also freeze and unfreeze all forms at once by using @findex fl_freeze_all_forms() @anchor{fl_freeze_all_forms()} @findex fl_unfreeze_all_forms() @anchor{fl_unfreeze_all_forms()} @example void fl_freeze_all_forms(void); void fl_unfreeze_all_forms(void); @end example There are also routines that influence the way events are dispatched. These routines are provided mainly to facilitate the development of (unusual) new objects where attributes need to be changed on the fly. These routines should not be used on the built-in ones. To enable or disable an object to receive the @code{@ref{FL_STEP}} event, use the following routine @findex fl_set_object_automatic() @anchor{fl_set_object_automatic()} @example void fl_set_object_automatic(FL_OBJECT *obj, int yes_no); @end example To determine if an object receives @code{@ref{FL_STEP}} events use @findex fl_object_is_automatic() @anchor{fl_object_is_automatic()} @example int fl_object_is_automatic(FL_OBJECT *obj); @end example To enable or disable an object to receive the @code{@ref{FL_DBLCLICK}} event use the following routine @findex fl_set_object_dblclick() @anchor{fl_set_object_dblclick()} @example void fl_set_object_dblclick(FL_OBJECT *obj, unsigned long timeout); @end example @noindent where @code{timeout} specifies the maximum time interval (in msec) between two clicks for them to be considered a double-click (using 0 disables double-click detection). To determine the current setting of the timeout use @findex fl_get_object_dblclick() @anchor{fl_get_object_dblclick()} @example unsigned fl_get_object_dblclick(FL_OBJECT *obj); @end example To make an object or a group invisible or visible use the following two functions @findex fl_hide_object() @anchor{fl_hide_object()} @findex fl_show_object() @anchor{fl_show_object()} @example void fl_hide_object(FL_OBJECT *obj); void fl_show_object(FL_OBJECT *obj); @end example @noindent @code{obj} can be the pseudo-object returned by @code{@ref{fl_bgn_group()}} and then allows to hide or show whole groups of objects. To determine if an object is visible (given that the form it belongs to is also visible) use @findex fl_object_is_visible() @anchor{fl_object_is_visible()} @example int fl_object_is_visible(FL_OBJECT *obj); @end example @findex fl_trigger_object() @anchor{fl_trigger_object()} @example void fl_trigger_object(FL_OBJECT *obj); @end example @noindent returns @code{obj} to the application program after calling its callback if one exists. @findex fl_set_focus_object() @anchor{fl_set_focus_object()} @example void fl_set_focus_object(FL_FORM *form, FL_OBJECT *obj); @end example @noindent sets the input focus in form @code{form} to object @code{obj}. Note however, if this routine is used as a response to an @code{@ref{FL_UNFOCUS}} event, i.e., as an attempt to override the focus assignment by the main loop from within an objects event handler, this routine will not work as the main loop assigns a new focus object upon return from the object event handler, which undoes the focus change inside the event handler. To override the @code{@ref{FL_UNFOCUS}} event the following routine should be used: @findex fl_reset_focus_object() @anchor{fl_reset_focus_object()} @example void fl_reset_focus_object(FL_OBJECT *obj); @end example Use the following routine to obtain the object that has the focus on a form @findex fl_get_focus_object() @anchor{fl_get_focus_object()} @example FL_OBJECT *fl_get_focus_object(FL_FORM *form); @end example The routine @findex fl_set_object_callback() @anchor{fl_set_object_callback()} @example void fl_set_object_callback(FL_OBJECT *obj, void (*callback)(FL_OBJECT *, long), long argument); @end example @noindent binds a callback routine to an object. To invoke the callback manually (as opposed to invocation by the main loop), use the following function @findex fl_call_object_callback() @anchor{fl_call_object_callback()} @example void fl_call_object_callback(FL_OBJECT *obj); @end example @noindent If the object @code{obj} does not have a callback associated with it, this call has not effect. @findex fl_set_form_callback() @anchor{fl_set_form_callback()} @example void fl_set_form_callback(FL_FORM *form, void (*callback)(FL_OBJECT *, void *), void *data); @end example @noindent binds a callback routine to an entire form. It is sometimes useful to obtain the last X event from within a callback function, e.g., to implement different functionalities depending on which button triggers the callback. For this, the following routine can be used from within a callback function. @findex fl_last_event() @anchor{fl_last_event()} @example const XEvent *fl_last_event(void); @end example @noindent In other rare circumstances one might not be interested not in the X event but instead the internal XForms event resulting in the invocation of an object or form callback. This information can be obtained by calling @findex fl_current_event() @anchor{fl_current_event()} @example int fl_current_event(void); @end example @noindent A callback invocation resulting from a call of @code{@ref{fl_call_object_callback()}} will return @tindex FL_TRIGGER @anchor{FL_TRIGGER} @code{FL_TRIGGER}. For other possible return value see @ref{Part IV Events, , the chapter about XForms internal events}. Calling this function is only useful while within an object or form callback, at all other times it returns just @tindex FL_NOEVENT @anchor{FL_NOEVENT} @code{FL_NOEVENT}. Also in objects callback it might be of interest to find out if the mouse is on top of a certain letter of the (inside) label (one trivial use of this can be found in the program @file{demo/strange_button.c}. To find out about this use @findex fl_get_label_char_at_mouse() @anchor{fl_get_label_char_at_mouse)} @example int fl_get_label_char_at_mouse(FL_OBJECT *obj); @end example @noindent The function returns the index of the character in the label of the object the mouse is on or @code{-1} if it's not over the label. Note that this function has some limitations: it can only be used on labels inside of the object and the label string may not contain underline characters (and the label can't be a symbol) - if you try to use it on labels that don't satisfy these requirements @code{-1} is returned. Sometimes, it may be desirable to obtain hardcopies of some objects in a what-you-see-is-what-you-get (WYSISYG) way, especially those that are dynamic and of vector-graphics in nature. To this end, the following routine exists: @findex fl_object_ps_dump() @anchor{fl_object_ps_dump()} @example int fl_object_ps_dump(FL_OBJECT *obj, const char *fname); @end example @noindent The function will output the specified object in PostScript. If @code{fname} is @code{NULL}, a file selector will be shown to ask the user for a file name. The function returns a negative number if no output is generated due to errors. At the moment, only the @code{FL_XYPLOT} object is supported. Nothe that this function isn't part of the statndard XForms library (@code{libforms}) but the XForms image library (@code{libflimage} discussed in @ref{Part VI Images}. The object must be visible at the time of the function call. The hardcopy should mostly be WYSIWYG and centered on the printed page. The orientation is determined such that a balanced margin results, i.e., if the width of the object is larger than the height, landscape mode will be used. Further, if the object is too big to fit on the printed page, a scale factor will be applied so the object fits. The box underneath the object is by default not drawn and in the default black&white mode, all curves are drawn in black. See demo program @file{xyplotover.c} for an example output. It is possible to customize the output by changing the PostScript output control parameters via the function @findex flps_init() @anchor{flps_init()} @tindex FLPS_CONTROL @example FLPS_CONTROL *flps_init(void); @end example @noindent A typical use is to call this routine to obtain a handle to the PostScript output control structure and change the control structure members to suit your needs before calling @code{@ref{fl_object_ps_dump()}}. You should not free the returned buffer. The control structure has the following members @table @code @item int ps_color The choices are full color (@code{FLPS_COLOR}), grayscale (@code{FLPS_GRAYSCALE}) and black&white (@code{FLPS_BW}). The default for xyplot is black and white. In this mode, all drawings are black, on a white background. If @code{drawbox} (see below) is true, the drawing color can be either white or black depending on the specified color. @item int orientation Valid choices are @code{FLPS_AUTO}, @code{FLPS_PORTRAIT} and @code{FLPS_LANDSCAPE}. The default is @code{FLPS_AUTO}. @item auto_fit By default, this is true so the object always fits the printed page. Set it to false (0) to turn off auto-scaling. @item int eps Set this to 1 if output in EPS format is required. @item int drawbox Set this to 1 if the box of the object is to be drawn. @item float xdpi, ydpi These two are the screen resolution. The default is to use the actual resolution of the display. Note by setting a dpi number smaller or larger than the actual resolution, the output object is in effect being enlarged or shrunken. @item float paper_w The paper width in inches. The default is @w{8.5 in}. @item float paper_h The paper height in inches. The default is @w{11 in}. @end table To generate a PostScript output of a form or forms, use the @code{fd2ps} program documented in @ref{Part II Generating Hardcopies}. @node Doing Interaction @section Doing Interaction To display the form @code{form} on the screen use one of @findex fl_show_form() @anchor{fl_show_form()} @findex fl_show_form_f() @anchor{fl_show_form_f()} @example Window fl_show_form(FL_FORM *form, int place, int border, const char *title); Window fl_show_form(FL_FORM *form, int place, int border, const char *fmt, ...); @end example @noindent @code{place} controls the position and size of the form. @code{border} indicates whether a border (window manager's decoration) should be drawn around the form. If a border is to be drawn @code{title} is the name of the window (and its associated icon). The routine returns the window identifier of the form. For resource and identification purposes, the form name is taken to be the title with spaces removed and the first character lower-cased. E.g., if a form has a title @w{@code{"Foo Bar}} the forms name is derived as @code{"fooBar"}. The only difference between the two functions is that the first one accepts a simple string for the title while the second expects a format string like @code{printf()}, followed by the appropriate number of arguments. For the the location and size of the window controlled by @code{place} the following possibilities exist: @table @code @tindex FL_PLACE_SIZE @item FL_PLACE_SIZE The user can control the position but the size is fixed. Interactive resizing is not allowed once the form becomes visible. @tindex FL_PLACE_POSITION @item FL_PLACE_POSITION Initial position used will be the one set via @code{@ref{fl_set_form_position()}}. Interactive resizing is allowed. @tindex FL_PLACE GEOMETRY @item FL_PLACE GEOMETRY Place at the latest position and size (see also below) or the geometry set via @code{@ref{fl_set_form_geometry()}} etc. A form so shown will have a fixed size and interactive resizing is not allowed. @tindex FL_PLACE_ASPECT @item FL_PLACE_ASPECT Allows interactive resizing but any new size will have the aspect ratio as that of the initial size. @tindex FL_PLACE_MOUSE @item FL_PLACE_MOUSE The form is placed centered below the mouse. Interactive resizing will not be allowed unless this option is accompanied by @code{@ref{FL_FREE_SIZE}} as in @code{@ref{FL_PLACE_MOUSE}|@ref{FL_FREE_SIZE}}. @tindex FL_PLACE_CENTER @item FL_PLACE_CENTER The form is placed in the center of the screen. If @code{@ref{FL_FREE_SIZE}} is also specified, interactive resizing will be allowed. @tindex FL_PLACE_FULLSCREEN @item FL_PLACE_FULLSCREEN The form is scaled to cover the full screen. If @code{@ref{FL_FREE_SIZE}} is also specified, interative resizing will be allowed. @tindex FL_PLACE_FREE @item FL_PLACE_FREE Both the position and size are completely free. The initial size used is the designed size. Initial position, if set via @code{@ref{fl_set_form_position()}}, will be used, otherwise interactive positioning may be possible if the window manager allows it. @tindex FL_PLACE_HOTSPOT @item FL_PLACE_HOTSPOT The form is so placed that mouse is on the "hotspot". If @code{@ref{FL_FREE_SIZE}} is also specified, interactive resizing will be allowed. @tindex FL_PLACE_CENTERFREE @item FL_PLACE_CENTERFREE Same as @code{@ref{FL_PLACE_CENTER}|@ref{FL_FREE_SIZE}}, i.e., place the form at the center of the screen and allow resizing. @tindex FL_PLACE ICONIC @item FL_PLACE ICONIC The form is shown initially iconified. The size and location used are the window manager's default. @end table If no size is specified, the designed (or later scaled) size will be used. Note that the initial position is dependent upon the window manager used. Some window managers will allow interactive placement of the windows and some will not. There are three values that can be passed for @code{border}: @table @code @tindex FL_FULLBORDER @item FL_FULLBORDER Draw full border with title @tindex FL_TRANSIENT @item FL_TRANSIENT Draw borders with possibly less decoration (depends on the window managers behaviour) @tindex FL_NOBORDER @item FL_NOBORDER Draw no border at all @end table Since multiple forms can be displayed at the same time note that using @code{FL_NOBORDER} might have adverse effect on keyboard focus and is not very friendly to other applications (it is close to impossible to move a form that has no border). Thus use this feature with discretion. The only situation where @code{FL_NOBORDER} is appropriate is for automated demonstration suites or when the application program must obtain an input or a mouse click from the user, and even then all other forms should be deactivated while a borderless form is active. For almost all situations where the application must demand an action from the user @code{FL_TRANSIENT} is preferable. Also note that you can't iconify a form that has no borders and under most window managers forms displayed with @code{FL_TRANSIENT} can't be iconified either. One additional property (under almost all window managers) of a transient window is that it will stay on top of the main form, which the application program can designate using @findex fl_set_app_mainform() @anchor{fl_set_app_mainform()} @example void fl_set_app_mainform(FL_FORM *form); @end example @noindent By default, the main form is set automatically by the library to the first full-bordered form shown. To obtain the current main form, use the following routine @findex fl_get_app_mainform() @anchor{fl_get_app_mainform()} @example FL_FORM *fl_get_app_mainform(void); @end example In some situations, either because the concept of an application main form does not apply (for example, an application might have multiple full-bordered windows), or under some (buggy) window managers, the designation of a main form may cause stacking order problems. To workaround these, the following routine can be used to disable the designation of a main form (must be called before any full-bordered form is shown): @findex fl_set_app_nomainform() @anchor{fl_set_app_nomainform()} @example void fl_set_app_nomainform(int yes_no); @end example @noindent with a true flag. All visible forms will have the properties @code{WM_CLASS}, @code{WM_CLIENT_MACHINE} and @code{WM_NAME} set. In addition, the first full-bordered form will have the @code{WM_COMMAND} property set and is by default the applications main form. Sometimes it is necessary to have access to the window resource ID before the window is mapped (shown). For this, the following routines can be used @findex fl_prepare_form_window() @anchor{fl_prepare_form_window()} @findex fl_prepare_form_window_f() @anchor{fl_prepare_form_window_f()} @example Window fl_prepare_form_window(FL_FORM *form, int place, int border, const char *name); Window fl_prepare_form_window_f(FL_FORM *form, int place, int border, const char *fmt, ...); @end example @noindent These routines create a window that obeys any and all constraints just as @code{@ref{fl_show_form()}} does but remains unmapped. The only difference between the two functions is that the first one takes a simple string for the forms name while the second expects a format string like @code{printf()}, followed by the appropriate number of further arguments. To map such a window, the following must be used @findex fl_show_form_window() @anchor{fl_show_form_window()} @example Window fl_show_form_window(FL_FORM *form); @end example @noindent Between these two calls, the application program has full access to the window and can set all attributes, such as icon pixmaps etc., that are not set by @code{@ref{fl_show_form()}}. The application program can raise a form to the top of the screen so no other forms obscures it by calling @findex fl_raise_form() @anchor{fl_raise_form()} @example void fl_raise_form(FL_FORM *form); @end example To instead lower a form to the bottom of the stack use @findex fl_lower_form() @anchor{fl_lower_form()} @example void fl_lower_form(FL_FORM *form); @end example When placing a form on the screen using @code{FL_PLACE_GEOMETRY} for the @code{place} argument to @code{@ref{fl_show_form()}} the position and size can be set before by using the routines @findex fl_set_form_position() @anchor{fl_set_form_position()} @findex fl_set_form_size() @anchor{fl_set_form_size()} @findex fl_set_form_geometry() @anchor{fl_set_form_geometry()} @findex fl_scale_form() @anchor{fl_scale_form()} @example void fl_set_form_position(FL_FORM *form, FL_Coord x, FL_Coord y); void fl_set_form_size(FL_FORM *form, FL_Coord w, FL_Coord h); void fl_set_form_geometry(FL_FORM form*, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h); void fl_scale_form(FL_FORM *form, double xsc, double ysc); @end example @noindent where @code{@ref{fl_set_form_geometry()}} combines the functionality of @code{@ref{fl_set_form_position()}} and @code{@ref{fl_set_form_size()}} and the last routine, @code{@ref{fl_scale_form()}}, scales the form in horizontal and vertical direction by the factors passed to the function. These routines can also be used when the form is visible. Sometimes it is desirable to know how large the decoration are the window manager puts around a forms window. They can be obtained by a call of @findex fl_get_decoration_sizes() @anchor{fl_get_decoration_sizes()} @example void fl_get_decoration_sizes(FL_FORM *form, int *top, int *right, int *bottom, int *left); @end example @noindent This is especially useful if it is necessary to open a window at some previously stored position since in that case one needs the position of of the window, which deviates from the position reported for the form by the window manager's decorations. Obviously, the above function can't be used for forms that are embedded into another form. The function @findex fl_form_is_iconified() @anchor{fl_form_is_iconified()} @example int fl_form_is_iconified(FL_FORM *form); @end example @noindent allows to test if the (visible) window of a form is in iconified state. If interactive resizing is allowed (e.g., by showing the form with @code{@ref{FL_PLACE_POSITION}}) it can be useful to limit the range of the size of a form can take. To this end, the following functions are available @findex fl_set_form_minsize() @anchor{fl_set_form_minsize()} @findex fl_set_form_maxsize() @anchor{fl_set_form_maxsize()} @example void fl_set_form_minsize(FL_FORM *form, FL_Coord minw, FL_Coord minh); void fl_set_form_maxsize(FL_FORM *form, FL_Coord maxw, FL_Coord maxh); @end example Although these two routines can be used before or after a form becomes visible, not all window managers honor such requests once the window is visible. Also note that the constraints only apply to the next call of @code{@ref{fl_show_form()}} for the form. To set or change the icon shown when a form is iconified use the following routine @findex fl_set_form_icon() @anchor{fl_set_form_icon()} @example void fl_set_form_icon(FL_FORM *form, Pixmap icon, Pixmap mask); @end example @noindent where @code{icon} can be any valid pixmap ID. (@pxref{Pixmap Object} for some of the routines that can be used to create pixmaps.) Note that a previously set icon if not freed or modified in anyway. If, for any reason, you would like to change the form title after the form has been made visible, the following calls can be used (they will also change the icon title) @findex fl_set_form_title() @anchor{fl_set_form_title()} @findex fl_set_form_title_f() @anchor{fl_set_form_title_f()} @example void fl_set_form_title(FL_FORM *form, const char *name); void fl_set_form_title_f(FL_FORM *form, const char *fmt, ...); @end example @noindent (While the first function expects a simple string, the second has to be called with a format string as @code{printf()} etc., followed by the corresponding number of arguments.) The routine @findex fl_hide_form() @anchor{fl_hide_form()} @example void fl_hide_form(FL_FORM *form); @end example @noindent hides the particular form, i.e., closes its window and all subwindows. To check if a form is visible or not, the following function can be used @findex fl_form_is_visible() @anchor{fl_form_is_visible()} @example int fl_form_is_visible(FL_FORM *form)' @end example @noindent The function can return that the form is visible (@code{@ref{FL_VISIBLE}}), is invisible (@code{@ref{FL_INVISIBLE}}) or is in the processing of becoming invisible (@code{@ref{FL_BEING_HIDDEN}}). The most important function for doing the actual interaction with forms is @anchor{fl_do_forms()} @findex fl_do_forms() @example FL_OBJECT *fl_do_forms(void); @end example @noindent It starts the main loop of the program and returns only when either the state of an object changes that has no callback bound to it or @code{@ref{fl_finish()}} is called in a callback. In the first case the address of the object is returned, in the latter @code{NULL}. A second way of doing interaction with the currently displayed forms is using @anchor{fl_check_forms()} @findex fl_check_forms() @example FL_OBJECT *fl_check_forms(void); @end example @noindent This routine returns @code{NULL} immediately unless the state of one of the object (without a callback bound to it) changed. In that case a pointer to this object gets returned. @code{NULL} also gets returned after a call of @code{@ref{fl_finish()}}. Then there are two more functions: @anchor{fl_do_only_forms()} @findex fl_do_only_forms() @anchor{fl_check_only_forms()} @findex fl_check_only_forms() @example FL_OBJECT *fl_do_only_forms(void); FL_OBJECT *fl_check_only_forms(void); @end example @noindent Both functions do the same as @code{@ref{fl_do_forms()}} and @code{@ref{fl_check_forms()}} except that they do not handle user events generated by application windows opened via @code{@ref{fl_winopen()}} or similar routines. To activate or deactivate a form for user interaction you can use @findex fl_activate_form() @anchor{fl_activate_form()} @findex fl_deactivate_form() @anchor{fl_deactivate_form()} @example void fl_activate_form(FL_FORM *form); void fl_deactivate_form(FL_FORM *form); @end example The same can also be done for all forms at once using @findex fl_deactivate_all_forms() @anchor{fl_deactivate_all_forms()} @findex fl_activate_all_forms() @anchor{fl_activate_all_forms()} @example void fl_deactivate_all_forms(void) void fl_activate_all_forms(void) @end example To find out if a form is currently active call @findex fl_form_is_activated() @anchor{fl_form_is_activated()} @example int fl_form_is_activated(FL_FORM *form); @end example A return value of 0 tells you that the form is currently deactivated. You can also register callbacks for a form that are invoked whenever the activation status of the form is changed: @tindex FL_FORM_ATACTIVATE @tindex FL_FORM_ATDEACTIVATE @findex fl_set_form_atactivate() @anchor{fl_set_form_atactivate()} @findex fl_set_form_atdeactivate() @anchor{fl_set_form_atdeactivate()} @example typedef void (*FL_FORM_ATACTIVATE)(FL_FORM *, void *); FL_FORM_ACTIVATE fl_set_form_atactivate(FL_FORM *form, FL_FORM_ATACTIVATE callback, void *data); typedef void (*FL_FORM_ATDEACTIVATE)(FL_FORM *, void *); FL_FORM_ACTIVATE fl_set_form_atdeactivate(FL_FORM *form, FL_FORM_ATACTIVATE callback, void *data); @end example Also individual objects (or groups of objects if the argument of the function is an object returned by @code{@ref{fl_bgn_group()}}) can be activated and deactivated to enable or disable user interaction: @findex fl_activate_object() @anchor{fl_activate_object()} @findex fl_deactivate_object() @anchor{fl_deactivate_object()} @example void fl_activate_object(FL_OBJECT *obj); void fl_deactivate_object(FL_OBJECT *obj); @end example @noindent It is normally useful to give the user a visual clue when an object gets deactivated, e.g., by graying out its label etc. To find out if an object is active use @findex fl_object_is_active() @anchor{fl_object_is_active()} @example int fl_object_is_active(FL_OBJECT *obj); @end example @findex fl_redraw_object() @anchor{fl_redraw_object()} @example void fl_redraw_object(FL_OBJECT *obj); @end example @noindent This routine redraws the particular object. If @code{obj} is a group it redraws the complete group. Normally you should never need this routine because all library routines take care of redrawing objects when necessary, but there might be situations in which an explicit redraw is required. To redraw an entire form use @findex fl_redraw_form() @anchor{fl_redraw_form()} @example void fl_redraw_form(FL_FORM *form); @end example For non-form windows, i.e., those created with @code{@ref{fl_winopen()}} or similar routines by the application program, the following means of interaction are provided (note that these do not work on form windows, for which a different set of functions exist, @pxref{Windowing Support} for details.) You may set up a callback routine (of type @code{FL_APPEVENT_CB} for all user events using @tindex FL_APPEVENT_CB @findex fl_set_event_callback() @anchor{fl_set_event_callback()} @example typedef int (*FL_APPEVENT_CB)(XEvent *, void *); FL_APPEVENT_CB fl_set_event_callback(FL_APPEVENT_CB callback, void *data); @end example @noindent The function returns the previously set callback (or @code{NULL}). It is also possible to set up callback functions on a per window/event basis using the following routines: @tindex FL_APPEVENT_CB @findex fl_add_event_callback() @anchor{fl_add_event_callback()} @findex fl_remove_event_callback() @anchor{fl_remove_event_callback()} @example typedef int (*FL_APPEVENT_CB)(XEvent *xev, void *user_data); FL_APPEVENT_CB fl_add_event_callback(Window win, int xevent_type, FL_APPEVENT_CB callback, void *user_data); void fl_remove_event_callback(Window win, int xevent_type); @end example @noindent These functions manipulate the event callback functions for the window specified, which will be called when an event of type @code{xevent_type} is pending for the window. If @code{xevent_type} is 0 it signifies a callback for all event for window @code{win}. Note that the Forms Library does not solicit any event for the caller, i.e., the Forms Library assumes the caller opens the window and solicits all events before calling these routines. To let the Forms Library handle event solicitation, the following function may be used @findex fl_activate_event_callbacks() @anchor{fl_activate_event_callbacks()} @example void fl_activate_event_callbacks(Window win); @end example @node Signals @section Signals Typically, when a signal is delivered, the application does not know what state the application is in, thus limiting the tasks a signal handler can do. In a GUI system and with a main loop inside the library, it's even harder to know what's safe or unsafe to do in a signal handler. Given all these difficulties, the Forms Library's main loop is made to be aware of signal activities and invoke signal handlers only when it's appropriate to do so, thus removing most limitations on what a signal handler can do. The application program can elect to handle the receipt of a signal by registering a callback function that gets called when a signal is caught @tindex FL_SIGNAL_HANDLER @findex fl_add_signal_callback() @anchor{fl_add_signal_callback()} @example typedef void (*FL_SIGNAL_HANDLER)(int, void *); void fl_add_signal_callback(int signal, FL_SIGNAL_HANDLER sh, void *data); @end example Only one callback per signal is permitted. By default, @code{@ref{fl_add_signal_callback()}} will store the callback function and initiate a mechanism for the OS to deliver the signal when it occurs. When the signal is received by the library, the main loop will invoke the registered callback function when it is appropriate to do so. The callback function can make use of all of XForms's functions as well as Xlib functions as if they were reentrant. Further, a signal callback registered his way is persistent and will cease to function only when explicitly removed. It is very simple to use this routine. For example, to prevent a program from exiting prematurely due to signals, a code fragment similar to the following can be used: @example void clean_up(int signum, void *data) @{ /* clean up, of course */ @} /* call this somewhere after fl_initialize() */ fl_add_signal_callback(SIGINT, clean_up, &mydata); @end example @noindent After this, whenever a @code{SIGINT} signal is received, @code{clean_up()} is called. To remove a signal callback, the following routine should be used @findex fl_remove_signal_callback() @anchor{fl_remove_signal_callback()} @example void fl_remove_signal_callback(int signal); @end example Although very easy to use, there are limitations with the default behavior outlined above. For example on some platforms there is no blocking of signals of any kind while handling a signal. In addition, use of @code{@ref{fl_add_signal_callback()}} prevents the application program from using any, potentially more flexible, system signal handling routines on some platforms. Also there might be perceptible delays from the time a signal is delivered by the OS and the time its callback is invoked by XForms' main loop. This delay can be particular troublesome for timing sensitive tasks (playing music for example). In light of these limitations, provisions are made so an application program may choose to take over the initial signal handling setup and receipt via various system dependent methods (@code{sigaction()} for example). To change the default behavior of the built-in signal facilities, the following routine should be called prior to any use of @code{fl_add_signal_callback(}) with a true value for @code{flag}: @findex fl_app_signal_direct() @anchor{fl_app_signal_direct()} @example void fl_app_signal_direct(int flag); @end example @noindent After this call @code{@ref{fl_add_signal_callback()}} will not initiate any actions to receive a signal. The application program should handle the receipt and blocking of signals (via e.g., @code{signal(2)}, @code{sigaction(2)}, @code{sigprocmask(2}) etc.) When the signal is received by the application program, it should call the following routine to inform the main loop of the delivery of the signal @code{signum}, possibly after performing some timing sensitive tasks: @findex fl_signal_caught() @anchor{fl_signal_caught()} @example void fl_signal_caught(int signum); @end example @noindent This routine is the only one in the library that can be safely called from within a direct application signal handler. If multiple invocations of @code{@ref{fl_signal_caught()}} occur before the main loop is able to call the registered callback, the callback is called only once. The following example illustrates how to handle a timing critical situation (for most application, idle callback, timeouts or @code{FL_TIMER} object should be sufficient). First, you need to define the function that will handle the timing critical tasks. The function will be registered with the OS to be invoked directly by it. There are limitations on what you can do within a (OS) signal handler, in particular, GUI activity is not safe. @example void timing_critical_task(int sig) @{ /* handle timing critical tasks that does not involve GUI */ ... /* Now tell the library the signal has been delivered by the OS. * The library will invoke the xforms signal handler when it's * appropriate to do so */ fl_signal_caught(sig); @} @end example @noindent Now define a (XForms) signal handler that will be responsible for handling the response of the GUI upon receipt of the signal @example void gui_signal_handler(int sig, void *data) @{ /* within an XForms signal handler, there is no limitation * on GUI activitity */ fl_set_object_color(....); ... @} @end example To make all this work, a set-up similar to the following can be used @example /* setup the signal */ fl_app_signal_direct(1); setitimer(ITIMER_REAL, interval); /* setup the OS signal handler */ signal(SIGALRM, timing_critical_tasks); /* setup the XForms signal handler */ fl_add_signal_callback(SIGALRM, gui_signal_handler, &myData); @end example @node Idle Callbacks and Timeouts @section Idle Callbacks and Timeouts For application programs that need to perform some light, but semi-continuous or periodic tasks, idle callback and timeouts (also @code{FL_TIMER} objects) can be utilized. To register an idle callback with the system, use the following routine @tindex FL_APPEVENT_CB @findex fl_set_idle_callback() @anchor{fl_set_idle_callback()} @example typedef int (*FL_APPEVENT_CB)(XEvent *, void *); FL_APPEVENT_CB fl_set_idle_callback(FL_APPEVENT_CB callback, void *user_data); @end example @noindent where @code{callback} is the function that will get called whenever the main loop is idle. The time interval between invocations of the idle callback can vary considerably depending on interface activity and other factors. A range between 50 and @w{300 msec} should be expected. While the idle callback is executed it won't be called again (i.e., no call of any XForms function from within the idle callback function will call the idle callback function), so it does not need to be reentrant. It is possible to change what the library considers to be "idle" with the following function: @findex fl_set_idle_delta() @anchor{fl_set_idle_delta()} @example void fl_set_idle_delta(long msec); @end example @noindent Here @code{msec} is the minimum time interval of inactivity after which the main loop is considered to be in an idle state. However it should be noted that under some conditions an idle callback can be called sooner than the minimum interval. If the timing of the idle callback is of concern, timeouts should be used. Timeouts are similar to idle callbacks but with the property that the user can specify a minimum time interval that must elapse before the callback is called. The precision of timeouts tends to be quite a bit better than that of idle callbacks since they internally get prefered treatent. To register a timeout callback, the following routine can be used @tindex FL_TIMEOUT_CALLBACK @findex fl_add_timeout() @anchor{fl_add_timeout()} @example typedef void (*FL_TIMEOUT_CALLBACK)(int, void *); int fl_add_timeout(long msec, FL_TIMEOUT_CALLBACK callback, void *data); @end example @noindent The function returns the timeout ID (note: the function will not return 0 and -1, so the application can use these values to mark invalid or expired timeouts). When the time interval specified by the @code{msec} argument (in milli-second) is elapsed, the timeout is removed and the callback function is called with the timeout ID as the first argument. Although a timeout offers some control over the timing, due to performance and CPU load compromises, while the resolution can be better than @w{10 ms} under favourable conditions, it can also be much worse, occasionally up to @w{150 ms}. To remove a timeout before it triggers, use the following routine @findex fl_remove_timeout() @anchor{fl_remove_timeout()} @example void fl_remove_timeout(int id); @end example @noindent where @code{id} is the timeout ID returned by @code{@ref{fl_add_timeout()}}. @xref{Timer Object}, for the usage of @code{FL_TIMER} object. For tasks that need more accurate timing the use of signal should be considered. @node Global Variables and Macros @section Global Variables and Macros For convenience the library exports a number of global variables. These are: @table @code @vindex FL_EVENT @anchor{FL_EVENT} @item FL_OBJECT *FL_EVENT This is a special object returned by @code{@ref{fl_do_forms()}} etc.@: when an X event is received that isn't coming from a form under the control of the library, e.g., for a window that was opened directly via Xlib functions. Upon receiving this special event the application program can and must remove the pending event from the queue using @code{@ref{fl_XNextEvent()}}. @vindex fl_current_form @anchor{fl_current_form} @item FL_FORM *fl_current_form This variable is always set to the currently active form. @vindex fl_display @anchor{fl_display} @item Display *fl_display This variable is set to the display (X server) the program is connected to and is needed as an argument for many Xlib functions. It's recommended not to use this global variable but instead either the function @code{@ref{fl_get_display()}} or @code{@ref{FL_FormDisplay()}} (the latter accepts a form pointer as its argument and will also be safe in future versions of the library that may support multiple connections). @vindex fl_screen @anchor{ fl_screen} @item int fl_screen This variable is set to the default screen of the display connection. @vindex fl_root @anchor{fl_root} @item Window fl_root This variable is set to the root window. @vindex fl_vroot @anchor{fl_vroot} @item Window fl_vroot Some window managers have problems with obtaining the corrent root window and applications don't work with the normal root windows. In this case @code{fl_vroot} can be used instead. @vindex fl_scrw @anchor{fl_scrw} @vindex fl_scrh @anchor{fl_scrh} @item int fl_scrw, fl_scrh These variables contain the screens width and height. @vindex fl_vmode @anchor{fl_vmode} @item int fl_mode The variable contains the visual mode in use, it should be one of the Xlib constants @code{PseudoColor}, @code{TrueColor}, @code{DirectColor}, @code{StaticColor}, @code{GrayScale or @code{StaticGray}. Alternatively, the functions @code{@ref{fl_get_vclass()}} or @code{fl_get_form_vclass()}} can be used (the latter accepts a form pointer as its argument and is thus also safe for future versions that may allow multiple connections). @vindex fl_state @anchor{fl_state} @item FL_State fl_state[6] This array of structure of type @code{@ref{FL_State}} contains a lot of information about the graphics mode, where each structure has the information for each of the visual modes. Of interest is only the entry for the visual mode in use, @code{@ref{fl_vmode}}. @vindex fl_dpi @findex fl_get_dpi() @anchor{fl_dpi} @anchor{fl_get_dpi()} @item double fl_dpi @item double fl_get_dpi() The @code{fl_dpi} variable contains the screen resolution (in dots per inch), averaged over the resolutions in @code{x}- and @code{y}-direction. The funtion is a convenience macros with the same result. @vindex fl_visual @findex fl_get_visual() @anchor{fl_visual} @anchor{fl_get_visual()} @item Visual *fl_visual @item Visual *fl_get_visual() Convenience macros that expands to the @code{Visual} pointer in use. Same as @code{@ref{fl_state}[@ref{fl_vmode}].xvinfo->visual}. @vindex fl_colormap @findex fl_get_colormap() @anchor{fl_colormap} @anchor{fl_get_colormap()} @item Colormap fl_colormap @item Colormap fl_get_colormap() Convenience macros that expands to the currently used @code{Colormap}. Same as @code{@ref{fl_state}[@ref{fl_vmode}].colormap}. @vindex fl_ul_magic_char @anchor{fl_ul_magic_char} @item char *fl_ul_magic_char This variable points to the character used to indicate underlining in labels and other texts. If it appears as the very first character of a string all characters in that string are underlined, otherwise the character direct in front of it. Per default it's set to @code{'\b'}. @end table xforms-1.2.4/doc/Makefile.am0000644000175000017500000000573012254553253012571 00000000000000include $(top_srcdir)/config/common.am EXTRA_DIST = xforms.css xforms.init # Set up which parts of the documentation are to be build (some may be # impossible to build since the required tools are unavailable) if BUILD_HTML_DOCS html_docs = xforms.html endif if BUILD_PDF_DOCS pdf_docs = xforms.pdf endif info_TEXINFOS = xforms.texi xforms_TEXINFOS = part0_preface.texi \ part1.texi \ part1_defining_forms.texi \ part1_doing_interaction.texi \ part1_free_objects.texi \ part1_getting_started.texi \ part1_goodies.texi \ part1_introduction.texi \ part2.texi \ part2_command_line.texi \ part2_creating_forms.texi \ part2_generating_hardcopies.texi \ part2_getting_started.texi \ part2_introduction.texi \ part2_language_filters.texi \ part2_saving_loading.texi \ part3.texi \ part3_buttons.texi \ part3_choice_objects.texi \ part3_container_objects.texi \ part3_deprecated_objects.texi \ part3_input_objects.texi \ part3_introduction.texi \ part3_other_objects.texi \ part3_popups.texi \ part3_static_objects.texi \ part3_valuator_objects.texi \ part4.texi \ part4_an_example.texi \ part4_drawing_objects.texi \ part4_events.texi \ part4_fl_object.texi \ part4_global_structure.texi \ part4_introduction.texi \ part4_new_buttons.texi \ part4_preemptive_handler.texi \ part5_dirty_tricks.texi \ part5_overview.texi \ part5_resources.texi \ part5.texi \ part5_trouble_shooting.texi \ part5_useful_functions.texi \ part6.texi \ part6_images.texi SUBDIRS = xforms_images all-local: $(html_docs) $(pdf_docs) install-data-local: @$(NORMAL_INSTALL) if [ -e xforms.pdf ]; then \ $(install_sh) -d $(DESTDIR)$(pdfdir); \ $(install_sh) -m 644 xforms.pdf $(DESTDIR)$(pdfdir); \ fi if [ -e xforms.html ]; then \ $(install_sh) -d $(DESTDIR)$(htmldir); \ $(install_sh) -m 644 xforms.html/*.html $(DESTDIR)$(htmldir); \ $(install_sh) -m 644 xforms.html/*.css $(DESTDIR)$(htmldir); \ fi uninstall-local: @$(NORMAL_UNINSTALL) rm -rf $(DESTDIR)$(htmldir)/xforms_images rm -rf $(DESTDIR)$(infodir)/xforms_images # Rule for creating the HTML documentation from the texi files - afterwards # all generated HTML files get copie to their own directory - the lower level # Makefile in 'xforms_images' will also copy the required figures into it .texi.html: $(TEXI2HTML) --init-file xforms.init xforms.texi /bin/mkdir -p xforms.html mv index.html xforms_*.html xforms.html cp -r xforms.css xforms.html cp -r xforms_images xforms.html .texi.pdf: if [ $(TEXI2DVI_NEEDS_PDF) = "yes" ]; then \ $(MAKE) -C xforms_images create_pdf_files; \ fi texi2dvi --pdf --batch xforms.texi .texi.dvi: if [ $(CONVERT) != "no" ]; then \ $(MAKE) -C xforms_images create_eps_files; fi $(TEXI2DVI) --batch xforms.texi clean-local: -rm -rf xforms.5 xforms.info* xforms.html *~ xforms-1.2.4/doc/xforms_images/0000775000175000017500000000000012353624654013461 500000000000000xforms-1.2.4/doc/xforms_images/scrollbars.png0000644000175000017500000001344111665175504016256 00000000000000‰PNG  IHDRD"ÇW†” pHYs  ÒÝ~üÓIDATxÚíÝ=Ž«ÈÂà¹G³oÀÒdK³ ‡vêUtØ„N{¤8ô.Žd¯`$6à5|'àc˜Ÿ*ªž'¹}»=ÝðæðR€ÿ÷ññññññüÙüOY–eYŠ`I§Óét:ý.f›Íf³ÙÜn·Ûí&€¹EQEóõq„¥˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜ögn+\EQ`çóù|>Ë¡5þ{´Æñ­ªªªªu-óñx<r–³œs“]1k”eY–eüËy:N§Óº–™ö¨ÙæÉç½ç–?ã;·ûý~¿ß×R)w»Ýn·»Ýn·Ûm9Ç¿=×u]×õÚs¶=§*Ób¶Ùl6›MÌJ÷LjüËL[<ÿ85‡SÍ?EÆ%~k|ï»a ã‹íyùíùz½^¯WãEl2-f±Ùn·Ûí¶9€v!PbøÇÉáTzš³ûý~¿ßÛWðLs±“ˇä,gä¼.þXSÉä§æ »[Ÿ†~Ÿ<ÙèjöÍ×k¼EÎÈYÎ9SÌضÔ-’ú8·-’¡áœ·œåŒœ×È¥Œ iÏŒ©aÀTÚ4¶ë™ sã&{9Ë9¯³™–d&¶æü· “ä,gä¼fÌ&ff ˆ™´|8ç-g9#ç4˜1›€™1 ffÒræü·œåŒœ×Œٛ̌kd&-%ÎyËYÎÈ9%fÌ03¤ÄLZ>œÿ–³œ‘sü̘ý3c@̤­‹sÞr–3rN³af È™™´T9ÿ-g9#瘙1ûÍÌ@—™´Ø8ç-g9#çT™1û£9ðýýýýý­’<Ó”±Ÿ?þüùSëåü·œåŒœã¤˜ýÞÔš¯«É4ìcàœ·œåŒœÓæRÆßÚõ¬Ñ>éþ möikŸÿ6¾r–3rŽbö_óµ öuqrÎ[ÎrFÎ9p)c/Ç—ô)iïÓÚû:ÉäÀ}#r–3rއ³77Çækg—5²ïZ ç¼å,gäœ3f£˜IÖÂÌÏ8ÿ-g9#ç˜1›xm¾v6ˆ}Ñz9ç-g9#çܘ1›…™4 3c¼Çùo9Ë9‡eÆl¡M¶ùÚÙk`ö-)qÎ[ÎrFÎyRÌõ¬¤ô×Ý{(cih­âÙÆRÝ®ä,g9Ë9NŠY0Ý’v>ŸÏç³dòÑœÙêŽûÐ¯¯¯¯¯î>„ôÆ7¬´·.9ËYÎrŽ“b›rªÌ‹2-û ㋜匜S•u1[ãA³ýµØï÷ûýÞ–ƒÄøb{úÈ´˜ÅvМê2ûý~¿ßå°FÞûÆâW–eY–Çãñx|~~~~~ʆʮ˜¹?`ZßßßßßßëZf÷˜@0Í2‹À’3² h3—2¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜ögn+\UUUU`Çãñx<ʆʮ˜Ýï÷ûý~>ŸÏç³á˜Ên·Ûív·Ûív»I†Ê®˜ÁÜŠ¢(Š"¶¥r2 fŠY¶Ûív»=N§ÓÉtʲ,Ë2†%i¶+#’†fVj¿ßï÷{û H‰bXSÉäžÍf³ÙlÂ^ÖçÜÓŽ¯ziðTƶ-u‹drÓÌ~tëÓÐï“›sKÑ"X/3f iÏŒ©aÀTÚ3fízf& ÖE1›‘2,II€õRÌ&¦Œ1PÒ`]³ (c@Ì”4ˆŸbö&e X#% ⤘  Œ)QÒ ŠÙPÆ€(i–bö/”1 gJ,O1ûMèRÒ`ŠÙUUUUÕ|}<Ç£Lºš2ÖÞgSù!‚v«Z$аo€¹™1û­;Wf& È™} ,I1{ª;“Öý>@Jìë Ŭ% H•}Ä@1LIÖξ b£˜¢¤ka1SÌ&£¤±±/€µPÌf¡¤¡ØçÀ)f³SÒ€¹Ù·ÀÚ)f‹zVÒÈÓív»Ýnçóù|>ù>¹éî=”1X;Å,˜nIsÀõ›i}}}}}}5_+cÅ, °Ò³ßï÷û½˜–}¤J1ƒ‰™ù`¨ìŠYY–eYx Ù³º®ëº6ðÓ²w€1~ˆ ,Å 0Å 0Oe\±Ãáp8.—ËårÿÊæ5íï }ý3}–pü_éþÅñùt¿ß^ž>ùŒY÷1£óÞ;혾·ÌCs:ÊS­W ï %ŠYÖ^׌>%¤Ïá阊òºB„:¨Zü–1?3¦ã·¨eÆî½mµ½ü}Fîw—2òféó›YftæÙP7TÎó­…wЦ˜eªÿyúöìÜbK¦Ïå—ýÿ[[@(.edF.Ó£[`bH2Õ1íscû§ã/gõî ±ßï÷û½–QEQq.Ûù|>ŸÏkOøñx<ív»ÝnÇüž_¿~ýúõËk{Îb¶zag^ÿõxŠÄ|¿îûÍÞ{ôHÚc:ÇÚͱ^i'ɴʲ,Ë2Îe;N§ÓIÚîc³Ùl6›Ûív»Ý¼¯mÏ ¥˜­ÞTÏ£›ã¯Ç0'6ŸùÖe¾’ÿ˜Î±výŸÌÙýmÏ^“v’L+ÎÃÙ˜Ïǧ‘vª c{æ=î1cFùÜM´üšÆðDÊ|Fðð’$€ñ³Lõ?(t^?”ñŸá6ÇïÏs‹º¼d[ÆSÌøãõ,|ú›cdÌè„Ù5nQÝeóœI`Iî1ËÚ³{–º?e]£jd§ú»C›ÑÿõÈÄI1[±i?wè!éòÈ;ßõÿ@äå?lüïœc¤æË!žípÌëþ;X»Ýn·ÛíÂ.C>OÕ •¶ç]ŠD$†O6Ëç3ˆB¥íSž€.ÅŒE ½'ù„<×xCvi§¡ªªªªâYžãñx< 1SÌXTž•CÑ 7÷ûý~¿ÇP}› V]>Jü3ˆˆ{ÌrH[Iº3ˆˆ{ÌrHÛ%”@—bqÈ.í4”eY–¥ ?Å €‰Õu]×µ%þ3ˆˆ{ÌrHÛ=f@—bqYi»„èRÌ "Ù¥ äé‡ÂRÌSÌSÌËîáUUUUeàæp<Ç£Þã_(iË™ç,»bv¿ßï÷{üŸFß|bóù*ÍÃ|ã_f Ï÷~{™}:Ó{bxD¾´™Êø4‡Ãáp8t¿¹\.—˘ßÜÚž‰S¦Ëßl6›Í&戢(Š¢¸^¯×ëu-ËL#¶ÃÓf[òHèµXã{¿»Ìô×äÿø¦‘¶=!)±=§Ç=fQØn·Ûí6¥ü€94µß¾Òã¦k*™h¼¾FÜÝ;´™ €”(f´ËXso†Lh4×¾wµÝ½C[{ iÏž)i°^ŠÙB”1`J¤A1›‘2,II€õRÌ&¦Œ1PÒ`]³ (c@Ì”4ˆŸbö&e X#% ⤘  Œ)QÒ ŠÙPÆ€(i–bö/â,cýõ×_ýetâ÷Ï?ÿüóÏ?±-Õáp8F‡>”4Xžbö›™1€.% –¡˜ýQUUUUÍ×Çãñx<Ê «)cí}&0•"h—±ªE2 ûF˜›³ßºse±Í¤5w.Ýn·Ûíf¼êr¹\.9į}¹`X®&€%)fOugÒºßH‰}„¢˜õ¢¤©²O€(fƒ)iÀÚÙw@l³Q”4`-ì£ fŠÙd”4 6öE°ŠÙ,”4 ûX#ÅlvJ07ûX;ÅlQÏJ4ʲ,ËR¼ÖÝ{(c°vŠY0Ý’v>ŸÏç³drV×u]×ý¿On¾¾¾¾¾¾š¯•1H‰bX@öª¬‹Ù/&tdüv»Ýn·‹m¤l9kg mÙ³æžÇãñx<>?????-3Ó2RxïCeWÌÖu¯Ž;‹ Ok|ïÛ_À?D–b˜b˜Ç坨áp8—Ëår¹Œeóšöw†¾þ™>KØgùû/U÷5Ó&°äº¿7:1¬×{ËÜ«~ï]0ÕzÅóîÒ ˜eíuáéS‡úž=Ô~¦ù Sý¶ñ Ì}H=fÙæ[¯×c:~‹šÛëRúzëj/ŸípÉw°v.eäÍÒ5æ7ç“@Øe›c½BýÝP9Ï·ÊЦ˜eªÿyúöÕò M Îq|ï¢Í9Ök½[@ 3fä2­1Ú&ž“ê˜ö¹ˆ±ýÓñõÒ»hsÙê…=dý×ç;èœã~³8×½ý{–¹G+Ô˜†µ9Ö+í$€i)f«7ÕóèæøëiÏ ,¿^Ë”´´Ç´ÿœXŸõ}}‚ çw0”K™ÑÜwå|·Rا¦—ùëõ:¼$I`<Å,Sý S=¯?4å—ð½¿j½ÒÞ¢./ÙŸã)füñz– þåŸê1 q&0fÙB­×·¨î²yÎ$°$÷˜eíÙ=KÝŸJ «ÏøTŸ6tÙBìTwèc3ú¿Þ9€8)f+6íGâ=$]òyÇ/ÿ´ „}ìGØíd¾-*¶ípÌëcÞ–€8¹” 03f,jè}8iÌ'ä¹Öô§˜±¨<+‡¢Àk.eL1L1L1L1L1L1L1L1L1L1ìÏÜV¸ªªªª <ÀŽÇãñx” •]1»ßï÷ûý|>ŸÏgÃ0•Ýn·Ûín·Ûív“ •]1ƒ¹EQElKåd@̳(l·Ûív{:N§“è4”eY–e KÒlWF$ ͬÔ~¿ßï÷öÅ,°¦’É!=›Íf³Ù„½¬+ι;¦_õ Ò ˜Ð.cu]×u- ¿vk×o% ÖK1[ˆ2ÌAI€4(f3RÆ€%)i°^ŠÙÄ”1 JÚºøŒMlÏÞ) ˜M@b¦¤Å¬yƦX»æYÄÇãñx|~~~~~Žùm㬑bö&e X#% ˜Ã÷÷÷÷÷÷º–ùx<GcG<³”1 %JZ âùÌÃ×|""¯Ýï÷ûýÿöÜ¿5Ÿ ö#m K1ûÊ%-”>óð5ŸˆHzÛóõz½^¯Æ‹Ø(fÿBr¦¤…Òþ×'¬´ÿ퓳œå,ç8)fÿ²YÛ°JÚ’šÙ†æëPs9Œ²œå,g9Ç釚G¯67­ªdÏ4ÿÜþüùóçÏŸÒ˜C<€¥}h%g9ËYÎqRÌþß3yªÉ4ì—Ôf5'†œåŒœóáRÆßºLm‚x *ûÀÜ4#9ç-g9#çP³§º3iÝï¤Ä¾.íóßê-g9#ç(f½(i@ªìÓpÎ[ÎrFÎ1PÌSÒ€µ³ïZ ç¿å,gäœÅl% X û(ºœó–³œ‘s<³É(i@lì‹Òàü·œåŒœs ˜ÍBIB±Ï¡ç¼å,gäÅlvJ07û–8ÿ-g9#ç´)f‹zVÒúëî=”1úsÎ[ÎrFÎqRÌ‚é–4›{zÔo¦õõõõõõÕ|­ŒåÉùo9Ë9§J1‹‚¬ôì÷ûý~/¦e_ÁÎyËYÎÈ9fŠLÌÎ ˜›óßr–3rNOvŬ,˲, <ùpÎ[ÎrFÎñË®˜Õu]×µ˜–½ëòœÿ–³œ‘sJ~ˆR圷œåŒœ×B1€kŸÿ–†œåŒœ×K1€9ç-g9#çuñTÆÕ;‡Ãár¹\.—ñ¯l^ÓþÎÐ×?Óg û,ÿ{¥JÓ&Ü^æ>IŽOé½q ûß]÷¡#2~Ë|ï½3ß{ºÜ7"g9#çµSÌøòЧZô9`ªx¼®^óÕ›1¿¹ù¯¦]¶iÇ1ÔO—1f›º ,ù^€gšsÞr³œ‘󺸔‘ßÞ+]c~ó2ËóoŽmCý·±e5ßZ(cÌ­}ÎÛÅHr–3r^Å,kýÏÜ·ç|äöž2|6£õ^õ²ý@œZÉYÎÈy\ÊÈì–¹pkÚƒþî2/s9âÝòc~fÌ–9Ç6à"Fž©ªªª*9`{†œ)f‰;ñú¯O{ºäßšÃÜï½Gäùî˜#“µoŸ,o¿ßï÷{9̧,˲,å°LÎÇãñx|~~~~~ÊÄöÌPŠY"¦zBÝ}Ú²ÌÌÛë;¦Ö2½^ßgã8fXò½ÀÚ¹phu]×umi-¹œ-mü3f·®2Ó˜{rùLÜå5tæÈjï`ŠYÖú&æv(9Õ'V-é½1³ ¤½ý¬qÖËSùíÙf> Ë?cpŽY¬1ãê¿g›÷œI 3f<½©ûÓµKû0zÌ8†úoûÎÐK _/Uª[8°^ÿûøøøøø¸^¯×ëµýş(Š¢(š¯]ʘK `è%…¹]l&€Ü(f HÈ€6—2¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜¦˜ögûÿTUUU•P–ô¿A„òÀû¤—‡]IEND®B`‚xforms-1.2.4/doc/xforms_images/Makefile.in0000664000175000017500000003163112353624173015446 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/common.am subdir = doc/xforms_images ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FL_FIXLEVEL = @FL_FIXLEVEL@ FL_REVISION = @FL_REVISION@ FL_VERSION = @FL_VERSION@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIB = @JPEG_LIB@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ TEXI2DVI = @TEXI2DVI@ TEXI2DVI_NEEDS_PDF = @TEXI2DVI_NEEDS_PDF@ TEXI2HTML = @TEXI2HTML@ VERSION = @VERSION@ XMKMF = @XMKMF@ XPM_LIB = @XPM_LIB@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign DISTCLEANFILES = *.orig *.rej *~ *.bak core makelog MAINTAINERCLEANFILES = $(srcdir)/Makefile.in makelog AM_INSTALL_DATA_FLAGS = $(INSTALL) -m 644 -D # List of all png files figures_png = borderwidth.png \ boxtypes.png \ buttontypes.png \ counters.png \ colchooser.png \ crossbutton.png \ dials.png \ fd_align.png \ genattr.png \ fdesign.png \ FL_BLACK.png \ FL_BLUE.png \ FL_BOTTOM_BCOL.png \ FL_CHARTEUSE.png \ FL_COL1.png \ FL_CYAN.png \ FL_DARKCYAN.png \ FL_DARKER_COL1.png \ FL_DARKGOLD.png \ FL_DARKORANGE.png \ FL_DARKPINK.png \ FL_DARKTOMATO.png \ FL_DARKVIOLET.png \ FL_DODGERBLUE.png \ FL_GREEN.png \ FL_INACTIVE.png \ FL_INDIANARED.png \ FL_LEFT_BCOL.png \ FL_LIGHTER_COL1.png \ FL_MAGENTA.png \ FL_MCOL.png \ FL_ORCHID.png \ FL_PALEGREEN.png \ FL_RED.png \ FL_RIGHT_BCOL.png \ FL_SLATEBLUE.png \ FL_SPRINGGREEN.png \ FL_TOMATO.png \ FL_TOP_BCOL.png \ FL_WHEAT.png \ FL_WHITE.png \ FL_YELLOW.png \ folders.png \ fontsize.png \ fselect.png \ gravity.png \ input.png \ labelframe.png \ pushme.png \ scrollbars.png \ slider.png \ slidertypes.png \ symbols.png \ thumbwheels.png \ yesno.png # All png files are to be distributed EXTRA_DIST = $(figures_png) all: all-am .SUFFIXES: .SUFFIXES: .eps .pdf .png $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/common.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/xforms_images/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/xforms_images/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/common.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ clean-local distclean distclean-generic distclean-libtool \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-data-local \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am uninstall uninstall-am uninstall-local # Copy the png images to a subdirectory both in the directory with the # HTML and the one with the info documentation install-data-local: @$(NORMAL_INSTALL) $(install_sh) -d $(DESTDIR)$(htmldir)/xforms_images $(install_sh) -m 644 $(figures_png) $(DESTDIR)$(htmldir)/xforms_images $(install_sh) -d $(DESTDIR)$(infodir)/xforms_images $(install_sh) -m 644 $(figures_png) $(DESTDIR)$(infodir)/xforms_images # Creates eps files from all pngs for inclusion in info documentation # (as used by emacs info mode) create_eps_files: for i in $(figures_png); do \ $(MAKE) $${i%png}eps; \ done # Creates pdf files from all pngs, needed with some older versions of texi2dvi # to create the PDF documentation successfully create_pdf_files: for i in $(figures_png); do \ $(MAKE) $${i%png}pdf; \ done .png.eps: $(CONVERT) $< $@ .png.pdf: $(CONVERT) $< $@ # On uninstall remove the subdirectory with the images from the directory # for the info documentation (the corresponding subdirectory in the HTML # documentation directory is taken care of by the Makefile in the 'doc' # directory one level up) uninstall-local: @$(NORMAL_UNINSTALL) rm -rf $(infodir)/xforms_images # Get of junk clean-local: -rm -f *~ *.eps *.pdf # 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: xforms-1.2.4/doc/xforms_images/boxtypes.png0000644000175000017500000002320211665175503015760 00000000000000‰PNG  IHDR¶@W\«¡ pHYs  ÒÝ~ü&4IDATxÚíÝ=š£¸Úàoúêx;+/aâ ]i¯¢ÂrèkNí°âY‚k Þ€×ðœ€s1â„@ ûN¦Ç€@o‰Ç2üµßï÷ûýÿ@ÇÏæ?—Ëår¹h¿ÿþýû÷æv»Ýn·Ó(4ñqóïí'DÉ5kÇÇŸÝ5Qòý~¿ßïš  §Óét:uÿ¡i"$D Hˆ @€ !2ABd‚„È ‘ú© ÒÇãñóÊÛív»Ý¶±-kÜ:`(3‘g•ÑÌÏL䉅fã¶ããæßeÎÛY3Ž Bä™4ÁkÌLäÐkÆÅ»s†¿1Ë ½¦ûx·bÖhëõ¿kžv€’¹œÅLRâãøOØv[¥´Ï¸Ï¬­å k™È×ëõz½®«™ÞÞÞÞÞÞb^8öÏÿRíy»ígç¿EhMR>-¦âg@÷¯UÌ~ÙÒQ ÀÅg•SY Dþþþþþþ¾\.—Ëe-;æñx<y–Õ2ã/…Ñ(sæl|¨Ò)ÛÞ]Ãøüýýýýý};¥€’4ùäáp8÷ûý~¿Ï¹ôÅ®‰¼Ûív»ÝüœÛR7ÖK¹ŽpŽ˜j>òœkÚ_1ë?ç× Ôæt:N§¯¯¯¯¯¯ù—îÆz3:›x¨þkþÖsk¸q[Ú!‹ÚÚÚÜXo&)£=—wÕ›Ò¡÷¶…ž-¹ `)f"OlÜõºó”CŸÓ?g6æ†{ó´CúÌëøHi½¡ûjc&ò¬†ÞP.þÙµo{Ì+s´^ÌZ™• @ÍÌDž@Ž[äMõú©Öm©ô•ü.¨™È™‰ÌÄܤ¶ÄLd2ÀÚ™‰ÌÄ\•¶ÄLd‚„È ‘"$D Hˆ @€ !2ABd‚„È ‘"$D Hˆ @€ !2ABd‚„È ‘úYÛŸN§ÓédÇå;ŸÏçóY;”æz½^¯Wí”ïííííímþåÇãñ¨ýòÝn·Ûí¦bT"7.—Ëår±û2ýþýû÷ïßÚ Lßßßßßß//////Z(ÓŸ?þüùs¿ßï÷ûRë šJæë®¡*½œÅn·Ûívv?Pñ1ÀZ4Q²vJÓÄÇÚ€iU:¹ÑDÉÏçóù|:€e‰Ö¨‰’]€(Ááp8Ú€ª‘M”¼ìÏ|€š¹V;P²J/g@ !2ABd‚„È ‘"$D Hˆ @€ Ÿš€’ÇãñØüûv»Ýn·i_?íö›g}€Út«PµQ'u‰©!ªG|[i1ÐÇËÙŠrÖSý„f"ÃLâÿ,¤XoµQ'qŽ-Z#¾Å´èãh[ˆg&2L&ôdûÏLóoß^uR'jˆ¶ôqm K"S…îOf†þíj“2´Z‹¦]ói×M„Ä×nßï~N|•÷l̸4ô™s¶•z k4gïõCå^·òÛ6þY˜“ËYPPAÏ÷³””?3¹×  m©Z¤NÓ7Þ›¿’Ì¿>ê-lÛ<}<_•Ƚnå·-”LˆL¥n-íÇÓÿàuu—Û¿Äøu Íjñ]%Ô,Tú¥Ô¢xê$OümEÛ¯7ƒ¸ßÐ sëHo õ¶mþ>ÞÕ}oü燶¨û®˜¥Ä¬[Ém«~²BdªÓ-¾å”ãôuóÝ&N¶­œ*Wr( Þ¶¥ôñø¯ÇÆ}~LŒ›²n%·m»¥”Fˆ “éÿ¾´‘ãAè’ï*¡fãfÏͳVê$ܵ®»¬ÒNøÕ[ض¥ú¸¶Í×¶ê'å"Cv¹‹þüWy˜–: LkÚªÿµ\ù?=VoaÛ¶8Þ"l¯mÕOÊ'Df5¦ºDýü3Gæ\7ßRmS]YJ6´LUå–3r·•z kTÎx/åóCïzi‹õ¶­úI™~jJÖ”ÎÐ¥åûßÕÿšÐç¤ëqë¿ñ7~ifÃ! _J-ЧN)RÆéU®û Cסü¶Roa-æïã1ƿϳn%·­úÉZ˜‰Ì ä¾ÀÿÐ¥äØŠ”gúMUEÕI Lñ3‚U’ôvPoA·ômTiõ“šýµßï÷ûý×××××Wû‰ûý~¿ßs,òt:N§f‰ù–³ôy¶—”}:jÖÔ¥îãçóù|>k€Òtë¶Š ”àp8‡ö#Kçš5 ”o•jžL5”Q˜‰ @€ !2A?55p5.ÇLd‚„È ‘"$D è§&h\¯×ëõªÚ„Èÿ÷ñññññ¡€¥¼¼¼¼¼¼|k €5úõëׯ_¿´[Uõå,ÄÇ@9š(Y;¬Ëår¹\.Ú(Áóù|>ŸÚ€*‰üúúúúúj÷0”à(Y%ïv»Ýn·ìšÇãñhlCu!òù|>ŸÏv<ã<Çã¡€’-[©n·Ûív³¶¤êËYÐOˆ @€ !2ABd‚„È ‘"$D Hˆ @€ !2ABd‚„È ‘"$D Hˆ @€ Ÿµmðñx<vŸµFŒJCdú5Cÿõ4ÀVN§Óéôõõõõõµ®5o‡DÂb -TÖ^74@™šé¯¯¯¯¯¯Z#ž2jb Á10T»n¨$,Kˆ P„fn]û³6Ö˼c`ZM%Q[XŠ&c¶ ¹É,å‡&€t`NݹÉ€ !2$1XŠùÈÌCˆ #‰ˆ’ÈMˆ @3(ùÈä#D Hˆ @ÐOMÀPý? ý¨³ý®r~øYæZMµ/bö PrÏÕÓÛPëA™}³ÎºÔÈsÜrUZHïq%ô µŸó–¶OUQjf&2ÄAWàZï¾ØÕ|Ç•S>=û±L®Œ 뢷²f"¥[Ôº'Ní×8¹š_ÌpûÖÒsIoCÕÊì›ÝÊz÷¦J ãúŽ„†*ʺ‘,TÔ†~ãzeLyWÌ{§ZÏþ¹¤<›¾¿Rf‘»D‰ŸMAÝžêkCkfÿ'ÇT•qu8_}Pý`¦í¡ý¯Z ‡®sŽíj¹ã¨´0­Üã±PL©0)õpÎsU4þYq9 ;¶tŸ½µôBü³)%5Ç >ý“çß_5l)Ô&¥î¥ôú¡Ë]ªÂ¨~P¦ô óôÐi+aîí]ª^©´°TÿšvÜ5çȰÿ5ùÎýUQHg&2QBßû3ôʘòÿ®þuZˆCïmÿä¤ÝJñ?E™ê;À©Z/fK»GEûYßjÂT=7¦õ¿f\¥í¯1ÏvïŸ%‘òó=ÕÊ4®o¦÷ÐiÍ?òZ-S–›{oª´0íHoªþß§ªÆsžû«¢íWª¢LËLdHŸeÜþœôå¦Üí4%ìÞj©MßR߂²}¶ýø´53¥2´—ÞUfKª~PŽ¥Fb)KIYç”jYò¨U¥…ô^“Þ»—:/îV³øl!å]ªh·eô,R˜‰ÌHóßXo½%/4ƒ;ǵû—žo¹)sÒ¡fùzJ=ÃDÕôM¶º7UZ¶ÚwêÙöþ_3‡‚Ñ¡ïZï‘ Š².Bd¢Ä”ì¡7Ö·ôî:””t6’ÒªÓ®Oîc£û¸?N0¿2kæüÕ@õƒ2åî›Ûh{³¡ÒÂÚ›|–2eM µ[÷qU”¡\΂ÁrÜH$ÞTWÌL¹©Ë¸-ùéÍœû+Ç–ú#¥)§W†*L¾K[¨~° SÄÒß;Ï:§TËiÛjÚöTi¡sž‡ªÖÐKX ­ªhˆ*J:3‘‰Òý~,ýã ½žQü:{oú¼ì©ÚjܲR¶44“zÜ –ë—^K§ÚFÕJÖ; ”ê1g \j䙲ܡû(f+¦Ú.•–m˜ó|0}­¦íÅCÛ!å]ª¨*Ê<ÌDf€¡wͽܡw/v[Öø3™¶˜ö¾ØùÖ'æÙe—®úÑl¸ Ã<í<ôÙ2kNî‘ç²?ëViK#bÚZ‘¯þŒ»Y\i[‘o¿¤? Óúk¿ßï÷û¯¯¯¯¯¯ö÷ûý~¿çXäét:NÍó-%ÄT 4M]jªqûñóù|>Ÿç_Ÿe«4@¿rj”Q%P¦ªÓáp8¯¯¯¯¯¯KiBÖ[£æ 7Ké>n&2ABd‚„È0˜+#¥q™ò"$D€‘ÌGJ`2¹ ‘ ‰(XŠø€y‘"ÀÌGæd2sú© `*Ý(YÄLEm`)•†ÈfˆO;Ü1[H§’°¬êBäÐÝÓét:LËÜd`u€r¸œA×ëõz½j€tݹÉý¯ê±Õšp¹\.—‹ý ° BdþK3Ü>ŸÏçóýýýýý]›L+ ¹äÔi«_ }~~~~~Ú¿Û Dþóù|>ŸµÀãñx<Ú(ÙV+•™ÈÀ6Üï÷ûýþööööö¦5€2©QCýЄ‘"$D Hˆ @€ !2ABd‚„È ‘"$D Hˆ @€ !2ABd‚„È ‘"ô³¶ Þív»ÝÎŽÊ÷|>ŸÏç¶·QM†-©¡jås<Ç£v€zÜn·Ûí¦X‹êBdr ƒ¾ß¯æ¸9‹“@5P Xã['ý”: ‘˜ŒøˆÑ®õÊÍé·ÓN ªjãäy“Z„È$)š²Õ(¹}’鄈ÑÔ Õ£6顤ãdþ~êx 6BdFSÙÞÜds íꡞ¬ÑÐÐþeÚãÁHBd¹­}n²¸˜Ö~¿ßï÷jK âƒ9{Še =ÛÄ"Pœ5FÉ" ‡óù|>ŸO§ÓétRgr‹‰Ò´?ÛsT[ôŽ: ‘ˆb20¿µDÉb 7QòTD`0N|Ьm•€ÿA| P‚&JN¿éV B­$Æ‚|úû—^¹vBdŠVò|dóù55Gýiˆ¥`-B½R/^ !2Aæ å(-Jß˪3Jî†Mê0¬]|¸¬¿/Kˆ À¿¬Es­äæb[Ú.Ô¬ÛßÕ„e ‘XµÜj`~k’ÅC@?±ò²„ÈÀ@@ŠvÅ8¶tŸ%™‚üý÷ßÿýwüëÿùçŸþù§ûÞöãåoK k ”&¥Æ|¦ú )\ ¹¿eâ_?m–yÒ¸öSÙø}ªG,¥}eäý~¿ßï×2YÐSf¿^{ýTµj ”íë©üÐòwKî¥hm E%™¿Î¨Ÿ@Œ¡¡3ö&Û8NÚ±Žp§´~ZO_Vµ¶­]aº3”ÇLd µ¥ùe¡miÇͿͪºú+CŽ9Ëåo»ú å놜ÈmiŸ¶÷¦9_ô÷zÇÆ²íßߣ·×—U-ºG‚=žBˆLúC–nôÐ}}Ž¢ù´˜(ôš˜x¥ëÄ.°méÕLýŒ˜Vú®CŸ+ ]bJ,¿žý?îNy6E{žW¾=2ç‘£/ÛGåí‹þ¾ÓãâûlüZåkU«æã_]Çå,ظ”ˆ¡üuóSnrØív»ÝN;”¯„‹E¨ŸÀPSý˜ºÿ5CŸMYbŽø8ý“×µOÍL¯¹¿Sò^˜j–v U ûq3‘)Ôйo1bf̵_9ÕŒ³˜¨"fÝB7ÂêÎòk¯ûYsè`ÆÕn5Héûê§ú CÅœ˜ÅÌ:—-ý½ñïêÿyøÐ"ôÞîÕc‡Þ,hª¹oSµ^Ì–¶_ÙÝ^³ùÖÅ>Z×¾ÍÒí¯?ñ½2¥ª«ZLÛ„ÈC™‰ÌÆýÓÒ~|]sкë?4Â0çJý\ãöÂöto†s3®¡§è¡ÏL ¬ã×!å½ë’¾¥Nøa½}ÎøxÚ5蘭ªÅ–˜‰L¡¦çµl°Ô¡B× 5‡Öeٛ˩Ÿ1ët¥ÜÎ(4?(÷L®õžê‡Ú*ǵÇíÓôåÆÜ ˆ©KÝøtþ«jÁ´ÌDfãB@ A@îuE?fÕÑïù|>ŸOíP¾ùkˆú©~Bº¡ós癿:Õ/ó„ÜE3òmKîVÊq5jædO•S1ÒßÛ­?Co¸×~åR5VÕ¾GˆLEJ›AFt_94È0{H¡~:hs½ÜºÁD»åçÙ¿ãÖ¹ÿ‘ïí®ùü¡Ìœ[j_¨U÷ûý~¿/mÝ쯒™”¾¼ö£BÕÂÞÇå,¨HÊ ²”ŸK»1T÷ÇÔý·± -1æ†QŽ Ø†2/j¡~ýúJ<X?ô:ÈÝŸEOûÞPËÄ™1ÕIò¸e¥lih†ã¸ ²”öþ²§JØ 1=:æºóã~ë0gUWµÚ3‘Ù¸ÐI~Ì­¢æ ú—’ò,@ õXJ̩ݮá뫘X9ôJ LzñZ‘øÌGˆ×Ž’›¸Ç¬d …ø¸_(fKAiôʵ"E” Ìo-s»ÚQ²ÛîCµ£ññ8CÃåþw1ô¯m"PœõÆÇmÍÉRs•dQ2#þªÇâãqúëpÌ%‰Trê¤w D`€v¬cV2Ã6âã¶vÐ㇜@5/+&b¥±=ñwtpl×Lˆ ÀH.pLe{ÁqH{nrûq·ãƒÚÄ„Å]âãeÅÇgC«º`Ži9ÉAˆ @s“õÄÇmM ÔŽ’ÇÅI@=ÄÇë24’Kÿ*Q¸%ŽÊ$D`2æ&1ê Ž»ºQ2@›à¸é‘_î_´%µ6‘˜˜x ž€t¹cG—]𳵡LÕ…È¢ €xbSà‡& Dˆ @€ !2ABd‚„È ‘"$D Hˆ @€ !2ABd‚„È ‘"$D Hˆ @€ Ÿš`*‡Ãáp8´y>ŸÏçSËÀ¶=Çã¡b\¯×ëõª 6ooooooÚ’ýúõëׯ_Ú¡altÉ·ÛP'!ò`ݰ¨Yè´³æ0CL -Tœ€OÈ»¥ÖRCFà[jmc$Ê$D@| ÄkNÀj;M2xâ5ÃiR DÀL{<ˆ¡Ù£h¦=Œ¯ÈAˆü? Žï÷ûý~×nPƒ˜S ök¶zÂ3tˆc@õˆ©íרk±½PX(¹®ý;t í_æ·½PØßèuí_çhä Dê…Å@è„$tb³½¹ÉýC TBÕÃÜäe• ·ÔÚóiñKt¤Ñ¯äèÐ_Ï-µöüGZüi5"ÿ—˜yÇâc _sú±Õ(9fxa`ôkª„(y~KÅÄ‚9¦=òÉýŸìH®ÁR1±¿zL{<ä;’M$ª™9Šàª}šÑ>!ùýû÷ïß¿›ŸÏçóù¼í5\†j×ö ÉŸ?þüùÓüÛl¨ybbQËzNÕ/šÏùüüüüüì>k,´óÄÄŽ–5ôœª_4ŸóþþþþþÞ}Öøaí„ÈÿšƒìÔHš›|:N§ÓZ¢äÐÀÂHš›ÜŒÐŒÇºò…ÅNðØž˜£:¦O…â㆑Riò…Åö)ÛsTÇô©P|ÜUZcµ"‹™„þ4–%;)æª*5GÉÓ†ÅNÒ`þÞa•Û´a±ýó÷áòZ‘ÿ…øȧ ‹›àx½[ax äÓŒÄbîT±=鑱Ó-ȧü34Êì¾Þøj\»M»ýã¡ãœîës–Uuˆ\çÉ P¦2ç#—|j 6Û›œ;‰‚Ò„¢ÉøÑ”X9¥õâ÷°”Ðè%~D$V^V¥!²KXË ÍG.'JöÓK`Y¡ùÈë’ÇEÆN`íRÂåÚbåq‘±Ñ)¬]J¸,Vž“ËYü‡ø˜ßº.ma€Ìoí—¶;íztGVCcåmŒÍ†ÇF¤Pî¸hh¬ld5-!2L&>8vb´ •×(ÇÇ"c mh¬,Pž–y1Çãñx<Æ¿þv»Ýn·:ÛgÎmï_nh¯…Ö0f/§oÝжš¿mãöÚŽóÚú²c „þ³Ü¡µ.ß–ÎSEkëkZ,Ÿ˜øx«'0ýG`9GÝ«ŸÑ]ÍÚjL \~ä—¶êÛ´•ÇènªcO‹5Ú#«˜@Y”œâGm¼ÞŸC b˜³ýSöαE;k‡Æ²¸XöfzŽ’û`™{G­³—•6¢ë?iy´ÔyD•Ô­±úmé!Æ[Kè5%ß¹Ýb¶®Ì£W}˷ΪǴÇj bF\)·5ÆLä"®†Üÿ­‘r°¬nû·÷WûÙæß¡½3[¹ÿ¶A;t•eä©ôj]ɦªuªG ¶×V%_9t*RÃ<—þº±–£®üê§æÐÕ?C¹´YÉk¼]³ú¦z”F[ Õ?CÙ¬äq„È›’r±…¡¯é>>î2ésx‡.1e¹ÝOîßöøÏ,!>‹Ù§ùþ ŷôÇùR@­Ûj­›¿š ­¢ñí™R=rQ¹ÛJ¥Qs|lôu)õ9¦æ =ÞÖUý†V<£»­j¢Ø2£ä5ÆÇê[ õÍè.G[Õ\i›±™(9]u—³X—ô¢9ôsr¬gÌŸÕy–8n¹·–yÚ¶´@yžuK¾˜Çº^j]Ží¿Ö•ÓÇí‹ù×þõQi§">ÎWÙæ<ž[ª~ãÖÓènB±ìR¸Xo|¬¾•Ùîò-õTÚÐ8Í.â ‘‹p h¿&¾ô‡þTä. ·ŽþíYçþ÷ÞBKIYnhÅì£øÖ+íÈÌq,;ÚSŽóþm•ÜþjZ·–Z7ÕÓ÷Kú¾ˆ™c2tßMuD©´%«yKüqÞÿx5ë_Ê´ýh]ÕoÜþ2ºÛª’#ÚuÍ>VߌîÆí¯{­»ïTÚæ§"oJè'*ó/wžuŽ)£¥µ•c©„u3«Åñ9ÕrçYçuÕºò«k9kX~Ì”²¶*-ó¥ó•˜¯×Ô¼†jtõmkhtǶ ‘ êÌýßVé®eöQ=ûw©£=fŽ[Ýû¤ï¯ò÷Ñœk3û»Î¾¦ÒÖiÙDû‚-¾•ÜÓË¡æ°Uê[ùíŸoYFwíåÆ?ζ ‘‹¦[Æ´O¿ô¥ôÿÙÎwi|Gû´æ¿ ŽùiÛg{µn-GTüÏËÿqŸJ›OmWÓË÷ËŒn-J¿ÌQÌq»ê§æÔSsB–ºòÚ×mªãV}[K=1ºzÅ?^>W@N!DÞ”i¿=›§(¤¬sè½1ßÖŽ[nŽï'§mç©.™?ÿ7±s®›µSëJ®u%Wi×°ü+Ÿ¦´•JÛÏYâ®yjì´_§-ÕkÆõ\£»jNŒÒndWÚþrÉê[ ÕcÚ54º›çh\Š#§ûk¿ßï÷û¯¯¯¯¯¯ö÷ûý~¿çXäét:NÍó-%äp8‡îãó¯Iü7Zã.—ÓáSJÆÐoPS–>Õö¦,wþN9¢òµê¸õœªÒ÷ÂÐgçÑTÅîãçóù|>Ï¿>Óž„¨u5Ôº|5dÚ*š²uýûzÜq>³Ò–3~ërB2mßOù«1´Ê•\ý¦ê×Fw5„Ë¥ÅÇk\CõÍè.¾=ÇíY£»emi´6O¦Ê(ª›‰\ÂÉF1wtê]¹×9å¸KµFúžÒ[;þRZx©£¢„#vNKÅÇ’ôjݲ­‘c‰SµpîöÜ’mTÚrFtý³’k˜›œÞû¦]î´_È¥©®Æ½ÔiÚ€XŸZ#!r”öŸƒ Æ6.[¯=¤0b¸/EŠ¡áòçççççgÌ' šÙžyîî _”fh¸Üž$ÑOÐÌöä ˆõ‹-"ÿ—f¶Kÿ¤ÌMúõÇÇëš}ÜÕT¿æÏh¨an2Я?>6û8E¨öN{£Ô¡ŸcäÌ´–ºå¯#yBû±|;ÔÐÏ1rfZó„ÂŽäÚ‘ƒb¢äл´Ô [¾¿¿¿¿¿C¯_{|Ü%‡ÞåøtëÀn·Ûív¡×‹së©æ æÜpŒyŽ´Ü}„ôTósn8ÆÂ¶ ‘ÿ‡ö0"f¸Sò˜ßö‚ã®ö0"f¸Sò˜Ÿà¸ññÙü#ÞÜK.»Ë9¶¡_||6ÿˆ7÷E‡ËîßrŽmj&D`ÚŸÛóòòòòòÒÌG®!>îšög€Àö<ŸÏçóÙÌG¯×ÐH®üñ³þ¶@˜ßÐH®üñ³þ¶@ˆ!DlÚ{¿k×­ Nl†Þî Ø¶nMpbS›ô¿ŒFÚŽضô¿ŒFÚŽÈMˆ<ƒ!€~CŒ“{¤-¤ž³µr´…Ôs¶6”Iˆ TMl ÐOl üЄ‘"$D Hˆ @€ !2ABd‚„È ‘"$D Hˆ @€ !2ABd‚„È ‘"$D Hˆ @€ !2ABd‚„È ‘"ôsÙÅ_¯×ëõj7”iùr¹\.—çóù|>ßßßßßßí€2-"?Çã¡éâ-•¬º&2ABd‚„È ‘"$D Hˆ @€ !2ABd‚„È ‘"$D ègè‰ëõz½^5@Íþe&òÇÇÇÇLJ¦¨ÇËËËËËK÷ñÿ ‘ÅÇ5ëFÉí÷ûý~¯ièú ¬Ÿº5Ö>IEND®B`‚xforms-1.2.4/doc/xforms_images/FL_INDIANARED.png0000644000175000017500000000056111665175504016066 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$pƒIDAThÞíÚ± €0 Q@Ùè¯àžÉ½P*ŠÔW¤{|]kŸUUUI’zÑÝÝ=V¦ûžsÎÝ“¾,I®Ý#þÄX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±€±^Ö-÷˜ïZ•wÄ]Ǫ…%tEXtcreate-date2009-05-07T00:32:27+02:00_µÞ•%tEXtmodify-date2009-05-07T00:32:27+02:00¨¡tEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_ORCHID.png0000644000175000017500000000056211665175503015440 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p„IDAThÞíÚ1 À0 Ñ´ #S0‚am2AÐ!s†›ÒJ÷|Ýj_™™™MUUU}ecÎç9=éË"Z»OøcÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆúzyX·|í¬J/ëð¦Šì2L%tEXtcreate-date2009-05-07T00:40:05+02:00§Á %tEXtmodify-date2009-05-07T00:40:05+02:00øp{KtEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_RIGHT_BCOL.png0000644000175000017500000000055611665175503016147 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p€IDAThÞíÚ± €P ÄP@l”RgØì‘(~„+@ò›àäúöÌÌ̈ˆˆM7fffΕ©»»ûíIßUUUu¼=ãOŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ Ø=†<±Ž!/aŸÁ³NÙ%tEXtcreate-date2009-05-07T00:25:28+02:00НjÅ%tEXtmodify-date2009-05-07T00:25:28+02:00ÕñtEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/input.png0000644000175000017500000000331311665175503015243 00000000000000‰PNG  IHDRr–tH= pHYs  ÒÝ~ü}IDATxÚíݽ‘âXÐí­Ž À–IC àv&2‰ä ›É@¤@&k°U*©„$àS÷9Æ ƒ~®jú}}Ÿ€¢(Š¢ø Òçí¯ªªªªR Ç÷÷÷÷÷÷ÿaåëëëëë«iš¦i”x¯²,˲¼=þW9€d MX¢ +@4aˆ&¬Ñ„ š°DV€h MX¢ +@4aˆ&¬Ñ„ š°DV€hŸJ@šº®ëºV€gØív»ÝnYÇ,¬çr¹\.—Ãáp8T`.«ÕjµZ5MÓ4ͲŽÜ4MX¢ +@4aˆ&¬Ñ„ š°DV€h MX¢ +ÿl6›ÍŸ?·?UÒ+@4_d8Òv»Ýn·÷ÏÇãñ8dýþ5g³Ùl6›Ûãóù|>Ÿ3÷ùú£š÷,î÷Ö%§VÀÏ ³2›v|ßisG5€étV€‘º:(÷1åöX¯˜BX™ÁmZg{çщžþ®L{oíI¥®=t->i5|«|]¿ëJ‡ï¡=ù2ýÕ—¢ÿ|ç½.¿§ªð›™z³!“GýëŒ[úèó×fN‡õœC†Õ){˜þêýÛöK®fU4ÂÊlî»ãìc˸m]Ú>æc‡)g÷.íAë|§ͶsËð#™²íõŸã”ëÒîZuÕVdŸÁ4Лuˆá ?‚Œ›¸™¶’«Ý‡OXL‰Ï‹&S&J~ÆuGà7ÐY™Ù¸ĶE%Y:1˜‹ÎÊ›õßúú®à’Ù#ÉüÔ†xoo X:•§8r"Bû˜Fï§ÿîžWçç]—®m}Ö ü$:+AÞÚor~ô ̯ü”ÞáƒPûîovm×aܹO¹×gÊuqMá·ÑYy¢!vÿûwîŸyM”yÆíºs2ðôSöÌ£WjÊõzöR`Y>Š¢(Šât:N§¦iš¦QÞ«,˲,‡ÃápP ^ãþû–Ïçóùï_5áçY­V«Õj)cým,¸=ÖY¢ +@4aˆæÝ@îSh:+@4aˆ&¬Ñ„ š°DV€h MX¢ùP8âTUUU•:p#¬çz½^¯Wu˜×rºš¢ +@4aˆ&¬Ñ„ š°DV€h MX¢ +@4aˆ&¬Ñ„ š°DV€h MX¢ +@4aˆö©¤©ëº®kux†Ýn·Ûí–uÌ q.—ËårÙï÷ûý^5æ²^¯×ëuÓ4MÓ,ëÈMÑ„ š°DV€h MX¢ +@4aˆ&¬Ñ„ š°DV€hoû"Ãív»Ýn‡¬y<Ç£K•àþª¹.¼Æ:+Ãc ðó|&D×ïè÷1åöØoóðÛD„•.·hÒßYé_:$=c«þé’)KûdÈúíªö¼×‚o°2 ¶×yåV¯?ëéÇ9å,¶wü×`.Ñ•)7áÙöy[Ýw/†O`=Úíèêå yÅ)û€WŠ+ã"¸ɚ®5wž±Õ¼ºª1®’síßE<æú‡Àm˸½õïaÜV]ë÷?Ü‹~7P¿)Óý“ ]Ó(nÕž r.úpï‡|‚íð¾+: ïߌ{ÝöVSBɳ;4:@䈾Áv¸qCék¶šën’ö~´zô8=Sý!žaÁ•®ápÜ'—ôïaÜV¯<빎axUà5>Š¢(Šât:N§¦iš¦QÞ«,˲,÷ûý~¿W €¹¬×ëõz½”±þ6ÜûÖe š°DV€h MX¢ +@4aˆ&¬Ñ„ š°DV€h íS HSUUUUêÀ°Bœëõz½^Õ`^Ëýéjˆ&¬Ñ„ š°DV€h MX¢ +@4aˆ&¬Ñ„ š°DV€h MX¢ +@4aˆ&¬Ñ„ š°DV€h MX¢ +@4aˆ&¬Ñ„ Úçý?꺮ëZQ€EQE¡@¦ÿéG”§âÕÑIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_DARKER_COL1.png0000644000175000017500000000055311665175503016216 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p}IDAThÞíÚ± À0 ÄÀ$ð4jµ‚Ö×N)T§`eàMð`ýwUUUffæ¥ÝÝÝk2EDDìžtºg÷€?1`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,`Íåa÷ŒÓM¥À³¢•±"ý%tEXtcreate-date2009-05-07T00:29:56+02:00Êiø%tEXtmodify-date2009-05-07T00:29:56+02:00•ØŽ;tEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/symbols.png0000664000175000017500000001153311732372246015577 00000000000000‰PNG  IHDRc1Ü@‚ pHYs  ÒÝ~ü IDATxÚírÜ* †÷:=RÙ›¼3ä,o2™ÌÚF!$ìO3mÓx—¤Ïcl^ÿ0l{{á Œ1 Œ1 Œ1 Œ10Æ00Æ00Æ00Æ€ñŸ« £Fœ†‚ñÃÖnhDi(}%yË™‰Q`Œ46Äøõš×¤–៥ñ:Ù-0¶<Þ¤¶ˆÍÐøŽÃß“i‘‰ˆ¹~ cüÝŒüÐXt@,[£D¸†rNêú©AÆG;1‹ çjh¿QŽÇ¸,5ã\Ä25^McÄe„b0¾–šŠq ²‘±˜MÁßQÎÍ0s0Žö•â«¿¢0>—šŒq3o“Îå×3f„Æ=0n_Iì…ñ±Ü 1¶9oãšÎŽ[a}VˆÏª=Z‚*ËMǸ渌KŠ8Œu­ý0¶%–õ0¶–<cÝq9—dãñèØ{¿;cÍqYc±Œï26–guÇã±Æ?×GS0–—׉b|—™ŠZ2vkb%Œ¿KŸ„±òjn«å¯ŒG–€¯vkâ¡ï’û'ôí_n[ïÖÄ#1ÞelÜ7™·ò "{N÷cã]f*<¡_ã5&ÃæÄcÒLÅ.óÆí’µ[«aüê¶}O•IóÆ;ÝÅkÏOȫꞹ4èAwñr–å­©hßòV&ýaiãÛ?ý±÷³xÖ‹T0¾õ³xû?m´€±Œò-žŒžš¼ßÚ§€ñ¥Û¼§â.¡™y:¢Æh Æh<ã¿CfkhÄhð¶y4n ÁÞØ Œ10Æ00ưù·îã W&µü²ôQ½¾ÏŸ[­-í2ô²½ªÖ:>Ñ#„O”_–þë@jeÇÛÖ–s›æúß§i× Äø|W=´Üò¥ÒÇN¹¾µ2£Úß–QÿÇùoÆG—e`\+¼.KÅXªïµÌŸceÖ/þöm©µçX¿ãÑòˆ½½<gãkÆ:1Kù½Îé)]½UKóÇT9TÚQÆZ$ÞåõûKöбVÇßÉGzN#=Þe 0–2KÊrùQ—|z@¤úÛ.;äú–ù¶†qíDkK¯ßt0¥:ëG¬ ë<É '`œ1î“ËÊÊZéúJÚöeG½¾}[ÖóÖ”5y¨ãžèzr‚g*äjF ,4œ2K—Ãm£JÓ^£ÙØ×}&¢T=O{†–ˆ¤ec-çdN#gáZéZÎé¹H±–mÅØšÉ4hÏ#×qé#àѱqkV'il|<þ%™=_Æ”>ÚšöMˆ3¨Ú4Ùž ¤·?ä™ ùH¿??rûÃV50ÆÀÃÀÃÀÃÀc c c kbÌ{иÁ{*þüùoØÚMB( Þá†Æ 4À 0&4h€ñÍ4<û‡‚ñm0οöÜJt;²w÷´Õ=c{™`Ü¿}µðË;®í‹q½î;mSs:1n=f²ƶmlVTäcܵ¯zz6?6b,o»µ+Ï|ŒglS™·M|ë,{0þž¥ÍŸ¶µ›|lãú&¨{alßϱ}?Ô^ö)X~›{PöµCÛô¸o_ꌥ-©5w®Œ±}sõñ-$- ¯ŒqÊþl¬±•’¥nYs躟]TµFlèÛÙç«6Æc—‘çÿYPöŽ¯Þ©eéDŒ%—®Šqï¾ô£¡±€ìŸfÑ[P?åË4cÕèÄX>gFwsŸ‡qŸÂhGi¹¿ýÞŠš©¨¡1k]‡a\Ž0{Æ0wǸ7Û÷iôBüV‹œpÓPŽ»î€90.“ÿhøï‚±µÞS~ Œ5”£&'=—Ã.ŒµQ¦w,vŒ¥ÑéÕg#—‘ˆÛ“qûãŠòØBÛ,;ÙxÒØ¸·›Ü3Kuß,36c©Ì­ÆÆÌT|ãÏÏTÔê¼ÑLóÆŸÅø“óÆ­²¶™7–orï3ëŸÏøVÎ6wñXSñyŒç¯©°–±Éš V¸=ãö÷7YáÆzãU0žµÞ¸á±lÚŒñyiKD#âKôêÅeJIÂ\ï©ç9¹¬zcãåõ™ã£D Ær‰o¨ŽM;6ïØÝµq”õâ²±¤‘q-e]ë|îâeÿ½ÿ\‘¬gV›Ïl­2eã²åx¦ï,”J|ÿæèÍÕg'ÙVß¶0ÖÆ‰þ6•§˜_Co‰t*·bR‹BÝËå@ŽZc)%%c\VÉ‹²\¢6>“t¥ïÕ2ž®W{ªÅƒñµï=ãÓÐ[¢ù¾>*·DAò–ìy)K×û;›Ï0n]é¿^½ÁNãcv;ÿÆ0)LR&ÁXB"B£Þ=+ûÊ*‘½z:ãÒW’âÆzaþ…^=­Û—‡V$½v«¼—_ãZ­=ÙXóJ c9ÝÈk=‘ƒðA…v®úÇÆ­³¿>6n9Ѫ'÷&#ãÖ2R(G4ô–ôëq•ƽ­‡>RîñY+bnŒgÝþ¸ÎTœ;–šS-!»ÿ혲®y¢RF¯rôÇEï†1þ”½–®Ýl—€1Æ8ŒÁÃÀÃÀc c c kbÌ{иÁ{*þüùoØÚMB( Þá†Æ 4À 0&4hDhXozcÜ’t[ìfsÃoy~ŒmÛ ¥`¹…OiŒÛ;ð=cû.… Ï MMŒï€qk³ótŒã¶wô©ôkômÆù××¼ƒÕ!Œs3e¼†eŠŒçi”»¶^!“„qÌÖç6îAŒó4äM=ë*;1Ö7Y¬wQáÏTXQã, }gÚãõa÷m€» ÆV”Á8G£ÎÕϓؒßR1¶ËÙÜvVͼÄk•Æmª4¿%c|»£“µe¸üùZ9`ü‰lÜŸÃ0>KŽÝÑ™‹q­¬¾Ðè×µ­Ð3‹í3NßpuÆGÑÑ;:³1ÖÊËÈ0×vå`|¾Êßg¦bŒGCÓž‚ÉÄX*s5Œ_fûíú4¼»‡úâqžñ"‡aümß‹³÷ÇxýllñccÆG„cclìI]Ãxß™ áˆð3SáK]Âx×yãÂ`ýaEŒ÷ÑxÔ³x?o­™0^㟌îCŒ€ñ¼&ñž 0NÂøénCŒÑ@ŒÑ@ÃŒñß!³5 4b4xÛ<7Ð`ïìÆccØ\ŒÛw£‚*4¨S~¿UbN«2ý• ɇï¿3[ám×Ë*Yþ”ãÀ1éûïWÛÍÃ8Ó_Ù±¨ùpŽJ¿ÚË&y\Ÿ¼:ò÷ëÁÈhQ¦¿²cÑòá •4ŒÝJ&Æ5¶®üý+Æ?ÇŽGÏŸ8ÿ9»ú÷{õºèí÷]v,j>”ýçéÍF#íÄXúõhÄ9*ëØœ%¿Äø”ãgŸ¹þÏŽ±ÞŽ<ÅĤæÃÒÞ1s=Òý-éÂX¯t ʲŽý|×¾_fccé“çìÜ›î¯8ŒÛ9/–*>,çÔ[ÑŸ(»ñÐአ‘çò¢õ}) çëåxŒeDÌ0Ôb“š¥ôâk“¬rõ”½%/»l­ºQ YÇ^ºôý:ÆRvÐ0>wªEõYt¼1Ñ}¨û/R%-×scä„•¦c=ã-Ó8úÅ]‰±>Rö¶#ÏGQ1iõc¥ÿ|ƒ]¥¾ÍÆ+Üþ°ë·?®XÇøúÝž åeãOßþ(Oõ±¬ïIWnŒ1l]c Œ1 Œ1 Œ1 Œ10Æ00Æ00ư&Ƽ¼§âç=ÀcÖnhDið74n Æh€1¡AŒ?®1oó4܉)Ëm2T}Mú4ƵÕÀ9[aîŒqÌ&ÎËa,/˜ß—:cmÓYl|Ãl,pŒµÍÑÀø–—Á¾ÆzŽîÓxuÙúßtP!UŒkûãõblßbŒ?¾›ûùÆ1þÖ¨mãƵœKÝãï&¼ŸÁÝãs T<ãwØ÷ÅXnOl;"7ôýr7šõóR=1–[‹ñ¹ÿmÇȪ30®6ëwl¹Ær[b1¶dû(_eÄüA7fGŒ-WÞcí°ž(Æxö8 Œ#|5¦qññÈú|0ÞcÆÆi¡al,µ£@©ÂØøÃ3S‘y÷ Œ§`̼±¤a¹“wVbÞøcsOÖ°ÞŽ>j16þƬ©5¸½Ƭp[#`¼üzcËV0ë­7ãM0ž÷ô‡ö‹7cžÅ{Æ2nyOFg„†'£{}¥Û–ÏÖÈÀø®¾ÊÓ°¿|ŒÑcBƒÆÊ`ŒÆ1þ;d¶&¡FŒo›GãìýÝÀÀc c ËÁ¸¼•z\9[~ZþÙY™ÆŠ3¿‚Trku[d äQºßòcòéòDŒ%d­7°Uª?ðÚO±Õ[‡X©ñþ7>>í˜|¶<ãósW7åb,kǾ֪-ˆË”’F^|,1ùdy*ÆG×h»…rPñóÍc†°UWÖŽÊ_z«"1–[ µÇ‡q©‘‰q;&‘xÓt~ô«$ª¤NÉÆ¥ëµŽ¸Ì9òQ+Ʋöøè[.¹ž'½™RÒ9zb´5º—$"²qýTŒ©ý•›ëßm¢Ä ž?\b,7M?jq€~¾ïw^­ä”kÞ;g™qŒå0—' ÆW5ïešÅCuŠº1®]Ù0îk°–ãe¼Î“ ~ÕʹŒq©æþÖHò bÄc¶˜D•'Q¥]͘0–³ÏÆöFJÐç–z«¢²±¦sþ]DßrÖæ.¢Fþ’š?×"¡õ^NŒ¥Ÿ¤ÎKº·ŠjMÔµG1®ýƒp½ô¸q«í1.£ëóWD$$ŒíDn\w½ §Îvß¹Úv‚7 ÔóBD˜¸ýÑ_û’›ëLÅcÅ¿#g†­a`Œ1†mŠ1†1†1†1ÆÆ6cÞ‹€F†ÆtŒÿ¶¶ÛÐxšÆtŒygñË`üõõSÕë¿„ 0&ü` Æh€ñ"Ÿ¯v-ybþÙ0ž†ñïl­.y"Æž7·Ãö\% ÿþ…˜oþŒ[_÷òcÆ-{1î =ëûÖù6F{(ÆuWŸ÷^׺×6_,AcãÈëbl-½ã™—xíDÁØŒ±òªcã<Œý֯т¸Œ«k ¯:S‘7¨ã­1–AæÖDž†â+È`ÜÄXù‰n³ÆÆ`œ„ñø˜Òz‘gÙ£¸æ«ÌAEï\ÅoÉ`¼ ÆWýö 0_6®éŒ÷*3f\ÀxÙll êòKÓ‰ãÏèUÀ8 ãÑ,6#S¶t¢}•׫€q Æ‘3™™²¦3ÿ=§W㌣ç33¥¦u7ÒrD¯Â¼ñ¿ïâÍË”z«b5r{0þ·âšŠ™™òª¹R¯r\¯ÂšŠW¸ÍÍ”çO´Ž¯Ú«°Âm¹õƳ3¥ÝVîUXo¼ØÓó3匳{žþ˜gñìÙ½ Ïâu`Ì“Ñ~=z•`|_ÄÐcÂÆñ4À 0ž‹ñß!³¹ giLÇøo7Gc-ÉcØ^ÆccØLŒËûé­;ì®Ê*™¥ÿþn\©æã¯^ÛÛ~kÝ-Qy}(-šdß•{;êÝÌ8Ìj?å•þÓ†¥Z}óêµýáWi×½'Æ c|^Ýt=Ë£*.©Ì*} c¹l°^½zùc*öºßã#¼y—*³JÅX*[ÿT?ÆZùrþìøV÷sIÇAËñåm0òaŒås=¶ªšÊùXléÇc~¥ZÙ×Oxôôò¥vô©´ë~Žôùï_ˆË#³3sÆe® ªÇÆ—’ ŽY?¾ôòˆGI/[Îl½zµºª´ë. 7ôïhÑ[ c ¯Øl|všä¤¸Ò¯Ùȧ$û§œñêiž‘g^úTZu—g<êǤµpŒ%—Iî­¶TJT6n•>¦Tk{@ÐÖÓÊ—gúT,u/yZæ?œè¸lNÔ¨µ¦76nOç(Y'­¼zíÞɯb™,¬€7ÏÙÚo"@ž{û£=‘å/ûzlL¯•GTjÙøX’4SqV^z¦ÃV70ÆÀÃÀÃÀÃÀc c c c Œ1 Œ1 Œ1 Œ±[Úÿ¨¥9Œ]>W—IEND®B`‚xforms-1.2.4/doc/xforms_images/genattr.png0000664000175000017500000001133612244473611015551 00000000000000‰PNG  IHDR¼À²œ¦W!PLTE­­­ÌÌÌYYYÞÞÞ)))¿¿¿ÿúë×ÿcG€ÿ«œU pHYs  ÒÝ~ücIDATxÚíÝ1sÛ:p¼<¤OæŠks¹y}æÍwÝû<‰+gnîxÜßwH‘æõ¾&Ÿòì%’%€Åÿ:Že[²¥Ÿ!" c@ íÄ/ïóâ݇¹«¾äx|ʽâ›Ù«~€äXüšÕ¿Ïã#À ^ð‚w9¯e>û.ðv×#ð.åµLçlc¼L–Á»˜·³¥œÎOÔÁ›Ã+d]a]+îÚ²áî’k¬g­×ýçþ®7 -¼¼–º7îÈü[×]O<àuòF¾eIœÁ›ÁÛ¹y^2Êk‡¯´lùKÈÕÁ›Õz]ËeååÈkNyoÝñÊèòyÉq¢:Ék”W® ÞÞjœ÷´sà!/:‡<^7ïí†5íH;‡ó¡ÍÏýÐÆÚ²y/ÉÄL†9àžMÌü«;LÌ–ò^Œô˜ÃÙ ðÎòvm’G:œóú+xÁ»ßÎÁ€¼»âýÛ{Dn\Á‹È'ð‚¼ð‚¼ð‚¼ð‚¼ðÞ/§ ¦ñ¬„¥ä†×»£öÒI”½ñš$ÁtÀËŠœðÖäéßÕ˜½HÏñŽ=æž×€÷F^’PC¢ÙpÓ%–°Ïéé>¸T4üª¼îîø4—øÎv}ŽdHÓÑä÷ŸOà¡x­Ažd-^+IA¼×ÖûQãƒÚDÙçñjG›ð&)f‘—ÓŸqS˜áýÑ¥Éï+ô{ÆãC%Þ¯ai«¶^÷,”Îûcœ×?|w­§Ã“ék<%è[ï€·Þ ÈwŸ*ñþû¤ïõÄö ’, ¿£­WûÆ"ñoszÎyëÅÛUyû,õ¹ÖKýÞ^×jmHBõC›¤ò²µD‡ësV¹2¯C©Ý=/ûI™C‹³˜)–øWú˜KNÌ&xeb–L¼÷Ë»iœó®à/xÁ ^ð‚÷þx¹|xc<¼ðVåý¼à/xÁ ^ð‚wg¼\/À{©ÎÙ-agxOÓ ¼'‡×|>0ïÓ ïÉåyÞðÖ切#w—x]Þ…•Ô–!/?¼íyÉS¬$̪'œÖK:Q¤ìumg¼q× 9¦’±ÂQxY­_|ByëÚÎ[¯‘[[Y³’q³#µ^]k’½®íoÎNGÚRÞœumà]Ì:‡œum+wk®­ˆûïq)^N‡¶¬umƒûÆÆzCÛŠk+º9”Î ñʆAqb¶|]›«NÌêÅ9olSexÇží˦,ïåemsF÷¦’-¯ç=;Î`Ûã]1ù_÷ÔͶØdo…šÛz¯Z×V—wùOϽÃÊû¦ß7T[XâÙÌîÕùaqçPùµÁ;œ9¼Mö áÍÙk¼3¼ŸÃ)ït¼ï"^?so5^?ïM†6ð–ä•©B:1oIÞeÞ–y²®m+Þ­Öµ1Í> ¤@R¸Yr+Û>oõåíÓÿ/òÚ¤‚åp ï/ I/µÞÀ;¼xgx}•Úœ³!¯IÒÿÁ;™>-Ç•rê§ÕƒÉ¤éÿàÚ䨨KÌæíW „S†àå•¡LÆùêÁÉÓ°jÀ§ÿ·Ïû±^|˜å•å>&ã„êðÜ4%éÿíó>Õk¶ŸfxIVV,å¥ÈKàáõóÞ°½B>/ÇÎa'CÛF¼þU[þÄ,}Õ–¤ÿƒ÷àǶäí·t/Z/xÁ Þ£ðêtd6§f¯Þ>Y‰òTïtPë¼áà±=á®ÂKÅc뼤¿w•Ö{8^}ȱŽL^ÝXËÑ<¹œ]—aÍák\ê±î·?xÌeZoHL×5ûO>ã\j+è¯áBpoõäÿI^Ó:)Õ9h© :x).¢X™·zòÿz¼º337Ä[-ÖæµZ¯96o,9S–×€W".еcŠ´Þ‘¡lÚŽÃ+%gâĬ¯ëpÙU NÌ\ÅA®åj»àöf×Çšàå±ýÒ–ðŽüð¢õ‚7ƒ÷ãñÛQxßoGáÝ4TiÉßåx—ò.iÃoÁ ^ð‚¼ûä­>%K~"c ži™·~€wm^]3 Þš¼rPÔ;3 ÞÀ«åºXk*€÷vÞpÅõ½>kƒµB½ç}SwÍýó~Õ EÂë›±|÷—JÓ-5´ï ¯ºþ@ÎõI¼F¯°ï×Õæ½)¯Mê-×>&¯l$Cƒ·(¯žô3ð–ä]3À ^ð‚·IÞ¿þ¼àÝïØ^àà-Æ;¶Y5xÈkKmó=äý}IúÔbÞ~/p6Vh•·@õç¼W·þlÞp[+ˆÝ3ïÓʼR}ÆúUºãxËòÊþßv¼oA^öÿŽÁ[–—À[7Ùû C[^Ùÿ›Âöáà-Æ;ÛðÒ‘â ÔóÚó=¶›áõ¼Wæ=+¥cn\×Önëµv¸ät’W2|ܰAÝwi2‰êïY)cG–½îòp:™“ª(VV’wƒ”C™äÕÅëV†Ò Ë×ðÒY){â.שb,‡2öS½‘w¤”޹§Ö;¨Š¢¼±âÁ,¯ë¬N~®îFJéŒýÚw}U«¥Ðóx}›¥­wX-c¬âÀ~;‡¤l‡UäyG~ÒnyÓª(KZ¯Ö·xéŽxÓ¡ÍǪ+6cb¦™TL7͆¼c?h—¼§UQ¯Ÿ˜Íò.ˆŒyï°”NÞ÷›ðΘ˜‰!¼8ïy){þ¢v·Û‚ŒFÌE½—C:mñÆIì&¼cÅtîŠ÷´@ë-Ékã!=ð¢õ‚÷¸;^mÁ»d^ù®ïS½fûéÞR;ùnœßÛ(¯y[h'_ðV ðVëÀ;É[à÷[ðVå}/xÁ Þ-yCÙ%²ƒìÁ[„׆%ýà­Âw[o^’Bò`tk`]aѯ ÷2)7É;8Ffn³¬Uyu[jÝÄobÛh½·ïæy‡i ñ&‰šJëO7Ãk“>lš—rvܦsˆiF’Ý%M¥ ^â¸)’•$f;ý—ðÁïcüv1cIÏ[t¡õjvWC­—u9XŸu‰W6ЧÐÏmÊkõ>Þð(šé{Cê"^ŠILfc^ŠëˆC[33‡kx kŠåXnͪ¼ZÑÕÏd+–‰™Ý3¯4—Á‚—xg¢^«}Ø<¯Ì”×6ÍëS–›â%ÍZ¤ ó^¿7m;CÛNZ¯¼jó;óÍ¿jsiªÜÎĬqÞqòÛ¼#­Sæ•x«ÖÒAë]à/xÁ ^ð‚7Ö^š: ¨«óÖ–PÁ[8À»:oR!I?y6à­À›ž£oyÞôÌ>x ðJý’5Û^UnûJTŒ·Ñ…WÕyµ(’T𜱨ñàè<–®\Ù9$gÍI:†±³KXº²`éJÚ9øs¹Ö§Ô·Àï·óƒMN‰‚÷ Þ§^JyÓ<ð–à mIžÿ¼7ñúâ}–âÄLólÂÄ ¼7ñ. ð–áµ<š«Þm[/·"¯åÙǰ>/›>aϜԦi^ŸÐ«?bô6ÛðÚÆx‰R^6ƒmtiº __ÿ{â6›ñº|^’Ôٰו+ßèºòÍxuw3:¡Ìá¸MoùZ:²å²N—)9,d7Jþ÷5KIêï†Ã¬šÎíþüDÆŒfH†zÓ“·ÉàýÇ‚#dóRR-—ú ÍðÆ´^)2;ÃÛ¿ª:¿Í¼ñåtÊ«uµ7â•C€‘WÚ``·éɃÞþ˜Àèm6áå°ŠbÐzÍÆ¼Ö†Ã)zÄJ gòŽÞ¦™Ö»1¯=畵v½ß(¯¬£©ÛlÁK:V'‹­BÖ¯–™—9ˆæVEÞ©ÛlÈ+‹¨ßëÊß7Þ†WG"ÒÊw^~›¡²“¼z&lâ6[ðöA£[ó=ãÖÚéŸÙ—xÁ ^ð‚¼-ñÖYº^:KWVçmtáU±Ø˜·~´”€ ^å-ð‹-x«ò6Ð÷‚¼àÝïêµtŽÅ»<°¡X˼Oõší'ðnÃk9,Û{jƒ¼þ\zÚyj‹¼q©ÞÚ ¨Gá R+' ‚×?µSÞÕPÁ+òšÏ°fêAxãжrêQxí ïJ ¨ux-Oηà=›9¬–€Z…7gšä®oµoÅpÞ»fjÞ¤µ´À;|Õ¶fj-^#ûòøòG²Ì^>;Xj^?ÏäøfuÆh·ÜÔÆn’€Z‡7LÕûV;idÏ S2ÕP+ñÞïä“}i¬ÈkÁ[׎ðnÝ÷Þ/içÀúÑ m~ãð–è¬mRìÈøCy²ñx ðÎD«¼uP«ñZß”¯QÞ{©Þ*o©¼¿_™Mð:‡ŒÔ_nÍRFžÃèϸºW˜”¯þŒ'ð‚¼à/xÁ[˜·Õ Åî„·~ÌóÚôœ·4oz&¼xÇ2\ÆNÄû3Üä7/ïÚ¼ÑCT6©*Þq^×AH’K~ÀTŽYòâïlç åo•ÍWžãUO•RŸàÚ´Â%E6{±sÄUo^ë²Í¶Þ$}/ù*xgúÞoÞ7ÄK}oµº¼—x%S7‹·Ÿo$Ÿ‚wŽ7 mdÌìÐv>1s´þðNòfMÌx§i²®5™d Þ1^ȋ֋#fà/xÁ ^ð‚·>oáTð£p*xëxÁ ^ð‚÷žx?¶‘w“ßþ[-Þ÷Ä_̦÷§/¢l€¼àE€¼àE€¼àE€¼àxÁ‹/xÁ‹/xÁ‹/xÁ‹/x)o#ÉewOha@ @ ÄX,Zµxà‡µh¬wñfÿü¾ žvÃû¯?DÎÃúõç‚øxÁ ^ð‚¼à/xÁ{OӼߺ÷ÏzùóÝðþà3Ñ×ó>ÎÓŽ÷Ç—?¹ï+Ÿ¡öà|DÞÍy_§y_sx¿}ãïßùóçïÌwÁûE:ˆ/~éÞÝGæy_ùñ'³ÿðȱ=¿roòv7¼Ü¿ýøÒ½]ÍÛ‰v}¿>¾>òOy ­—óx“÷»áuýÁÿîZî¼2ˆ=vÿË{h¼‡åýÑõ—ùz^×5^Ç™ð†BÖGäåAë½¾ï}Sm½?GZïσñþè;ÿ~¯´^7À=žðêÐ6÷ªís'ü-ÞîfÞëÞï­C›'Ú~^äýÆŸ=ï=MÌü«¶ªã½ubæy‡³Ÿ¯'/9pÌ¡Ô1‡Ç³ÅãýáFó/ëðâˆx÷Ä‹ã½à/xÁ ^ð‚·ïï÷¹Ð»øÃZT:à·Ý8!@ 7ÆÿÖ~´S…Æ›kIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_MAGENTA.png0000644000175000017500000000055511665175503015546 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$pIDAThÞíÚ± À0Q;+±;1%3‘Âu¤\EºWüŽ–™™±ô »»{UUUͬ5ã>í©t}}³?1`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,`ûòÆy ¹¹Ô=ϯsr%tEXtcreate-date2009-05-07T00:35:39+02:00!ü¾/%tEXtmodify-date2009-05-07T00:35:39+02:00~MÈtEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_TOP_BCOL.png0000644000175000017500000000055411665175504015733 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p~IDAThÞíÚ± À0 ÄÀ$ðFZA+hlí”Bu VvÞÖgffFDD\úÐÝݽ&SUUÕîI§{vøcÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆÖ\vÏ8ÝTz_¤Yü^Ã%tEXtcreate-date2009-05-07T00:37:57+02:00³YÈ%tEXtmodify-date2009-05-07T00:37:57+02:00ìèjütEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_DARKTOMATO.png0000644000175000017500000000057111665175503016135 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p‹IDAThÞíÚ± €0 Q@ŒM<’`RFÈÞ‰"5ÅU Ò½ ¾®µ÷ÌÌ̈ˆˆMªªªÎ‘©µÞŸgö¤uE\×}³gü‰±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cçxy·üÙcÖ5*½e7¾·Oß%tEXtcreate-date2009-05-07T00:41:44+02:00j>c%tEXtmodify-date2009-05-07T00:41:44+02:005;tEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_CHARTEUSE.png0000644000175000017500000000056211665175503016013 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p„IDAThÞíÚ± €0A@$Ôó-|O¦SÜ÷Dà‰ ÒN§oÍÌÌŒˆˆXô ªªj™Ž£÷ëš=é»"γµmöŒ?1`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,`õòÆ8†ÜƒzŠoë˜%tEXtcreate-date2009-05-07T00:43:54+02:00¢a³¬%tEXtmodify-date2009-05-07T00:43:54+02:00ýÐŘtEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_DARKVIOLET.png0000644000175000017500000000056211665175503016134 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p„IDAThÞíÚ± €0A@$Ôó-|O¦SÜ÷Dà‰ ÒN§oÍÌÌŒˆˆXô ªªj™ŽãºzŸ=é»"Z;ÏmöŒ?1`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,`õòÆ8†Üƒz‘¥%tEXtcreate-date2009-05-07T00:44:28+02:00ØË¸%tEXtmodify-date2009-05-07T00:44:28+02:00Òi½ŒtEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/fontsize.png0000644000175000017500000000652011665175503015750 00000000000000‰PNG  IHDR,9d€Ú pHYs  ÒÝ~ü IDATxÚíÝ1šœ¸Ðé÷õ ¼Ǭ‡Ø;!ôNœšu°†ÞÉå€ùê qωzÜU”¸¨õ#5]×u]÷Ïå~þüùóçÏX1 Ã0 êp¶Wþúõëׯ_W~ð×××××—°æû÷ïß¿W‡óüøñãÇŸ¯ÿøöíÛ·oßæyžçYij`ÂpžålûÊ@d‚€Ð!¡ BB„„&Mš  4A@h‚€Ð!¡ BB„„&Mš  4A@h‚€Ð>kn\ß÷}߯ývÇq_¯yý|å§,ßõþéË×§´ðØ^¼·|»%éû»÷•íª:_Îp߇þ²Ÿ¸‡9xlkk¿]‹=<›¥Ñ,Ë«§={ßuFü´¢aÊ`ýÞç…9ñ³À¥f–Ûõo÷(¼³4Z¬…×Ï«J-´¶^€–F/uÍ >é[r‚°˜Ú®®K ,¦xÆuÄtù×Ó¯ü¹F<ÛG×u]×MÓ4MÓ<Ïó<+ Ï6 Ã0 ¯Ÿ2#\“²PYÏ̦­Ö<Ãð­Ør×s³ ¡ BB„„&Mš  4A@h‚€Ð!¡ BB„„&Mš  4A@h‚€Ð!¡ BB„„&Mš  4A@hŸ57®ïû¾ïS^9Žã8ŽËw-ÿåš¶½bNKRÞ›¾ý½-©§†Û­Êé!{ßÐßµtùÔš«œM–338!ùsÑUª¶ù5t,àz \#Ì¿ÝãzË´†¶»Ñãìö¼nmu{oÕyÛ{*se<ó¹Y&„R7zlÕ³g3Û÷m–Úë²·Û)ÂvÕ9¿¹·ËÙžÓÔ\·²'–Cá^®ž.ý:Ó±«}-£c‚Ú¹wùñ¼åMà<‚ÝÞ}sšüzªÜE^䨼píõËß>õ jx²ð¼‡Fœ:@=~°¶;N÷ÆáÚ^œÑæ½W ï½zå‘M9jǾs'ÿK½Xú躮ëºiš¦išçyžgEàÙ†a†áõ³¥QBóøÄÇ®EYtrdÖ Â? |Ž,“¥QB„„&Mš  4A@h‚€Ð!¡ BB„„&Mš  4A@h‚€Ð!¡ BB„„&Mš  4A@h‚€Ð>ëobß÷}ßï}×8Žã8¾oaùïwíEN¶·s¬VÛ;¶…üö§WéŒmžwsúü5É?Êe·×3#¤˜œ‘~!ç5À^ Ì—žqþøÈöîËÞá¯T­öÎóŽíÝ“*¬U)5/Uçó*`†G‹Ì)ÀðwM%¯¯s —àl‚ð6égÙ­,…å_eTù”O®i‰äÙ!Ülíö“»®Š@¢iìaúùrÍ{ñjár˜K¹&´|W©ZµR±¶*ŸÓ¶µcwM8åŠ^G‹Ì¡:ã›åoψdw¢™»FoÞ—µÙIþ¹¹3î»*v›—í<£…9ÛÔëh‘!4㌘qEáÍj»]>G[Cj=•wS ÜKV¤Ýï )Õæ½`”ýú´*ŸòÍ2e?EBc×ËÛ® Þ¯åz©o¢¹ëmŽ}z •ÏoÕwG—=¾÷ö8ÆŒbÊ~©[ÊÖ®y´¼¶ê (ë£ëº®ë¦iš¦ižçyž€g†a†×Ïf„„îá^ùר,déúÔÌŒ€ÐÌÿÂ9;ú<›!¡ BB„„&Mš  4A@h‚€Ð!¡ BB„„&Mš  4A@h‚€Ð!¡ BB„„&Mš  4A@h‚€Ð!¡ BB„„&í³þ&ö}ß÷}ÎÆqÇqm›ï¿­s߯iç{µ}îG­ì§ßµ_õôºí}ÙÛ”¾Zªz)×­®Ô@ÓkPK’ö‚­œ QUõ¥Æ‚ÐäyÞ¾~!§ò9s‹œ×§ÏKŽíc[½qo°•½åWlo{Œ¤sê,‡°íáom!w{\{ÍC ŽÍíÒ•íß»B²:P¶5Ük­!µ•žéxqAH’ÚfKO½Õ&e†}ÍñœGÒ¼ü!ò®áþzN à -åêÑõ׊ܯXÖÚÕÐ¥:û¤>À5»kÔc-ŠpJý}ry'pʾ´¾ÚÖÑá^ž#¤Rg IéƒãSÄô{eÍˉÃs„Aíærž,<öP|þó‹zã±½(õœå±ÞXª¶Æ Ò™RÑÒåöò]©í×_‡ŽÂ{MΈCW©›e¨N=r#–ˆÀŒ0œük?¥¾z­ì²Ûí‡9½ò™Ò¤³螤¶Ç$D µ„<ıÞÒ«ú€ ¤Ô ñõ\ÃÛ~T|»1‡øô}?cÞf.H\#læÁ[oïãÚMÿ9[8ãˆ\\JÕ§ž^ÒªVŽ5„<ÄÞyj´ÁN}`ÍG×u]×MÓ4MÓ<Ïó<+ Ï6 Ã0 ¯Ÿ]# 4A@h®f9ãÎC×fô"½®dF@hf„Yœw£AëÌMš  4A@h‚€Ð!¡ BB„„&Mš  4A@h‚€Ð!¡ BB„„&Mš  4A@h‚€Ð!¡ BB„„&Mš  4A@h‚€Ð!¡ BB„„öÙJCû¾ïûþ¼íã8ŽcÊ箽²-çí×±-×Öž²}òúO,ûWÐîh¿G{ûÏÙÇh» zÈ1Í!ÔàØ@³|×S‡•§]–Fá/ú…R[SÕë+¦ò¬ixFèü޳¥ ÇÊJÍTžýW°V½c‹íË?¯ng/ƒïݾq2…!üÛ8.lo'ý•¤H¯ävåkžš¹^OÂgÌÞ |)51ov:uAÿQjIjጻúkÜ5 arÏ&ï%á+—( pÇŽŽºqK£°Ê°[›ç]O5¬!PW ¤<|òþ®VöQÖ£á Ì?7ÔáÊÖ“ÖZmÛq˜R:ÿƯŒÀg÷RÌ¡°œ¡ÇÉÙvMöÖö©ßLY‚hFþ³˜÷Þtc9´N¾bÂõ´Äꯠ†:l÷Ãëãð®ÔCR˜BaéC“†+Â{µ=’Á‹Ç'`• zË¡¬„ð‡©ý›Ö÷EO«Ÿ „¿8c86×|v­D`[!•ÊþŽmÁPu¯óêïäƒ5‚*”ý_q>^*˜ ÇwÕ¿l¸²ïq6AHr¾[ä˜í`ά›kêåɇl—Ç'Šu÷ü?rŽ}Ãäy5?»=w-ÿ>£¶ò >÷£È=$!Õ)ûg–¿µ²ÿK^§AwULýYcFH¥ö~WÈÚ»ÎhOúY¶aWý©ßG×u]×MÓ4MÓ<Ïó<+ Ï6 Ã0 ¯Ÿ-š  4A@hn–¹Í•Ï–¹e½Ö˜šámœÿ¢—B ÌMš  4A@h‚€Ð!¡ BB„„&Mš  4A@h‚€Ð!¡ýçÃôû÷ïß¿+ q|t]×uBÓ¿Y&‡%C<<IEND®B`‚xforms-1.2.4/doc/xforms_images/crossbutton.png0000644000175000017500000000547511665175504016505 00000000000000‰PNG  IHDR6¾`Úh¼ pHYs  ÒÝ~ü ïIDATxÚíÝA®¢Xàk§VÀL\Á5¹;ñ8ÔMô´Ò“Ž:&=ï© ®€Ä•Tø+Åêø¢ò<#Ê:"rÏÇË„Åét:No@²?ÿüûïþù-˲,ˬH÷×_üñûï_êÔQZ–eY–V tÙn·Ûí¶žþÍê€! AB‚„( Q¢$D è‹UÀ|,—Ëåri=Lår¹\.ëWb$ÊŒ¸?×´š?Q‡×`$Êì¸?×ý‰O^•‘( Q¢$D È…EpW›Íf³Ù¤´<‡Ã!6ÿØ{k Q˜À=CN¬Âí8œ /EXÂ= Qxh›†”ÿM™Æ"Dá¡¥Œ,»Ú4_7B…[pN&Ð?.l^ýJóì¦3ð„(L ~âù$Dái´çZ'0-! O }W”Â#pN&~é1Ù–´=çSa,BîêÚëoßuïðÏR8œ AB‚„( Qra3UEQÖ0„‘(³“çyžçÖÃ=½¿¿¿¿¿[¼žEUUUUÕÿ(˲,K+ºl·Ûív[O‰@€ ! AB‚üÄå®úo&þÚw7utÔѸßôU¿õs1½S´‹¡Ýé=Ö ÔQ—C˾õ㢓•A×+¯§]Þ u4ÖzЦåpî ]{³ï2å©)ûéýíûßumû®6Bu«#ÍŒBô·yûüüüüü¼ÿ¦$eCÓ<ü•²Yi¾Þ~×µíÓ—9eÃñ,·è»gPGó©£ô¥UG÷7£=ŸÏçóùÛ·oß¾}kž—Ëår¹ÜgùSöjÛ¸Rгù¿)¥xmûá¾~ýúõë×ÇìWuX¯×ëõz÷üRGSÕÑðñ«:º…ÙÎͲ,Ë278lÔêß«½¶}úÜRö¾ï¹‘½V}°ãñx<Õ‘:·ŽÚïmWYúøUÝ‚ ‹fíÚ+ýbWn:Xÿ¨£ô:êšO콌EˆÞ¼´Ò»ø´epíÙôö‡zêH-<;!zWíqØð‘Y×&&åpkú§§·ž²:Š­ýaZBôæÒÝ Ù'M¹°ÿ³RÎ夷u4nõ°œŠß‰N°!xíög¡ŽÆj¯:Ÿ‘( Q¢$D Hˆ@€ ! AB‚„( Q¢äÞ¹W[.—Ëår¬¹=òcrávŠ¢(ŠbÜy~~~~~~Z·Ü“‘èÕ²,˲l¬¹ÕÏs·V™›óù|>ŸÇšÛ~¿ßï÷Ö*÷g$TGiY–eYÆæ0<>Sž&è)<²:Jw»Ýn·«ûsz­ÛWUUU•:b*F¢OïÐ!}Ñ¥ë½̸~ö¨ïßÓm]·_­V«ÕJ1!ú²ì;ó|}u±x{ë‹Òf|Öí‡DÕCÑÙéßÿÝ4´ÛwMwÍ¡=·®%IiÏkëÒv|Noꈚ}Yמajj¾+eº]ÌéÄšË9Ö4žW_”NŸêˆ~.,zz]E2Õ~zûsëWÒ—³¿=sð³üˆÒ··ÛƧ:"Fˆ>½®"² Ój>ëé:VoÑ«Õ1ç¾,û¡<£¾ƒ·¿ºìHqBxýç>§Rè"D_VÊÕƒéí‡|®©}æWç>ÛQ:ÖïDÕ1Ήr‹ûŽ[äý—´¯Ly%åõöR9«D—Óét:>>>>‹z:½ýX¿UGÄü_r»ÇWßfïx<Ç!ßt½^¯×ë<Ïó<¾TÍÛžéŽsîWsû¾ã>Èaøm8QG×.m=m$zµú<Öó"5·ý~¿ßï­Uæ&˲,ËÆšÛv»Ýn·Ö*÷g$TGén·Ûív›Íf³Ù‡ÃáòÞº}UUUU Y†z>ýmÒ— Ҳ,˲ŒÍax|ª#†0äGù}ÿžVŠÍö«ÕjµZ _†C‡ô ĵ—!ó„Ç¤Žˆ¢#ÞÛÛbñöÖ¥Íø¬Û‰¦- Ž¸!:b™ýw”¶ãsÚ²ìßÿÝ4´ÛwMwÍ¡=·®%IiCQ¢£éŽÒiâóÚ3µÿõ]R§ÛÅœ~@¬¹œc@u¤ŽîÃ…E#«»ïf³XÜ+>»Šdªñnûs¬“ÔåìoêH=!z£RüŸ?F¥‹EtöÚbk.‰3: Ž¸‡sGÓ}ðö×—Ýn£`?Ô·#DGÐîsÚ(àv„è é—µ£t¬ß‰þjÙRÿw¬h¿ÝœaºWGü7çD9N§Óéãc±øø¨§ÓÛõ;ÑþÒê¿Ü }`Ê+)¯·—ÊY%ºÜâ~ÔêˆûX47åCn¾õøêÛƒÇãñ8䛎{ãìá·=ã5úÕܾïz½^¯×yžçy>|©š·áÔ'ÕÑ}–¶ž6½Ú¸Ï‹ðô æ©ÞPŽõü"ÏAb*Ή@€ ! AB‚„( Q¢$D Hˆ@€ ! AB‚„( Q¢äy¢W÷¡Üž'Ê<EQŸóôTQîÏHôjY–eY6ÖÜšOH‡ù8ŸÏçóy¬¹í÷ûý~o­rF¢Au”–eY–elÃãs³Ùl6›þ6‡Ãáp8ø{ñ˜ê(Ýív»Ý®îÏé=¶n_UUUUꈩ‰>½C‡ô D—®÷™'tõ¨ïßS{W³ýjµZ­VꈩÑ—eß™çê«‹ÅÛÛÛ[”6ã³n?|$ªŽBˆÎNÿþ說ݾkºkí¹u-IJ{^[”¶ãsÚxSGÔ„è˺ö SSó])ÓíbN? Ö\α ñ¼º¢tªøTGôsaÑÓë*’©öÓÛŸ[¿’¾œý홃Qz¿øTGÄѧ×UäCö aZíÑçé[õjuDŒÃ¹/Ë~(ϨëàmÊeGêˆû¢ÀCè?÷9m”B!ú²R®Lo?äsmìHé3)ç>ÛQ:ÖïDÕ1Ήr‹ûŽ[äý—´¯Ly%åõöR9«D—Óét:‹z:½ýX¿UGÄ,š]pÈMì_}›½ãñx<‡|Óõz½^¯ó<Ïó|øR5o{¦;ι_ÍíûŽû ‡á·áD]»´õ´‘èÕê?ðXÏ‹ðÜ æiÜçySqN‚„( Q¢$D Hˆ@€ ! AB‚„( Q¢$D Hˆ@€ ! AB‚„( Q¢$D Hˆ@€ ! AB‚„(}™ç×.Š¢( ~PG0Ä¢ªªªªê”eY–å«~Õår¹\.ýɹ…,˲,{í RG¨£Úv»Ýn·õôŒF¢—Ëår¹è¦è]¾)z×Xœ€ ! AB‚„( Q¢$D Hˆ@€ ! AB‚„( Q¢$D Hˆ@€ ! AB‚„( QúÒüGQEQX)â#Ñ<Ïó<·: ßûûûûû{=ý/ƒP¨?ÚÏIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_DARKORANGE.png0000644000175000017500000000056211665175503016105 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p„IDAThÞíÚ± €0A@$Ôó-|O¦SÜ÷Dà‰ ÒN§oÍÌÌŒˆˆXô ªªj™z?Žëš=é»Î3¢µmöŒ?1`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,`õòÆ8†Ü†Š®Gœ%tEXtcreate-date2009-05-07T00:42:55+02:00ëÔÓ&%tEXtmodify-date2009-05-07T00:42:55+02:00´e¥tEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_WHEAT.png0000644000175000017500000000056511665175503015343 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p‡IDAThÞíÚ1 €@у 嬅t%(ÏØz¢ &a* ™§àgê¿dffFDD4ݨªªÚ®LÇ1FïoOú®}Ÿ³µõíb,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀXÀâ1ä‰ëra8çÖuí%tEXtcreate-date2009-05-07T00:42:18+02:00I¼%tEXtmodify-date2009-05-07T00:42:18+02:00QøÊ(tEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/labelframe.png0000644000175000017500000000337611665175503016207 00000000000000‰PNG  IHDR@´:¾ pHYs  ÒÝ~ü°IDATxÚíÜ=’ªÜÐ{nõ˜a£C;u¦„΄Ã='Ðc¸7°ÊÒB6¬•|}”ß×7à÷¯®ëº®ÿÌèãòŸ¶mÛ¶U˜Ú~¿ßï÷ÿપªªêû¾ï{¥€)4MÓ4Íåïÿ*ÌO@€€ 0`À € @@€€ 0`À € @@€€ >”àY»Ýn·Û]þ>N§Ói}k|¼Þëׇ˜s›uà’; ¸f „í®¨ÛaÌ(ÆO>5à58àñ7ý!'ÇÛ%¼6×ðy§Ø÷Ëz_»Ð}»Í—|;ï³5œ®zã—Ÿ§Xò³—û†,áñåÖ×Ö2{Õ˜¢JÃß¿zc>Ó1óN·¿÷¶ê];‡Ã¡¬sÓ¹œ±??????û¾ïû¾”-/òpUUUU•Uèkkº7ݽ:—+¹gº¯È”¨iš¦i~~~~~~ÊÚraÍêµ ¡ïRʃ-Ù*•^=û ¥ðVÌ».„¤{ó.ùW˜Ë‰éª7ÅgšÝß; æg<Êkwé†Ïûìz‡Ü\‘Þ[áéLW½÷.y [õ®=ò3$¶ÃxVÃ;zöä5æ±£¥ìÆWiží_½ñK~­¦Ûª×Þ·lÓ¿º®ëº¾Ü¾^þcM×7ÛË} ²ü¿ Y“²rá²µ—¿€ @Æx –CÃF¹ø Yž‚† º°FÀ € @@€€ 0`À € @@€€ 0`À € @@€€ 0`À € @@€€ J0¦iš¦QnÇãñ¨'Ñ“[#€gÕ¶mÛ¶êÀÅ~¿ßï÷z=¹MxVUUUUÕ÷}ß÷ª±eË}êI–Ö“Ûá0`À € @@€€ 0`À € @@€€ >” t»Ýn·Û ™òt:N'^UÓ“K«¡Š­‰°CúmK~¼ü!Ó¬»JèÉñ5ÑŸkb¼*÷¾_´Æv÷*ƒž\Z7^×DÅÖGoÂå@½6ׯ9]Þ;)Ü;5 ™æÞºn÷bȶ¹|§'KïÉÛ×/‡¹½ ¥´ã/¾=»„Ó Ý¢'³=Év¯Êƒù½1sû­|È7÷ÛiÞ{ñmÈòÑ“KëÉÇKÐÃëcÌâÜ;]¾6/”Þ“ÏF5¥0^ùiâööøz²¢wÝŒ€7ÁA‹ž,‹èݼуyžyßµFw¿ôävzRôn‡KЫ2þ—ñ§•!—o§¹}(ÆO‰ôäÖzrȲ kb¼!ÃqøìA>Ï4N7zRO²&FÀÅ{×) ”SÞÔËtJÕ“©žÔ{[c 0`À € @@€€ 0`À € @@€€€%˜_×u]שz¶LÏêëëëëëKГ€žÉñx<ꀞ.Ü€ 0`À € @@€€ 0`À € @@€€ 0`À € @@€€ 0|”»é]×u]ç# D…pÛ¶mÛþýýýýý‡Ãáà# D…ðù|>ŸÏ>6®•˜î@€€ 0`À € @@€€ 0`À € @@€€ 0`À € @@€€€ët]×u¢ÀÔþÕu]×µBÀœþ†ÏÚejИ»IEND®B`‚xforms-1.2.4/doc/xforms_images/FL_GREEN.png0000644000175000017500000000055411665175503015331 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p~IDAThÞíÚ± À0Qœ•X˜’™œÂu¤\EºWüŽ–UUU•™™z033ÝÝÝ{G¸O{*]_ßìOŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ X>†¼qCnž@t ªx7%tEXtcreate-date2009-05-07T00:34:40+02:00Qc™Û%tEXtmodify-date2009-05-07T00:34:40+02:00ÒïïtEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_BLUE.png0000644000175000017500000000055411665175503015220 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p~IDAThÞíÚ± À0Qœ•X˜’™œÂu¤\EºWüŽ–UUU•™™z033ÝÝÝ{»O{*]_ßìOŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ X>†¼qCnÞñt×%tEXtcreate-date2009-05-07T00:34:09+02:00@±Òò%tEXtmodify-date2009-05-07T00:34:09+02:00¤ÆtEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_COL1.png0000644000175000017500000000055311665175503015166 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p}IDAThÞíÚ± À0 ÄÀ$ðF4Ö×N)T§`eàMð`ýwUUUDDÄ¥ÝÝÝk2effîžtºg÷€?1`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,`Íåa÷ŒÓM¥U¥ê¾c¬*%tEXtcreate-date2009-05-07T00:14:15+02:00×Ù%tEXtmodify-date2009-05-07T00:14:15+02:00LfwítEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/fdesign.png0000664000175000017500000001015212236445727015527 00000000000000‰PNG  IHDR Q y#ÌPLTE­­­ÌÌÌÞÞÞÿYYY)))ÿÿÿÿÿp(+­bKGDaˆë pHYs  ÒÝ~üèIDATxÚíÍnã8€ÙvÎ;óA³ç~j¡û2}ÎöaæÞÆ/`û±WõCŠú£DI¶)ŠtâÄ’"[_ŠÅªR±¨TiMûô[iÿRŸ‹ 4í¨ž.MÛÛ_ý_ÏJár S‡.¯‘gË’ÂÓJ `”ÑÃý´#Ð4̾ž€Îlö§€:àéõÒ|]wûD¯š§æÀ§Ëk³÷ %·^†„}À1 3Ÿ\5‡ð >3Ëžu)ÔD´u¡ðD|š§æ@ÒôD[g(¨x föMßzö´Kþb … ‹]°ýò(\øé‰(Ðï¯n뫚“…¾üûÒÚèFü{ûù•êOÑï"BAöSïÀ£Í(¬¥’`)\_§ûêSýÞÞ¦0ø?ûßA±Fñ×ýÏNÿÇæ8ÃŒáÄ› Ÿ^„ …;>M¨%–êé= ´uV;š¾°ò–º‚1 ´U{‡ )ð~Óþ:ÖE–¶Cêu¬òìË‚Z  Fž&)0¥8 j’‚ÈkÖJúC<…ÁÀ8KA© xú8 #H;( ÆxõµãÓ¥«"çeAEP1"DÁ" *ŽÂ†ÎHÙ¡ÀôS«œ6¸ÈÖ½{îÑq&ô‚wX—†ŽÕÔ§À?Åkk59[jÓ1JðűH DZšŽ‹õBd»„w/·F)ààOׄC\3ª í±ºö‚³Æ`¹1b/ —YÇboo*ô™Mð/,e팰³ŒÂ岈‚†9¯ÉÔ=l¸EÿÑ s ¹NoȧÔdayÝS)§˜ @¥xÚéÈÂ,mŸŒtNzíý Âο$‹DéŽ@m¥ Ωñ4èß°ÓR@ee쨆6qs”:ÐmnOáv’¤8b:Œ\ªíÅÃàõ: „ŠÿFãŠ5«ºÐÀ”ѯŸ(à/F_Þž¾,•ôWµg³ÐÕòã(ðè+ÛÕáeÁï¢ý| ºCÁZ8†¶t¶˜‚§Ñ/#,ëÀv†s7ÈÕkÚèv{ú=b^uꛜúóŸÇiÿ‘ï½Û·ãHBi¥•VZi¥=¨} äû`›Îºßg }†O[“š¨M[Ïôü2¹ÿýnBŸa£õû\( …B–‚ òSX7æC!(?’У`‰M>…±Xؽ)Hü¹dØ™ÝBÓYhèŒ) ï`œ•ÞÔʈì(p¢‘»£û q4ígØ•ÇjÈc”îð‚¸¡€ÉÚ}ÄQð3ª §Ø<Œ‚$ï†~Ÿ‚;R Ól ;HO¢á±zA‰i øSTÿnŸ^á¼,(‰ú?‚ê$wŒRP«),‘þócSP! ¸ÇˆÚ™îékÇ´š¥@#å)ÛOð 3#¥&wZ;öv>OùÚ;ħ0l÷¦à5Ó~†XYèØÇ= ÖO/å$5?¢ÍÚBÁ¨yYðsʲ”…¾«”¥g](,£ÐéÙ™R¶¸(ËÉ)Lf7|§ýLî¿…Ðg؇ÂÑ[¡P((tf¡s" vRR4…%¹æ§PPñþ{èb"/-…Æø×”/d±Ž™¬„^©ä~: ?ŽÜž= ý ù¿ ÀN³00ÁÁUz¨L)Øiz.³ê(È‰ßæJA;‘ç@Q¯GHðZ+m§¶fÚ#:²`CbC ªõ,ó£`úô‚Ö¹S°ÚÑLkG7õ5g½ e ˜)ÙžÈX&Ú2?¢Pˆ¦ `×˃)0&i ;ÿ/'˜·çÕg¤`T¯ Áq(°7bèζ)ñr댖»|çŒ@à³sÕž©7zñFhxÖÛ¤ƒ)Ðà.I4ö 䮬vîÏø=L;ZoDü3µ‚QÚ¦ 8ÃÏKg™!kB="øÚù}½,xöéŠæBC—°áCêÁ{Ĺ¯Û((؉‚QªCAÛ³[sÓ  ÛF #mß@¦T»ô•”^°ÚÑ%Åm£\;ãhÚ‘>:¨ô‚ØŽÞHI‚Ï#¥TGÊ[µµU(dGaµÙ1 0Loí美gúååY;‡™~…‚¢xü(¨ èw¸¡Ø´/{žq% ð÷õÆí…Þt3ý|§OüyJ;šn©î^î«V)P¨®5=ä>pS$…/“æd! ÀZPC<…?ÖSèDNE¡¹æ+T ¨ðÑ@¨ðG$…—o 3cD¢z¡Š;ÓOÌk+—P˜´ó¢ð2IaØbüˆR@MMA}ËŒBlûùŽW](|E3ôðêÈ"?=…€­7÷úŒÎ¤GŸŠ5ŽÍ¯=CD5LÌQPéS¨ñÊ] §iTuµ* -ñvœOA÷דz¬Oy­ª+ÀGe9MSðn!·3"} ²; ¨ ™AÓ;ö¢ ¡$ ,¶k t{„NTàº#-7tTë?w{DZ²p“aó_)ñQöˆDd\xÅ1 ñb . bœ‚I¦G€ °ÔPSœ©‚FJ­¤‡-Ζ ëÌ} Œ”ÚäNá@~D¡À¶ã°ÅG_. Û[¡…ºP@5Ðn­ÎK¡ÞÂ^¹¯w£`ƒ*e©¡ZC²V= »å¾Þ9ÍYÔ+eÏõ|h{áÊ.$ß±?1v'k(¨O çî6´„9,‡œÎHãï>ÕëÌÈ LØé–çZV÷õ€~Dˆ‚ê'U'™Ý•…" '¢Êkê.5+ÖŒ“Ú±·ìxƲ ÒÏ}ÅV¹­Õy)´·éë›PÐEŽA#,äQòo+Â,ó="˜ûš„íXu+LèL¢,tí5ÿV­¢ðõëËá=kG¡ŽŽ¡ð×_ï9Q8©gݧpN½Ð׎+ÆÊ^Ð ÆûN`¤ä/þQà “zá(¶·P˜£ ò§€%\¤\ƒi'¶$/Öx†Ó¡)ŒëWÓU ¼ö(pjW§ìë±)Œëhkƌʂ¤ùùÓk3í~iÓI mŒ:Gí¨Í2 ™-­ÏJÁÖz¶^G)d¤ƒz¡-ð:B!§‘òð~D¡P(…þÚÚŠ,”Q( K(.÷õŽ—ûZzD¡P(x~mnÿûùŽK~?=úć¦ðV(<_?,…·_· pŒÜ×_·¦`#*£T"¹,¿Þà­‘ø€7€_ð 7ìNA«Ä)@#($ ͯ 8K¿Ñ]c sv «MhG“Šv¼½,hUzÄ(°v„···úõLòppü€!>h°Œ*³ pc?b–BÚ±xS…B¡àQØ¡ ÙR¨VTÅÎŽBÝÖù\¸‚Bæ²p" çASuK,„[Ùº¯X¤`Á<¢I `Œ+ýªÝìÑʽð° fµ¤Â×\ý–yTv& gLQðW¥J¸Æ§Ðæuù<²Ö§\qe§ µ¯Û+(Ø´VYëQu(xi€Þ…B¡0Aá·[·CP¸Oã*—R¹¢+w›×UíTçZí¨ÜrŸžväÕ?ÍÈ¢`'ÕÖTò‡H;ѶvuœhÇÊ‘RÉrŸ‘_*Î{íð(YØÞV“ißJZMýò£ ;‹^P9`€t)t?ܘ, XE6®_ºg½¬™ëWgAAn‚]ËÙôWA<pëz³_b¶Q¨¤FôâhKhÆf;_OÇé‰Ñ( _ÿòhË ë¾.–Ý£°¹GØÕ#G[†6©ª](D­E=e!çay´eHa· àˆ1¢G!N/ŒEYÈ·XmyøH ØŒ²a›5Úqħä%[û–§ p `ÃFX㚬)G(XÝp ƒ©Š&(Ô…Â9)ô£,l1,¶¤FAÅS‹²PÜåÑ–Ù à‰ f¼’µé¸–YFY‚Õì8“ÅtvŸ”‚ RøóÖíÛ(ü}½q{)îH“|͸v4'’uYð€*¾V|&#…v¡º]É™W½ÇÐJåyΛ‚[c¨råo1”‚‘'ê4XÖpK ™Ôô+B4OÕtÓ¤WñÔÈ"×Í>ojiŽ$soõ(Hft¹=9R0Ê+üÚ«õiÄÅ ¹Î•8#\‚‰Jaº:™ST¿å\ Í%rõÃGJk ðs½/ÝR0C r= ×OncbYªÛ´Š$µ£ûç3…zO ÞH9Èwä‘gÊH GÔe²Ôñ!–ë«©[}Àõˆ¤,hÊç¢Ì q!–Å q ½œ8‡r)…6ÛꬎàS:çúôЗ>=Ž2])ªbÉ„‡X$ÐÂQ•˜Ëõ¦Àw£€­^·õ$…cV¿Ý›Â1çÜ×Õªå93£@Ym…¦V(äIA’}ÏMA\K7rT§¤Ð‘…3QàÉ@uÝ:;沸TgÏ‘ŽÉƒ¾¹K Ue³¾÷Ìe±©Î Æ(ÈÎòšj/ A†ïÜ·µo§($’ÝE.Ôõ‘T ™~õã)èôÂ-)¸:ÈãÚq°óQªÚ.ñÞÕŽ»ä²,“…Çç/àéÒWä·ýrY–Q0™ûKLjB¡P` Þ$’âY …B ªëhº:…š)ô9ÄTÀÍEF¤a? úÐd¤X WåŠ6ÄTÀ]JAOQHÀvJé"SY 5ETÀÍ{‘âMÕ{ªcê}NÖôÅEÅ8ÝÙˆmÔY]ÇèîܲD( ôïDÁØjž¶˜ç@¤æg‚²Pí& `3_9Ás¤GðÆ)ìÚ#ÐEhdʬ%M$úî•kЍ€;©©ÄËAêd^-^1>UQpyÐ>=FA'Ba¤UqgÚ¦›#2¡@¹8³#¥¤¿vGJª†l² ðUå·’s ±ðªßK|á¥P Ïä¸õ‹ Ÿs¥°<£…(¼çw¬c(¨—ƒS( GV®à µ,ÏhA ÿ>xÜ‘C*|V¼Š3-ÏhA Ï%Ž5m¡pŸue>íq¦ßå‡G᮵ÁÓk¨ ^( g ðçÛ÷—°j\puŸÑáöCOi¥•VZi7j_v«ý½öL{T&¾ûÌNlÏûÀ|Y}¦ÆìyßúîŸCï>·³P( …B¡P( …B¡P( …B¡P( …B¡P(ö¤ði·›D+Ïôû÷Ç~½ûÜÎÒJ+­´ÒFÛÿ–®­@Á“IEND®B`‚xforms-1.2.4/doc/xforms_images/folders.png0000644000175000017500000001300411665175503015540 00000000000000‰PNG  IHDRÍ#ùû pHYs  ÒÝ~ü¶IDATxÚíÝ=²âVÞàjlÖáÌö*n!7tä%‚3ª¼ˆž‚hœ1¥Ì[ð¨ßÝQ£ ‰ó×yžè6 ú8â§Ã‘ôùÛ·oß¾}û¡,—Ëårù¢(Š¢PÄòÓO?ýôÓO_ªT¡öt:N'E@Ê6›Íf³©þþ‡â .q€ÀÄYgLœ 0q€ÀÄYgLœ °/c®l6›Íf3…ž¦²,˲T›ê ­µÌÐõB¿F],‹ÅBq§o_£6ÕZj™~ë…! >:[ïNEQEq:N§“¢Ò-W«ÕjµR›ê ­µÌ3õÂpmžêNé»ÕñÔ¦úB«@-óX½0´‘&èNS¢6ÕZjÒáÎ&Θ8 @`ÉÅÙeÓ®’{÷·{™¼¶ôÒ©Ç~×>úºw]Ïl›^·ß»wCom¬cZúµ<¾9íÞÇ-_ÒܬÃáp8Ú›é­÷tiŽÍÏ>³Ì~"·¶­½dR>¬Ü»_}ÕÅpu:Õúšž1ûõ´[…6¯RîËê…`“ ¦Ýoí]_{ýªÒz¿^USª¯j]ÝG2|%äÖ‹§Ý—Õ²Þ§^¢Kttö^ÝÏÛšï¯ÿoûØm—Æ}kÉ]Þߥ#Ý»§CŒzwê«.Ú—óü’s®¯ö>Ø¥<ÖoÕïÐm©½_w©åè­âÞ½ëÞBº—À½ÇÏ{—ð̺¦Ý÷ŸùF{þ°ý»Û1™º`£³Ï4¦ú§ºüÝl܇šöCa};»¼¿ß’gÝ˼û¦¾ê¢}9퇰qÊ0ÍúêÒª_[z}µ~ûu­bœýz¾-u_Âø½>n-ß»Íýîã½Çs½/O‰ÆÙ[¥óÓRû–Üûþñ·püÒ»7Ú¶/gˆ=½µä!J2Íúzlnèzn]Ï÷ë|zñ˜ûõ|9<ÓJÕr 5˜þ>’š—‚idquKkç\9M)߇´%˜¶`sgï©F”Úìòþî×®Òo/ëëšâçi ÑÚ•Dç1 /6í+ʇˆã—À­K¦W_Qê%Í˧Ú*îÝ»”÷å™-Ô÷§Ñ>ÕËT…¼¬ûÿöuxnÉ]–ùØI:_-ÏìWʵ<ÕúªÜûKÈó{Ô} }•Þµ0íVÑo_N¹-åÜ÷ǯÁáz´zÉG¢“ ڛѭ)ÛÍÃPûuê¯ty½ûfîÕ~å½· b Çܯ{ë¢ùz{¶¯±ËvNµ¾ž©åîõòØ[טýzÚ­âù½{¦-=V†íKxl]úþ½õØåXúÌw·z¡òùr¹\.—ê§Óét:õµèÅb±X,†X2é>Ò¶ßï÷û}õ÷jµZ­VjS}¡U –ûÚòÜêE«Âf³Ùl6ÕßæÎØDž Æ-Ý õ…VZF½D!ÎNœî§¾Ð*PËöÂM›É6à¥`³Ùl6›)b_QEQ ѯ‰¢~1ÊÛÛÛÛÛ›2RS–eY–}v¤KÁê_¨PW¤Ï|îljÁ˜ž9ßeê·Ò€Ôôd+æÎ˜8 @`â,‰³&Θ8 @`â,‰³&Θ8 @`â,}QTf³Ùl6Ky ˲,ËRMuFgø®(Š¢(RÞÂÍf³ÙlÔPgt€ªP{:N§S:[%È’›ý~¿ßïÇY×jµZ­VqËJœ gí_ÃÑ¿8açóù|>Ïçóù|>ÜZÞßßßßßS;}½—8›©år¹\.믇Ãáð̧šÿ{ïòi¨¾†›¯Çãñý‹ÆïMÛív»Ýö»äÅb±X,¦QJâlvªÐÙ —·^ïþ©öÏ*yNO×ëõz½®^Éç—q–µGä¾–¯œ¡/—Ëår¹¤¿)ô}¿8A:ÄY:©Üݧ( d€Ê­iÕ,öÆhݨ‹Nš“ n\àUò¼ÔRœ¥gÆe`õqÙœ/²4Ù€À„fÐ÷¦jŒv_3íQ[q6;ÝgÁ6'/èâùçxMuŒVœàƒúS…ÒQ=¹þÖãsAßÌ™8 ÀwÕ—)ÜäyOMЃډ³8»ÅcLœ ° N6hÞê¿â~¨Óct€ÀÄYgLœ 0q€ÀÄYgLœ 0q€ÀÄYgLœ 0q€ÀÄYgLœ 0q€À¾(ò±ßï÷û½rÈÁjµZ­VÊ!FgÈÈù|>ŸÏÊaÚÞßßßßß•C>ŒÎ*Ôn·Ûív«4¦d±X, 壳@'¿ü²\.—ÊÔˆ³&Θ8 @`.Ãmk $7!¨Åmk 7!¨3:ËwU¨Ýív»ÝnªûX–eY–ꚸ܄ Iœåƒ¢(Š¢øí·ß~ûë¯éíÝüñÇfãN“0%&˜8 @`â,‰³&Θ8 @`â,‰³&Θ8 @`r @Ö~ùe¹\.•Côûý÷ÃápP;ygÈšÔ]d•©1Ù€ÀÄYgÌÜY~௿þúë·ß”>q–®×ëõz}{{{{{S@úÄY>ív»Ýn§ }Õ gQEQ( €Š8˧²,˲T ÏDäR0gLœ 0q€ÀÄYgLœ 0q€ÀÄYóT0€f³Ùl6{~9Ó{² ÑY3: @QEQœN§ÓéôØ6›Íf³Ùn·ÛívJ%ct–ëë§ OFgĽ!µûû§7ãx†8Kî ¯_¿~ýúõkóõÝn·Ûíî]—€ 9gyP{„},b¶êÖ믋¶q–; a»k.¿¹=¢-ä&Xœíò£ö·oß¾}ûvï’EŸÇJþµåV_û­h«f`Ú‚ÝÙ ºEÅK®n]¡A4Ýš«šZL¼µUîœÓr²Áó÷]«d›¢_nUmm}/LB`‹Åb±PuæÎòÁ”îpk*Â~¿ßï÷«ÕjµZ©qbùùçŸþùgåP'ÎòÝ´o€UíKd«W„Z"zæ™^SýEÚSÁø©þ/¼Àô%»y¥U¨Ý׈¹Daîl“8›5HU„Z¢0w¶IœÍ”ÛWÕÇh«W„ZÒgîlSà8["<#çqÙf¨b gÏçóù|þ׿þüóÏ?[¿ÿ}¹\.¹ Ú§0.ûÌ™åÐŒÑ2sg›L6Èš TŒÑ…¹³MâlFÌ—íÎ-i2w¶)pœÝív»ÝîŸÿ|| E‘og0.Û4Îí˜'͇ý޳Æ)s¿½½½½½M»¾ô} ºÀqöù±C9ã+Š¢(Šëõz½^‡^Wu~<Çã˜k¬þžÏçóùõ¢jÍ…KœàDXr ÚNƒ8 Àw",9mãgø´ßï÷û}õ÷jµZ­VÊ„œU¶Þ/H™8 À‡+Ú’3í?"q€D[r£G'Îp“hËTiÏS"ÎòƒŽ Œ/ý/Ôf´u‰ ±¬×ëõz¥ÇÑÇ(ðÝù|>ŸÏÓØ—÷÷÷÷÷÷)íÓVµØXÛ, <¦zÔjó4àÞ×y¦Ýj½Óct–ª÷ÐY=ÀpJ{4´ážðä6OµØñùeFIª¢g!kEQEQõ»äê®N$RVÿáõyóù|>Ÿ×É'@¤¼§U½äæ†nç¤@œÈNu3ÄO®Õ2‡[>¤ÐµíÔ˜; |Pýü]"Îc¯À8ŒÎò år¹\.믇Ãápï§šŸ}lÉ@žÄYîVÅÍfļõzÓ­÷<¿d 7â,@Ïß‹fª÷œ1w–XÖ( Úׯ_¿~ý:Õ½3:˨L$€ÇT·V¬þ~ì‹S½…¢ÑY€`º?„%‡;ψ³ŒÄÔxÆó¼™ê£mL6ànÕÄ€.·ÓªO$èò©îK€ŸÏç}-íóår¹\.Õ?ªÇ£)bR¶Ùl6›Mõ·¹³&Θ8 @`â,‰³&Θ8 @`â, øÛÙl6›ÍñøÊ²,ËRù¿¶üõ#õ¨6S«MåŸO_#7ÆÙ¢(Š¢¸^¯×ëUA©zNÆñx<ÊÿUå¿Ýn·Û­~¤Õf:µé¨˜O_kr2ó*㜮|zÕáÛãsÇ<((ÿtÊ_?Rj3µÚTþùôµf½;™yU-}ºò%N<ÎÉ̘Æ<]q)‰³&Θ8 @`¹l¹\.—ËÃáp8î}g÷Ï>öþi«J£þÊ­’QncÖÂ-ý–¿ÚϧÿæÖk¢—ƒ§EåÆ xªÓ6»hûÿ2œöÒ^Ö‡xÿpåÜW]ëÅõ¨fKpDTœ]vÐ}iÍÎÙ~ȸ÷ýÑ5ƒ~—Vª¯jÿý–³Ú×ÕH÷ÒhˆgÚÿ½eÞe8¦Lûªkmf¸²rD­›Ôdƒîw6bí9Ÿkv9wzíý –Oûoß÷gZ¯ÚϧÿQ{¦4b•^_[«ÍL¯NÓdîlo|MÖËÁ!,åzî]íO»ÿ:Ê=V±NúÝÚöRÚl6›ÍF[J­ÅFdî,wK?¬´O“Gí«Aåpo[z~i}-ç±ìrÙ[Ëp-Š:qöŽCFûAäÖû§úåÑå¸1káÖèc÷£µöî­WíçÙó9ÊuÙ£ç{Íc¥ýÚcÂÐÇ–Üzܘ5>íº0Ùàn]Ñ~SŒ[Íbz_¢]®|®¦Zª©µö[å¬öó쿵“ôoÿØ´ŠgJãÖwJó*õ.Ë¿·œ»œà=³µõwvÙ‹éM6§E9¢6}¾\.—Ë¥úÇét:N}-z±X,‹!–Ì-õCÃñx<ÊÿUå¿Ýn·Û­~¤Õf:µé¨˜O_Óûr¨ßúòÃÎöuE6Õ¶rÖþ`8á㬯d¥­F”9s)‰³æÎ@Föûý~¿WS2RœÕtt]Ô#jSùóZëõz½^+‡qÌçóù|~>ŸÏçóÐë<Îj:¯m:Ê]W=N£Õf µ©üóékuÕ͹V«ÕjµRòc§Ì¼ï, ¡~ßY—‚˜8 @`â,‰³&Θ8 @`â,‰³&Θ8 @`â,‰³ö¥þý~¿ßï Q|]¯×ëõZq¾ù|>ŸÏ«¿ÿžÓwäëŠbºIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_DARKGOLD.png0000644000175000017500000000056611665175504015664 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$pˆIDAThÞíÚ1 €@Ñ… ka5àâÔ k=Q\M1ÕA2OÁÏÔ«ªªÊÌÌ ½èîî>f¦ë:Ïû^=éÛÆØWOøcÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŽyyˆˆcõ˜ïš•8úh_lŒk%tEXtcreate-date2009-05-07T00:39:20+02:00bòì%tEXtmodify-date2009-05-07T00:39:20+02:00=CmØtEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_SLATEBLUE.png0000644000175000017500000000056011665175503016006 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p‚IDAThÞíÚ± €0 Q@ÙÈ+¸Ïä^ÈEj® H÷&ø:¹ô™™™qèAUUÕX™º»çÜ=é»Ö)]»gü‰±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cc½<øònUº¢ĦóÕù%tEXtcreate-date2009-05-07T00:31:47+02:00ríl%tEXtmodify-date2009-05-07T00:31:47+02:00-\%tEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_RED.png0000644000175000017500000000055411665175504015104 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p~IDAThÞíÚ± À0Qœ•X˜’™œÂu¤\EºWüŽ–UUU•™™z033ÝÝÝ{GD¸O{*]_ßìOŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ X>†¼qCn]t–A%tEXtcreate-date2009-05-07T00:33:06+02:00T%¹b%tEXtmodify-date2009-05-07T00:33:06+02:00 ”ÏVtEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_INACTIVE.png0000644000175000017500000000055411665175504015674 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p~IDAThÞíÚ± €@ A@ß‘[pû®Ç)c6zv*8m|gfffDDÄ¡UUUk2uwwïžô]SéÚ=ãOŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ Xsyðòn*Ý-åÔJá¡¡%tEXtcreate-date2009-05-07T00:37:20+02:00|;+_%tEXtmodify-date2009-05-07T00:37:20+02:00#Š]ktEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_WHITE.png0000644000175000017500000000055011665175504015346 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$pzIDAThÞíÚ± À0 Ä@;+ií¤)5SR¸¶VAÞüögfffDDÄÐFww÷¨ªªºu´*]_oö'ÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒL!o¬cÈÓö3ìœåß%tEXtcreate-date2009-05-07T00:21:03+02:00Ãf™8%tEXtmodify-date2009-05-07T00:21:03+02:00œ×ï tEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_SPRINGGREEN.png0000644000175000017500000000056211665175504016254 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p„IDAThÞíÚ± €0A@$Ôó-|O¦SÜ÷Dà‰ ÒN§oÍÌÌŒˆˆXô ªªj™®«÷ã˜=é»Z;ψmöŒ?1`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,`õòÆ8†Ü‰š÷ý %tEXtcreate-date2009-05-07T00:45:01+02:00µ§â(%tEXtmodify-date2009-05-07T00:45:01+02:00ê”tEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/pushme.png0000664000175000017500000000200512201253100015355 00000000000000‰PNG  IHDRæ Ç™[Þ pHYs  ÒÝ~ü·IDATxÚíÝAr¢@†ÑÉTNÀ-ú,.Ys“^r¶¸ô}¥Y8 « ”5á½M- ‘|b—U~”RJ)ø<ÿ™¦iš&‡àQ†a†ád»®ëº®µÖZsh¶¨µÖZÏ·ÿ:9" $²A" $²A" $²A" $²A" $²A" $²A" $²A" $²A" $²A" $²A" $²A" $²A" $²A" $²A" $²A" $²A" $²A" $²A" $²A" $²A" $²A" $²A" $²AŸ{p­µÖê…‡WÇqÇýŒww‘=›¦iš&§;<Ó0 Ã0ìmÔ;l×u]×µÖZkN}HÛó'Hs²A" $²A" $²A" $²A" $²A" $²A" $²A" $²A" $²A" $²A" $²A" ´ÓŸgIß÷}߯?çx<ÇçìÉ–mmYÃö­Ã™+Y¾p\p~ô–¿{÷ögŽ÷'²ÜÁ•ÜKdy€õ«¿ëGû+·¬ÿöç_:¿1ܾ•õ7’~s€%"˶å2d—–Ö|ýüGíÉ–±ÿô)žIdùÂúõÚöIƒë$-­ózù÷¶~{ÊoYÏöýa?|»€/äÂq»Ç†û9\±r/‘å®?h?ç+S—‰¿¾}ïžÃ-Lðb²Åï&²<ÌÒ·Ö—<ß÷®a×Gd%¦ x€õ™Öõ%—ËâÊþó*¥”RÊét:N­µÖÚïp­µÖºŸñÂûüßoã8Žã~Ækº Hd‚D Hd‚D Hd‚D Hd‚D Hd‚D Hd‚D Hd‚D Hd‚D Hd‚D Hd‚D h×? >Ïó<ÏN g§‘=‡ÃÁˤí.²{øÍwà}˜“Y€ ‘Y€ ‘Y€ ‘Y€ ‘Y€ ‘Y€ ‘Y€ ‘Y€ ‘Y€ ‘Y€ ‘Y€ ‘Y€ ‘Y€ ‘Y€ ‘Y€ ‘Y€ ‘Y€ ‘Y€ ‘Y€ ‘Y€ ‘Y€ ‘Y€ ‘Y€ ‘ú¼¼3Ïó<Ï À£|”RJ)@Â?¡CnõžcNôIEND®B`‚xforms-1.2.4/doc/xforms_images/dials.png0000644000175000017500000000770011665175503015204 00000000000000‰PNG  IHDRÖªÏ%@ pHYs  ÒÝ~ürIDATxÚíÝ?ˆ×ð]c“Bi¬V…ë-\Ò‡7‰ Å­Ú$A¸°›6x‹_a§´ cpá "Í0%À¤r,‡- :p_‘&wv)”bthîæf5ûgfÞû½Ï§Åú¸Ûyß»ïýôfv:›Íf³Ù‚ºvíÚµk×ê<_ýçîÝ»wïÞu€ˆçÁƒ<¨?ò¤_¿~ýúõë«ÕjµZ9LÄöœC@ižwˆíÑ£G=ª?b @q”`Š£P{‚îáÇ>¬?b @q”`Šc;ÁݸqãÆÓét:V(Á÷â‹§§wî|úé7ßüä'øÃsϽòŠ @pŸ~úÍ7¿úUõ÷û÷'“ƒ%€à~þóW_ýå/«¿ÿ÷¿“Éþ£ÜïÿÎ;ï¾[ÄÝ!(ŽI0Áýú׿øÅÏ~VD  ¸·Þzï½?®?b;Å1  ¸/¾¸ÿ³Ïê˜P“`‚ûë_ïßÿË_ê(Á‰šÏçóù¼Ï|rrrrr⃠‚üÊo9þüçÏ?ÿê«ú#Jp¢]³Åb±X,šõ÷u¡œ N&‡‡÷õu§S„>óÛOz'“ù|:õ34 %x´ Ž•õ_7µg ýe°¿šû,ë¾n[E–Aä÷¢qÒ»þë¶UdùMÁßþö÷¿ÿãõG”àB›KšÏs^#Ìä›Áñ*連Ïóðp:•AÊÎoé½êyN§_‘ü¦C î%®‘–x[-Žúz‰‘Á|*o—_KsZ,ƒÄÊoœô6_KsZ,¿Ãøð÷߾sg2™L~úÓœL~øA ÞChK[¾ëk±03|cUÞ.ÖÕb$·ü–•ÞõµX~ûóÆ—ß1N Þ2´–i]ýh8J “ÁòŠïzO†BLù•Þº§GC!’¼Ah-Ç.búË âÛBLšù•Þ.âáxǸNѵø¶ÓVˆaÓ ª¿ÛºXˆeqò+½Û©bùÝ?“àÖÐ*¾ûb6ÌvT|÷Çl˜áó+½ûb6¼ï¿~aÜ9“à+¢kaõÇl˜.Tûd6Lßù•Þþ˜ oï­·Þ{ïãëš?YFŠïšUØñ—AÅwX—gÃ2Ènù•Þ!]ž Ëïv -Áæ¾é¨Ž¿3RrÕß±>~l›ÛæWzÇõø±mÛ*n;„²•&Û$ÊÌ ú›Û$Ø4¿Ò›Û$¶QP VÓ§ —“Aõ7Uª0]ò+½iR…7SD Vó¢ ÇΠú›U˜¶üJoúTᮦ³Ùl6›-—Ëår¹Z­V«UÔ調ΠãžAõ7O‡‡ö Ëïd¢þæé<½ò;™|ùå?ÿùÝwõGÂN‚•§L…cdPýÍ™©°üJo¾L…× 8 V£rfs«ÿ™ñž`󬇱™c=äËÙ¢ôõY öOÞ¬g—ð0Twhç®éçWziù®ÿþ÷¿þõí·õ?þYTNOOOOOëd3 6¦;óàþ2hL7æÁiæWzé"æ<ø«“`‚;;;;;;«?’Á$Ø ˜í˜ï7ƒfÀlÎ<8üJ/›Šÿ®rAÞ6ºS‚èÝ|þõ׎ä™ßƒƒüçÁ|ðÑGŸ|2¯IºÛÁîlŠØ=ƒ6B°o­†“P v¹ÃpyÜú *CÃÚÿL·MJ›\×W~ÓÌnÛ³23ÎSœËãL‚ÐïL·Y/)³•‚q)Á{w¹òö]v+.h#wj1ýqa@¯§Óa*oŬ—ØÔböÅ…qÙS|)™Z̾(Á{Ñ× Ø&XO-f;J0@rÌzaj1](Á;ÚulÖ }{V-–·ø\°w‡‡Ÿž>½#D—BlÖ ãªßí–¸0 'O‹l[!V|Ò¡ìÝÕ…XñH‡ Ð+Å EÏ9ÄöÁ}ôÉ'/¼pýúK/UšÜ›o¾þúk¯ýïßvV=b @q*ÁÕ­+šwqƒýªÖXóV)œ“ú…\ЇjÙ-½ÿüÊ.ý«VY„ôÚ@pÞ,€â4ÿØž`FpròòË÷î9g~ïÝËK¡ @q’+Á.£?.‰ëžA—ÇÑ—Ä ‘_Ù¥q.‰«Ø @p.Œ`dvCÎùÍu7pfÆÙµ46›"°–råxc5­—h ¶këʱ""»å—|EK¯»C0! çüF¸-Z]Ò%Ø"Ø;BìžAÿÍnÜbÌüÊ.»‰sGˆßüf>ÿÝïæóùüöíßþv>ŸÏ]@pwïžœüñõGl‡ w6B@Îù¶¢’A ¶)‚íØ±ß ÚÁæl„H%¿²Ë梽5F“I0=2†œós\ɦ›Óp4¦3àó+»ts¾&ÁÝ©tŽé¬.³ávŠ/©ç7ì¦7 V|<ÖJðîaVõ Æ]u ±âK¾ù7»i”`Åw¤ã®ï7Ì•ØE°´×KŽk2z-nnQ|‰“ß!³;F nnQ|ÇYiJð@:ßš¨ò’ÛŠýú냃¶š˜çkZ÷Z_bå÷à`>oÖÄþ²Û ¾ºòžçWñ“<@¤¯¾¨.Í*™×³…]Vuªµ¸í@³^ä÷©}ewß%¸í"@³Þ´T÷ V‚“ v¥¿Ò9Ö×…”Ò×6-®ë¯"wýº*/\•ß«§Åuݳ»y ^¯ SÞœ(ÁɆ¼¯›²©¹Ðž»ªWú»)Ûåz­ìÂ>ò[•ãJ·e»\—•Ý|)ÁÇ›eP„›7oÞ¼y³ú» @pÕÅpõGl‡ 8Ï;ÄÖ¼å€ @pÍ»c%]‚ë}ý½ªìò1ëÇúïrX»<“Ý_E—Ï¿Ë3é~^º,²|_)Ãd¼û¹k~ü.ß%¶Ë¸¼À. j[»7æuÉl$L‚«¿Ý"Xÿ²ËÏ.‹¸í‡ë¦aîþ1)D¢í«w/%¹¼Rb—fuÉ ±ÓWÎë’ÙHЏ;Äv7Íð§•}=Cß(¼€Ì2Œã†lJp}ÒÓåã»ÿvµégÞï³ú[`G¢®:y™¥ojpŸà Sa›_%jüÊy¥ / ³2;¤“†Ìî±Ëο]–ìúç³Ý³µRø.±ûE0P2 "_n‘ö ûººs;ë?ÿð¿ô§œWJ^—ˆ— ™¥’e Ng¹ty&ÍéãÞ‘¾Mˆ%‘¾KÈ ³i ; îþ#0ý“ûºŸñðQßïͪ|û *y™•ÙaÎZý‘Œ/ŒÛô ã.¸íö)Žuw‹ý.²¨¯”Hß%äÙØ²¿0n»ܶpKØyÓß% mŸy¬£êâ «´¯¾¯ç /ÐÇÊô3Nfw1Íf³Ùl¹\.—ËÕjµZ­bsŸ`ŠãiEÛtï‘pA^äd–ëÁvŠc;ÅQ‚(Ž=Á×ܬ\óÂGÛ!(Èb±X,J09:::::R‚(Ž=ÁçÂ8ŠãÂ8P‚( @qì  8ÆPÆ€ @y”`ŠcO0Á¹0€â4/Œ»P‚&"¹}ûöíÛ·ë<)Á·nݺuë–@<ÍüŠ ˜™cIEND®B`‚xforms-1.2.4/doc/xforms_images/yesno.png0000644000175000017500000000240011665175503015235 00000000000000‰PNG  IHDR@x\<`Ê pHYs  ÒÝ~ü²IDATxÚíܱ‘£JÐ?¿&² ™Ød‚I&¸`*RZcÖ J…FÀégg¥.ºûqEƒôU–eY–ÿúþù§ëº®ët쭮뺮ÿpQEQŒã8Ž£®€=4MÓ4ÍÏßÿë8ž€ 0`À € @@€€ 0`À € @@€€ 0`øÖ¼®ªªªªæž†a½ÄféÚÙ8Ûf2ÛÀlfîðävfkcéw1v­÷>7cÍd¶e šÝ9TqÅyøØÞLf[˜ƒü¼æ««K¶¼¤åc›å{|¾ýß=û»Ç×¾Úçí[.ïÃ=ÆñùvžãÚ×¼ö½Ã0aËzs‹~Ë·sÌÏÜ?ÓÅÕ%‹¨KÎíž·ßc§ÛÙv\ž¿gºCs ¯Ÿ·œ»Îw•Ãîc˜-yµ©w·Õ~Ï9:ïtý›3pìhzöö» ÓgõgŠèe΀y{,TžÁÜ’¬08²ÿõ6{ÀäøÙ9ÓWµüã‚HÑóìG³»WîR^»¯åÁöÊý´k_áÜBôÚê×ûçø±~å.ècFçõÙ ¿#€ÙÌÜWPž/™>Þ+»ÕÏlµÇ¹öÇßÖ4·÷WBbú!`ÉvæÚo5Žk{û•ÑYûÞa[_eY–ey¿ßï÷û8Žã8ê®Îu;# çÔ4MÓ4?;æ­8®Bó&üN/p-¾Ì›ºF®Å0`À € @@€€ 0`À € @@€€ 0`À € @@€€ 0`À € @@€€€ïO{ÃMÓ4McàßUÛ¶mÛêõ‹ú=¿ à]×u]gº¿“º®ëºÖêõ{ÀEQE1Žã8ަþÕ9+R¿¨ß+r 0`À € @@€€|UUUUµ_{àÈZ^R¡ªøà‹•®¢…«†aÕŠ¾L¹î×€ã}èOQ^ÑôSócÄÎ=>}vn›KÚ u8²¢ç¬­eÎÌð››–ë01WÌÓÃÁ”å2¸V-s~øbãpÉ'èÇgŸ·w ©Š^Ò^m¾Kж¼h×–÷㽚Š`[ø’Ö^=zå6®i‹a8CEó,Aó{Àaîf«¹ÇõoÉõ`5ûN,API/¹µjîà<®UËœŸ¾|AnÛR1C¶f×~£ë² 0`À € ࣿ†Ô÷}ß÷&¨_8Þ‡ðív»Ýn†Ô/¤|\·mÛ¶­õ Y®@€€ 0`À € @@€€ 0`À € @@À÷ô?}ß÷}¯S`o_eY–e©#àH$ºçd•aIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_DARKCYAN.png0000644000175000017500000000056311665175504015666 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p…IDAThÞíÚ± €0 Qƒ²‘› àžYÄ;Q¤Nq Ý›àëZû¨ªªÊÌÌ mtww•é¾3ç|{Òw]WDÄùöŒ?1`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,`¬—‡uË×ΪôÛœ¾âG¶%tEXtcreate-date2009-05-07T00:40:44+02:00…ü1%tEXtmodify-date2009-05-07T00:40:44+02:00ÚM~tEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_DARKPINK.png0000644000175000017500000000056211665175503015673 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p„IDAThÞíÚ± €0A@$Ôó-|O¦SÜ÷Dà‰ ÒN§oÍÌÌŒˆˆXô ªªj™z¿®ã˜=é»Î³µˆmöŒ?1`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,`õòÆ8†Ü‰šÏÊq%tEXtcreate-date2009-05-07T00:43:20+02:00\랦%tEXtmodify-date2009-05-07T00:43:20+02:00Zè’tEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_YELLOW.png0000644000175000017500000000055511665175504015506 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$pIDAThÞíÚ± À0Q;+±;1%3‘Âu¤\EºWüŽ–™™±ô »»{UUUÍ̬å>í©t}}³?1`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,`ûòÆy ¹xjÔ=ú 2A%tEXtcreate-date2009-05-07T00:35:07+02:00ÿL‘%tEXtmodify-date2009-05-07T00:35:07+02:00 ý´¥tEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/slider.png0000644000175000017500000000331011665175503015363 00000000000000‰PNG  IHDR@ ¢Qþˆ pHYs  ÒÝ~üzIDATxÚíÝ=š¢X€Ñ©yjì‚ÐujÊNÙ )†®ãºw2Ø …~X÷œ¤m•_«ë­{¥­¯²,˲üx£ïû]×u]çtÀÖ꺮ëúÿEQEJ)¥äÔÀš¦išæ~û_§ÞO€ €@€ 0` À@€ €@€ 0` Ààûwºïû¾ï½x¿Éét:NùïGøz½^¯×¶mÛ¶õ%Ë;5MÓ4Ío=:ÿ¦ˆr8‡CJ)¥”ÏQd€!V×u]×ý¦#ªëº®k¯,¼“ÃÓŠ¢(Šâwü´þ»Çô°g.‚÷ ·aüž½ø\ 0` À@€ €@€ 0` À@€ €@€ 0` À@€!@J)¥Ô¶mÛ¶¯Ü|®o§–éû¾ï{çXF€áiUUUUå<¯øÈw]×u_{ÀçúÈßn·ÛíæÅøòü®î", À@€ €« a–ãñx<Ç=ŸÏçóyz©ÇçŒÝÿìž<»,°FÀðƒéôÎÀ##`5ÌêpÄùøœûí9£R#W@€a–±dÞïv#`5gRwÙEX[3Š…ý3†Y¦'Ÿß³ÅùÛ[vúR2àŒ€aÔpt»ìó°¶Ûâ²eaŒ€áïÿ`ééîWöDza?¾Ê²,Ëòr¹\.—”RJÉI€-4MÓ4Íý¶0` À@€ €@€ 0` À@€ €@€ 0` À@€ €@€ ¾s;à¾ïû¾÷ÂìÇét:N¹uv¾^¯×ëµmÛ¶ms;öÃáp8ªªªª*Ï3§¦iš¦ù”½õ•™›û÷¥”RJ)·cÏ.À§®ëº®ÛóÖu]×µWŠ|0d¡(Š¢(ö9Îø¬1:¬ÅEXÀîS‚Ã(>{?0M€ €@€ \ýƒãñx<‡÷ŸÏçóù¼Öڦ׼î>°FÀ£¦c9'¥¿cØ‚ð_ Ãö8Ö||ô~{ÙHtz©÷ìQŒ€0 ÛûS·‡}`]ü&ÃíñóÞÈ¿ÕyàñQȇ¿ÉØ»¶ÞÍÈ“@þÁØÅSÏ®aì’«9k{}Øþ‹±wg§ÿoîØ3—­í•}`ÿxÔtØžÍÞ²µ­»ì‡OÂúÁ{B»î>°FÀ@€ €@€ ü!¥”RjÛ¶mÛW 2Ò÷}ß÷ÎìCªªªªÊy€ýÈ.À]×u]—óKî xÅ=È.À·Ûív»åùbç|ìÀ>åü}ÉEX@€ €@&;c¿Øq­çïam¯leÝ=Æ0`²óøë§Çy~Ö/…ù xÉtŸMàZk›ó£Ã+“ÌcËÎÙÖý9Ÿûà ¬Åš°gßi^kmÛ­gþœÁÖGŸÎ˜L=ŽÃîÆ¦¦çŒÏ†Ïy%3ë®mz=ëNÈÏ9ǹ`Xh‹©Ýá¶{7w¸Îáäðœ=\ë¼An^²ÖØt,~Þ+…ßJ€ÉÚp"zøèز¯LçNïÏØVæLí¾ó¼ùúW¸ Vðz–ýðú§ïyvYâóà ÿ1fÝäl°á‘ÎßÖüea#`Xh,3Ë®a^v­õÖ{þìs¤æû*˲,ËËår¹\RJ)%'¶Ð4MÓ4÷ÛFÀ@€ €@€ 0` À@€ €@€ 0` À@€ €@€ ¾ÿÒ÷}ß÷N lí«,˲,x§ÿûb#«Ä–=ÔIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_LIGHTER_COL1.png0000644000175000017500000000055411665175503016345 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p~IDAThÞíÚ± À0 ÄÀ$ðFZA+hlí”Bu VvÞÖgffFDD\úÐÝݽ&SUUÕîI§{vøcÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆÖ\vÏ8ÝTz_¤Yü^Ã%tEXtcreate-date2009-05-07T00:29:25+02:00ñDë‹%tEXtmodify-date2009-05-07T00:29:25+02:00®õ¿tEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_PALEGREEN.png0000644000175000017500000000056311665175504015774 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p…IDAThÞíÚ± €0 Ñ€Øè¯àžÉ½P*ŠÔW¤{|]kUUUI’ ½èîî¾V¦9ï{ÎÝ“¾+#9wÏøcÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆ®õò°nù»Ç|תô{^ÄWÏ:C%tEXtcreate-date2009-05-07T00:38:35+02:00¢_ë%tEXtmodify-date2009-05-07T00:38:35+02:00L)ßtEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/borderwidth.png0000644000175000017500000000460211665175504016424 00000000000000‰PNG  IHDRžŒ â> pHYs  ÒÝ~ü 4IDATxÚíݽuêÚ€Ñë7¨@ 8V†ëpH¬JØ¡:!¡êØ´à¨á¼€7ô$‹™…öœÉõ=>ãXˆýK’ᣮ뺮ÿ‚Ù\þs8‡ƒÝ4MÓ4͇öªªªªÊ9çœíx•”RJéòõìˆÉÐAÚ (C;eh€  픡‚2´@P†vÊÐAÚ (C;eh€  픡‚2´@P†vjóªüùùùùùéàY~~~~~~Þq˵€´€´€´€Ƽlh¯ªªªªóù|>Ÿ- —RJ)µmÛ¶í{m¹ЂЂÐÂX 9眳û‘’[ؼöÇ{ZâqMÓ4Móî·B hA haØ‚q…G\FûÞÝ&ÂFx‰Æ}Öñ²L ha¬ã ·2¢°>!†ö ã ó­oD¶`\a# ÀºÚ/Œ+L3¢åð‘o”¡‚2´@P†vÊÐAÚ (C;eh€ 6%ßøÝn·Ûí._ÇãñhALï¥1öžta¿i¡äõoiÁ^Ò‚î7{ìYœi¸ÁœÃXPæúWZÐXÿK(úL;·r´Œ’ µ{Z¢Ìõ]Áð»Î® -Pr,ÁÐþ˲>ÔN_$óÈwA  …øûd¸ciA ZÐBÉ-°4—Çæ7ýçeî“ÝkF eîOŸZ(³…ãûD îw´ …‹ã€u²gÚÿϲæw}Óõ1Ôù>=ò¢ÿÖ‚¿ ÆE_ZÐZ(¹oÁ¥…2[˜þÈЂ×H,Á™öÑ…k)_ãgžœ´°nαkA  …9|ªˆ`9δ?ÍØÅäKÓ}ÖÖÖØÏõûZ”ÖÂôß|îmD ñ[þ¹7ߢäŒëh¥9Óþ„0æì‡%Ž´€Þ±…é÷4Q4å´0¶ýZ äXš3íÿ“Êü´óÖm»oîû;ó?Î-¬»…ù¥xŠÕº[XbÏ …÷mÁ¸®-ð— í³–û㊿עÞ.gW´Pf  …±ÛåyA e¶pëû‡+B ^#ñ8Cû/9EˆçUÛ0ýãaE å´€´0½Oª…ÒZ@ Zà/}Ôu]×uß÷}ßçœsÎ󃿾¾¾¾¾Æ¾û—[Â{I)¥”ƾ۶mÛ¶ïu‹ÆZP±ŽTÀãE¼{ *àYE¼o *à¹E¼K ×ýz#:ÊÐAÚ (C;eh€  픡‚2´@P›˜›Õu]×uîJnhßï÷ûýÞØív»ÝnO§ÓétZ÷-uè 4´×™oÝ£»ÐÂ…CW!†v# ÷Y߸¢´ ´pÍ¡+^<´{YÆãÖñM hA hA haÈ¡+ø¨ëº®ë¾ïû¾Ï9çœíx•”RJéòµ|€  픡‚2´@P†vÊÐAÚ (C;eh€  픡‚2´@P†vÊÐAÚ (C;eh€  픡‚ڼ꧔RJîž«mÛ¶mßk›µ€´€´€´€Æl^ûã‡Ãáp°tx\Ó4MÓ¼ïök-h-h-h- ½xh¯ªªªªóù|>Ÿ-#JËO hA hA haN 9眳û”û¼ûU›ái‰û¬ã©H hA haºã ·ra9¬Iˆ¡ýÂK4æ[ßË2- …±Œ+ÌaD`­ íÆ¦­{D¶`\aŒ á†ö ã CF 4>§‚2´@P†vÊÐAÚ (C;eh€ ‚~Nû«ìv»Ýnwùúx<GûaLÉûG ö‰=£ëß>Ñ‚ý kÀý>Ü3öÉœiøÅœÃXPæúWZÐXÿKs¦_8ZFɆGÓ=-Qæú¿®`ø]gWЂ(¹–fh¿yQˆ§/’yä» ÐB„[=܇±Ð‚(¹þ’ËãoÈoúÏ×z«wW¬ -”Ù‚'HÊláx¥´G´Zs°–æLû¬E9Ìïúò§ë#¬ó/‹zd$¸õàY9¹èK Z€’[ð\”ÙÂôßq¨¯‘Xš3í7,Ür–òôñ3ONZXw α£ÐÂ>U-ð7œi_ÐØ¥æÇ¼ÜÃÁØ¿ì÷µ(­…±-_âV …ø- Š7ߢäŒëh¿äLûÓŒ½”™ŽSNhA h!f Óïi¢YÊial µ@É-ð—œiÿg:•ùi=ç­Ûvß6Ìÿ7—Ør´¿…ù¿»èIT ëna‰ÛŽÞ·ã:ZàU íw.÷Ç/#ÆpË]¡Ì@ c[îy2[¸õ¡…µ¶À«Ú‰$æQÕ¥§Ý“Z-Lßj jÁóh¿ahÿeq߷ܧ«½ã~@ e¶ ´`å£ë-häµ¼eh€  픡‚2´@P†vÊÐA…þœö®ëº®s'P¦ Cû~¿ßï÷î®m·Ûív{:N§S9·Ú¡+(Y¸¡Ý¸Î´rFw- … ‡®€’Ú(Ì·îqE hA hášCW% 1´{YÆ}Ö÷M hA hA haÈ¡+Jöâ¡ýûûûûûÛÝZ-€@ 0ôQ×u]×}ß÷}ŸsÎ9Û)ð*)¥”ÒåkŸÓAÚ (C;eh€  픡‚2´@P†vÊÐAÚ (C;eh€  픡‚2´@P†vÊÐAm®ÿ§ëº®ëìˆà£®ëº®íˆæ_·ò½ËûÍ›ðIEND®B`‚xforms-1.2.4/doc/xforms_images/buttontypes.png0000644000175000017500000001330011665175504016502 00000000000000‰PNG  IHDR"S¹r‰ pHYs  ÒÝ~ürIDATxÚíÝ1ŒãƆá]Ã@R¥ šE*!•°î \JuR•€µûl«*P>5‘¸Ñ^u*ܸîRãÛÊwPm`‘Ò©.Åd±³ÍÜOÎ 9?ù>…½ÐQ5ΧÉëÅb±X,®PëKó¿¶mÛ¶¥8º4MÓ4Íÿ쪪ªªŽÇãñx¤håÛn·ÛíÖüýÅÐŽ0¨G˜Ô#Ìêfõ3€z„@=  aP0¨G˜Ô#Ìêfõ3€z„@=  aPïKŠi­×ëõzm¿rwwwwwç[Ò÷¯Ão³dKÜoç*áM¯M¯´ÝZGíŠA˜!Ùaé;ØÂÿªQ8žcBÚ÷Þr‚¿„rNUÚÔ®)Õ.†‘ý œO̯fJ›ï;zfˆ"ÿM'ù•-YÞ7“jù~ß.f=îÚËÛÿþe-ù޾5ËËDWÍìZ&á}ׯôr—3µË g† öù;Kø ´Œ´Ëˈ´ïruÉß1ßQ^æiëCÚz%i|»î÷ajl¿m˜jíJ¥ÐžÙv»Ýn·¥7ùéìv»ÝnWÎöœN§ÓéÔ¶mÛ¶öëçóù|>§ý,÷ ð©–i2bz{9ä.ÃÛÛÛÛÛ[»,—Ëåry<Çc¾znþÂ¥Ýõ;–SÚs«]©=ÌèVúéiš¦iš2·­ªªªªº6X¹å;$â‡L§:MÃóCóp8‡Üõ*þg‡Fs«]©fe6¦©Ì­÷™ûPOµæøÁ!kÂ|J›ÚÆ93$;ÀÂKædè*žþF¾|øSúEšdRIŽ’É·æ)ÕFí{‡ÚÆÔ|$ž³”jHÄɧt]>ü‰òyYò-q#Ó÷ŠäõiOµ¾žÄ÷Ñû­™ÚÕÏõb±X,ætn9g§ì“Ì9¶êåË7o~ÿ{É’¯^}ýõÏ?çûŽæïÒf3æ.èS7¨WÈQÍß3ê™=ØÍÍ‹WW77ŸÇ»w?ü@u€òÍ"Ìž÷ÃÂe¢Rî~ù,ÂL2TxiàñææÅ‹—/ß¼ùá‡|ƒ€x3ò|ÈѰMïíq@Ò,ÃUPª…Ù?ÿùã¿ùùûåKóÿðãS¤½|ùË/ëõ«W¿ý-‘å™Q˜}ûíÿøßÿš¿_½ºº’ šaFy¤™>Ã’0¤‰\4-ŸjßÕc,]îÙÏ}üï/¿¬×L!IËÜж®ëº®) >ê{f¾3ƒŠvoÌÇ~üþû?üáÏ6óÍO?½~ýý÷ÿùÏï~çÿÄ_G—y—äsæÞ—ÝDZŽ;÷cbîÁòM`˜ÑÄIÿkÂìàùæ›|ýÚŽ´çŸâþmÞõÓO¯_»kC?¾Ç‹˜#Ò çÞÕ"~I”Iq˜=ÍH¼ôº™â!97æëù}²çžâóÛo9C–†ä)YDÂ|±$ï™lMrˆ´¯fbÌôÃLŸìÒzºq‡=™ "Ñõa9"M~¾Ü ùˆçÞoðÓ§Ðò××iîÊH-Ëì¦æ›˜cæ_/ -J…Ï¢™jKãâÓï™ÅFŽH“ F6e²÷‹<Æìe®¯/¯§ë¾¦ oR€‘Ïi4‘fŸëŠóüòê««ëë¿þõñ¿ð‰‰1›i¹·™¦GIŒÅ,O-*ÇdzfŸô'ÆâÓæõõ?þñø:UÖ'UŒÙJ8—~à§dyêLLÉÛ}©˜Xzì¥ÅöϨECšä0cèlYÌp"âí÷ûý~Ÿoý&ÆÌ-Ms¤Ò5Òb"Z4®‰‡™Ÿ 6÷¿]×pwhìGieƘoî™û¯áåéÄï·$%e/3VŸŒZcw¹ô\é~Bf¦~˜ëÌh˜bøÎ¥åŽ1ùþò-™ê>Ôœx—"­Ï½©EZÌèvVÆã#Zž¦Š<:7®>§GûBi¤bGÚét:NœƒD¿[ssaíff1}²§™Šî´Žçñ/Nˆ±±Pèªß]ó¡ÑÄÃÌ~LŒûØLwøÑícùâÊ]žƒ(Gè´M~6ã×_ÿü³™Už”!ŸLof*r`@9fwÎ,ìRD½yóø×§Oÿú—™îÿŠD”`ÖaötÇ(ÙËP] L³½Î 0„@=  ž‚sf¹çЮè0[­V«ÕŠ+4̸q@Žsfõ3ÍÜ)Ÿó¦Â¸ ebìþþýûûûûû««ûû««¿üåñÖÔºâFÃÓ–,̦ý/žO6$;Æì׿ûîßÿþî;" ]\ó7€™6zf#fîa3çàôŘHƒäÈ2÷{T&Á¦Q²0c—#†$ÆlÃDšo`ŠÚ^¾˜}dÞó¼ijÑð¾ ïßN ÷'¿kÜ•¼Wò[I^iº~»ð§¸Û)ßBß–„ûm¹¿ãºÆ˜-G¤u­i4IåH;ªá¶NÔ¢’}!¯iŸÙn|íjä{=\-$[ÛõÛõ+ðw—ü=äwRLŒÙL¤¥ñ®Ã4= •æ‹®;£ë´¤·^³<»nmîå‡9<ÊßfWª³ÅGZ×ßàáöO1wWx«$Ëû>½„.¹å;ÓÜuÈ‘Z4–ì×™ÅtÕûUè¹ƺÔu]×uÚ³™H[.—Ëår¬ï(é KúÊÓ닃Z”ÏD.šöí0:ò¥9ŸÏçóùíÛwï޾ͱþ>~üðáx<ÇuLòSiÜñ€2ûâ å–}j¾; !_¡pÐjñiWWoß~õÕÍÍW_ů3_ŒùjW¿_©]ßEjJ¨Eù|))‚~ÝL÷½¹#­ëÖæ[>¦Üòí‘Ò¤Š´Ü1–»9K»<æ€ZäMq»Ã]'¯÷[¦ß®rç@ú>±ë·“,/ÙÉÚŸÒu”,fà1mŒ¥½ºCÊ·ïúMè  O4ÌØuª}ªÑØÜ¯çøv]·$ÇÜÎTßzH]{i¹{c]¯ó‹Y³äºLîO¡µhHÜÎ ‘DÚçÆ$Èw]³ï´¿¼ïî[iOdĬ‡Z4< ÅñEÚðçÆrÌøÊw¶ƒKtm1Q”ï$µ(Ÿ/çYõùU[>;ÒªªªªJË”sts×üù g†¢-”ºJ{>”¬Ð03·;šÏnØív»ÝŽêäC\M[Ñ=³¶mÛ¶öhš¦i*"Ä(:̦}¦dn½OÈg"÷fÌaP0¨G˜Ô#Ìêfõ3€z„@=  7FÑ–Ëår¹|xxxxxàvÈÁ†§0ûLuw÷—êÑ31fß̬®ëº®‰4ô;¢yÌ´Í(Ì$¿ËÂq•ö‘}ðqcÌ01F¤A~¤÷{(%Á¦Ñìzf¾ˆ’ô·ì¨£êäà‹1‘†~Gz×÷ö;Ò%ïòµBg †EUÍ~… —ƒ$Æl9"fH»´û"æ´‚oyùOgtÅlÆ —ÒR׳ّ–¶&¸Ì¿RC_»(‡³ Ö”LZ11fËi.š¡òÙûh¬Ÿ¹áOtÿ•VkvÃŒ¾,™¯Èà@*©bÌVι´p=qÿÕW'©iÓ“£ ñMW™ÛæŒÂLÞ¸„×@¤ÅØï÷ûý>ßúMŒ™§xïv»Ýn—¶É B×=ë¶!9>Ñw¦>ý3&€x«MI›Íf³Ù˜H3§]|ŒÑ !Ç>µkWŽºDm!̼‚Ë'G¤¥êÑ !Ÿ|?”i¯³ÿ£6¼T‘–cPÑ×XÐ •)ßÞ¡eÐb¦³ÝÙ>TֱؑÖõ½ÃÄJ×^¸oÖ¢|ÉùôûgfîIu÷V’5{9t´ácŒf¨|iÏ5Æïá‰òòéf¾¶K²¤ü³¦ÙŒb,7ÉÀcv]r›ß+¾›\S+böcLåhgº¾Kþ:µ…sf *"ÒòEZÞQÌ]óçƒ0C¡ìH;N§Ó‰scèJ~+2L; EÛX( Ä ®¦{3Ô#Ìêfõ3€z„@=  aP0¨§à¢éÜÏ&hWt˜­V«ÕjÅN?&@½Bù®‹Åb±8‡Ãáx<G u]×uM9À§ªªªªº¶Ô+ô«9>ææãæoî͈ Îçóù|¦¶†P¯¯0 aPOfòç®NéAï<´´ÈÞ3#$¥A)@ŒÄaÆãïÃë<›ÑíC¸&7¯ØKÚ¯‡—ô=æÜ“¾>»¼ïÃëïú­%ï•—ÒßôêÐ3³J_äØìe ½½ÎµÅ}Ý}¯½~ÉVuý]—÷ñ•F¸”†ùŽ ]‡0s›Úø_ú¾5HÖì6Ö’÷æ^>Û CRÑ4½ ìëö1=»Ýn·ÛQ’â0 ŸQ#äÊ×¶mÛ¶”Ô4MÓ4 å€á©ï™1€¦WÚ»´a\ô¶1®Î@¯ ¯ëVå[>_ù”YòPŽÎ@ìÙ†öë]ßÏ§ç» æ[H–—l‰dmáOéZò03zLøj0 É Iñà¡éíSó7@0|­ãFÃõ3€z3 3`ªè™Ô#Ì&n-à./Ygü2s(yj 0 õMC"|£gæy¦¢%À꺮ë:~=çóù|>³ßQÂlÖ|O$ðq1Cºåi—U™Û™êÞ+fb4ñQ†ñL×xsr†G˜ÍÁ`fœù³ª@#zf³pç9û_Ý>œd=³Yc*Çœí÷ûý~O9`3`vÌ<ÆÍf³ÙlbÖ¿ †g-„Ybnã’®ËûøzBc 3ŽU扩ùákúÇ4=³‰“ u€v„€Ä¸f‹ma–Xx.b Û3ÌÖ–VÆwöK5׎mf›sãœÙ’Ë“}¯»ÓÊS ô¹ë‘ÏúóM¯l­ïÉëîVqön>RÝfÉ–»¯À6³Í9fÏÈ›Úp¤Å–|ý1ñÿ)c•JfÖ|ƒ`ù®Ùb›sos>„Y2ýúLÀT™¦Öþ߯qŒ_Û\Ú6çÀ9³dÜóÅ0v³X[Âïr—²ye›5Ö´B{fmÛ¶mûîÝ»w}×PUU5Æ–Z€«_S;nÃÊ6ëRh˜Åî4v0=M¶¹| 3Ô#Ìê1Ì8ä³yÓ3r˜­V«ÕjÅnÊÄMh1Z˜ív»ÝnÇJcæ?<<<<<ÜÞÞÞÞÞR&(Mx†™ÀÐX»˜P0¨G˜Ô#Ìêfõ3€z„@=  žâ‹¦—Ëår¹´_1÷,`§Ž‹Kn%O¢¬€´Ô„™]Æñx<ìÈr¸Mù´›ì˜ï;·²ò):Ìì#´´p›ãi<”=Ç7šCYÃ(ôœ16%î£Üõ~³ýgK޲2´—0¤âÂÌÄØÑÂNš»™Þn·ÛíV×öÛ16d‰i€DAÃŒvŒ±c¦Í<ÈDZù>ÆlæsÍsÅ6›Íf³)ÿjü±‚!ýk."Ì|“;0%GÚ¸1f31¦+ÒÌsѨá0š¦iš&ßú ê™Ñ'›»VÚ¶•c6]‘VUUUU׿ùœC‹(9ÒhÁ@€gÊì“Ùìþû 0ß$Ÿõz½^¯ÃËÜÝÝÝÝÝQVP‚ÑzfåOú¸ó0ÿ* <ß{cÖ9 6ègäaFgËè“åPÂlÆòm 66†“1ý*_Ô¹½.{yû_}ëñõÛ|Kºkö-øýî–p×úÀ~b0¤³p#f¿Kò·ý‰ö¿J<ííL5@Šð~‘”p¿w£gæ%ï Ãý\_ß«ßòèW7Ü"’s¢¾wÅüTBÚ#}Üã]fW]+1Í 0·ã=¼ JÀ0cÏJOÿ˜ÏñN9”ž|FxROîÉY¥ò(Óh=33)_ã-†å§÷%ËÇ|î”z‡%ÜnXþÈßÄ ùÙß»äÍ“®›OUîÉYýÖ?O 3~¦šº|Ž[É|¿ãÜþ’×Ý5û¶Ãp÷‹d_ø#öã4j‚doæ^~žfUø÷Ê«c××».ÉaPBma/@Ž˜ÄÈaf6rïüy*íyfö`£ïn ã^+ÆãÜðÓG¢ aFÑ97zïÄøu—v\S¾"†õNA¼2Ÿ1-éŸ ß´Ñ'ž¤·íF]Ú>zxýD¬QÜ“¦9\ç ´¡EI¤ ƒã"·~Óß}“¶$ï•Ƚþ))nˆ{/pài°Ë1›‰±±â„Ë-UäÄ/?ùkÎ šoº<äB;½1æÖÉ!k#1È=5_iꥱ÷Ôét:NzÌWßò0&ô£æ:3÷ÀÞ[Ø‘eî©©6ÇáŸYòoó^6ÅMsØ£Ìz(ÿERá @bD0<îÍPž€Œ8«af²X­V«ÕŠrÀ03‰Méb hÁ93€z„@=  aP0¨G˜Ô#Ìêfõ3€z„@=  aPïÙ†yX@£ëÅb±X,(€^ÿeµˆQÏIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_CYAN.png0000644000175000017500000000055511665175503015224 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$pIDAThÞíÚ± À0Q;+±;1%3‘Âu¤\EºWüŽ–™™±ô »»{UUU­53ã>í©t}}³?1`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,`ûòÆy ¹ùÌÔ=dnË?%tEXtcreate-date2009-05-07T00:36:13+02:00,ž]%tEXtmodify-date2009-05-07T00:36:13+02:00s/++tEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_BOTTOM_BCOL.png0000644000175000017500000000055511665175504016276 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$pIDAThÞíÚ± €@ A@ß‘[pûn•8i£i§‚ÓÆwfffFDDzPUUµ&Sww÷îIß5•®Ý3þÄX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±€5—!ï¦Ò iEVþb¾1%tEXtcreate-date2009-05-07T00:27:30+02:00qô%tEXtmodify-date2009-05-07T00:27:30+02:00.®‚5tEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_MCOL.png0000644000175000017500000000055311665175503015222 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p}IDAThÞíÚ± À0 ÄÀ$ðFZA…–×N)T§`eàMð`ýwfffDDÄ¥ÝÝÝk2UUUížtºg÷€?1`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,`Íåa÷ŒÓM¥µVŽYsm%tEXtcreate-date2009-05-07T00:27:38+02:00Bðºf%tEXtmodify-date2009-05-07T00:27:38+02:00AÌRtEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/thumbwheels.png0000644000175000017500000000440011665175503016431 00000000000000‰PNG  IHDR@úDÕ pHYs  ÒÝ~ü²IDATxÚíÝ1RêüÀá{Š`¡rÆEЇ–±w”:CÃ" R:CÏ q¨aT.à+òÜaô&ù^ÄçiGåó#$&²,˲ì?Àý-ÿ™ÏçóùÜ8 m£Ñh4ýàn·Ûív×ëõz½6hÃd2™L&ååÿ\ž@€ 0` À@€ €@€ 0` À@€ €@€ 0` À@€ €@€ 0` À@€ €@€ ü5‚êò<Ïóü÷Üߢ(Š¢ð¸´A€k˲,Ë2s …·  €@oA×6Çãñr¹\.—·wï6›Íf³ñ(´Í0°ÜÐ`0 ·w¿¬\†5`` ¸¡~¿ßï÷Í€f¸¡Ùl6›ÍÌ€f¸¡——————ÕjµZ­né~Ù p¶@€ Ø +I¯×ëõzæ@]œd¿ßï÷{s .Nr«§d mœäöŽíï€.ÃNX@€ €@€ ø3¤$Ž„@3œÄ‘°hF€“8ÍpG ;a@€ 0` À@€ €q$q,hšà$Ž @3œÄ± hF€kët:N§¼<‡Ãá-Ý;Ç‚¸ ;a@€ 0` À@€ €@€E™¤Ûív»]s .Nr8‡ƒ9P—'Y,‹Å¨K€“8ÍØ 0` À@€ €½ á_yžçyžeY–eÇßn·ÛíÖ| Ö÷¿›EQEñ³î‘5`~¤×××××ןûó[†³ý’÷ûý~¿obÐÌÇÇÇÇÇÇWŸN§Óéô–î¯C%Ëår¹\ƒÁ`p|¹ül™ÞrñqúÙSu¯ª×ëõz½ý~¿ßï›ÝB©Óét:ò¨æå¡UË㻥d¦îmÞÝÝÝÝÝ5»ýÑh4æóù|>?ïã^ý»ìv»Ýn×ö”ªßfús#ý™VýyÞ?2›Íf³Yùñòú·úÒV€k;^LÔ]d@É6` ÀÀ[ÐIœ€f8‰óÐŒ')÷Š4êà$müÙC,/).ÃNX@€ €@€ 0` À@€ €@€NÆÄù€hF€“80Íp'ï Nâ|À4c', À@€ €@€ 0`àHXµív»ÝnWž†¡¼l&Ô%ÀPÃãããããcyùíííííí«k~ÿÙôë·q íÝZ{·yìááááá¡íç@Ûßåú'Ÿrk)¿Y–eYvKˆÿã8ºç"Àð?¶Ûív»5¸þßÍŸþâX€“”[‚Íá6EQ…9—!ÀI‡Ãáp0êà$‹Åb±X˜u p’áp8oém6›Ífã‘h›Ã™åyžçy•-ÊU®Y^çø#u¯ÿ•”mÞÕ¿ËéwL™O³¯­þUՆ곭þ(W¿Nú ë>CRžW)ó¿m Wçxa÷Õâì«Ï~ÿñã[HY,~õU×¼¨­û³}Ÿœï'pýÉ9ïãN3E WªY\Sn™öµ¯œ®×šáï!ÀpEª¯9Yd×U}bç]M¤¼…{«~ t³åØ ­ˆ]7m¶ýò7Ìçû˜êîÜ;ÛôµêºÏë^ý, ­HYˆ·ýݯa--v>íýü_Íö4ü§×¬rsÍÐNX×À[ÐðëØ~|:s½(1[ª`¸"Q; —'Àp¥¾Ê°5×ï'ÐlOòs½”©²•´ÊË^`ý¶ÃÕùþDÊßgø2óùé»#Õ=žWÊWÝÆÄÚð'˲,ËÞßßßßß×ëõz½þÍ¿ØUž²ååþþþþþ~·Ûív»[ºOOOOOOååçççççg;À¹L&“ÉdR^¶œÄéhF€“8!·¡îveoƒC:Nât„ÜA…˳4°\Ûççççççée¨Î0` À@€ €@€ üp’^¯×ëõÌ€º8É~¿ßï÷æ@]œd¹\.—Ks .N2 ƒÁ-Ý#'c¸ ;a@€ 0` ÀÀß'q(Jšà$E @3œÄ¡(hF€“8%ÍØ 0` ÀÀNXIúý~¿ß7êà$³Ùl6›™u p†@3¶@nhµZ­V+s oA7d÷+RpCv¿ …×6N§Ó©9Â6` ÀÀ[еÇãñx|«÷Îì—!Àµu:N§c¤àÚò<ÏóÜH!À5EQ…9ÎNX@€ €@€ 0` À@€ €@€ 0` À@€ €@€ 0` À@€ €@€ 0` À@€ €@€ 0` À@€ €@€ 0ø{üŸÅb±X, Úö'˲,Ë .é‚–G€\ºIEND®B`‚xforms-1.2.4/doc/xforms_images/colchooser.png0000664000175000017500000006447512340166201016250 00000000000000‰PNG  IHDRgü‹6 bKGDÿÿÿ ½§“ pHYs  ÒÝ~ühÝIDATxÚí½]¨mKz6ªjîÓ6D],pƒ× ¨/~P[ÐlP»I@:W‚6\ $A†( ƒ >=\A Òƒ" Ö…n"Ý#%ŽQ¸‚$ ‹s v ¤æ ¬€6ØŽÏšU•‡ªï«QUs®½ÎßÞk¯õ 6ûÌUk®Ÿ½Ö>kìñ}ãåÞ~ûm ƒÁ`8 €?üÐ^ƒÁ`0Žãý÷ß_¼õÖ[Ïž=³—Ã`0 †=8åÌwÞyçô»5|òÉ'¿ôK¿t%?ìg?ûÙ øÝ8ýÿÂàÿ;[…Ö`0 †Sa¬i0 é0Ö4 ƒáTk ƒÁp*Œ5 ƒÁ`8Æšƒá\ðî»_x÷Ý/Øë`8gk ƒÁp*{ †»ÇãÇŸ>}zÊâàÝwßÕã?þøÖõkx÷çÅ}ëßèo ?C~”]¿HkÞþ6\y­oäE¾ß]ü)d{ ï¾ûîÀ”åâÞú•` –ÇŸÏßLÃ3Ñ‹/º~©0Ö|ýø±‚ôàÈw/ßyÑõ‹@ü¹O¦Ò5*5.OŸ>Ý †3„±ækÀá”ÉÀ#.t@¬+å¢×Å›¶X¿|¹ô×–ïÃâoÀ1‰þ‘è¥àÈõº¨'œùŸöW¥ _ã/ÀüFóúÕv{÷vñ¥×a¬ù’x—ÄŸGP&‹@€W ’ŒEk*YŒÈÒÓmIO·C¢Šß¡§ôcЋCùÄTú¼ø:ص½¹ügÐæ=¬ßý;eý`¬ùbø¼ÈÊGIt¤i2 ôVÄ¥jML4éJÏAebçœLgþŸpn€0ú¾õVç‰=F¼Z¦|¡wÿÖs^û/ÀKÌk^U³óªYó[á<ªÖVŸ„ oÈÝ3û€Ô [(V§MÐfö$Z´¦Ÿ3€ŽÐ'vXsžBàèÚS3-.ªÒÿ8ßreÜùÖ[o={ölïÚŨÁ`¸\)kÞP=6÷j2T. žJµL–¡òµ®]¬vYŽª5g6ѧëb=ÀĦüæÍlš§kõâ CgFÀ߸þ#Ü °˜ÕÖ`0&\k:¸R ¤&|™è[%¶’e®'7²ô=•†~ò4”Yο¡fç4»©)õäÿæ3CwB¼ Wúœ0•snvîÀZ'UŒ; w‡?þ={ gŽ+bM‡!÷õØÂy7kÛ2#Q¢¡S–{cš륋(lf²|!Uvœ4Ë= ¹´Ÿ½ÝjÙý=H ‚Ölëi«€Å¸Ó`0€ëaM‡?êñY /„ ½Æ ÜYJµŸf-,%MÊ =eé¥F]W»,—gAV£%˽ =î°ÿOtðzqi¡‘H?âÿsøsNœï¼óΰr¤Ùi0®—ÏšߊʗÁ#²ÊÍ’ž7Ä‹è=Ÿ}ד\²µ.ª;œLNŸQkú£…Ù#¬YâôŽð(oÖɰé$Zv¾c¥ïÿÁÀ·\,w~éK_V>øàû€0 .œ5Þ–€äqnDk®¹ÎTÝYÎ/¼(#%ÛöŸÜíj²]•]ˆtÙ"Db´<=ì©O×—d¹6ËïœëçH6˹›ÝMªÖ޳(”Y¿Gü;‡o»Lâ4Ž4 §àbYÓá;„ª„™&=|©Ç®À£JiA ¶+ðøÜê·¬,C¦ª¬º„\7 Ym´Cz»{‘zìžÖõǹ§Ïeç=–èƒJ“LÌ –¡0ËÇNTþ_ßnNƒÁp¸LÖtøNàF$æàÕcÖYn¦ê÷ ¯Pî¦M¼päœ –>ˆ[›èm´NnåZ+›5[•‰Ç9uS‰æ-¹¶ÞõåÈâzôû!âÏþÂE§õ5_#n Ž0Ø[öpq¬éðY‘˜ðX=>S4–G|@²Z‚ðßÔ¹l Ÿ ©@sµ–gQ” !z” r³0Ë‹Y,©N;xÚÅpäÕld™°Š-÷§•ak}Í׈O?ýÔ~Xû).õ‡½(ÖtønÔª¬÷H °z x yø7Ù‚S†Z}eom«Íª•gW­Í2gâ'­£ îenš€ŽWkùª¹»¹Œm(…^¨æªåk7„&П¥\¯Mpˆø‡ïºÑii0NÁå°¦Ã÷¢²Vb"1)M¹™Èw€ ¶~*Õrm}®(~Ö7}ÙeµsÐS香–爃¡„[Dä”u;Ï¡N;Ðê"÷PŸõå»ÇZVYFˆè,+þ•Ã÷X›Ó`0\.„5¾/À ;Æò¨”Ytgkg†jJü$7C5ʶaM/Y}#s^©{¤hå–óóxø¤§mÇØò m2(s$³àl Ú«ÓÎaÛ¿ ]S“H¨”Yôéa§õ5 Ã)¸ÖtøœŽcöì¨eÕ²e¦†s…bžô%úR­Îœhm–Vö˜2°Ðä&h¢B®¤¸išÉroq(Øá´cÐfm6BþñÝtŠrÄZ~ œÇ!ÿÌáû0qZ_Ó`0œ‚ÏšŸ£žeid>¢ª¬ÈB¢¥r[â1à‘Gò /9*¨P)ˆt'ïO×ãäÉ“LFYaÇÐç¹—aWbú)fv3“v`Ð-”´¼á-¹[CDô@B p=‰–Êmp(+åÜÃ&NãHƒÁp 0k:|XCëY–Š«ïÝ@Q(³4558³G(W¹‰~ò„©4H,­zB?Žz¦ê±L¥³ëÇ÷=NwÛÔæŒW÷Ü@›F¡¾ÁYtçd‘ug¡ÒÁ T#TÀ:¬ÀX›Ó`0\&*k:|@h‚2‰ h‘Ö&@$Z*±â¡qç†Üä1MP­¯ŠùÍáߘuôþÐtf§5=š\°Ý;Î2v¢4©JA,BrB*(‡Õ¾<;f y¬EzÆzŒˆ?pFœƒá"ñ YÓá›Pu$S&“hË7JlPP_¹­Ü™i.sK­oÍO«5[nm¦Öí ¶œFËbt¦Æ¡`úk±5pÂ~"¢²zì 8ÇeJ ÏÛðÐÆj¥jç1«¯Äé<2°Fü_ňÓ`0\k:¼ ,ÑãQoùtg ­ÁYÆKtÝËç*Ñze 3Ñ—¹®7C‘h­Ùò¤&‡ õØÜê·ußÍ=qÉ! Çåfÿ‚´ƒÍšíT¡vDbF Ï+•ØÒ¼,:rp^™hç”ç[ê·õÞäªCÄï9|áaçG}dŸƒá<0ÖtøëhC™‡ž)GÝIc'õÊMŠ“6ˆÜ¬;ˆ­À#é_RP—lšå}ª3Õ„ÉR¯,¹„Û÷;7Ü@®öSÕiKPèßQe*=G¥çP’ j‘:‚)Õ—ÒÎtÒÎ< os’ÐÔ«ŠÕöwþÚ¹çìž5 †=<$Ötø"š¦¬â›]¤úZ" dítQŒµ…&Ñ­¶6ƒÈͪ/sÏÜï ýÌ ÑçÀ‹-ŠVxÑ»}­9_œ;˜8µ`ÓgËC)ƒôlo|¤‡®«b´%ê }ôÙ8Èb½*ÂIów~è|‰Ó¬³ƒá…ð`X³§Lªµ‡GMZŠ^¨^Ù¢J=%êqͶPæêBeÍ ¡ÀB~¡ŸÝÔÑ”L;Z÷ôÙŽ6•RmðãÊ(.ѯøîEè˜[ NÔ' ,Ñð¼ §Œñ³Cx—¾t¡jÞŒæ³Í…o= ÐTŸ¹77q Ãéx@Zsé˰jí™)SIqp Ó¬—.æê‘5f/ Ñ㈨NTe«j-Õj¶ðOn+]“´2ñ³ŽäFæ­rsnp*)ºúTkÀÞD¢åý®%ÙÐZ˜ ˆ±\T»žh¥×ƒÐ* ¥Ý*Å–› æ ƒÁ`¸< Ötø ˜õKiÈy¤!«ê·ÙohÐ< ßJ²å¢ÊÍà‘}/7}ÝwÓsbû^“D¤w£¬ {]Ì##›³VX€.[„¹-sÐ8gé»v:9Ü@Ûœêª7$âjTP”¡Òþü-‡6¹i0<k:üH€Çì£âßjjz¦LÝê„‚”D9¨Pæ _ZZÿ²rg‰¸©¤¨ÍK?f=™fÃP‰õ2ÁéÈ[;çÌ‘nk …™˜2ƒˆ#[{r—8¹µ‰XY½¾\¥Ué†pÚ@7‘8¡CäO½#NƒÁððqî¬éðcá ¼!v¬©@=ej1v Qï‘e(¥ÊJÔ-©õVÅ1ÔlA™ÃÙ@^¶Ìl;ŸvTBÕ’lÞÚ)lpwû¹zn2ÍB6é t?¨‰EÝE´õÊ#_B¶1‰ÔÎÚ0 [„ªîÔ²mÐ\?Úڬĉδø ‡5â4 gÍšSö”vÇ}@a#‡¶LaÎ$ª> 6¦I N ¸‘Ä(c¶í…êbÃ'N$fîí? „wš~GY–ÁÖ—ý)ÉQFüÐæ2fÉÄs™Ô¹œÛ™®¿ØIÉÐõ5kSZ›±÷ÕjmB øšÃ—8 ÃCÅù²¦Ã724R>¡[¸ÈT\?[æ O3'…#ëaqP ¼¡om>I2ñ%¨m©þ iîybÇ@áž™En²uöVâÜ C ê˜èô{…YÕ”N€1±½ìµéz³O¤•ú ‚ÌœÄN†6ëÚÍÀ¯9ü-#NƒÁð qÖZ³´3"°øÎÎóÈWÍÄ~Ú Ú±fiÏ“E’óægr½­€*ëéh#È/‡8‹3Ä”©¾¡#|ÉëyÇO()ËE‹Ê‘ c2íP›U:ÄÔÎDèN—jQw +¤ÈÄÉÍ%œ¯¬ ÃÃÙ²¦ÃO–æey’E8e¦Wre=n&qéÄ㣙A1t74»e1= ñ´:+•Î> L¹zžì?…ËÎÕ®“ž˜/²âÜÜh³ ô.ÙAY¢iÐ’…475§"­¶3SßÎtضcͶž ICr+ˆE¨ÜöW~Âä¦Á`xx8GÖtøÛ€°8uô€R ·ùºÎ~ÚaJ>ÙlyzáÎr&¤<Ë~ZÈŽ›Mn ;†@5Ø\oÞ˜R«µ®VtÛ¶'þ(SÎâ2ìk‡f§‚W¨¢«s™¡.ÒJ’]? t²¦èÉ f½©ÙBÿÒˆXÉ(ÔΡ~Åá§Œ8 ÃÃÙ±¦Ãß)¥6ëeß-›¯† Aé´…IcƒÊdOÐÐÑ,g*•BTCʃ–jÑïG=Øh}×ûÔx.Òú2O¡OP|è^®ú½_ÅeØkjÖƒˆD‰íܼ|@œ1[oâûáNaVM9XËß©ò($oÀ/9ü´§Á`xH8G­ðÈÃ…NSÖ$ R•FPnHeÞô3*ž4hv\ˆDµ£9HLUŸZm¥Z¥Ï<‘%z¦œ9rКn§©y"ƒb ›õýŒJ§D#75'Ñ©²’õ%çê©âlûœ ÑjRùfÙ T¸v•‹ôl ƒáaà¼XÓágÉÌàâ+ÿ9)úЪµA¥'Ì–¬8mUº€,S%Ú༡ý5ÛJØ’˜•‰ÛT evS(è‡O|tà·xôô:íVŒ{;!^l3wеU‹´@bÑ[w²žÐ´cétF Y1 ­Š?v·*K¡®opþ#‡Ÿ1¹i0 Έ5þ®>«€Tf4©Y¢ï´ZÛm ÆQ´¤2•)UƒÞP#“«²&…J!‹Ü”ʧ÷´ƒØP³õ”@‹InzÒš~ÇLëwø’#Hb6MÉæ t„ÚÏeÆZ"—,o¨ÉîY_‰3I;S·ÞÌr«ÙC[Zž…¤WtÎ  9uBÑ¿èð³Fœ…kÛ¯ô½÷Þ³·ìzÞ²óÒš2R…8´E"nDV:¥C øª2ëÞ™¥…IÒsÝ¢LOc' '&î¬Á:z™Iöfe™…­´µI\èäÞï2Lg¢ß§Ú#†6E*Ï•ù’‹´… #•g»¬c“0h—‘|=l*·Êèx4clpê V§½<|òÉ'׳Û;ï¼óìÙ3{Ë®ç-;Ötøûý¨ÉÐÎ\’¦ÑÒ ‹Ð¡Vn—PG9áeBʹL™7Ô×58¡ÜI×&\Œ²héz!(Åæá?Èïgéí1å¦ô 2õ)õX)ÒF*뢷Ëja–çLºíÃ4ô ÜYR?gÒÆNú§žà=žÿÐáï™Ü4 gÁšO€ˆ2j5{–Ú™5\8òQñFÎSâÁÒ3åZÂÔ×ô³WçOdºƒ˜X GJMWx1ô³›Ãð ÷5óÄ…›î3Sbÿ"ˆ>56¯pd¢¹L­ÍF %Ò|Ò¼ÔƒUj¶©gPP6Pñв¨ÔÔ7/–'¯¤XW~Þáq †sǹhMQ–QžU’ìY])A@ŽJ²ÚìtB´IÄe`qé‘ÃÔ×ôµëIbªÓ‡¹CÖëHå & ÏLKq[›kº-ʘÓE@t$8Ã,@•/Qtgj¡?¥*['Iè *‹ÈBœª8šìËV â÷)UYM ­;wÊ ºâž[`Á`x0¸Ötø¹^Y–æe º+W'@ºuÔRx±žÏÒ“6²Ž²ÎL©æ á²éfò/ËE”Ñ_«¸  h›EÑ‹Z­í©±m=géùž2±_³åÚ¬?RªMä•…ðe íªRŒUjÔ%ÕØš¨ë%P¯R¿žYÄõA”e;H¤>ÎáçLn †³Æ9hÍŠÁKò¬Ô Ô7ˆ{¶²,'©ñG‚ nzël¥Ò‰)ÕàSÆ´… •ÏÚì¦éÉ·U¯l¦iöк-ÅŽZÐØ4öÕ¤YŸ¶Ñ§ŠËRD-,( u%IJ¯Q¤dÇ =q‚rkQÄy¬oN›ìì/ÕL›zC¤¯ÉêÓ`0Î÷Ìš?àÊ@dß×,‹åstÜ÷ì#6Óé&ñõ¨‡¶PKî™2÷É´‰ê9Z­¥§Ó$trSM³QA,.±5Ĺ3 Q¬ë+´{rSƒg%m !‘•¨WòÈf’×^'2õ¾ŒhlJšùý|½móʆî"¦1ÍòþT1*…ÙU^æ'˜Ü4 ç‹WbÍ?ú£?rνâ3ÐQˆƒ½ ùw~°TeÝõ¿ÎûýùWýzúô©½;ƒá á•Xóí·ßþÆ7¾ñÒ7wøÅ £ e(3Ày8i[:` p¾íDíÄëÄïSª~]©“Ü[ö5¨ô/Ý`ÿ¡]©õ¼" B5AæO$±ªz,2…òÞ· N,$(u–Z<¢«¥¸t"2ö=ËDO½*z`iWÕ  Åê’-Â1óNDbB,-FYçƒUrˆÒYŽW¹ ù·>/‹ÄLÈklBŠÈ‰®*1¶´ò\Ò$yñâ?ÒY­ß8DjÄ^ÅÇåð¹sü³æu1Ü0å‘н?æOÞ«ú8ñwàŽŸÞñß¾xUñøûz`‡,I@X”¿…)]À,.%»Àã&Tú,ÜàBMª‹Å=D}ÀàõØ×]9‹S÷€Ç° úŒJBÂÇB÷\VnÊ€OùN¢&jïSd­^Ô {sÊ_D«¬¬"þË?Åb*‡ÿÆá À4÷õ¡sÇ»GØwLägø €3#ž§OŸÞú|®¶rZ³Ùù}ÈX[äO¡ŠbŽ4Y8L«µÅõ³xd=¡sœžfÑHq¶EÙŒ¢;“”jÄ×#Zý¤iPÔõÓÖ-9óþ°& MöÍú>T¶·ÿl!ÒØI’a Ú<…’ªjŒÄšådÈ̉îyRÓõ$H2jâÔj‹Ê¸ÖâÐ"mÒÔ}à®Gkÿ šë`eEÙeó¯~ýŽ­*è­÷³W|Óûœ×¯÷Ýz5ì½z›/ûÞ[iïÚ}á~´¦Ã/' MkA)’±iMékÞˆ6-ûyÝÈJQ-‹hÊTv#jR/–õ¾n"Vdè +NÕ¦¨׋ ¢;‹0½)úOÉË‹æCU–*@‹Ä¬_®×š~Wnzý ¢5]MÙm¢nëc%‘Ù¢³T\U;f—*"s¯&‹âŒhò´^ô¤WìºrP³œ„ð— aÕš¥‚CKõS% zÄ€¿sár³|¨íÕÁ@ìóGç­yåcq¸á)÷³yòÞ}¾^ª°ò—{+ïæ]Û|bó¯îcÂÅ¿5Ëý=®“Î¥“i?Œ—D_k³QXJëZ›’äB“0KñMr³<œö2—Ь@¾?($Ž;P’Ñ9Î:-êV$^G9U}zÙJÌ·ÉïEwΉzak ÔŽÇnÜ&Œ‚ôЗ$‘•Y”(âRUfB‹Ç‹4¾éThú&4•Yy°D›š‘ JNP’UJ¥ë•'Y6Ý\q ¢s&3^×ãúz•ûáÕ¦‚Ù”/†WÇÞ«ýÒïΛ{׆âÄæaÿgÐ=°¦Ã¯†jGYhBPKµºÉ 4î@æ8S@ð­0ÛBõ&]ˆ>o¸Z;Wh©0ë¤ïWZs¾ßü$I6ê™@r(Ã7ª5[a6TPÝ, Âs Î#›ŸÌë¬@›ƒ›ÕÄ_™ø’7ÈL:I> F–}…}U–Ü@…)‹ÙGãô „Ê©@Z˜íH” ³…/‡~Òá+—?»¹É¯ëöóùÃ߄歿Ç߯½«îø-¶7 ÷«5'ë,&š,ýÎò$“ÊÍPh"uű´å4>)Ÿ÷^j¼¹÷Ðç"âr¦,[uBçLPsÛ58+wÚ.Z³<ÑE:^žâMkvÂÑ›Ç7 #[dESp+Òô¥a@5“=J„ƒˆH—%²'¡¹j!Ú ¤ÔâRDÑÀw%]òJH5fY‡oÑðJ¢Ê—j¦õÀó+2Óê‡Ñ\v{ÅÅ7ÄĆûú y¡uÛÃ]÷5~¨z°Î–ü¼B“OP­¯3åV¡œ\<±´¸È&b ögéSB<´K)«cV[˜åÑå>K—´ŒÇ”§÷-½½0qmm–FcñÙ:ék:qÒBz–ÅR[Úœ™¾‡Ö¿Ô¯ÖìDsφɣ[›šýÖa¨.ãê’Eks‚ü´åï n[¢oaB:‰º˜õ†â€U«mòm±UT×Ë™«Ü¤¶<bo¦Õ´‹øñ‹ínç°×õQx>c &4‡÷å’þˆ¹¶?ÈîÁ $¦žÚÑdîܢɿý)·VfPõÂ…uÔĈ¾€âE(#Šh!‚\dæÄ늘ƒÊC´3Ëb’æ¥ú€BP¡:´ù“òþ̶ Y¯ä꺛w¢ZvÕé“ÄÅ“Äþ“C¥À$Fãì»3³Ä”BË%TNzŸDŸNêÖʯ‘lAez¨y|P7EaeP9ö2|¢ç\.ïÆæU§”ì^ñœW<Ùðº~Ž¿¤üîlþæœâıwíµàî+´7èë±T…&Mž ¥Ú…fK:[G )”²ÞÕf5ß@J²>tÕÚ N´MÄtð°„Ñ{‚ÍŸÔI W³ Çh‘ÖuZïO(Ïnö>Ñû€<ï–û/mg¦$‘GQÈUvþбޅD©Êf­ÊÆZ¨Þ´ÿ$Ù,³.Ò´ ›€|¨ÕZ=XÕø#ûŸ”Zûs O=Î Å`nœ;Z_-ÇÅÉžÉáœÍ‡¸õ~6O†Õýîé`ÕöÞ;~×^Ôˆt©po¿ýö׿þõ— !{òäÉ %ê9ü†ô2Z@Œâ¡u¡%êiG³Äã%ZôzàŘãÛˆC#K1Ê:Í RmèsÛÅO[Õ45½Äìq_CGSÒÞ wºÜ 8`‘6od’²¢c§‹¬ë¢n(ZÛ²-:$93êJIÔ P†KHeé$ÔXü>% 'ÉJDLÈrmIÎ+”%-¯\\#ÖT×!÷œuîËÿsþ'yÌKȇ’¥qH-B¨wR®-ÇÏ˃Fä„ç±òn¹Éóˆ_OÐ %ê=yòäƒ>8åÌwÞyçõÝ;Na/—ñ»aoÙ‰¯îCkVékÆì Ž–Z!¿E ›WHmAB™ìJ’þSCõxòD¦œ fºɪU—Mæp9ÐMÁk“X[½ì‹TV:>Õè}_à÷…&6¾G½‡ú#êx ¸°IáyÙ7*ur\þÆH½ß'1!£þ9±òÔ?Ð6íäÀ¼¢h#m¥’Å”d÷iÞ[fž§¦G ƒál°ÜùÃE:nhjS¬–‘JµQ:š‰H´•jQÝ)AóÜ…,“,Öai)}AÖÙ,ɾY/ÊRÚw—ÛÖ`µ`ë¨T‹F„áx6¶(ÓSt-j†»¯L™b-ÃÖ/¦I/W/'YÌ´‰Ê°‰æLŠ*Íh!´™è³,õ•Ó` ˆÆÊ­fKc'åÍ)[ƒiåV‹·Pêئ›ƒáœpw¬éð[$.Ñš°Ä„ôoBµ{òdgcJqv.~ºJûšÄ …é¿å­YOMÍîxâÎ¥oyz©ë:‡ìˆ/ I{}à{yeÆ|Œ½L2Iž¦VÊlr“š—Yø’‰3ëPŠoõ*3‰²´¢0}fêkª{hè_Æ~óNÚ©RŸf°¢ßÔ·¡ÒqøMSƒá,p—Z³Dÿ8ùôåT 'c!Ìœf ûNãJ§2ÉÝ“B+Õz‘›ÚìLç˜AƒÄØB"S½V!‰ =íæ¤åéd×§Á9\›…HO®ÊzZ AÃ1úÚ!–Ö(äúé¢/Ò::ß z 1pb’QbjS(š $´¬×k…¶¯Ö¦Ô}DzPoÛ‰Så¦pg3q¨žÛß,lPœP¡9~%dÙ)³Ò=Ue+YöB³£[mjê+Å(_æ©» òÓê™  ÂØ^4paž²’¼x út”Ãgx øôÓO퇵ŸâRØ;îk¢¡…t9'¡3Íb“>µHZ%¶ä¹ƒxGépáj-´©MçÛ¨ „¼<'t(hé™é ËÖ›^÷æ’dÃ'¹cÐù+ê&3§n×`cí?Z•ëHUÚ±µE›ÖLÝFcèçX@5ÛLn }-³lÉ™&ÅYÀÜéB·Óg­ÙÆ[¤§Á`0Ü+î†5ˤæ 4ëË $š²„Ó.´ÿÅ\¤ÓߎÙsý93ƒzšãDh6ÝÂZîÔj­ŽiB¹³Œw«„ Eé_VGn?pâ}/(ý–ÐÄ.eÆ6éц)…A‹m5RU¶¾~©M¢‚n8f ‰ÆÞs¤-̵w¥žùxEsy•­“=Δf2 ç7Κ C<²áÚYi=\h„ªs&˜´ú@¡–U+MAÄ :k•A¹»©æ rhÛ„®Ó™¹Á™‘=\Ù§Ú'ô\ýd í%ftð®TbK;32ç…nŸ%BÐþ$*4#1b’•ÀUÙú£«ÜÔPø^AΑJ½~x,S;óøJ’Wôó¿o­MƒÁpŸXîä!ÊÖ%Z‰-Á@ÏêÀŽ˜øÒI&-†"-÷8%œ¶ ëq*Q6B‹qŸŒµ-Ò]žysö!‘¦¦“¾¦§j- »²x8O¶ ÊÃó›¹í~'ý %qP•qrHq‚„¦¦´Iú;AmA ]7O×bð¡EôÍfŸAGβrXñ¾gJ9m®Ü Ã=á^&O0ÈÍД\¤ZfÐÐç!lô8ÅL2l–äáR/äJG3LB3‹±¶l“º©êK’›  ¡¹ÓY eæÂ—äªíQ†$ "ˤDKýEj^F:Т«æÊB½B¨)í‰@äS­J4uZ3Q/“ë· ÷'í”g7/êÄË0 ™bûM±Ž¦Á`8KÜÖìuäÞ:/¶²Ý.òÁïúÁÖ”Üïíßéú±·%4o=À,÷ŠAz¹ dÙ;ÉŽ˜NJwÌNZ›¥Úào‹ÚêhRÖO}šä›-Ix‰‚a•¥ ¹²‰ú𩝻¦>~àÈÁ.yßf²Œ†À£™Cnû^;s¯Nk j0îwÀš7ýÐWb±ÕÎFíT“öÄ=«fW¾[·Ùæ =K§»X—EfP295ñ ²”EG‰•ѧMQjBFž£‚Ž œ ·ÔÖ°Ùº0 –9'íLHUÄòQ¼¯Z•Eq õ„Ô6ÿšzœÚÈÔ?9Æ‚mï¶­¥Ú´]žÝ«Ð¡Éƒý‡5 ÷Œ7Ëšßu´‘ù ;d9;€0UeA…Yå •r…6õ†Þ¥Û¥9à¦P""žEÉl[*½œ·(f¯Û eØödhjbîh2pf|¿?‰o‘³‘œ>Дڞ«2ù€0ÑdÆÈ¬³EØ5Äod¾Ê,²5ßçð/Ìd0î ËÜ©sª¨F¨LôuÛLúr“/‡•MAÉYø¶aµ£lV™\ª-Í.œ–œA™j³å©8Ê­õJ½œUKÁîpbÜý–!È+efŒ[L§r÷â÷©C4QøLÊÌMhRBl U²K>[§(Z¯-Ì´=dr¢å[4Y|T\ÈMÝ)uS”hEZƒÁpÏXîö±Ž)Nê_B7ݤyL‰¾‰¾£9t:Û­B8ß/ÒÊ€fö-ŸV,CµVåf½ÈYkýVó Êgžä&™”›;7¶39œ}+î'I;–4V‹Ý.Öü3Ùëë7´¦2î/΂’@J‡‘èӆʌÖÎ4 g‡»Óšr°n=ú^›S¯*ÞÚ òTб¡@ÓÃaK†‚´¦iAn GûZ·-Æ„)5‡¯‚ã13,Ö`0Ü+îÆC«˜5eAØçÑÍ«XS[=³^ë»*4è`>“IQ(L£‚TP:"Ÿ ™ãt´MŠ'?mÊ ’{0ÆÒú@ZÚŠdªÊêN™à¡¡ÀÈ‘³Eä§Æ <^w,?û4' ¥ÚM:<ΑÇ˰§¨Á`0Ü-î@kòaóã:ZäúíL–èc܇u¿Óï(T–¿‡Êv…ƒ¸d݉¡H+s)^*ºFWä¦dšü´)`IÈvó[…Y‡ÔïÖWeºŽ bY›ÆDmN9XɤZ KUÂNGsfDli7ÅÓ$æ¦Ê´ ­Á`¸o¼AÖtø³þ‚TÄéùÌgªu·IO|ÔÅÐ'ú p`PlïÒ[e"Ôºº$-áb0ñœR¤õ›S{À n¡*¥šÉeà ±J–±ßÀËñv%r“õh ³|öûšÇÅ%×foeÇuçþùN‡mÃ'ƒá~ðFµæ M•ZVé;BÊž ƒ³/*=Ñ ML’=‰êzîU)KL§c’Ÿ‡~S”áþAÖ\Pn­Æ»;Ú}¾Ûe¯£™ºm¥¹ôо=ÙyyB—éŠ –ë4pÂÇñ¨ÜÄgÇa¬eoÚ„OfkRŒöÿÖ`0Ü–{zÄ[t§¸d—žqÕé=…ª“Ø šH{–zQÉrao-:“'Rº^&h©œ«…\ðhJ‰Ùóp®æ¬‡>(ú#@[f*Í€vûâñ†˜½9ÖgfJöʧÌxTkvûމø›h˵š:·¶3ǬÁ`8K,wrçnºJW†~g˜N.ŽîY=M4…ŽÏf+ú$[بß:hÝ;÷éz1 všNÛ¤H~*Ò’ÐŒǸ»-ɰ›tì¿çÉ›2âJD¸‰Ü¿eyr ͦٴ0`=z²y‚ ýâXs=í aV®È…­ôb$ÐpŽïi¬œWGO¨Ò/bÒ®gŒáb¿Å Ã6)y.Ҏʬ¥¹ %HˆÜ¤™MÖÑ4Ú¡Î šÁ©ëq£©¹Ù°L'‹Å¸Ã‚§‹KÛžÚ`0Ü+îxò„áö×gºw^Iûœ:PÄ|UšSoóñÒ |ËÛ›E'¦Žiç-’ž^­ÖrÐA?m’FM9è9æ›N‡iIxâô¼åÚ¬Ðnú€6Nw »•çväº#Ž, ýâͺö¯Z_üYaÙòyìwNã?$Ú.ÑÉ,ÓŠë}C-ˆF9ÛdçÞÏF~Úìá]Ý€“÷îí?Ì’y‚lùÉ;NÚY}æ~%îÌ™¬Gë«èK¦§“_ÁóÃøé;Ó°æ é–a.ˆ_]¶¿o‡¹—W÷}@œþ·H4÷ ÎMÆ} íñÌxòwk^ †³Çr~w>sØž¸Gouäž™ ÓÑ›3GÎWÚãägì'sƒ«jw˜3Á”.›ŽzdÒ~4o±Tžh’™2îÛ‹f­y¢Œ/B¢Ñ´¦Á`8;,áI†—º•;í4¿µ˜÷ïÍíŸï&–mÛ-mÚÔ#oØnÕjGÈr¦Õy““uÿV·~ÅIkÆ­&«±Á`¸,œ¡Ö¼F8L-ÌtB‘óHW2Àdù4j<΂ñ^Ñ«Œ}8>ú裫úyß{ï={Ë®ç-{“ÄörÛS¸×ôè¯r?ùï6Oמ$5é2ܶê=þl6KÄyçV›Û¿ø­[åÛ—1'éßú¸¼Çø‘ï:A;7œ5>ùä“>øàJ~ØwÞyçÙ³gö–]Ï[öäà)Úâ¥MEwÚÖœœÈ5”í¨Ó`è=ñNËiAÈfÝ9Ç÷ß—-®ZoãÑá)ùýÎMwþüJþ[ †KÅ}kÍW·Ðº¼•Û²ÐÎsólŽb·ºíljý %x/!¬e×êÂÑ!ÑM´”>'½cL· ™åiçmHÎ~êô†iZÝ;ùˆ¸L'7 †ûÁ=iÍõ¥Ønñèis$ß^f_žS¿2ïNíúlj‹› ™Ù¬ÍàÚ¶˜ÎE”»$£˜*}ÖÆž«˜tÃ(þ(óç>ª0ˈ*kÓÍÁeë‡WÇd‡Y ·S˜Ý#Ëaјƒáìð&YóॄÁºsÃ[£ö®: ”·¢âΞ(}²^Üòè UΉòTh&Þ¬ThcªrsÏâ›d§°Hª´Ó¦žSèŸ_Ô;T×ÍÓoÈq¹èï…°EØâK'†Ÿã¿œƒÊôšh0 ÷ƒ7¯5/Îö¤äf í‘sòÖúPŒíZT$ÉwâOk;&:-pu×[ä@%ÎênÆ\ÅeÒ}Zò-¯Wïtí{3 2kS3ÓJÚªßÈ_@›oX˜¶fÃkº­ð‚¥'ÑYw|iÔ`0Ü3¹Þ¶ÇÉpñVw½äZ«£»qý¢ÛØs³éEl Çáª#S‹©ÞêånNp¥µÙ™ƒŠ°Hs ·S3ç ûfišf!T/EàŒ”}²¤c✠[)s,ù•p[LɧPƒÁ`¸ÜkçBEÜ:a>4¥ô£t(®2›ÒbÀÎöš\ƒM[njvÊ]¥~Ú$ÐÓŽµüZ«²‚«Ð,[„Aˆs¬Ö*ùfY„œäyä­!Þa;lu:C¯£`EL•Y7†&]c·ªƒnæ?UåìÆé MÆZ.ÌÎÞä¦Á`¸Gܹh½h¿pÝâ¿y±:¹1YxfS羬¬ßc/ÝŽ°ÎãçS9j¹zŽ/¼qÖ=¨C¥ÉÌ[JG„Z¤ígQR¬ÍËÎø !Ñ ¾nÃÙí¼­ /Ðû¾ÒÏï§Åej/ïm}W´¹#b¢‹Ã÷(Ý]¾ç´%=/³$ûøñã§OŸž¾~ʵgþóê1ÿ{ëþÁ‡ÿÞåãOï:ß2Æ›uÕBhÁæÌFÞÒ—óÀ?‹ËáãÖúLœÌš‰äÐfAî™U ±tmsÃö-Ò8fu%¨Mp¾=Â(72àJ‘v˜E©ÍÎHjo®Ír9—º›ÝˆHÞaнc7íé+¾_Ÿõ%¦?@ ÉRs®”¿ ã&¤„‘<"¤t\^MËœzHh@/î­_ †ŸýÜ~üSþª»¶·Lñíˆù/Ð…8ëô5‰²¢WÅþ^‰èŠ„±Ï`òØ8€Þ_Œ¥6Y¾GÄ)õw›û(»ñ€t@ŒHtŸ)¶•¸"­ˆ±¤ˆ‘"rBJÈ©;« ‹RÊlΠP#l›€vX)%ÙоªÌÒËTÃm‰;ð·}Ýl-¢{ˆzÑ÷‹Jrå˜×—i´tÙù¢]çòŸ]À'æüçüÕ~ì}XxöïÍe²† N—[fŸQ\æþüõ•úà6drÍS˜i,½xzz)QÅXæL¼£ƒˆ›À3š£â,õ[‘›Å›#º“åfg¹>6BdN£(Ë,#˜å]Y€•&XÄTÌAõgþ¨ ½Ð ýbš‚6¥§›6 }=V7ûW1vr¼vD½Í·22~¸¿çö.Û/RÁ›ÿ Ú”˜X_ôVq9/öæµÎ'Ê/êñFXù*“YJǹޕŠÎ¸"®´e²ÜùÚî¶œ–V ׫ô §ª5sD‰Ù„fªW刜hV¤èN—…GáiX“iÉF9‹í6?Q¢¾×¦ôU_Æ@& m©zR“èE§ï…&&YÉÊ’¯Z¶òŒÂ–輨Å#ÇOŸ>?%o½·½•áL~N$¤;{—ì ðæµææÊ¦ˆiÓáªuK_’Mè}°t1¸FæîC¶ ˜ºÙ’0ôb}'7ƒm´>·vfÑ—ª»üÜÈD§;}j~ZÇ­MÕõ8×iNòá(>°ç6A ;åN†¿–’ÔiWù­X{ù(Çjèm;…9"T•˜±_L“¦ ýúžÃö0iõs“?@7k¹Gîs¾Õ½ëƒú®/m«¹ƒwy¸·YõžÉ¯Ö}áNXs¯ {äÚ‰>cž|°h+a.ÞêÉÃ` cëJFÂ8ˆæÜÓ$Î^©SF±·¾ôqÏÉZ:àR-M¡¸ž2µZ‹îb}N±kÛ\J9» –}Öï‘T£#K/ó+òÐö„ªÔÞz®I~ÙR?sÂwµÉ£z+:¸®Ô7}«;ÀžoöšñÒ¶š{­ø‡¹¯[Ñ1tU®Ê zô“!›æXŽêM°¼Ño«åD,ÎßËýezò¡Í^Y,A¦.&ªf i…sp@B‡)vгgª*/GΔ™¶äf–¾¦GÌÝ^)ŠO5õÍÎ>º=¦zÛ˜eâÃ÷YîÏ ê&yJ+­çê¥Ø­´Z…ÉrÙL¹YJÑ ú}øXÜôúŸþAlxˆ¿ ö.?¼á¾æÚܳ5|¦è…±XOËw%¡¸ÕÝäÖ¦®ÌÍaæÒ\#RîZ›µ…§Žæ $i|ª‡¶›Ëê@„r]5Ü®•æk3Q_s•6gr¤m™©¯É­M5Ù–ED1Óv N/Ä&ÜSÿpÕìT™/-R_õµZ[mA³vé º¢ k%vî\î]Ü\™Z•õe•ŸNj’”椽¹’Ñ‹ùYL\^Ì[foeÁ›eÍü—„#;n µgÊ#‹wNÄÙRÇ<â4d7ÆNšQˆGGr3©(‘á(„#+q¶9“(ö² ñ´I"O•E(‰Êzå¹$a€Í%ÄV Ð†UºGºÎþÃqµÙgÇ%ÔLFå p6^A “]ˆ˜µjBþç—ôßoOdèÇÓ­Ÿ_›–"6qØ'ÝùÃÞ凅;Ooßtñúýãúê«z¦ÎeÀV3nÌ–4ë¶0§Âlët¢fÙÛ[T¢¤© d‡ÚäV%Ò‰öB©3‹ˆöUYíXè¹íÊY~†è‚¼XÍ%`Ïõ–â~SϨ/¨'M™Z6ú`+º-õ9°)Wh}£ÆÂ -ûpm´ÚN3 †ûÄgÍüpdøÍ¼ãdÙ_Lý, ¢¨À½¨¦Ø<Ïí9/Ô#é)×.¥öXA ´ÍYNÈ]U¶µ6#àá±xä çǽM”F”¬†wèɱ£Î.L1EeBd¢pj}®^ÒeϪð‚Lgºj®{mò†*h"2 «k·Ëàg-…ÙØ™oë9^BARò@¿ŠûµÙô1!ÿ¾ý5 ÷‹;©Ðv‰plgÊÅÚƒë˳ÁM¢S™X¨1¡cP?Ôf™)S߿Ԭƒ øÊ”ÜÔl¹²3;Te¹‹ÂNH¹²P¬ÒEÌé¹tP’pjªÜÿj mOƒ¥ZK†[®¬Bj³ms1GÛŠqXZïë´©¸Šå94A™©ßÉUÙE+MwÎÃ~«ÁÉ ší¿«Á`¸wÜU_sSSBä`ßάµÐÁC»ÕËlRRÃþSN[)îf2Í&5 êÒѪlYDÛ²(ÈòÄqŠº YÎ$PÚê\ês#Z/Iú@l+pÍ$›–4¦ÌÓFÖ®m^ )ävöŸ,Õ]NÅÓš5‘\-ð†±º\¯ßPÌ#ev{y‡V¡Y\B¥Û:Tb™A³u7 ÙàNXS(3¢ïhGkÜQ¢Cج«¾˜z±¨º9-dú \•ÕkcýˆÄõ5!„*d¢û–€·˜Žƒj;MÖíð¢<Ù®£Ù›€ôÅF‹”Tkªâ¬±¡>Kå¿–´—ûyM¡ øÆ©NJ¸‰ê±©—§<´©SœÕì#q}턹B;±i|.É^ž^¼ÓßUƒÁ`8Š»ø$Ê_€ûÝÞ;P#&1º’ %—lˆ}y–†fЫ¤©—ôQTnJ¸O›6AGŸU¹µ‹Yì?Îî#‚CÊýŽ`.È JÓ´cGS)¢fÁÛ$žÛÙÏ«í#†~(ECh‡M­sÓ…ú°{h(Õ‚š ¹õ/«ƒ—y—-?¤2uò¤³ ÍõØ¡ßIr³la–ÿwûïj0î÷1y²nóX†õèšYFL-ÌžJ[ÿRyt°ËJll!+œõºSf_§ö×ú1ÛÞ&ª>Ës uì2QtHlŸ·@)Æ"'S›ºêw'ÖY'q‰2ƒˆ&™#Û,Šo6Ú¦5#Mg:pÚ|Lu¾¥dôÔžJ³³fÁ«Ï‰é“Æ4S¢!Î,Mà0¥ÑÞØä‰Á`87Üa_´ 'ɸ¼w[YÄ£©'N¿¥8›(!x:afÊ\7´*ê}/=ËãGÙªZgKÐm1]ãÚ‰/á´ÿ—ˆK­àÞBœ©\‚4*I÷¬VîÜ£Ì4rd}-úÑ””Û®ÔJ–)o1è*L¬œçLtú³TYånëi<=ÒËÍòÐñ@㛎Ò›9yXøðÃíE°·ìRqG¬™î ñ;ÖYæÑE.ëÁíx‚ˆM;76kÿÒ7š*¹êððjÿ‰D–™ ú m‘€ª8=[Ðè¼ÔT‡4ƒ$š{{„õ¡zz²>h1…(B%f 1@Uf3Q§3 ÕZ´Ú¬ö;K¶Ða«ÖjGÓ“(Køm$îD«ÖF’•-tþ t8WkŸ£þtâÎ_·ÿ«Ÿ~ú©ý°öS\ê{‹!rv¥tYP0Ûë’ç}Ó—ÜÌÔÝdz#PŠ4¬™$-¨ØbeÉ¡BÛ)N×|¹)U-B³¸d©¯Úéå}â¬Â4¶k½èÎÛŠÈM5fáNTC °[¡™”¨V_µ»$ݳ̠I+«YÞGv–[mUhÁ‘@Q¶4)¯ŠÒ§ùf Ã9âYóÐ)Ëx½²aȤҤŠÎÔ÷8“(EG÷“úî&eæq²Aѯ­*››ý§—ê1ç Û¼f\7mÂ#¹ßr Iwd‹M :Õ@K;W'xÈȦÆìuEZÝnÓË~lY(ÓoYb›3Ñ}Tjì{’•Ô ¡É5ØPÿN©vFé†NñÖÖ¾é\žU65 †³Àݱfþa¸ßê3f±[¤¹š!nøfÙaë7}@®+Ìê´IÐP9á?Ÿ©*›„#{+Ú™ vf"OP_k…¦ºzI”íÐA'GJ ÒH ÄµYu ¥*=«V-µº×J=È´¡X– WëËIFMÛÉI‚l몄­ÖÙ,­8Úó¤Mßz™õIpËÓ#>—N§:€–-÷,—gbDþMûj0Î÷”ÞŽ¾ú:u1ýV Ð0ˆâÓÖ䉻¬°ÔàÊ-ˆ>}êo(Œë¼˜i% ALM*›Ü,½L¦L9¹ªHÏ’Þ^wÖöHkgjd¹R©¶4„5Ù 7¦L«°c”ìîb€Eôk¬]ÏúD!ÖÙç÷ó+j0 GqçI'v1×qÏá©~ôù­fGŸR¡-¥×ÖÑÌ"ØJV­Øh=…yo5Hù2·j¼{à›!hŽk"eÊ5úŒý SGŸ_Ó}UPBSXne–'Xrbëâà³M²ûf¦DÙÔL@µ¢ëy¸Tbö$Y¾Vkõ~Ò¡u1ËùÝŽ(Pêjе6 ÃYâNY3ÿ(Ü׫t§Q“tèG6Ñ©ªôÐû€œÌ¥ÂÓôöµ“•,×¾£¹"ÈîÎe%®4)¢GÈmr¢Üèeë0Ù|ROÅ(„~‚s®ÓrBbWªM/˾(¾m“VM@’7_9Irõ\㼤QïÅ4¤«ì,í{¹ÉFÙUÈK¬~‘’ÒË,LÙ©LJ¡fs åÎI³$¶ÿºý/5 çƒ;ך‡‘,G§IÉŽ&ㆨ…òxšK¡“FŸ‡ÆŽÈmΤð®ÚbëXgjy³^j¶*ï:¾D#×ÐGåAx@3t=ÐíÈ=ô{Só~aª58 ª :”g!“@Mš…ZZ>­ó'êÖl¤ˆÚRne²,ۊ²Å:[Ö‰)U€Ö 0È ”çˆjÊ}^ÇZƒÁ`8#ÜCÓh×é*Ì’:k…YHw’¿“ú®g<[™2µ¹ÌaΤÍhêE–Í,UÙÔúšmCMên–™“Å#ExñþNxjÓ·–«újÚ oíÛÝ7Yé€Û9¡èT Èmr“H^ñÖàŒT­ÍµåYb¢n³(ѵí|’¨»YGSV ØvØþ£¥Úb–®[KµYJµË8mRshËÎÕ«ýÿ4 熻fÍü·à~u£0f;M-ŽCõ|¢EŽÊSúä9)ÛÆò‘®9ì¾omr_36CìÐÝô²fy:™ÂX]ßÔô½Ê\è;JxÅð ’™HF?½J^©ñ:ébz ïhʨIË7ð’®®+‘vË•£ì©©ÕÚz–›«ì ýg¦,áyMR¿³z…R7=Þ Åþ‹ †³Â=5œdš•ãRJ­ä‡ŒY5)SÖJïðB«™ê´ƒÐÔùÆUœA¥ëDqÒ™>“Á3!¸Ž/Û~Y¢à½lO­T +³è<²/ŠNªTâLõ @ѧÌkÒ£êÙUJ¢m1ÝRô”&ùiWñPyŠ>@“›@Û•ºÆ0¤Æ«¦¢ÉJÞÜï<¨Ü™Ê5̃ÁpF¸ÖÌ?÷+@éÆÍ=Nij6W-“hêL@•)ûÔYÍêê´*4Qõ`PgP ™Û@®Ù¹<‹æóñç*´6uØw1±_ží¢kS—{£T£S½Û"FqdW§-Á»-!MGÖ•ØÆNŠÜ,¹u.³Gm[Æ&7ÛgAhöŸ´žd ª30å¡§©Ít@L&4 Ãâ>µf¥4Êž nÚ)lk:3Å-¦ ƒÁp¦¸ÖÌ? ÷·bÜËä‰ ezšÐÝ”WÀ#ˆ?¨’®[Ð:æç5¿ë,Wh³ œ”xtt ‹IšA”œæêI\Ÿ”ö&eØ(/+ðç^‰¦Êì6¦Ný8Š´9cªåQ§u`–›jüiÍØ¥°ÊšlŠ3Ëtf$§nX;s@¡ò ­t@Op.u§°rŸœ§¥ÚŒüßÛNƒÁp†¸ïàeD9dJY °¥«WÂÙm^3”’aùXèÓ÷)}í\¡U•9–jÕþ“z¾TPœ@î_ÊøP‚{Úô˜gøÑfAr³šc•PS»“6]SîaЗõ8Læ ¢R wÆšf!ÒFP¸B›¤BÛªµkK9hÆZiaª¦Lž’fH1 q>û’ ²µ3 ÃùãÞX3ÿ×p¿(T'3­xªÖ&bJæÔ$c—±êßçJl÷¡eà$7•ÙB€d S7+(Šö&Ô º¦’eúÈŽi‹/çÖfÑšª\Ë.(µW*QÒÊ3ÌD‰©{¡ä~ø„³ˆ"þâV…VÛ™¾…ê~mƒžžN@-ØF‰ j¶ 1·­4Ù:[ò/ØÿLƒÁpž8 ­Y÷ÛXÉÔ`±ÂK 3NM͈ÚÔ,zT»¡mÓ=>lxhK…6È®–!÷áy‚PC_Û,Ê@“ÃÆs_.Ñ‹Îâ’Ït›%ÙÒ%MÔ7•«ŠÊ\¤f åô£Ÿ6öÜkÌÞ¦'¨ò¢VhcÝ¿›Ý@É·öZ›][ÚnËF@­ß¶È½òKI¶Ôcëóa[Á`0œ#î“5óÏÂýC@Í´¾ß;³øz Z©ÐÖi“©©Y+·ÅþÓÄáX ³ÃÚÁÈ—“Ü„K {…¾‚:Ue~º˜w¾bêv«ÖÙ•LM UPŽÌÝ,ÊàŠýœ±Æñ´Â¬zh×F„eŸê¸9|R*´ÚÚ\+ ê>'ջăR§­79†ž#fšƒáœqZ³¦´?—`<8Q^ôlÿ/M«ÊªôŒ «ˆ” N%˱µy¾\é@d#G-±¯˜€6y1Ò"´Áu?ì]ŽÜœ×Œ´I P·¹.µNR÷Ú#ÉÃW5ÜlACDmlyîåªT^»Bc¥B¨©úçÚhµ¾HåœUkCkdVeYl´Ê©Ú×,mÑòünÌ:k0Î÷ÌšùÀý¼Øe]nphÛ„Ê©Z¿²t[ÉC³Î¦]¥Ñz¬ ¬l¢TBhyVÝ®Åd«X Ï ûU›X·éÌÐ)WÞüdørEË®ÚúºI-¤8œI_z°3Hr ºëzê4HhÉ´u4S(³Te9¶hÊb­“—+õ&éb«ÁšÖ,4Y9µ¼‘eã°çÈØÿIƒÁpÎ8ƒÍ "{VI0­©ûŸ„ÔÏ¥<¯mÎzB¬3*ªDUDgP”ã@­ÍŽAC£ÒŽ/#B™ÎômºC§M"àCvUbÊEr$Ù4HO–ªnËT..‘UHT›-Õ^ë£'§¯î…2p§—Ng™¿\iG”@æ  "rIZª»:—k«ÖÖ‹ú·É‚(öZÎ ª©³‡sùm|3øè£ì³æÜðÞ{ïÙ‹`x ÜÿçTþ9¸'bíá¾f±Ë®ä’ú­¶9Ǫ¬ë²ž…#™}t1O±֌ن n:Ntq°Ë¦Ie¦ž8];¼g}SWªÍ ¬5e““nìÍ„ˆê‹¢LY«¦êë rÚÚÍŸÔ×J²R­M™ìL2ˆB Az~ @¨Z3fäÿöRÿ›}òÉ'¿ûä?³›óÁú/þÇgÏžÙë`x œË_÷1‰IGj°)÷UYW“zÔ¤qzõâ¡muÇPGS©±´<ë¢y þ @åÙЊ´õ ÐÔu_;—Ãa®?f­9l+æ¦-6ݼÅ&S#à­©“'ÔÚÌ‘TŒ?˜G6u÷.Õ²»'’9ˆçOúý5Kç2ºFfÓ‘:²I+5½Ý|³ƒáaà,X3÷÷û¾æó õ¸ [N諯µ*ëR‹´mÔHž –¶NÅØ.ñ Ñ"õ~B@ŒðAv@dYÔ§›Xs Ô0‘ešŽ£ô59ýÀMZ3Ó˜f¢©ÍÖÚlqÅø£Ü™)Ù€´R¤ d£%sPÉÏ‹åÓ¢B¥Ï(”YŒ?Q•%ÚÈf=A´fþ{ö¿Ñ`8?~úôiù~âùÃÊ)7<~+¾voýôÇz@8­™ÿ;¸¿Ûúšµ37×iŸ÷'¬T}]»3;mùÌgéÙÙhB¨"Cë¢@…æ )˺£ïiÚÅSà.ïd²IœmLShÒ‹å§m[Ýû€²FˆôŒ"‡Enz pGåѪ;C]¬”¨lKL e–Äy=b Æg‰Ð“9“¢#uì¤Øt‹½¶žPb ~Ö> †WÁÌUÌX›ì5Üp>çÈ­ÊU?žùû˜’q^þ‹ø¼ÒKH½!H†OÔ+ËÖÙ–¤s&±÷ЦÞþ!Î$ AÔÎl[ƒñŒfDðU—BhÒáD‡ ~U7ÐG¦ãã(}Ð:€J¾A­Ðö¥ZÝT@¨Ô˜·¸S âQ†L@”©ÓÉ{žHW·V\C8©{SëE®ÖÒØIQŸ5ôÀ`0¼ŠôÑÕÎ7<ýäáV׉3bÍü p? S–¡4àž‹9–Z˜€]×­ª¬ÎVæF®#qêì&€,£(™øR|; 4îL½ú )½LÈbjá õªk·©”hR©1÷Z³,Few÷Djѵ踳 kf¡FHƒS©4´ÝÁjËs©W©ôªjŒ‡Æ‘é %…Ü6¸ ò É Š Mƒád(½•ƒ)O¼íp¾ÞɦjÜ»ÕË=ÖÀŸÕ³ÉÿHr¼¬u„¯ ÁµîºK¸w¬©¥uhð9¢ëz<Ôãrm¹ŸºRl(rPï-"=G<Ô­««§&$ÉH .ÁE¤ˆ”ä„Xëºe½œV¿âô•Sý®zqüŠí å ! ÷æˆ(_Íž”jøCL-ú ¶Ž&„QÓ j±œ“@e:%ÔúmÍôÒé,3JùYd]†RêU‹ÜOÚ,ê™ùgìsÐ`8OŸ>-<¤ßgZRœ«¦/¡,ܪ°,vêº/§bÏç8!×ê´¥*›ºÜvÍ7è1]? ©'¤Úïl=K+BÙ{##¹J«µqCtiLMYö×D_•åþ%H\ßótq˜<éÓFÍZ°Õ‹«EÚ’OËú2v³(¡/Ï–û d¬å wja& ZëÏÅUgCÐZOˆ‡±Y~åâ‚÷ ÃëÄ&KÝ*ø”ƒ÷<>Gn5(Ô‹/Þž—Öÿ‡zP“JUMŸ‹ˆ,ô9€ºXíœES–u—ýµX‘D°–ƒ‘žWeYå)‹ÎY½õ‚²¨Ì""Y_:ù‚¨ÌõZѾVbÍF kg‰ä…”THV2Ö²KHš—õnCì…Ò†O´)Ã'1 ÿ„ý÷3^*ïŽLžpiô¥GS {8Ó ³ü¸ïQ$x'õ[:KmÝçË˾›CÄA¢ùE™×ô¯Îe>¸0 Ï#ît›ß]ÛùÅj¶k"¾,¯Ll[’EÍÔð аf”›«3¨•jDZ É[¥£IÃ'£±VGPÐb "yhËðI ]’{ :Xß·ÿ{ÃáVÝtÞ¹ÕË]u8ëä϶J¬Ùp•âLä¡Eg¦­YÄO–T > >—ÄŸUº›/‹*=ChÑ@…ÒB€K:JÚ.j<êΕ—Êœ[›qJÔÓ ƒu>AÍ0ãÑ‚bjÜê$ „;‡F&ºÈÙrŽF)¹– lyhy¿°J™ €z`1@ÃÀà­ þX½8ߊ›šåâÞ­ŽÜáñ«.çËšùŸÀýM ”U9ë @Ê­<|âÛb“ž\•M-NzB꘡™T"‘sa 1Gƒ(Ž*±¡Ÿ3Ñ«rŸ@»Ç5°.uÙ@Y6 «W>Y@ΠHF¡¢>ËŽ›1Öû¬ Ë¢&¹< H‹´yô¥C ([l.eBµi1­´ ç‚üeûŒ3^/Ntî_<1âàU®ºœˆ‘¿*¶ÜYšG >ŶÓ-ÆÓʬH<Ð :‚ò\ÆHŠ™(ÖM@æLŠ ¨Ÿ6awO™QÉ|s¹ÖoÍŸè×*Àd¢Ó Ã' ‰žB‰bVÒÉ$ú£AgQª9(WS–ê Š¹]l®Ÿ<­ zÔée/kÜT—šŒŒ2 †WŸîç¾7Sþu¸‘Z8q½ÁG˶º¨T‹©ùœ.fÄØn…Ø<5‹ðË#«v ”‚ tРŽ"8¨k°ØÏÕÃÖðÉŠfêi+©†íÕÎ%ài %ÐzH´ØÊ³è¶ýÒ,Y­âÕÚš@;ì¯äÏ™…öZ¹síʳcƒs¤]›“¨ì8›ƒ0u72 ÃÃÇÃØ8ÿ&ÜÙ‘4ß,Ù”8»±“ç@  OÐK*¿ŠW¨éÑÐl;lÒ6gšdå&2êJ¢6'¶L@¼ § ]ûA”U8ÀQìªzâMW6U-¤¸´ÖæÀ šr€iù¸T£l·¿&…çu~ZqÞe †‹ÀÃ`M@>ØÑmø5Ú”8C‹¨õ¬A‡²­ˆ¸@;œx(OM\.ýV›•¥lRlö7 P¥ÀÁòƒžGóÄšª‡q”@ת9HÙ´xˆª „øicy¹ZTPT•pÚVŒ½î\ÚF(eŠ·hȤ}@¿fƒÁpæã,ÿ6Ü[ÊA8Ywˆ3Y„)ª×4ˆí¶p‹—ÙŒ;¡YØN…æÀ#F,Z€¥çÀŽ¡—’Ç/òÊ`í2öRˈd%€5¶ó9Í }–¿0jƒÈÍXˆJEDÖÛ)ªo¶Ø‚rËqˆ2óRíBe¼ä€¨LyÓº›ù‡ìšÁ`¸ <$'ˆ»˜+Í@ÈG®ª©³’C;¸êÉR°UÐ2µ6ÕûÃ)Gˆs;qºMæ$7÷.òfa:š™É äe«ÏHã›MŒÒ>Õ­Ó™€5bÁ”U–£•&‹]š¬,'@èS'OfQ¦Á`¸ <°ÒYþßàÞEL}J{ê‹·T•ÕÁMôëÍû#Ö¡â**%Y½2PS ±iËõh³°…8oŽn’›è9C1V¸°S¢©³Ôra½Uõ¹Æ&=ùžº§–dÑF¦¤èÕÍ5ÅìS~…Ò*©³‡vUijæ¿fÿÇ Ã%áá5œòÇp?ØâJ(ùÈ l—ím´@cJï£ Є‡‹UƒêШôä^&jHѸqæÐàľ¸´i%Ñ4ocÿ‚ˆÜl.!—¾§ÆUKµXË͵›Eis&l ÅÉy³m:…Æ@‹îÌÕþƒ † ôiäÿîó»ú²mU~"%¶ îõFŒ|úÝn:PTÞà˜M½ ô¤Jý Ú2À¡õX½ ½«6Jk³²`ù¹E\®à,½ò’´¦f»Ukm.ÍïSÝ@D–‘g< d¬¥¦fþûße0.ÕܘîóÛ4© Î:Ê r%ÚyD{Ÿ"Ù+ -Ìz¤Øº˜„,Š¢-+©—• åí…>å=¡úÖÄ0[¢uZrO,g»ƒf4Sö† .«–7jgQÚ¾cr1׋"p›ˆ§SŒ2 Ã…âäß÷¹V†UšìÆK¦áfÊâ *!ìê•M$4OP¢ ­R¬ªL–’ðU&rPš˜D®3k& pÇ`*]ˆ)q¹J B— –ggšå¦|šÄœÆN@9ìœ ”¿ßþS † ƃ¤ËŸÀ}Nt$ ¢ÔvfÚhg–sºœ "È®4(õX•¢—¤i«ÁÉÒÓ÷¶ ô±ïÚÔÜ@­©Bh\9¡+ض=/å@DaåÈ„XèÚ-¹I3šcƒ“‡R$¨nÿ2 ÃÅãÆÏó'pß'ú²èŸµ… Õ:j±ÿt$º¢,›Mw2M†‰#7Ý@âïOÐh&ªÌ ¢s ÂJg¦¬œë®äž]ä&˜ôåD¥ÔÎù}@UÙ6j¢nÛñ`”i0®Ú’ÿÜ÷оô²¿Ça *ßµµ‰9Ëɺ3ł푃Me%„ù›¢3µãƒ²lÏ”A~¸ÐìñÊ¢›q&šN!*%K-¨©¹g’—¾62¿Ïþ/ †kÀåDå ÷Ý’R ©Öþ'jd®£‡¶éÄ„ÅÃÅ1i6‘o–B5ƶ2(ÌÙO ‘›Ë´§§‚ívy8¨X¤E6•Û³¨ž)[‰­K;ëKžõ¬Á@G<´5*hi»RÈßcÿ‘ Õà¢Bó€ûl¯/Q•SóÐ’'hé…¦Ÿ ³,"=Ù…Žlyd“ 2Mú’É’Eç° õXž7Ð[~@n *ƵÙB±›× ¡2MÊ Øõz7Pþ.û_d0®«?…ûN-ý ŠNõÐ6]Õèm!9¨…Y¾È6Ú¦eì;ÍKvØ…:è˹B»Q¶M]yö õU¶Ô¢>¹½6K›?ˆ^9–x æÑºŸÚ_¬?°Á`0\ .s3Šü¯á¾Í´ù}È›] dI_\; A ` ÔOp²ÕžÎ„ÈMôÛ‡±cH-?!KlÕf•»R-/¶1•©N[õä8»ýç1 Wˆ‹ÝÂ)ÿpo|@Œ“¶?òˆŸ‘üXfÄG¥ßÙû€6yt(º‚Îô;ÜÅ‚2mñå<µ¹i¦]¦Y”e*ÌÎÌšCÛRë´}:¬+ôy£ø†ËX³Ã§¾Ûíö87åfÞ/™/ú}M9ÜÊoUh1k;ªÊ)–ö@QAz&Œ/ †3F¡ýÜ.ÚrðöÛ9ã3þ8ã_f„ˆá#R’¯X¿BDJÈ 9!%äˆb=(W9¡|ùØn®_ù¶¯Cìîä Çr-"П³Êb§I@ÂAÎÿžŒïÊø.£Lƒá¼ÁÔò iæb~ÓšÇðÏ…Z>çF}©»ibK‰ú-Ñ9Û|N½·®ÕÒëÖøfNc¿óû& †‚ÍêâÓ§O7×ϹZ»÷ƒð óz¹ÕfQwïüÍ;C0­y>Éø§ÿ47u¨êÓ—±N’|"yšªôL/¥5s¯#UqÝ9 è•("þrÆ_ÎF™ÃeâÁ58‡'àéÓ§åG`ò+?×°¾yþ‘;yC0­ùbø}¡ŸwÝv§[²rÙךC_sOk²zNên‚ØLCÕhÒ`¸tá¥ïü¾~vÓšw„_6’3 /¦É=†xŠóÈ¢WH›ç‹oúÕ0Ö4 †³ÃÀ G˜à̉óÈRž¹R]9¾õ'îjsñÂXÓ`0Î{0—j/àÙôÇâ„„Ó_ ¬¯i0 é0Ö4 ƒáTk ƒÁp*Œ5 ƒÁ`8ÆšƒÁ`0œ cMƒÁ`0NÅ+Mž|øá‡ø‡h/â5ãÜ~Þzë-{S ÛÃ+±æ§Ÿ~j¯à5ãéÓ§çö;`¿“†3ÁG}d?ïEÂR ׋?üðÎèÿ±—ûœð¦+_úÒ—®êõ¼ªŸ×½ýöÛ_ÿúן={fÿ‘ ƒÁ`ØÃ“'O`n ƒÁ`0N‡±¦Á`0 §â2YssÓ™{߈îÈx,8Ãçf0 …iÍ{†nŽSp w¾.†»¦Üûÿìö7„Á`؃±æýãÖ}pîø9 ƒa×8y2l|º¹9ø‹lžSîas[Ô—Ø+uóæè7wåç<ÿ,ü|ö~´#÷ó¢?ã9csÃÞsÞÂ×`0œ9LkV(ÇÌ4sÊ9Zeåu>¯èw¤*»ùpº}ù­?Î|ÃSîçEÆ xß4•‡E~gï½m0îËš'Üz“½Äù„[w?q}¾ÛùIy¸Ó–—¸ŸWùYÎö—áÈñ‹þ)ðr·2 —‹­Ð#8åãïÍ}DÎBfüyM/ìüçÈüKr¤pä·ë…ne0.–¨×pJÙo€Ò†ç0x_ñáîài?\¼Ü«a¯¡Ápµ0Ö|1¼öâäqgÊëz¸+7¿°Cj6[½Äßf&2®Wêôܼxëœß õÀp[ÄÁæñ‹ÞüÏyéŸñAÃøÏ`0¼®‘5µƒÈʃ±óa:ßð8¯l>Ð|ŽZؤzäáØ:tâCÜz?›'ã‚Hes'ü‰ðÒ` †‹„íyb¸gMžpÝœ^åõSF{ Ã…¡ìyb¬i0 Ãí°Â ƒÁ`x1k ƒÁp*Œ5 ƒÁ`8ÆšƒÁ`0œ cMƒÁ`0N…±¦Á`0 §ÂXÓ`0 †Sa¬i0 é0Ö4 ƒáTk ƒÁp*Œ5 ƒÁ`8ÆšƒÁ`0œ cMƒÁ`0N…±¦Á`0 §b)ÿ|ôÑGöZ ƒÁpîí·ß¶WÁ`0 †SðÿRçDrX]²‰IEND®B`‚xforms-1.2.4/doc/xforms_images/counters.png0000644000175000017500000000417611665175503015756 00000000000000‰PNG  IHDRJ–gPŠñ pHYs  ÒÝ~ü0IDATxÚíÝA–¢¼à®{þ¸ gº†ŽÝ CwÂT‡®wTw`ÿ§í[%Pù’ç™tj¤bòJ@ò±ßï÷ûý/ ˆžÿt]×uꀜÏçóùü;¼w»Ýn·ëû¾ï{U¹iÛ¶mÛçÏÿQ‹ð€`„7#¼ á ÁoFx@0‚ތð€`„7#¼ á ÁoFx@0‚ތð€`„7#¼ á ÁoFx@0‚ތð€`„7óOÄB·mÛ¶­Æ[Ûáp8êR<Çã¡Öv¹\.—K=ï7dx?u]×u]þå<ŸÏçó9b™ŸƒNm‡,åx<Ǧiš¦1^mSæzïÝn·Ûíú¾ïû>Ï~!ˆXf ñj›2×Ã5oFx@0»X§Óét:©p,SžªÃ{Þ!‘ÿäP‡òäy\—:Šæ¯Òð.?¶??un(Íç§空ðžoù‡¢Ø†ZäáóJ•ëÇ‘üUÞb(‡¯[á-¶‰ÕW¿Jí!”J„×*ðCZj&¶KmÓÛív»Ý¦þï÷}ƒzbågÏÀRêvÞkǼßyÁï\†¹æÍF†ŸZUÃYÝz7=¥Ômz» mn-;æ9ògIPÀ’ ˜isÈÂÔ뻦v¡f² ŒñL›@0‚ތð€`„7#¼ á ÁoFx@0‚ÞLÈg›¿.‹Åáp8:¿ÇãñxÏFœ!x2ÆæÌ5oFx@0Â{”Óét:ÔÀÆÌµ o]`ÆÏõïÝîóSmÌñù)Â× ¼¿!¶–$—&¼ÿ"¶Ö"—ø{ÞËÛäÕÿv»Ýn·Û6{€u=#üãCŸL!¼Å6õÃwÃÙðÿ.µØŽOSõ´¹ØøI&Òçª4¼Å6@.DøtÕ…·ØÈ‘Ÿ¢¢ðÛ¹áãTÞn‹øøÐð9r Û8ÕM›‹p€‰í)*½aM„äBlOWõWÅD8q¹.H Äö\Òò;Ÿ øõËílüt?œû|´ô=ÀvÄváý›'Ÿ~˜²¥‘܉í%X˜ä/&ÒÖ"¶—#¼¿!–$¶—&¼ßá©Äö:„÷ÿ¡ÛÌcü\ðÖfÌ\›ð€`ÂUìz½^¯W °clž‡wÓ4MÓD)m×u]×ép@±ÆØÚ|ì÷ûý~¿ßï÷{ß÷}ß«ÈMÛ¶mÛ>v͂ތð€`,L¾®j5üÏçö¯+bÍû†è×׎Y4óÝß_’ñKs.ûÍשõ¼T¥´ÂÔž0µN¦¾vjoY£aá͆èñÃ÷ëö)Qôj8žS>.Œù+ùÔó²m4¯~Æ×vú‡ªyïbÌÇ‹¥ú ¤0mÎbb-RwðM©g ‰ÖÙg(ðf#SWª3YÏ9PÊçÔ×Λ²^¶ea›¼ÊQ†f¼>ãü›¸æÍbæÝ¦4¼·wÃåR7”-5oóWJê'kaÊÚ‘ü oV±l/U’è…µ[d©»îam¦ÍY]Ê`÷õ*©´¤^ëâ…köäCx³ÃÙÚ¦ÞÄ—òZŒ ›ż‹‡ôhßæ*i õ<ïµcâ^ë8—…y\ófÃOªŠ·ão_JyšÛ6õœÞFÃA›[+oÓ"ðS, X3m›šz}×Ô.ð•ð†M c isFx@0‚ތð€`„7#¼ á Áoæ¯'¬]¯×ëõªR g¿WSÅÇï­{å´ÇIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_BLACK.png0000644000175000017500000000055111665175503015302 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p{IDAThÞíÚ± À0 Ä@;+ií¤)µS ×ÌÊÀ›àÁúgfffDDÄЇîîîQUUuzÌíV¥çôŒ?1`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,`z Ù±Ž!/ƒeý¦alk%tEXtcreate-date2009-05-07T00:21:35+02:00.9«á%tEXtmodify-date2009-05-07T00:21:35+02:00qˆÝÕtEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_LEFT_BCOL.png0000644000175000017500000000055711665175503016025 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$pIDAThÞíÚ± €P ÄP@l”²KfÊPÙ‰â×H¸$¿ N®oÏÌÌŒˆˆØtcffæ\™ªªªÞžô]ÝÝÝÇÛ3þÄX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±€ÝcÈër5Ÿ¬ Q%tEXtcreate-date2009-05-07T00:28:23+02:00}Vµ%tEXtmodify-date2009-05-07T00:28:23+02:00"çûtEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/fd_align.png0000644000175000017500000000456111665175504015656 00000000000000‰PNG  IHDR~-¸5, pHYs  ÒÝ~ü #IDATxÚíÝÏq»8ÆñõN* j`RŠ}M¹r¤®øè.2C*ð ¤ïÍ›‹Òû¾ú~™Ýü°- ¬'______ÿ Øûûûûûû[–eY–µmÛ¶-éãããããã_ ¡PƒÐ¨AhÔ ´jZ5-€oË^Ö4MÓ44`®Óét:–½vah}×u]×5;0­ëº®ëŠ¢(ŠbÍí,ÞÖ‚»i|”eY–åår¹\.kÞ‡sZ5-€„@·ýÞ:Ïó<Ï-5V"‘:Ú«£½šºêh·chÙ[¦ÑŸH¬ªªª*êh©Žöjêª# Óƒ5-€„@ #¡u<Ç#%§5ئ>´lts[Õ‚Ö`›âкwm·;ÒšÛè0¦2´lÆÕºnš6e¡et5¿›¦M¤ãMKA}ºæ5]Ûù|>ŸÏÛ—v™¾›>¦K5Ý&þeU÷um²÷èóéþ[ÊÙk€ BËw$±fœq8ìUúX£ÿÏÕU÷ØÑ¸ˆžL}©…{ZŒ–aÂH“ÐÐbeàÝcM˸Z@ Ä…2æ!º€”:§E\Mù=—CûL·ÏÞgƒÂäô§pÆ )ZýW‘®ùo¿Ý1í3Ý>aŽÒémÖ±¸ˆ›¼]÷[ÕK¬¯$0$t!Ñu÷Ø)Ó2®–ÑKÞSï Ý2-£+®X*lEÁÅžçrdvßþ¥Ö˯Sžj ­±¦ ÂèÊ'äô¶CžçyžÛÞƒzu]×u䪹“OtÉùû—d¿¿ÁcµÆšÏjØqåÿéã-×¼Öž,˲,kÛ¶m[Û5Õ¨,˲,«ªªªJf •Ý0×þ´Øü®™6•&±ÙM¯ëši)PüHÖÑYF\ø‹âÐêÙèÚ¶ª­À6õ¡ÕÓÛÍíQrZ€UFB \ü×èî}EWì­GhÔØý:­¦iš¦±ÝˆÔ‘šcÇÐê/ÖPpqñó’„¥'ðåÜIáþÿûœ·.ß`’J Ÿ0coj<ºdÆÕoÙž£M]Ê|Úy¼ {ð§ì6Nó¢KÒd kê`=•¿>×ÅÁÀ"ÅwÄø;ºˆ+°Kýmœ†ÑE\i2¼Ë¢ÿOi3òhâŠ= ;8§PƒÐ¨AhÔ ´jZ5-€;Þå=Ïó<ÏãV¯_^)§$)\ˆ-áº=iûÝöBÚ1´²,˲,î=àåܾ/IÿßUUUUeï`*Š¢(Šþ¿ÙïÃ’XÝã@x<€ ÆÇp‘0s@hD \$̰ ¡5Ûñx<´­ ŸÏçóÜ£®Ã!D©|>+dy¸EiùD‚üQN,çZc-Ÿ^ØQ Ö8NòymÜ’³]¢´äÇa_øñ £.[¦g¦·LFZÄæ ?¾aÔeÝtPÅ1BtZÐКćðÑ%±TØNã=èÚ§>ÓŒÃß»¶ô‡¹Ÿ>wK‚NÞ‘~Åt§à³MÜ"¤ðÓq>‹}˜$Lƒk±’ÿï]’>Ë æ~Š95Š0=xo8w§à³MÜ"œqõú‰«ôŒG-®c`îï·ýtÿ-5жzèÂkÄdfBN»ùzÜr†yÉ»üèB*ˆ+¼2¾È$|tù|zÜrîMÄ1$G—Èžp“؇Œâ*UkŽ-+ í·‚nãäÓ¸±v€üèòo½1Y5 ’:ìgîÈCËåÆ)¬e÷<-ùÑÅç¸{?…# [ñ9÷³æ»æñÿô¸å ƒ‡@.<€hZV¨5kÿÖ¯'\¿òÐö·‰Ð`Êš¹þx’Ð` ÁcO.¨±ûH«iš¦i$TUBI꺮ë:…‹ý`‡ëõz½^Û¶mÛ–æWQEQÐ#ÉT–eY–UUUUëÓ9§@ÆÇpa¤P i± ¡PƒÐ¨AhÔøõ kuòýlH2Ú°)ÒIEND®B`‚xforms-1.2.4/doc/xforms_images/FL_DODGERBLUE.png0000644000175000017500000000056211665175504016105 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$p„IDAThÞíÚ± €0A@$Ôó-|O¦SÜ÷Dà‰ ÒN§oÍÌÌŒˆˆXô ªªj™®ë8zŸ=é»Z‹8ÏmöŒ?1`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,`õòÆ8†Ü†Š€­—â%tEXtcreate-date2009-05-07T00:45:34+02:00iÊl%tEXtmodify-date2009-05-07T00:45:34+02:006¡¼XtEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/fselect.png0000664000175000017500000000336212254343154015531 00000000000000‰PNG  IHDRJeý¼ÕPLTE­­­YYY)))ÌÌÌÞÞÞÿÿÿÿ*«GïbKGDaf¸} pHYs  ÒÝ~üsIDATxÚí rã6 †Ùtq€î :ÛL/ {LgÀTê zþŠI=lÙŠ”þ¿Æ±õðú[ A˜¦œƒ ‚ ‚ ÝõËo65¦|y{¦o¼Õ×· åÇ3k¿¾žPį å5(EØ9~H98KåOzÖsr4%;âŽOR’;žrlÉ[Êá‘W¥$ÇDL]Ñw#’øáJÙpÝqWN†«»Ž„+QvŸ¦u5@·%Pç8Ÿ ×–j¶ŒTwÂë¸ÏJÉ‘’õ —NŽ®¬H)"(c‰»xÙ„RÔ³¥QÒ˜2”p8É·¶¬åã=%õ”¤>ž*C¤æbèØ€Õ¤Læ{Ojª•R+eï=ýÎñ”Ú÷[iK¤4ØJI’êew¨k«RKw8_},弨™éÇ;•û2¢œWŒ ¹òÊŸÏFƯ¯' Ç'”¿>¿Ÿ0{wÐABžy"P‚Ò %Éü¨%ïL™³Q|û/¯§dæ½)iJZŸ‡›§ìF[Ý,åâøËž-u”óSq‹i"cõR½GÇÛœRln3åÞ>žPÕ–"†)¥ØÒ¦äKP½Çr½L‰©œ§´Fùð f(g3E°%(A9O‰<òDAAQUû&ìåÇ'ôû„òÏöpý­”Ÿ ÖÏ£üX^À/W¥lDü(Û¶ñW ŒPîCÙzPN)ÃÔº P¦™~æ)Ýʺޣ”¡Ôó¼Ô4?ÞežÖKq2ož¿¤UoªQ†/âÄgÎEÏ4¬zȦ®-ªèwui ¼­hƒ\ù¹€Îãgg›2ýDÃ.åÄ{lRŽZ"{”׈ÕÃ÷ž‚XýLJÄêˆÕÿ·”?—'–¾ŸG¹-›UÉ{6éB”9Vo Sö±ºaÊÃJP‚ÒFKÔÉ?j‹šS)±ú˜²±EYü#,±A)¾³¥—®ÄVô¥5·Íé¶ŒFìzÈŽ2`&í0ÃKi#åù%)}¬—>VÔ´“^6›§c)[Û”"2¦l½7ãã[¶— œÔËV,P–XÝ+ÞØÇ³{ŸKYzHm/ÛÒ^¶©½´@¹Dþ1Ñ%(¥½„-Aù•(—ÆêÍÙñå¢Xݯõôš±z³ºY¯« \«Û ôObõÓëå׉ÕWÁV5V_qÔŒÕ×ç‰kÆêgS.‹Õcmµm¬®“ œ ±:(O¢lüÜúÿÙ‘Ò·× |Ø»4&(›ØïÄþº‘Å=t=±'ò†JÅ¡ô¹#·T/ý`|£!GÙ·IÙØ¥ìÂ¥ Õ4Sj,dË–} ÜÛÒX{YJÜ[®—Í`ؘ)íùxßÄz)™R³X6(¯m€” \Kù$Vß2¥½Z¬¾i:aµXÝoiÖ«ÅêF(ŸÆê†(ý|¬n¥^~X}K>«Z¬¾iZsµXÝ[¢œÕMQÎÆê²åW_ˆ‰@ JP‚” %(A JP‚” %(AÙSbõØ)?–0ÖÍ%(AYƒòÎݶØ¥ÜY>Ö%ßY>ÖeZ¡3­+éÖ™&)óš±aÓ›ÿ™´eZATWÃ$»%^(õÖ™6K|hK«>Nƒ‡MJɾ“–‘5é=Ú÷ä5c­¶D×èÇŸ- [‚” <ˆrÛê±µ(/‘ÍÚ$P^YV´ê %(÷¦d ”"£+MPrHÌP’%Jš£[””î‰CBÔ“Š)J÷Êq¦$C”1­¡d”Ò«<ò+C¶Œ),Q’¨ìÔËÀ%É–4±¥‰V½Pr¦,nnrà=ƒæ“ŒQ¦Vˆi|s.;”÷:îÉK‹”·_IZ¤Ä— åq”oÇë]?yK–µš6e³ ‚ ‚j(ä>˜ž]5M;Þþî µöSø¸yJš¡äÇÿ‘C(Ý%(Yó"œ²´¬)œP‚¢·4§pCV']HaB]Ø —†òöC(e²Åù|‘.=’P%¥«³ÿ8e€úD/ïï=Ž©äê\Ê}¦»Õ‡cNèõ)\/É)HRÓ¥KÓÛ²eÊÎj–6PÆŒâ˜2§p§”$•(ãS4KoK7¥”[:⺔üˆ’ç(]%J­òù™—yO¦äBYÞ~`K«±~ŒNæ”qK”R¸Žû7Œê¥ÝŸ‚ È‚äTñBJßž©kPþJPÞ§üç_P‚” %(A JP‚r?ʶ%(A¹ŠòÜ ÌRJ÷ãT9‚ ‚ èÒú@n†3xå!IEND®B`‚xforms-1.2.4/doc/xforms_images/Makefile.am0000664000175000017500000000500612340166201015417 00000000000000include $(top_srcdir)/config/common.am # List of all png files figures_png = borderwidth.png \ boxtypes.png \ buttontypes.png \ counters.png \ colchooser.png \ crossbutton.png \ dials.png \ fd_align.png \ genattr.png \ fdesign.png \ FL_BLACK.png \ FL_BLUE.png \ FL_BOTTOM_BCOL.png \ FL_CHARTEUSE.png \ FL_COL1.png \ FL_CYAN.png \ FL_DARKCYAN.png \ FL_DARKER_COL1.png \ FL_DARKGOLD.png \ FL_DARKORANGE.png \ FL_DARKPINK.png \ FL_DARKTOMATO.png \ FL_DARKVIOLET.png \ FL_DODGERBLUE.png \ FL_GREEN.png \ FL_INACTIVE.png \ FL_INDIANARED.png \ FL_LEFT_BCOL.png \ FL_LIGHTER_COL1.png \ FL_MAGENTA.png \ FL_MCOL.png \ FL_ORCHID.png \ FL_PALEGREEN.png \ FL_RED.png \ FL_RIGHT_BCOL.png \ FL_SLATEBLUE.png \ FL_SPRINGGREEN.png \ FL_TOMATO.png \ FL_TOP_BCOL.png \ FL_WHEAT.png \ FL_WHITE.png \ FL_YELLOW.png \ folders.png \ fontsize.png \ fselect.png \ gravity.png \ input.png \ labelframe.png \ pushme.png \ scrollbars.png \ slider.png \ slidertypes.png \ symbols.png \ thumbwheels.png \ yesno.png # All png files are to be distributed EXTRA_DIST = $(figures_png) # Copy the png images to a subdirectory both in the directory with the # HTML and the one with the info documentation install-data-local: @$(NORMAL_INSTALL) $(install_sh) -d $(DESTDIR)$(htmldir)/xforms_images $(install_sh) -m 644 $(figures_png) $(DESTDIR)$(htmldir)/xforms_images $(install_sh) -d $(DESTDIR)$(infodir)/xforms_images $(install_sh) -m 644 $(figures_png) $(DESTDIR)$(infodir)/xforms_images # Creates eps files from all pngs for inclusion in info documentation # (as used by emacs info mode) create_eps_files: for i in $(figures_png); do \ $(MAKE) $${i%png}eps; \ done # Creates pdf files from all pngs, needed with some older versions of texi2dvi # to create the PDF documentation successfully create_pdf_files: for i in $(figures_png); do \ $(MAKE) $${i%png}pdf; \ done .png.eps: $(CONVERT) $< $@ .png.pdf: $(CONVERT) $< $@ # On uninstall remove the subdirectory with the images from the directory # for the info documentation (the corresponding subdirectory in the HTML # documentation directory is taken care of by the Makefile in the 'doc' # directory one level up) uninstall-local: @$(NORMAL_UNINSTALL) rm -rf $(infodir)/xforms_images # Get of junk clean-local: -rm -f *~ *.eps *.pdf xforms-1.2.4/doc/xforms_images/FL_TOMATO.png0000644000175000017500000000056111665175503015472 00000000000000‰PNG  IHDR2±£è pHYsHHFÉk> vpAg2ˆ!$pƒIDAThÞíÚ1 €PQ 8Z ' ßÜ%A5 SÉ<›©w®ªªJ’dÒîîîõÊ4ÆqìûÛ“¾kÛ’dy{ÆŸ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 0`,ÀX€±cÆŒ 00{ yâ:†œVúã©ÃÕ%tEXtcreate-date2009-05-07T00:36:49+02:00À 5%tEXtmodify-date2009-05-07T00:36:49+02:00Ÿ¿ztEXtps:HiResBoundingBox50x30+0+0ôIEND®B`‚xforms-1.2.4/doc/xforms_images/slidertypes.png0000644000175000017500000002120511665175503016453 00000000000000‰PNG  IHDRlb¥mÕA pHYs  ÒÝ~ü"7IDATxÚíݽ±«H·à;_ÈB¦âÀD®¢Ø.¦Ü/ \0•Å©Bœ*˜®¡1tKM#`ñ÷<Μ‘4½@{¿›nøët:N§ÿ€¿žÿ©ªªª*ÝÀ|®×ëõzý'ˆfY–eYÛ¶mÛê¦U–eY–ÏÿGwI ” @(A€P‚(¡QB ¢„D%ˆJ ” @(A€P‚h’âÍç%?¿’²-}ìÕ/]Ðç56MÓ4Mú»ôqEô_ô…Ìôð)¦¼rEt””ù¼vúùšjÊÚú†ìö­ùùº+·ÀÚ,D뺮ëz ;¹\.—Kß»ó¹¾uöEÍÏ˺)m^OE€xŸ“Ñ¢ÇãñxTUUUÕ²ÝÝu]×uŸ—é ŠãCéûÞ£ï´Ë÷ùùùùùùqúÀq<ÓÐù|>ŸÏmÛ¶m¹õņæfY–eYü1_(M1ßÝtS9°'eY–ey¿ßï÷{üÖÍýÒç«‘ómQÏ[箹½<Ï`‚è¿H¹ÐTkþ¼Î¾åf`[ Ííõù~¶cʾë}ŸkÚ·­¾ØiÈ.°-‚h’ô°×woÛôu}}Ì’ñ Í ” @(A€P‚(¡QB ¢„D%ˆJ ” @(A€P‚(¡QB ¢„D%ˆJ ” @(A€P‚(¡QB ¢„Dõëh;\×u]×Ûjóår¹\.VõE}ÕW}ÙÏ[áç~ºÃÑÇãñxöÅÁx~îu¸ ÊqTUUUÕ:Ûv½^¯×«°ukþi›ÂOdXŠ ÊneY–eÙÚþ.µ§¿À:Ú¦ð–åfE„D%ˆJ ” @(A€P‚(¡QB ¢„D%ˆJ ” @(A€P‚(¡QB ¢„D%ˆJ ” @(A€P‚(¡~éƨ뺮ký¤DøRžçyžë`(A¤ªªªªôŽ%`Y‚(H×u]×é€iùvÊÍŠ%ˆJ ”9¢;TEQMÓ4M“þîóõ÷åÇ,9´Í)Ûý¼•÷e†¶¶où÷OÍÑp‚(_×ï‚búú¿[[Ÿ¡ëOßîÜ-‡ý14€•š;È=×ÿùú'0WDvk2˜6E_ \öŠâ˜Ê®…Âg‚(Àn}7rÌúÇ I]ÛWCsa>†æ°0ƒcáhQÊuKXŠ¡¹üËm{–ºiPúÐâ”ý”G³À|Q€ú–æx`ÉÐ5|÷Ùï–ÚªeûŽ@`)3?68&A€Y™@7+ ” @(A€P‚(¡QB ¢„D%ˆJ ” @(A€P‚(¡QB ¢„DõKÀqÔu]×µ~˜Ãår¹\.ú!… òx<‡~`+n·ÛívÓ¬ßù|>ŸÏmÛ¶m«7R¢pPUUUU¥X§ëõz½^õì• •eY–eþ~ÏÚ”eY–¥~€}s³"B ¢„D%ˆJ ” @(A€P‚(¡QB ¢„D%ˆJ ” @(A€P‚(¡QB ¢„D%ˆJ ” @(A€P¿tY]×u]ë" ¢pPyžçy®ˆ'ˆÀTUUU•~`Y‚(H×u]×é€iùvÊÍŠ%ˆJ ÔA爖eY–åúÛy¿ßï÷»Ãæ8O§ÓétšoýÎßeë;7õeEQEÑ4MÓ4éï>__~Ì’é­í{÷¹Î÷6ÞÇôeÆ´³¯g†¶jh¦ôØ•‚u:ôÍŠÖ|çÀëõz½^ àüU_õ…>ß×ïbXŸ5G£ÏÑ}ª–]úvçn9,ëÐA4˲,ËÚ¶mÛv=­ÚÊÕpþ:ÕØ¢¹ƒ\ßÕ`à•Ç·¬Èçœs¬LXšvmÓz „ëiᘡÔb-{"ˆ¬Èw3 Ǭ¯CsçØßùê»þ–ôÜ5€šûÚ20† “qÝRš °I}s _ß]gËÓ©2f†Îýn‹C?åÑ,ð$ˆ¬Âç(2Çã@†®aè§R3U{¦mçTû²†JÁ: ¢ü#e^å:ï:»ž)Qþ±Å»à[$ˆ°jçóù|>/Û†¶mÛ¶U ˜Š Àªåyžçù²m¸Ýn·ÛM-`*‚(«&Àþ¢ì\]×u]ëõ`=Qvk Ãù˜Ûãñx<k¸böœÇ訛¯o—mƒ9¢0-A”2öÄQØA€U`Q`ꪪªJ?l‹ lX×u]×iɾ™# û#ˆ°jæˆÀþ¢¬šûó]@$A€P‚(¡QB ¢„D%ˆJ Ô/]P×u]×úœ¿¨/ãÐA4Ïó<ÏàüE}€H ¢·Ûív»)?ùü-Š¢(Š÷×›¦išF?o½¾Àš™# @(A€P‚(¡Ü5Ľˆæs¹\.—‹~H!ˆÀ<Çãá¦PŒW–eY–ûØgãÏçóùܶmÛ¶z#… À—ªªªªj»í¿^¯×ëU!ž À—²,˲l‹WötE¶H`E>Ïd6öA`Eúf2›ƒ{âñ-„D%ˆJ ” @(A€P‚(¡ŸÏçsÛ¶mÛê‚(_ªªªªªí¶ÿz½^¯Wu„x‚(_ʲ,˲-^ÚÓ]Ø"7+`Ï¡ŒïpèëÀ ¢„D%ˆJ ” @(A€P‚(¡QB ¢„D%ˆJ ” @(A€P‚(¡QB ¢„D%ˆJ ” @(A€´mÛ¶íív»Ýnc^¶è—.`Œº®ëºÖ@:A€/åyžç¹~†:\­ªªª*…W_Ô÷÷ïß¿ÿÖ«Î_ý Ž% Þá‚h×u]×i­új­új­;f}™sðí:”›J ” @¨Cß5·(Š¢(š¦iš&e™ç¿û–|]Oß’)˼/©[©EÊzÞ÷t辫éR5}ÿTz5SÚ<÷7þϲ1}>t/RŽ„ÏGÈTÇÀÐ}dîo¶ù¾¾«©óeîó%½…CÊOU߬™Ç· –~¢~þ2EØJ-ÔÑùÕתôw×små,KïÉ¡ šêøúKùT=ï[eYS}Œ©©óe޾Ú¹¿ë|o°E‡šûù¯þNHµ@MSöeüšUdGõwý©Ïq¾ìé|™»…óý<‚x®ˆ6f ‹_8ŽP uw~Eöƒ³ìó¶Ösœôýú8fè£ïœµ¡ñG¸óe©óeh —=2}o°N‚è`†=¨ÅT­b[çWß,ßeûÁYöy[s·ê}Víç5š»ïoª©ꚇæ:_Ö|öùÞ`[Ü5÷ÿù›–SQ-PS!¥_ûíó¯×†Òá|ÙÓù⌆ñQ€¦ŸãWÒùÓ!{bhî?ÒЏíµZÌá»›Ôoñf?G;¿>×ñóŽY‘iÏ…ïj4ÕV–:Xó7€óeýçËø¦´mè§|o°-N§Óét¿ßï÷{Û¶mÛνɲ,˲ŒÜ"¯âsÙs‹Ï»" ÿ"eð¤¿5ª)*Î} ¤Dá_ø‘£¦¨8_ô-0-7+ ” @(A€P‚(¡QB ¢„D%ˆJ ” @(A€P‚(¡QB ¢„úµìæëº®ëZŽc ZUUUUÿý÷ßÿýóóóóó£ DZ@íº®ë:]°¬¥Ò™9¢„D%ˆJýEQÅ|˧¶x“¾žÈ½H÷K¬Ík lš¦išôwÖÏÑÿÇ3à¥\!|.3G ì[gú¶ÄT`\E_ˆ*¦¬§/$¿·íóÚÒ÷åu‹®Ü}¢u]×u½†¿\.—Ëåó2éqîýõ×O½ÎóüÌæ rŸÛ6Õ¾¤_%^Ï‘G–’Œ¦µ@}<Ç£ªªªª–íîÏoM û·>©M¿!P_PJûÚœ~åsèò}~~~~~~œöÎçóù|nÛ¶mÛÈ­/647˲,Ëâw8Æ´w /”ÆïËû¡ï+â•eY–åý~¿ßïñ[7Gô_¼^ý{ÿ÷ûòé÷¼ßžÈp$Sq×ÜYŒ ožç ì› š$åZè«÷094^¦Ü@è;CÛÖ·¼À |ÇÐ܉½FÖ÷aº)÷Îý|?Û1×ZSÚ–²üø–Gö×ét:NÏ)ª1·z»×›¬Y|.{nñùoCs%ˆJ ” @(A€P‚(¡QB ¢„D%ˆJ ” @(A€P‚(¡QB ¢„D%ˆJ ” @(A€P‚(¡QBý:Ú×u]×õ¶Ú|¹\.—‹ƒU}Q_õUßcö3Àúù‰?Ôá‚èãñx<·Ûív»­¿µçóù|>·mÛ¶­ƒU}Q_õUߣõóT•Êó<ÏóãìõÑ”eY–åš[èØÛ7?ñ¿s¸ ÀþTUUUÕÚZu½^¯×«êÀ;A€Í˲,˲õ\•ZÿuZX–›J ” @(A€PnVôEQÅë+MÓ4M3ôSïŸýnͨ/ê‹úÀþ¢ÿxþ"òþËGßëïú–¿fÔõU_õ€=14€P®ˆNæup—¿£«/ê‹ú¡?Ó{Õ0i^ ¢0¬K}Q_Ô÷ “`*†æJ¥o ê‹ú¢¾ôÕEu04÷Ïa?)³S^‡ ¥|*}ͨ/ê‹ú}õÒ?G#ˆþßÍo3+õE}Q_8Cs€ˆ À;WD€$†I0AÀ0iÆ34€P‚(¡QB ¢„:ÜÍŠªªªªJáÕõE}€¥.ˆþ÷¿ÿýïÿ»­6_.—Ëåâ`U_ÔW}ÕöápAôñx<Ûív»ÝÖßÚóù|>ŸÛ¶mÛÖÁš^ß­´ö~¿ßïwõ]êü}báÓTpþ.[ß¹©/Œá9¢ìÖš‡ù]¯×ëõªF0­º®ëºÖ°~‚(»•eY–ek»^Q–eY–ªÓÊó<Ïsý[!ˆÀó¦Pn…¥¾ÀÚ¢p ]×u]g¦â{æ;ž# @(A€P‚(¡ÌØ¡çÓ’ûžÜ÷nú3–çxóû:û¶ûy+ïË mmßòû©Ô°W‚(_×ï‚búú¿[[Ÿ¡ëOßîÜ-‡ý14€•š;È=×ÿùú'0WDvk2˜6E_ \öŠâ˜Ê®…Âg‚(Àn}7rÌúÇ I]ÛWCsa>†æ°0ƒcáhQÊuKXŠ¡¹üËm{–ºiPúÐâ”ý”G³À|Q€ú–æx`ÉÐ5|÷Ùï–ÚªeûŽ@`)3?68&A€Y™@7+ ” @(A€P‚(¡QB ¢„D%ˆJ ” @(A€P‚(¡QB ¢„DõKÀqÔu]×µ~˜Öår¹\.ú! òx<Çív»ÝnGØßóù|>Ÿó<Ïó\õIwœs„ñžß3mÛ¶m«7Ò ¢ÀTUUU•~ Ïõz½^¯úæ&ˆ’eY–e®]ð®,˲,õÄp³"B ¢„D%ˆJ ” @(A€Pž# PEQ¯¯4MÓ4ÍÐO½ö»5°E‚(äßÃaßëïú–¿f¶ÅÐ\B ¢@â…Þ82Cs€Ùv À+WD%ˆ32€w†æIžÃhS²ò:ì6åSék`Q`€ïÓ2æá.졹„D%ˆJ ” @(A€P‚(¡__~Ì’é­í{÷¹Î÷6ÞÇôeÆ´³¯g†¶jh¦ôØ•‚uD6é»àú] ë³æhô9ºOÕò¡ëOßîÜ-‡eš ÀÌä^¯ëmèãŠ(ÀŠÌ`R†ª.µ¶iõÂe[8f(µk¡ì‰ °"ßÍ0³þ½Ícç«ïú[Ó24€28ÖL€É¸n ) ÍؤÏ7ÅYÿýl?·vü É¡sD¿ÛâÐOy4 < ¢«ð9ŠÌñ8¡kú©”‡ÇLÕžiÛ9Õ¾¬¡R°N‚(ÿH™W¹Î»Î®§…@ A€lñ.¸À¹Y¡QB ¢„:èѲ,˲\;ï÷ûý~w˜Âçïét:Nó­ßù»l}禾0Æ¡oVTUUUUëlÛõz½^¯Ppþª¯úÀþ:ˆfY–eYÛ¶mÛ®§U[¹Î_ç¯úß1G€P‚(¡QB ¢„D%ˆêÐo`ýÎçóù|^¶ k{ l Àªåyžçù²m¸Ýn·ÛM-`*‚(«&Àþ¢ì\]×u]ëõœ5ó¹\.—ËE?¤DÙ­5 çcnÇãñx¬áŠÙs££n¾¾]¶ {š#ºž³&þÜtu}¯Ê²,ËrÍ-tìíÛó{ÆÝ†DÙ!_÷°'æˆ)ªªªªjm­º^¯×ëUuà Àª @Š,˲,[ÏU©õ_§…e ¢À†­óïßlËç¹ÓæþÁQ`ú®ëºNKöÍQ`n}s§Íýƒù¢¬š9¢°?‚(«&ÀþüGI ” @(sD€Š¢(Šâõ•¦iš¦ú©÷Ï~·f¶H’<ƒâ{8ì{ý]ß2ã× À¶¢À!ô]•eëN§Óétrì±”?þüùóG? %ˆþO]×u]ëpþ¢¾Ìíõ×q×9ŽìÐAt Iœ¿¨ïv À«ƒQGçoÊ­SØn}€534˜Ñz®|ú3Ó^•eY–åš[èØƒw‚(äùËtÊCV^ÃgʧÒ× À>¢Àß=¦eÌÃ]ØŸÿè" ¢„D%ˆJ ”»æphUUUU¥ ’ À¡u]×u]úëÀx‚(;Q×u]×úÖO`óò<Ïó\?ÀV¢p Çœ g úk#ˆÀmΛ9~ÀÜ|Ï|Çã[%ˆJ ”9¢ (Š¢(Цiš¦I÷ùúûòc–Loíçm½¾>_û§Ú‹ô}I©ÎÐÞNß»iëë!ˆlÀwÁõ» µæöO»õi{cèúÓ·»ž:ÂT Í É3ö|¾š7fÍKíÑ{ ¶ÎQ€ÅÌQR£n±†îE_ \¶7Æ Tv-”­DóÝÂ1ë?¤ó5ÔÅ\QœomËp54—#34€38ÖF`°ig?î5(ºn } ÍØ€ÏÁoýQç»ö/5Gô»9™C?åÑ,™ °€ÏacŽ~ ]صÍ×þùú|Ì2ßãø:Âz¢•2 vÍgëí‡#Djë!MÈ„ír³"B ¢„D%ˆJ ” @(A€P‚(¡QB ¢„D%ˆJ ” @(A€P¿tG]×u]ë€i].—Ëå¢Ò ¢p ÇãñxÜn·Ûív„ý=ŸÏçó9Ïó<ϳ×GS–eY–kn¡coßžß3mÛ¶m«7Ò ¢l^UUUU­­U×ëõz½ª¼Dؼ,˲,[ÏU©õ_§…e¹YòHù‡¾Œ!ˆJ ” @(A€P‚(¡QByŽ(0@QEQ¼¾Ò4MÓ4C?õþÙïÖ À ¢@’gP|‡}¯¿ë[füšØCs%ˆAŠzàÈ ÍfgØ-¯\ ” ÌÈ@\Þš $y£MyÈÊë°Û”O¥¯€}D€¾{L˘‡»°?†æJ ” @(A€P‚(¡QB ¢HÛ¶mÛÞn·Ûí6æu` Ï`'꺮ëZ?Àú ¢l^žçyžëØ A¤ªªªªì5ê ,K€麮ë:û 0ß3ßq³"B ¢„DeŽ(@’¢(Š¢hš¦išôwŸ¯¿/?fÉôÖαݔå?÷FÊëï[Ioy_{¦êÛ¡-ü¼•”}ÿ®"1ýßDfñ]pý.ÌôI_[z8ºGSõ[zËÇ÷Æ´-üÎÐõÇ÷Œah.{FšÏWêžÒ#ÐúcÒÜ-LïUX?WD˜;¤ øœcmÓnwŒ¾¸5f¨ð´û8´…Ë™óõŒ!ˆ ðÝ<½1ë_ÏÐÜ1^×–²æ5Í鱩ŽÌõ·œc:\­ªªª*…W_Ô÷÷ïß¿ÿÖ«Î_`>}±ós](Û`¼ÃѮ뺮ÓZõÕZõÕZ=¦¾À¶À쉡¹³ø|k™˜81ílÀ˜=šoŽèÜ•vþíÐOy4 Ûò×ét:N÷ûý~¿·mÛ¶íÜ›,˲,ËÈ-ð*>—=·øü·+¢›‘rK$WÀô-¬ß¡ƒhÊ8û÷;¼õ-ùþ¸çï–y_R-¶R‹”õ }8xú2j:wMÇ<ê}Ì-õ§úfØ÷Y6¦Ï‡îEúUúŽ©ŽÃðŽI}õ-ìƒ+¢ƒMukì¡Q„­ÔB_}­Jw=GÑVβ1£ø®FS k{ÄøÏ‘wþó_ýý W Ô4e_ƯYEöqTןú€crEt°1ÃüÂq„Z¨»ó+²œeŸ·µžãd¾»€úÎ`‹ÑÁ —R‹©ZŶίÏ_ßëQ´•³lÌÐÜ1ÞgÕ~^³¡¹ðt衹Oï¥ö#\-PS!¥_ûísch7l— 0À´óE…à˜ ÍýGúÀ*·ËW‹9|÷P‡-Þìçhç×çà:~~à1+2í¹ð]¦ÚÊRÇ,ë¯Óét:î÷ûý~oÛ¶mÛ¹7Y–eY–‘[àU|.{nñùoWDá_¤ žtBMQ ÿ¯¿jŠŠÓr³"B ¢„D%ˆJ ” @(A€P‚(¡QB ¢„D%ˆJ ” @¨_Ën¾®ëº®•à8¢UUUUõ÷ßÿý÷ß??????Êp Ѯ뺮ÓõËZ*™# @(A€P‚(¡QB ¢„D%ˆJ ” @(A€P‚(¡QB ¢„D%ˆJ Ô¯×ÿ©ëº®kÀ|þ:N§ÓIGã§wžÓclíIEND®B`‚xforms-1.2.4/doc/xforms_images/gravity.png0000644000175000017500000000557211665175503015602 00000000000000‰PNG  IHDR@ú€&BNbKGDÿÿÿÿÿÿ X÷Ü pHYsHHFÉk> vpAg@úR®µæ ²IDATxÚíݽN2yÀáñ•………tö&ž†•¡…ÄÒ˜x–ž ±4J á8bbak‰`ûlóβ‹;™æã¾®†‡áÏ“¯zy@“½¿¿¿¿¿/Ÿ}}}}}U½*€¸îïïïïï—ÏÿWõ‚€ö˜Íf³Ù,I~~~~~~–éëÔƒJ3N§Óiñר†¶–Nø‹Åb±øýóôu“@€z€ÀÖŠNøLêAË›ü­2 ¨llÓ‰žI @µ °¶u'«Lª%µ•5Á3 ¨Æáö»¢‡Ãá0ûç£Ñh4-Ÿ÷ûý~¿_õªH™#‚€Á@€` @0 ŒF#‚€Á@€` @0 ŒF#þ¯×ëõz½åcÕëØPÂؗêЪ&06 ¯Õ÷M&“ÉdRÞöû&Ö«ÛÄ-+ë¶N ½œ´VVP¥Vt2·ºPšNad_Y‡húšBd´…FadMì¶ä9ô 4Z+ïjÛMÃOàM'ÖË ¶²‚NMá>€@û Á]­ ,&€Á˜”wci€¦0ØðšÊ  Á´… @0 ŒF#‚€Á@€` @0 ŒFsXõ€$éõz½^où|2™L&“ý}Þª]>Õ2€@òÂoÝíh&d]:éËšø Ávrö`Û*zˆ¸èvy¯ ¿v3€RÔ‘€Øôk–ÕíW÷Ÿ7ù+ú¹‚5{°î¡Ø¢Ê ¶¼`¥] 4H^­lÂ/& ’7ñÛö6/Â/{\ÛÂ5ñc0˜ô/~Õ'ùVýù»–w›–uÿ,z‘GÖöE'‡Y´‹d¯üCDSö9{P7‚f'„À¿m‚ECqWWÓ.°eêv§y ~`KÔmâæwJ@}9°áêv§y þ`ËÔýNó@õ ÿÉUkÐ^ÿTÖæ€ú€-S—;Íõ%®nwšêO¶„sö€¢Ü°eª¾Óü®Þ”Ç ŒF#‚€Á@€` @0 ¦nooooo“d6›Íf³òö+jj±X,‹$yzzzzz*/ @C”„ ¡6 Âê´×ÇÇÇÇÇG’ŒF£ÑhTõjÚo5_^^^^^’äààààà IÎÎÎÎÎÎJœ¦¥™–'õ´ñ0 ¾ét:N—Å º¸¸¸¸¸H’~¿ßï÷«^ @ó¤UT§Óét:IÒív»Ýn’\^^^^^&Éýýýýýýr»Â(øê%+øòd à¨—MƒoÕá÷÷÷÷÷w’\_____'ÉÛÛÛÛÛ[’üüüüüül¾@'}C\éÅé!`6SVð­r0PXv©¬ÀK_ÿüüüüüü}î ÏÃÃÃÃÃCÕ«hžáp8Ëßïáéééééi’ŸÏçÛvÒ7´Ïêd?ïïy~¯¯¯¯¯¯U¯¨Â`0 U¯‚U™ÀtĘ>:'ØÔÉÉÉÉÉÉò0ö3ù¯·Â÷LC0EÞÜÜÜÜÜ,MÐ Ÿ˜7! žJ»d5¨§Ò~Í ‚€Á@€` @0 Œ¦´A°[½^¯×ëåo7™L&“Éúû+ú¾ªö ”Ǡ抆ߦÛóo韟?GÚÌ ¦²$k¢¶º}ú|ß8?¨?Ðya•þ|ÛÉÕºá™÷þ¼÷å­wÝ ÜtYï«*¤a—¨™²=Ý_Þvu]×®¶ƒ6€5·îäiÛIUúþu'eEeM³ó>7obYô{dmgòG9 @’$ù´«ÉYÙûrÏ æ\ ”Í fÊž¸Õ}òU÷õA™4Ä®/ÒX÷»]¯Õûñm{‘Ǧûƒ62¨©¬I`Ù¿dUÙ·e)ë{­{ŽbYßÃm`h#@€šÛ×UÀEï3¸ïïµï턘4ľ¬é¿9¤¬ý AÚÌ @)\TÍ!Ø ‡P¡¾œ@)4‡ @0 ŒF#‚€Á¸ °7ãñx<W½  °sWWWWWWU¯€”væááááá¡êU°Ê9€Á@€` @0 ŒF#‚€Á@€` @0 ŒF#‚€Á@€` @0 ŒF#‚€Á@€` @0 ˜ÃªÿÔëõz½Þòùd2™L&ûû¼U»þ|¨‚ !å…ߺÛ@“@BÉ ºtÒ—5ñ‚´‰CÀìÕ¦!µî¡á¢Ûç½.üh#@öBH@}@vjÓC®YÛçí·è~Ö @›@öjÝC±ëÚö*â¼`€6€4JY“ÀU€H ¡ ?"€ìUVpm;ÉÛö*á¢ï€6pv*ëv*Ûߦ·iÉÛÞo @ö"/œÊ +ùLÙ«}…`Uû€&0ÆFqñlÏF~°>@EðÀöL‚€Á@€` @0 ŒF#‚€Á@€` @0 ŒF#‚€Á@€` @0 ŒF#‚€Á@€` @0 ŒF#‚€Á@€` @0 ŒF#‚€Á@€` @0 ŒF#‚€Á@€` @0 ˜ÃªÔÇííííím’,‹Åb‘¿ýt:N§¿_ït:N'I†Ãáp8¬ú[°Êø[·Ûív»õÙ»!¿]^^^^^.'xëJß—î€z€À/›NðLþšA¿¬; 4ùhd*:Ñ3ùhdÊ›šü4“reMøLþšI¹Ò ßÑÑÑÑÑÑòÑä ™~Ýz<Ç㪗ÔÑññññññò¹/šéàüüüüüüÏŸªÀ~ü_mäxŽÿtEXtps:HiResBoundingBox320x250+0+0QšÃtEXtps:LevelAdobe-3.0 EPSF-3.0 @Ër5IEND®B`‚xforms-1.2.4/doc/part3.texi0000644000175000017500000000054711665175511012464 00000000000000@node Part III @unnumbered @emph{Part III - Object Classes} @menu * Part III Introduction:: * Part III Static Objects:: * Part III Button-like Objects:: * Part III Valuator Objects:: * Part III Input Objects:: * Part III Choice Objects:: * Part III Container Objects:: * Part III Other Objects:: * Part III Popups:: * Part III Deprecated Objects:: @end menu xforms-1.2.4/Makefile.am0000664000175000017500000000225012353623325012016 00000000000000include $(top_srcdir)/config/common.am DISTCLEANFILES += libforms.spec config.status config.cache config.log config.h ACLOCAL_AMFLAGS = -I config MAINTAINERCLEANFILES += \ $(srcdir)/aclocal.m4 \ $(srcdir)/configure \ $(srcdir)/acinclude.m4 \ $(srcdir)/lib/config.h.in if BUILD_DEMOS DEMOS = demos else DEMOS = endif if BUILD_GL GL = gl else GL = endif if BUILD_DOCS DOCS = doc else DOCS = endif SUBDIRS = config lib image $(GL) fdesign fd2ps $(DEMOS) $(DOCS) # libforms.spec is needed as well as libforms.spec.in or else 'make rpmdist' # will fail. EXTRA_DIST = ChangeLog COPYING.LIB Copyright INSTALL INSTALL.git README \ README.rpmbuild autogen.sh libforms.spec.in libforms.spec # Builds RPM packages (using the libforms.spec file), one (architecture- # dependend) binary package and a development, documentation and source # package libdist: dist tar -vxf $(PACKAGE)-$(VERSION).tar.gz; \ rm -f $(PACKAGE)-$(VERSION).tar.gz; \ mv $(PACKAGE)-$(VERSION) libforms-$(VERSION); \ tar -czf libforms-$(VERSION).tar.gz libforms-$(VERSION); \ rm -rf libforms-$(VERSION); rpmdist: libdist rpmbuild -ta libforms-$(VERSION).tar.gz; \ saved_status=$$?; \ exit $$saved_status xforms-1.2.4/lib/0000775000175000017500000000000012353624652010615 500000000000000xforms-1.2.4/lib/flsnprintf.c0000644000175000017500000013115312251307514013060 00000000000000/* * snprintf.c - a portable implementation of snprintf * * AUTHOR * Mark Martinec , April 1999. * * Copyright 1999, Mark Martinec. All rights reserved. * * TERMS AND CONDITIONS * This program is free software; you can redistribute it and/or modify * it under the terms of the "Frontier Artistic License" which comes * with this Kit. * * 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 Frontier Artistic License for more details. * * You should have received a copy of the Frontier Artistic License * with this Kit in the file named LICENSE.txt . * If not, I'll be glad to provide one. * * FEATURES * - careful adherence to specs regarding flags, field width and precision; * - good performance for large string handling (large format, large * argument or large paddings). Performance is similar to system's sprintf * and in several cases significantly better (make sure you compile with * optimizations turned on, tell the compiler the code is strict ANSI * if necessary to give it more freedom for optimizations); * - return value semantics as per ISO C9X; * - written in standard ISO/ANSI C - requires an ANSI C compiler. * * SUPPORTED FORMATS AND DATA TYPES * * This snprintf only supports format specifiers: * s, c, d, o, u, x, X, p (and synonyms: i, D, U, O - see below) * with flags: '-', '+', ' ', '0' and '#'. * An asterisk is supported for field width as well as precision. * * Data type modifiers 'h' (short int), 'l' (long int) * and 'll' (long long int) are supported. * NOTE: * If macro SNPRINTF_LONGLONG_SUPPORT is not defined (default) the * data type modifier 'll' is recognized but treated the same as 'l', sn * which may cause argument value truncation! Defining * SNPRINTF_LONGLONG_SUPPORT requires that your system's sprintf also * handles data type modifier 'll'. long long int is a language * extension which may not be portable. * * Conversion of numeric data (formats d, o, u, x, X, p) with data type * modifiers (none or h, l, ll) is left to the system routine sprintf, * but all handling of flags, field width and precision as well as c and * s formats is done very carefully by this portable routine. If a string * precision (truncation) is specified (e.g. %.8s) it is guaranteed the * string beyond the specified precision will not be referenced. * * Data type modifiers h, l and ll are ignored for c and s formats (data * types wint_t and wchar_t are not supported). * * The following common synonyms for conversion characters are supported: * - i is a synonym for d * - D is a synonym for ld, explicit data type modifiers are ignored * - U is a synonym for lu, explicit data type modifiers are ignored * - O is a synonym for lo, explicit data type modifiers are ignored * * The following is specifically not supported: * - flag ' (thousands' grouping character) is recognized but ignored * - numeric formats: f, e, E, g, G and synonym F * - data type modifier 'L' (long double) and 'q' (quad - use 'll' instead) * - wide character/string formats: C, lc, S, ls * - writeback of converted string length: conversion character n * - the n$ specification for direct reference to n-th argument * - locales * * It is permitted for size to be zero, and it is permitted to specify NULL * pointer for resulting string argument if str_m is zero (as per ISO C9X). * * The return value is the number of characters which would be generated * for the given input, excluding the trailing null. If this value * is greater or equal to str_m, not all characters from the result * have been stored in str. If str_m is greater than zero it is * guaranteed the resulting string will be null-terminated. * * NOTE that this matches the ISO C9X and GNU C library 2.1, * but is different from some older implementations! * * Routines asprintf and vasprintf return a pointer (in the ptr argument) * to a buffer sufficiently large to hold the resulting string. This pointer * should be passed to free(3) to release the allocated storage when it is * no longer needed. If sufficient space cannot be allocated, these functions * will return -1 and set ptr to be a NULL pointer. These two routines are a * GNU C library extensions (glibc). * * Routines asnprintf and vasnprintf are similar to asprintf and vasprintf, * yet, like snprintf and vsnprintf counterparts, will write at most str_m-1 * characters into the allocated output string, the last character in the * allocated buffer then gets the terminating null. If the formatted string * length (the return value) is greater than or equal to the str_m argument, * the resulting string was truncated and some of the formatted characters * were discarded. These routines present a handy way to limit the amount * of allocated memory to some sane value. * * AVAILABILITY * http://www.ijs.si/software/snprintf/ * * REVISION HISTORY * 1999-04 V0.9 Mark Martinec * - initial version, some modifications after comparing printf * man pages for Digital Unix 4.0, Solaris 2.6 and HPUX 10, * and checking how Perl handles sprintf (differently!); * 1999-04-09 V1.0 Mark Martinec * - added main test program, fixed remaining inconsistencies, * added optional (long long int) support; * 1999-04-12 V1.1 Mark Martinec * - support the 'p' format (pointer to void); * - if a string precision is specified * make sure the string beyond the specified precision * will not be referenced (e.g. by strlen); * 1999-04-13 V1.2 Mark Martinec * - support synonyms %D=%ld, %U=%lu, %O=%lo; * - speed up the case of long format string with few conversions; * 1999-06-30 V1.3 Mark Martinec * - fixed runaway loop (eventually crashing when str_l wraps * beyond 2*31) while copying format string without * conversion specifiers to a buffer that is too short * (thanks to Edwin Young for * spotting the problem); * - added macros PORTABLE_SNPRINTF_VERSION_(MAJOR|MINOR) * to snprintf.h * 2000-02-14 V2.0 (never released) Mark Martinec * - relaxed license terms: The Artistic License now applies. * You may still apply the GNU GENERAL PUBLIC LICENSE * as was distributed with previous versions, if you prefer; * - changed REVISION HISTORY dates to use ISO 8601 date format; * - added vsnprintf (patch also independently proposed by * Caolan McNamara 2000-05-04, and Keith M Willenson 2000-06-01) * 2000-06-27 V2.1 Mark Martinec * - removed POSIX check for str_m<1; value 0 for str_m is * allowed by ISO C9X (and GNU C library 2.1) - (pointed out * on 2000-05-04 by Caolan McNamara, caolan@ csn dot ul dot ie). * Besides relaxed license this change in standards adherence * is the main reason to bump up the major version number; * - added nonstandard routines asnprintf, vasnprintf, asprintf, * vasprintf that dynamically allocate storage for the * resulting string; these routines are not compiled by default, * see comments where NEED_V?ASN?PRINTF macros are defined; * - autoconf contributed by Caolan McNamara */ /* Define HAVE_SNPRINTF if your system already has snprintf and vsnprintf. * * If HAVE_SNPRINTF is defined this module will not produce code for * snprintf and vsnprintf, unless PREFER_PORTABLE_SNPRINTF is defined as well, * causing this portable version of snprintf to be called fli_portable_snprintf * (and fli_portable_vsnprintf). */ /* #define HAVE_SNPRINTF */ /* Define PREFER_PORTABLE_SNPRINTF if your system does have snprintf and * vsnprintf but you would prefer to use the portable routine(s) instead. * In this case the portable routine is declared as fli_portable_snprintf * (and fli_portable_vsnprintf) and a macro 'snprintf' (and 'vsnprintf') * is defined to expand to 'portable_v?snprintf' - see file snprintf.h . * Defining this macro is only useful if HAVE_SNPRINTF is also defined, * but does does no harm if defined nevertheless. */ /* #define PREFER_PORTABLE_SNPRINTF */ /* Define SNPRINTF_LONGLONG_SUPPORT if you want to support * data type (long long int) and data type modifier 'll' (e.g. %lld). * If undefined, 'll' is recognized but treated as a single 'l'. * * If the system's sprintf does not handle 'll' * the SNPRINTF_LONGLONG_SUPPORT must not be defined! * * This is off by default since (long long int) is a language extension. */ /* #define SNPRINTF_LONGLONG_SUPPORT */ /* Define NEED_SNPRINTF_ONLY if you only need snprintf, and not vsnprintf. * If NEED_SNPRINTF_ONLY is defined, the snprintf will be defined directly, * otherwise both snprintf and vsnprintf routines will be defined * and snprintf will be a simple wrapper around vsnprintf, at the expense * of an extra procedure call. */ /* #define NEED_SNPRINTF_ONLY */ /* Define NEED_V?ASN?PRINTF macros if you need library extension * routines asprintf, vasprintf, asnprintf, vasnprintf respectively, * and your system library does not provide them. They are all small * wrapper routines around fli_portable_vsnprintf. Defining any of the four * NEED_V?ASN?PRINTF macros automatically turns off NEED_SNPRINTF_ONLY * and turns on PREFER_PORTABLE_SNPRINTF. * * Watch for name conflicts with the system library if these routines * are already present there. * * NOTE: vasprintf and vasnprintf routines need va_copy() from stdarg.h, as * specified by C9X, to be able to traverse the same list of arguments twice. * I don't know of any other standard and portable way of achieving the same. * With some versions of gcc you may use __va_copy(). You might even get away * with "ap2 = ap", in this case you must not call va_end(ap2) ! */ /* #define NEED_ASPRINTF */ /* #define NEED_ASNPRINTF */ /* #define NEED_VASPRINTF */ /* #define NEED_VASNPRINTF */ /* Define the following macros if desired: * SOLARIS_COMPATIBLE, SOLARIS_BUG_COMPATIBLE, * HPUX_COMPATIBLE, HPUX_BUG_COMPATIBLE, * DIGITAL_UNIX_COMPATIBLE, DIGITAL_UNIX_BUG_COMPATIBLE, * PERL_COMPATIBLE, PERL_BUG_COMPATIBLE, * * - For portable applications it is best not to rely on peculiarities * of a given implementation so it may be best not to define any * of the macros that select compatibility and to avoid features * that vary among the systems. * * - Selecting compatibility with more than one operating system * is not strictly forbidden but is not recommended. * * - 'x'_BUG_COMPATIBLE implies 'x'_COMPATIBLE . * * - 'x'_COMPATIBLE refers to (and enables) a behaviour that is * documented in a sprintf man page on a given operating system * and actually adhered to by the system's sprintf (but not on * most other operating systems). It may also refer to and enable * a behaviour that is declared 'undefined' or 'implementation specific' * in the man page but a given implementation behaves predictably * in a certain way. * * - 'x'_BUG_COMPATIBLE refers to (and enables) a behaviour of system's sprintf * that contradicts the sprintf man page on the same operating system. * * - I do not claim that the 'x'_COMPATIBLE and 'x'_BUG_COMPATIBLE * conditionals take into account all idiosyncrasies of a particular * implementation, there may be other incompatibilities. */ /* added by Lgb, the LyX Project */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* ============================================= */ /* NO USER SERVICABLE PARTS FOLLOWING THIS POINT */ /* ============================================= */ #define PORTABLE_SNPRINTF_VERSION_MAJOR 2 #define PORTABLE_SNPRINTF_VERSION_MINOR 1 #if defined ( NEED_ASPRINTF ) || defined ( NEED_ASNPRINTF ) || defined ( NEED_VASPRINTF ) || defined ( NEED_VASNPRINTF ) # if defined ( NEED_SNPRINTF_ONLY ) # undef NEED_SNPRINTF_ONLY # endif # if ! defined ( PREFER_PORTABLE_SNPRINTF ) # define PREFER_PORTABLE_SNPRINTF # endif #endif #if defined ( SOLARIS_BUG_COMPATIBLE ) && ! defined ( SOLARIS_COMPATIBLE ) #define SOLARIS_COMPATIBLE #endif #if defined ( HPUX_BUG_COMPATIBLE ) && ! defined ( HPUX_COMPATIBLE ) #define HPUX_COMPATIBLE #endif #if defined ( DIGITAL_UNIX_BUG_COMPATIBLE ) && ! defined( DIGITAL_UNIX_COMPATIBLE ) #define DIGITAL_UNIX_COMPATIBLE #endif #if defined ( PERL_BUG_COMPATIBLE ) && ! defined ( PERL_COMPATIBLE ) #define PERL_COMPATIBLE #endif #include #include #include #include #include #include #include #ifdef isdigit #undef isdigit #endif #define isdigit( c ) ( ( c ) >= '0' && ( c ) <= '9' ) /* prototypes */ #if defined ( NEED_ASPRINTF ) int asprintf( char **, const char *, ... ); #endif #if defined ( NEED_VASPRINTF ) int vasprintf( char **, const char *, va_list ); #endif #if defined ( NEED_ASNPRINTF ) int asnprintf( char **, size_t, const char *, ... ); #endif #if defined ( NEED_VASNPRINTF ) int vasnprintf( char **, size_t, const char *, va_list ); #endif #ifndef va_copy #define va_copy( ap2, ap ) ap2 = ap #endif #if 0 #if defined ( HAVE_SNPRINTF ) /* declare our portable snprintf routine under name fli_portable_snprintf */ /* declare our portable vsnprintf routine under name fli_portable_vsnprintf */ #else /* declare our portable routines under names snprintf and vsnprintf */ #define fli_portable_snprintf snprintf #if !defined ( NEED_SNPRINTF_ONLY ) #define fli_portable_vsnprintf vsnprintf #endif #endif #endif /* 0 */ #if ! defined ( HAVE_SNPRINTF ) || defined ( PREFER_PORTABLE_SNPRINTF ) int fli_portable_snprintf( char *, size_t, const char *, ... ); #if ! defined ( NEED_SNPRINTF_ONLY ) int fli_portable_vsnprintf( char *, size_t, const char *, va_list ); #endif #endif /*************************************** ***************************************/ #if defined ( NEED_ASPRINTF ) int asprintf( char **ptr, const char *fmt, ... ) { va_list ap; size_t str_m; int str_l; *ptr = NULL; va_start( ap, fmt ); /* measure the required size */ str_l = fli_portable_vsnprintf( NULL, ( size_t ) 0, fmt, ap ); va_end( ap ); assert( str_l >= 0 ); /* possible integer overflow if str_m > INT_MAX */ *ptr = fl_malloc( str_m = str_l + 1 ); if ( *ptr == NULL ) { errno = ENOMEM; str_l = -1; } else { int str_l2; va_start( ap, fmt ); str_l2 = fli_portable_vsnprintf( *ptr, str_m, fmt, ap ); va_end( ap ); assert( str_l2 == str_l ); } return str_l; } #endif /*************************************** ***************************************/ #if defined ( NEED_VASPRINTF ) int vasprintf( char ** ptr, const char * fmt, va_list ap ) { size_t str_m; int str_l; *ptr = NULL; { va_list ap2; va_copy( ap2, ap ); /* don't consume the original ap, we'll need it again */ /* measure the required size: */ str_l = fli_portable_vsnprintf( NULL, ( size_t ) 0, fmt, ap2 ); va_end( ap2 ); } assert( str_l >= 0 ); /* possible integer overflow if str_m > INT_MAX */ *ptr = fl_malloc( str_m = str_l + 1 ); if ( *ptr == NULL ) { errno = ENOMEM; str_l = -1; } else { int str_l2 = fli_portable_vsnprintf( *ptr, str_m, fmt, ap ); assert( str_l2 == str_l ); } return str_l; } #endif /*************************************** ***************************************/ #if defined ( NEED_ASNPRINTF ) int asnprintf( char ** ptr, size_t str_m, const char * fmt, ... ) { va_list ap; int str_l; *ptr = NULL; va_start( ap, fmt ); /* measure the required size */ str_l = fli_portable_vsnprintf( NULL, ( size_t ) 0, fmt, ap ); va_end( ap ); assert( str_l >= 0 ); /* possible integer overflow if str_m > INT_MAX */ if ( ( size_t ) str_l + 1 < str_m ) str_m = ( size_t ) str_l + 1; /* truncate */ /* if str_m is 0, no buffer is allocated, just set *ptr to NULL */ if ( str_m == 0 ) { /* not interested in resulting string, just return size */ } else { *ptr = fl_malloc( str_m ); if ( *ptr == NULL ) { errno = ENOMEM; str_l = -1; } else { int str_l2; va_start( ap, fmt ); str_l2 = fli_portable_vsnprintf( *ptr, str_m, fmt, ap ); va_end( ap ); assert( str_l2 == str_l ); } } return str_l; } #endif /*************************************** ***************************************/ #if defined ( NEED_VASNPRINTF ) int vasnprintf ( char ** ptr, size_t str_m, const char * fmt, va_list ap ) { int str_l; *ptr = NULL; { va_list ap2; va_copy( ap2, ap ); /* don't consume the original ap, we'll need it again */ /* measure the required size: */ str_l = fli_portable_vsnprintf( NULL, ( size_t ) 0, fmt, ap2 ); va_end( ap2 ); } assert( str_l >= 0 ); /* possible integer overflow if str_m > INT_MAX */ if ( ( size_t ) str_l + 1 < str_m ) str_m = ( size_t )str_l + 1; /* truncate */ /* if str_m is 0, no buffer is allocated, just set *ptr to NULL */ if ( str_m == 0 ) { /* not interested in resulting string, just return size */ } else { *ptr = fl_malloc( str_m ); if ( *ptr == NULL ) { errno = ENOMEM; str_l = -1; } else { int str_l2 = fli_portable_vsnprintf( *ptr, str_m, fmt, ap ); assert( str_l2 == str_l ); } } return str_l; } #endif /*************************************** ***************************************/ /* * If the system does have snprintf and the portable routine is not * specifically required, this module produces no code for snprintf/vsnprintf. */ #if ! defined ( HAVE_SNPRINTF ) || defined ( PREFER_PORTABLE_SNPRINTF ) #if ! defined ( NEED_SNPRINTF_ONLY ) int fli_portable_snprintf( char * str, size_t str_m, const char * fmt, ... ) { va_list ap; int str_l; va_start( ap, fmt ); str_l = fli_portable_vsnprintf( str, str_m, fmt, ap ); va_end( ap ); return str_l; } #endif /*************************************** ***************************************/ #if defined ( NEED_SNPRINTF_ONLY ) int fli_portable_snprintf( char * str, size_t str_m, const char * fmt, ... ) { #else int fli_portable_vsnprintf( char * str, size_t str_m, const char * fmt, va_list ap ) { #endif #if defined ( NEED_SNPRINTF_ONLY ) va_list ap; #endif size_t str_l = 0; const char *p = fmt; /* In contrast to POSIX the ISO C9X now says that str can be NULL and str_m can be 0. This is more useful. */ /*if (str_m < 1) return -1;*/ #if defined ( NEED_SNPRINTF_ONLY ) va_start( ap, fmt ); #endif if ( ! p ) p = ""; while ( *p ) { if ( *p != '%' ) { /* if (str_l < str_m) str[str_l++] = *p++; -- this would be sufficient but the following code achieves better performance for cases where format string is long and contains few conversions */ const char *q = strchr( p + 1, '%' ); int n = ! q ? strlen( p ) : ( q - p ); int avail = ( int ) ( str_m - str_l ); if ( avail > 0 ) { int k; char *r; const char* p1; for ( p1 = p, r = str + str_l, k = ( n > avail ? avail : n ); k > 0 ; k-- ) *r++ = *p1++; } p += n; str_l += n; } else { const char *starting_p; int min_field_width = 0, precision = 0; int zero_padding = 0, precision_specified = 0, justify_left = 0; int alternative_form = 0, force_sign = 0; int space_for_positive = 1; /* If both the ' ' and '+' flags appear, the ' ' flag should be ignored. */ char data_type_modifier = '\0';/* allowed valued: \0, h, l, L, p */ char tmp[ 32 ]; /* temporary buffer for simple numeric->string conversion */ const char *str_arg = NULL; /* string address in case of string arguments */ int str_arg_l; /* natural field width of arg without padding and sign */ int j; long int long_arg; /* long int argument value - always defined in case of numeric arguments, regardless of data type modifiers. In case of data type modifier 'll' the value is stored in long_long_arg and only the sign of long_arg is guaranteed to be correct */ void *ptr_arg; /* pointer argument value - only defined for p format */ int int_arg; /* int argument value - only defined if no h or l modif.*/ #ifdef SNPRINTF_LONGLONG_SUPPORT long long int long_long_arg = 0; /* long long argument value - only defined if ll modifier is present */ #endif int number_of_zeros_to_pad = 0; int zero_padding_insertion_ind = 0; char fmt_spec = '\0'; /* current format specifier character */ starting_p = p; p++; /* skip '%' */ /* parse flags */ while ( *p == '0' || *p == '-' || *p == '+' || *p == ' ' || *p == '#' || *p == '\'') { switch ( *p ) { case '0': zero_padding = 1; break; case '-': justify_left = 1; break; case '+': force_sign = 1; space_for_positive = 0; break; case ' ': force_sign = 1; /* If both the ' ' and '+' flags appear, the ' ' flag should be ignored */ #ifdef PERL_COMPATIBLE /* ... but in Perl the last of ' ' and '+' applies */ space_for_positive = 1; #endif break; case '#': alternative_form = 1; break; case '\'': break; } p++; } /* If the '0' and '-' flags both appear, the '0' flag should be ignored. */ /* parse field width */ if ( *p == '*' ) { p++; min_field_width = va_arg( ap, int ); if ( min_field_width < 0 ) { min_field_width = -min_field_width; justify_left = 1; } } else if ( isdigit( ( unsigned char ) *p ) ) { min_field_width = *p++ - '0'; while (isdigit( ( unsigned char ) *p ) ) min_field_width = 10 * min_field_width + ( *p++ - '0' ); } /* parse precision */ if ( *p == '.' ) { p++; precision_specified = 1; if ( *p == '*' ) { p++; precision = va_arg( ap, int ); if ( precision < 0 ) { precision_specified = 0; precision = 0; /* NOTE: Solaris 2.6 man page claims that in this * case the precision should be set to 0. Digital * Unix 4.0 and HPUX 10 man page claim that this * case should be treated as unspecified precision, * which is what we do here. */ } } else if ( isdigit( ( unsigned char ) *p ) ) { precision = *p++ - '0'; while ( isdigit( ( unsigned char ) *p ) ) precision = 10 * precision + ( *p++ - '0' ); } } /* parse 'h', 'l' and 'll' data type modifiers */ if ( *p == 'h' || *p == 'l' ) { data_type_modifier = *p; p++; if ( data_type_modifier == 'l' && *p == 'l' ) { /* double l = long long */ #ifdef SNPRINTF_LONGLONG_SUPPORT data_type_modifier = '2'; /* double l encoded as '2' */ #else data_type_modifier = 'l'; /* treat it as single 'l' */ #endif p++; } } fmt_spec = *p; /* common synonyms: */ switch ( fmt_spec ) { case 'i': fmt_spec = 'd'; break; case 'D': fmt_spec = 'd'; data_type_modifier = 'l'; break; case 'U': fmt_spec = 'u'; data_type_modifier = 'l'; break; case 'O': fmt_spec = 'o'; data_type_modifier = 'l'; break; default: break; } /* get parameter value, do initial processing */ switch ( fmt_spec ) { case '%': /* % behaves similar to 's' regarding flags and field widths */ case 'c': /* c behaves similar to 's' regarding flags and field widths */ case 's': data_type_modifier = '\0'; /* wint_t and wchar_t not supported */ /* the result of zero padding flag with non-numeric format is undefined */ /* Solaris and HPUX 10 does zero padding in this case, Digital Unix not */ #ifdef DIGITAL_UNIX_COMPATIBLE zero_padding = 0; /* turn zero padding off for string formats */ #endif str_arg_l = 1; switch ( fmt_spec ) { case '%': str_arg = p; break; case 'c': { j = va_arg( ap, int ); str_arg = ( const char * ) &j; } break; case 's': str_arg = va_arg( ap, const char * ); if ( ! str_arg ) str_arg_l = 0; /* make sure not to address string beyond the specified precision !!! */ else if ( ! precision_specified ) str_arg_l = strlen( str_arg ); /* truncate string if necessary as requested by precision */ else if ( precision <= 0 ) str_arg_l = 0; else { const char *q = memchr( str_arg, '\0', ( size_t ) precision ); str_arg_l = ! q ? precision : ( q - str_arg ); } break; default: break; } break; case 'd': case 'o': case 'u': case 'x': case 'X': case 'p': long_arg = 0; int_arg = 0; ptr_arg = NULL; if ( fmt_spec == 'p' ) { /* * HPUX 10: An l, h, ll or L before any other conversion character (other than d, i, o, u, x, or X) is ignored. * Digital Unix: not specified, but seems to behave as HPUX does. * Solaris: If an h, l, or L appears before any other conversion specifier (other than d, i, o, u, x, or X), the behavior is undefined. (Actually %hp converts only 16-bits of address and %llp treats address as 64-bit data which is incompatible with (void *) argument on a 32-bit system). */ #ifdef SOLARIS_COMPATIBLE # ifdef SOLARIS_BUG_COMPATIBLE /* keep data type modifiers even if it represents 'll' */ # else if ( data_type_modifier == '2' ) data_type_modifier = '\0'; # endif #else data_type_modifier = '\0'; #endif ptr_arg = va_arg( ap, void * ); long_arg = ! ptr_arg ? 0 : 1; } else { switch ( data_type_modifier ) { case '\0': case 'h': /* It is non-portable to specify a second argument of char or short to va_arg, because arguments seen by the called function are not char or short. C converts char and short arguments to int before passing them to a function. */ int_arg = va_arg( ap, int ); long_arg = int_arg; break; case 'l': long_arg = va_arg( ap, long int ); break; #ifdef SNPRINTF_LONGLONG_SUPPORT case '2': long_long_arg = va_arg( ap, long long int ); /* only the sign of long_arg is guaranteed */ if ( long_long_arg > 0 ) long_arg = +1; else if ( long_long_arg < 0 ) long_arg = -1; else long_arg = 0; break; #endif } } str_arg = tmp; str_arg_l = 0; /* NOTE: * For d, i, o, u, x, and X conversions, if precision * is specified, the '0' flag should be ignored. This * is so with Solaris 2.6, Digital UNIX 4.0 and HPUX 10; * but not with Perl. */ #ifndef PERL_COMPATIBLE if ( precision_specified ) zero_padding = 0; #endif if ( fmt_spec == 'd' ) { if ( force_sign && long_arg >= 0 ) tmp[ str_arg_l++ ] = space_for_positive ? ' ' : '+'; /* Leave negative numbers for sprintf to handle, to avoid handling tricky cases like (short int)(-32768) */ } else if ( alternative_form ) { if ( long_arg != 0 && ( fmt_spec == 'x' || fmt_spec == 'X' ) ) { tmp[ str_arg_l++ ] = '0'; tmp[ str_arg_l++ ] = fmt_spec; } #ifdef HPUX_COMPATIBLE else if ( fmt_spec == 'p' /* HPUX 10: for an alternative form of p conversion, * a nonzero result is prefixed by 0x. */ #ifndef HPUX_BUG_COMPATIBLE /* Actually it uses 0x prefix even for a zero value. */ && long_arg != 0 #endif ) { tmp[ str_arg_l++ ] = '0'; tmp[ str_arg_l++ ] = 'x'; } #endif } zero_padding_insertion_ind = str_arg_l; if ( ! precision_specified ) precision = 1; /* default precision is 1 */ if ( precision == 0 && long_arg == 0 #ifdef HPUX_BUG_COMPATIBLE && fmt_spec != 'p' /* HPUX 10 man page claims: With conversion character * p the result of converting a zero value with a * precision of zero is a null string. * Actually it returns all zeroes. */ #endif ) { /* converted to null string */ } else { char f[ 5 ]; int f_l = 0; f[ f_l++ ] = '%'; if ( ! data_type_modifier ) { } else if ( data_type_modifier == '2' ) { f[ f_l++ ] = 'l'; f[ f_l++ ] = 'l'; } else f[ f_l++ ] = data_type_modifier; f[ f_l++ ] = fmt_spec; f[ f_l++ ] = '\0'; if ( fmt_spec == 'p' ) str_arg_l += sprintf( tmp + str_arg_l, f, ptr_arg ); else { switch ( data_type_modifier ) { case '\0': case 'h': str_arg_l += sprintf( tmp + str_arg_l, f, int_arg ); break; case 'l': str_arg_l += sprintf( tmp + str_arg_l, f, long_arg ); break; #ifdef SNPRINTF_LONGLONG_SUPPORT case '2': str_arg_l += sprintf( tmp + str_arg_l, f, long_long_arg ); break; #endif } } if ( zero_padding_insertion_ind < str_arg_l && tmp[ zero_padding_insertion_ind ] == '-' ) zero_padding_insertion_ind++; } { int num_of_digits = str_arg_l - zero_padding_insertion_ind; if ( alternative_form && fmt_spec == 'o' #ifdef HPUX_COMPATIBLE /* ("%#.o",0) -> "" */ && ( str_arg_l > 0 ) #endif #ifdef DIGITAL_UNIX_BUG_COMPATIBLE /* ("%#o",0) -> "00" */ #else && ! ( zero_padding_insertion_ind < str_arg_l && tmp[zero_padding_insertion_ind] == '0' ) #endif ) { /* assure leading zero for alternative-form octal numbers */ if ( ! precision_specified || precision < num_of_digits + 1 ) { precision = num_of_digits + 1; precision_specified = 1; } } /* zero padding to specified precision? */ if ( num_of_digits < precision ) number_of_zeros_to_pad = precision - num_of_digits; } /* zero padding to specified minimal field width? */ if ( ! justify_left && zero_padding ) { int n = min_field_width - ( str_arg_l + number_of_zeros_to_pad ); if ( n > 0 ) number_of_zeros_to_pad += n; } break; default: /* unrecognized format, keep format string unchanged */ zero_padding = 0; /* turn zero padding off for non-numeric formats */ #ifndef DIGITAL_UNIX_COMPATIBLE justify_left = 1; min_field_width = 0; /* reset flags */ #endif #ifdef PERL_COMPATIBLE /* keep the entire format string unchanged */ str_arg = starting_p; str_arg_l = p - starting_p; #else /* discard the unrecognized format, just keep the unrecognized fmt char */ str_arg = p; str_arg_l = 0; #endif if ( *p ) str_arg_l++; /* include invalid fmt specifier if not at EOS */ break; } if ( *p ) p++; /* step over the just processed format specifier */ /* insert padding to the left as requested by min_field_width */ if ( ! justify_left ) { /* left padding with blank or zero */ int n = min_field_width - ( str_arg_l + number_of_zeros_to_pad ); if ( n > 0 ) { int avail = ( int ) ( str_m - str_l ); if ( avail > 0 ) { /* memset(str+str_l, zp, (n>avail?avail:n)); */ const char zp = zero_padding ? '0' : ' '; int k; char *r; for ( r = str + str_l, k= ( n > avail ? avail : n ); k > 0; k-- ) *r++ = zp; } str_l += n; } } /* zero padding as requested by the precision for numeric formats requred?*/ if ( number_of_zeros_to_pad <= 0 ) { /* will not copy first part of numeric here, * * force it to be copied later in its entirety */ zero_padding_insertion_ind = 0; } else { /* insert first part of numerics (sign or '0x') before zero padding */ int n = zero_padding_insertion_ind; if ( n > 0 ) { int avail = ( int ) ( str_m - str_l ); if ( avail > 0 ) memcpy( str + str_l, str_arg, ( size_t ) ( n > avail ? avail : n ) ); str_l += n; } /* insert zero padding as requested by the precision */ n = number_of_zeros_to_pad; if ( n > 0 ) { int avail = ( int ) ( str_m - str_l ); if ( avail > 0 ) { /* memset(str+str_l, '0', (n>avail?avail:n)); */ int k; char *r; for ( r = str + str_l, k = ( n > avail ? avail : n ); k > 0; k-- ) *r++ = '0'; } str_l += n; } } /* insert formatted string (or unmodified format for unknown formats) */ { int n = str_arg_l - zero_padding_insertion_ind; if ( n > 0 ) { int avail = ( int ) ( str_m - str_l ); if ( avail > 0 ) memcpy( str + str_l, str_arg + zero_padding_insertion_ind, ( size_t ) ( n > avail ? avail : n ) ); str_l += n; } } /* insert right padding */ if ( justify_left ) { /* right blank padding to the field width */ int n = min_field_width - ( str_arg_l + number_of_zeros_to_pad ); if ( n > 0 ) { int avail = ( int ) ( str_m - str_l ); if ( avail > 0 ) { /* memset(str+str_l, ' ', (n>avail?avail:n)); */ int k; char *r; for ( r = str + str_l, k= n > avail ? avail : n; k > 0; k-- ) *r++ = ' '; } str_l += n; } } } } #if defined(NEED_SNPRINTF_ONLY) va_end( ap ); #endif if ( str_m > 0 ) { /* make sure the string is null-terminated even at the expense of overwriting the last character */ str[ str_l <= str_m - 1 ? str_l : str_m -1 ] = '\0'; } return str_l; /* return the number of characters formatted (excluding trailing null character), that is, the number of characters that would have been written to the buffer if it were large enough */ } #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/fonts.c0000664000175000017500000004612612353623325012037 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fonts.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * All font and string size query routines. There are rooms for speed ups. * For one, font switching can be reduced somewhat. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/flvasprintf.h" #include #include static XFontStruct * defaultfs; static XFontStruct * try_get_font_struct( int, int, int ); static char * get_fname( const char *, int ); /* * Question marks indicate the sizes in tenth of a point. It will be * replaced on the fly by the font requesting routines. Depending on * the availability of the fonts and capabilities of the server, the * font may or may not be scalable. * * Resolution field is left blank on purpose as the resolution reported * by the server is not reliable thus the program can't force the * resolution. This way the admins can set the proper font path. * * Order is important as it has to agree with FL_TIMES_STYLE etc * defined in Basic.h * */ /* These default fonts may not be the most beuatiful X11 fonts available on the system but they are part of X11 distributions since at least 20 years, so we can be rather sure that they're available everywhere. (And, remember, these fonts must be available on the machine where the X server is running on, which is not necessarily the machine where the program using XForms is executed.) */ static const char *default_fonts[ ] = { "-*-helvetica-medium-r-*-*-*-?-*-*-p-*-*-*", "-*-helvetica-bold-r-*-*-*-?-*-*-p-*-*-*", "-*-helvetica-medium-o-*-*-*-?-*-*-p-*-*-*", "-*-helvetica-bold-o-*-*-*-?-*-*-p-*-*-*", "-*-courier-medium-r-*-*-*-?-*-*-*-*-*-*", "-*-courier-bold-r-*-*-*-?-*-*-*-*-*-*", "-*-courier-medium-o-*-*-*-?-*-*-*-*-*-*", "-*-courier-bold-o-*-*-*-?-*-*-*-*-*-*", "-*-times-medium-r-*-*-*-?-*-*-p-*-*-*", "-*-times-bold-r-*-*-*-?-*-*-p-*-*-*", "-*-times-medium-i-*-*-*-?-*-*-p-*-*-*", "-*-times-bold-i-*-*-*-?-*-*-p-*-*-*", "-*-charter-medium-r-*-*-*-?-*-*-*-*-*-*", "-*-charter-bold-r-*-*-*-?-*-*-*-*-*-*", "-*-charter-medium-i-*-*-*-?-*-*-*-*-*-*", "-*-charter-bold-i-*-*-*-?-*-*-*-*-*-*", NULL }; static FL_FONT fl_fonts[ FL_MAXFONTS ]; static const char *cv_fname( const char * ); #define DEFAULTF1 "fixed" #define DEFAULTF2 "6x13" /*************************************** * Global initialization routine. Must be called before any font * routine can be used. We can place fli_init_font in all font switching * and string size query routines so a seperate initialization is not * needed, and it has the added bonus that startup *may* be faster, * but we pay a function call overhead in every call to any of these * font related routines. ***************************************/ void fli_init_font( void ) { FL_FONT *flf; const char *const *f = default_fonts; static int initialized; if ( initialized ) return; initialized = 1; /* If fl_set_font_name() has been called before fl_initialize() we need to keep the changes */ for ( flf = fl_fonts, f = default_fonts; *f; f++, flf++ ) if ( ! *flf->fname ) strcpy( flf->fname, *f ); /* Load a default font */ if ( ! defaultfs && ! ( defaultfs = XLoadQueryFont( flx->display, DEFAULTF1 ) ) ) defaultfs = XLoadQueryFont( flx->display, DEFAULTF2 ); /* Load a couple of fonts at normal size to prevent the caching code from using bad looking replacement if strange sizes are requested */ fl_get_font_struct( FL_NORMAL_STYLE, FL_DEFAULT_SIZE ); fl_get_font_struct( FL_BOLD_STYLE, FL_DEFAULT_SIZE ); fl_get_font_struct( FL_FIXED_STYLE, FL_DEFAULT_SIZE ); } /*************************************** * In addition to get the font handle, we also make the font current * in default GC ***************************************/ void fl_set_font( int numb, int size ) { int dh; XCharStruct overall; XFontStruct *fs; fs = fl_get_font_struct( numb, size ); /* cur_font is always the one in current GC */ if ( fl_state[ fl_vmode ].cur_fnt == fs ) { #if FL_DEBUG >= ML_DEBUG M_debug( "fl_set_font", "current", fli_curfnt ); #endif return; } fl_state[ fl_vmode ].cur_fnt = flx->fs = fs; /* Basic font info (no need to send a string, we just want the maximum ascent and descent) */ XTextExtents( flx->fs, "", 0, &dh, &flx->fasc, &flx->fdesc, &overall ); flx->fheight = flx->fasc + flx->fdesc; XSetFont( flx->display, flx->textgc, flx->fs->fid ); if ( fli_cntl.debug > 1 ) { unsigned long res = 0; if ( XGetFontProperty( flx->fs, XA_RESOLUTION, &res ) ) M_info2( "fl_set_font", "FontResolution: %lu", res ); } } /*************************************** * Add a new font (indexed by n) or change an existing font. * Preferably the font name constains a '?' in the size * position so different sizes can be used. ***************************************/ int fl_set_font_name( int n, const char * name ) { FL_FONT *flf; if ( n < 0 || n >= FL_MAXFONTS ) { M_warn( "fl_set_font_name", "Bad font number (%d)", n ); return -1; } if ( ! name || ! *name ) { M_warn( "fl_set_font_name", "Bad font name" ); return -1; } if ( strlen( name ) > FL_MAX_FONTNAME_LENGTH ) { M_warn( "fl_set_font_name", "Font name too long" ); return -1; } flf = fl_fonts + n; if ( *flf->fname ) { int i; for ( i = 0; i < flf->nsize; i++ ) if ( flf->size[ i ] > 0 ) XFreeFont( flx->display, flf->fs[ i ] ); *flf->fname = '\0'; } flf->nsize = 0; strcpy( flf->fname, name ); if ( ! flx || ! flx->display ) return 1; return try_get_font_struct( n, FL_DEFAULT_SIZE, 1 ) ? 0 : -1; } /*************************************** * Add a new font (indexed by n) or change an existing font. ***************************************/ int fl_set_font_name_f( int n, const char * fmt, ... ) { char *buf; int ret; EXPAND_FORMAT_STRING( buf, fmt ); ret = fl_set_font_name( n, buf ); fl_free( buf ); return ret; } /*************************************** * Returns the name of the indexed font ***************************************/ const char * fl_get_font_name( int n ) { if ( n < 0 || n >= FL_MAXFONTS ) return NULL; return fl_fonts[ n ].fname; } /*************************************** * List built-in fonts ***************************************/ int fl_enumerate_fonts( void ( * output )( const char *s ), int shortform ) { FL_FONT *flf = fl_fonts, *fe = flf + FL_MAXFONTS; int n = 0; for ( ; output && flf < fe; flf++ ) if ( *flf->fname ) { output( shortform ? cv_fname( flf->fname ) : flf->fname ); n++; } return n; } /*************************************** * All font changes go through this routine. If with_fail is false, * this routine will not fail even if requested font can't be loaded. * A substitution will be made. ***************************************/ static XFontStruct * try_get_font_struct( int numb, int size, int with_fail ) { FL_FONT *flf = fl_fonts; XFontStruct *fs = NULL; int i, is_subst = 0; if ( special_style( numb ) ) numb %= FL_SHADOW_STYLE; /* Avoid trying to use negative or zero font size */ if ( size <= 0 ) { M_info( "try_get_font_struct", "Bad font size requested (%d), using %d istead", size, size < 0 ? -size : 1 ); size = size < 0 ? -size : 1; } flf = fl_fonts + numb; if ( numb < 0 || numb >= FL_MAXFONTS || ! *flf->fname ) { if ( ! fli_no_connection ) { /* This function is typically used to test whether a font is loadable or not, so it's not a fatal error if it fails. Issue a message for information therefore. */ M_info( "try_get_font_struct", "Bad FontStyle requested: %d: %s", numb, flf->fname ); } if ( ! fl_state[ fl_vmode ].cur_fnt ) M_warn( "try_get_font_struct", "bad font returned" ); return fl_state[ fl_vmode ].cur_fnt; } strcpy( fli_curfnt, get_fname( flf->fname, size ) ); /* Search for requested size in the cached fonts - fonts with "negative sizes" are replacement fonts found before */ for ( fs = NULL, i = 0; ! fs && i < flf->nsize; i++ ) if ( size == abs( flf->size[ i ] ) ) fs = flf->fs[ i ]; /* Return it if font has already been loaded (i.e. is in the cache) */ if ( fs ) return fs; /* Try to load the font */ fs = XLoadQueryFont( flx->display, fli_curfnt ); /* If that didn't work try to find a replacement font, i.e. an already loaded font with the nearest size or, if there's none, the very most basic font. */ if ( ! fs ) { int mdiff = INT_MAX, k; if ( with_fail ) return NULL; M_warn( "try_get_font_struct", "Can't load %s, using subsitute", fli_curfnt ); /* Search for a replacement with the nearest size */ for ( k = -1, i = 0; i < flf->nsize; i++ ) { if ( mdiff > FL_abs( size - flf->size[ i ] ) ) { mdiff = FL_abs( size - flf->size[ i ] ); k = i; } } if ( k != -1 ) fs = flf->fs[ k ]; else fs = flx->fs ? flx->fs : defaultfs; is_subst = 1; } /* If cache is full make space at the end */ if ( flf->nsize == FL_MAX_FONTSIZES ) { if ( flf->size[ FL_MAX_FONTSIZES - 1 ] > 0 ) XFreeFont( flx->display, flf->fs[ FL_MAX_FONTSIZES - 1 ] ); flf->nsize--; } flf->fs[ flf->nsize ] = fs; flf->size[ flf->nsize++ ] = is_subst ? - size : size; /* Here we are guranteed a valid font handle although there is no gurantee the font handle corresponds to the font requested */ return fs; } /*************************************** ***************************************/ XFontStruct * fl_get_font_struct( int style, int size ) { return try_get_font_struct( style, size, 0 ); } /*************************************** * Similar to fl_get_string_xxxGC except that there is no side effects. * Must not free the fontstruct as structure FL_FONT caches the * structure for possible future use. ***************************************/ int fl_get_string_width( int style, int size, const char * s, int len ) { XFontStruct *fs = fl_get_font_struct( style, size ); return fli_no_connection ? ( len * size ) : XTextWidth( fs, s, len ); } /*************************************** ***************************************/ int fli_get_string_widthTABfs( XFontStruct * fs, const char * s, int len ) { int w, tab; const char *p, *q; if ( fli_no_connection ) return 12 * len; tab = fli_get_tabpixels( fs ); for ( w = 0, q = s; *q && ( p = strchr( q, '\t' ) ) && ( p - s ) < len; q = p + 1 ) { w += XTextWidth( fs, q, p - q ); w = ( ( w / tab ) + 1 ) * tab; } return w += XTextWidth( fs, q, len - ( q - s ) ); } /*************************************** ***************************************/ int fl_get_string_widthTAB( int style, int size, const char * s, int len ) { XFontStruct *fs = fl_get_font_struct( style, size ); return fli_get_string_widthTABfs( fs, s, len ); } /*************************************** * Function returns the height of the string, calculated from adding the * largest ascent and descent of all its characters in the string, via 'asc' * and 'desc' (but which both can be NULL pointers), the maximum ascent * and descent. ***************************************/ int fl_get_string_height( int style, int size, const char * s, int len, int * asc, int * desc ) { int a, d; if ( fli_no_connection ) a = d = size / 2; else { XFontStruct *fs = fl_get_font_struct( style, size ); XCharStruct overall; int dh; XTextExtents( fs, s, len, &dh, &a, &d, &overall ); } if ( asc ) *asc = a; if ( desc ) *desc = d; return a + d; } /*************************************** * Returns font height and, via 'asc' and 'desc' (but which both can be NULL * pointers), the fonts ascent and descent. ***************************************/ int fl_get_char_height( int style, int size, int * asc, int * desc ) { int a, d; if ( fli_no_connection ) a = d = size / 2; else { XFontStruct *fs = fl_get_font_struct( style, size ); a = fs->ascent; d = fs->descent; if ( asc ) *asc = a; if ( desc ) *desc = d; } return a + d; } /*************************************** * Function returns the width of the widest character in the requested font ***************************************/ int fl_get_char_width( int style, int size ) { XFontStruct *fs = fl_get_font_struct( style, size ); return fs->max_bounds.width; } /*************************************** ***************************************/ void fl_get_string_dimension( int fntstyle, int fntsize, const char * s, int len, int * width, int * height ) { const char *p, *q; int h, maxw = 0, maxh = 0; h = fl_get_char_height( fntstyle, fntsize, NULL, NULL ); for ( q = s; *q && ( p = strchr( q, '\n' ) ); q = p + 1 ) { maxw = FL_max( maxw, fl_get_string_width( fntstyle, fntsize, q, p - q ) ); maxh += h; } maxw = FL_max( maxw, fl_get_string_width( fntstyle, fntsize, q, len - ( q - s ) ) ); maxh += h; *width = maxw; *height = maxh; } /* * Tab handling. Currently only one tab */ #define MaxTabs 5 static char *tabstop[ MaxTabs ] = { "aaaaaaaa", 0 }; static int tabstopNchar[ MaxTabs ] = { 7 }; /*************************************** ***************************************/ void fl_set_tabstop( const char *s ) { static int set; if ( s ) { if ( set ) fl_free( *tabstop ); *tabstop = fl_strdup( s ); *tabstopNchar = strlen( *tabstop ); set = 1; } } /*************************************** ***************************************/ int fli_get_tabpixels( XFontStruct * fs ) { return XTextWidth( fs, *tabstop, *tabstopNchar ) + XTextWidth( fs, " ", 1 ); } /*************************************** * Convert X font names to more conventional names by stripping the * auxiliary info. ***************************************/ static const char * cv_fname( const char *f ) { static char fname[ FL_MAX_FONTNAME_LENGTH + 1 ]; char *q, *p; /* Remove all the garbages from head */ for ( q = strcpy( fname, f ); *q && ! isalnum( ( unsigned char ) *q ); q++ ) /* empty */ ; /* Remove all the garbage from the end, starting from '?' */ if ( ( p = strchr( fname, '?' ) ) ) *--p = '\0'; /* Remove all remaining garbages */ for ( p = fname + strlen( fname ) - 1; p > q && ! isalnum( ( unsigned char ) *p ); p-- ) /* empty */ ; *++p = '\0'; return q; } /*************************************** * Given a font name and a size (in points), assemble the complete name ***************************************/ static char * get_fname( const char * str, int size ) { static char fname[ sizeof fli_curfnt ]; char len_str[ 50 ]; /* should be enough for all ints */ char *p; /* If necessary truncate font names that are too long, the caller expects a real string */ strncpy( fname, str, sizeof fname - 1 ); fname[ sizeof fname - 1 ] = '\0'; if ( ( p = strchr( fname, '?' ) ) ) { int len = sprintf( len_str, "%d0", size ); if ( len + strlen( str ) <= sizeof fname - 1 ) { memmove( p + len, p + 1, strlen( p ) ); strncpy( p, len_str, len ); } } return fname; } /*************************************** * Some compatibility stuff, i.e. functions that were never documented * and were removed from V0.89, but apparently this broke some applications * that were using them. Put back in 10/22/00. ***************************************/ int fl_fdesc_( void ) { return flx->fdesc; } /*************************************** ***************************************/ int fl_fheight_( void ) { return flx->fheight; } /*************************************** ***************************************/ GC fl_gc_( void ) { return flx->gc; } /*************************************** ***************************************/ GC fl_textgc_( void ) { return flx->textgc; } /*************************************** ***************************************/ Window fl_cur_win_( void ) { return flx->win; } /*************************************** ***************************************/ XFontStruct * fl_cur_fs_( void ) { return flx->fs; } /*************************************** ***************************************/ Display * fl_display_( void ) { return flx->display; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/scrollbut.c0000664000175000017500000000734712353623325012721 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file scrollbut.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Buttons for the scrollbar. Maybe of some value in general use. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" #include "flinternal.h" /*************************************** ***************************************/ static void draw_scrollbutton( FL_OBJECT * ob ) { FL_COLOR c1; FL_Coord abw = FL_abs( ob->bw ); FL_Coord extra = abw; FL_BUTTON_STRUCT *sp = ob->spec; int btype = FLI_TRIANGLE_UPBOX8; char *label = ob->label; int x = ob->x, y = ob->y, w = ob->w, h = ob->h; if ( ob->col2 != FL_COL1 && ( sp->event == FL_ENTER || sp->event == FL_LEAVE ) ) return; if ( sp->event == FL_DRAW ) fl_draw_box( ob->boxtype, x, y, w, h, ob->col1, ob->bw ); if ( *label == '#' ) { w = h = FL_min( ob->w, ob->h ); x += ( ob->w - w ) / 2; y += ( ob->h - h ) / 2; label++; } if ( ( ob->boxtype != FL_NO_BOX && ob->boxtype != FL_FLAT_BOX ) || abw == 1 ) { extra += 1 + 0.051 * FL_min( w, h ); abw = 1; } if ( *label == '2' ) btype = sp->val ? FLI_TRIANGLE_DOWNBOX2 : FLI_TRIANGLE_UPBOX2; else if ( *label == '4' ) btype = sp->val ? FLI_TRIANGLE_DOWNBOX4 : FLI_TRIANGLE_UPBOX4; else if ( *label == '6' ) btype = sp->val ? FLI_TRIANGLE_DOWNBOX6 : FLI_TRIANGLE_UPBOX6; else if ( *label == '8' ) btype = sp->val ? FLI_TRIANGLE_DOWNBOX8 : FLI_TRIANGLE_UPBOX8; c1 = ( ob->belowmouse && sp->event != FL_RELEASE ) ? FL_MCOL : ob->col2; fli_draw_tbox( btype, x + extra, y + extra, w - 2 * extra, h - 2 * extra, c1, abw ); } /*************************************** * creates an object ***************************************/ FL_OBJECT * fl_create_scrollbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob; fl_add_button_class( FL_SCROLLBUTTON, draw_scrollbutton, 0 ); ob = fl_create_generic_button( FL_SCROLLBUTTON, type, x, y, w, h, label ); ob->boxtype = FL_UP_BOX; ob->col1 = FL_COL1; ob->col2 = FL_COL1; ob->lcol = FL_COL1; return ob; } /*************************************** * Adds an object ***************************************/ FL_OBJECT * fl_add_scrollbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob = fl_create_scrollbutton( type, x, y, w, h, label ); fl_add_object( fl_current_form, ob ); return ob; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/Makefile.in0000664000175000017500000010566012353624173012610 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/config.h.in $(top_srcdir)/config/common.am subdir = lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man5dir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libforms_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_libforms_la_OBJECTS = align.lo appwin.lo asyn_io.lo bitmap.lo \ box.lo browser.lo button.lo canvas.lo chart.lo checkbut.lo \ child.lo choice.lo clipboard.lo clock.lo cmd_br.lo colsel.lo \ combo.lo counter.lo cursor.lo dial.lo display.lo errmsg.lo \ events.lo flcolor.lo fldraw.lo flsnprintf.lo flresource.lo \ flvisual.lo fonts.lo formbrowser.lo forms.lo frame.lo free.lo \ fselect.lo global.lo goodie_alert.lo goodie_choice.lo \ goodie_input.lo goodie_msg.lo goodies.lo goodie_sinput.lo \ goodie_yesno.lo goodie_colchooser.lo handling.lo input.lo \ interpol.lo keyboard.lo labelbut.lo lframe.lo lightbut.lo \ listdir.lo menu.lo nmenu.lo objects.lo oneliner.lo pixmap.lo \ popup.lo positioner.lo read2lsbf.lo read2msbf.lo read4lsb.lo \ read4msb.lo readint.lo round3d.lo roundbut.lo scrollbar.lo \ scrollbut.lo select.lo signal.lo sldraw.lo slider.lo space.lo \ spinner.lo strdup.lo symbols.lo sysdep.lo tabfolder.lo tbox.lo \ text.lo thumbwheel.lo timeout.lo timer.lo tooltip.lo util.lo \ valuator.lo version.lo vn_pair.lo win.lo xdraw.lo xpopup.lo \ xsupport.lo xtext.lo xyplot.lo nodist_libforms_la_OBJECTS = libforms_la_OBJECTS = $(am_libforms_la_OBJECTS) \ $(nodist_libforms_la_OBJECTS) libforms_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libforms_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libforms_la_SOURCES) $(nodist_libforms_la_SOURCES) DIST_SOURCES = $(libforms_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive man5dir = $(mandir)/man5 NROFF = nroff MANS = $(man_MANS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FL_FIXLEVEL = @FL_FIXLEVEL@ FL_REVISION = @FL_REVISION@ FL_VERSION = @FL_VERSION@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIB = @JPEG_LIB@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ TEXI2DVI = @TEXI2DVI@ TEXI2DVI_NEEDS_PDF = @TEXI2DVI_NEEDS_PDF@ TEXI2HTML = @TEXI2HTML@ VERSION = @VERSION@ XMKMF = @XMKMF@ XPM_LIB = @XPM_LIB@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign DISTCLEANFILES = *.orig *.rej *~ *.bak core makelog MAINTAINERCLEANFILES = $(srcdir)/Makefile.in makelog AM_INSTALL_DATA_FLAGS = $(INSTALL) -m 644 -D @USE_BWC_BS_HACK_FALSE@BWC = @USE_BWC_BS_HACK_TRUE@BWC = -DUSE_BWC_BS_HACK CLEANFILES = forms.h xforms.5 EXTRA_DIST = xforms.man dirent_vms.h vms_readdir.c SUBDIRS = bitmaps fd include private INCLUDES = -DMAKING_FORMS $(X_CFLAGS) $(BWC) lib_LTLIBRARIES = libforms.la libforms_la_LDFLAGS = -no-undefined -version-info @SO_VERSION@ libforms_la_LIBADD = $(X_LIBS) $(XPM_LIB) -lX11 nodist_libforms_la_SOURCES = config.h man_MANS = xforms.5 libforms_la_SOURCES = \ align.c \ appwin.c \ asyn_io.c \ bitmap.c \ box.c \ browser.c \ button.c \ canvas.c \ chart.c \ checkbut.c \ child.c \ choice.c \ clipboard.c \ clock.c \ cmd_br.c \ colsel.c \ combo.c \ counter.c \ cursor.c \ dial.c \ display.c \ dmalloc.h \ errmsg.c \ events.c \ extern.h \ flcolor.c \ fldraw.c \ flinternal.h \ flsnprintf.c \ flresource.c \ flvisual.c \ fonts.c \ formbrowser.c \ forms.c \ frame.c \ free.c \ fselect.c \ global.c \ goodie_alert.c \ goodie_choice.c \ goodie_input.c \ goodie_msg.c \ goodies.c \ goodie_sinput.c \ goodie_yesno.c \ goodie_colchooser.c \ handling.c \ input.c \ interpol.c \ keyboard.c \ labelbut.c \ lframe.c \ lightbut.c \ listdir.c \ local.h \ menu.c \ nmenu.c \ objects.c \ oneliner.c \ pixmap.c \ popup.c \ positioner.c \ read2lsbf.c \ read2msbf.c \ read4lsb.c \ read4msb.c \ readint.c \ round3d.c \ roundbut.c \ scrollbar.c \ scrollbut.c \ select.c \ signal.c \ sldraw.c \ slider.c \ space.c \ spinner.c \ strdup.c \ symbols.c \ sysdep.c \ tabfolder.c \ tbox.c \ text.c \ thumbwheel.c \ timeout.c \ timer.c \ tooltip.c \ ulib.h \ util.c \ valuator.c \ version.c \ vn_pair.c \ win.c \ xdraw.c \ xpopup.c \ xsupport.c \ xtext.c \ xyplot.c all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/common.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/common.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then rm -f stamp-h1; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status lib/config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libforms.la: $(libforms_la_OBJECTS) $(libforms_la_DEPENDENCIES) $(EXTRA_libforms_la_DEPENDENCIES) $(libforms_la_LINK) -rpath $(libdir) $(libforms_la_OBJECTS) $(libforms_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/align.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/appwin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asyn_io.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/box.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/browser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/button.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/canvas.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chart.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/checkbut.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/child.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/choice.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clipboard.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmd_br.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colsel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/combo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/counter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cursor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dial.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/display.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errmsg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/events.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flcolor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fldraw.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flresource.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flsnprintf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flvisual.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fonts.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/formbrowser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/forms.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frame.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/free.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fselect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/global.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goodie_alert.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goodie_choice.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goodie_colchooser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goodie_input.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goodie_msg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goodie_sinput.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goodie_yesno.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goodies.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/handling.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/input.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interpol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyboard.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/labelbut.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lframe.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lightbut.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listdir.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/menu.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmenu.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objects.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oneliner.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/popup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/positioner.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read2lsbf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read2msbf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read4lsb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read4msb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readint.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/round3d.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/roundbut.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scrollbar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scrollbut.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sldraw.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slider.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/space.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spinner.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strdup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symbols.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysdep.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tabfolder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tbox.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thumbwheel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timeout.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tooltip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/valuator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vn_pair.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/win.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdraw.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpopup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xsupport.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xtext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xyplot.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man5: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man5dir)" || $(MKDIR_P) "$(DESTDIR)$(man5dir)" @list=''; test -n "$(man5dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.5[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ done; } uninstall-man5: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.5[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) $(MANS) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man5dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-man install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man5 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-libLTLIBRARIES uninstall-man uninstall-man: uninstall-man5 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags ctags-recursive \ distclean distclean-compile distclean-generic distclean-hdr \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man \ install-man5 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am \ uninstall-libLTLIBRARIES uninstall-man uninstall-man5 xforms.5: cp -p ./xforms.man xforms.5 # 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: xforms-1.2.4/lib/readint.c0000644000175000017500000001004712251554050012316 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file readint.c * * Copyright(c) 1993,1994 by T.C. Zhao * All rights reserved. * * Read an integer (decimal or hex) from a file. * Valid sepertors are SPACE, \t \n and , * Comment is introduced by # * * For hex integers, a-f, A-F is assumed continous */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include /* for isdigit */ #include "include/forms.h" #include "flinternal.h" #include "ulib.h" #define IS_FS( c ) \ ( ( c ) == ' ' || ( c ) == '\t' || ( c ) == '\n' || ( c ) == ',' ) #define IS_COMMENT( c ) ( ( c ) == '#' ) static int yell = 0; /*************************************** ***************************************/ static void bad_character( int c ) { if ( yell && c != EOF ) fprintf(stderr, "Bad character %c Code=%d\n", c, c); } /*************************************** ***************************************/ static int skip_comment( FILE * fp ) { int c; while ( ( c = getc( fp ) ) != EOF && c != '\n' ) /* empty */ ; return c != EOF ? getc( fp ) : EOF; } /*************************************** * read an integer [+-]nnn. No way to return error status ***************************************/ int fli_readint( FILE * fp ) { int c, num = 0, sign = 1; do { c = getc( fp ); while ( IS_COMMENT( c ) ) c = skip_comment( fp ); } while ( IS_FS( c ) ); if ( c == '-' || c == '+' ) { sign = ( c == '-' ) ? -1 : 1; c = getc( fp ); } while ( isdigit( ( unsigned char ) c ) ) { num = 10 * num + c - '0'; c = getc( fp ); } if ( ! IS_FS( c ) ) { bad_character( c ); num = 123456; } return sign * num; } /*************************************** * Read a positive integer. return EOF if error ***************************************/ int fli_readpint( FILE * fp ) { int c, num = 0; do { c = getc( fp ); while ( IS_COMMENT( c ) ) c = skip_comment( fp ); } while ( IS_FS( c ) ); if ( ! ( c == '+' || isdigit( ( unsigned char ) c ) ) ) { bad_character( c ); return EOF; } do { num = 10 * num + c - '0'; c = getc( fp ); } while ( isdigit( ( unsigned char ) c ) ); return num; } /*************************************** * Read a hex integer ***************************************/ int fli_readhexint( FILE * fp ) { int num = 0, i, c; static short hextab[ 256 ]; /* Initialize the hex table */ if ( ! hextab[ '1' ] ) { for ( i = '1'; i <= '9'; i++ ) hextab[ i ] = i - '0'; for ( i = 'A'; i <= 'F'; i++ ) hextab[ i ] = 10 + i - 'A'; for ( i = 'a'; i <= 'f'; i++ ) hextab[ i ] = 10 + i - 'a'; } do { c = getc( fp ); while ( IS_COMMENT( c ) ) c = skip_comment( fp ); } while ( IS_FS( c ) ); /* demand 0[xX] */ if ( c != '0' || ( ( c = getc( fp ) ) != 'x' && c != 'X' ) ) { bad_character( c ); return EOF; } /* Now do the coversion */ while ( ( c = getc( fp ) ), isxdigit( ( unsigned char ) c ) ) num = ( num << 4 ) + hextab[ ( unsigned char ) c ]; return num; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/win.c0000664000175000017500000006060012353623326011475 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file win.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao * All rights reserved. * * To isolate dependencies of XForms on the window system, we provide * some system-neutual windowing services. It is expected that all * XForms internal windowing will be done using these. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" #include "flinternal.h" #include "private/flvasprintf.h" /********************************************************************* * * Windowing support. * Geometry preference, opening/closing windows and geometry queries * * winclose is in appwin.c * ****************************************************************{****/ static XSetWindowAttributes st_xswa; static XSizeHints st_xsh; static XWMHints st_xwmh; static unsigned int st_wmask; static int st_wmborder; static unsigned int bwidth = 0; static int fli_winreparentxy( Window win, Window new_parent, int x, int y ); extern FLI_WM_STUFF fli_wmstuff; /* defined in flresource.c */ /********************************************************************* * Default window attributes. Subject to pref_winsize and its friends **********************************************************************/ void fli_default_xswa( void ) { /* OwnerGrab is needed for pop-up to work correctly */ st_xswa.event_mask = ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | OwnerGrabButtonMask | EnterWindowMask | LeaveWindowMask | ButtonMotionMask | PointerMotionMask | PointerMotionHintMask /* | VisibilityChangeMask | PropertyChangeMask */ | StructureNotifyMask; /* Add event mask flags required by the input method/context */ if( fli_context->xic ) { long int fevents; if ( ! XGetICValues( fli_context->xic, XNFilterEvents, &fevents, NULL ) ) st_xswa.event_mask |= fevents; } st_xswa.backing_store = fli_cntl.backingStore; st_wmask = CWEventMask | CWBackingStore; /* Border_pixel must be set for 24bit TrueColor displays */ st_xswa.border_pixel = 0; st_wmask |= CWBorderPixel; st_xsh.flags = 0; /* Default size */ st_xsh.width = st_xsh.base_width = 320; st_xsh.height = st_xsh.base_height = 200; /* Border */ st_wmborder = FL_FULLBORDER; /* Keyboard focus. Need window manager's help */ st_xwmh.input = True; st_xwmh.initial_state = NormalState; st_xwmh.flags = InputHint | StateHint; } /************** Window sizes ******************{**/ /*************************************** * Open window with this size ***************************************/ void fl_initial_winsize( FL_Coord w, FL_Coord h ) { st_xsh.width = st_xsh.base_width = w; st_xsh.height = st_xsh.base_height = h; st_xsh.flags |= USSize; } /*************************************** ***************************************/ void fl_initial_winstate( int state ) { st_xwmh.initial_state = state; st_xwmh.flags |= StateHint; } /*************************************** ***************************************/ void fl_winicon( Window win, Pixmap p, Pixmap m ) { XWMHints lxwmh, *xwmh; lxwmh.flags = 0; xwmh = win ? &lxwmh : &st_xwmh; xwmh->icon_pixmap = p; xwmh->icon_mask = m; xwmh->flags |= IconPixmapHint | IconMaskHint; if ( win ) XSetWMHints( flx->display, win, xwmh ); } /*************************************** * Open window with this size and KEEP it this size if window manager * coorporates ***************************************/ void fl_winsize( FL_Coord w, FL_Coord h ) { fl_initial_winsize( w, h ); /* Try to disable interactive resizing */ st_xsh.min_width = st_xsh.max_width = w; st_xsh.min_height = st_xsh.max_height = h; st_xsh.flags |= PMinSize | PMaxSize; } /*************************************** * Set a limit to the minimum size a window can take. Can be used * while a window is visible. If window is not given, we take the * request to mean a constraint for future windows. ***************************************/ void fl_winminsize( Window win, FL_Coord w, FL_Coord h ) { XSizeHints mxsh, *sh; /* Copy current constraints */ mxsh = st_xsh; mxsh.flags = 0; sh = win ? &mxsh : &st_xsh; sh->min_width = w; sh->min_height = h; sh->flags |= PMinSize; if ( win ) XSetWMNormalHints( flx->display, win, sh ); } /*************************************** ***************************************/ void fl_winmaxsize( Window win, FL_Coord w, FL_Coord h ) { XSizeHints mxsh, *sh; mxsh = st_xsh; mxsh.flags = 0; sh = win ? &mxsh : &st_xsh; sh->max_width = w; sh->max_height = h; sh->flags |= PMaxSize; if ( win ) XSetWMNormalHints( flx->display, win, sh ); } /*************************************** ***************************************/ void fl_winstepsize( Window win, FL_Coord dx, FL_Coord dy ) { XSizeHints mxsh, *sh; /* Copy current constraints */ mxsh = st_xsh; mxsh.flags = 0; sh = win ? &mxsh : &st_xsh; sh->width_inc = dx; sh->height_inc = dy; sh->flags |= PResizeInc; if ( win ) XSetWMNormalHints( flx->display, win, sh ); } /******* End of basic win size routines **********}***/ /******* Window position routines **************{***/ /*************************************** ***************************************/ void fl_winposition( FL_Coord x, FL_Coord y ) { st_xsh.x = x; st_xsh.y = y; st_xsh.flags |= fli_wmstuff.pos_request; } /****** End of window positioning routines ******}*/ /***** Window position and size **************{****/ /*************************************** ***************************************/ void fl_initial_wingeometry( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h ) { fl_winposition( x, y ); fl_initial_winsize( w, h ); } /*************************************** ***************************************/ void fl_wingeometry( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h ) { fl_winposition( x, y ); fl_winsize( w, h ); } /***** End of geometry preference routine *******}**/ /***** Misc. windowing routines *****************{*/ /*************************************** * Try to fix the aspect ration ***************************************/ void fl_winaspect( Window win, FL_Coord x, FL_Coord y ) { XSizeHints lxsh, *xsh; if ( x <= 0 || y <= 0 ) { M_err( "fl_winaspect", "Bad aspect ratio" ); return; } lxsh.flags = 0; xsh = win ? &lxsh : &st_xsh; xsh->flags |= PAspect; xsh->min_aspect.x = x; xsh->min_aspect.y = y; xsh->max_aspect.x = x; xsh->max_aspect.y = y; xsh->base_width = xsh->width = x; xsh->base_height = xsh->height = y; if ( xsh->base_width < 100 || xsh->base_height < 100 ) { double fact = 100 / FL_max( x, y ); xsh->base_width *= fact; xsh->base_height *= fact; } if ( win ) XSetWMNormalHints( flx->display, win, xsh ); } /*************************************** ***************************************/ void fl_noborder( void ) { st_wmborder = FL_NOBORDER; } /*************************************** ***************************************/ void fl_transient( void ) { st_wmborder = FL_TRANSIENT; } /*************************************** ***************************************/ void fl_winmove( Window win, FL_Coord dx, FL_Coord dy) { if ( win ) XMoveWindow( flx->display, win, dx, dy ); else fl_winposition( dx, dy ); } /*************************************** ***************************************/ void fl_winreshape( Window win, FL_Coord dx, FL_Coord dy, FL_Coord w, FL_Coord h ) { if ( win ) XMoveResizeWindow( flx->display, win, dx, dy, w, h ); else { fl_winresize( win, w, h ); fl_winmove( win, dx, dy ); } } /***** End of misc. windowing routines **********}*/ /********* Window geometry query routines ********{*/ /*************************************** ***************************************/ void fl_get_winsize( Window win, FL_Coord * w, FL_Coord * h ) { unsigned int ww, hh, bjunk, djunk; int xx, yy; Window root; XGetGeometry( flx->display, win, &root, &xx, &yy, &ww, &hh, &bjunk, &djunk ); *w = ww; *h = hh; } /*************************************** ***************************************/ void fl_get_winorigin( Window win, FL_Coord * x, FL_Coord * y ) { int xx, yy; unsigned int ww, hh, bw, d; Window root; XGetGeometry( flx->display, win, &root, &xx, &yy, &ww, &hh, &bw, &d ); XTranslateCoordinates( flx->display, win, root, - ( int ) bw, - ( int ) bw, &xx, &yy, &root ); *x = xx; *y = yy; } /*************************************** ***************************************/ void fl_get_wingeometry( Window win, FL_Coord * x, FL_Coord * y, FL_Coord * w, FL_Coord * h ) { int xx, yy; unsigned int ww, hh, bw, d; Window root; XGetGeometry( flx->display, win, &root, &xx, &yy, &ww, &hh, &bw, &d ); XTranslateCoordinates( flx->display, win, root, - ( int ) bw, - ( int ) bw, &xx, &yy, &root ); *x = xx; *y = yy; *w = ww; *h = hh; } /***** End of window geometry query routines ********}*/ /******* Open window etc ***********************/ /*************************************** * If one of the forms is destoryed we want to know about it * All window notices the Close window manager command ***************************************/ static void setup_catch_destroy( Window win ) { static Atom atom_delete_win; static Atom atom_protocols; if ( ! atom_delete_win ) atom_delete_win = XInternAtom( flx->display, "WM_DELETE_WINDOW", 0 ); if ( ! atom_protocols ) atom_protocols = XInternAtom( flx->display, "WM_PROTOCOLS", 0 ); XChangeProperty( flx->display, win, atom_protocols, XA_ATOM, 32, PropModeReplace, ( unsigned char * ) &atom_delete_win, 1 ); } /*************************************** * Waits until we know for sure the newly mapped window is visible ***************************************/ static void wait_mapwin( Window win ) { XEvent xev; if ( ! ( st_xswa.event_mask & StructureNotifyMask ) ) { M_err( "wait_mapwin", "XForms improperly initialized" ); exit( 1 ); } /* Wait for the window to become mapped */ do { XWindowEvent( flx->display, win, StructureNotifyMask, &xev ); fli_xevent_name( "waiting", &xev ); } while ( xev.type != MapNotify ); } /*************************************** ***************************************/ static char * fl_label_to_res_name( const char * label ) { static char res[ 54 ]; fli_sstrcpy( res, label ? label : "", sizeof res ); fli_nuke_all_non_alnum( res ); if ( res[ 0 ] && isupper( ( unsigned char ) res[ 0 ] ) ) res[ 0 ] = tolower( ( unsigned char ) res[ 0 ] ); return res; } /*************************************** ***************************************/ static char * get_machine_name( Display * d ) { static char machine_name[ 256 ] = ""; char *p; if ( machine_name[ 0 ] ) return machine_name; if ( gethostname( machine_name, sizeof machine_name - 1 ) ) { M_err( "get_machine_name", "Unable to get host name" ); strcpy( machine_name, DisplayString( d ) ); if ( ( p = strchr( machine_name, ':' ) ) ) *p = '\0'; } return machine_name; } /*************************************** ***************************************/ void fli_set_winproperty( Window win, unsigned int prop ) { char **argv; int argc; if ( prop & FLI_COMMAND_PROP ) { argv = fl_get_cmdline_args( &argc ); XSetCommand( flx->display, win, argv, argc ); } } /*************************************** ***************************************/ Window fli_create_window( Window parent, Colormap m, const char * wname ) { Window win; XClassHint clh; char *tmp; XTextProperty xtpwname, xtpmachine; char *label = fl_strdup( wname ? wname : "" ); FL_FORM *mainform = fl_get_app_mainform( ); st_xswa.colormap = m; st_wmask |= CWColormap; /* No decoration means unmanagered windows */ if ( st_wmborder == FL_NOBORDER && ( st_xsh.flags & fli_wmstuff.pos_request) == fli_wmstuff.pos_request ) { /* Turning this on will make the window truely unmananged, might have problems with the input focus and colormaps */ st_xswa.override_redirect = True; st_wmask |= CWOverrideRedirect; } /* MWM uses root window's cursor, don't want that */ if ( ( st_wmask & CWCursor ) != CWCursor ) { st_xswa.cursor = fli_get_cursor_byname( FL_DEFAULT_CURSOR ); st_wmask |= CWCursor; } if ( st_wmborder != FL_FULLBORDER ) { st_xswa.save_under = True; st_wmask |= CWSaveUnder; /* For small transient windows, we don't need backing store */ if ( st_xsh.width < 200 || st_xsh.height < 200 ) st_xswa.backing_store = NotUseful; } if ( mainform && mainform->window ) { st_xwmh.flags |= WindowGroupHint; st_xwmh.window_group = mainform->window; } #if FL_DEBUG >= ML_WARN fli_dump_state_info( fl_vmode, "fli_create_window" ); #endif win = XCreateWindow( flx->display, parent, st_xsh.x, st_xsh.y, st_xsh.width, st_xsh.height, bwidth, fli_depth( fl_vmode ), InputOutput, fli_visual( fl_vmode ), st_wmask, &st_xswa ); if ( fli_cntl.debug > 3 ) { XFlush( flx->display ); fprintf( stderr, "****CreateWin OK**** sleeping 1 seconds\n" ); sleep( 1 ); } clh.res_name = fl_label_to_res_name( label ); clh.res_class = "XForm"; /* Command property is set elsewhere */ xtpwname.value = 0; XStringListToTextProperty( label ? &label : 0, 1, &xtpwname ); XSetWMProperties( flx->display, win, &xtpwname, &xtpwname, 0, 0, &st_xsh, &st_xwmh, &clh ); if ( xtpwname.value ) XFree( xtpwname.value ); xtpmachine.value = 0; tmp = get_machine_name( flx->display ); if ( XStringListToTextProperty( &tmp, 1, &xtpmachine ) ) XSetWMClientMachine( flx->display, win, &xtpmachine ); if ( xtpmachine.value ) XFree( xtpmachine.value ); fli_create_gc( win ); if ( st_wmborder == FL_TRANSIENT ) { if ( mainform && mainform->window ) XSetTransientForHint( flx->display, win, mainform->window ); else XSetTransientForHint( flx->display, win, fl_root ); } fl_free( label ); return win; } /*************************************** ***************************************/ Window fli_cmap_winopen( Window parent, Colormap m, const char * label ) { Window win = fli_create_window( parent, m, label ); return fl_winshow( win ); } /*************************************** ***************************************/ Window fl_wincreate( const char * label ) { return fli_create_window( fl_root, fli_map( fl_vmode ), label) ; } /*************************************** ***************************************/ Window fl_winopen( const char * label ) { fli_init_colormap( fl_vmode ); return fli_cmap_winopen( fl_root, fli_map( fl_vmode ), label ); } /*************************************** ***************************************/ Window fl_winshow( Window win ) { XMapRaised( flx->display, win ); /* Wait until the newly mapped window shows up */ if ( st_xwmh.initial_state == NormalState ) wait_mapwin( win ); setup_catch_destroy( win ); fl_winset( win ); /* Re-initialize window defaults */ fli_default_xswa( ); return win; } /*************************************** ***************************************/ int fli_winreparentxy( Window win, Window new_parent, int x, int y ) { if ( ! win || ! new_parent ) return -1; else return XReparentWindow( flx->display, win, new_parent, x, y ); } /*************************************** ***************************************/ int fl_winreparent( Window win, Window new_parent ) { return fli_winreparentxy( win, new_parent, 0, 0 ); } /*************************************** ***************************************/ void fl_winhide( Window win ) { if ( win ) XUnmapWindow( flx->display, win ); } /*************************************** ***************************************/ void fl_winbackground( Window win, unsigned long bk ) { if ( win == 0 ) { st_xswa.background_pixel = bk; st_wmask |= CWBackPixel; } else { XSetWindowBackground( flx->display, win, bk ); XClearWindow( flx->display, win ); } } /*************************************** ***************************************/ void fl_winset( Window win ) { flx->win = win; } /*************************************** ***************************************/ Window fl_winget( void ) { return flx->win; } /*************************************** ***************************************/ int fl_iconify( Window win ) { return XIconifyWindow( flx->display, win, flx->screen ); } /*************************************** * Inform window manager about window constraints: minsize, maxsize, * aspect ratio ***************************************/ void fl_reset_winconstraints( Window win ) { if ( win ) XSetWMNormalHints( flx->display, win, &st_xsh ); } /*************************************** ***************************************/ void fl_winresize( Window win, FL_Coord neww, FL_Coord newh ) { XSizeHints lxsh; long fields; FL_Coord curwh, curww; if ( ! win ) return; /* If sizes are the same we don't have to do anything. Some window managers are too dumb to optimize this. */ fl_get_winsize( win, &curww, &curwh ); if ( curww == neww && curwh == newh ) return; lxsh.flags = 0; fields = 0; if ( XGetWMNormalHints( flx->display, win, &lxsh, &fields ) ) { lxsh.width = lxsh.base_width = neww; lxsh.height = lxsh.base_height = newh; lxsh.flags |= USSize; if ( lxsh.flags & PMinSize && lxsh.flags & PMaxSize ) { if ( lxsh.min_width == lxsh.max_width ) lxsh.min_width = lxsh.max_width = neww; if ( lxsh.min_height == lxsh.max_height ) lxsh.min_height = lxsh.max_height = newh; } /* Reset any contraints */ if ( lxsh.flags & PMinSize ) { if ( lxsh.min_width > neww ) lxsh.min_width = neww; if ( lxsh.min_height > newh ) lxsh.min_height = newh; } if ( lxsh.flags & PMaxSize ) { if ( lxsh.max_width < neww ) lxsh.max_width = neww; if ( lxsh.max_height < newh ) lxsh.max_height = newh; } XSetWMNormalHints( flx->display, win, &lxsh ); } XResizeWindow( flx->display, win, neww, newh ); XFlush( flx->display ); } /*************************************** * Check if a given window is valid. At the moment only used by * canvas. A dirty hack. *****TODO ***** * If the main event loop is correct, we don't need to do this stuff ***************************************/ static int badwin; static int valid_win_handler( Display * dpy FL_UNUSED_ARG, XErrorEvent * xev ) { if ( xev->error_code == BadWindow || xev->error_code == BadDrawable ) badwin = 1; return 0; } /*************************************** ***************************************/ int fl_winisvalid( Window win ) { int ( * old )( Display *, XErrorEvent * ); FL_Coord w, h; badwin = 0; old = XSetErrorHandler( valid_win_handler ); fl_get_winsize( win, &w, &h ); XSetErrorHandler( old ); return ! badwin; } /*************************************** ***************************************/ void fl_wintitle( Window win, const char * title ) { XTextProperty xtp; if ( ! win && ! title ) return; xtp.value = 0; XStringListToTextProperty( ( char ** ) &title, 1, &xtp ); XSetWMName( flx->display, win, &xtp ); XSetWMIconName( flx->display, win, &xtp ); if ( xtp.value ) XFree( xtp.value ); } /*************************************** ***************************************/ void fl_wintitle_f( Window win, const char * fmt, ... ) { char *buf; EXPAND_FORMAT_STRING( buf, fmt ); fl_wintitle( win, buf ); fl_free( buf ); } /*************************************** ***************************************/ void fl_winicontitle( Window win, const char * title ) { XTextProperty xtp; if ( ! win || ! title ) return; xtp.value = 0; XStringListToTextProperty( ( char ** ) &title, 1, &xtp ); XSetWMIconName( flx->display, win, &xtp ); if ( xtp.value ) XFree( xtp.value ); } /*************************************** ***************************************/ void fl_winicontitle_f( Window win, const char * fmt, ... ) { char *buf; EXPAND_FORMAT_STRING( buf, fmt ); fl_winicontitle( win, buf ); fl_free( buf ); } /*************************************** * Grab keyboard focus ***************************************/ void fl_winfocus( Window win ) { XSetInputFocus( flx->display, win, RevertToParent, CurrentTime ); #if 0 if ( fli_context->xic ) XSetICValues( fli_context->xic, XNClientWindow, win, XNFocusWindow, win, 0 ); #endif } /********* END of Windowing support ***}**/ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/vms_readdir.c0000644000175000017500000002213112251675126013174 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* ** VMS readdir() routines. ** Written by Rich $alz, in August, 1990. ** This code has no copyright. ** ** Feb'95 -- reliance on eliminated, here and in dirent.h; ** support for Unix-style directory specifications implemented; ** vmsreaddirversions() modified to return prior flag setting; ** use ANSI headers and plus VMS headers ** and ; minor lint cleanup. [pr] ** ** Known problems: ** garbage directory specifications aren't always diagnosed. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include /* $FILESCAN arguments */ #include /* Protect against TEST being defined by some other module */ #undef TEST /* Uncomment the next line to get a test routine. */ /* #define TEST */ /* Number of elements in vms_versions array */ #define VERSIZE(e) (sizeof e->vms_versions / sizeof e->vms_versions[0]) /* Simplified string descriptor */ struct dsc { unsigned short len, mbz; char *adr; }; /* Parts of file specification used to specify a directory. */ #define FSCN_DIR (FSCN$M_NODE | FSCN$M_DEVICE | FSCN$M_ROOT | FSCN$M_DIRECTORY) extern unsigned long sys$filescan(); /* Filename syntax conversion routine */ #ifdef __DECC /* (really depends on run-time library, not compiler) */ #define cvt__to_vms decc$to_vms #else #define cvt__to_vms shell$to_vms #endif extern int cvt__to_vms(char *, int (*)(char *, int), int, int); static int cvt_action(char *, int); /* Callback routine uses non re-entrant communication w/ caller. */ static char nambuf[255 + 1]; /* ** XXX$to_vms callback routine. Note: old versions of shell$to_vms ** didn't document the second argument, which indicates whether a ** directory of foo/bar was converted into "[.foo]bar.dir" rather ** than "[.foo.bar]" (such conversion is requested by passing non-zero ** as XXX$to_vms's 4th argument; also undocumented in old versions). */ static int cvt_action(char *name, int dir_flag___unused) { nambuf[sizeof nambuf - 1] = '\0'; (void) strncpy(nambuf, name, sizeof nambuf - 1); /* An even value tells xxx$to_vms that conversion should stop; that point is moot here since wildcard processing is disabled. */ return 0; } /* ** Open a directory, return a handle for later use. */ DIR * opendir( name ) const char *name; { DIR *dd; struct dsc name_dsc; int len, retry = 0; unsigned long flags; /* Validate the directory name argument. ("[...]" is allowed!) */ if (!name || !*name || strchr(name, '*') != 0 || strchr(name, '%') != 0 || strchr(name, '?') != 0) { /* Name is required; wildcards are not allowed. */ errno = ENOTDIR; return NULL; } nambuf[sizeof nambuf - 1] = '\0'; /* (strncpy doesn't guarantee it) */ name_dsc.adr = strncpy(nambuf, name, sizeof nambuf - 1); name_dsc.mbz = 0; do { name_dsc.len = len = strlen(nambuf); /* Check which components of file specification seem to be present. */ flags = ~0; /* (init so that we can ignore return status) */ (void) sys$filescan(&name_dsc, (void *) 0, &flags); if ((flags & ~FSCN_DIR) != 0 || strchr(nambuf, '/') != 0) { /* Didn't supply nice directory name; check for Unix-style one. */ /* (stupid shell$to_vms doesn't like trailing slash) */ if (len > 1 && nambuf[len - 1] == '/') nambuf[len - 1] = '\0'; if (++retry > 1 || cvt__to_vms(nambuf, cvt_action, 0, 0) != 1) { errno = ENOTDIR; return NULL; } /* else: cvt_action() has updated `nambuf'; `retry' is now 1 */ } else retry = 0; /* have something, possibly after retrying once */ } while (retry); /* Get memory for the handle, and the pattern. */ if ((dd = fl_malloc( sizeof *dd ) ) == NULL ) { errno = ENOMEM; return NULL; } dd->pattern = fl_malloc( strlen( nambuf ) + sizeof "*.*" ); if (dd->pattern == NULL) { fl_free( dd ); errno = ENOMEM; return NULL; } /* Fill in the fields. */ strcat(strcpy(dd->pattern, nambuf), "*.*"); dd->context = 0; dd->count = 0; dd->vms_wantversions = 0; dd->pat.adr = dd->pattern; dd->pat.len = strlen(dd->pattern); dd->pat.mbz = 0; memset(&dd->entry, 0, sizeof dd->entry); return dd; } /* ** Set the flag to indicate we want versions or not. Return old setting. */ int vmsreaddirversions(dd, flag) DIR *dd; int flag; { int old_flag = dd->vms_wantversions; dd->vms_wantversions = flag; return old_flag; } /* ** Free up an opened directory. */ void closedir( dd ) DIR *dd; { if (dd) { (void) lib$find_file_end(&dd->context); fl_free(dd->pattern); fl_free((void *) dd); } } /* ** Collect all the version numbers for the current file. */ static void collectversions( dd ) DIR *dd; { struct dsc pat; struct dsc res; struct dirent *e; char *p; char buff[sizeof dd->entry.d_name]; int i; char *text; long context; /* Convenient shorthand. */ e = &dd->entry; /* Add the name plus version wildcard, replacing the "*.*" put on before */ i = strlen(dd->pattern); /* assert( i > 3 ); */ i = FL_max( i, 4 ); text = fl_malloc( (i - 3) + strlen(e->d_name) + sizeof ";*"); if (text == NULL) return; strcpy(text, dd->pattern); strcat(strcpy(&text[i - 3], e->d_name), ";*"); /* Set up the pattern and result descriptors. */ pat.adr = text; pat.len = strlen(text); res.adr = buff; res.len = sizeof buff - 1; pat.mbz = res.mbz = 0; /* Read files, collecting versions. */ for (context = 0; e->vms_verscount < VERSIZE(e); e->vms_verscount++) { if (lib$find_file(&pat, &res, &context) == RMS$_NMF || context == 0) break; buff[sizeof buff - 1] = '\0'; if (p = strchr(buff, ';')) e->vms_versions[e->vms_verscount] = atoi(p + 1); else e->vms_versions[e->vms_verscount] = -1; } if (e->vms_verscount < VERSIZE(e)) e->vms_versions[e->vms_verscount] = -1; (void) lib$find_file_end(&context); fl_free(text); } /* ** Read the next entry from the directory. */ struct dirent * readdir(dd) DIR *dd; { struct dsc res; char *p, *q; int i; /* Set up result descriptor, and get next file. */ res.adr = nambuf; res.len = sizeof nambuf - 1; res.mbz = 0; dd->count++; /* (ought to check for generic success/failure, not a specific value) */ if (lib$find_file(&dd->pat, &res, &dd->context) == RMS$_NMF || dd->context == 0L) /* None left... */ return NULL; /* Strip trailing blanks. */ nambuf[sizeof nambuf - 1] = '\0'; for (p = &nambuf[sizeof nambuf - 1]; p > nambuf && *--p == ' ';) *p = '\0'; /* Skip any directory component and just copy the name. */ p = nambuf; while ((q = strchr(p, ']')) != 0 || (q = strchr(p, '>')) != 0) p = q + 1; (void) strncpy(dd->entry.d_name, p, sizeof dd->entry.d_name - 1); dd->entry.d_name[sizeof dd->entry.d_name - 1] = '\0'; /* Clobber the version. */ if ((p = strchr(dd->entry.d_name, ';')) != 0) *p = '\0'; dd->entry.vms_verscount = 0; dd->entry.vms_versions[0] = 0; if (dd->vms_wantversions) collectversions(dd); return &dd->entry; } /* ** Return something that can be used in a seekdir later. */ long telldir(dd) DIR *dd; { return dd->count; } /* ** Return to a spot where we used to be. Brute force. */ void seekdir(dd, count) DIR *dd; long count; { int vms_wantversions; /* If we haven't done anything yet... */ if (dd->count == 0) return; /* Remember some state, and clear it. */ vms_wantversions = dd->vms_wantversions; dd->vms_wantversions = 0; (void) lib$find_file_end(&dd->context); dd->context = 0; /* The increment is in readdir(). */ for (dd->count = 0; dd->count < count;) (void) readdir(dd); dd->vms_wantversions = vms_wantversions; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/private/0000775000175000017500000000000012353624652012267 500000000000000xforms-1.2.4/lib/private/Makefile.in0000664000175000017500000002513312353624173014256 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/common.am subdir = lib/private ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FL_FIXLEVEL = @FL_FIXLEVEL@ FL_REVISION = @FL_REVISION@ FL_VERSION = @FL_VERSION@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIB = @JPEG_LIB@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ TEXI2DVI = @TEXI2DVI@ TEXI2DVI_NEEDS_PDF = @TEXI2DVI_NEEDS_PDF@ TEXI2HTML = @TEXI2HTML@ VERSION = @VERSION@ XMKMF = @XMKMF@ XPM_LIB = @XPM_LIB@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign DISTCLEANFILES = *.orig *.rej *~ *.bak core makelog MAINTAINERCLEANFILES = $(srcdir)/Makefile.in makelog AM_INSTALL_DATA_FLAGS = $(INSTALL) -m 644 -D EXTRA_DIST = \ flsnprintf.h \ flvasprintf.h \ pbrowser.h \ pcanvas.h \ pchoice.h \ pcounter.h \ pdial.h \ pflps.h \ pformbrowser.h \ pinput.h \ pmenu.h \ pnmenu.h \ ppositioner.h \ pscrollbar.h \ pselect.h \ pslider.h \ pspinner.h \ ptbox.h \ ptwheel.h \ pvaluator.h \ pxyplot.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/common.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/private/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/private/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/common.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: xforms-1.2.4/lib/private/pmenu.h0000664000175000017500000000375112353623325013506 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XForms. If not, see . */ /** * \file pmenu.h */ #ifndef PMENU_H_ #define PMENU_H_ #define MMAXITEMS ( FL_MENU_MAXITEMS + 1 ) /* index 0 unused */ /* make sure that the first 5 elements are the same as FL_CHOICE. * fdesign assumes this */ typedef struct { int numitems; /* number of items in menu */ int val; /* last menu item selected */ char * items[ MMAXITEMS ]; /* individual menu items */ char * shortcut[ MMAXITEMS ]; /* shortcuts for items */ unsigned char mode[ MMAXITEMS ]; /* menu item mode */ int align; /* onle here to mirror FL_CHOICE */ int extern_menu; /* if external pop is used */ short showsymbol; /* whether symbol is to be shown */ short shown; /* if shown */ char mval[ MMAXITEMS ]; /* entry value, position based */ char modechange[ MMAXITEMS ]; int cur_val; /* counter for the value */ int no_title; FL_PUP_CB cb[ MMAXITEMS ]; /* item callback functions */ } FLI_MENU_SPEC; #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/private/pbrowser.h0000664000175000017500000000472112353623325014223 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XForms. If not, see . */ /** * \file pbrowser.h * * This file is part of the XForms library package. * Copyright (c) T.C. Zhao and Mark Overmars * All rights reserved. */ #ifndef PBROWSER_H_ #define PBROWSER_H_ #include "ptbox.h" #include "pscrollbar.h" typedef struct { FL_OBJECT * tb; /* the textbox */ FL_OBJECT * hsl; /* horizontal scrollbar */ FL_OBJECT * vsl; /* vertical scrollbar */ FL_CALLBACKPTR callback; long callback_data; double hsize, vsize; double hval, vval; double hinc1, hinc2; double vinc1, vinc2; int dead_area; int attrib; int v_on, /* scrollbar on/off state */ h_on; int v_pref, /* on/off prefererence */ h_pref; int vw, vw_def; int hh, hh_def; int user_set; FL_BROWSER_SCROLL_CALLBACK hcb, vcb; void * hcb_data, * vcb_data; double old_vp; double old_hp; } FLI_BROWSER_SPEC; #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/private/pdial.h0000664000175000017500000000320412353623325013444 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XForms. If not, see . */ /** * \file pdial.h * * This file is part of the XForms library package. * Copyright (c) 1995-1997 T.C. Zhao and Mark Overmars * All rights reserved. * * Private header for dial object */ #ifndef PDIAL_H #define PDIAL_H typedef struct { double a, /* for speed */ b; double min, /* min/max value of dial */ max; double val; /* current value of dial */ double step; /* step size */ double thetai; /* start angle (degrees) */ double thetaf; /* end angle (degrees) */ double origin; /* where the origin is */ short cross_over; double start_val; short direction; /* not currently used */ } FLI_DIAL_SPEC; #endif /* pdial_h */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/private/pscrollbar.h0000664000175000017500000000202512337325620014515 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XForms. If not, see . */ /** * \file pscrollbar.h */ #ifndef PSCROLLBAR_H_ #define PSCROLLBAR_H_ #include "pslider.h" typedef struct { FL_OBJECT * slider; FL_OBJECT * up; FL_OBJECT * down; double increment; double old_val; } FLI_SCROLLBAR_SPEC; #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/private/pslider.h0000664000175000017500000000342512353623325014022 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XForms. If not, see . */ /** * \file pslider.h * * This file is part of the XForms library package. * Copyright (c) 1995-1997 T.C. Zhao and Mark Overmars * All rights reserved. * * private header for slider object */ #ifndef PSLIDER_H #define PSLIDER_H #include "pvaluator.h" typedef FLI_VALUATOR_SPEC FLI_SLIDER_SPEC; #define MINKNOB_SB 16 /* scrollbar */ #define MINKNOB_SL 14 /* regular sliders */ #define IS_HSLIDER( o ) ( ( o )->type & FL_HOR_FLAG ) #define IS_VSLIDER( o ) ( ! IS_HSLIDER( o ) ) #define IS_FILL( o ) ( ( o )->type & FL_VERT_FILL_SLIDER \ || ( o )->type & FL_VERT_PROGRESS_BAR ) #define IS_SCROLLBAR( o ) ( ( o )->type & FL_SCROLL_FLAG ) #define IS_FLATBOX( bt ) ( ( bt ) == FL_FRAME_BOX \ || ( bt ) == FL_EMBOSSED_BOX \ || ( bt ) == FL_BORDER_BOX \ || ( bt ) == FL_ROUNDED_BOX ) #endif /* PSLIDER_H */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/private/pnmenu.h0000644000175000017500000000167011665175614013670 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XForms. If not, see . */ #ifndef PNMENU_H_ #define PNMENU_H_ typedef struct { FL_POPUP * popup; FL_POPUP_RETURN * sel; FL_COLOR hl_color; } FLI_NMENU_SPEC; #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/private/pvaluator.h0000664000175000017500000000603112353623325014371 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XForms. If not, see . */ /** * \file pvaluator.h * * This file is part of the XForms library package. * Copyright (c) 1995-1997 T.C. Zhao and Mark Overmars * All rights reserved. * * private header for valuator object. Someday, all the * valuator functions will be consolidated to take care * most common tasks. Also the struct has redundant stuff in it. */ #ifndef PVALUATOR_H #define PVALUATOR_H /* The special information for valuators. the size of this structure * probably can be reduced quite a bit. */ typedef struct { double min; /* minimal value of slider */ double max; /* maximal value of slider */ double val; /* current value of slider */ double step; /* step size */ int draw_type; int prec; /* precision when printing value */ double start_val; double ldelta; /* "left mouse" step */ double rdelta; /* "right mouse " step */ double sstep; /* small step for counter */ double lstep; /* large step for counter */ FL_Coord x, /* draw (dbl buffer): adjustment report box */ y, w, h; double slsize; /* size of the slider */ FL_VAL_FILTER filter; FL_Coord offx; FL_Coord offy; FL_Coord mx, /* mouse: after adjustment for report box */ my, mw, mh; FL_Coord old_mx, old_my; int mouse, /* part the mouse is on */ lmouse; FL_Coord ww[ 5 ], /* for counter */ xx[ 5 ]; int changed; unsigned int mouseobj; int cross_over; /* allow cross over */ int repeat_ms; int cur_repeat_ms; int min_repeat_ms; int do_speedjump; int timeout_id; int mouse_off_knob; int was_shift; int react_to[ 3 ]; } FLI_VALUATOR_SPEC; enum { COMPLETE_DRAW = 1, VALUE_DRAW = 2, }; #endif /* PVALUTOR_H */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/private/pcounter.h0000664000175000017500000000214412353623325014214 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XForms. If not, see . */ /** * \file pcounter.h * * This file is part of the XForms library package. * Copyright (c) 1995-1997 T.C. Zhao and Mark Overmars * All rights reserved. * * private header for counter objects */ #ifndef PCOUNTER_H #define PCOUNTER_H #include "pvaluator.h" typedef FLI_VALUATOR_SPEC FLI_COUNTER_SPEC; #endif /* PCOUNTER_H */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/private/ptbox.h0000664000175000017500000001706612353623325013522 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XForms. If not, see . */ #ifndef PTBOX_H #define PTBOX_H typedef struct { char * fulltext; /* text of line with flags */ char * text; /* text of line without flags */ unsigned int len; /* line length */ int selected; /* whether line is selected */ int selectable; /* whether line is selectable */ int x; /* vertical position relative to topline */ int y; /* horizontal position of text */ int w; /* length of text in pixels */ int h; /* height of text in pixels */ int size; /* font size */ int style; /* font style */ int asc; /* font ascent */ int desc; /* font descent */ FL_COLOR color; /* font color */ int align; /* alignment of text */ int is_underlined; /* whether to draw underlined */ int is_separator; /* is this a separator line? */ int is_special; /* does it need special GC? */ GC specialGC; /* GC for if not default font/color */ int incomp_esc; /* text has incomplete escape sequence */ } TBOX_LINE; typedef struct { TBOX_LINE ** lines; /* strurctures for lines of text */ int num_lines; /* number of structures */ int xoffset; /* horizontal scroll in pixels */ int yoffset; /* vertical scroll in pixels */ int x, /* coordinates and sizes of drawing area */ y, w, h; int attrib; /* set when attributes changed */ int no_redraw; /* flags when no redraw is to be done */ int select_line; /* last selected line */ int deselect_line; /* last deselected line */ int max_width; /* length of longest line in pixels */ int max_height; /* height of all lines in pixels */ int def_size; /* default front size */ int def_style; /* default font style */ int def_align; /* default alignment */ int def_height; /* height of line with default font size */ GC defaultGC; /* text drawing GC */ GC backgroundGC; /* background GC */ GC selectGC; /* background for selection GC */ GC nonselectGC; /* for text of non-selectable lines */ GC bw_selectGC; /* b&w selection text GC */ int specialkey; /* Key that indicates a special symbol */ FL_CALLBACKPTR callback; /* double and triple click callback */ long callback_data; /* data for callback */ int old_yoffset; int react_to_vert; int react_to_hori; } FLI_TBOX_SPEC; /* Defaults */ #define FLI_TBOX_BOXTYPE FL_DOWN_BOX #define FLI_TBOX_COL1 FL_WHITE #define FLI_TBOX_COL2 FL_YELLOW #define FLI_TBOX_LCOL FL_LCOL #define FLI_TBOX_ALIGN FL_ALIGN_BOTTOM #define FLI_TBOX_FONTSIZE FL_SMALL_SIZE extern FL_OBJECT * fli_create_tbox( int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char *); extern void fli_tbox_delete_line( FL_OBJECT * obj, int line ); extern void fli_tbox_insert_lines( FL_OBJECT *, int, const char * ); extern void fli_tbox_insert_line( FL_OBJECT *, int, const char * ); extern void fli_tbox_add_line( FL_OBJECT *, const char *, int ); extern void fli_tbox_add_chars( FL_OBJECT *, const char * ); extern const char * fli_tbox_get_line( FL_OBJECT *, int ); extern void fli_tbox_replace_line( FL_OBJECT *, int, const char * ); extern void fli_tbox_clear( FL_OBJECT * ); extern int fli_tbox_load( FL_OBJECT *, const char * ); extern void fli_tbox_recalc_area( FL_OBJECT * ); extern void fli_tbox_set_fontsize( FL_OBJECT *, int ); extern void fli_tbox_set_fontstyle( FL_OBJECT *, int ); extern int fli_tbox_set_xoffset( FL_OBJECT *, int ); extern double fli_tbox_set_rel_xoffset( FL_OBJECT *, double ); extern int fli_tbox_set_yoffset( FL_OBJECT *, int ); extern double fli_tbox_set_rel_yoffset( FL_OBJECT *, double ); extern int fli_tbox_get_xoffset( FL_OBJECT * ); extern double fli_tbox_get_rel_xoffset( FL_OBJECT * ); extern int fli_tbox_get_yoffset( FL_OBJECT * ); extern double fli_tbox_get_rel_yoffset( FL_OBJECT * ); extern void fli_tbox_set_topline( FL_OBJECT *, int ); extern void fli_tbox_set_bottomline( FL_OBJECT *, int ); extern void fli_tbox_set_centerline( FL_OBJECT *, int ); extern void fli_tbox_deselect( FL_OBJECT * obj ); extern void fli_tbox_deselect_line( FL_OBJECT *, int ); extern void fli_tbox_select_line( FL_OBJECT *, int ); extern int fli_tbox_is_line_selected( FL_OBJECT *, int ); extern int fli_tbox_get_selection( FL_OBJECT *obj ); extern void fli_tbox_make_line_selectable( FL_OBJECT *, int, int ); extern void fli_tbox_set_dblclick_callback( FL_OBJECT *, FL_CALLBACKPTR, long ); extern int fli_tbox_get_num_lines( FL_OBJECT * ); extern int fli_tbox_get_topline( FL_OBJECT * obj ); extern int fli_tbox_get_bottomline( FL_OBJECT * ); extern void fli_tbox_react_to_vert( FL_OBJECT *, int ); extern void fli_tbox_react_to_hori( FL_OBJECT *, int ); extern int fli_tbox_get_line_yoffset( FL_OBJECT *, int ); #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/private/flsnprintf.h0000644000175000017500000000323512253115420014531 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XForms. If not, see . */ /** * \file flsnprintf.h */ #ifndef FL_SNPRINTF_H #define FL_SNPRINTF_H #include #ifdef HAVE_SNPRINTF #ifndef HAVE_DECL_SNPRINTF int snprintf( char *, size_t, const char *, ...); #endif #ifndef HAVE_DECL_VSNPRINTF int vsnprintf( char *, size_t, const char *, va_list); #endif #define fli_snprintf snprintf #define fli_vsnprintf vsnprintf #else int fli_portable_snprintf( char *, size_t, const char *, ... ); int fli_portable_vsnprintf( char *, size_t, const char *, va_list ); #define fli_snprintf fli_portable_snprintf #define fli_vsnprintf fli_portable_vsnprintf #endif /* HAVE_SNPRINTF */ #endif /* NOT FL_SNPRINTF_H */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/private/pformbrowser.h0000664000175000017500000000340312353623325015103 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XForms. If not, see . */ /** * \file pformbrowser.h */ #ifndef PFORMBROWSER_H #define PFORMBROWSER_H typedef struct { FL_OBJECT * canvas; FL_OBJECT * parent; int nforms; FL_FORM ** form; int v_pref; int h_pref; int vw_def, vw; int hh_def, hh; FL_OBJECT * hsl; FL_OBJECT * vsl; int h_on, v_on; double old_vval, old_hval; int x, y; int left_edge; int top_edge; int top_form; int max_height; int max_width; int processing_destroy; int in_draw; int scroll; /* either pixel based or form based */ } FLI_FORMBROWSER_SPEC; #define IsFormBrowserClass( ob ) \ ( ( ob ) && ( ob )->objclass == FL_FORMBROWSER ) #if defined sun && ! defined __SVR4 #define memmove( a, b, c ) bcopy( b, a, c ) #endif #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/private/pspinner.h0000664000175000017500000000242512353623325014215 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XForms. If not, see . */ #ifndef PSPINNER_H #define PSPINNER_H typedef struct { FL_OBJECT * input; FL_OBJECT * up; FL_OBJECT * down; int i_val; int i_min; int i_max; int i_incr; double f_val; double f_min; double f_max; double f_incr; int orient; int prec; int attrib; int old_ival; double old_fval; } FLI_SPINNER_SPEC; #define DEFAULT_SPINNER_PRECISION 6 #endif /* PSPINNER_H */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/private/pcanvas.h0000664000175000017500000000537112353623325014015 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XForms. If not, see . */ /** * \file pcanvas.h * * This file is part of the XForms library package. * Copyright (c) 1995-1997 T.C. Zhao and Mark Overmars * All rights reserved. */ #ifndef PCANVAS_H #define PCANVAS_H /* Canvas specific stuff */ typedef struct { const char * winname; /* name of the window */ Window parent; /* real parent(needed for dblbuffer) */ Window window; /* Canvas window */ Visual * visual; /* canvas visual */ void * context; /* context for glx/mesa */ FL_MODIFY_CANVAS_PROP init; FL_MODIFY_CANVAS_PROP activate; FL_MODIFY_CANVAS_PROP cleanup; Colormap colormap; /* colormap for the canvas */ GC gc; unsigned int mask, user_mask; int depth; int dec_type; /* if and how to decorate canvas */ int x, /* window size */ y, w, h; int yield_to_shortcut; /* other object's shortcut has priority */ XSetWindowAttributes xswa; XSetWindowAttributes user_xswa; FL_OBJECT * last_active; /* last sp->activated object */ /* this is not exactly right. sort of wasteful */ FL_HANDLE_CANVAS canvas_handler[ LASTEvent ]; void * user_data[ LASTEvent ]; int keep_colormap; Window swindow; /* scrolled/subwindow */ int sx, sy, sw, sh; /* scrolled window size */ } FLI_CANVAS_SPEC; #endif /* PCANVAS_H */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/private/pselect.h0000664000175000017500000000212112353623325014007 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XForms. If not, see . */ #ifndef PSELECT_H_ #define PSELECT_H_ typedef struct { FL_POPUP * popup; FL_POPUP_RETURN * sel; int align; int style; int size; FL_COLOR color; int timeout_id; long repeat_ms; } FLI_SELECT_SPEC; #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/private/ptwheel.h0000664000175000017500000000213712353623325014027 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XForms. If not, see . */ /** * \file ptwheel.h * * This file is part of the XForms library package. * Copyright (c) 1995-1997 T.C. Zhao and Mark Overmars * All rights reserved. * * private header for slider object */ #ifndef PTWHEEL_H #define PTWHEEL_H #include "pvaluator.h" typedef FLI_VALUATOR_SPEC FLI_THUMBWHEEL_SPEC; #endif /* PTWHEEL_H */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/private/pinput.h0000664000175000017500000000625412353623325013702 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XForms. If not, see . */ #ifndef PINPUT_H #define PINPUT_H typedef struct { char * str; /* the input text */ FL_COLOR textcol; /* text color */ FL_COLOR curscol; /* cursor color */ int position; /* cursor position (in chars) */ int beginrange; /* start of the range */ int endrange; /* end of the range */ int size; /* size of the string */ int changed; /* whether the field has changed */ int drawtype; /* if to draw text with background */ int noscroll; /* true if no scrollis allowed */ int maxchars; /* limit for normal_input */ int attrib1; int attrib2; FL_INPUT_VALIDATOR validate; /* scroll stuff. */ FL_OBJECT * dummy; /* only for the size of composite */ FL_OBJECT * hscroll; FL_OBJECT * vscroll; FL_OBJECT * input; int xoffset; int yoffset; int screenlines; int topline; int lines; /* total number of lines in the field */ int xpos, /* current cursor position in char,line */ ypos; int cur_pixels; /* current line length in pixels */ int max_pixels; /* max length of all lines */ int max_pixels_line; int charh; /* character height */ int h, /* text area */ w; double hsize, vsize; double hval, vval; double hinc1, hinc2; double vinc1, vinc2; int h_pref, /* scrollbar preference */ v_pref; int vw, vw_def; int hh, hh_def; int h_on, v_on; int dead_area, attrib; int cursor_visible; int field_char; } FLI_INPUT_SPEC; #endif /* INPUT_H */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/private/ppositioner.h0000664000175000017500000000340012353623325014724 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XForms. If not, see . */ /** * \file ppositioner.h * * This file is part of the XForms library package. * Copyright (c) 1995-1997 T.C. Zhao and Mark Overmars * All rights reserved. * * private header for positioner object */ #ifndef PPOSITION_H #define PPOSITION_H typedef struct { double xmin, /* minimal values */ ymin; double xmax, /* maximal values */ ymax; double xval, /* current values */ yval; double lxval, /* previous values */ lyval; double xstep, /* step size to which values are rounded */ ystep; int partial; double old_x, /* values at start of ineraction */ old_y; int react_to[ 5 ]; int mousebut; Pixmap xpm, ypm; GC copy_gc; FL_POSITIONER_VALIDATOR validator; /* funcion for validating a new position */ } FLI_POSITIONER_SPEC; #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/private/pflps.h0000664000175000017500000002232312353623325013502 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XForms. If not, see . */ /** * \file pflps.h * * private headers of postscript support. Must come * after forms.h */ #ifndef PFLPS_H #define PFLPS_H #include "include/forms.h" /* configuration infomation. contains all information needed for * both regular gui postscript and image_postscript members */ typedef struct { /* The first entries must be identical to the ones of a FLPS_CONTROL structure defined in flps.h */ int ps_color; int orientation; int auto_fit; int drawbox; int eps; float xdpi, ydpi; float paper_w, paper_h; float gamma; const char * tmpdir; int printer_dpi; float hm, vm; float xscale, yscale; int scale_text; int first_page_only; int clip; /* Now follow elements not from the FLPS_CONTROL structure */ FILE * fp; int lastc, literal, len; int pack; int verbose; /* cache */ int cur_lw, /* line width */ last_lw; int cur_style, /* font style and size */ cur_size; FL_COLOR cur_color; /* color cache */ int landscape; float final_xscale, final_yscale; /* private fields for regular flps */ int unit; /* unit of measure */ int pages; /* how many pages */ int page; /* current page */ int epsf_import; /* true if importing EPS */ int inverted; /* take care of coord switch */ int user_bw; /* bw specified on cmdline */ int bw; /* current border width */ const char * poly_name; /* PS poly name */ /* private field for image postscript */ char * prefix; /* output file prefix */ int misct, /* misc. margins */ miscl, miscb, miscr; int lastr, lastg, lastb; int comment; int isRGBColor; int rotation; float s2px; /* screen to paper scaling */ float s2py; /* screen to paper scaling */ } FLPSInfo; extern FLPSInfo *flps; extern void flps_color( FL_COLOR ); extern void flps_rgbcolor( int, int, int ); extern int flps_get_gray255( FL_COLOR ); extern void flps_emit_prolog( void ); extern void flps_emit_header( const char *, int, int, int, int, int ); extern void flps_switch_flps( FLPSInfo * ); extern void flps_restore_flps( void ); /* basic drawing of simple geomtric figures */ extern void flps_draw_init( void ); extern void flps_rectangle( int, int, int, int, int, FL_COLOR ); extern void flps_roundrectangle( int, int, int, int, int, FL_COLOR ); extern void flps_lines( FL_POINT *, int, FL_COLOR ); extern void flps_line( int, int, int, int, FL_COLOR ); extern void flps_poly( int, FL_POINT *, int, FL_COLOR ); extern int flps_draw_symbol( const char *, int, int, int, int, FL_COLOR ); extern void flps_oval( int, int, int, int, int, FL_COLOR ); extern void flps_pieslice( int, int, int, int, int, int, int, FL_COLOR ); extern void flps_circ( int, int, int, int, FL_COLOR ); extern void flps_arc( int, int, int, int, int, int, FL_COLOR ); #define flps_rectf( x, y, w, h, c ) flps_rectangle( 1, x, y, w, h, c ) #define flps_rect( x, y, w, h, c ) flps_rectangle( 0, x, y, w, h, c ) extern void flps_draw_box( int, int, int, int, int, FL_COLOR, int ); extern void flps_draw_tbox( int, int, int, int, int, FL_COLOR, int ); extern void flps_draw_frame( int, int, int, int, int, FL_COLOR, int ); extern void flps_draw_checkbox( int, int, int, int, int, FL_COLOR, int ); /* basic text drawing routines */ extern void flps_draw_text( int, int, int, int, int, FL_COLOR, int, int, const char * ); extern void flps_draw_text_beside( int, int, int, int, int, FL_COLOR, int, int, const char * ); extern void flps_text_init( void ); extern int find_type_val( int, const char * ); extern void flps_reset_cache( void ); extern void flps_invalidate_color_cache( void ); extern void flps_invalidate_font_cache( void ); extern void flps_invalidate_linewidth_cache( void ); extern void flps_invalidate_symbol_cache( void ); extern void flps_linewidth( int ); extern int flps_get_linewidth( void ); extern void flps_reset_linewidth( void ); extern void flps_linestyle( int ); extern int flps_get_linestyle( void ); extern void flps_log( const char * ); extern void flps_output( const char *, ... ); extern void flps_set_font( int, int ); extern int get_gray255( FL_COLOR ); extern void get_scale_unit( int, float *, float * ); extern void ps_invalidate_font_cache(void); extern char *ps_literal( const char * ); extern void flps_set_clipping( int, int, int, int); extern void flps_unset_clipping( void ); extern void flps_apply_gamma( float ); extern FL_COLOR flps_get_namedcolor( const char * ); #define PS_SPECIAL( c ) ( ( c ) == '(' \ || ( c ) == ')' \ || ( c ) == '[' \ || ( c ) == ']' \ || ( c ) == '<' \ || ( c ) == '>' \ || ( c ) == '%' \ || ( c ) == '#' \ || ( c ) == '/' ) #endif /* ifndef PFLPS_H */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/private/pchoice.h0000664000175000017500000000343512353623325013773 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XForms. If not, see . */ /** * \file pchoice.h * * This file is part of the XForms library package. * Copyright T.C. Zhao and Mark Overmars * All rights reserved. */ #ifndef PCHOICE_H_ #define PCHOICE_H_ /* make sure that the first 5 items are the same as FL_MENU. * fdesign assumes this */ #define CMAXITEMS ( FL_CHOICE_MAXITEMS + 1 ) /* index 0 unused */ typedef struct { int numitems; /* number of items in choice */ int val; /* last menu item selected */ char * items[ CMAXITEMS ]; /* choice items */ char * shortcut[ CMAXITEMS ]; unsigned char mode[ CMAXITEMS ]; int align; /* the choice text is aligned */ int fontsize; /* font size */ int fontstyle; /* font style */ int pushed; int below; unsigned char modechange[ CMAXITEMS ]; int counter; unsigned int no_title; } FLI_CHOICE_SPEC; #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/private/pxyplot.h0000664000175000017500000001542712353623325014104 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XForms. If not, see . */ /** * \file pxyplot.h * * This file is part of the XForms library package. * Copyright (c) 1995-1997 T.C. Zhao and Mark Overmars * All rights reserved. * * private header for xyplot object */ #ifndef PXYPLOT_H #define PXYPLOT_H #define MAX_MAJOR 50 #define MAX_MINOR 20 #define MAX_TIC 200 typedef struct { float xmin, /* true xbounds */ xmax; float ymin, /* true ybounds */ ymax; float xscmin, /* bounds used in mapping */ xscmax; float yscmin, /* bounds used in mapping */ yscmax; float ax, /* data -> screen conversion */ bx, ay, by; float xtic, /* tic marks */ ytic; float xbase, /* log base */ ybase; float lxbase, /* log10 of the log base */ lybase; int xi, /* ploted area bounds */ xf, yi, yf; char * title; /* overall title */ char * xlabel, * ylabel; /* the x- and y-axis labels */ char * axtic[ MAX_MAJOR + 1 ]; /* alphanumerical tic marks */ char * aytic[ MAX_MAJOR + 1 ]; /* alphanumerical tic marks */ char * xmargin1, * xmargin2; char * ymargin1, * ymargin2; /* fixed area. margins */ char ** text; /* inset text *text[over] */ float * xt, * yt; /* inset text position xt[over] */ float ** x, ** y; /* real data *x, *y[over+1] */ float * grid; /* interpolating grid[over+1] */ float log_minor_xtics, /* use logarithmix minor tics? */ log_minor_ytics; float * wx, /* working array for interpol. */ * wy; FL_POINT * xp; /* screen data */ FL_POINT * xpactive; /* active(mouse) screen data */ FL_POINT * xpi; /* screen data for interpolated */ short * thickness; /* line thickness [over+1] */ FL_COLOR * col; /* overlay color [over+1] */ FL_COLOR * tcol; /* overlay text color [over+1] */ int * type; /* type[over+1] */ int * n, /* total points/viewable points */ nxp; int n1; int ninterpol; int nxpi; int cur_nxp; /* length of xp */ int inside; int grid_linestyle; FL_XYPLOT_SYMBOL * symbol; /* [over + 1] */ short * interpolate; /* if interpolate[over+1] */ short * talign; /* inset text alignment [over+1] */ short xscale; /* linear or log for x */ short yscale; /* linear or log for y */ short active; /* if accepting mouse events */ short ssize; /* symbol size */ short lsize, /* font and style for labels */ lstyle; short xautoscale; /* autoscale to fit */ short yautoscale; /* autoscale to fit */ short xmajor, xminor; /* x-axis scaling */ short ymajor, yminor; /* y-axis scaling */ short inspect; short update; short maxoverlay; short xgrid, ygrid; /* if draw grid */ short iactive; /* which overlay is active */ int objx, /* singlebuffer mode */ objy; float bxm, /* data -> screen conversion */ bym; float key_x, /* key place location */ key_y; int key_lstyle, key_lsize; int key_align; int no_keybox; char ** key; short maxytic; /* max tic mark length in pixels */ int key_maxw, key_maxh, key_ascend, key_descend; int key_xs, key_ys; /* tic locations */ int num_xminor; int num_xmajor; int num_yminor; int num_ymajor; float xmajor_val[ MAX_MAJOR ]; float ymajor_val[ MAX_MAJOR ]; short xtic_minor[ MAX_TIC ]; short xtic_major[ MAX_MAJOR ]; short ytic_minor[ MAX_TIC ]; short ytic_major[ MAX_MAJOR ]; short mark_active; short external_data; int start_x; int start_y; int react_to[ 3 ]; } FLI_XYPLOT_SPEC; #endif /* PXYPLOT.H */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/private/flvasprintf.h0000664000175000017500000002320612337325620014714 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifndef FLVASPRINTF_H #define FLVASPRINTF_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "flsnprintf.h" #if defined ( HAVE_VASPRINTF ) && ! defined ( HAVE_DECL_VASPRINTF ) int vasprintf( char ** strp, const char * fmt, va_list ap ); #endif /* Macro for allocating a buffer and filling it with a string * constructed from a format string and an unspecified number * of arguments. It expects a char pointer first (which will * be set to the address of the memory allocated for the resulting * string) and a (const) char pointer with a printf-like format * string (if the pointer to the format string is NULL memory is * obtained for the empty string). Of course, the function from * which the macro is invoked from must be a variadic function, * called with the appropriate number of types of arguments for * the format string. * * On success the first argument will be set to a buffer long * enough and containing the intended string. If there wasn't * enough memory available an attempted is make to at least * allocate memory for the empty string. If even this fails * the first macro argument is set to NULL. * * Of course it's the responsibility of whatever invoked * this macro to release the memory allocated here at the * appropriate time. * * The best function to use here would be vasprintf(), which * exactly does what we need. Older systems may not have it - * in this case 'HAVE_VASPRINTF isn't defined. Unfortunately, * we can't use the implementation from the flsnprintf.c file * since it doesn't get compiled in the way this file is made * up (and for good reasonsm the way the necessary va_copy() * function gets defined is broken in more than one way). But * we can use fli_vsnprintf() from that file, though with some * difficulties. * * For such systems we need a way to not "use up" the va_list * by initializing it and then passing it to some function * (that's actually the rationale for using a macro here * instead of a function!), so we must do the memory allo- * cation here (if necessary repeatedly) and only call * fli_vsnprintf(). * * So the whole existence of this macro is due to backward * compatibility with old (pre C99) compilers that may have * a uncommon way of defining a va_list. Messy, isnt' it? * * BTW, all locally used variables have names starting with 'l1I_' * since this is a prefix no sane person would ever use - we try to * avoid compiler warnings about local variables shadowing already * defined ones. */ #if defined ( HAVE_VASPRINTF ) #define EXPAND_FORMAT_STRING( buf, fmt ) \ do { \ if ( ! fmt || ! *fmt ) \ buf = NULL; \ else if ( ! strchr( fmt, '%' ) ) \ { \ if ( ( buf = fl_malloc( strlen( fmt ) + 1 ) ) ) \ strcpy( buf, fmt ); \ } \ else \ { \ va_list l1I_ap; \ \ va_start( l1I_ap, fmt ); \ if ( ! vasprintf( &buf, fmt, l1I_ap ) ) \ buf = NULL; \ va_end( l1I_ap ); \ } \ \ if ( ! buf && ( buf = fl_malloc( 1 ) ) ) \ *buf = '\0'; \ } while ( 0 ) #else #define EXPAND_FORMAT_STRING( buf, fmt ) \ do { \ if ( ! fmt || ! *fmt ) \ buf = NULL; \ else if ( ! strchr( fmt, '%' ) ) \ { \ if ( ( buf = fl_malloc( strlen( fmt ) + 1 ) ) ) \ strcpy( buf, fmt ); \ } \ else \ { \ int l1I_min_needed = strlen( fmt ) + 1; \ int l1I_len = l1I_min_needed; \ char *l1I_p; \ \ for ( l1I_p = strchr( fmt, '%' ); l1I_p; \ l1I_p = strchr( ++l1I_p, '%' ) ) \ l1I_len += 16; \ \ if ( ( buf = fl_malloc( l1I_len ) ) ) \ { \ while ( 1 ) \ { \ va_list l1I_ap; \ int l1I_written; \ \ va_start( l1I_ap, fmt ); \ l1I_written = fli_vsnprintf( buf, l1I_len, fmt, l1I_ap ); \ va_end( l1I_ap ); \ \ /* Take care: older libc versions returned a negative \ value if the buffer wasn't large enough space while \ newer ones follow C99 and return the length of the \ string needed (without the trailing '\0') */ \ \ if ( l1I_written > -1 && l1I_len > l1I_written ) \ { \ if ( l1I_len != l1I_written + 1 ) \ { \ l1I_p = buf; \ if ( ! ( buf = fl_realloc( l1I_p, \ l1I_written + 1 ) ) ) \ buf = l1I_p; \ } \ break; \ } \ \ l1I_len = l1I_written < 0 ? \ ( 2 * l1I_len ) : ( l1I_written + 16 ); \ l1I_p = buf; \ if ( ! ( buf = fl_realloc( l1I_p, l1I_len ) ) ) \ { \ fl_free( l1I_p ); \ break; \ } \ } \ } \ } \ \ if ( ! buf && ( buf = fl_malloc( 1 ) ) ) \ *buf = '\0'; \ } while ( 0 ) #endif #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/private/Makefile.am0000664000175000017500000000052412353623325014240 00000000000000include $(top_srcdir)/config/common.am EXTRA_DIST = \ flsnprintf.h \ flvasprintf.h \ pbrowser.h \ pcanvas.h \ pchoice.h \ pcounter.h \ pdial.h \ pflps.h \ pformbrowser.h \ pinput.h \ pmenu.h \ pnmenu.h \ ppositioner.h \ pscrollbar.h \ pselect.h \ pslider.h \ pspinner.h \ ptbox.h \ ptwheel.h \ pvaluator.h \ pxyplot.h xforms-1.2.4/lib/interpol.c0000644000175000017500000000562412251554145012536 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file interpol.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao * All rights reserved. * * interpol1 interpolates a one-dimensional non-uniform * tabulated data onto a working grid, grid, using * nth order Lagrangian polynomial */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" #include "flinternal.h" /*************************************** ***************************************/ int fl_interpolate( const float * wx, const float * wy, int nin, float * x, float * y, double grid, int ndeg ) { int i, j, k, l, jo, ih, im, idm, nout; double term, accum; if ( nin <= ndeg ) { M_warn( "fl_interpolate", "too few points in interpol\n" ); return -1; } nout = ( wx[ nin - 1 ] - wx[ 0 ] ) / grid + 1.01; x[ 0 ] = wx[ 0 ]; y[ 0 ] = wy[ 0 ]; /* Start the main loop */ jo = 0; for ( i = 1; i < nout; i++ ) { /* Better than x[i] = x[i-1] + grid; */ x[ i ] = x[ 0 ] + i * grid; /* Center */ j = jo; ih = nin; while ( ih - j > 1 ) { im = ( ih + j ) / 2; if ( x[ i ] > wx[ im ] ) j = im; else ih = im; } jo = j; j = j - ndeg / 2; if ( j < 0 ) j = 0; if ( j > nin - ndeg - 1 ) j = nin - ndeg - 1; /* Interpolate */ accum = 0.0; idm = j + ndeg; for ( l = j; l <= idm; l++ ) { term = wy[ l ]; for ( k = j; k <= idm; k++ ) { if ( l != k ) term *= ( double ) ( x[ i ] - wx[ k ] ) / ( wx[ l ] - wx[ k ] ); } accum += term; } y[ i ] = accum; } /* Make sure the ends are free of numerical errors */ x[ nout - 1 ] = wx[ nin - 1 ]; y[ nout - 1 ] = wy[ nin - 1 ]; return nout; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/clipboard.c0000644000175000017500000002330312251554313012630 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file clipboard.c * * This file is part of the XForms library package. * Copyright (c) 1997-2002 T.C. Zhao * All rights reserved. * * Implementation of clipboard. Event handling violates the ICCCM, * but should work ok. Need server time from the mainloop. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" typedef struct { FL_OBJECT * ob; /* the object that stuff'ed cp */ FL_OBJECT * req_ob; /* the object that requested cp */ Window window; Window req_window; long type, size; FL_LOSE_SELECTION_CB lose_callback; FL_SELECTION_CB got_it_callback; } ClipBoard; static ClipBoard clipboard; int ( * fli_handle_clipboard )( void * ) = NULL; /* also needed in handling.c */ static int handle_clipboard_event( void * ); /*************************************** ***************************************/ int fl_stuff_clipboard( FL_OBJECT * ob, long type FL_UNUSED_ARG, const void * data, long size, FL_LOSE_SELECTION_CB lose_callback ) { Window win = FL_ObjWin( ob ); ClipBoard *cp = &clipboard; fli_handle_clipboard = handle_clipboard_event; if ( ! win ) { M_err( "fl_stuff_clipboard", "Bad object %s", ob ? ob->label : "null" ); return 0; } XSetSelectionOwner( flx->display, XA_PRIMARY, win, CurrentTime ); /* Make sure we got it */ if ( XGetSelectionOwner( flx->display, XA_PRIMARY ) != win ) { M_err( "fl_stuff_clipboard", "Failed to get owner" ); return 0; } /* Create structure that holds clipboard info */ cp->window = win; cp->ob = ob; cp->size = size; cp->lose_callback = lose_callback ? lose_callback : NULL; /* Cheap (and fast!) shot */ XStoreBuffer( flx->display, data, size, 0 ); return size; } static Atom clipboard_prop; static Atom targets_prop; /*************************************** ***************************************/ int fl_request_clipboard( FL_OBJECT * ob, long type FL_UNUSED_ARG, FL_SELECTION_CB got_it_callback ) { Window win; ClipBoard *cp = &clipboard; void *buf; int nb = 0; cp->req_ob = ob; if ( got_it_callback == NULL ) { M_warn( "fl_request_clipboard", "Callback is NULL" ); return -1; } if ( ! clipboard_prop ) { clipboard_prop = XInternAtom( flx->display, "FL_CLIPBOARD", False ); fli_handle_clipboard = handle_clipboard_event; } cp->got_it_callback = got_it_callback; cp->req_window = FL_ObjWin( ob ); win = XGetSelectionOwner( flx->display, XA_PRIMARY ); if ( win == None ) { XSetSelectionOwner( flx->display, XA_PRIMARY, cp->req_window, CurrentTime ); buf = XFetchBuffer( flx->display, &nb, 0 ); cp->window = XGetSelectionOwner( flx->display, XA_PRIMARY ); cp->ob = NULL; cp->size = nb; cp->got_it_callback( cp->req_ob, XA_STRING, buf, nb ); XFree( buf ); } else if ( win != cp->req_window ) { /* We don't own it, request it */ M_warn( "fl_request_clipboard", "Requesting selection from %ld", win ); XConvertSelection( flx->display, XA_PRIMARY, XA_STRING, clipboard_prop, cp->req_window, CurrentTime ); nb = -1; } else if ( win == cp->req_window ) { /* We own the buffer */ buf = XFetchBuffer( flx->display, &nb, 0 ); cp->got_it_callback( cp->req_ob, XA_STRING, buf, nb ); XFree( buf ); } return nb; } /*************************************** * Returns a negative number if not known how to handle an event ***************************************/ static int handle_clipboard_event( void * event ) { XSelectionRequestEvent *sreq = event; XEvent *xev = event; XSelectionEvent sev; ClipBoard *cp = &clipboard; char *s; int n; /* SelectionClear confirms loss of selection SelectionRequest indicates that another app wants to own selection SelectionNotify confirms that request of selection is ok */ if ( ! targets_prop ) targets_prop = XInternAtom( flx->display, "TARGETS", False ); if ( ! clipboard_prop ) clipboard_prop = XInternAtom( flx->display, "FL_CLIPBOARD", False ); if ( ! cp->req_window && ! cp->window ) { M_warn( "handle_clipboard_event", "InternalError" ); return -1; } if ( xev->type == SelectionClear ) { if ( cp->ob && cp->lose_callback ) cp->lose_callback( cp->ob, cp->type ); cp->ob = NULL; cp->window = None; } else if ( xev->type == SelectionNotify && cp->req_ob ) { /* Our request went through, go and get it */ Atom ret_type; int ret_format; unsigned long ret_len = 0, ret_after; unsigned char *ret = NULL; /* X guarantees 16K request size */ long chunksize = fli_context->max_request_size, offset = 0; char *buf = NULL; int buflen = 0; /* Get the stuff. Repeat until we get all */ do { XGetWindowProperty( flx->display, xev->xselection.requestor, xev->xselection.property, offset, chunksize, False, xev->xselection.target, &ret_type, &ret_format, &ret_len, &ret_after, &ret ); if ( ret_len && ret ) { if ( ret_after == 0 && ! buf ) cp->got_it_callback( cp->req_ob, ret_type, ret, ret_len ); else { buf = fl_realloc( buf, buflen + ret_len ); memcpy( buf + buflen, ret, ret_len ); buflen += ret_len; } XFree( ret ); ret = NULL; } offset += ret_len * ret_format / 32; chunksize = ( ret_after + 3 ) / 4; if ( chunksize > fli_context->max_request_size ) chunksize = fli_context->max_request_size; } while ( ret_after ); if ( buflen ) { cp->got_it_callback( cp->req_ob, ret_type, buf, buflen ); fl_free( buf ); } XDeleteProperty( flx->display, xev->xselection.requestor, xev->xselection.property ); } else if ( xev->type == SelectionRequest ) { /* Someone wants our selection */ M_warn( "handle_clipboard_event", "SelectionRequest" ); if ( sreq->owner != cp->window ) { M_err( "handle_clipboard_event", "Wrong owner" ); return -1; } /* Set up the event to be sent to the requestor */ sev.type = SelectionNotify; sev.display = sreq->display; sev.requestor = sreq->requestor; sev.selection = sreq->selection; sev.target = sreq->target; sev.property = None; sev.time = sreq->time; if ( sreq->selection == XA_PRIMARY ) { if ( sreq->target == XA_STRING ) { s = XFetchBuffer( flx->display, &n, 0 ); XChangeProperty( flx->display, sreq->requestor, sreq->property, sreq->target, 8, PropModeReplace, (unsigned char *) s, n ); sev.property = sreq->property; XFree( s ); } else if ( sreq->target == targets_prop ) /* aixterm wants this */ { Atom alist = XA_STRING; XChangeProperty( flx->display, sreq->requestor, sreq->property, XA_ATOM, 32, PropModeReplace, ( unsigned char * ) &alist, 1 ); sev.property = sreq->property; } else { /* If we have other types conversion routine should be called here */ M_warn( "handle_clipboard_event", "Received request with " "unknown/not implemented XAtom target type: %d\n", ( int ) sreq->target ); } XSendEvent( flx->display, sreq->requestor, False, 0, ( XEvent * ) & sev ); } else { /* not XA_PRIMARY request */ M_warn( "handle_clipboard_event", "Unknown selection request: %d", sreq->selection ); return -1; } } return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/flinternal.h0000664000175000017500000007611012353623325013045 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file flinternal.h * * This file is part of the XForms library package. * Copyright (c) 1996-1998 T.C. Zhao and Mark Overmars * All rights reserved. * * Internal routines used by the Forms Library. An application should * not use any of this since there is no guarantee that exactly some * thing will exist in future versions of XForms. */ #ifndef FLINTERNAL_H #define FLINTERNAL_H #include #include #include "local.h" #include "ulib.h" /* macros and constants */ /* FL_DEBUG controls some conditional compilations. Even if the code * is compiled in, it still needs -debug level on the command line * to activate the message output. FL_DEBUG less than ML_ERR probably * is not a good idea. Only when making real production executables * should FL_DEBUG be less than ML_ERR (say ML_ERR-1) * * ML_ERR -- print some error messages * ML_WARN -- print some error messages * ML_INFO1 -- some messages * ML_INFO2 -- more messages * ML_DEBUG -- debugging code compiled in * ML_TRACE -- can be unbearable */ #ifndef FL_DEBUG #define FL_DEBUG ML_WARN #endif /* Mask for all possible events */ #define AllEventsMask ( ( OwnerGrabButtonMask << 1 ) - 1 ) /* There are two ways to handle interaction. One is to process object * Q only if there are no more event pending. This can result in * an event entered into object Q more than once if the connection * is slow and clicking is rapid. If subsequently the object is * hidden or deleted/freed, problem occurs as the callback will * still be processed. To fix this, need to flush the object Q * when hiding/deleting objects. Also if an object is entered * multiple times, and its status changed each time, when the * Q is handled, we get wrong status. * * The other way to handle the interaction is to process object * Q as soon as the status of the object is changed. This is * the correct behavior. However, a change in status is typically * preceeded by a redraw (say mouse release on button), and due to * the X buffering mechnism, the redraw probably not get shown yet * when the callback is evoked. To fix this, an explicit flush * is needed. This can be time consuming. Also objects that do * not have callbacks may be handled out of order (after the one's * having callbacks). */ #if 1 #define DELAYED_ACTION #endif /* If we want to have gamma correction as a built-in feature. * Probably useless */ #define DO_GAMMA_CORRECTION /* XForms internal colormap */ typedef struct { const char * name; FL_COLOR index; unsigned short r; unsigned short g; unsigned short b; unsigned short a; int grayval; } FLI_IMAP; #define BadPixel FL_NoColor #define Clamp( v, vmin, vmax ) ( ( v ) < ( vmin ) ? \ ( vmin ) : ( ( v ) > ( vmax ) ? \ ( vmax ) :( v ) ) ) #define IsValidClass( o, c ) ( ( o ) && ( o )->objclass == ( c ) ) #define fli_safe_free( p ) \ do { if ( p ) { \ fl_free( p ); \ p = NULL; \ } \ } while( 0 ) #define fli_class( i ) fl_state[ i ].vclass #define fli_depth( i ) fl_state[ i ].depth #define fli_visual( i ) fl_state[ i ].xvinfo->visual #define fli_colormap( i ) fl_state[ i ].colormap #define fli_map( i ) fl_state[ i ].colormap #define fli_dithered( i ) fl_state[ i ].dithered enum { FLI_FIND_INPUT, FLI_FIND_AUTOMATIC, FLI_FIND_MOUSE, FLI_FIND_CANVAS, FLI_FIND_KEYSPECIAL, FLI_FIND_RETURN }; /* events.c or event related */ void fli_obj_queue_delete( void ); void fli_event_queue_delete( void ); void fli_object_qenter( FL_OBJECT *, int ); void fli_filter_returns( FL_OBJECT * ); FL_OBJECT * fli_object_qread( void ); void fli_object_qflush( FL_FORM * ); void fli_object_qflush_object( FL_OBJECT * ); FL_OBJECT *fli_object_qtest( void ); void fli_treat_user_events( void ); void fli_treat_interaction_events( int ); void fli_compress_event( XEvent *, unsigned long ); const char *fli_event_name( int ); XEvent * fli_xevent_name( const char *, const XEvent * ); void fli_handle_idling( XEvent * xev, long msec, int do_idle_cb ); /* Variables defined in handling.c */ extern FL_FORM * mouseform; /* the current form under mouse */ extern FL_FORM * keyform; /* keyboard focus form */ extern FL_OBJECT * fli_pushobj; extern FL_OBJECT * fli_mouseobj; extern FL_Coord fli_mousex, fli_mousey; extern unsigned int fli_keymask; extern unsigned int fli_query_age; /* Misc. utilitnes */ FL_FORM * fli_find_event_form( XEvent * ); void fli_print_version( int ); /* from forms.c and object.c */ void fli_scale_form( FL_FORM *, double, double ); void fli_handle_form( FL_FORM *, int, int, XEvent * ); FL_OBJECT *fli_end_group( void ); void fli_handle_object( FL_OBJECT *, int, FL_Coord, FL_Coord, int, XEvent *, int ); FL_OBJECT * fli_find_first( FL_FORM *, int, FL_Coord, FL_Coord ); void fli_show_object( FL_OBJECT * ); void fli_recalc_intersections( FL_FORM * ); FL_OBJECT * fli_find_last( FL_FORM *, int, FL_Coord, FL_Coord ); FL_OBJECT *fli_find_object( FL_OBJECT *, int, FL_Coord, FL_Coord ); FL_OBJECT *fli_find_object_backwards( FL_OBJECT *, int, FL_Coord, FL_Coord ); void fli_insert_object( FL_OBJECT *, FL_OBJECT * ); void fli_scale_object( FL_OBJECT *, double , double ); void fli_set_object_visibility( FL_OBJECT * obj, int vis ); int fli_mouse_wheel_to_keypress( int * ev, int * key, void * xev ); void fli_notify_object( FL_OBJECT * obj, int reason ); /* double buffering etc. */ void fli_free_flpixmap( FL_pixmap * ); void fli_create_object_pixmap( FL_OBJECT * ); void fli_show_object_pixmap( FL_OBJECT * ); void fli_create_form_pixmap( FL_FORM * ); void fli_show_form_pixmap( FL_FORM * ); /* windowing support */ void fli_default_xswa( void ); Window fli_cmap_winopen( Window, Colormap, const char * ); Window fli_create_window( Window, Colormap, const char * ); void fli_create_gc( Window ); enum { FLI_COMMAND_PROP = 1, FLI_PROP_SET = ( 1 << 10 ) /* really set */ }; void fli_set_winproperty( Window, unsigned int ); /* graphics related */ void fli_init_colormap( int ); void fli_free_colormap( int ); void fli_dump_state_info( int, const char * ); void fli_init_stipples( void ); void fli_draw_button( FL_OBJECT * ); /* for fdesign */ const char * fli_query_colorname( FL_COLOR ); long fli_query_namedcolor( const char *s ); void fli_free_xtext_workmem( void ); int fli_get_pos_in_string( int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, int, int, FL_Coord, FL_Coord, const char *, int *, int *, int * ); int fli_draw_stringTAB( Window, GC, int, int, int, int, const char *, int, int ); int fli_draw_string( int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, int, FL_COLOR, FL_COLOR, FL_COLOR, int, int, int, int, int, const char *, int, int, int, FL_COLOR ); int fli_get_max_pixels_line( void ); int fli_get_string_widthTABfs( XFontStruct *, const char *, int ); void fli_init_font( void ); void fli_canonicalize_rect( FL_Coord *, FL_Coord *, FL_Coord *, FL_Coord * ); void fli_get_goodie_title( FL_FORM *, const char * ); void fli_add_q_icon( FL_Coord, FL_Coord, FL_Coord, FL_Coord ); void fli_add_warn_icon( FL_Coord, FL_Coord, FL_Coord, FL_Coord ); void fli_check_key_focus( const char *, Window ); void fli_free_cmdline_args( void ); FL_RECT * fli_get_underline_rect( XFontStruct *, FL_Coord, FL_Coord, const char *, int ); /* Group some WM stuff into a structure for easy maintainance */ typedef struct { unsigned int pos_request; /* USPOSITION or PPOSITION */ } FLI_WM_STUFF; /* Routines in sldraw.c. */ typedef struct { FL_Coord x; FL_Coord y; FL_Coord w; FL_Coord h; } FLI_SCROLLBAR_KNOB; enum { FLI_SLIDER_NONE = 0, FLI_SLIDER_BOX = 1, FLI_SLIDER_KNOB = 2, FLI_SLIDER_ALL = 3 }; void fli_calc_slider_size( FL_OBJECT *, FLI_SCROLLBAR_KNOB * ); void fli_draw_slider( FL_OBJECT *, FL_COLOR, FL_COLOR, const char *, int ); void fli_draw_checkbox( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col, int bw ); void fli_set_global_clipping( FL_Coord, FL_Coord, FL_Coord, FL_Coord ); void fli_unset_global_clipping( void ); void fli_set_additional_clipping( FL_Coord, FL_Coord, FL_Coord, FL_Coord ); FL_RECT * fli_get_global_clip_rect( void ); /* Application windows */ typedef struct fli_win_ { struct fli_win_ * next; Window win; FL_APPEVENT_CB pre_emptive; /* always gets called first if set */ FL_APPEVENT_CB callback[ LASTEvent ]; void * pre_emptive_data; void * user_data[ LASTEvent ]; FL_APPEVENT_CB default_callback; unsigned long mask; } FLI_WIN; extern FLI_WIN * fl_app_win; void fli_set_form_window( FL_FORM * ); void fli_unmap_canvas_window( FL_OBJECT * ); FL_APPEVENT_CB fli_set_preemptive_callback( Window, FL_APPEVENT_CB, void * ); unsigned long fli_xevent_to_mask( int ); int fli_initialize_program_visual( void ); #define FLI_TIMER_RES 50 /* resolution of FL_STEP event */ /* Currently only one idle procedure is permitted, so the next * field is of no much use */ typedef struct fli_idle_cb_ { FL_APPEVENT_CB callback; void * data; } FLI_IDLE_REC; typedef struct fli_io_event_ { struct fli_io_event_ * next; FL_IO_CALLBACK callback; void * data; unsigned int mask; int source; } FLI_IO_REC; /* signals */ #if ! defined HAVE_SIGACTION typedef RETSIGTYPE ( * FLI_OSSIG_HANDLER )( int ); #endif typedef struct fli_signallist_ { struct fli_signallist_ * next; FL_SIGNAL_HANDLER callback; #if defined HAVE_SIGACTION struct sigaction old_sigact; #else FLI_OSSIG_HANDLER ocallback; /* default OS signal handler */ #endif void * data; int signum; int caught; } FLI_SIGNAL_REC; void fli_remove_all_signal_callbacks( void ); /* timeouts */ typedef struct fli_timeout_ { int id; struct fli_timeout_ * next; struct fli_timeout_ * prev; long start_sec, start_usec; long ms_to_wait; FL_TIMEOUT_CALLBACK callback; void * data; } FLI_TIMEOUT_REC; void fli_remove_all_timeouts( void ); /* * Intenal controls. */ typedef struct fli_context_ { FL_FORM_ATCLOSE atclose; /* what to do if WM_DELETE_WINDOW */ void * close_data; FLI_IDLE_REC * idle_rec; /* idle callback record */ FLI_IO_REC * io_rec; /* async IO record */ FLI_SIGNAL_REC * signal_rec; /* list of app signals */ FLI_TIMEOUT_REC * timeout_rec; /* timeout callbacks */ int idle_delta; /* timer resolution */ int last_event; /* last event received */ long mouse_button; /* push/release record */ int pup_id; /* current active pup id */ FL_FORM * modal; /* current modal form */ long max_request_size; /* max protocol size */ int num_io; int hscb, vscb; /* default scrollbar */ long ext_request_size; /* extended request size */ int tooltip_time; #ifdef XlibSpecificationRelease XIM xim; /* input method */ XIC xic; /* input context */ #else void * xim; void * xic; #endif unsigned int navigate_mask; /* input field */ long reserverd[ 6 ]; } FLI_CONTEXT; /* Some X info that helps to make the windowing system independent * API work (fl_color() etc. */ typedef struct { Display * display; Window win; GC gc, textgc; GC miscgc; int isRGBColor; int isMBFont; /* multi-byte font */ unsigned long bktextcolor; int newpix; int fdesc; /* font descent */ int fasc; /* font ascent */ int fheight; /* font height */ Colormap colormap; XFontStruct * fs; unsigned long color; /* last color. cache */ unsigned long textcolor; /* last textcolor. cache */ unsigned long bkcolor; int screen; } FLI_TARGET; typedef struct { FL_FORM ** forms; /* all forms, visible and hidden */ int formnumb; /* number of visible forms */ int hidden_formnumb; /* number of hidden forms */ size_t auto_count; int unmanaged_count; FL_Coord mousex, /* last recorded mouse position */ mousey; unsigned int keymask; /* state of buttons and modifier keys */ unsigned int query_age; /* age of recorded information */ FL_FORM * mouseform; /* the current form under the mouse */ FL_FORM * keyform; /* keyboard focus form */ FL_OBJECT * pushobj; /* latest pushed object */ FL_OBJECT * mouseobj; /* object under the mouse */ } FLI_INTERNAL; extern FLI_INTERNAL fli_int; void fli_init_context( void ); #include "extern.h" void fli_watch_io( FLI_IO_REC *, long ); int fli_do_shortcut( FL_FORM *, int, FL_Coord, FL_Coord, XEvent * ); int fli_test_lalign( int align, const char * txt ); void fli_get_hv_align( int, int *, int * ); void fli_get_outside_align( int, int, int, int, int, int *, int *, int * ); void fli_init_symbols( void ); void fli_release_symbols( void ); int fli_handle_event_callbacks( XEvent * ); /* Some macros to test how an object can be moved or resized, depending on its gravity settings (ULC = uppler left hand cornner, LRC = lower right hand corner) */ #define ULC_POS_LEFT_FIXED( obj ) \ ( ( obj )->nwgravity == FL_NorthWest \ || ( obj )->nwgravity == FL_West \ || ( obj )->nwgravity == FL_SouthWest ) #define ULC_POS_RIGHT_FIXED( obj ) \ ( ( obj )->nwgravity == FL_NorthEast \ || ( obj )->nwgravity == FL_East \ || ( obj )->nwgravity == FL_SouthEast ) #define LRC_POS_LEFT_FIXED( obj ) \ ( ( obj )->segravity == FL_NorthWest \ || ( obj )->segravity == FL_West \ || ( obj )->segravity == FL_SouthWest ) #define LRC_POS_RIGHT_FIXED( obj ) \ ( ( obj )->segravity == FL_NorthEast \ || ( obj )->segravity == FL_East \ || ( obj )->segravity == FL_SouthEast ) #define HAS_FIXED_HORI_ULC_POS( obj ) \ ( ULC_POS_LEFT_FIXED( obj ) || ULC_POS_RIGHT_FIXED( obj ) ) #define HAS_FIXED_HORI_LRC_POS( obj ) \ ( LRC_POS_LEFT_FIXED( obj ) || LRC_POS_RIGHT_FIXED( obj ) ) #define HAS_FIXED_WIDTH( obj ) \ ( HAS_FIXED_HORI_ULC_POS( obj ) && HAS_FIXED_HORI_LRC_POS( obj ) ) #define ULC_POS_TOP_FIXED( obj ) \ ( ( obj )->nwgravity == FL_NorthWest \ || ( obj )->nwgravity == FL_North \ || ( obj )->nwgravity == FL_NorthEast ) #define ULC_POS_BOTTOM_FIXED( obj ) \ ( ( obj )->nwgravity == FL_SouthWest \ || ( obj )->nwgravity == FL_South \ || ( obj )->nwgravity == FL_SouthEast ) #define LRC_POS_TOP_FIXED( obj ) \ ( ( obj )->segravity == FL_NorthWest \ || ( obj )->segravity == FL_North \ || ( obj )->segravity == FL_NorthEast ) #define LRC_POS_BOTTOM_FIXED( obj ) \ ( ( obj )->segravity == FL_SouthWest \ || ( obj )->segravity == FL_South \ || ( obj )->segravity == FL_SouthEast ) #define HAS_FIXED_VERT_ULC_POS( obj ) \ ( ULC_POS_TOP_FIXED( obj ) || ULC_POS_BOTTOM_FIXED( obj ) ) #define HAS_FIXED_VERT_LRC_POS( obj ) \ ( LRC_POS_TOP_FIXED( obj ) || LRC_POS_BOTTOM_FIXED( obj ) ) #define HAS_FIXED_HEIGHT( obj ) \ ( HAS_FIXED_VERT_ULC_POS( obj ) && HAS_FIXED_VERT_LRC_POS( obj ) ) #define XK_PageUp XK_Prior #define XK_PageDn XK_Next #define XK_PageUp XK_Prior #define XK_PageDn XK_Next /* some header has XK_XP_Left etc */ #if XlibSpecificationRelease >= 6 #define IsHome( k ) ( k == XK_Home || k == XK_Begin || k == XK_KP_Home ) #define IsLeft( k ) ( k == XK_Left || k == XK_KP_Left ) #define IsRight( k ) ( k == XK_Right || k == XK_KP_Right ) #define IsUp( k ) ( k == XK_Up || k == XK_KP_Up ) #define IsDown( k ) ( k == XK_Down || k == XK_KP_Down ) #define IsEnd( k ) ( k == XK_End || k == XK_KP_End ) #define IsPageDown( k ) ( k == XK_Next || k == XK_Page_Down || k == XK_KP_Page_Down ) #define IsPageUp( k ) ( k == XK_Prior || k == XK_Page_Up || k==XK_KP_Page_Up) #else #define IsHome( k ) ( k == XK_Home || k == XK_Begin ) #define IsLeft( k ) ( k == XK_Left ) #define IsRight( k ) ( k == XK_Right ) #define IsDown( k ) ( k == XK_Down ) #define IsUp( k ) ( k == XK_Up ) #define IsEnd( k ) ( k == XK_End ) #define IsPageDown( k ) ( k == XK_Next ) #define IsPageUp( k ) ( k == XK_Prior ) #endif #define FLI_HALFPAGE_UP 0x10000000 #define FLI_HALFPAGE_DOWN 0x20000000 #define FLI_NLINES_UP 0x30000000 #define FLI_NLINES_DOWN 0x40000000 #define FLI_1LINE_UP 0x50000000 #define FLI_1LINE_DOWN 0x60000000 #define IsHalfPageUp( k ) ( ( k ) == FLI_HALFPAGE_UP ) #define IsHalfPageDown( k ) ( ( k ) == FLI_HALFPAGE_DOWN ) #define IsNLinesUp( k ) ( ( k ) == FLI_NLINES_UP ) #define IsNLinesDown( k ) ( ( k ) == FLI_NLINES_DOWN ) #define Is1LineUp( k ) ( ( k ) == FLI_1LINE_UP ) #define Is1LineDown( k ) ( ( k ) == FLI_1LINE_DOWN ) void fli_hide_and_get_region( FL_OBJECT *, Region * ); int fli_convert_shortcut( const char *, long * ); int fli_get_underline_pos( const char *, const char * ); int fli_get_visible_forms_index( FL_FORM * ); void fli_recount_auto_objects( void ); int fli_get_tabpixels( XFontStruct * ); int fli_get_default_scrollbarsize( FL_OBJECT * ); void fli_set_app_name( const char *, const char * ); void fli_hide_composite( FL_OBJECT *, Region * ); void fli_show_composite( FL_OBJECT * ); void fli_deactivate_composite( FL_OBJECT * ); void fli_activate_composite( FL_OBJECT * ); void fli_delete_composite( FL_OBJECT * ob ); void fli_free_composite( FL_OBJECT * ob ); void fli_set_composite_gravity( FL_OBJECT *, unsigned int, unsigned int ); void fli_set_composite_resize( FL_OBJECT *, unsigned int ); void fli_composite_has_been_resized( FL_OBJECT * ); void fli_parse_goodies_label( FL_OBJECT *, const char * ); int fli_goodies_preemptive( FL_FORM *, void * ); void fli_get_goodies_font( int *, int * ); void fli_handle_goodie_font( FL_OBJECT *, FL_OBJECT * ); void fli_goodies_cleanup( void ); void fli_msg_cleanup( void ); void fli_alert_cleanup( void ); void fli_choice_cleanup( void ); void fli_question_cleanup( void ); void fli_input_cleanup( void ); void fli_sinput_cleanup( void ); void fli_handle_timeouts( long * ); #define FL_IS_NONSQRBOX( t ) ( t == FL_SHADOW_BOX \ || t == FL_NO_BOX \ || t == FL_RFLAT_BOX \ || t == FL_ROUNDED_BOX \ || t == FL_OVAL_BOX \ || t == FL_ROUNDED3D_UPBOX \ || t == FL_ROUNDED3D_DOWNBOX ) enum { FLI_TRIANGLE_UPBOX1, FLI_TRIANGLE_UPBOX2, FLI_TRIANGLE_UPBOX3, FLI_TRIANGLE_UPBOX4, FLI_TRIANGLE_UPBOX6, FLI_TRIANGLE_UPBOX7, FLI_TRIANGLE_UPBOX8, FLI_TRIANGLE_UPBOX9, FLI_TRIANGLE_DOWNBOX1, FLI_TRIANGLE_DOWNBOX2, FLI_TRIANGLE_DOWNBOX3, FLI_TRIANGLE_DOWNBOX4, FLI_TRIANGLE_DOWNBOX6, FLI_TRIANGLE_DOWNBOX7, FLI_TRIANGLE_DOWNBOX8, FLI_TRIANGLE_DOWNBOX9 }; FL_RECT * fli_intersect_rects( const FL_RECT *, const FL_RECT * ); void fli_xyplot_nice_label( float, int, float, char * ); void fli_xyplot_compute_data_bounds( FL_OBJECT *, int *, int *, int ); int fli_xyplot_interpolate( FL_OBJECT *, int, int, int ); void fli_insert_composite_after( FL_OBJECT *, FL_OBJECT * ); void fli_add_composite( FL_OBJECT * ); void fli_insert_composite( FL_OBJECT *, FL_OBJECT * ); int fli_is_watched_io( int ); const char * fli_object_class_name( FL_OBJECT * ); char * fli_read_line( FILE * fp ); char * fli_sstrcpy( char * dest, const char * src, size_t n ); void fli_set_form_icon_data( FL_FORM *, char ** ); char *fli_getcwd( char *, int ); void fli_replacepup_text( int, int, const char * ); int fli_valuator_handle_drag( FL_OBJECT *, double ); int fli_valuator_handle_release( FL_OBJECT *, double ); void *fli_init_valuator( FL_OBJECT * ); double fli_valuator_round_and_clamp( FL_OBJECT *, double ); double fli_clamp( double, double, double ); void fli_inherit_attributes( FL_OBJECT *, FL_OBJECT * ); int fli_boxtype2frametype( int ); void fli_xvisual2flstate( FL_State *, XVisualInfo * ); int fli_find_closest_color( int, int, int, XColor *, int, unsigned long * ); void fli_rgbmask_to_shifts( unsigned long, unsigned int *, unsigned int * ); void fli_show_tooltip( const char *, int, int ); void fli_hide_tooltip( void ); int fli_is_tooltip_form( FL_FORM * ); void fli_do_radio_push( FL_OBJECT *, FL_Coord, FL_Coord, int, void *, int ); long fli_getpid( void ); void fli_xlinestyle( Display *, GC, int ); #define FLI_BROKEN_BOX ( 1 << 10 ) FLI_TARGET * fli_internal_init( void ); void fli_switch_target( FLI_TARGET * ); void fli_restore_target( void ); void fli_draw_text_inside( int align, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char *, int, int, FL_COLOR, FL_COLOR, int ); /* Misc. stuff */ void fli_add_vertex( FL_Coord x, FL_Coord y ); void fli_add_float_vertex( float x, float y ); void fli_reset_vertex( void ); void fli_endpolygon( void ); void fli_endclosedline( void ); void fli_endline( void ); const char * fli_get_xevent_name( const XEvent * ); void fli_set_input_navigate( unsigned int mask ); void fli_adjust_browser_scrollbar( FL_OBJECT * ); FL_POPUP * fli_popup_add( Window, const char *, const char * ); FL_POPUP_ENTRY * fli_popup_add_entries( FL_POPUP *, const char *, va_list, const char *, int ); FL_POPUP_ENTRY * fli_popup_insert_entries( FL_POPUP *, FL_POPUP_ENTRY *, const char *, va_list, const char *, int ); FL_POPUP_ENTRY * fli_popup_insert_items( FL_POPUP *, FL_POPUP_ENTRY *, FL_POPUP_ITEM *, const char * ); void fli_popup_init( void ); void fli_popup_finish( void ); int fli_check_popup_exists( FL_POPUP * ); int fli_check_popup_entry_exists( FL_POPUP_ENTRY * ); FL_POPUP_RETURN * fli_set_popup_return( FL_POPUP_ENTRY * ); void fli_popup_reset_counter( FL_POPUP * ); void fli_free_cursors( void ); void fli_free_fselectors( void ); /* Some utility stuff */ typedef struct { int val; const char * name; } FLI_VN_PAIR; int fli_get_vn_value( FLI_VN_PAIR * vn_pair, const char * name ); const char * fli_get_vn_name( FLI_VN_PAIR * vn_pair, int val ); #if XlibSpecificationRelease == 6 # define IsTab( ksym ) ( ksym == XK_ISO_Left_Tab || ksym== XK_Tab ) #else # define IsTab( ksym ) ( ksym == XK_Tab ) #endif void fli_set_tab_color( FL_OBJECT * obj, FL_COLOR col1, FL_COLOR col2 ); void fli_set_tab_lcolor( FL_OBJECT * obj, FL_COLOR lcol ); void fli_set_tab_lsize( FL_OBJECT * obj, int lsize ); void fli_set_tab_lstyle( FL_OBJECT * obj, int lstyle ); void fli_set_tab_lalign( FL_OBJECT * obj, int align ); void fli_set_tab_bw( FL_OBJECT * obj, int bw ); void fli_textcolor( FL_COLOR col ); void fli_bk_textcolor( FL_COLOR col ); char * fli_fix_dirname( char * dir ); Cursor fli_get_cursor_byname( int name ); void fli_hide_canvas( FL_OBJECT * ob ); const char * fli_vclass_name( int n ); int fli_vclass_val( const char * v ); void fli_set_ul_property( int prop, int thickness ); int fli_is_valid_dir( const char * name ); #endif /* ! defined FL_INTERNAL_H */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/goodies.c0000644000175000017500000001455012340612470012324 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file goodies.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Common routines for the goodies */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "bitmaps/q.xbm" /* in directory bitmaps */ #include "bitmaps/warn.xbm" /* in directory bitmaps */ /*************************************** ***************************************/ void fl_update_display( int block ) { if ( block ) XSync( flx->display, 0 ); else XFlush( flx->display ); } /*************************************** * Preemptive handler to work around a bug in some window managers * where iconification causes a window to close. For normal closing, * we don't see any unmap events as winclose eats it ***************************************/ int fli_goodies_preemptive( FL_FORM * form, void * ev ) { if ( ( ( XEvent * ) ev )->type == UnmapNotify ) { fl_trigger_object( form->u_vdata ); return FL_PREEMPT; } return 0; } /*************************************** ***************************************/ int fl_goodies_atclose( FL_FORM * form, void * data ) { fl_trigger_object( data ? data : form->u_vdata ); if ( form->sort_of_modal ) form->sort_of_modal = 0; return FL_IGNORE; } /*************************************** ***************************************/ void fli_parse_goodies_label( FL_OBJECT * ob, const char * name ) { char s[ 256 ]; if ( fl_get_resource( name, NULL, FL_STRING, NULL, s, 256 ) ) { fl_set_object_label( ob, s ); fl_fit_object_label( ob, 5, 2 ); } } /*************************************** ***************************************/ void fli_get_goodie_title( FL_FORM * form, const char * res ) { char s[ 256 ]; if ( fl_get_resource( res, NULL, FL_STRING, NULL, s, 256 ) ) fl_set_form_title( form, s ); } static int goodie_style = FL_NORMAL_STYLE, goodie_size = FL_DEFAULT_SIZE; /*************************************** ***************************************/ void fl_set_goodies_font( int style, int size ) { goodie_style = style; goodie_size = size; } /*************************************** ***************************************/ void fli_get_goodies_font( int * style, int * size ) { *style = goodie_style; *size = goodie_size; } /*************************************** ***************************************/ void fli_handle_goodie_font( FL_OBJECT * ob1, FL_OBJECT * ob2 ) { if ( goodie_style < 0 ) return; if ( ob1 ) { fl_set_object_lstyle( ob1, goodie_style ); fl_set_object_lsize( ob1, goodie_size ); fl_fit_object_label( ob1, 1, 1 ); } if ( ob2 ) { fl_set_object_lstyle( ob2, goodie_style ); fl_set_object_lsize( ob2, goodie_size ); } } /*************************************** ***************************************/ static void fli_box_vert( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h ) { int halfh = 0.5 * h, halfw = 0.5 * w; fli_add_vertex( x, y + halfh ); fli_add_vertex( x + halfw, y ); fli_add_vertex( x + 2 * halfw, y + halfh ); fli_add_vertex( x + halfw, y + 2 * halfh ); } /*************************************** ***************************************/ static int draw_box( FL_OBJECT * ob, int ev, FL_Coord x FL_UNUSED_ARG, FL_Coord y FL_UNUSED_ARG, int k FL_UNUSED_ARG, void * sp FL_UNUSED_ARG ) { int p = ( FL_max( ob->w, ob->h ) / 2 ) * 2 + 1; if ( ev != FL_DRAW ) return 0; fl_winset( FL_ObjWin( ob ) ); if ( ! fli_dithered( fl_vmode ) ) { fl_color( FL_YELLOW ); fli_reset_vertex( ); fli_box_vert( ob->x, ob->y, p, p ); fli_endpolygon( ); } fl_linewidth( 2 ); fl_color( FL_BLACK ); fli_reset_vertex( ); fli_box_vert( ob->x, ob->y, ob->w, ob->h ); fli_endclosedline( ); fl_linewidth( 0 ); return 0; } /*************************************** ***************************************/ void fli_add_q_icon( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h ) { FL_OBJECT *obj; fl_add_free( FL_INACTIVE_FREE, x, y, w, h, "", draw_box ); obj = fl_add_bitmap( FL_NORMAL_BITMAP, x, y, w, h, "" ); fl_set_bitmap_data( obj, q_width, q_height, q_bits ); fl_set_object_color( obj, FL_YELLOW, FL_YELLOW ); fl_set_object_lcolor( obj, FL_BLACK ); } /*************************************** ***************************************/ void fli_add_warn_icon( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h ) { FL_OBJECT *obj; fl_add_free( FL_INACTIVE_FREE, x, y, w, h, "", draw_box ); obj = fl_add_bitmap( FL_NORMAL_BITMAP, x, y, w, h, "" ); fl_set_bitmap_data( obj, warn_width, warn_height, warn_bits ); fl_set_object_color( obj, FL_YELLOW, FL_YELLOW ); fl_set_object_lcolor( obj, FL_BLACK ); } /*************************************** ***************************************/ void fli_goodies_cleanup( void ) { fli_msg_cleanup( ); fli_alert_cleanup( ); fli_choice_cleanup( ); fli_question_cleanup( ); fli_input_cleanup( ); fli_sinput_cleanup( ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/cursor.c0000664000175000017500000002137712344103310012207 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file cursor.c *. * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao * All rights reserved. * * Cursor routines * * name is one of the standard symbolic cursor names (XC_watch etc) or * the constants defined by XFORMS (FL_INVISIBLE_CURSOR etc) * * Cursor is the cursor usable in XDefineCursor(win, cursor) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #define MAX_CURSORS 64 /* max. number of bitmap cursors */ #define MAX_SEQ 24 /* max. number cursors per animation */ /* Cursor cache */ typedef struct { int name; int ncursor; int cur_cursor; Window win; int timeout_id; int timeout; Cursor cur[ MAX_SEQ ]; } CurStruct; /* Pre-built cursors */ static CurStruct prebuilt[ ] = { { XC_watch, 0, 0, None, 0, 0, { 0 } }, { XC_sb_right_arrow, 0, 0, None, 0, 0, { 0 } }, { XC_hand2, 0, 0, None, 0, 0, { 0 } }, { XC_top_left_arrow, 0, 0, None, 0, 0, { 0 } }, { XC_tcross, 0, 0, None, 0, 0, { 0 } }, { XC_pirate, 0, 0, None, 0, 0, { 0 } } }; static CurStruct *cursors = NULL; static int fl_default_curname = XC_top_left_arrow; /* xforms' default */ #ifndef XC_num_glyphs #define XC_num_glyphs 255 #endif static int user_cur_name = XC_num_glyphs; static CurStruct *find_timeout( Window win ); /*************************************** ***************************************/ static CurStruct * add_cursor( int name, Cursor cur ) { CurStruct *c = cursors; static int warned; while ( c->name && c->name != name ) c++; if ( c < cursors + MAX_CURSORS ) { c->name = name; c->cur[ c->ncursor++ ] = cur; } else if ( ! warned ) { M_err( "add_cursor", "too many cursors" ); warned = 1; } return c; } /*************************************** ***************************************/ static Cursor create_bitmap_cursor( const char * source, const char * mask, int w, int h, int hotx, int hoty ) { Pixmap s, m = None; XColor fg, bg; Cursor cur; Window win = fl_root; s = XCreateBitmapFromData( flx->display, win, source, w, h ); if ( mask ) m = XCreateBitmapFromData( flx->display, win, mask, w, h ); fg.red = fg.green = fg.blue = 0; bg.red = bg.green = bg.blue = 0xffff; cur = XCreatePixmapCursor( flx->display, s, m, &fg, &bg, hotx, hoty ); return cur; } /*************************************** ***************************************/ static void init_cursors( void ) { static int ok; CurStruct *c; static char c_bits[ ] = { 0x00 }; if ( ok ) return; ok = 1; if ( ! cursors ) { cursors = fl_calloc( MAX_CURSORS, sizeof *c ); memcpy( cursors, prebuilt, sizeof prebuilt ); } for ( c = cursors; c->name; c++ ) c->cur[ c->ncursor++ ] = XCreateFontCursor( flx->display, c->name ); /* Create an invisible cursor */ add_cursor( FL_INVISIBLE_CURSOR, create_bitmap_cursor( c_bits, c_bits, 1, 1, 0, 0 ) ); /* Add the default cursor */ add_cursor( FL_DEFAULT_CURSOR, XCreateFontCursor( flx->display, fl_default_curname ) ); } /*************************************** ***************************************/ void fli_free_cursors( void ) { fli_safe_free( cursors ); } /*************************************** ***************************************/ static void animate_cursor( int id FL_UNUSED_ARG, void * data ) { CurStruct *cur = data; cur->timeout_id = 0; fl_set_cursor( cur->win, cur->name ); } /*************************************** * Set cursor for win to name. Name is either the standard XC_ or * Form defined ***************************************/ void fl_set_cursor( Window win, int name ) { CurStruct *c = cursors; init_cursors( ); if ( win == 0 ) { M_err( "fl_set_cursor", "Bad Window" ); return; } for ( ; c->name; c++ ) { if ( c->name == name ) { if ( c->ncursor > 1 ) { int n = c->cur_cursor % c->ncursor; XDefineCursor( flx->display, win, c->cur[ n ] );; c->cur_cursor++; c->win = win; if ( c->timeout_id == 0 ) c->timeout_id = fl_add_timeout( c->timeout, animate_cursor, c ); } else { CurStruct *cur = find_timeout( win ); if ( cur && cur->timeout_id ) { fl_remove_timeout( cur->timeout_id ); cur->timeout_id = 0; } XDefineCursor( flx->display, win, c->cur[ 0 ] );; } return; } } XDefineCursor( flx->display, win, fli_get_cursor_byname( name ) ); } /*************************************** * To be used in XDefineCursor ***************************************/ Cursor fli_get_cursor_byname( int name ) { CurStruct *c; Cursor cur = 0; init_cursors( ); for ( c = cursors; c->name; c++ ) { if ( c->name == name ) { int n = c->cur_cursor % c->ncursor; c->cur_cursor++; return c->cur[ n ]; } } /* Take a wild shot: since we can generate the default X cursor on the fly we don't have to always save them to the cursor structure */ if ( name < XC_num_glyphs - 1 ) { static int nn; cur = XCreateFontCursor( flx->display, name ); if ( nn < 10 ) { add_cursor( name, cur ); nn++; } } else { M_err( "fli_get_cursor_byname", "Unknown cursor: %d\n", name ); cur = fli_get_cursor_byname( FL_DEFAULT_CURSOR ); /* recursion */ } return cur; } /*************************************** ***************************************/ void fl_set_cursor_color( int name, FL_COLOR fg, FL_COLOR bg ) { XColor xfg, xbg; int r, g, b; Cursor cur = fli_get_cursor_byname( name ); fl_getmcolor( fg, &r, &g, &b ); xfg.red = ( r << 8 ) | 0xff; xfg.green = ( g << 8 ) | 0xff; xfg.blue = ( b << 8 ) | 0xff; fl_getmcolor( bg, &r, &g, &b ); xbg.red = ( r << 8 ) | 0xff; xbg.green = ( g << 8 ) | 0xff; xbg.blue = ( b << 8 ) | 0xff; XRecolorCursor( flx->display, cur, &xfg, &xbg ); } /*************************************** ***************************************/ int fl_create_bitmap_cursor( const char * source, const char * mask, int w, int h, int hotx, int hoty ) { Cursor cur; init_cursors( ); cur = create_bitmap_cursor( source, mask, w, h, hotx, hoty ); add_cursor( user_cur_name, cur ); return user_cur_name++; } /*************************************** * cursor animation ***************************************/ int fl_create_animated_cursor( int * cur_names, int timeout ) { int *n = cur_names, k = MAX_SEQ; CurStruct *c = 0; for ( ; *n >= 0 && --k >= 0; n++ ) c = add_cursor( user_cur_name, fli_get_cursor_byname( *n ) ); if ( c ) c->timeout = timeout > 0 ? timeout : 20; return user_cur_name++; } /*************************************** ***************************************/ static CurStruct * find_timeout( Window win ) { CurStruct *c = cursors; for ( ; c->name; c++ ) if ( c->win == win && c->timeout_id ) return c; return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/tooltip.c0000644000175000017500000001140212251553730012362 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file tooltip.c * * This file is part of the XForms library package. * Copyright (c) 1998-2002 T.C. Zhao * All rights reserved. * * Show message in a top-level unmanaged window. Used * for tooltips */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" typedef struct { FL_FORM * tooltipper; void * vdata; char * cdata; long ldate; FL_OBJECT * text; int fntstyle; int fntsize; FL_COLOR background; FL_COLOR textcolor; int boxtype; int lalign; } TOOLTIP; static TOOLTIP *tip; /*************************************** ***************************************/ static void create_it( void ) { FL_OBJECT *text; if ( tip ) return; tip = fl_calloc( 1, sizeof *tip ); tip->fntstyle = FL_NORMAL_STYLE; tip->fntsize = FL_DEFAULT_SIZE; tip->boxtype = FL_BORDER_BOX; tip->lalign = fl_to_inside_lalign( FL_ALIGN_LEFT ); tip->textcolor = FL_BLACK; tip->background = FL_YELLOW; tip->tooltipper = fl_bgn_form( FL_NO_BOX, 5, 5 ); tip->text = text = fl_add_box( tip->boxtype, 0, 0, 5, 5, "" ); fl_set_object_bw( text, -1 ); fl_set_object_lstyle( text, tip->fntstyle ); fl_set_object_lsize( text, tip->fntsize ); fl_set_object_lcolor( text, tip->textcolor ); fl_set_object_lalign( text, tip->lalign ); fl_set_object_color( text, tip->background, tip->background ); fl_end_form( ); } /*************************************** ***************************************/ void fl_set_tooltip_boxtype( int bt ) { create_it( ); tip->boxtype = bt; fl_set_object_boxtype( tip->text, bt ); } /*************************************** ***************************************/ void fli_show_tooltip( const char * s, int x, int y ) { int maxw = 0, maxh = 0, extra; if ( ! s ) return; create_it( ); extra = 1 + ( tip->boxtype != FL_FLAT_BOX && tip->boxtype != FL_BORDER_BOX ); fl_get_string_dimension( tip->fntstyle, tip->fntsize, s, strlen( s ), &maxw, &maxh ); maxw += 7 + extra; maxh += 7 + extra; if ( maxw > 800 ) maxw = 800; if ( maxh > 800 ) maxh = 800; fl_freeze_form( tip->tooltipper ); fl_set_form_geometry( tip->tooltipper, x, y, maxw, maxh ); fl_set_object_label( tip->text, s ); fl_unfreeze_form( tip->tooltipper ); if ( ! tip->tooltipper->visible ) fl_show_form( tip->tooltipper, FL_PLACE_GEOMETRY | FL_FREE_SIZE, FL_NOBORDER, "Tooltip" ); fl_update_display( 1 ); } /*************************************** ***************************************/ void fli_hide_tooltip( void ) { if ( tip && tip->tooltipper->visible ) fl_hide_form( tip->tooltipper ); } /*************************************** ***************************************/ int fli_is_tooltip_form( FL_FORM * form ) { return tip && tip->tooltipper == form; } /*************************************** ***************************************/ void fl_set_tooltip_color( FL_COLOR tc, FL_COLOR bc ) { create_it( ); fl_set_object_lcolor( tip->text, tip->textcolor = tc ); tip->background = bc; fl_set_object_color( tip->text, tip->background, tip->background ); } /*************************************** ***************************************/ void fl_set_tooltip_font( int style, int size ) { create_it( ); fl_set_object_lstyle( tip->text, tip->fntstyle = style ); fl_set_object_lsize( tip->text, tip->fntsize = size ); } /*************************************** ***************************************/ void fl_set_tooltip_lalign( int align ) { create_it( ); fl_set_object_lalign( tip->text, tip->lalign = fl_to_inside_lalign( align ) ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/config.h.in0000664000175000017500000001264512353624172012565 00000000000000/* lib/config.h.in. Generated from configure.ac by autoheader. */ /* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ /* \file config.h * * This is the compilation configuration file for xforms. * It was generated by autoconfs configure. * You might want to change some of the defaults if something goes wrong * during the compilation. */ #ifndef CONFIG_H #define CONFIG_H /* Define if you are building a development version of xforms */ #undef DEVEL_VERSION /* Define if you have the prototype for function `sigaction' */ #undef HAVE_DECL_SIGACTION /* Define if you have the prototype for function `snprintf' */ #undef HAVE_DECL_SNPRINTF /* Define if you have the prototype for function `vasprintf' */ #undef HAVE_DECL_VASPRINTF /* Define if you have the prototype for function `vsnprintf' */ #undef HAVE_DECL_VSNPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `c' library (-lc). */ #undef HAVE_LIBC /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `nanosleep' function. */ #undef HAVE_NANOSLEEP /* Define to 1 if you have the `sigaction' function. */ #undef HAVE_SIGACTION /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `usleep' function. */ #undef HAVE_USLEEP /* Define to 1 if you have the `vasprintf' function. */ #undef HAVE_VASPRINTF /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Define if the return type of signal handlers is void */ #undef RETSIGTYPE_IS_VOID /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Version number of package */ #undef VERSION /* Define this if you want to see the warning directives put here and there by the developpers to get attention */ #undef WITH_WARNINGS /* define this to the location of xpm.h to be used with #include, e.g. */ #undef XPM_H_LOCATION /* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned int' if does not define. */ #undef size_t #endif /* NOT CONFIG_H */ xforms-1.2.4/lib/strdup.c0000644000175000017500000000231712251553767012230 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file strdup.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "include/forms.h" /*************************************** ***************************************/ char * fl_strdup( const char * s ) { return strcpy( fl_malloc( strlen( s ) + 1 ), s ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/formbrowser.c0000644000175000017500000007352112251554221013245 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file formbrowser.c * * This file is part of the XForms library package. * * Copyright (c) 1997 By T.C. Zhao and Mark Overmars * Copyright (c) 1998 By Steve Lamont of the National Center for * Microscopy and Imaging Research * Copyright (c) 1999-2002 by T.C. Zhao and Steve Lamont * All rights reserved. * * form browser. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/pformbrowser.h" static void check_scrollbar( FL_OBJECT * ob ); static int canvas_cleanup( FL_OBJECT * ob ); static int canvas_handler( FL_OBJECT * ob, Window win, int w, int h, XEvent * ev, void * data ); static void delete_form( FLI_FORMBROWSER_SPEC * sp, int f ); static void display_forms( FLI_FORMBROWSER_SPEC * sp ); static void form_cb( FL_OBJECT * ob, void * data ); static int handle_formbrowser( FL_OBJECT * ob, int event, FL_Coord mx, FL_Coord my, int key, void * ev ); static void hcb( FL_OBJECT * ob, long data ); static void parentize_form( FL_FORM * form, FL_OBJECT * ob ); static void set_form_position( FL_FORM * form, int x, int y ); static void vcb( FL_OBJECT * ob, long data ); static void set_formbrowser_return( FL_OBJECT * obj, unsigned int when ); /*************************************** ***************************************/ FL_OBJECT * fl_create_formbrowser( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob; FLI_FORMBROWSER_SPEC *sp; int absbw, oldu = fl_get_coordunit( ); int D; ob = fl_make_object( FL_FORMBROWSER, type, x, y, w, h, label, handle_formbrowser ); fl_set_coordunit( FL_COORD_PIXEL ); ob->boxtype = FL_FORMBROWSER_BOXTYPE; ob->align = FL_FORMBROWSER_ALIGN; ob->col1 = FL_FORMBROWSER_COL1; ob->col2 = FL_BLACK; ob->set_return = set_formbrowser_return; ob->spec = sp = fl_calloc( 1, sizeof *sp ); absbw = FL_abs( ob->bw ); sp->form = NULL; sp->parent = ob; sp->scroll = FL_SMOOTH_SCROLL; sp->vw_def = sp->hh_def = D = fli_get_default_scrollbarsize( ob ); sp->canvas = fl_create_canvas( FL_CANVAS, ob->x + absbw, ob->y + absbw, ob->w - 2 * absbw - sp->vw_def, ob->h - 2 * absbw - sp->hh_def, label ); sp->canvas->u_vdata = sp; fl_modify_canvas_prop( sp->canvas, NULL, NULL, canvas_cleanup ); fl_set_object_color( sp->canvas, ob->col1, ob->col2 ); fl_set_object_bw( sp->canvas, ob->bw ); fl_set_object_boxtype( sp->canvas, fli_boxtype2frametype( ob->boxtype ) ); fl_add_canvas_handler( sp->canvas, Expose, canvas_handler, NULL ); sp->v_pref = sp->h_pref = FL_AUTO; sp->hsl = fl_create_scrollbar( FL_HOR_THIN_SCROLLBAR, ob->x, y + h - D, w - D, D, "" ); fl_set_scrollbar_value( sp->hsl, sp->old_hval = 0.0 ); fl_set_object_boxtype( sp->hsl, ob->boxtype ); sp->hsl->visible = sp->h_pref == FL_ON; sp->hsl->resize = FL_RESIZE_X; fl_set_object_callback( sp->hsl, hcb, 0 ); sp->vsl = fl_create_scrollbar( FL_VERT_THIN_SCROLLBAR, x + w - D, y, D, h - D, "" ); fl_set_object_boxtype( sp->vsl, ob->boxtype ); sp->vsl->visible = sp->v_pref == FL_ON; fl_set_scrollbar_value( sp->vsl, sp->old_hval = 0.0 ); sp->vsl->resize = FL_RESIZE_Y; fl_set_object_callback( sp->vsl, vcb, 0 ); fl_add_child( ob, sp->canvas ); fl_add_child( ob, sp->hsl ); fl_add_child( ob, sp->vsl ); fl_set_coordunit( oldu ); /* Set default return policy for the object */ fl_set_object_return( ob, FL_RETURN_NONE ); return ob; } /*************************************** ***************************************/ FL_OBJECT * fl_add_formbrowser( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj = fl_create_formbrowser( type, x, y, w, h, label ); fl_add_object( fl_current_form, obj ); return obj; } /*************************************** ***************************************/ FL_FORM * fl_get_formbrowser_topform( FL_OBJECT * ob ) { int topline; FLI_FORMBROWSER_SPEC *sp; if ( ! IsFormBrowserClass( ob ) ) { M_err( "fl_get_formbrowser_topform", "%s not a formbrowser", ob ? ob->label : "null" ); return NULL; } sp = ob->spec; topline = sp->top_form + 1; return topline ? sp->form[ topline - 1 ] : NULL; } /*************************************** ***************************************/ int fl_set_formbrowser_topform( FL_OBJECT * ob, FL_FORM * form ) { int n = fl_find_formbrowser_form_number( ob, form ); if ( n > 0 ) fl_set_formbrowser_topform_bynumber( ob, n ); return n; } /*************************************** ***************************************/ FL_FORM * fl_set_formbrowser_topform_bynumber( FL_OBJECT * ob, int n ) { FLI_FORMBROWSER_SPEC *sp = ob->spec; FL_FORM *form = NULL; if ( n > 0 && n <= sp->nforms ) { int h, f; sp->top_form = n - 1; sp->top_edge = 0; form = sp->form[ sp->top_form ]; display_forms( sp ); for ( h = f = 0; f < sp->top_form; f++ ) h += sp->form[ f ]->h; sp->old_vval = ( double ) h / ( sp->max_height - sp->canvas->h ); fl_set_scrollbar_value( sp->vsl, sp->old_vval ); } return form; } /*************************************** ***************************************/ int fl_addto_formbrowser( FL_OBJECT * ob, FL_FORM * form ) { FLI_FORMBROWSER_SPEC *sp; if ( ! IsFormBrowserClass( ob ) ) { M_err( "fl_addto_formbrowser", "%s not a formbrowser", ob ? ob->label : "null" ); return 0; } if ( ! form ) { M_err( "fl_addto_formbrowser", "Invalid argument" ); return 0; } if ( form->attached ) { M_err( "fl_addto_formbrowser", "Already attached ?" ); return 0; } sp = ob->spec; if ( form->visible == FL_VISIBLE ) fl_hide_form( form ); if ( ! form->form_callback ) fl_set_form_callback( form, form_cb, NULL ); parentize_form( form, ob ); sp->form = fl_realloc( sp->form, ( sp->nforms + 1 ) * sizeof *sp->form ); sp->form[ sp->nforms++ ] = form; form->attached = 1; if ( form->pre_attach ) form->pre_attach( form ); if ( sp->max_width < form->w ) sp->max_width = form->w; sp->max_height += form->h; display_forms( sp ); return sp->nforms; } /*************************************** ***************************************/ int fl_find_formbrowser_form_number( FL_OBJECT * ob, FL_FORM * form ) { FLI_FORMBROWSER_SPEC *sp; int num; if ( ! IsFormBrowserClass( ob ) ) { M_err( "fl_find_formbrowser_form_number", "%s not a formbrowser", ob ? ob->label : "null" ); return 0; } if ( ! form ) { M_err( "fl_find_formbrowser_form_number", "Invalid argument" ); return 0; } sp = ob->spec; for ( num = 0; num < sp->nforms; num++ ) if ( sp->form[ num ] == form ) break; return num == sp->nforms ? 0 : num + 1; } /*************************************** ***************************************/ int fl_delete_formbrowser( FL_OBJECT * ob, FL_FORM * form ) { FLI_FORMBROWSER_SPEC *sp; int f; if ( ! IsFormBrowserClass( ob ) ) { M_err( "fl_delete_formbrowser", "%s not a formbrowser", ob ? ob->label : "null" ); return -1; } if ( ! form ) { M_err( "fl_delete_formbrowser", "Invalid argument" ); return -1; } sp = ob->spec; f = fl_find_formbrowser_form_number( ob, form ); if ( f ) delete_form( sp, f - 1 ); return f ? sp->nforms : -1; } /*************************************** ***************************************/ #if 0 FL_FORM * fl_get_formbrowser_parent_form( FL_OBJECT * ob ) { return ob->form->parent; } #endif /*************************************** ***************************************/ FL_FORM * fl_delete_formbrowser_bynumber( FL_OBJECT * ob, int num ) { FL_FORM *form; FLI_FORMBROWSER_SPEC *sp; if ( ! IsFormBrowserClass( ob ) ) { M_err( "fl_delete_formbrowser_bynumber", "%s not a formbrowser", ob ? ob->label : "null" ); return NULL; } sp = ob->spec; if ( num <= 0 || num > sp->nforms ) { M_err( "fl_delete_formbrowser_bynumber", "Invalid argument -- %d not between 1 and %d", num, sp->nforms ); return NULL; } form = sp->form[ --num ]; delete_form( sp, num ); return form; } /*************************************** ***************************************/ FL_FORM * fl_replace_formbrowser( FL_OBJECT * ob, int num, FL_FORM * form ) { FL_FORM *old_form; FLI_FORMBROWSER_SPEC *sp; if ( ! IsFormBrowserClass( ob ) ) { M_err( "fl_replace_formbrowser", "%s not a formbrowser", ob ? ob->label : "null" ); return NULL; } sp = ob->spec; if ( num <= 0 || num > sp->nforms ) { M_err( "fl_replace_formbrowser", "Invalid argument -- %d not between 1 and %d", num, sp->nforms ); return NULL; } old_form = sp->form[ --num ]; fl_hide_form( old_form ); sp->form[ num ] = form; display_forms( sp ); return old_form; } /*************************************** ***************************************/ int fl_get_formbrowser_area( FL_OBJECT * ob, int * x, int * y, int * w, int * h ) { FLI_FORMBROWSER_SPEC *sp; if ( ! IsFormBrowserClass( ob ) ) { M_err( "fl_get_formbrowser_area", "%s not a formbrowser", ob ? ob->label : "null" ); return 0; } sp = ob->spec; *x = sp->canvas->x; *y = sp->canvas->y; *w = sp->canvas->w; *h = sp->canvas->h; return 1; } /*************************************** ***************************************/ int fl_insert_formbrowser( FL_OBJECT * ob, int line, FL_FORM * new_form ) { FLI_FORMBROWSER_SPEC *sp; int nforms; FL_FORM **form; int n = line - 1; if ( ! IsFormBrowserClass( ob ) ) { M_err( "fl_insert_formbrowser", "%s not a formbrowser", ob ? ob->label : "null" ); return -1; } sp = ob->spec; nforms = sp->nforms; if ( line <= 0 || line > nforms ) { M_err( "fl_insert_formbrowser", "Invalid argument" ); return -1; } form = fl_realloc( sp->form, ( nforms + 1 ) * sizeof *form ); if ( ! form ) { M_err( "fl_insert_formbrowser", "Running out of memory" ); return -1; } parentize_form( new_form, ob ); if ( n != nforms ) memmove( form + n + 1, form + n, sizeof *form * ( nforms - n ) ); form[ n ] = new_form; sp->form = form; sp->nforms++; display_forms( sp ); return sp->nforms; } /*************************************** ***************************************/ void fl_set_formbrowser_hscrollbar( FL_OBJECT * ob, int how ) { FLI_FORMBROWSER_SPEC *sp = ob->spec; if ( sp->h_pref != how ) { sp->h_pref = how; fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_set_formbrowser_vscrollbar( FL_OBJECT * ob, int how ) { FLI_FORMBROWSER_SPEC *sp = ob->spec; if ( sp->v_pref != how ) { sp->v_pref = how; fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_set_formbrowser_scroll( FL_OBJECT * ob, int how ) { FLI_FORMBROWSER_SPEC *sp = ob->spec; if ( sp->scroll != how ) { if ( ( sp->scroll = how ) == FL_JUMP_SCROLL ) sp->top_edge = 0; fl_redraw_object( ob ); } } /*************************************** ***************************************/ int fl_set_formbrowser_xoffset( FL_OBJECT * ob, int offset ) { FLI_FORMBROWSER_SPEC *sp; int current; if ( ! IsFormBrowserClass( ob ) ) { M_err( "fl_set_formbrowser_xoffset", "%s not a formbrowser", ob ? ob->label : "null" ); return 0; } sp = ob->spec; current = sp->left_edge; if ( sp->max_width < sp->canvas->w ) offset = 0; if ( offset < 0 ) offset = 0; if ( offset > sp->max_width - sp->canvas->w ) offset = sp->max_width - sp->canvas->w; sp->left_edge = offset; sp->old_hval = ( double ) sp->left_edge / ( sp->max_width - sp->canvas->w ); fl_set_scrollbar_value( sp->hsl, sp->old_hval ); return current; } /*************************************** ***************************************/ int fl_get_formbrowser_xoffset( FL_OBJECT * ob ) { if ( ! IsFormBrowserClass( ob ) ) { M_err( "fl_get_formbrowser_xoffset", "%s not a formbrowser", ob ? ob->label : "null" ); return 0; } return ( ( FLI_FORMBROWSER_SPEC * ) ob->spec )->left_edge; } /*************************************** ***************************************/ int fl_set_formbrowser_yoffset( FL_OBJECT * ob, int offset ) { FLI_FORMBROWSER_SPEC *sp; int current; int h, f; if ( ! IsFormBrowserClass( ob ) ) { M_err( "fl_set_formbrowser_yoffset", "%s not a formbrowser", ob ? ob->label : "null" ); return 0; } sp = ob->spec; current = fl_get_formbrowser_yoffset( ob ); if ( sp->max_height < sp->canvas->h ) offset = 0; if ( offset < 0 ) offset = 0; if ( offset > sp->max_height - sp->canvas->h ) offset = sp->max_height - sp->canvas->h; h = sp->max_height; for ( f = sp->nforms - 1; f >= 0 && offset < h; f-- ) h -= sp->form[ f ]->h; sp->top_form = ++f; sp->top_edge = offset - h; sp->old_vval = ( double ) offset / ( sp->max_height - sp->canvas->h ); fl_set_scrollbar_value( sp->vsl, sp->old_vval ); return current; } /*************************************** ***************************************/ int fl_get_formbrowser_yoffset( FL_OBJECT * ob ) { FLI_FORMBROWSER_SPEC *sp; int h, f; if ( ! IsFormBrowserClass( ob ) ) { M_err( "fl_get_formbrowser_yoffset", "%s not a formbrowser", ob ? ob->label : "null" ); return 0; } sp = ob->spec; for ( h = f = 0; f < sp->top_form; f++ ) h += sp->form[ f ]->h; return h + sp->top_edge; } /*************************************** ***************************************/ int fl_get_formbrowser_numforms( FL_OBJECT * ob ) { if ( ! IsFormBrowserClass( ob ) ) { M_err( "fl_get_formbrowser_numforms", "%s not a formbrowser", ob ? ob->label : "null" ); return -1; } return ( ( FLI_FORMBROWSER_SPEC * ) ob->spec )->nforms; } /*************************************** ***************************************/ FL_FORM * fl_get_formbrowser_form( FL_OBJECT * ob, int n ) { FL_FORM *form = NULL; FLI_FORMBROWSER_SPEC *sp; if ( ! IsFormBrowserClass( ob ) ) { M_err( "fl_get_formbrowser_form", "%s not a formbrowser", ob ? ob->label : "null" ); return NULL; } sp = ob->spec; if ( n >= 1 && n <= sp->nforms ) form = sp->form[ n - 1 ]; else M_err( "fl_get_formbrowser_form", "%d is not an allowable form number", n ); return form; } /* Internals */ /*************************************** ***************************************/ static void display_forms( FLI_FORMBROWSER_SPEC * sp ) { int f; int y_pos; FL_OBJECT *canvas = sp->canvas; FL_FORM **form = sp->form; int nforms = sp->nforms; int top_form = sp->top_form; int left_edge = - sp->left_edge; int height = canvas->h; /* - (2 * absbw); */ if ( ! FL_ObjWin( sp->canvas ) ) return; fli_inherit_attributes( sp->parent, sp->canvas ); for ( f = 0; f < top_form; f++ ) if ( form[ f ]->visible ) fl_hide_form( form[ f ] ); fli_inherit_attributes( sp->parent, sp->vsl ); fli_inherit_attributes( sp->parent, sp->hsl ); /* I prefer to keep scrollbar unresizable */ sp->vsl->resize = sp->hsl->resize = FL_RESIZE_NONE; y_pos = sp->scroll == FL_JUMP_SCROLL ? 0 : -sp->top_edge; for ( f = top_form; y_pos < height && f < nforms; f++ ) { if ( form[ f ]->visible ) set_form_position( form[ f ], left_edge, y_pos ); else { fl_prepare_form_window( form[ f ], 0, FL_NOBORDER, "Formbrowser" ); form[ f ]->parent_obj = sp->parent; XReparentWindow( fl_get_display( ), form[ f ]->window, FL_ObjWin( sp->canvas ), left_edge, y_pos ); fl_show_form_window( form[ f ] ); } y_pos += form[ f ]->h; } for ( ; f < nforms; f++ ) if ( form[ f ]->visible ) fl_hide_form( form[ f ] ); } /*************************************** ***************************************/ static int handle_formbrowser( FL_OBJECT * ob, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { FLI_FORMBROWSER_SPEC *sp = ob->spec; switch ( event ) { case FL_RESIZED : fl_redraw_object( ob ); break; case FL_DRAW : fl_set_object_boxtype( sp->canvas, fli_boxtype2frametype( ob->boxtype ) ); sp->processing_destroy = 0; check_scrollbar( ob ); if ( ! sp->in_draw && FL_ObjWin( sp->canvas ) ) { sp->in_draw = 1; display_forms( sp ); sp->in_draw = 0; } break; case FL_FREEMEM : fl_free( sp ); break; } return FL_RETURN_NONE; } /*************************************** * Canvas expose handler. ***************************************/ static int canvas_handler( FL_OBJECT * ob, Window win FL_UNUSED_ARG, int w FL_UNUSED_ARG, int h FL_UNUSED_ARG, XEvent * ev FL_UNUSED_ARG, void * data FL_UNUSED_ARG ) { display_forms( ( FLI_FORMBROWSER_SPEC * ) ob->u_vdata ); return 0; } /*************************************** * Before canvas is destroyed, this routine will be called. * we need to close the form that is attached to this canvas ***************************************/ static int canvas_cleanup( FL_OBJECT * ob ) { FLI_FORMBROWSER_SPEC *sp = ob->u_vdata; int i; sp->processing_destroy = 1; sp->h_on = FL_OFF; sp->v_on = FL_OFF; for ( i = 0; i < sp->nforms; i++ ) if ( sp->form[ i ]->visible ) fl_hide_form( sp->form[ i ] ); return 0; } /*************************************** * Dummy ***************************************/ static void form_cb( FL_OBJECT * ob FL_UNUSED_ARG, void * data FL_UNUSED_ARG ) { } /*************************************** ***************************************/ static void hcb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { FLI_FORMBROWSER_SPEC *sp = obj->parent->spec; double nval = fl_get_scrollbar_value( sp->hsl ); int old_left_edge = sp->left_edge; sp->left_edge = ( sp->max_width - sp->canvas->w ) * nval; if ( old_left_edge != sp->left_edge ) { fl_freeze_form( obj->form ); display_forms( sp ); fl_unfreeze_form( obj->form ); } if ( obj->returned & FL_RETURN_END ) obj->parent->returned |= FL_RETURN_END; if ( nval != sp->old_hval ) obj->parent->returned |= FL_RETURN_CHANGED; if ( obj->parent->how_return & FL_RETURN_END_CHANGED && ! ( obj->parent->returned & FL_RETURN_CHANGED && obj->parent->returned & FL_RETURN_END ) ) obj->parent->returned = FL_RETURN_NONE; if ( obj->parent->returned & FL_RETURN_END ) sp->old_hval = nval; } /*************************************** ***************************************/ static void vcb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { FLI_FORMBROWSER_SPEC *sp = obj->parent->spec; double nval = fl_get_scrollbar_value( sp->vsl ); if ( sp->scroll == FL_JUMP_SCROLL ) sp->top_form = ( sp->nforms - 1 ) * nval; else { /* do pixel based scrolling */ int pos = ( sp->max_height - sp->canvas->h ) * nval; int h = 0, f; for ( f = 0; h <= pos && f < sp->nforms; f++ ) h += sp->form[ f ]->h; sp->top_form = f ? ( f - 1 ) : f; sp->top_edge = sp->form[ sp->top_form ]->h - h + pos; } fl_freeze_form( obj->form ); display_forms( sp ); fl_unfreeze_form( obj->form ); if ( obj->returned & FL_RETURN_END ) obj->parent->returned |= FL_RETURN_END; if ( nval != sp->old_vval ) obj->parent->returned |= FL_RETURN_CHANGED; if ( obj->parent->how_return & FL_RETURN_END_CHANGED && ! ( obj->parent->returned & FL_RETURN_CHANGED && obj->parent->returned & FL_RETURN_END ) ) obj->parent->returned = FL_RETURN_NONE; if ( obj->parent->returned & FL_RETURN_END ) sp->old_vval = nval; } /*************************************** ***************************************/ static void set_form_position( FL_FORM * form, int x, int y ) { XMoveWindow( fl_get_display( ), form->window, x, y ); } /*************************************** ***************************************/ static void delete_form( FLI_FORMBROWSER_SPEC * sp, int f ) { fl_hide_form( sp->form[ f ] ); sp->form[ f ]->attached = 0; sp->nforms--; sp->max_height -= sp->form[ f ]->h; for ( ; f < sp->nforms; f++ ) sp->form[ f ] = sp->form[ f + 1 ]; sp->form = fl_realloc( sp->form, sizeof *sp->form * sp->nforms ); display_forms( sp ); } /*************************************** ***************************************/ static void parentize_form( FL_FORM * form, FL_OBJECT * ob ) { form->parent = ob->form; /* This is probably the wrong way to do it. */ } /*************************************** ***************************************/ static void check_scrollbar( FL_OBJECT * ob ) { FLI_FORMBROWSER_SPEC *sp = ob->spec; int absbw = FL_abs( ob->bw ); int h_on = sp->h_on, v_on = sp->v_on; /* Inherit the boxtype of the parent */ sp->hsl->boxtype = ob->boxtype; sp->vsl->boxtype = ob->boxtype; /* Gravity/resize may screw up the ratios. Recompute */ sp->canvas->x = ob->x + absbw; sp->canvas->y = ob->y + absbw; sp->canvas->w = ob->w - 2 * absbw; sp->canvas->h = ob->h - 2 * absbw; sp->h_on = sp->canvas->w - 2 * absbw - sp->vw_def > 0 && sp->canvas->h - 2 * absbw - sp->hh_def > 0 && ( sp->h_pref == FL_ON || ( sp->h_pref != FL_OFF && sp->canvas->w < sp->max_width ) ); sp->v_on = sp->canvas->w - 2 * absbw - sp->vw_def > 0 && sp->canvas->h - 2 * absbw - sp->hh_def > 0 && ( sp->v_pref == FL_ON || ( sp->v_pref != FL_OFF && sp->canvas->h < sp->max_height ) ); if ( sp->h_on && ! sp->v_on ) sp->v_on = sp->canvas->w - 2 * absbw - sp->vw_def > 0 && sp->canvas->h - 2 * absbw - sp->hh_def > 0 && sp->v_pref != FL_OFF && sp->canvas->h < sp->max_height + sp->hh_def; else if ( ! sp->h_on && sp->v_on ) sp->h_on = sp->canvas->w - 2 * absbw - sp->vw_def > 0 && sp->canvas->h - 2 * absbw - sp->hh_def > 0 && sp->h_pref != FL_OFF && sp->canvas->w < sp->max_width + sp->vw_def; if ( sp->v_on ) { sp->vw = sp->vw_def; sp->vsl->x = ob->x + ob->w - sp->vw; sp->vsl->y = ob->y; sp->vsl->w = sp->vw; fli_set_object_visibility( sp->vsl, FL_VISIBLE ); fli_notify_object( sp->vsl, FL_RESIZED ); } else { fli_set_object_visibility( sp->vsl, FL_HIDDEN ); sp->vw = 0; } if ( sp->h_on ) { sp->hh = sp->hh_def; sp->hsl->x = ob->x; sp->hsl->y = ob->y + ob->h - sp->hh; sp->hsl->h = sp->hh; fli_set_object_visibility( sp->hsl, FL_VISIBLE ); fli_notify_object( sp->hsl, FL_RESIZED ); } else { fli_set_object_visibility( sp->hsl, FL_HIDDEN ); sp->hh = 0; } /* Recheck vertical */ if ( ! sp->v_on && sp->canvas->w - 2 * absbw - sp->vw_def > 0 && sp->canvas->h - 2 * absbw - sp->hh_def > 0 && sp->v_pref != FL_OFF && sp->canvas->h < sp->max_height ) { sp->v_on = 1; sp->vw = sp->vw_def; sp->vsl->x = ob->x + ob->w - sp->vw; sp->vsl->y = ob->y; sp->canvas->w = ob->w - 2 * absbw - sp->vw; } sp->canvas->w = ob->w - 2 * absbw - ( sp->v_on ? 2 * absbw + sp->vw_def : 0 ); sp->canvas->h = ob->h - 2 * absbw - ( sp->h_on ? 2 * absbw + sp->hh_def : 0 ); sp->hsl->w = sp->canvas->w + 2 * absbw; sp->vsl->h = sp->canvas->h + 2 * absbw; /* If scrollbars get turned off adjust the offsets. */ if ( ! sp->v_on && v_on && sp->canvas->h >= sp->max_height ) { sp->top_edge = 0; sp->top_form = 0; fl_set_scrollbar_value( sp->vsl, sp->old_vval = 0.0 ); } if ( ! sp->h_on && h_on && sp->canvas->w >= sp->max_width ) { sp->left_edge = 0; fl_set_scrollbar_value( sp->hsl, sp->old_hval = 0.0 ); } if ( sp->h_on ) { fl_set_scrollbar_size( sp->hsl, ( double ) sp->canvas->w / sp->max_width ); fl_set_formbrowser_xoffset( ob, fl_get_formbrowser_xoffset( ob ) ); } if ( sp->v_on ) { fl_set_scrollbar_size( sp->vsl, ( double ) sp->canvas->h / sp->max_height ); fl_set_formbrowser_yoffset( ob, fl_get_formbrowser_yoffset( ob ) ); } if ( sp->canvas->w > 0 && sp->canvas->h > 0 ) fl_winresize( FL_ObjWin( sp->canvas ), sp->canvas->w, sp->canvas->h ); } /*************************************** * Sets under which conditions the object is to be returned to the * application. This function is for interal use only, the user * must call fl_set_object_return() (which then will call this * function). ***************************************/ static void set_formbrowser_return( FL_OBJECT * obj, unsigned int when ) { FLI_FORMBROWSER_SPEC *sp = obj->spec; if ( when & FL_RETURN_END_CHANGED ) when &= ~ ( FL_RETURN_NONE | FL_RETURN_CHANGED ); obj->how_return = when; if ( when == FL_RETURN_NONE || when == FL_RETURN_CHANGED ) { fl_set_scrollbar_return( sp->vsl, FL_RETURN_CHANGED ); fl_set_scrollbar_return( sp->hsl, FL_RETURN_CHANGED ); } else { fl_set_scrollbar_return( sp->vsl, FL_RETURN_ALWAYS ); fl_set_scrollbar_return( sp->hsl, FL_RETURN_ALWAYS ); } } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/signal.c0000664000175000017500000001311712251554023012150 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file signal.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao * All rights reserved. * * Simple minded quick&dirty signal handling. * * Only permit a specific signal to have one handler */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include #include void ( * fli_handle_signal )( void ) = NULL; /* also needed in handling.c */ /*************************************** ***************************************/ static void handle_signal( void ) { FLI_SIGNAL_REC *rec = fli_context->signal_rec; for ( ; rec; rec = rec->next ) while ( rec->caught ) { rec->caught--; rec->callback( rec->signum, rec->data ); } } #ifndef FL_WIN32 #define IsDangerous( s ) ( ( s ) == SIGBUS \ || ( s ) == SIGSEGV \ || ( s ) == SIGILL \ || ( s ) == SIGFPE ) #else #define IsDangerous( s ) 0 #endif static int sig_direct; /*************************************** ***************************************/ static RETSIGTYPE default_signal_handler( int sig ) { fl_signal_caught( sig ); /* if the signal is one of those that can cause infinite loops, handle it and then exit */ if ( IsDangerous( sig ) ) { handle_signal( ); fprintf( stderr, "Can't continue upon receiving signal %d\n", sig ); exit( sig ); } #ifndef RETSIGTYPE_IS_VOID return 0; #endif } /*************************************** ***************************************/ void fl_add_signal_callback( int s, FL_SIGNAL_HANDLER cb, void * data ) { FLI_SIGNAL_REC *sig_rec, *rec = fli_context->signal_rec; if ( ! fli_handle_signal ) fli_handle_signal = handle_signal; while ( rec && rec->signum != s ) rec = rec->next; if ( rec ) { rec->callback = cb; rec->data = data; } else { sig_rec = fl_malloc( sizeof *sig_rec ); sig_rec->next = NULL; sig_rec->data = data; sig_rec->callback = cb; sig_rec->signum = s; sig_rec->caught = 0; if ( ! sig_direct ) { #if defined HAVE_SIGACTION struct sigaction sact; sact.sa_handler = default_signal_handler; sigemptyset( &sact.sa_mask ); sact.sa_flags = 0; if ( sigaction( s, &sact, &sig_rec->old_sigact ) < 0 ) #else errno = 0; sig_rec->ocallback = signal( s, default_signal_handler ); if ( sig_rec->ocallback == ( FLI_OSSIG_HANDLER ) - 1L || errno ) #endif { M_err( "fl_add_signal_callback", "Can't add handler for " "signal %d", s ); fl_free( sig_rec ); return; } } if ( fli_context->signal_rec ) sig_rec->next = fli_context->signal_rec; fli_context->signal_rec = sig_rec; } } /*************************************** ***************************************/ void fl_remove_signal_callback( int s ) { FLI_SIGNAL_REC *last, *rec = fli_context->signal_rec; for ( last = rec; rec && rec->signum != s; last = rec, rec = rec->next ) /* empty */ ; if ( ! rec ) { M_err( "fl_remove_signal_callback", "No handler exists for signal %d", s ); return; } if ( rec == fli_context->signal_rec ) fli_context->signal_rec = rec->next; else last->next = rec->next; if ( ! sig_direct ) { #if defined HAVE_SIGACTION sigaction( s, &rec->old_sigact, NULL ); #else signal( s, rec->ocallback ); #endif } fli_safe_free( rec ); } /*************************************** ***************************************/ void fl_signal_caught( int s ) { FLI_SIGNAL_REC *rec = fli_context->signal_rec; while ( rec && rec->signum != s ) rec = rec->next; if ( ! rec ) { M_err( "fl_signal_caught", "Caught bogus signal %d", s ); return; } rec->caught++; #if ! defined HAVE_SIGACTION if ( ! sig_direct && ! IsDangerous( s ) ) signal( s, default_signal_handler ); #endif } /*************************************** ***************************************/ void fl_app_signal_direct( int y ) { if ( ! fli_handle_signal ) fli_handle_signal = handle_signal; sig_direct = y; } /*************************************** ***************************************/ void fli_remove_all_signal_callbacks( void ) { while ( fli_context->signal_rec ) fl_remove_signal_callback( fli_context->signal_rec->signum ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/pixmap.c0000664000175000017500000006436512353623325012211 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file pixmap.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao * All rights reserved. * * Pixmap support. In order to take advantage of Xpm3.4g features, * we need both XpmRevision and XpmLibraryVersion check */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include XPM_H_LOCATION #if FL_DEBUG >= ML_ERR #define CHECK( obj, f ) \ if ( ! IsValidClass( ( obj ), FL_PIXMAP ) \ && ! IsValidClass( ( obj ), FL_PIXMAPBUTTON ) ) \ { \ M_err( f, "%s is not Pixmap/pixmapbutton class", \ ( ( obj ) && ( obj )->label ) ? ( obj )->label : "" ); \ return; \ } #else #define CHECK( obj, f ) #endif typedef struct { XpmAttributes * xpma; GC gc; int align; int dx, dy; int show_focus; unsigned int focus_w, /* these should be in button_spec */ focus_h; } PixmapSPEC; static XpmAttributes *xpmattrib; /*************************************** * Part of pixmap cleanup ***************************************/ static void cleanup_xpma_struct( XpmAttributes * xpma ) { /* Only versions >= 3.4g have alloc_pixels. We always compile with 3.4g but have to re-act to dynamic libraries, which may be older */ if ( ! xpma || ! xpma->colormap ) return; /* do we use at least libXpm 3.4g? */ #if XpmFormat >= 3 && XpmVersion >= 4 && XpmRevision >= 7 M_warn( "cleanup_xpma_struct", "Using 3.4g features" ); XFreeColors( flx->display, xpma->colormap, xpma->alloc_pixels, xpma->nalloc_pixels, 0 ); #else /* somewhat dangerous */ M_warn( "cleanup_xpma_struct", "Using old xpm libs" ); XFreeColors( flx->display, xpma->colormap, xpma->pixels, xpma->npixels, 0 ); #endif xpma->colormap = None; XpmFreeAttributes( xpma ); fl_free( xpma ); } /*************************************** * Free pixmaps associated with an object ***************************************/ static void free_pixmap( FL_BUTTON_STRUCT * sp ) { PixmapSPEC *psp = sp->cspecv; fl_free_pixmap( sp->pixmap ); fl_free_pixmap( sp->mask ); cleanup_xpma_struct( psp->xpma ); psp->xpma = NULL; sp->pixmap = None; sp->mask = None; } /*************************************** ***************************************/ static void free_focuspixmap( FL_BUTTON_STRUCT * sp ) { fl_free_pixmap( sp->focus_pixmap ); fl_free_pixmap( sp->focus_mask ); sp->focus_pixmap = None; sp->focus_mask = None; } /*************************************** * Change pixmap/mask. del==true means we want to destroy old pixmaps ***************************************/ static void change_pixmap( FL_BUTTON_STRUCT * sp, Window win, Pixmap p, Pixmap shape_mask, int del ) { PixmapSPEC *psp = sp->cspecv; if ( p == None || win == None ) return; if ( del ) free_pixmap( sp ); else { cleanup_xpma_struct( psp->xpma ); psp->xpma = NULL; } sp->pixmap = p; sp->mask = shape_mask; M_warn( "change_pixmap", "Pixmap = %ld mask = %ld win = %ld", p, shape_mask, win ); if ( psp->gc == None ) { psp->gc = XCreateGC( flx->display, win, 0, NULL ); XSetGraphicsExposures( flx->display, psp->gc, False ); } XSetClipMask( flx->display, psp->gc, sp->mask ); } /*************************************** * Change pixmap/mask. If 'del' is set destroy teh old pixmaps ***************************************/ static void change_focuspixmap( FL_BUTTON_STRUCT * sp, Window win FL_UNUSED_ARG, Pixmap p, Pixmap shape_mask, int del ) { if ( del ) free_focuspixmap( sp ); sp->focus_pixmap = p; sp->focus_mask = shape_mask; } /*************************************** ***************************************/ static void show_pixmap( FL_OBJECT * obj, int focus ) { FL_BUTTON_STRUCT *sp = obj->spec; PixmapSPEC *psp = sp->cspecv; int dest_x, dest_y, dest_w, dest_h, src_x, src_y, m_dest_x, m_dest_y; FL_Coord clip_x, clip_y, clip_w, clip_h; Pixmap pixmap, mask; int bits_w, bits_h, is_focus = focus && sp->focus_pixmap && psp->show_focus; int bw = FL_abs( obj->bw ); pixmap = is_focus ? sp->focus_pixmap : sp->pixmap; mask = is_focus ? sp->focus_mask : sp->mask; bits_w = is_focus ? psp->focus_w : sp->bits_w; bits_h = is_focus ? psp->focus_h : sp->bits_h; /* Do nothing if pixmap does not exist or has zero size */ if ( pixmap == None || bits_w == 0 || bits_h == 0 ) { fl_draw_text( FL_ALIGN_CENTER, obj->x, obj->y, obj->w, obj->h, obj->lcol, obj->lstyle, FL_TINY_SIZE, "p" ); return; } m_dest_x = dest_x = obj->x + bw + psp->dx; m_dest_y = dest_y = obj->y + bw + psp->dy; dest_w = obj->w - 2 * bw - 2 * psp->dx; dest_h = obj->h - 2 * bw - 2 * psp->dy; src_x = 0; src_y = 0; if ( dest_w > bits_w ) { if ( ! ( psp->align & ( FL_ALIGN_LEFT | FL_ALIGN_RIGHT ) ) ) m_dest_x = dest_x += ( dest_w - bits_w ) / 2; else if ( psp->align & FL_ALIGN_RIGHT ) m_dest_x = dest_x += dest_w - bits_w; dest_w = bits_w; } else { if ( ! ( psp->align & ( FL_ALIGN_LEFT | FL_ALIGN_RIGHT ) ) ) src_x = ( bits_w - dest_w ) / 2; else if ( psp->align & FL_ALIGN_RIGHT ) src_x = bits_w - dest_w; m_dest_x -= src_x; } if ( dest_h > bits_h ) { if ( ! ( psp->align & ( FL_ALIGN_TOP | FL_ALIGN_BOTTOM ) ) ) m_dest_y = dest_y += ( dest_h - bits_h ) / 2; else if ( psp->align & FL_ALIGN_BOTTOM ) m_dest_y = dest_y += dest_h - bits_h; dest_h = bits_h; } else { if ( ! ( psp->align & ( FL_ALIGN_TOP | FL_ALIGN_BOTTOM ) ) ) src_y = ( bits_h - dest_h ) / 2; else if ( psp->align & FL_ALIGN_BOTTOM ) src_y = bits_h - dest_h; m_dest_y -= src_y; } /* Get the currently set clipping */ if ( fl_get_clipping( 1, &clip_x, &clip_y, &clip_w, &clip_h ) ) { if ( clip_w <= 0 || clip_h <= 0 ) return; /* If the pixmap is not within the clipping region nothing is to be drawn */ if ( dest_x + dest_w < clip_x || dest_x > clip_x + clip_w || dest_y + dest_h < clip_y || dest_y > clip_y + clip_h ) return; /* If the pixmap isn't completely within the clipping region recalculate what to draw */ if ( dest_x <= clip_x || dest_x + dest_w >= clip_x + clip_w || dest_y <= clip_y || dest_y + dest_h >= clip_y + clip_h ) { if ( dest_x < clip_x ) { src_x += clip_x - dest_x; dest_w -= clip_x - dest_x; dest_x = clip_x; } if ( dest_x + dest_w > clip_x + clip_w ) dest_w = clip_x + clip_w - dest_x; if ( dest_y < clip_y ) { src_y += clip_y - dest_y; dest_h -= clip_y - dest_y; dest_y = clip_y; } if ( dest_y + dest_h > clip_y + clip_h ) dest_h = clip_y + clip_h - dest_y; } } /* Hopefully, XSetClipMask is smart */ XSetClipMask( flx->display, psp->gc, mask ); XSetClipOrigin( flx->display, psp->gc, m_dest_x, m_dest_y ); XCopyArea( flx->display, pixmap, FL_ObjWin( obj ), psp->gc, src_x, src_y, dest_w, dest_h, dest_x, dest_y ); } static int red_closeness = 40000; static int green_closeness = 30000; static int blue_closeness = 50000; /*************************************** * Basic attributes ***************************************/ static void init_xpm_attributes( Window win, XpmAttributes * xpma, FL_COLOR tran ) { XWindowAttributes xwa; XGetWindowAttributes( flx->display, win, &xwa ); xpma->valuemask = XpmVisual | XpmDepth | XpmColormap; xpma->depth = xwa.depth; xpma->visual = xwa.visual; xpma->colormap = xwa.colormap; xpma->valuemask |= XpmRGBCloseness; xpma->red_closeness = red_closeness; xpma->green_closeness = green_closeness; xpma->blue_closeness = blue_closeness; #if XpmRevision >= 7 xpma->valuemask |= XpmReturnPixels | XpmReturnAllocPixels; #else xpma->valuemask |= XpmReturnPixels; #endif { static XpmColorSymbol xpcm[ 2 ]; xpcm[ 0 ].name = "None"; xpcm[ 0 ].value = 0; xpcm[ 0 ].pixel = fl_get_flcolor( tran ); xpcm[ 1 ].name = "opaque"; xpcm[ 1 ].value = 0; xpcm[ 1 ].pixel = fl_get_flcolor( FL_BLACK ); xpma->valuemask |= XpmColorSymbols; xpma->colorsymbols = xpcm; xpma->numsymbols = 2; } } /********************************************************************** * Static PIXMAP ******************************************************************{**/ static void draw_pixmap( FL_OBJECT * obj ) { /* Draw the box */ fl_draw_box( obj->boxtype, obj->x, obj->y, obj->w, obj->h, obj->col2, obj->bw ); show_pixmap( obj, 0 ); } /*************************************** ***************************************/ static int handle_pixmap( FL_OBJECT * obj, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { FL_BUTTON_STRUCT *sp = obj->spec; #if FL_DEBUG >= ML_DEBUG M_info( "handle_pixmap", fli_event_name( event ) ); #endif switch ( event ) { case FL_DRAW: draw_pixmap( obj ); /* fall through */ case FL_DRAWLABEL: fl_draw_object_label( obj ); break; case FL_FREEMEM: free_pixmap( obj->spec ); if ( ( ( PixmapSPEC * ) sp->cspecv )->gc ) XFreeGC( flx->display, ( ( PixmapSPEC * ) sp->cspecv )->gc ); fli_safe_free( sp->cspecv ); fli_safe_free( obj->spec ); break; } return FL_RETURN_NONE; } /*************************************** * Creates a pixmap object ***************************************/ FL_OBJECT * fl_create_pixmap( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; FL_BUTTON_STRUCT *sp; PixmapSPEC *psp; obj = fl_make_object( FL_PIXMAP, type, x, y, w, h, label, handle_pixmap ); obj->boxtype = FL_BITMAP_BOXTYPE; obj->col1 = FL_BITMAP_COL1; obj->col2 = FL_BITMAP_COL2; obj->lcol = FL_BITMAP_LCOL; obj->align = FL_BITMAP_ALIGN; obj->active = type != FL_NORMAL_BITMAP; obj->spec = sp = fl_calloc( 1, sizeof *sp ); sp->bits_w = 0; sp->cspecv = psp = fl_calloc( 1, sizeof *psp ); psp->dx = psp->dy = 0; psp->align = FL_ALIGN_CENTER; return obj; } /*************************************** * Adds a pixmap object ***************************************/ FL_OBJECT * fl_add_pixmap( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj = fl_create_pixmap( type, x, y, w, h, label ); fl_add_object( fl_current_form, obj ); return obj; } /*************************************** ***************************************/ Pixmap fl_create_from_pixmapdata( Window win, char ** data, unsigned int * w, unsigned int * h, Pixmap * sm, int * hotx, int * hoty, FL_COLOR tran ) { Pixmap p = None; int s; /* This ensures we do not depend on the header/dl having the same size */ xpmattrib = fl_calloc( 1, XpmAttributesSize( ) ); init_xpm_attributes( win, xpmattrib, tran ); s = XpmCreatePixmapFromData( flx->display, win, data, &p, sm, xpmattrib ); if ( s != XpmSuccess ) { errno = 0; M_err( "fl_create_from_pixmapdata", "error converting: %s", ( s == XpmOpenFailed ? "(Can't open)" : ( s == XpmFileInvalid ? "(Invalid file)" : ( s == XpmColorFailed ? "(Can't get color)" : "" ) ) ) ); if ( s < 0 ) { fl_free( xpmattrib ); return None; } } if ( p != None ) { *w = xpmattrib->width; *h = xpmattrib->height; if ( hotx ) *hotx = xpmattrib->x_hotspot; if ( hoty ) *hoty = xpmattrib->y_hotspot; } else fl_free( xpmattrib ); return p; } /*************************************** ***************************************/ void fl_set_pixmap_pixmap( FL_OBJECT * obj, Pixmap id, Pixmap mask ) { FL_BUTTON_STRUCT *sp; FL_Coord w = 0, h = 0; CHECK( obj, "fl_set_pixmap_pixmap" ); sp = obj->spec; change_pixmap( sp, FL_ObjWin( obj ), id, mask, 0 ); /* 0 don't free old */ if ( sp->pixmap != None ) fl_get_winsize( sp->pixmap, &w, &h ); sp->bits_w = w; sp->bits_h = h; fl_redraw_object( obj ); } /*************************************** ***************************************/ Pixmap fl_get_pixmap_pixmap( FL_OBJECT * obj, Pixmap * p, Pixmap * m ) { FL_BUTTON_STRUCT *sp; if ( ! IsValidClass( obj, FL_PIXMAP ) && ! IsValidClass( obj, FL_PIXMAPBUTTON ) ) { M_err( "fl_get_pixmap_pixmap", "%s is not Pixmap/pixmapbutton class", ( obj && obj->label ) ? obj->label : "" ); return None; } sp = obj->spec; /* pixmapbutton and pixmap use the same structure */ *p = sp->pixmap; if ( m ) *m = sp->mask; return sp->pixmap; } /*************************************** * Generic routine to read a pixmap file. ***************************************/ Pixmap fl_read_pixmapfile( Window win, const char * file, unsigned int * w, unsigned int * h, Pixmap * shape_mask, int * hotx, int * hoty, FL_COLOR tran ) { Pixmap p = None; int s; xpmattrib = fl_calloc( 1, XpmAttributesSize( ) ); init_xpm_attributes( win, xpmattrib, tran ); s = XpmReadFileToPixmap( flx->display, win, ( char * ) file, &p, shape_mask, xpmattrib ); if ( s != XpmSuccess ) { errno = 0; M_err( "fl_read_pixmapfile", "error reading %s %s", file, ( s == XpmOpenFailed ? "(Can't open)" : ( s == XpmFileInvalid ? "(Invalid file)" : ( s == XpmColorFailed ? "(Can't get color)" : "" ) ) ) ); if ( s < 0 ) { fl_free( xpmattrib ); return None; } } if ( p != None ) { *w = xpmattrib->width; *h = xpmattrib->height; if ( hotx ) *hotx = xpmattrib->x_hotspot; if ( hoty ) *hoty = xpmattrib->y_hotspot; } else fl_free( xpmattrib ); return p; } /*************************************** ***************************************/ void fl_set_pixmap_file( FL_OBJECT * obj, const char * fname ) { Pixmap p = None, shape_mask = None; FL_BUTTON_STRUCT *sp; int hotx, hoty; Window win; if ( ! flx || ! flx->display ) return; CHECK( obj, "fl_set_pixmap_file" ); sp = obj->spec; win = FL_ObjWin( obj ) ? FL_ObjWin( obj ) : fl_default_win( ); p = fl_read_pixmapfile( win, fname, &sp->bits_w, &sp->bits_h, &shape_mask, &hotx, &hoty, obj->col1 ); if ( p != None ) { change_pixmap( sp, win, p, shape_mask, 0 ); ( ( PixmapSPEC * ) sp->cspecv )->xpma = xpmattrib; fl_redraw_object( obj ); } } /******** End of static pixmap ************************}*/ /***************************************************************** * Pixmap button ***********************************************************{****/ #define IsFlat( t ) ( ( t ) == FL_FLAT_BOX \ || ( t ) == FL_FRAME_BOX \ || ( t ) == FL_BORDER_BOX ) /*************************************** ***************************************/ static void draw_pixmapbutton( FL_OBJECT * obj ) { FL_BUTTON_STRUCT *sp = obj->spec; PixmapSPEC *psp = sp->cspecv; /* Draw it like a "normal button */ fli_draw_button( obj ); /* Add the pixmap on top of it */ switch ( sp->event ) { case FL_ENTER: if ( psp->show_focus ) show_pixmap( obj, 1 ); else show_pixmap( obj, 0 ); break; case FL_LEAVE: show_pixmap( obj, 0 ); break; default: show_pixmap( obj, obj->belowmouse && psp->show_focus ); break; } fl_draw_object_label( obj ); } /*************************************** * button driver will clean up spec after this function returns ***************************************/ static void cleanup_pixmapbutton( FL_BUTTON_STRUCT *sp ) { PixmapSPEC *psp = sp->cspecv; if ( psp->gc ) { XFreeGC( flx->display, psp->gc ); psp->gc = None; } if ( psp->xpma ) { cleanup_xpma_struct( psp->xpma ); psp->xpma = NULL; } if ( sp->cspecv ) { fl_free( sp->cspecv ); sp->cspecv = NULL; } } /*************************************** ***************************************/ FL_OBJECT * fl_create_pixmapbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; static int class_init; FL_BUTTON_STRUCT *sp; PixmapSPEC *psp; if ( ! class_init ) { fl_add_button_class( FL_PIXMAPBUTTON, draw_pixmapbutton, cleanup_pixmapbutton ); class_init = 1; } obj = fl_create_generic_button( FL_PIXMAPBUTTON, type, x, y, w, h, label ); obj->boxtype = FL_PIXMAPBUTTON_BOXTYPE; obj->col1 = FL_PIXMAPBUTTON_COL1; obj->col2 = FL_PIXMAPBUTTON_COL2; obj->align = FL_PIXMAPBUTTON_ALIGN; obj->lcol = FL_PIXMAPBUTTON_LCOL; sp = obj->spec; /* allocated in fl_create_generic_button() */ sp->cspecv = psp = fl_calloc( 1, sizeof *psp ); psp->show_focus = 1; psp->align = FL_ALIGN_CENTER; psp->dx = psp->dy = 3; return obj; } /*************************************** ***************************************/ FL_OBJECT * fl_add_pixmapbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; obj = fl_create_pixmapbutton( type, x, y, w, h, label ); fl_add_object( fl_current_form, obj ); return obj; } /*************************************** ***************************************/ void fl_set_pixmap_data( FL_OBJECT * obj, char ** bits ) { FL_BUTTON_STRUCT *sp; Window win; Pixmap p, shape_mask = None; int hx, hy; CHECK( obj, "fl_set_pixmap_data" ); if ( ! flx->display ) return; sp = obj->spec; win = FL_ObjWin( obj ) ? FL_ObjWin( obj ) : fl_default_win( ); p = fl_create_from_pixmapdata( win, bits, &sp->bits_w, &sp->bits_h, &shape_mask, &hx, &hy, obj->col1 ); if ( p != None ) { change_pixmap( sp, win, p, shape_mask, 0 ); ( ( PixmapSPEC * ) sp->cspecv )->xpma = xpmattrib; fl_redraw_object( obj ); } } /*************************************** ***************************************/ void fl_set_pixmap_colorcloseness( int red, int green, int blue ) { red_closeness = red; green_closeness = green; blue_closeness = blue; } /****************** End of pixmap stuff ************}**/ /*************************************** ***************************************/ void fl_set_pixmap_align( FL_OBJECT * obj, int align, int xmargin, int ymargin ) { FL_BUTTON_STRUCT *sp; PixmapSPEC *psp; CHECK( obj, "fl_set_pixmap_align" ); sp = obj->spec; psp = sp->cspecv; if ( align != psp->align || xmargin != psp->dx || ymargin != psp->dy ) { psp->align = align; psp->dx = xmargin; psp->dy = ymargin; fl_redraw_object( obj ); } } /*************************************** ***************************************/ void fl_set_pixmapbutton_focus_pixmap( FL_OBJECT * obj, Pixmap id, Pixmap mask ) { FL_BUTTON_STRUCT *sp = obj->spec; PixmapSPEC *psp = sp->cspecv; int w, h; CHECK( obj, "fl_set_pixmapbutton_focus_pixmap" ); change_focuspixmap( sp, FL_ObjWin( obj ), id, mask, 0 ); if ( sp->focus_pixmap != None ) { fl_get_winsize( sp->focus_pixmap, &w, &h ); psp->focus_w = w; psp->focus_h = h; } } /*************************************** ***************************************/ void fl_set_pixmapbutton_focus_data( FL_OBJECT * obj, char ** bits ) { FL_BUTTON_STRUCT *sp; PixmapSPEC *psp; Window win; Pixmap p, shape_mask = None; int hx, hy; CHECK( obj, "fl_set_pixmapbutton_focus_data" ); if ( ! flx->display ) return; sp = obj->spec; psp = sp->cspecv; win = FL_ObjWin( obj ) ? FL_ObjWin( obj ) : fl_default_win( ); p = fl_create_from_pixmapdata( win, bits, &psp->focus_w, &psp->focus_h, &shape_mask, &hx, &hy, obj->col1 ); if ( p != None ) { change_focuspixmap( sp, win, p, shape_mask, 0 ); ( ( PixmapSPEC * ) sp->cspecv )->xpma = xpmattrib; } } /*************************************** ***************************************/ void fl_set_pixmapbutton_focus_file( FL_OBJECT * obj, const char * fname ) { Pixmap p, shape_mask = None; FL_BUTTON_STRUCT *sp; int hotx, hoty; Window win; PixmapSPEC *psp; if ( ! flx->display ) return; sp = obj->spec; psp = sp->cspecv; win = FL_ObjWin( obj ) ? FL_ObjWin( obj ) : fl_default_win( ); p = fl_read_pixmapfile( win, fname, &psp->focus_w, &psp->focus_h, &shape_mask, &hotx, &hoty, obj->col1 ); if ( p != None ) { change_focuspixmap( sp, win, p, shape_mask, 0 ); fl_free( xpmattrib ); } } /*************************************** ***************************************/ void fl_set_pixmapbutton_focus_outline( FL_OBJECT * obj, int yes_no ) { FL_BUTTON_STRUCT *sp; PixmapSPEC *psp; CHECK( obj, "fl_set_pixmapbutton_focus_outline" ); sp = obj->spec; psp = sp->cspecv; psp->show_focus = yes_no; } /*************************************** ***************************************/ void fl_free_pixmap_pixmap( FL_OBJECT * obj ) { CHECK( obj, "fl_free_pixmap_pixmap" ); free_pixmap( obj->spec ); } /*************************************** ***************************************/ void fl_free_pixmap_focus_pixmap( FL_OBJECT * obj ) { CHECK( obj, "fl_free_pixmap_focus_pixmap" ); free_focuspixmap( obj->spec ); } /*************************************** * This can't go into forms.c as it will pull xpm into * programs that don't need it ***************************************/ void fli_set_form_icon_data( FL_FORM * form, char ** data ) { Pixmap p, s = None; unsigned int j; p = fl_create_from_pixmapdata( fl_root, data, &j, &j, &s, NULL, NULL, 0 ); if ( p != None ) { fl_set_form_icon( form, p, s ); fl_free( xpmattrib ); } } /*************************************** ***************************************/ void fl_free_pixmap( Pixmap id ) { if ( id != None ) XFreePixmap( fl_display, id ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/util.c0000664000175000017500000001437312353623326011663 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file util.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * X independent utilities */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include #include #include /*************************************** * Returns if two objects are the same - not of any use normally, * but seems to help with the Python port (so don't use it for * anything else, it might be gone if it should not needed for * the Python port anymore) ***************************************/ int fl_is_same_object( FL_OBJECT * obj1, FL_OBJECT * obj2 ) { return obj1 == obj2; } /*************************************** * Sets the form window ***************************************/ void fli_set_form_window( FL_FORM * form ) { if ( form && form->window != None ) flx->win = form->window; } /*************************************** * Function is kept only for backward compatibility ***************************************/ void fl_show_errors( int y FL_UNUSED_ARG ) { } /*************************************** * Convenience replacement for XFlush() ***************************************/ void fl_XFlush( void ) { XFlush( fl_display ); } /*************************************** * For debugging ***************************************/ #define VN( v ) { v, #v } static FLI_VN_PAIR flevent[ ] = { VN( FL_ENTER ), VN( FL_LEAVE ), VN( FL_PUSH ), VN( FL_RELEASE ), VN( FL_STEP ), VN( FL_SHORTCUT ), VN( FL_UPDATE ), VN( FL_MOTION ), VN( FL_KEYPRESS ), VN( FL_DRAW ), VN( FL_FOCUS ), VN( FL_UNFOCUS ), VN( FL_FREEMEM ), VN( FL_DRAWLABEL ), VN( FL_DBLCLICK ), VN( FL_OTHER ), VN( FL_ATTRIB ), { -1, NULL } }; /*************************************** ***************************************/ const char * fli_event_name( int ev ) { return fli_get_vn_name( flevent, ev ); } static FLI_VN_PAIR flclass[ ] = { VN( FL_BUTTON ), VN( FL_LIGHTBUTTON ), VN( FL_ROUNDBUTTON ), VN( FL_ROUND3DBUTTON ), VN( FL_CHECKBUTTON ), VN( FL_BITMAPBUTTON ), VN( FL_PIXMAPBUTTON ), VN( FL_BITMAP ), VN( FL_PIXMAP ), VN( FL_BOX ), VN( FL_TEXT ), VN( FL_MENU ), VN( FL_CHART ), VN( FL_CHOICE ), VN( FL_COUNTER ), VN( FL_SLIDER ), VN( FL_VALSLIDER ), VN( FL_INPUT ), VN( FL_BROWSER ), VN( FL_DIAL ), VN( FL_TIMER ), VN( FL_CLOCK ), VN( FL_POSITIONER ), VN( FL_FREE ), VN( FL_XYPLOT ), VN( FL_FRAME ), VN( FL_LABELFRAME ), VN( FL_CANVAS ), VN( FL_GLCANVAS ), VN( FL_TABFOLDER ), VN( FL_SCROLLBAR ), VN( FL_SCROLLBUTTON ), VN( FL_MENUBAR ), VN( FL_IMAGECANVAS ), VN( FL_TEXTBOX ), VN( FL_SPINNER ), { -1, NULL } }; /*************************************** ***************************************/ const char * fli_object_class_name( FL_OBJECT * ob ) { if ( ! ob ) return "null"; else if ( ob == FL_EVENT ) return "FL_EVENT"; return fli_get_vn_name( flclass, ob->objclass ); } /*************************************** * Function tries to read a line (of arbirary length) from a file * On failure (either due to read error or missing memory) NULL is * returned, otherwise a pointer to an allocated buffer that must * be freed by the caller. ***************************************/ #define STRING_TRY_LENGTH 128 char * fli_read_line( FILE *fp ) { char *line = NULL; char *old_line = NULL; size_t len = STRING_TRY_LENGTH; size_t old_len = 0; while ( 1 ) { if ( ( line = fl_realloc( line, len ) ) == NULL ) { fli_safe_free( old_line ); M_err( "fli_read_line", "Running out of memory\n" ); return NULL; } if ( ! fgets( line + old_len, len - old_len, fp ) ) { if ( ferror( fp ) ) { M_err( "fli_read_line", "Failed to read from file" ); fl_free( line ); return NULL; } if ( old_len == 0 ) { fl_free( line ); return NULL; } M_warn( "fli_read_line", "Missing newline at end of line" ); break; } if ( strchr( line + old_len, '\n' ) ) break; old_line = line; old_len = len - 1; len *= 2; } old_line = line; if ( ( line = fl_realloc( line, strlen( line ) + 1 ) ) == NULL ) return old_line; return line; } /******************************************* * Secure string copy: a maximum of (n-1) bytes will be copied, the * destination string is always ends in a '\0'. * Returns: dest or NULL if src or dest are NULL or n is 0 *******************************************/ char * fli_sstrcpy( char * dest, const char * src, size_t n ) { size_t l = src ? strlen( src ) : 0; if ( ! src || ! dest || n == 0 ) return NULL; if ( l < n ) memcpy( dest, src, l + 1 ); else { memcpy( dest, src, n - 1 ); dest[ n - 1 ] = '\0'; } return dest; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/goodie_choice.c0000644000175000017500000001657712251554176013477 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file goodie_choice.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/flsnprintf.h" /****************** Make a choice ***********************{**/ typedef struct { FL_FORM * form; FL_OBJECT * str; FL_OBJECT * but[ 3 ]; const char * sc[ 3 ]; } FD_choice; static FD_choice *fd_choice; static int default_choice; /*************************************** ***************************************/ static FD_choice * create_choice( void ) { FD_choice *fdui = fl_malloc( sizeof *fdui ); int oldy = fli_inverted_y; int oldu = fl_get_coordunit(); fli_inverted_y = 0; fl_set_coordunit( FL_COORD_PIXEL ); fdui->form = fl_bgn_form( FL_FLAT_BOX, 460, 130 ); fl_set_form_title( fdui->form, "Choice" ); fdui->str = fl_add_box( FL_FLAT_BOX, 20, 15, 420, 65, "" ); fdui->but[ 0 ] = fl_add_button( FL_NORMAL_BUTTON, 40, 93, 90, 27, "" ); fdui->but[ 1 ] = fl_add_button( FL_NORMAL_BUTTON, 185, 93, 90, 27, "" ); fdui->but[ 2 ] = fl_add_button( FL_NORMAL_BUTTON, 330, 93, 90, 27, "" ); fdui->sc[ 0 ] = fl_strdup( "1" ); fdui->sc[ 1 ] = fl_strdup( "2" ); fdui->sc[ 2 ] = fl_strdup( "3" ); fl_end_form( ); fli_inverted_y = oldy; fl_set_coordunit( oldu ); return fdui; } /*************************************** ***************************************/ int fl_show_choices( const char * msg, int numb, const char * c0, const char * c1, const char * c2, int def ) { FL_OBJECT *retobj; const char *c[ ] = { c0, c1, c2 }; int i; if ( ! fd_choice ) fd_choice = create_choice( ); fli_handle_goodie_font( fd_choice->but[ 0 ], fd_choice->but[ 1 ] ); fli_handle_goodie_font( fd_choice->but[ 2 ], fd_choice->str ); fl_set_object_label( fd_choice->str, msg ); fl_hide_object( fd_choice->but[ 0 ] ); fl_hide_object( fd_choice->but[ 1 ] ); fl_hide_object( fd_choice->but[ 2 ] ); default_choice = def; switch ( numb ) { case 3: for ( i = 0; i < 3; i++ ) { fl_set_object_label( fd_choice->but[ i ], c[ i ] ); fl_set_object_shortcut( fd_choice->but[ i ], fd_choice->sc[ i ], 1 ); fl_show_object( fd_choice->but[ i ] ); fl_fit_object_label( fd_choice->but[ i ], 1, 1 ); } break; case 2: /* pick button 0 and 2 */ fl_set_object_label( fd_choice->but[ 0 ], c[ 0 ] ); fl_set_object_shortcut( fd_choice->but[ 0 ], fd_choice->sc[ 0 ], 1 ); fl_show_object( fd_choice->but[ 0 ] ); fl_fit_object_label( fd_choice->but[ 0 ], 1, 1 ); fl_set_object_label( fd_choice->but[ 2 ], c[ 1 ] ); fl_set_object_shortcut( fd_choice->but[ 2 ], fd_choice->sc[ 2 ], 1 ); fl_show_object( fd_choice->but[ 2 ] ); fl_fit_object_label( fd_choice->but[ 2 ], 1, 1 ); break; case 1: fl_set_object_label( fd_choice->but[ 0 ], c[ 0 ] ); fl_set_object_shortcut( fd_choice->but[ 0 ], fd_choice->sc[ 0 ], 1 ); fl_show_object( fd_choice->but[ 0 ] ); fl_fit_object_label( fd_choice->but[ 0 ], 1, 1 ); break; default: return 0; } fli_get_goodie_title( fd_choice->form, FLChoiceTitle ); if ( ! fd_choice->form->visible ) fl_deactivate_all_forms( ); if ( def > 0 && def <= 3 ) fl_set_form_hotobject( fd_choice->form, fd_choice->but[ def - 1 ] ); else fl_set_form_hotspot( fd_choice->form, -1, -1 ); fl_show_form( fd_choice->form, FL_PLACE_HOTSPOT, FL_TRANSIENT, fd_choice->form->label ); fl_update_display( 0 ); retobj = fl_do_only_forms( ); fl_hide_form( fd_choice->form ); fl_activate_all_forms( ); return retobj == fd_choice->but[ 0 ] ? 1 : ( ( retobj == fd_choice->but[ 1 ] || numb == 2 ) ? 2 : 3); } /*************************************** ***************************************/ int fl_show_choice( const char * m1, const char * m2, const char * m3, int numb, const char * c1, const char * c2, const char * c3, int def ) { char *buf; size_t len; int ret; len = ( m1 ? strlen( m1 ) : 0 ) + 1 + ( m2 ? strlen( m2 ) : 0 ) + 1 + ( m3 ? strlen( m3 ) : 0 ) + 1; if ( len == 3 ) { M_warn( "fl_show_choice", "Only NULL or empty strings" ); return 0; } buf = fl_malloc( len ); sprintf( buf, "%s\n%s\n%s", m1 ? m1 : "", m2 ? m2 : "", m3 ? m3 : "" ); ret = fl_show_choices( buf, numb, c1, c2, c3, def ); fl_free( buf ); return ret; } /*************************************** ***************************************/ void fl_set_choices_shortcut( const char * a, const char * b, const char * c ) { if ( ! fd_choice ) fd_choice = create_choice( ); if ( fd_choice->sc[ 0 ] ) fl_free( ( char * ) fd_choice->sc[ 0 ] ); fd_choice->sc[ 0 ] = ( a && *a ) ? fl_strdup( a ) : NULL; if ( fd_choice->sc[ 1 ] ) fl_free( ( char * ) fd_choice->sc[ 1 ] ); fd_choice->sc[ 1 ] = ( b && *b ) ? fl_strdup( b ) : NULL; if ( fd_choice->sc[ 2 ] ) fl_free( ( char * ) fd_choice->sc[ 2 ] ); fd_choice->sc[ 2 ] = ( c && *c ) ? fl_strdup( c ) : NULL; } /*************************************** ***************************************/ void fl_hide_choice( void ) { if ( fd_choice && fd_choice->form->visible ) { if ( default_choice <= 0 || default_choice > 3 ) default_choice = 1; fl_trigger_object( fd_choice->but[ default_choice ] ); } } /*************************************** ***************************************/ void fli_choice_cleanup( void ) { if ( ! fd_choice ) return; if ( fd_choice->sc[ 0 ] ) fl_free( ( char * ) fd_choice->sc[ 0 ] ); if ( fd_choice->sc[ 1 ] ) fl_free( ( char * ) fd_choice->sc[ 1 ] ); if ( fd_choice->sc[ 2 ] ) fl_free( ( char * ) fd_choice->sc[ 2 ] ); fli_safe_free( fd_choice ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/thumbwheel.c0000664000175000017500000003344012353623326013046 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file thumbwheel.c * * This file is part of the XForms library package. * Copyright (c) 1998-2002 T.C. Zhao * All rights reserved. * * The thumbwheel * * TODO: cursor keys * home key * do we need increments a la slider? */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include #include "private/ptwheel.h" #ifndef M_PI #define M_PI 3.14159265359 #endif static const double arc = ( M_PI * 0.48 ); /* about 90 degrees */ #define GRID 0.190 /* angular grid for ridges */ #define NEAR 600.0 /* near plane distance */ #define DEFSTEP 0.005 /*************************************** ***************************************/ static void draw( FL_OBJECT * ob ) { int h2 = ob->h / 2, w2 = ob->w / 2; int absbw = FL_abs( ob->bw ); double delta = GRID - ( ( h2 + w2 ) > 300 ? 0.02 : 0.0 ); FLI_THUMBWHEEL_SPEC *sp = ob->spec; double yo = ob->y + h2; double x0 = ob->x + w2; int x, y, w, h; double theta; double dx, dy; double offset = sp->val / ( sp->step == 0.0 ? DEFSTEP : sp->step ); double junk; FL_COLOR c1, c2; if ( sp->draw_type == COMPLETE_DRAW ) fl_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); x = ob->x + absbw; y = ob->y + absbw; w = ob->w - 2 * absbw; h = ob->h - 2 * absbw; if ( ob->type == FL_VERT_THUMBWHEEL ) { double extra = h2 * ( NEAR / ( NEAR - h2 ) - 0.96 ); /* (Fake) depth-cue */ fl_rectf( x, y + 1, w, h - 2, FL_DARKER_COL1 ); fl_rectf( x, yo - ob->h / 4, w, ob->h / 2, FL_COL1 ); fl_rectf( x, yo - ob->h / 10, w, ob->h / 5, FL_LIGHTER_COL1 ); for ( theta = arc - modf( offset / delta, &junk ); theta > -arc; theta -= delta ) { dy = ( h2 + extra ) * sin( theta ); dx = ob->h - ( h2 + extra ) * cos( theta ); y = yo + FL_nint( dy * NEAR / ( NEAR + dx ) ); if ( y > ob->y + 3 && y < ob->y + ob->h - 3 ) { int d = 1; if ( y < yo + h2 / 4 && y > yo - h2 / 4 ) { c1 = FL_LEFT_BCOL; c2 = FL_RIGHT_BCOL; } else if ( y < ob->y + h2 / 5 || y > yo + h2 - h2 / 5 ) { c1 = FL_LIGHTER_COL1; c2 = FL_BOTTOM_BCOL; d = 0; } else { c1 = FL_MCOL; c2 = FL_BOTTOM_BCOL; } fl_line( x + 1, y - 1, x + w - 2, y - 1, c1 ); fl_line( x + 1, y + d, x + w - 2, y + d, c2 ); } } /* Bottom */ y = ob->y + absbw; fl_rectf( x - 1, ob->y + ob->h - 6, w, 3, FL_RIGHT_BCOL ); /* Top */ fl_rectf( x - 1, y, w, 3, FL_RIGHT_BCOL ); /* Left */ fl_line( x - 1, y, x - 1, y + h - 1, FL_BLACK ); /* right */ fl_rectf( x + w - 1, y, 2, h, FL_RIGHT_BCOL ); /* Highlight */ fl_line( x + 1, yo - h2 + 10, x + 1, yo + h2 - 10, FL_LEFT_BCOL ); } else { double extra = w2 * ( NEAR / ( NEAR - w2 ) - 0.96 ); fl_rectf( x, y, w, h, FL_DARKER_COL1 ); fl_rectf( x0 - w / 4, y, w / 2, h, FL_COL1 ); dx = ob->w / 10; fl_rectf( x0 - dx, y, 2 * dx, h, FL_LIGHTER_COL1 ); for ( theta = arc + modf( offset / delta, &junk ); theta > -arc; theta -= delta ) { dx = ( w2 + extra ) * sin( theta ); dy = ob->w - ( w2 + extra ) * cos( theta ); x = x0 + FL_nint( dx * NEAR / ( NEAR + dy ) ); if ( x > ob->x + absbw + 1 && x < x0 + w2 - absbw - 2 ) { int d = 1; if ( x < x0 + w2 / 4 && x > x0 - w2 / 4 ) { c1 = FL_LEFT_BCOL; c2 = FL_RIGHT_BCOL; } else if ( x < ob->x + ( w2 / 4 ) || x > x0 + w2 - ( w2 / 4 ) ) { c1 = FL_LIGHTER_COL1; c2 = FL_BOTTOM_BCOL; } else { c1 = FL_MCOL; c2 = FL_BOTTOM_BCOL; } fl_line( x - 1, y + 2, x - 1, yo + h2 - 2 * absbw, c1 ); fl_line( x + d, y + 2, x + d, yo + h2 - 2 * absbw, c2 ); } x = ob->x + absbw; y = ob->y + absbw; w = ob->w - 2 * absbw; h = ob->h - 2 * absbw; /* Top shadow */ fl_line( x, y - 1, x + w - 2, y - 1, FL_BLACK ); fl_line( x, y, x + w - 4, y, FL_BLACK ); /* Bottom shadow */ fl_line( x + 5, y + h - 2, x + w - 4, y + h - 2, FL_BLACK ); fl_line( x, y + h - 1, x + w - 2, y + h - 1, FL_BLACK ); fl_line( x, y + h, x + w - 2, y + h, FL_BLACK ); /* Left & right */ fl_rectf( x, y - 1, 3, h + 1, FL_RIGHT_BCOL ); fl_rectf( x + w - 4, y - 1, 3, h + 1, FL_RIGHT_BCOL ); /* High light */ fl_line( x0 - w2 + 11, y + 1, x0 + w2 - 11, y + 1, FL_TOP_BCOL ); } } if ( sp->draw_type == COMPLETE_DRAW ) fl_draw_object_label_outside( ob ); } /*************************************** ***************************************/ static int handle_thumbwheel( FL_OBJECT * ob, int ev, int mx, int my, int key, void * xev FL_UNUSED_ARG ) { FLI_THUMBWHEEL_SPEC *sp = ob->spec; int cur_pos, old_pos; double value; double step = sp->step != 0.0 ? sp->step : DEFSTEP; int ret = FL_RETURN_NONE; switch ( ev ) { case FL_ATTRIB : ob->align = fl_to_outside_lalign( ob->align ); break; case FL_DRAW: draw( ob ); sp->draw_type = COMPLETE_DRAW; break; case FL_DRAWLABEL: if ( sp->draw_type == COMPLETE_DRAW ) fl_draw_object_label_outside( ob ); break; case FL_PUSH: if ( key != FL_MBUTTON1 ) break; sp->old_mx = mx; sp->old_my = my; sp->start_val = sp->val; /* fall through */ case FL_MOTION: if ( key != FL_MBUTTON1 ) break; cur_pos = ob->type == FL_VERT_THUMBWHEEL ? sp->old_my : mx; old_pos = ob->type == FL_VERT_THUMBWHEEL ? my : sp->old_mx; value = sp->val + step * ( cur_pos - old_pos ); sp->old_mx = mx; sp->old_my = my; ret |= fli_valuator_handle_drag( ob, value ); break; case FL_KEYPRESS: value = sp->val; if ( IsHome( key ) ) value = 0.5 * ( sp->min + sp->max ); else if ( IsUp( key ) && ob->type == FL_VERT_THUMBWHEEL ) value = sp->val + step; else if ( IsDown( key ) && ob->type == FL_VERT_THUMBWHEEL ) value = sp->val - step; else if ( IsRight( key ) && ob->type == FL_HOR_THUMBWHEEL ) value = sp->val + step; else if ( IsLeft( key ) && ob->type == FL_HOR_THUMBWHEEL ) value = sp->val - step; ret |= fli_valuator_handle_release( ob, value ); break; case FL_RELEASE: if ( ! ( key == FL_MBUTTON1 || ( ob->type == FL_VERT_THUMBWHEEL && ( key == FL_MBUTTON4 || key == FL_MBUTTON5 ) ) ) ) break; if ( ob->type == FL_VERT_THUMBWHEEL && ( key == FL_MBUTTON4 || key == FL_MBUTTON5 ) ) value = sp->val + ( key == FL_MBUTTON4 ? step : -step ); else value = sp->val; ret |= fli_valuator_handle_release( ob, value ); break; } return ret; } /*************************************** ***************************************/ double fl_get_thumbwheel_value( FL_OBJECT * ob ) { #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_THUMBWHEEL ) ) { M_err( "fl_get_thumbwheel_value", "%s is not a thumbwheel", ob ? ob->label : "null" ); return 1.0; } #endif return ( ( FLI_THUMBWHEEL_SPEC * ) ob->spec )->val; } /*************************************** ***************************************/ double fl_set_thumbwheel_value( FL_OBJECT * ob, double value ) { FLI_THUMBWHEEL_SPEC *sp; double oldval; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_THUMBWHEEL ) ) { M_err( "fl_set_thumbwheel_value", "%s is not a thumbwheel", ob ? ob->label : "null" ); return 1.0; } #endif sp = ob->spec; oldval = sp->val; value = FL_clamp( value, sp->min, sp->max ); if ( sp->val != value ) { sp->val = sp->start_val = value; fl_redraw_object( ob ); } return oldval; } /*************************************** ***************************************/ void fl_set_thumbwheel_bounds( FL_OBJECT * ob, double min, double max ) { FLI_THUMBWHEEL_SPEC *sp; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_THUMBWHEEL ) ) { M_err( "fl_set_thumbwheel_bounds", "%s is not a thumbwheel", ob ? ob->label : "null" ); return; } #endif sp = ob->spec; if ( sp->min != min || sp->max != max ) { sp->min = min; sp->max = max; sp->val = FL_clamp( sp->val, min, max ); fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_get_thumbwheel_bounds( FL_OBJECT * ob, double * min, double * max ) { FLI_THUMBWHEEL_SPEC *sp = ob->spec; *min = sp->min; *max = sp->max; } /*************************************** ***************************************/ double fl_get_thumbwheel_step( FL_OBJECT * ob ) { return ( ( FLI_THUMBWHEEL_SPEC * ) ob->spec )->step; } /*************************************** ***************************************/ double fl_set_thumbwheel_step( FL_OBJECT * ob, double step ) { FLI_THUMBWHEEL_SPEC *sp = ob->spec; double old = sp->step; if ( sp->step != step ) sp->step = step; return old; } /*************************************** * Unused, undocumented function JTT ***************************************/ int fl_set_thumbwheel_crossover( FL_OBJECT * ob, int flag ) { FLI_THUMBWHEEL_SPEC *sp; int old; if ( ! ob || ! ( ob->objclass != FL_THUMBWHEEL ) ) return -1; sp = ob->spec; old = sp->cross_over; sp->cross_over = flag; return old; } /*************************************** * Sets under which conditions the object is to be returned to the * application. This function should be regarded as deprecated and * fl_set_object_return() should be used instead. ***************************************/ int fl_set_thumbwheel_return( FL_OBJECT * obj, unsigned int when ) { return fl_set_object_return( obj, when ); } /*************************************** * Creates a thumbwheel object * ***************************************/ FL_OBJECT * fl_create_thumbwheel( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; FLI_THUMBWHEEL_SPEC *sp; obj = fl_make_object( FL_THUMBWHEEL, type, x, y, w, h, label, handle_thumbwheel ); obj->col1 = FL_THUMBWHEEL_COL1; obj->col2 = FL_THUMBWHEEL_COL2; obj->lcol = FL_THUMBWHEEL_LCOL; obj->align = FL_THUMBWHEEL_ALIGN; obj->boxtype = FL_THUMBWHEEL_BOXTYPE; obj->wantkey = FL_KEY_SPECIAL; obj->spec = NULL; sp = fli_init_valuator( obj ); sp->step = DEFSTEP; fl_set_object_return( obj, FL_RETURN_CHANGED ); return obj; } /*************************************** * Adds a thumbwheel object ***************************************/ FL_OBJECT * fl_add_thumbwheel( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj = fl_create_thumbwheel( type, x, y, w, h, label ); /* Set default return policy for the object */ fl_set_object_return( obj, FL_RETURN_CHANGED ); fl_add_object( fl_current_form, obj ); fl_set_object_dblbuffer( obj, 1 ); return obj; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/valuator.c0000644000175000017500000000725512251553715012543 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file valuator.c * * This file is part of the XForms library package. * Copyright (c) 1998-2002 T.C. Zhao * All rights reserved. * * Handle some common valuator tasks. * TODO: move slider and counter handler here */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/pvaluator.h" /*************************************** ***************************************/ void * fli_init_valuator( FL_OBJECT * ob ) { FLI_VALUATOR_SPEC *sp = ob->spec; if ( ! sp ) ob->spec = sp = fl_calloc( 1, sizeof *sp ); sp->min = 0.0; sp->max = 1.0; sp->val = 0.5; sp->prec = 2; sp->step = 0.01; sp->draw_type = COMPLETE_DRAW; return sp; } #define CROSS_OVER( v, vmin, vmax ) \ ( ( v ) < ( vmin ) ? ( vmax ) : ( ( v ) > ( vmax ) ? ( vmin ) : ( v ) ) ) /*************************************** ***************************************/ double fli_valuator_round_and_clamp( FL_OBJECT * ob, double val ) { FLI_VALUATOR_SPEC *sp = ob->spec; double vmin, vmax; if ( sp->step != 0.0 ) { val /= sp->step; val = sp->step * ( val >= 0 ? floor( val + 0.5 ) : ceil( val - 0.5 ) ); } vmin = FL_min( sp->min, sp->max ); vmax = FL_max( sp->min, sp->max ); if ( ! sp->cross_over ) return FL_clamp( val, vmin, vmax ); else return CROSS_OVER( val, vmin, vmax ); } /*************************************** ***************************************/ int fli_valuator_handle_drag( FL_OBJECT * ob, double value ) { FLI_VALUATOR_SPEC *sp = ob->spec; int ret = FL_RETURN_NONE; value = fli_valuator_round_and_clamp( ob, value ); if ( value != sp->val ) { sp->val = value; sp->draw_type = VALUE_DRAW; fl_redraw_object( ob ); ret |= FL_RETURN_CHANGED; } return ret; } /*************************************** ***************************************/ int fli_valuator_handle_release( FL_OBJECT * ob, double value ) { FLI_VALUATOR_SPEC *sp = ob->spec; int ret = FL_RETURN_END; value = fli_valuator_round_and_clamp( ob, value ); if ( value != sp->val ) { sp->val = value; sp->draw_type = VALUE_DRAW; fl_redraw_object( ob ); if ( ! ( ob->how_return & FL_RETURN_END_CHANGED ) ) ret |= FL_RETURN_CHANGED; } if ( sp->start_val != sp->val && ob->how_return & FL_RETURN_END_CHANGED ) ret |= FL_RETURN_CHANGED; return ret; } /*************************************** ***************************************/ double fli_clamp( double val, double min, double max) { double vmin = FL_min( min, max ), vmax = FL_max( min, max ); return FL_clamp( val, vmin, vmax ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/combo.c0000664000175000017500000000474112353623325012002 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file combo.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * All Buttons. Additional button class can be added via * fl_add_button_class and fl_create_generic_button */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" #include "flinternal.h" typedef struct { FL_OBJECT * input; FL_OBJECT * browser; } SPEC; /*************************************** ***************************************/ static int handle( FL_OBJECT * ob FL_UNUSED_ARG, int ev FL_UNUSED_ARG, int mx FL_UNUSED_ARG, int my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * xev FL_UNUSED_ARG ) { return 0; } /*************************************** * creates an object ***************************************/ FL_OBJECT * fl_create_combobox( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob; ob = fl_make_object(FL_COMBOBOX, type, x, y, w, h, label, handle); return ob; } /*************************************** * Adds an object ***************************************/ FL_OBJECT * fl_add_combobox( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob; ob = fl_create_combobox(type, x, y, w, h, label); fl_add_object(fl_current_form, ob); return ob; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/timer.c0000664000175000017500000002235112353623326012021 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file timer.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Forms Object class: TIMER */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "include/forms.h" #include "flinternal.h" /* Extra information need for input boxes. */ typedef struct { double time_left; /* the time (sec) left to wait */ double timer; /* total duration */ long sec, /* start time */ usec; int on, up; FL_TIMER_FILTER filter; } SPEC; /*************************************** ***************************************/ static char * default_filter( FL_OBJECT * ob FL_UNUSED_ARG, double totalsec ) { static char buf[ 32 ]; int minutes; double sec; if ( totalsec >= 3600.0 ) { int hr = totalsec / 3600.0 + 0.001; minutes = totalsec / 60.0 + 0.001; minutes -= hr * 60; sec = totalsec - 60 * ( minutes + 60 * hr ); sprintf( buf, "%d:%02d:%04.1f", hr, minutes, sec ); } else if ( totalsec >= 60.0 ) { minutes = totalsec / 60.0 + 0.001; sec = totalsec - minutes * 60; sprintf( buf, "%d:%04.1f", minutes, sec ); } else sprintf( buf, "%.1f", totalsec ); return buf; } /*************************************** * draws the timer ***************************************/ static void draw_timer( FL_OBJECT * ob ) { FL_COLOR col; char *str; SPEC *sp = ob->spec; if ( ob->type == FL_HIDDEN_TIMER ) return; if ( ! sp->on || sp->time_left > 0.0 ) col = ob->col1; else if ( ( int ) ( sp->time_left / FL_TIMER_BLINKRATE ) % 2 ) col = ob->col1; else col = ob->col2; fl_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, col, ob->bw ); if ( ob->type == FL_VALUE_TIMER && sp->time_left > 0.0 ) { double time_shown = sp->up ? sp->timer - sp->time_left : sp->time_left; str = ( sp->filter ? sp->filter : default_filter )( ob, time_shown ); fl_draw_text( FL_ALIGN_CENTER, ob->x, ob->y, ob->w, ob->h, ob->lcol, ob->lstyle, ob->lsize, str ); } } /*************************************** * Handles an event ***************************************/ static int handle_timer( FL_OBJECT * ob, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { SPEC *sp = ob->spec; long sec, usec; double lasttime_left; int ret = FL_RETURN_NONE; static int update_only; switch ( event ) { case FL_ATTRIB : if ( ob->type == FL_VALUE_TIMER ) ob->align = fl_to_outside_lalign( ob->align ); break; case FL_DRAW: draw_timer( ob ); /* fall through */ case FL_DRAWLABEL: if ( ob->type == FL_HIDDEN_TIMER || ( ob->type == FL_VALUE_TIMER && update_only ) ) break; if ( fl_is_outside_lalign( ob->align ) ) fl_draw_text_beside( ob->align, ob->x, ob->y, ob->w, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); else fl_draw_text( ob->align, ob->x, ob->y, ob->w, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); break; case FL_RELEASE: if ( ob->type != FL_HIDDEN_TIMER && sp->time_left < 0.0 ) fl_set_timer( ob, 0.0 ); break; case FL_STEP: if ( ! sp->on ) break; lasttime_left = sp->time_left; fl_gettime( &sec, &usec ); sp->time_left = sp->timer - ( sec - sp->sec ) - ( usec - sp->usec ) * 1.0e-6; update_only = 1; /* Don't check for zero, we can overshoot quite a bit. Instead try to split the error by already returning 10 ms too early. */ if ( sp->time_left > 0.01 ) { if ( ob->type == FL_VALUE_TIMER && ( int ) ( 10.0 * sp->time_left ) != ( int ) ( 10.0 * lasttime_left ) ) fl_redraw_object( ob ); } else if ( lasttime_left > 0.0 ) { if ( ob->type == FL_HIDDEN_TIMER ) fl_set_timer( ob, 0.0 ); else fl_redraw_object( ob ); update_only = 0; ret = FL_RETURN_CHANGED | FL_RETURN_END; break; } else if ( ( int ) ( lasttime_left / FL_TIMER_BLINKRATE ) != ( int ) ( sp->time_left / FL_TIMER_BLINKRATE ) ) fl_redraw_object( ob ); update_only = 0; break; case FL_FREEMEM: fl_free( ob->spec ); break; } return ret; } /*************************************** * creates an object ***************************************/ FL_OBJECT * fl_create_timer( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * l ) { FL_OBJECT *ob; SPEC *sp; ob = fl_make_object( FL_TIMER, type, x, y, w, h, l, handle_timer ); ob->boxtype = FL_TIMER_BOXTYPE; ob->col1 = FL_TIMER_COL1; ob->col2 = FL_TIMER_COL2; if ( type != FL_VALUE_TIMER ) ob->align = FL_TIMER_ALIGN; else ob->align = FL_ALIGN_LEFT; ob->lcol = FL_TIMER_LCOL; ob->spec = sp = fl_calloc( 1, sizeof *sp ); fl_set_timer( ob, 0.0 ); /* disabled timer */ sp->filter = default_filter; return ob; } /*************************************** * Adds an object ***************************************/ FL_OBJECT * fl_add_timer( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * l ) { FL_OBJECT *ob= fl_create_timer( type, x, y, w, h, l ); fl_add_object( fl_current_form, ob ); if ( ob->type == FL_VALUE_TIMER ) fl_set_object_dblbuffer( ob, 1 ); return ob; } /*************************************** * Sets the timer clock to the particular delay. (0.0 to reset) ***************************************/ void fl_set_timer( FL_OBJECT * ob, double total ) { SPEC *sp = ob->spec; sp->time_left = sp->timer = total; sp->on = total > 0.0; fl_set_object_automatic( ob, sp->on ); fl_gettime( &sp->sec, &sp->usec ); if ( ob->type != FL_HIDDEN_TIMER ) fl_redraw_object( ob ); } /*************************************** * returns the amount of time left ***************************************/ double fl_get_timer( FL_OBJECT * ob ) { SPEC *sp = ob->spec; return sp->time_left > 0.0 ? sp->time_left : 0.0; } /*************************************** ***************************************/ void fl_set_timer_countup( FL_OBJECT * ob, int yes ) { ( ( SPEC * ) ob->spec )->up = yes; } /*************************************** ***************************************/ FL_TIMER_FILTER fl_set_timer_filter( FL_OBJECT * ob, FL_TIMER_FILTER filter ) { SPEC *sp = ob->spec; FL_TIMER_FILTER old = sp->filter; if ( filter != sp->filter ) { sp->filter = filter; fl_redraw_object( ob ); } return old; } /*************************************** ***************************************/ void fl_suspend_timer( FL_OBJECT * ob ) { ( ( SPEC * ) ob->spec )->on = 0; fl_set_object_automatic( ob, 0 ); } /*************************************** ***************************************/ void fl_resume_timer( FL_OBJECT * ob ) { SPEC *sp = ob->spec; long sec, usec; double elapsed; if ( sp->on ) return; elapsed = sp->timer - sp->time_left; fl_gettime( &sec, &usec ); sp->sec = sec - ( long ) elapsed; sp->usec = usec - ( long ) ( ( elapsed - ( long ) elapsed ) * 1.0e6 ); fl_set_object_automatic( ob, 1 ); sp->on = 1; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/read4lsb.c0000644000175000017500000000265612251554055012404 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" #include "flinternal.h" #include "ulib.h" /*************************************** ***************************************/ int fli_fget4LSBF( FILE * fp ) { int ret = getc(fp); ret |= getc(fp) << 8; ret |= getc(fp) << 16; ret |= getc(fp) << 24; return ret; } /*************************************** ***************************************/ int fli_fput4LSBF( int code, FILE * fp ) { putc(code & 0xff, fp); putc((code >> 8) & 0xff, fp); putc((code >> 16) & 0xff, fp); return putc((code >> 24) & 0xff, fp); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/space.c0000664000175000017500000000501012353623326011765 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* * \file space.c * * Copyright(c) 1993,1994 by T.C. Zhao * All rights reserved. * * Remove unescaped leadingi/trailing spaces from a string. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "include/forms.h" #include "flinternal.h" #include "ulib.h" /*************************************** * Remove leading space ***************************************/ char * fli_de_space( char * s ) { char *p; /* Not all isspace considers '\t' a white space */ for ( p = s; p && ( isspace( ( unsigned char ) *p ) || *p == '\t' ); p++ ) /* empty */ ; return p == s ? s : memmove( s, p, strlen( p ) + 1 ); } /*************************************** * remove trailing space ***************************************/ char * fli_space_de( char * s ) { char *p, *q; if ( ! s || ! *s ) return s; q = p = s + strlen( s ) - 1; /* maybe replace \ with space ? */ for ( q--; p >= s && isspace( ( unsigned char ) *p ) && ( q < s || *q != '\\' ); p--,q-- ) /* empty */ ; *++p = '\0'; return s; } /*************************************** * Remove space from both ends ***************************************/ char * fli_de_space_de( char * p ) { return fli_space_de( fli_de_space( p ) ); } /*************************************** * remove non-alphanumericals from string ***************************************/ char * fli_nuke_all_non_alnum( char * s ) { char *p = s, *q = s + strlen( s ), *b; char buf[ 1024 ]; for ( b = buf; p < q; p++ ) if ( isalnum( ( unsigned char ) *p ) ) *b++ = *p; *b = '\0'; return strcpy( s, buf ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/lightbut.c0000664000175000017500000001157312353623325012526 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file lightbut.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" #include "flinternal.h" /*************************************** * Draws the lightbutton ***************************************/ static void draw_lightbutton( FL_OBJECT * ob ) { int c1, c2, libox; FL_Coord xx, yy, ww, hh, absbw = FL_abs( ob->bw ), bw2; FL_BUTTON_STRUCT *sp = ob->spec; c1 = ob->belowmouse ? FL_LIGHTBUTTON_MCOL : FL_LIGHTBUTTON_TOPCOL; c2 = sp->val ? ob->col2 : ob->col1; fl_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, c1, ob->bw ); if ( ob->boxtype == FL_NO_BOX || ob->boxtype == FL_FLAT_BOX ) absbw = FL_abs( FL_BOUND_WIDTH ); /* Otherwise it's too close to the edge... */ if ( absbw < 3 ) absbw = 3; /* Calculate and draw the light */ hh = FL_max( ob->h - 3 * absbw - 1, FL_LIGHTBUTTON_MINSIZE ); ww = FL_max( hh / 2, FL_LIGHTBUTTON_MINSIZE ); if ( ww > ob->w / 6 ) ww = ob->w / 6; xx = ob->x + 1.5 * absbw + 1; yy = ob->y + ob->h / 2 - hh / 2; absbw = FL_abs( ob->bw ); /* Adjustment for non-rectangular boxes */ if ( ob->boxtype == FL_ROUNDED3D_UPBOX || ob->boxtype == FL_ROUNDED3D_DOWNBOX ) { hh -= 2; yy += 1; xx += 3 + ob->w * 0.01; ww -= 1; } else if ( ob->boxtype == FL_RSHADOW_BOX ) { hh -= 1; xx += 1; } switch ( ob->boxtype ) { case FL_UP_BOX: case FL_ROUNDED3D_UPBOX: libox = FL_DOWN_BOX; break; case FL_DOWN_BOX: case FL_ROUNDED3D_DOWNBOX: libox = FL_DOWN_BOX; break; case FL_FRAME_BOX: case FL_EMBOSSED_BOX: case FL_ROUNDED_BOX: libox = ob->boxtype; break; case FL_RFLAT_BOX: libox = FL_ROUNDED_BOX; break; case FL_RSHADOW_BOX: libox = FL_ROUNDED_BOX; break; default: libox = FL_BORDER_BOX; break; } bw2 = absbw > 2 ? absbw - 1 : absbw; fl_draw_box( libox, xx, yy, ww, hh, c2, bw2 ); /* Draw the label */ if ( fl_is_center_lalign( ob->align ) ) fl_draw_text( FL_ALIGN_LEFT, xx + ww + 1, ob->y, ob->w - ww - 3, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); else fl_draw_object_label( ob ); ww = 0.75f * ob->h; if ( ww < absbw + 1 ) ww = absbw + 1; if ( ob->type == FL_RETURN_BUTTON ) fl_draw_text( 0, ob->x + ob->w - ww, ob->y + 0.2 * ob->h, 0.6 * ob->h, 0.6 * ob->h, ob->lcol, 0, 0, "@returnarrow" ); } /*************************************** * Creates a light-button object ***************************************/ FL_OBJECT * fl_create_lightbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob; fl_add_button_class( FL_LIGHTBUTTON, draw_lightbutton, NULL ); ob = fl_create_generic_button( FL_LIGHTBUTTON, type, x, y, w, h, label ); ob->boxtype = FL_LIGHTBUTTON_BOXTYPE; ob->col1 = FL_LIGHTBUTTON_COL1; ob->col2 = FL_LIGHTBUTTON_COL2; ob->align = FL_LIGHTBUTTON_ALIGN; ob->lcol = FL_LIGHTBUTTON_LCOL; return ob; } /*************************************** * Adds an object ***************************************/ FL_OBJECT * fl_add_lightbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob = fl_create_lightbutton( type, x, y, w, h, label ); fl_add_object( fl_current_form, ob ); return ob; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/goodie_colchooser.c0000664000175000017500000004136112343164061014364 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include #include "flinternal.h" #include "bitmaps/colorwheel.xpm" typedef struct { FL_FORM * form; FL_OBJECT * pm; /* pixmap with colorwheel */ FL_OBJECT * pos; /* positioner to select hue and saturation */ FL_OBJECT * sl; /* slider for HSV value */ FL_OBJECT * hsv_inp[ 3 ]; /* HSV input fields */ FL_OBJECT * rgb_inp[ 3 ]; /* RGB input fields */ FL_OBJECT * area; /* area for showing selected color */ FL_OBJECT * hex; /* label showing selected RGB color in hex */ FL_OBJECT * ok; /* "OK" button */ FL_OBJECT * quit; /* "Quit" button */ int hsv[ 3 ]; /* arrays for current HSV and RGB values */ int rgb[ 3 ]; } COLOR_CHOOSER; #define RED 0 #define GREEN 1 #define BLUE 2 #define HUE 0 #define SATURATION 1 #define VALUE 2 /**************************************** * Note that there isn't a 1-to-1 mapping between HSV and RGB color spaces, * already since there are many more possible HSV than RGB values and also * some colors can't be uniquely described in HSV (e.g. all greyscale values * including white or black). ***************************************/ /*************************************** * Conversion from RGB to HSV values ***************************************/ static int rgb2hsv( const int rgb[ 3 ], int hsv[ 3 ] ) { int min = 255, max = 0, delta, i, mi = 0; for ( i = RED; i <= BLUE; i++ ) { /* Check that value is within the interval [0, 255], otherwise return -1. */ if ( rgb[ i ] < 0 || rgb[ i ] > 255 ) return -1; /* Calculate minimum and maximum and index of the maximum */ min = rgb[ i ] < min ? rgb[ i ] : min; if ( rgb[ i ] > max ) { max = rgb[ i ]; mi = i; } } /* If all three values are identical there's no unique mapping to a HSV triple, set saturation and value, arbitrarily set hue to 0 and return 1 to indicate that there's no unique value for hue. */ delta = max - min; if ( delta == 0 ) { hsv[ HUE ] = 0; hsv[ SATURATION ] = 0; hsv[ VALUE ] = FL_nint( max / 2.55 ); return 1; } /* Calculate hue, saturation and value - hue must be with [0, 359] */ hsv[ SATURATION ] = FL_nint( ( 100.0 * delta ) / max ); hsv[ VALUE ] = FL_nint( max / 2.55 ); hsv[ HUE ] = FL_nint( 60 * ( 2 * mi + ( rgb[ ( mi + 1 ) % 3 ] - rgb[ ( mi + 2 ) % 3 ] ) / (double ) delta ) ); if ( hsv[ HUE ] < 0 ) hsv[ HUE ] += 360; return 0; } /*************************************** * Conversion from RGB to HSV values. ***************************************/ static int hsv2rgb( const int hsv[ 3 ], int rgb[ 3 ] ) { int i, v, p, q, t; double h, f; /* Check the input and return -1 if a value is out of bounds */ if ( hsv[ HUE ] < 0 || hsv[ HUE ] > 359 ) return -1; for ( i = SATURATION; i <= VALUE; i++ ) if ( hsv[ i ] < 0 || hsv[ i ] > 100 ) return -1; if ( hsv[ SATURATION ] == 0 ) /* achromatic (grey) */ { rgb[ RED ] = rgb[ GREEN ] = rgb[ BLUE ] = FL_nint( 2.55 * hsv[ VALUE ] ); return 0; } f = modf( hsv[ HUE ] / 60.0, &h );; p = FL_nint( 0.0255 * hsv[ VALUE ] * ( 100 - hsv[ SATURATION ] ) ); q = FL_nint( 0.0255 * hsv[ VALUE ] * ( 100 - hsv[ SATURATION ] * f ) ); t = FL_nint( 0.0255 * hsv[ VALUE ] * ( 100 - hsv[ SATURATION ] * ( 1 - f ) ) ); v = FL_nint( 2.55 * hsv[ VALUE ] ); switch( ( int ) h ) { case 0: rgb[ RED ] = v; rgb[ GREEN ] = t; rgb[ BLUE ] = p; break; case 1: rgb[ RED ] = q; rgb[ GREEN ] = v; rgb[ BLUE ] = p; break; case 2: rgb[ RED ] = p; rgb[ GREEN ] = v; rgb[ BLUE ] = t; break; case 3: rgb[ RED ] = p; rgb[ GREEN ] = q; rgb[ BLUE ] = v; break; case 4: rgb[ RED ] = t; rgb[ GREEN ] = p; rgb[ BLUE ] = v; break; case 5: rgb[ RED ] = v; rgb[ GREEN ] = p; rgb[ BLUE ] = q; break; } return 0; } /*************************************** * Validator for the positioner, keeps the position within the * circle of the underlying colorwheel pixmap. Boundaries for the * x- and y-values have been set up so that a set of value with * a radius of 1 is exactly on the edge of the colorwheel. ***************************************/ static int validator( FL_OBJECT * obj FL_UNUSED_ARG, double x, double y, double * x_repl, double * y_repl ) { double angle; /* If the new position is within the circle (with radius 1) it's fine, tell the positioner to use it as is */ if ( x * x + y * y <= 1 ) return FL_POSITIONER_VALID; /* Otherwise replace the new position by one at the circle's border in the direction from the center to the new coordinates */ angle = atan2( y, x ); *x_repl = cos( angle ); *y_repl = sin( angle ); /* Tell the positioner to use the values in x_repl and y_repl */ return FL_POSITIONER_REPLACED; } /*************************************** * Sets the colorfor the box sowing the currently selected color * and the label with its hexadecimal value. ***************************************/ static void update_color_area( COLOR_CHOOSER * cc ) { fl_mapcolor( FL_COLOR_CHOOSER_COLOR, cc->rgb[ RED ], cc->rgb[ GREEN ], cc->rgb[ BLUE ] ); fl_redraw_object( cc->area ); fl_set_object_label_f( cc->hex, "#%02X%02X%02X", cc->rgb[ RED ], cc->rgb[ GREEN ], cc->rgb[ BLUE ] ); } /*************************************** * Sets all HSV input field values at once ***************************************/ static void set_hsv_inputs( COLOR_CHOOSER * cc ) { int i; for ( i = HUE; i <= VALUE; i++ ) fl_set_input_f( cc->hsv_inp[ i ], "%d", cc->hsv[ i ] ); } /*************************************** * Sets all RGB input field values at once ***************************************/ static void set_rgb_inputs( COLOR_CHOOSER * cc ) { int i; for ( i = RED; i <= BLUE; ++i ) fl_set_input_f( cc->rgb_inp[ i ], "%d", cc->rgb[ i ] ); } /*************************************** * Sets the HSV positioner for thw hue and saturation value ***************************************/ static void set_hsv_positioner( COLOR_CHOOSER * cc ) { double angle = ( atan( 1 ) * cc->hsv[ HUE ] ) / 45; double radius = 0.01 * cc->hsv[ SATURATION ]; fl_set_positioner_values( cc->pos, radius * cos( angle ), radius * sin( angle ) ); } /*************************************** * Sets the HSV slider ***************************************/ static void set_hsv_slider( COLOR_CHOOSER * cc ) { fl_set_slider_value( cc->sl, cc->hsv[ VALUE ] ); } /*************************************** * Sets both the HSV hue and saturation positioner and the HSV value slider ***************************************/ static void set_hsv_elements( COLOR_CHOOSER * cc ) { set_hsv_positioner( cc ); set_hsv_slider( cc ); } /*************************************** * Callback for the HSV hue and saturation positioner ***************************************/ static void positioner_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { COLOR_CHOOSER *cc = obj->u_vdata; double x = fl_get_positioner_xvalue( obj ), y = fl_get_positioner_yvalue( obj ); cc->hsv[ HUE ] = FL_nint( 45 * atan2( y, x ) / atan( 1 ) ); cc->hsv[ SATURATION ] = FL_nint( 100 * sqrt( x * x + y * y ) ); if ( cc->hsv[ HUE ] < 0 ) cc->hsv[ HUE ] += 360; set_hsv_inputs( cc ); hsv2rgb( cc->hsv, cc->rgb ); set_rgb_inputs( cc ); update_color_area( cc ); } /*************************************** * Callback for the HSV value slider ***************************************/ static void slider_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { COLOR_CHOOSER *cc = obj->u_vdata; cc->hsv[ VALUE ] = fl_get_slider_value( obj ); fl_set_input_f( cc->hsv_inp[ VALUE ], "%d", cc->hsv[ VALUE ] ); hsv2rgb( cc->hsv, cc->rgb ); set_rgb_inputs( cc ); update_color_area( cc ); } /*************************************** * Callback for the HSV input fields ***************************************/ static void hsv_input_cb( FL_OBJECT * obj, long data ) { COLOR_CHOOSER *cc = obj->u_vdata; int value = strtol( fl_get_input( obj ), NULL, 10 ); if ( data == HUE ) { value %= 360; if ( value < 0 ) value += 360; } else value = FL_clamp( value, 0, 100 ); cc->hsv[ data ] = value; fl_set_input_f( obj, "%d", value ); hsv2rgb( cc->hsv, cc->rgb ); set_rgb_inputs( cc ); if ( data == VALUE ) set_hsv_slider( cc ); else set_hsv_positioner( cc ); update_color_area( cc ); } /*************************************** * Callback for the RGB input fields ***************************************/ static void rgb_input_cb( FL_OBJECT * obj, long data ) { COLOR_CHOOSER *cc = obj->u_vdata; int value = strtol( fl_get_input( obj ), NULL, 10 ); cc->rgb[ data ] = FL_clamp( value, 0, 100 ); fl_set_input_f( obj, "%d", cc->rgb[ data ] ); rgb2hsv( cc->rgb, cc->hsv ); set_hsv_inputs( cc ); set_hsv_elements( cc ); update_color_area( cc ); } /*************************************** * Creates the color chooser form ***************************************/ static void create_color_chooser_form( COLOR_CHOOSER * cc ) { int pos = 20, /* position and size of colorwheel */ size = 221; /* pixmap */ double fact = size / ( size - 20.0 ); /* factor due to white margin */ int i; const char *hsv_txts[ ] = { "Hue:", "Saturation:", "Value:" }; const char *rgb_txts[ ] = { "Red:", "Green:", "Blue:" }; /* Start the form */ cc->form = fl_bgn_form( FL_UP_BOX, 615, 275 ); /* Add the colorwheel pixmap */ cc->pm = fl_add_pixmap( FL_NORMAL_PIXMAP, pos, pos, size, size, "" ); fl_set_object_boxtype( cc->pm, FL_DOWN_BOX ); fl_set_pixmap_data( cc->pm, colorwheel ); /* Overlay it with a positioner. Account fot the 10 pixel wide margins of the colorwheel pixmap by setting the boundary values of the positioner to something larger than 1 so that the exact edge of the colorwheel is mapped to a radius of 1 and set center to have value of 0 for both directions. Set up a callback and a validator that is used to keep the positions always within the circle. */ cc->pos = fl_add_positioner( FL_OVERLAY_POSITIONER, pos - 1, pos - 1, size + 2, size + 2, "Hue and Saturation" ); fl_set_positioner_xbounds( cc->pos, -fact, fact ); fl_set_object_lsize( cc->pos, FL_DEFAULT_SIZE ); fl_set_positioner_ybounds( cc->pos, -fact, fact ); fl_set_positioner_xvalue( cc->pos, cc->hsv[ HUE ] ); fl_set_positioner_yvalue( cc->pos, cc->hsv[ SATURATION ] ); fl_set_object_callback( cc->pos, positioner_cb, 0 ); fl_set_positioner_validator( cc->pos, validator ); fl_set_object_color( cc->pos, FL_COL1, FL_BLACK ); cc->pos->u_vdata = cc; /* Add the slider for the HSV value, with a range of [0, 100]. */ cc->sl = fl_add_slider( FL_VERT_BROWSER_SLIDER, 255, 20, 15, 223, "Value" ); fl_set_object_lsize( cc->sl, FL_DEFAULT_SIZE ); fl_set_object_return( cc->sl, FL_RETURN_CHANGED ); fl_set_slider_bounds( cc->sl, 100, 0 ); fl_set_slider_value( cc->sl, cc->hsv[ VALUE ] ); fl_set_slider_increment( cc->sl, 1, 1 ); fl_set_object_callback( cc->sl, slider_cb, 0 ); cc->sl->u_vdata = cc; /* Add input fields (and labels) for the HSV and RGB values. We do that in sepearte loops to jump within the input fields with first through the HSV and then through the RGB input fileds. */ for ( i = HUE; i <= VALUE; i++ ) { fl_add_text( FL_NORMAL_TEXT, 290, 20 + i * 55, 80, 30, hsv_txts[ i ] ); cc->hsv_inp[ i ] = fl_add_input( FL_INT_INPUT, 370, 20 + i * 55, 80, 30, "" ); } for ( i = RED; i <= BLUE; i++ ) { fl_set_object_callback( cc->hsv_inp[ i ], hsv_input_cb, i ); cc->hsv_inp[ i ]->u_vdata = cc; fl_add_text( FL_NORMAL_TEXT, 460, 20 + i * 55, 55, 30, rgb_txts[ i ] ); cc->rgb_inp[ i ] = fl_add_input( FL_INT_INPUT, 515, 20 + i * 55, 80, 30, "" ); fl_set_object_callback( cc->rgb_inp[ i ], rgb_input_cb, i ); cc->rgb_inp[ i ]->u_vdata = cc; } /* Get a color slot for the area showing the selected color. Then create that area and a label for showing hexadecimal color value. */ fl_mapcolor( FL_COLOR_CHOOSER_COLOR, 255, 255, 255 ); cc->area = fl_add_box( FL_DOWN_BOX, 290, 180, 135, 63, "" ); fl_set_object_color( cc->area, FL_COLOR_CHOOSER_COLOR, FL_WHITE ); cc->hex = fl_add_text( FL_NORMAL_TEXT, 480, 180, 100, 20, "#FFFFFF" ); fl_set_object_lstyle( cc->hex, FL_FIXEDBOLD_STYLE ); /* Finally add the "Ok" and "Cancel" buttons. */ cc->ok = fl_add_button( FL_NORMAL_BUTTON, 455, 213, 60, 30, "Ok" ); cc->quit = fl_add_button( FL_NORMAL_BUTTON, 535, 213, 60, 30, "Cancel" ); fl_end_form( ); } /*************************************** * Function to be called by the users to have the color chooser displayed. * The first argument is a (const) array of RGB values to the used at * the start and can be a NULL pointer (in which case white is used * as the initial color). The second is an array of three ints used for * returning RFB values of the selected color. The function returns 1 * on success and 0 when the user aborts selecting a color. ***************************************/ int fl_show_color_chooser( const int * rgb_in, int * rgb_out ) { static COLOR_CHOOSER cc; FL_OBJECT *obj; int irgb[ ] = { 255, 255, 255 }; int i; /* Check that we have a non-NULL pointer for returning the selected color */ if ( rgb_out == NULL ) { M_err( "fl_show_color_chooser", "Argument for returning selected color is a NULL pointer" ); return 0; } /* Create the color chooser form if it doesn't exist yet. */ if ( ! cc.form ) create_color_chooser_form( &cc ); /* Put it into the start configuration, either with the user supplied color (after making sure it's within bounds) or white. */ if ( rgb_in ) for ( i = RED; i <= BLUE; i++ ) cc.rgb[ i ] = FL_clamp( rgb_in[ i ], 0, 255 ); else memcpy( cc.rgb, irgb, 3 * sizeof *irgb ); set_rgb_inputs( &cc ); rgb2hsv( cc.rgb, cc.hsv ); set_hsv_inputs( &cc ); set_hsv_elements( &cc ); update_color_area( &cc ); /* Show form and then wait for the user to press the "Ok" or "Cancel" button. */ fl_show_form( cc.form, FL_PLACE_CENTER, FL_FULLBORDER, "Color Chooser" ); while ( ( obj = fl_do_only_forms( ) ) != cc.ok && obj != cc.quit ) /* empty */ ; /* Hide the form and, if the user pressed "Ok" copy the selected color's RGB values into the user supplied array. */ fl_hide_form( cc.form ); if ( obj == cc.quit ) return 0; memcpy( rgb_out, cc.rgb, 3 * sizeof *rgb_out ); return 1; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/checkbut.c0000664000175000017500000000711712353623325012473 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file checkbut.c *. * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" #include "flinternal.h" /************************************************************************** * Draws a check button **********************************************************************{*/ static void draw_checkbutton( FL_OBJECT * ob ) { FL_Coord xx, yy, ww, hh, bw = FL_abs( ob->bw ); FL_BUTTON_STRUCT * sp = ob->spec; if ( sp->event == FL_ENTER || sp->event == FL_LEAVE ) return; fl_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); ww = hh = 0.6 * FL_min( ob->w, ob->h ); xx = ob->x + 4.5; yy = ob->y + ( ob->h - hh ) / 2; if ( sp->val ) fli_draw_checkbox( FL_DOWN_BOX, xx, yy, ww, hh, ob->col2, bw ); else fli_draw_checkbox( FL_UP_BOX, xx, yy, ww, hh, ob->col1, bw ); if ( fl_is_inside_lalign( ob->align ) ) fl_draw_text( FL_ALIGN_LEFT, xx + ww + 1, ob->y, ob->w - ww - 3, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); else fl_draw_text_beside( ob->align, ob->x, ob->y, ob->w, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); if ( ob->type == FL_RETURN_BUTTON ) fl_draw_text( 0, ob->x + ob->w - 0.8f * ob->h, ob->y + 0.2f * ob->h, 0.6f * ob->h, 0.6f * ob->h, ob->lcol, 0, 0, "@returnarrow" ); } /*************************************** ***************************************/ FL_OBJECT * fl_create_checkbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; fl_add_button_class( FL_CHECKBUTTON, draw_checkbutton, 0 ); obj = fl_create_generic_button( FL_CHECKBUTTON, type, x, y, w, h, label ); obj->boxtype = FL_CHECKBUTTON_BOXTYPE; obj->col1 = FL_CHECKBUTTON_COL1; obj->col2 = FL_CHECKBUTTON_COL2; obj->align = FL_CHECKBUTTON_ALIGN; obj->lcol = FL_CHECKBUTTON_LCOL; return obj; } /*************************************** ***************************************/ FL_OBJECT * fl_add_checkbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj = fl_create_checkbutton( type, x, y, w, h, label ); fl_add_object( fl_current_form, obj ); return obj; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/sldraw.c0000644000175000017500000002363212342657331012177 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file sldraw.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/pslider.h" #define IS_FLATORDOWN( t ) ( IS_FLATBOX( t ) || t == FL_DOWN_BOX ) #define IS_FLATORUPBOX( t ) ( IS_FLATBOX( t ) || t == FL_UP_BOX ) /*************************************** ***************************************/ static double flinear( double val, double smin, double smax, double gmin, double gmax ) { return smin == smax ? gmax : ( gmin + ( gmax - gmin ) * ( val - smin ) / ( smax - smin ) ); } /*************************************** ***************************************/ void fli_calc_slider_size( FL_OBJECT * ob, FLI_SCROLLBAR_KNOB * knob ) { FLI_SLIDER_SPEC *sp = ob->spec; double val = sp->min == sp->max ? 0.5 : ( sp->val - sp->min ) / ( sp->max - sp->min ); double size = sp->slsize; FL_COORD bw = ob->bw; int absbw = FL_abs( bw ); int fudge1 = IS_FLATORUPBOX( ob->boxtype ) ? 0 : ( bw == -2 || bw >= 2 ); int fudge2 = IS_FLATORUPBOX( ob->boxtype ) ? 0 : ( 2 * ( bw == -2 ) + ( bw >= 2 ) ); if ( ob->type == FL_VERT_FILL_SLIDER || ob->type == FL_VERT_PROGRESS_BAR ) { int inv = sp->min > sp->max; knob->h = ( inv ? 1 - val : val ) * ( sp->h - 2 * absbw ); knob->y = inv ? sp->h - absbw - knob->h : absbw; knob->w = sp->w - 2 * absbw; knob->x = absbw; return; } else if ( ob->type == FL_HOR_FILL_SLIDER || ob->type == FL_HOR_PROGRESS_BAR ) { knob->w = val * ( sp->w - 2 * absbw ); knob->x = absbw; knob->h = sp->h - 2 * absbw; knob->y = absbw; return; } if ( IS_VSLIDER( ob ) ) { knob->h = size * ( sp->h - 2 * absbw ); if ( IS_SCROLLBAR( ob ) && knob->h < MINKNOB_SB ) knob->h = MINKNOB_SB; else if ( ! IS_SCROLLBAR( ob ) && knob->h < 2 * absbw + MINKNOB_SL ) knob->h = 2 * absbw + MINKNOB_SL; if ( ob->type == FL_VERT_BROWSER_SLIDER2 ) { knob->h = size * sp->h; knob->y = flinear( val, 0.0, 1.0, 0, sp->h - knob->h ); knob->x = 1 + IS_FLATORDOWN( ob->boxtype ); knob->w = sp->w - 2 - 2 * IS_FLATORDOWN( ob->boxtype ); } else if ( ob->type == FL_VERT_THIN_SLIDER || ob->type == FL_VERT_BASIC_SLIDER ) { knob->h = size * sp->h; knob->y = flinear( val, 0.0, 1.0, 0, sp->h - knob->h ); knob->w = sp->w + fudge2; knob->x = - fudge1; } else { knob->y = flinear( val, 0.0, 1.0, absbw, sp->h - absbw - knob->h ); knob->w = sp->w - 2 * absbw; knob->x = absbw; } return; } else { knob->w = size * ( sp->w - 2 * absbw ); if ( IS_SCROLLBAR( ob ) && knob->w < MINKNOB_SB ) knob->w = MINKNOB_SB; else if ( ! IS_SCROLLBAR( ob ) && knob->w < 2 * absbw + MINKNOB_SL ) knob->w = 2 * absbw + MINKNOB_SL; if ( ob->type == FL_HOR_BROWSER_SLIDER2 ) { knob->w = size * sp->w; knob->x = flinear( val, 0.0, 1.0, 0, sp->w - knob->w ); knob->h = sp->h - 2 * ( 1 + IS_FLATORDOWN( ob->boxtype ) ); knob->y = 1 + IS_FLATORDOWN( ob->boxtype ); } else if ( ob->type == FL_HOR_THIN_SLIDER || ob->type == FL_HOR_BASIC_SLIDER ) { knob->w = size * sp->w; knob->x = flinear( val, 0.0, 1.0, 0, sp->w - knob->w ); knob->h = sp->h + fudge2; knob->y = - fudge1; } else { knob->x = flinear( val, 0.0, 1.0, absbw, sp->w - absbw - knob->w ); knob->h = sp->h - 2 * absbw; knob->y = absbw; } return; } M_err( "fli_calc_slider_size", "Bad slider type:%d", ob->type ); } /*************************************** ***************************************/ void fli_draw_slider( FL_OBJECT * ob, FL_COLOR col1, FL_COLOR col2, const char * str, int d ) { FLI_SLIDER_SPEC *sp = ob->spec; FL_COORD x = ob->x + sp->x, y = ob->y + sp->y, w = sp->w, h = sp->h; int sltype = ob->type; int bw = ob->bw; FL_Coord xsl, ysl, hsl, wsl; FL_Coord absbw = FL_abs( bw ); FLI_SCROLLBAR_KNOB knob; fli_calc_slider_size( ob, &knob ); xsl = ob->x + sp->x + knob.x; ysl = ob->y + sp->y + knob.y; wsl = knob.w; hsl = knob.h; /* Draw the slider */ if ( d & FLI_SLIDER_BOX ) { int btype = ob->boxtype; int actual_bw = bw; if ( sltype == FL_VERT_BROWSER_SLIDER2 || sltype == FL_HOR_BROWSER_SLIDER2 ) { btype = FL_UP_BOX; actual_bw = bw > 0 ? 1 : -1; } else if ( sltype == FL_VERT_THIN_SLIDER || sltype == FL_VERT_BASIC_SLIDER ) { btype = FL_FLAT_BOX; actual_bw = bw > 0 ? 1 : -1; } else if ( sltype == FL_HOR_THIN_SLIDER || sltype == FL_HOR_BASIC_SLIDER ) { btype = FL_FLAT_BOX; actual_bw = 1; } else btype = btype == FL_SHADOW_BOX ? FL_BORDER_BOX : btype; fl_draw_box( btype, x, y, w, h, col1, actual_bw ); } if ( sltype == FL_VERT_NICE_SLIDER || sltype == FL_VERT_NICE_SLIDER2 ) { fl_draw_box( FL_FLAT_BOX, x + w / 2 - 2, y + absbw, 4, h - 2 * absbw, FL_BLACK, 0 ); fl_draw_box( FL_UP_BOX, xsl, ysl, wsl, hsl, col1, IS_FLATBOX( ob->boxtype ) ? -1 : bw ); fl_draw_box( FL_DOWN_BOX, xsl + 2, ysl + hsl / 2 - 2, wsl - 4, 5, col2, 1 ); } else if ( sltype == FL_HOR_NICE_SLIDER || sltype == FL_HOR_NICE_SLIDER2 ) { int yoff = hsl > 15 ? 3 : 2; fl_draw_box( FL_FLAT_BOX, x + absbw, y + h / 2 - 2, w - 2 * absbw, 4, FL_BLACK, 0 ); fl_draw_box( FL_UP_BOX, xsl, ysl, wsl, hsl, col1, IS_FLATBOX( ob->boxtype ) ? -1 : bw ); fl_draw_box( FL_DOWN_BOX, xsl + wsl / 2 - 2, ysl + yoff, 5, hsl - 2 * yoff, col2, 1 /* absbw - 2 */ ); } else { FL_COORD bw2, absbw2; int slbox; switch ( ob->boxtype ) { case FL_UP_BOX: slbox = FL_UP_BOX; break; case FL_DOWN_BOX: slbox = FL_UP_BOX; break; case FL_FRAME_BOX: case FL_EMBOSSED_BOX: slbox = ob->boxtype; break; case FL_ROUNDED_BOX: slbox = FL_ROUNDED_BOX; break; case FL_RFLAT_BOX: slbox = FL_ROUNDED_BOX; break; case FL_RSHADOW_BOX: slbox = FL_ROUNDED_BOX; break; default: slbox = FL_BORDER_BOX; break; } /* This is the height of the sliding bar */ absbw2 = absbw >= 2 ? absbw - 1 : absbw - ( bw < 0 ); if ( absbw2 == 0 ) absbw2 = 1; bw2 = bw > 0 ? absbw2 : - absbw2; if ( sltype == FL_VERT_THIN_SLIDER || sltype == FL_HOR_THIN_SLIDER || sltype == FL_VERT_BASIC_SLIDER || sltype == FL_HOR_BASIC_SLIDER ) { absbw2 = absbw - ( absbw > 2 ) - ( bw == 2 ); if ( absbw2 == 0 ) absbw2 = 1; bw2 = bw > 0 ? absbw2 : - absbw2; } if ( sltype == FL_HOR_THIN_SLIDER ) sltype = FL_HOR_BROWSER_SLIDER2; if ( sltype == FL_VERT_THIN_SLIDER ) sltype = FL_VERT_BROWSER_SLIDER2; if ( d & FLI_SLIDER_KNOB ) { fl_draw_box( slbox, xsl, ysl, wsl, hsl, col2, bw2 ); if ( sltype == FL_VERT_BROWSER_SLIDER || sltype == FL_VERT_BROWSER_SLIDER2 ) { /* if soft edge, we can squeeze one more pixel */ int extra = bw2 < 0; fl_draw_text( FL_ALIGN_CENTER, xsl - extra, ysl, wsl + 2 * extra, hsl, 0, FL_NORMAL_STYLE, FL_TINY_SIZE, "@RippleLines" ); } else if ( sltype == FL_HOR_BROWSER_SLIDER || sltype == FL_HOR_BROWSER_SLIDER2 ) fl_draw_text( FL_ALIGN_CENTER, xsl - 1, ysl, wsl, hsl, 0, 10, 1, "@2RippleLines" ); } } if ( ! str || ! *str ) return; /* Draw the label */ fl_draw_text( FL_ALIGN_CENTER, xsl, ysl, wsl, hsl, 0, FL_NORMAL_STYLE, FL_TINY_SIZE, str ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/appwin.c0000664000175000017500000002070712353623325012201 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file appwin.c *. * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao * All rights reserved. * * Manage application windows */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" /***************************************************************** * Application window management. Data structure is grossly wrong * ****TODO****** **************************************************************{**/ /* some constant handlers */ static int handle_mapping_notify( XEvent * xev, void * user_data FL_UNUSED_ARG ) { XRefreshKeyboardMapping( ( XMappingEvent * ) xev ); return 0; } /*************************************** ***************************************/ static void remove_app_win( FLI_WIN * appwin ) { #if FL_DEBUG >= ML_DEBUG M_info( "remove_app_win", "deleting window %ld", appwin->win ); #endif if ( fli_app_win == appwin ) fli_app_win = appwin->next; else { FLI_WIN *fwin = fli_app_win; while ( fwin && fwin->next != appwin ) fwin = fwin->next; if ( fwin ) fwin->next = fwin->next->next; else { M_err( "remove_app_win", "Invalid argument" ); return; } } fl_free( appwin ); } /*************************************** * Given a window find the correct structure or create one ***************************************/ static FLI_WIN * get_fl_win_struct( Window win ) { FLI_WIN *fwin = fli_app_win, *lwin = fli_app_win; size_t i; for ( ; fwin && fwin->win != win; lwin = fwin, fwin = fwin->next ) /* empty */ ; /* If we found it we're done */ if ( fwin ) return fwin; /* Otherwise create a new structure and append it to the end */ #if FL_DEBUG >= ML_DEBUG M_info( "get_fl_win_struct", "Creating FLI_WIN struct for %ld", win ); #endif if ( ( fwin = fl_malloc( sizeof *fwin ) ) == NULL ) return NULL; fwin->next = NULL; fwin->win = win; fwin->pre_emptive = NULL; fwin->pre_emptive_data = NULL; for ( i = 0; i < LASTEvent; i++ ) { fwin->callback[ i ] = NULL; fwin->user_data[ i ] = NULL; } /* Default handlers */ fwin->callback[ MappingNotify ] = handle_mapping_notify; fwin->default_callback = NULL; fwin->mask = 0; if ( ! fli_app_win ) fli_app_win = fwin; else lwin->next = fwin; return fwin; } /*************************************** ***************************************/ FL_APPEVENT_CB fli_set_preemptive_callback( Window win, FL_APPEVENT_CB pcb, void * data ) { FLI_WIN *fwin; FL_APPEVENT_CB old = NULL; if ( ! ( fwin = get_fl_win_struct( win ) ) ) { M_err( "fli_set_preemptive_callback", "Memory allocation failure" ); return NULL; } old = fwin->pre_emptive; fwin->pre_emptive = pcb; fwin->pre_emptive_data = data; return old; } /*************************************** * Add an event handler for a window ***************************************/ FL_APPEVENT_CB fl_add_event_callback( Window win, int ev, FL_APPEVENT_CB wincb, void * user_data ) { FLI_WIN *fwin; int i, nev; FL_APPEVENT_CB old = NULL; if ( ev < 0 || ev >= LASTEvent ) return NULL; if ( ! ( fwin = get_fl_win_struct( win ) ) ) { M_err( "fl_add_event_callback", "Memory allocation failure" ); return NULL; } /* ev < KeyPress means all events */ nev = ev; if ( ev < KeyPress ) { ev = KeyPress; nev = LASTEvent - 1; } for ( i = ev; i <= nev; i++ ) { old = fwin->callback[ i ]; fwin->callback[ i ] = wincb; fwin->user_data[ i ] = user_data; } return old; } /*************************************** * Removes one or all event callbacks for a window. Might be * called for a window for which no event callbacks have been * set, so handle also that case gracefully. ***************************************/ void fl_remove_event_callback( Window win, int ev ) { FLI_WIN *fwin = fli_app_win; if ( ev < 0 || ev >= LASTEvent ) return; while ( fwin && fwin->win != win ) fwin = fwin->next; if ( ! fwin ) return; if ( ev >= KeyPress ) { fwin->callback[ ev ] = NULL; fwin->user_data[ ev ] = NULL; } else /* ev < KeyPress means all events */ remove_app_win( fwin ); } typedef struct { int event; unsigned long mask; } EMS; static EMS ems[ ] = { { CirculateNotify, StructureNotifyMask }, { ConfigureNotify, StructureNotifyMask }, { DestroyNotify, StructureNotifyMask }, { CreateNotify, StructureNotifyMask }, { GravityNotify, StructureNotifyMask }, { MapNotify, StructureNotifyMask }, { ReparentNotify, StructureNotifyMask }, { UnmapNotify, StructureNotifyMask }, { CirculateRequest, SubstructureRedirectMask }, { ConfigureRequest, SubstructureRedirectMask }, { MapRequest, SubstructureRedirectMask }, { ResizeRequest, ResizeRedirectMask }, { Expose, ExposureMask }, { EnterNotify, EnterWindowMask }, { LeaveNotify, LeaveWindowMask }, { KeyPress, KeyPressMask }, { KeyRelease, KeyReleaseMask} , { ButtonPress, ButtonPressMask /* | OwnerGrabButtonMask */ }, { ButtonRelease, ButtonReleaseMask /* | OwnerGrabButtonMask */ }, { MotionNotify, PointerMotionMask | ButtonMotionMask | PointerMotionHintMask }, { FocusIn, FocusChangeMask }, { FocusOut, FocusChangeMask }, { KeymapNotify, KeymapStateMask }, { PropertyNotify, PropertyChangeMask }, { VisibilityNotify, VisibilityChangeMask }, { ColormapNotify, ColormapChangeMask }, /* non-maskable events */ { MappingNotify, 0 }, { SelectionNotify, 0 }, { SelectionRequest, 0 }, { SelectionClear, 0 }, { ClientMessage, 0 }, { GraphicsExpose, 0 }, { NoExpose, 0 } }; /*************************************** ***************************************/ unsigned long fli_xevent_to_mask( int event ) { EMS *em = ems, *eme = ems + sizeof ems / sizeof *ems; for ( ; em < eme; em++ ) if ( em->event == event ) return em->mask; return 0; } /*************************************** ***************************************/ void fl_activate_event_callbacks( Window win ) { FLI_WIN *fwin = fli_app_win; int i; unsigned long mask; while ( fwin && fwin->win != win ) fwin = fwin->next; if ( ! fwin ) { M_err( "fl_activate_event_callbacks", "Unknown window %ld", win ); return; } /* Solicit all registered events */ for ( mask = i = 0; i < LASTEvent; i++ ) if ( fwin->callback[ i ] ) mask |= fli_xevent_to_mask( i ); XSelectInput( flx->display, win, mask ); } /*************************************** ***************************************/ void fl_winclose( Window win ) { XEvent xev; XUnmapWindow( flx->display, win ); XDestroyWindow( flx->display, win ); XSync( flx->display, 0 ); while ( XCheckWindowEvent( flx->display, win, AllEventsMask, &xev ) ) fli_xevent_name( "Eaten", &xev ); fl_remove_event_callback( win, 0 ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/cmd_br.c0000644000175000017500000004265112251554306012130 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file cmd_br.c * * This file is part of the XForms library package. * Copyright (c) 1997-2002 T.C. Zhao * All rights reserved. * * Run a command and have its output re-directed to a browser. * Not very robust as signals are not handled. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/flsnprintf.h" #include "private/flvasprintf.h" #include "fd/cmdbr.h" #ifndef FL_WIN32 #include #include #include #else #include #include #include #include #define waitpid( pid,pstat, code ) _cwait( pstat, pid, code ) #define pid_t HANDLE #endif /* FL_WIN32 */ /* Structures that hold the current running processes */ typedef struct pidlist { struct pidlist * next; pid_t pid; int fd_out, fd_err, fd_user; } PIDList; static PIDList *pidlist = NULL; static FD_cmd *logger = NULL; /*************************************** ***************************************/ static void io_cb( int fd, void * data FL_UNUSED_ARG ) { char buf[ 1024 ]; int n; #ifndef FL_WIN32 if ( ( n = read( fd, buf, sizeof buf - 1 ) ) > 0 ) { buf[ n ] = '\0'; fl_addto_browser_chars( logger->browser, buf ); } else if ( n <= 0 ) { /* 0: EOF <0: error. */ if ( n < 0 ) M_err( "io_cb", "read returns %d", n ); fl_remove_io_callback( fd, FL_READ, io_cb ); close( fd ); } #else ReadFile( ( HANDLE ) fd, buf, sizeof buf - 1, &n, NULL ); if ( n > 0 ) { buf[ n ] = '\0'; fl_addto_browser_chars( logger->browser, buf ); } else if ( n <= 0 ) { /* 0: EOF <0: error. */ if ( n < 0 ) M_err( "io_cb", "read returns %d", n ); fl_remove_io_callback( fd, FL_READ, io_cb ); CloseHandle( ( HANDLE ) fd ); } #endif } /*************************************** ***************************************/ static void check_for_activity( PIDList * cur ) { XEvent xev; /* We must read until the pipe is closed, otherwise waitpid will hang */ do { if ( fl_check_forms( ) == FL_EVENT ) fl_XNextEvent( &xev ); } while ( fli_is_watched_io( cur->fd_out ) || fli_is_watched_io( cur->fd_err ) ); fl_update_display( 1 ); } /*************************************** ***************************************/ void fl_cmdbr_close_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_hide_form( ( ( FD_cmd * ) ob->form->fdui )->cmd ); } /*************************************** ***************************************/ void fl_cmdbr_clear_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_clear_browser( ( ( FD_cmd * ) ob->form->fdui )->browser ); } /*************************************** ***************************************/ static int atclose( FL_FORM * form FL_UNUSED_ARG, void * data FL_UNUSED_ARG ) { return FL_OK; } /*************************************** ***************************************/ static void create_logger( void ) { if ( ! logger ) { int oldy = fli_inverted_y; int oldu = fl_get_coordunit( ); fli_inverted_y = 0; fl_set_coordunit( FL_COORD_PIXEL ); logger = create_form_cmd( ); fl_set_object_bw( logger->backface, 2 ); fl_set_form_minsize( logger->cmd, 250, 100 ); fl_set_form_atclose( logger->cmd, atclose, 0 ); fl_set_form_position( logger->cmd, -logger->cmd->w - 5, 3 ); fli_inverted_y = oldy; fl_set_coordunit( oldu ); } } /*************************************** ***************************************/ void fl_addto_command_log( const char * s ) { create_logger( ); fl_addto_browser_chars( logger->browser, s ); } /*************************************** ***************************************/ void fl_addto_command_log_f( const char * fmt, ...) { char *buf; EXPAND_FORMAT_STRING( buf, fmt ); fl_addto_command_log( buf ); fl_free( buf ); } /*************************************** ***************************************/ void fl_clear_command_log( void ) { create_logger( ); fl_clear_browser( logger->browser ); } /*************************************** ***************************************/ void fl_show_command_log( int border ) { create_logger( ); fl_fit_object_label( logger->close_br, 2, 1 ); fl_fit_object_label( logger->clear_br, 2, 1 ); fl_show_form( logger->cmd, FL_PLACE_POSITION, border, "MessageLog" ); } /*************************************** ***************************************/ void fl_hide_command_log( void ) { create_logger( ); if ( logger->cmd->visible ) fl_hide_form( logger->cmd ); } /* * VMS support is from the patch by * David Mathog (mathog@seqaxp.bio.caltech.edu) */ /* OpenVMS < 7.0 is missing some key pieces here, notably waitpid, so it uses wait instead. Also, vfork instead of fork (see local.h). */ #ifdef __VMS #include /* for wait(),vfork() */ /*************************************** ***************************************/ static void fl_execl( const char * path, const char * arg0, const char * arg1, const char * arg2, const char * arg3 ) { char cmd_tmp[ 1024 ]; char *cmd_token[ 16 ]; int i; /* VMS needs the tokens as tokens, not in one big command line. The following code is really simple minded, and will screw up if one of the command line arguments includes double quotes around spaces. A maximum of 16 tokens can exist in the command line. */ for ( i = 0; i < 16; i++ ) cmd_token[ i ] = NULL; strncpy( cmd_tmp, arg2, 1024 ); cmd_token[ 0 ] = strtok( cmd_tmp, " " ); cmd_token[ 15 ] = NULL; for ( i = 1; i < 15, ( cmd_token[ i - 1 ] != NULL ); i++ ) cmd_token[ i ] = strtok( NULL, " " ); execl( cmd_token[ 0 ], cmd_token[ 0 ], cmd_token[ 1 ], cmd_token[ 2 ], cmd_token[ 3 ], cmd_token[ 4 ], cmd_token[ 5 ], cmd_token[ 6 ], cmd_token[ 7 ], cmd_token[ 8 ], cmd_token[ 9 ], cmd_token[ 10 ], cmd_token[ 11 ], cmd_token[ 12 ], cmd_token[ 13 ], cmd_token[ 14 ], cmd_token[ 15 ], ( char * ) 0); } /*************************************** ***************************************/ #if __VMS_VER < 70000000 pid_t waitpid( pid_t pid, int * status, int options ) { return wait( status ); } #endif /* VMS_VER < 7.0 */ #else /* on all other platforms use native execl */ #define fl_execl execl #endif /* VMS */ #ifndef FL_WIN32 FL_PID_T fl_exe_command( const char * cmd, int block ) { pid_t pid; static int p_err[ 2 ] = { -1, -1 }, p_inout[ 2 ]; char buf[ 256 ]; create_logger( ); if ( pipe( p_err ) < 0 || pipe( p_inout ) < 0 ) { fli_snprintf( buf, sizeof buf, "Can't create pipe - %s", fli_get_syserror_msg( ) ); fprintf( stderr, "%s\n", buf ); fl_addto_browser( logger->browser, buf ); if ( p_err[ 0 ] > 0 ) { close( p_err[ 0 ] ); close( p_err[ 1 ] ); } return -1; } if ( ( pid = fork( ) ) < 0 ) { fli_snprintf( buf, sizeof buf, "fork failed: %s", fli_get_syserror_msg( ) ); fl_addto_browser( logger->browser, buf ); perror( "fork" ); close( p_inout[ 0 ] ); close( p_inout[ 1 ] ); close( p_err[ 0 ] ); close( p_err[ 1 ] ); return -1; } if ( pid == 0 ) { dup2( p_inout[ 1 ], fileno( stdout ) ); close( p_inout[ 1 ] ); close( p_inout[ 0 ] ); dup2( p_err[ 1 ], fileno( stderr ) ); close( p_err[ 1 ] ); close( p_err[ 0 ] ); fl_execl( "/bin/sh", "sh", "-c", cmd, ( char * ) 0 ); perror( "execle" ); _exit( 127 ); } else { PIDList *cur = fl_malloc( sizeof *cur ); cur->next = pidlist; cur->pid = pid; cur->fd_user = -1; pidlist = cur; /* close write end of the pipe, only child process uses them */ close( p_inout[ 1 ] ); close( p_err[ 1 ] ); cur->fd_out = p_inout[ 0 ]; cur->fd_err = p_err[ 0 ]; /* add_io prepends. handle stdout first when data is present */ fl_add_io_callback( cur->fd_err, FL_READ, io_cb, ( void * ) ( long ) cur->pid ); fl_add_io_callback( cur->fd_out, FL_READ, io_cb, ( void * ) ( long ) cur->pid ); } return block ? ( FL_PID_T ) fl_end_command( pid ) : pid; } #else /* Win/NT platform */ FL_PID_T fl_exe_command( const char * cmd, int block ) { SECURITY_ATTRIBUTES sa = { 0 }; STARTUPINFO si = { 0 }; PROCESS_INFORMATION pi = { 0 }; HANDLE hPipeWrite = NULL; HANDLE hPipeRead = NULL; char buf[ 512 ]; PIDList *cur; create_logger( ); sa.nLength = sizeof sa; sa.bInheritHandle = FL_TRUE; sa.lpSecurityDescriptor = NULL; if ( ! CreatePipe( &hPipeRead, &hPipeWrite, &sa, 255 ) ) { fli_snprintf( buf, sizeof buf, "Can't create pipe - %s", fli_get_syserror_msg( ) ); fprintf( stderr, "%s\n", buf ); fl_addto_browser( logger->browser, buf ); return ( FL_PID_T ) - 1; } /* Make child process use p_inout as standard out, and make sure it does not show on screen. */ si.cb = sizeof si; si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES; si.wShowWindow = SW_HIDE; si.hStdInput = GetStdHandle( STD_INPUT_HANDLE ); si.hStdOutput = hPipeWrite; si.hStdError = hPipeWrite; if ( CreateProcess( NULL, ( LPTSTR ) cmd, NULL, NULL, FL_TRUE, 0, NULL, NULL, &si, &pi ) ) { /* close write end of the pipe, only child process uses them */ CloseHandle( hPipeWrite ); CloseHandle( pi.hThread ); /* close the primay thread handle */ cur = fl_malloc( sizeof *cur ); cur->next = pidlist; cur->pid = pi.hProcess; cur->fd_out = hPipeRead; cur->fd_err = 0; cur->fd_user = 0; pidlist = cur; /* add_io prepends. handle stdout first when data is present */ fl_add_io_callback( ( int ) cur->fd_out, FL_READ, io_cb, ( void * ) cur->pid ); } else { fli_snprintf( buf,sizeof buf, "spawn failed: %s", fli_get_syserror_msg( ) ); fl_addto_browser( logger->browser, buf ); perror( "spawn" ); /* close the pipes */ CloseHandle( hPipeRead ); CloseHandle( hPipeWrite ); return ( FL_PID_T ) - 1; } return block ? ( FL_PID_T ) fl_end_command( cur->pid ) : cur->pid; } #endif /*************************************** * essentially a bi-directional pipe ***************************************/ FILE * fl_popen( const char * cmd, const char * type ) { pid_t pid; static int p_err[ 2 ] = { -1, -1 }, p_p2c[ 2 ] = { -1, -1 }, p_c2p[ 2 ] = { -1, -1 }; char buf[ 512 ]; int iswrite, i; FILE *fp = 0; if ( ! cmd || ! *cmd || ! type || ! *type || ( *type != 'r' && *type != 'w' ) ) return 0; iswrite = *type == 'w'; create_logger( ); if ( pipe( p_err ) < 0 || pipe( p_p2c ) < 0 || pipe( p_c2p ) < 0 ) { fli_snprintf( buf, sizeof buf, "Can't create pipe - %s", fli_get_syserror_msg( ) ); fprintf( stderr, "%s\n", buf ); fl_addto_browser(logger->browser, buf ); for ( i = 0; i < 2; i++ ) { if ( p_err[ i ] >= 0 ) close( p_err[ i ] ); if (p_p2c[ i ] >= 0 ) close( p_p2c[ i ] ); } return NULL; } if ( ( pid = fork( ) ) < 0 ) { fli_snprintf( buf,sizeof buf, "fork failed: %s", fli_get_syserror_msg( ) ); fl_addto_browser( logger->browser, buf ); perror( "fork" ); for ( i = 0; i < 2; i++ ) { close( p_err[ i ] ); close( p_p2c[ i ] ); close( p_c2p[ i ] ); } return NULL; } if ( pid == 0 ) { dup2( p_p2c[ 0 ], fileno( stdin ) ); dup2( p_c2p[ 1 ], fileno( stdout ) ); dup2( p_err[ 1 ], fileno( stderr ) ); close( p_p2c[ 0 ] ); close( p_p2c[ 1 ] ); close( p_c2p[ 0 ] ); close( p_c2p[ 1 ] ); close( p_err[ 0 ] ); close( p_err[ 1 ] ); fl_execl( "/bin/sh", "sh", "-c", cmd, ( char * ) 0 ); perror( "execle" ); _exit( 127 ); } else { /* the parent process */ PIDList *cur = fl_malloc( sizeof *cur ); cur->next = pidlist; cur->pid = pid; pidlist = cur; close( p_p2c[ 0 ] ); close( p_c2p[ 1 ] ); close( p_err[ 1 ] ); cur->fd_err = p_err[ 0 ]; cur->fd_out = p_c2p[ 0 ]; fl_add_io_callback( cur->fd_err, FL_READ, io_cb, ( void * ) ( long ) pid ); if ( iswrite ) { cur->fd_user = p_p2c[1]; fl_add_io_callback( cur->fd_out, FL_READ, io_cb, ( void * ) ( long ) pid ); } else cur->fd_user = p_c2p[ 0 ]; fp = fdopen( cur->fd_user, type ); } return fp; } /*************************************** * close pipe ***************************************/ int fl_pclose( FILE * stream ) { PIDList *cur, *last; int fd; if ( ! stream || ( fd = fileno( stream ) ) < 0 ) return -1; fclose( stream ); for ( last = 0, cur = pidlist; cur && cur->fd_user != fd; last = cur, cur = last->next ) /* empty */ ; if ( ! cur ) return -1; check_for_activity( cur ); return fl_end_command( cur->pid ); } /*************************************** ***************************************/ int fl_end_command( FL_PID_T pid ) { PIDList *cur, *last; int pstat; for ( last = NULL, cur = pidlist; cur && cur->pid != pid; last = cur, cur = last->next ) /* empty */ ; if ( ! cur ) return -1; do { check_for_activity( cur ); pid = waitpid( cur->pid, &pstat, 0 ); } while ( pid == -1 && errno == EINTR ); if ( last ) last->next = cur->next; else pidlist = cur->next; fl_free( cur ); return pid == -1 ? -1 : pstat; } /*************************************** * check if PID exists or not. Return 0 if it does not, 1 if still * running, any other value indicates an error ***************************************/ int fl_check_command( FL_PID_T pid ) { #ifndef FL_WIN32 if ( kill( pid, 0 ) == 0 ) { waitpid( pid, 0, WNOHANG ); return 1; } return errno == ESRCH ? 0 : -1; #else DWORD ExitCode = 0; GetExitCodeProcess( pid, &ExitCode ); if ( ExitCode == STILL_ACTIVE ) return 1; return ( GetLastError( ) == ERROR_INVALID_HANDLE ) ? 0 : -1; #endif } /*************************************** * clean up all child processes ***************************************/ int fl_end_all_command( void ) { PIDList *cur, *next; int pstat = 0; pid_t pid = 0; for ( cur = pidlist; cur; cur = next ) { next = cur->next; check_for_activity( cur ); pid = waitpid( cur->pid, &pstat, 0 ); fl_free( cur ); } pidlist = NULL; return pid == -1 ? pid : pstat; } /*************************************** ***************************************/ FD_CMDLOG * fl_get_command_log_fdstruct( void ) { static FD_CMDLOG ret; create_logger( ); ret.form = logger->cmd; ret.browser = logger->browser; ret.close_browser = logger->close_br; ret.clear_browser = logger->clear_br; return &ret; } /*************************************** ***************************************/ void fl_set_command_log_position( int x, int y ) { create_logger( ); fl_set_form_position( logger->cmd, x, y ); } #include "fd/cmdbr.c" /* from directory fd */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/roundbut.c0000664000175000017500000000677512353623325012556 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file roundbut.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" #include "flinternal.h" /*************************************** * Draws a round button ***************************************/ static void draw_roundbutton( FL_OBJECT * ob ) { int c1; FL_Coord xx, yy, rr; FL_BUTTON_STRUCT *sp = ob->spec; if ( sp->event == FL_ENTER || sp->event == FL_LEAVE ) return; c1 = ob->belowmouse ? FL_ROUNDBUTTON_MCOL : FL_ROUNDBUTTON_TOPCOL; fl_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, c1, ob->bw ); rr = 0.3 * FL_min( ob->w, ob->h ) + 0.5; xx = ob->x + rr + 4.1; yy = ob->y + 0.5 * ob->h; fl_circf( xx, yy, rr, ob->col1 ); fl_circ( xx, yy, rr, FL_BLACK ); if ( sp->val ) { fl_circf( xx, yy, ( int ) ( 0.8 * rr ), ob->col2 ); fl_circ( xx, yy, ( int ) ( 0.8 * rr ), FL_BLACK ); } if ( fl_is_center_lalign( ob->align ) ) fl_draw_text( FL_ALIGN_LEFT, xx + rr + 1, ob->y, 0, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); else fl_draw_object_label_outside( ob ); if ( ob->type == FL_RETURN_BUTTON ) fl_draw_text( 0, ob->x + ob->w - 0.8 * ob->h, ob->y + 0.2 * ob->h, 0.6 * ob->h, 0.6 * ob->h, ob->lcol, 0, 0, "@returnarrow" ); } /*************************************** * Creates an object ***************************************/ FL_OBJECT * fl_create_roundbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob; fl_add_button_class( FL_ROUNDBUTTON, draw_roundbutton, 0 ); ob = fl_create_generic_button( FL_ROUNDBUTTON, type, x, y, w, h, label ); ob->boxtype = FL_ROUNDBUTTON_BOXTYPE; ob->col1 = FL_ROUNDBUTTON_COL1; ob->col2 = FL_ROUNDBUTTON_COL2; ob->align = FL_ROUNDBUTTON_ALIGN; ob->lcol = FL_ROUNDBUTTON_LCOL; return ob; } /*************************************** * Adds an object ***************************************/ FL_OBJECT * fl_add_roundbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob = fl_create_roundbutton( type, x, y, w, h, label ); fl_add_object( fl_current_form, ob ); return ob; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/extern.h0000664000175000017500000000364312344104263012210 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file extern.h * * This file is part of the XForms library package. * Copyright (c) 1996-1998 T.C. Zhao and Mark Overmars * All rights reserved. * * All global variables used in forms. Should not be used * by application programs. There is no guarantee that these * variables exist in future version of XForms */ #ifndef FL_EXTERN_H_MAKING_FORMS_ONLY #define FL_EXTERN_H_MAKING_FORMS_ONLY extern Pixmap fli_gray_pattern[ ]; extern GC fli_bwgc[ ]; extern GC fli_whitegc; extern XKeyboardControl fli_keybdcontrol; extern unsigned long fli_keybdmask; extern FL_OBJECT *fli_current_group; #define FLI_INACTIVE_PATTERN fli_gray_pattern[ 1 ] extern FL_IOPT fli_cntl; extern int fli_inverted_y; extern FLI_CONTEXT * fli_context; extern FLI_TARGET * flx; extern long fli_requested_vid; extern int fli_no_connection; extern char fli_curfnt[ 127 ]; extern FLI_WIN *fli_app_win; extern void fli_draw_tbox( int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, FL_COLOR, int ); #endif /* !def EXTERN.H */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/text.c0000664000175000017500000000572712353623326011675 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file text.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Text object */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" /*************************************** ***************************************/ static int handle_text( FL_OBJECT * ob, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { switch ( event ) { case FL_ATTRIB : ob->align = fl_to_inside_lalign( ob->align ); break; case FL_DRAW: fl_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); /* fall through */ case FL_DRAWLABEL: fl_set_text_clipping( ob->x + FL_abs( ob->bw ), ob->y + 2, ob->w - 2 * FL_abs( ob->bw ), ob->h - 4 ); fl_draw_object_label( ob ); fl_unset_text_clipping( ); break; } return FL_RETURN_NONE; } /*************************************** ***************************************/ FL_OBJECT * fl_create_text( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; obj = fl_make_object( FL_TEXT, type, x, y, w, h, label, handle_text ); obj->boxtype = FL_TEXT_BOXTYPE; obj->col1 = FL_TEXT_COL1; obj->col2 = FL_TEXT_COL2; obj->lcol = FL_TEXT_LCOL; obj->align = FL_TEXT_ALIGN; obj->active = 0; return obj; } /*************************************** ***************************************/ FL_OBJECT * fl_add_text( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj = fl_create_text( type, x, y, w, h, label ); fl_add_object( fl_current_form, obj ); return obj; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/canvas.c0000664000175000017500000004567312353623325012167 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file canvas.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao * All rights reserved. *. * Class FL_CANVAS * * Not too much different from an app_win except geometry is managed * by forms and has one of the forms as its parent. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/pcanvas.h" /*************************************** * If yield_to_shortcut is set, every key press will have to * be checked for all objects' shortcuts on the current form ***************************************/ static int handle_keyboard_special( FL_OBJECT * ob, XEvent * xev ) { unsigned char keybuf[ 127 ], *ch; KeySym keysym; int kbuflen; int ret = 0; kbuflen = XLookupString( ( XKeyEvent * ) xev, ( char * ) keybuf, sizeof keybuf, &keysym, 0 ); if ( IsModifierKey( keysym ) ) /* empty */ ; else if ( kbuflen == 0 && keysym != None ) ret = fli_do_shortcut( ob->form, keysym, xev->xkey.x, xev->xkey.y, xev ); else for ( ch = keybuf; ch < keybuf + kbuflen && ob->form; ch++ ) ret = fli_do_shortcut( ob->form, *ch, xev->xkey.x, xev->xkey.y, xev ) || ret; return ret; } #define IsValidCanvas( ob ) ( ob && ( ob->objclass == FL_CANVAS \ || ob->objclass == FL_GLCANVAS ) ) /*************************************** * We have to intercept all events destined for the canvas. * Must return 0 if canvas is used just like an arbitary application * window. event processing routine calls the preemptive routine * and continues dispatching events if preemptive handler returns 0. ***************************************/ static int canvas_event_intercept( XEvent * xev, void * vob ) { FL_OBJECT *ob = vob; FLI_CANVAS_SPEC *sp = ob->spec; fli_xevent_name( "CanvasIntercept", xev ); if ( ! sp ) { /* Must be Destroy Event, which is generated after FREEMEM. Probably should block closewindow and handle the events there. Speed penalty? */ return FL_PREEMPT; } if ( xev->type == DestroyNotify && ! sp->canvas_handler[ xev->type ] && sp->cleanup ) { sp->cleanup( ob ); sp->window = None; } if ( xev->type == KeyPress && sp->yield_to_shortcut && handle_keyboard_special( ob, xev ) ) return FL_PREEMPT; if ( xev->type != Expose && xev->type != GraphicsExpose && xev->type != ClientMessage && ( ! ob->active || ob->form->deactivated ) ) return FL_PREEMPT; if ( sp->canvas_handler[ xev->type ] ) { if ( xev->type == Expose && sp->activate && ob->objclass == FL_GLCANVAS ) sp->activate( ob ); sp->canvas_handler[ xev->type ]( ob, sp->window, sp->w, sp->h, xev, sp->user_data[ xev->type ] ); return FL_PREEMPT; } return FL_PREEMPT; } /********** Data Structure maint. ***************{ ***/ /*************************************** ***************************************/ static void free_canvas( FL_OBJECT * ob ) { FLI_CANVAS_SPEC *sp = ob->spec; fli_unmap_canvas_window( ob ); /* Don't free the colormap if it is XForms' internal one */ if ( ! sp->keep_colormap && sp->colormap != fli_colormap( fl_vmode ) ) XFreeColormap( flx->display, sp->colormap ); fli_safe_free( ob->spec ); } /*************************************** * Returns the window ID of the canvas window ***************************************/ Window fl_get_canvas_id( FL_OBJECT * ob ) { FLI_CANVAS_SPEC *sp = ob->spec; #if FL_DEBUG >= ML_DEBUG if ( ! IsValidCanvas( ob ) ) { M_err( "fl_get_canvas_id", "%s not a canvas", ( ob && ob->label ) ? ob->label : "" ); return None; } #endif return sp->window; } /****** End of data struct. maint.************* }********/ /*************************************** ***************************************/ static void BegWMColormap( FLI_CANVAS_SPEC * sp ) { /* Set WM_COLORMAP property. Seems some versions of tvtwm have problems with setting this property. This check simply works around the problem (for most cases). */ if ( sp->colormap != fli_colormap( fl_vmode ) && ! XSetWMColormapWindows( flx->display, sp->parent, &sp->window, 1 ) ) M_err( "BegWMColormap", "WM choked" ); } /*************************************** ***************************************/ void fl_set_canvas_attributes( FL_OBJECT * ob, unsigned int mask, XSetWindowAttributes * xswa ) { FLI_CANVAS_SPEC *sp = ob->spec; /* Must not allow adding/removing events. We take care of soliciting events via canvas handler registrations */ if ( mask & CWEventMask ) { M_err( "fl_set_canvas_attributes", "Changing Events not supported" ); mask &= ~ CWEventMask; } sp->user_mask = mask; sp->user_xswa = *xswa; /* Check if canvas is already active */ if ( sp->window ) { XChangeWindowAttributes( flx->display, sp->window, sp->user_mask, &sp->user_xswa ); if ( mask & CWColormap ) BegWMColormap( sp ); } } /*************************************** ***************************************/ void fl_set_canvas_colormap( FL_OBJECT * ob, Colormap colormap ) { FLI_CANVAS_SPEC *sp = ob->spec; sp->colormap = sp->xswa.colormap = colormap; sp->mask |= CWColormap; if ( sp->window ) { M_warn( "fl_set_canvas_colormap", "Changing colormap for active window" ); XChangeWindowAttributes( flx->display, sp->window, sp->mask, &sp->xswa ); BegWMColormap( sp ); } } /*************************************** ***************************************/ void fl_share_canvas_colormap( FL_OBJECT * ob, Colormap colormap ) { FLI_CANVAS_SPEC *sp = ob->spec; sp->keep_colormap = 1; fl_set_canvas_colormap( ob, colormap ); } /*************************************** ***************************************/ Colormap fl_get_canvas_colormap( FL_OBJECT * ob ) { return ( ( FLI_CANVAS_SPEC * ) ( ob->spec ) )->colormap; } /*************************************** ***************************************/ void fl_set_canvas_visual( FL_OBJECT * obj, Visual * vi ) { ( ( FLI_CANVAS_SPEC * ) ( obj->spec ) )->visual = vi; } /*************************************** ***************************************/ void fl_set_canvas_depth( FL_OBJECT * obj, int depth ) { ( ( FLI_CANVAS_SPEC * ) ( obj->spec ) )->depth = depth; } /*************************************** ***************************************/ int fl_get_canvas_depth( FL_OBJECT * obj ) { return ( ( FLI_CANVAS_SPEC * ) ( obj->spec ) )->depth; } #define Moved( ob, sp ) ( ob->x != sp->x || ob->y != sp->y ) #define Resized( ob, sp ) ( ob->w != sp->w || ob->h != sp->h ) /*************************************** ***************************************/ static void init_canvas( FL_OBJECT * ob ) { FLI_CANVAS_SPEC *sp = ob->spec; static int nc; /* number of canvases */ char name[ 32 ]; if ( ! sp->window || ! fl_winisvalid( sp->window ) ) { /* Find the real parent of the canvas */ sp->parent = fl_get_real_object_window( ob ); sp->window = None; if ( sp->parent == None ) { M_err( "init_canvas", "Internal Error" ); exit( 0 ); } if ( sp->init && sp->init( ob ) < 0 ) { M_err( "init_canvas", "Unable to initialize canvas %s", ob->label ); return; } /* Create the window */ sp->window = XCreateWindow( flx->display, sp->parent, ob->x, ob->y, ob->w, ob->h, 0, sp->depth, InputOutput, sp->visual, sp->mask, &sp->xswa ); if ( sp->user_mask ) XChangeWindowAttributes( flx->display, sp->window, sp->user_mask, &sp->user_xswa ); #if FL_DEBUG >= ML_ERR M_warn( "init_canvas", "Depth = %d colormap = 0x%lx, WinID = %ld", sp->depth, sp->colormap, sp->window ); #endif /* Take over event handling */ fli_set_preemptive_callback( sp->window, canvas_event_intercept, ob ); if ( sp->activate && sp->activate( ob ) < 0 ) { M_err( "init_canvas", "Can't initialize canvas %s", ob->label ); return; } /* Record the name of the window */ if ( *ob->label ) XStoreName( flx->display, sp->window, ob->label ); else { sprintf( name, "flcanvas%d", nc++ ); XStoreName( flx->display, sp->window, name ); } BegWMColormap( sp ); XMapWindow( flx->display, sp->window ); /* Save size */ sp->x = ob->x; sp->y = ob->y; sp->w = ob->w; sp->h = ob->h; } /* Check if moved or resized */ if ( Moved( ob, sp ) || Resized( ob, sp ) ) { M_warn( "init_canvas", "Canvas: WinMoved\n" ); XMoveResizeWindow( flx->display, sp->window, ob->x, ob->y, ob->w, ob->h ); } sp->x = ob->x; sp->y = ob->y; sp->w = ob->w; sp->h = ob->h; if ( ob->col1 != FL_NoColor ) XClearWindow( flx->display, sp->window ); sp->dec_type = fli_boxtype2frametype( ob->boxtype ); fl_draw_frame( sp->dec_type, ob->x, ob->y, ob->w, ob->h, ob->col2, ob->bw ); } /*************************************** ***************************************/ FL_HANDLE_CANVAS fl_add_canvas_handler( FL_OBJECT * ob, int ev, FL_HANDLE_CANVAS h, void * udata ) { FL_HANDLE_CANVAS oldh = NULL; FLI_CANVAS_SPEC *sp = ob->spec; unsigned long emask = fli_xevent_to_mask( ev ); if ( ! IsValidCanvas( ob ) ) { M_err( "fl_add_canvas_handler", "%s not canvas class", ob ? ob->label : "" ); return NULL; } if ( ev < KeyPress ) { M_err( "fl_add_canvas_handler", "Invalid event %d", ev ); return NULL; } if ( ev != 0 && ev < LASTEvent ) { oldh = sp->canvas_handler[ ev ]; sp->canvas_handler[ ev ] = h; sp->user_data[ ev ] = udata; if ( ! sp->window ) sp->xswa.event_mask |= emask; else sp->xswa.event_mask = fl_addto_selected_xevent( sp->window, emask ); } return oldh; } /*************************************** * Remove a particular handler for event ev. If ev is invalid, * remove all handlers and their corresponding event mask ***************************************/ void fl_remove_canvas_handler( FL_OBJECT * ob, int ev, FL_HANDLE_CANVAS h FL_UNUSED_ARG ) { FLI_CANVAS_SPEC *sp = ob->spec; unsigned long emask = fli_xevent_to_mask( ev ); if ( ev < 0 || ev >= LASTEvent ) { M_err( "fl_remove_canvas_handler", "Invalid event %d", ev ); return; } sp->canvas_handler[ ev ] = NULL; if ( ! sp->window ) { if ( emask != 0 ) { sp->xswa.event_mask &= ~emask; sp->xswa.event_mask |= ExposureMask; } return; } /* Knock off the mask. Need to get Expose however */ if ( emask != 0 ) sp->xswa.event_mask = fl_remove_selected_xevent( sp->window, emask ); else if ( ev < 2 ) XSelectInput( flx->display, sp->window, sp->xswa.event_mask = ExposureMask ); if ( ev == 0 ) { for ( ; ev < LASTEvent; ev++ ) sp->canvas_handler[ ev ] = NULL; } } /*************************************** * Handle canvas by calling registered handlers. There is not much * to do as FL_DRAW typically will be followd by Expose on the * canvas ***************************************/ static int handle_canvas( FL_OBJECT * ob, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * xev FL_UNUSED_ARG ) { FLI_CANVAS_SPEC *sp = ob->spec; switch ( event ) { case FL_ATTRIB : ob->align = fl_to_outside_lalign( ob->align ); break; case FL_DRAW: if ( ob->col1 != FL_NoColor ) sp->xswa.background_pixel = fl_get_pixel( ob->col1 ); else sp->xswa.background_pixel = None; sp->mask |= CWBackPixel; init_canvas( ob ); fl_draw_object_label_outside( ob ); break; case FL_FREEMEM: fli_hide_canvas( ob ); free_canvas( ob ); break; } return FL_RETURN_NONE; } /*************************************** ***************************************/ void fli_hide_canvas( FL_OBJECT * ob ) { FLI_CANVAS_SPEC *sp = ob->spec; if ( sp->window && sp->cleanup ) sp->cleanup( ob ); /* If parent is unmapped, sp->window is also unmapped, must cleanup canvas specific stuff before closing window */ if ( ob->visible && sp->window && ob->form && ob->form->window ) fl_winclose( sp->window ); sp->window = None; } /*************************************** ***************************************/ FL_OBJECT * fl_create_generic_canvas( int canvas_class, int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob; FLI_CANVAS_SPEC *sp; int vmode = fl_vmode; int i; ob = fl_make_object( canvas_class, type, x, y, w, h, label, handle_canvas ); ob->boxtype = FL_CANVAS_BOXTYPE; ob->col1 = FL_NoColor; /* indicates no background */ ob->col2 = FL_BLACK; sp = ob->spec = fl_calloc( 1, sizeof *sp ); sp->xswa.border_pixel = 0; sp->xswa.event_mask = ExposureMask | StructureNotifyMask; sp->xswa.do_not_propagate_mask = 0; sp->mask = CWColormap | CWEventMask | CWBorderPixel | CWDontPropagate; if ( ! fli_no_connection ) { sp->visual = fli_visual( vmode ); sp->depth = fli_depth( vmode ); sp->colormap = sp->xswa.colormap = fli_colormap( vmode ); sp->gc = fl_state[ vmode ].gc[ 7 ]; /* NOT USED */ } sp->winname = NULL; sp->window = sp->parent = sp->swindow = None; sp->init = sp->activate = sp->cleanup = NULL; sp->last_active = NULL; sp->context = NULL; for ( i = 0; i < LASTEvent; i++ ) { sp->canvas_handler[ i ] = NULL; sp->user_data[ i ] = NULL; } fl_canvas_yield_to_shortcut( ob, 1 ); return ob; } /*************************************** ***************************************/ FL_OBJECT * fl_create_canvas( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { return fl_create_generic_canvas( FL_CANVAS, type, x, y, w, h, label ); } /*************************************** ***************************************/ FL_OBJECT * fl_add_canvas( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob = fl_create_canvas( type, x, y, w, h, label ); fl_add_object( fl_current_form, ob ); return ob; } /*************************************** ***************************************/ void fl_modify_canvas_prop( FL_OBJECT * obj, FL_MODIFY_CANVAS_PROP init, FL_MODIFY_CANVAS_PROP activate, FL_MODIFY_CANVAS_PROP cleanup ) { FLI_CANVAS_SPEC *sp = obj->spec; sp->init = init; sp->activate = activate; sp->cleanup = cleanup; } /*************************************** ***************************************/ void fl_canvas_yield_to_shortcut( FL_OBJECT * ob, int yes ) { FLI_CANVAS_SPEC *sp = ob->spec; unsigned int emask = KeyPressMask; if ( ( sp->yield_to_shortcut = yes ) ) { if ( ! sp->window ) sp->xswa.event_mask |= emask; else sp->xswa.event_mask = fl_addto_selected_xevent( sp->window, emask ); } else if ( ! sp->canvas_handler[ KeyPress ] ) { if ( ! sp->window ) sp->xswa.event_mask &= ~emask; else sp->xswa.event_mask = fl_remove_selected_xevent( sp->window, emask ); } } /*************************************** * Clear the canvas to the background color. If no background is * defined use black. ***************************************/ void fl_clear_canvas( FL_OBJECT * ob ) { Window win; if ( ! ob || ! ( win = FL_ObjWin( ob ) ) ) return; if ( ob->col1 != FL_NoColor ) XClearWindow( flx->display, win ); else { fl_winset( win ); fl_rectf( ob->x, ob->y, ob->w, ob->h, FL_BLACK ); } } /*************************************** * Called when a form that contains a canvas is getting hidden ***************************************/ void fli_unmap_canvas_window( FL_OBJECT * ob ) { FLI_CANVAS_SPEC *sp = ob->spec; if ( ob->visible && sp->window && ob->form && ob->form->window ) fl_winclose( sp->window ); sp->window = None; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/dmalloc.h0000644000175000017500000000620711665175614012330 00000000000000/* * * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file dmalloc.h * * This file is part of the XForms library package. * Copyright (c) 1996-1998 T.C. Zhao and Mark Overmars * All rights reserved. * * Very simple debug version of malloc family. It works by replacing the * standard malloc and its cousins with my own routines that track, among * other things, where mallocs are called and how many bytes they get. All * these relies on the the work of true malloc. A true debug version of * malloc should replace malloc with calls to sbrk. Anyway, All I want out of * this hack is to make sure there are no memory leaks. */ #ifndef TC_DMALLOC_H_ #define TC_DMALLOC_H_ #include #ifdef TC_MEMDBG extern void *tc_dbg_malloc( size_t, const char *, int ); extern void *tc_dbg_calloc( size_t, size_t, const char *, int ); extern void *tc_dbg_realloc( void *, size_t, const char *, int ); extern void *tc_dbg_getmat( int, int, size_t, const char *, int ); extern char *tc_dbg_strdup( const char *, const char *, int ); extern void tc_dbg_free( void *, const char *, int ); extern void tc_true_free( void * ); extern void tc_set_mem_warn( int ); extern void tc_mem_stat( int ); #ifndef TC_MEMDBG_OWNER /* actual replacememnt */ #define fl_malloc( a ) tc_dbg_malloc( a, __FILE__, __LINE__ ) #define fl_calloc( a, b ) tc_dbg_calloc( a, b, __FILE__, __LINE__ ) #define fl_realloc( a, b ) tc_dbg_realloc( a, b, __FILE__, __LINE__ ) #define fl_free( a ) tc_dbg_free( a, __FILE__, __LINE__ ) #define fl_strdup( a ) tc_dbg_strdup( a, __FILE__, __LINE__ ) #endif /* TC_MEMDBG_OWNER */ #else /* if not debug, tfree becomes free */ #ifndef fl_free #define fl_malloc( a ) malloc( a ) #define fl_calloc( a, b ) calloc( a, b ) #define fl_realloc( a, b ) realloc( a, b ) #define fl_free( a ) free( a ) #endif #define tc_true_free( p ) free( p ) #define tc_mem_stat( a ) #define tc_set_mem_warn( p ) #endif /* TC_MEMDBG */ #endif /* _MY_MALLOC_H */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/read4msb.c0000644000175000017500000000314612251554053012376 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file read4msb.c * * Copyright(c) 1993,1994 by T.C. Zhao * All rights reserved. * * Read 4bytes MSB first */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" #include "flinternal.h" #include "ulib.h" /*************************************** ***************************************/ int fli_fget4MSBF( FILE * fp ) { int ret = getc(fp); ret = ( ret << 8 ) | getc( fp ); ret = ( ret << 8 ) | getc( fp ); ret = ( ret << 8 ) | getc( fp ); return ret; } /*************************************** ***************************************/ int fli_fput4MSBF( int n, FILE * fp ) { putc( ( n >> 24 ) & 0xff, fp ); putc( ( n >> 16 ) & 0xff, fp ); putc( ( n >> 8 ) & 0xff, fp ); putc( n & 0xff, fp ); return n; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/labelbut.c0000664000175000017500000000614012353623325012470 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file labelbut.c * * This file is part of the XForms library package. * Copyright (c) 1997-2002 T.C. Zhao * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" #include "flinternal.h" /********** DRAWING *************/ /*************************************** * Draws the object ***************************************/ static void draw_labelbutton( FL_OBJECT * ob ) { FL_COLOR scol = ob->lcol; FL_COLOR col = ob->lcol; FL_Coord dh, dw, ww, absbw = FL_abs( ob->bw ); if ( ob->belowmouse ) col = ob->col1; if ( ( ( FL_BUTTON_STRUCT * ) ob->spec )->val ) col = ob->col2; ob->lcol = col; dh = 0.6 * ob->h; dw = FL_min( 0.6 * ob->w, dh ); ww = 0.75 * ob->h; if ( ww < dw + absbw + 1 + ( ob->bw > 0 ) ) ww = dw + absbw + 1 + ( ob->bw > 0 ); if ( ob->type == FL_RETURN_BUTTON ) fl_draw_text( 0, ob->x + ob->w - ww, ob->y + 0.2 * ob->h, dw, dh, ob->lcol, 0, 0, "@returnarrow" ); fl_draw_object_label( ob ); ob->lcol = scol; } /*************************************** * Creates a labelbutton object ***************************************/ FL_OBJECT * fl_create_labelbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label) { FL_OBJECT *obj; fl_add_button_class( FL_LABELBUTTON, draw_labelbutton, NULL ); obj = fl_create_generic_button( FL_LABELBUTTON, type, x, y, w, h, label ); obj->boxtype = FL_FLAT_BOX; obj->col1 = FL_RED; obj->col2 = FL_BLUE; obj->align = FL_LIGHTBUTTON_ALIGN; obj->lcol = FL_LIGHTBUTTON_LCOL; return obj; } /*************************************** * Adds a labelbutton object ***************************************/ FL_OBJECT * fl_add_labelbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label) { FL_OBJECT *obj = fl_create_labelbutton( type, x, y, w, h, label ); fl_add_object( fl_current_form, obj ); return obj; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/positioner.c0000664000175000017500000005262112353623325013076 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file positioner.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/ppositioner.h" #include #include /* The special information for positioners. * ymin is the value at the bottom and ymax is the value at the top */ /*************************************** * Performs linear interpolation ***************************************/ static double flinear( double val, double smin, double smax, double gmin, double gmax ) { if ( smin == smax ) return gmax; return gmin + ( gmax - gmin ) * ( val - smin ) / ( smax - smin ); } /*************************************** ***************************************/ static void handle_background( FL_OBJECT * obj, int clear_pms ) { FLI_POSITIONER_SPEC *sp = obj->spec; FL_Coord absbw = FL_abs( obj->bw ); FL_Coord x0 = obj->x + absbw + 1, y0 = obj->y + absbw + 1; FL_Coord w = obj->w - 2 * absbw - 2, h = obj->h - 2 * absbw - 2; FL_Coord xo = FL_crnd( flinear( sp->lxval, sp->xmin, sp->xmax, x0, x0 + w - 1 ) ), yo = FL_crnd( flinear( sp->lyval, sp->ymin, sp->ymax, y0 + h - 1, y0 ) ), xn = FL_crnd( flinear( sp->xval, sp->xmin, sp->xmax, x0, x0 + w - 1 ) ), yn = FL_crnd( flinear( sp->yval, sp->ymin, sp->ymax, y0 + h - 1, y0 ) ); /* Return immediatel if we're called for an invisible positioner or there's no window yet. */ if ( obj->type == FL_INVISIBLE_POSITIONER || FL_ObjWin( obj ) == None ) return; /* If no GC has been created do it now. */ if ( sp->copy_gc == None ) sp->copy_gc = XCreateGC( flx->display, FL_ObjWin( obj ), 0, NULL ); /* If there's a pixmap with what was under the horizontal line copy from it to the window to restore what's under the line. If we're asked to delete the pixmap also do so. */ if ( sp->xpm != None ) { XCopyArea( flx->display, sp->xpm, FL_ObjWin( obj ), sp->copy_gc, 0, 0, w, 1, x0, yo ); if ( clear_pms ) { XFreePixmap( flx->display, sp->xpm ); sp->xpm = None; } } /* Same for vertical line... */ if ( sp->ypm != None ) { XCopyArea( flx->display, sp->ypm, FL_ObjWin( obj ), sp->copy_gc, 0, 0, 1, h, xo, y0 ); if ( clear_pms ) { XFreePixmap( flx->display, sp->ypm ); sp->ypm = None; } } /* If we're not asked to delete the pixmap for storing what's under the horizontal line to be drawn safe the background, if necessary first creating new pixmaps for that. */ if ( ! clear_pms ) { if ( sp->xpm == None ) sp->xpm = XCreatePixmap( flx->display, FL_ObjWin( obj ), w, 1, fl_get_visual_depth( ) ); if ( sp->ypm == None ) sp->ypm = XCreatePixmap( flx->display, FL_ObjWin( obj ), 1, h, fl_get_visual_depth( ) ); XCopyArea( flx->display, FL_ObjWin( obj ), sp->xpm, sp->copy_gc, x0, yn, w, 1, 0, 0 ); XCopyArea( flx->display, FL_ObjWin( obj ), sp->ypm, sp->copy_gc, xn, y0, 1, h, 0, 0 ); sp->lxval = sp->xval; sp->lyval = sp->yval; } } /*************************************** ***************************************/ static void draw_positioner( FL_OBJECT * obj ) { FLI_POSITIONER_SPEC *sp = obj->spec; FL_Coord absbw = FL_abs( obj->bw ); FL_Coord x0 = obj->x + absbw + 1, y0 = obj->y + absbw + 1; FL_Coord w = obj->w - 2 * absbw - 2, h = obj->h - 2 * absbw - 2; FL_Coord x = FL_crnd( flinear( sp->xval, sp->xmin, sp->xmax, x0, x0 + w - 1 ) ), y = FL_crnd( flinear( sp->yval, sp->ymin, sp->ymax, y0 + h - 1, y0 ) ); if ( FL_ObjWin( obj ) == None ) return; if ( ! sp->partial ) { if ( obj->type != FL_OVERLAY_POSITIONER ) fl_draw_box( obj->boxtype, obj->x, obj->y, obj->w, obj->h, obj->col1, obj->bw ); fl_draw_object_label_outside( obj ); } handle_background( obj, 0 ); if ( x > x0 + 1 ) fl_diagline( x0, y, x - x0 - 1, 1, obj->col2 ); if ( w > x - x0 + 2 ) fl_diagline( x + 2, y, w - x + x0 - 2, 1, obj->col2 ); if ( y > y0 + 1 ) fl_diagline( x, y0, 1, y - y0 - 1, obj->col2 ); if ( h > y - y0 + 2 ) fl_diagline( x, y + 2, 1, h - y + y0 - 2, obj->col2 ); } /*************************************** * Handle a mouse position change ***************************************/ static int handle_mouse( FL_OBJECT * obj, FL_Coord mx, FL_Coord my ) { FLI_POSITIONER_SPEC * sp = obj->spec; FL_Coord absbw = FL_abs( obj->bw ); FL_Coord x1 = obj->x + absbw + 1, y1 = obj->y + absbw + 1; FL_Coord w1 = obj->w - 2 * absbw - 2, h1 = obj->h - 2 * absbw - 2; double oldx = sp->xval, oldy = sp->yval; double x, y; x = flinear( mx, x1, x1 + w1 - 1.0, sp->xmin, sp->xmax ); y = flinear( my, y1 + h1 - 1.0, y1, sp->ymin, sp->ymax ); /* Make sure the position is within bounds */ if ( ! sp->validator ) { if ( sp->xstep != 0.0 ) x = FL_nlong( x / sp->xstep ) * sp->xstep; if ( sp->ystep != 0.0 ) y = FL_nlong( y / sp->ystep ) * sp->ystep; x = fli_clamp( x, sp->xmin, sp->xmax ); y = fli_clamp( y, sp->ymin, sp->ymax ); } else { double x_repl, y_repl; int ret = sp->validator( obj, x, y, &x_repl, &y_repl ); if ( ret == FL_POSITIONER_INVALID ) return FL_RETURN_NONE; else if ( ret == FL_POSITIONER_REPLACED ) { x = x_repl; y = y_repl; } } sp->xval = x; sp->yval = y; if ( sp->xval != oldx || sp->yval != oldy ) { sp->partial = 1; fl_redraw_object( obj ); if ( ! ( obj->how_return & FL_RETURN_END_CHANGED ) ) return FL_RETURN_CHANGED; } return FL_RETURN_NONE; } /*************************************** * Handles an event ***************************************/ static int handle_positioner( FL_OBJECT * obj, int event, FL_Coord mx, FL_Coord my, int key FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { FLI_POSITIONER_SPEC *sp = obj->spec; int ret = FL_RETURN_NONE; static int is_in = 0; switch ( event ) { case FL_ATTRIB : obj->align = fl_to_outside_lalign( obj->align ); handle_background( obj, 1 ); break; case FL_DRAW: if ( obj->type != FL_INVISIBLE_POSITIONER ) draw_positioner( obj ); sp->partial = 0; break; case FL_DRAWLABEL: fl_draw_object_label_outside( obj ); break; case FL_PUSH: if ( key < FL_MBUTTON1 || key > FL_MBUTTON5 || ! sp->react_to[ key - 1 ] ) { fli_int.pushobj = NULL; break; } sp->mousebut = key; sp->old_x = sp->xval; sp->old_y = sp->yval; /* fall through */ case FL_MOTION: if ( obj->type != FL_INVISIBLE_POSITIONER ) { if ( is_in && ( mx < obj->x || mx > obj->x + obj->w || my < obj->y || my > obj->y + obj->h ) ) { is_in = 0; fl_reset_cursor( FL_ObjWin( obj ) ); } if ( ! is_in && mx >= obj->x && mx <= obj->x + obj->w && my >= obj->y && my <= obj->y + obj->h ) { fl_set_cursor( FL_ObjWin( obj ), FL_INVISIBLE_CURSOR ); is_in = 1; } } ret = handle_mouse( obj, mx, my ); break; case FL_RELEASE: if ( sp->mousebut != key ) { fli_int.pushobj = obj; break; } if ( obj->type != FL_INVISIBLE_POSITIONER ) fl_reset_cursor( FL_ObjWin( obj ) ); ret = FL_RETURN_END; if ( obj->how_return & FL_RETURN_END_CHANGED && ( sp->xval != sp->old_x || sp->yval != sp->old_y ) ) ret |= FL_RETURN_CHANGED; is_in = 0; break; case FL_FREEMEM: if ( sp->copy_gc != None ) { if ( obj->form ) handle_background( obj, 1 ); else { if ( sp->xpm != None ) XFreePixmap( flx->display, sp->xpm ); if ( sp->ypm != None ) XFreePixmap( flx->display, sp->ypm ); } XFreeGC( flx->display, sp->copy_gc ); } fl_free( obj->spec ); break; } return ret; } /*************************************** * Creates a posiioner object ***************************************/ FL_OBJECT * fl_create_positioner( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT * obj; FLI_POSITIONER_SPEC * sp; int i; obj = fl_make_object( FL_POSITIONER, type, x, y, w, h, label, handle_positioner ); obj->boxtype = FL_POSITIONER_BOXTYPE; obj->col1 = FL_POSITIONER_COL1; obj->col2 = FL_POSITIONER_COL2; obj->align = FL_POSITIONER_ALIGN; obj->lcol = FL_POSITIONER_LCOL; if ( obj->type == FL_OVERLAY_POSITIONER || obj->type == FL_INVISIBLE_POSITIONER ) { obj->bw = 0; obj->boxtype = FL_NO_BOX; } obj->spec = sp = fl_calloc( 1, sizeof *sp ); sp->xmin = 0.0; sp->ymin = 0.0; sp->xmax = 1.0; sp->ymax = 1.0; sp->xval = 0.5; sp->yval = 0.5; sp->xpm = sp->ypm = None; sp->copy_gc = None; sp->validator = NULL; /* Per default a positioner reacts to the left mouse button only */ sp->react_to[ 0 ] = 1; for ( i = 1; i < 5; i++ ) sp->react_to[ i ] = 0; fl_set_object_return( obj, FL_RETURN_CHANGED ); return obj; } /*************************************** * Adds a positioner object ***************************************/ FL_OBJECT * fl_add_positioner( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob = fl_create_positioner( type, x, y, w, h, label ); fl_add_object( fl_current_form, ob ); return ob; } /*************************************** ***************************************/ int fl_set_positioner_values( FL_OBJECT * obj, double new_x, double new_y ) { FLI_POSITIONER_SPEC * sp = obj->spec; int ret; double x = new_x; double y = new_y; if ( ! sp->validator ) { if ( sp->xstep != 0.0 ) x = FL_nlong( x / sp->xstep ) * sp->xstep; x = fli_clamp( x, sp->xmin, sp->xmax ); if ( sp->ystep != 0.0 ) y = FL_nlong( y / sp->ystep ) * sp->ystep; y = fli_clamp( y, sp->ymin, sp->ymax ); ret = x == new_x && y == new_y ? FL_POSITIONER_VALID : FL_POSITIONER_REPLACED; } else { ret = sp->validator( obj, new_x, new_y, &x, &y ); if ( ret == FL_POSITIONER_INVALID ) return ret; else if ( ret != FL_POSITIONER_REPLACED ) { x = new_x; y = new_y; } } if ( sp->xval != x || sp->yval != y ) { sp->xval = x; sp->yval = y; sp->partial = 1; fl_redraw_object( obj ); } return ret; } /*************************************** ***************************************/ int fl_set_positioner_xvalue( FL_OBJECT * obj, double val) { FLI_POSITIONER_SPEC * sp = obj->spec; return fl_set_positioner_values( obj, val, sp->yval ); } /*************************************** ***************************************/ int fl_set_positioner_yvalue( FL_OBJECT * obj, double val ) { FLI_POSITIONER_SPEC * sp = obj->spec; return fl_set_positioner_values( obj, sp->xval, val ); } /*************************************** ***************************************/ void fl_set_positioner_xbounds( FL_OBJECT * obj, double min, double max ) { FLI_POSITIONER_SPEC * sp = obj->spec; if ( min == max ) { M_err( "fl_set_positioner_xbounds", "Minimum and maximum value are identical" ); return; } if ( sp->xmin == min && sp->xmax == max ) return; sp->xmin = min; sp->xmax = max; if ( ! sp->validator ) sp->xval = fli_clamp( sp->xval, sp->xmin, sp->xmax ); else { double x, y; if ( sp->validator( obj, sp->xval, sp->yval, &x, &y ) == FL_POSITIONER_REPLACED ) { sp->xval = x; sp->yval = y; } } fl_redraw_object( obj ); } /*************************************** ***************************************/ void fl_set_positioner_ybounds( FL_OBJECT * obj, double min, double max ) { FLI_POSITIONER_SPEC * sp = obj->spec; if ( min == max ) { M_err( "fl_set_positioner_ybounds", "Minimum and maximum value are identical" ); return; } if ( sp->ymin == min && sp->ymax == max ) return; sp->ymin = min; sp->ymax = max; if ( ! sp->validator ) sp->yval = fli_clamp( sp->yval, sp->ymin, sp->ymax ); else { double x, y; if ( sp->validator( obj, sp->xval, sp->yval, &x, &y ) == FL_POSITIONER_REPLACED ) { sp->xval = x; sp->yval = y; } } fl_redraw_object( obj ); } /*************************************** ***************************************/ double fl_get_positioner_xvalue( FL_OBJECT * obj ) { return ( ( FLI_POSITIONER_SPEC * ) obj->spec )->xval; } /*************************************** ***************************************/ double fl_get_positioner_yvalue( FL_OBJECT * obj ) { return ( ( FLI_POSITIONER_SPEC * ) obj->spec )->yval; } /*************************************** ***************************************/ void fl_get_positioner_xbounds( FL_OBJECT * obj, double * min, double * max ) { *min = ( ( FLI_POSITIONER_SPEC * ) obj->spec)->xmin; *max = ( ( FLI_POSITIONER_SPEC * ) obj->spec)->xmax; } void fl_get_positioner_ybounds( FL_OBJECT * obj, double * min, double * max) { *min = ( ( FLI_POSITIONER_SPEC * ) obj->spec)->ymin; *max = ( ( FLI_POSITIONER_SPEC * ) obj->spec)->ymax; } /*************************************** * Sets the step size to which values are rounded. ***************************************/ void fl_set_positioner_xstep( FL_OBJECT * obj, double value ) { ( ( FLI_POSITIONER_SPEC * ) obj->spec )->xstep = value; } /*************************************** * Returns the step size to which values are rounded. ***************************************/ double fl_get_positioner_xstep( FL_OBJECT * obj ) { return ( ( FLI_POSITIONER_SPEC * ) obj->spec )->xstep; } /*************************************** * Sets the step size to which values are rounded. ***************************************/ void fl_set_positioner_ystep( FL_OBJECT * obj, double value ) { ( ( FLI_POSITIONER_SPEC * ) obj->spec )->ystep = value; } /*************************************** * Returns the step size to which values are rounded. ***************************************/ double fl_get_positioner_ystep( FL_OBJECT * obj ) { return ( ( FLI_POSITIONER_SPEC * ) obj->spec )->ystep; } /*************************************** * Sets under which conditions the object is to be returned to the * application. This function should be regarded as deprecated and * fl_set_object_return() should be used instead. * Please note that this function doesn't work like the other * object specific functions for setting the return policy! ***************************************/ void fl_set_positioner_return( FL_OBJECT * obj, unsigned int when ) { if ( when ) fl_set_object_return( obj, FL_RETURN_CHANGED ); else fl_set_object_return( obj, FL_RETURN_END ); } /*************************************** * Function allows to set up to which mouse * buttons the positioner object will react. ***************************************/ void fl_set_positioner_mouse_buttons( FL_OBJECT * obj, unsigned int mouse_buttons ) { FLI_POSITIONER_SPEC *sp = obj->spec; unsigned int i; for ( i = 0; i < 5; i++, mouse_buttons >>= 1 ) sp->react_to[ i ] = mouse_buttons & 1; } /*************************************** * Function returns a value via 'mouse_buttons', indicating * which mouse buttons the positioner object will react to. ***************************************/ void fl_get_positioner_mouse_buttons( FL_OBJECT * obj, unsigned int * mouse_buttons ) { FLI_POSITIONER_SPEC *sp; int i; unsigned int k; if ( ! obj ) { M_err( "fl_get_positioner_mouse_buttons", "NULL object" ); return; } if ( ! mouse_buttons ) return; sp = obj->spec; *mouse_buttons = 0; for ( i = 0, k = 1; i < 5; i++, k <<= 1 ) *mouse_buttons |= sp->react_to[ i ] ? k : 0; } /*************************************** * Returns the number of the last used mouse button. * fl_mouse_button will also return the mouse number ***************************************/ int fl_get_positioner_numb( FL_OBJECT * obj ) { return ( ( FLI_POSITIONER_SPEC * ) obj->spec )->mousebut; } /*************************************** * Allows to set a validator function for new positions ***************************************/ FL_POSITIONER_VALIDATOR fl_set_positioner_validator( FL_OBJECT * obj, FL_POSITIONER_VALIDATOR validator ) { FLI_POSITIONER_SPEC *sp = obj->spec; FL_POSITIONER_VALIDATOR old_validator = sp->validator; if ( ! validator ) { if ( sp->xstep != 0.0 ) sp->xval = FL_nlong( sp->xval / sp->xstep ) * sp->xstep; if ( sp->ystep != 0.0 ) sp->yval = FL_nlong( sp->yval / sp->ystep ) * sp->ystep; sp->xval = fli_clamp( sp->xval, sp->xmin, sp->xmax ); sp->yval = fli_clamp( sp->yval, sp->ymin, sp->ymax ); } else { int ret; double x, y; ret = validator( obj, sp->xval, sp->yval, &x, &y ); if ( ret == FL_POSITIONER_INVALID ) M_warn( "fl_set_positioner_validator", "Current positioner values not within valid range" ); else if ( ret == FL_POSITIONER_REPLACED ) { sp->xval = x; sp->yval = y; } } sp->validator = validator; fl_redraw_object( obj ); return old_validator; } /*************************************** * Function to be called for overlay positioners before what it is on top * of is changed: undraws the lines of the positioner - they will get * redrawn once the object under the positioner has been redrawn. ***************************************/ void fl_reset_positioner( FL_OBJECT * obj ) { if ( obj->type == FL_OVERLAY_POSITIONER ) handle_background( obj, 1 ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/dial.c0000664000175000017500000003660012353623325011613 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file dial.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Default 0 is at 6 oclock and clock-wise is positive. */ #define SIX_OCLOCK 1 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/pdial.h" #include #include #include #ifndef M_PI #define M_PI 3.14159265359 #endif static double xo, yo; /*************************************** ***************************************/ static void rotate_it( FL_POINT * xp, double x, double y, double a ) { double sina = sin( a ); double cosa = cos( a ); xp->x = FL_crnd( xo + ( x - xo ) * cosa + ( y - yo ) * sina ); xp->y = FL_crnd( yo - ( x - xo ) * sina + ( y - yo ) * cosa ); } /*************************************** * Draws a dial ***************************************/ static void draw_dial( FL_OBJECT * obj ) { FL_Coord x, y, w, h, radius; double dangle; FLI_DIAL_SPEC *sp = obj->spec; FL_POINT xp[ 5 ]; /* need one extra for closing of polygon! */ int boxtype, iradius; /* Since rotate_it() always does the rotation in the math way, i.e. 0 at three o'clock and CCW, need to translate the current theta into that coordiante system */ dangle = ( sp->val - sp->b ) / sp->a; if ( sp->direction == FL_DIAL_CW ) dangle = sp->origin - dangle; else dangle += sp->origin; if ( ( dangle = fmod( dangle, 360.0 ) ) < 0.0 ) dangle += 360.0; dangle *= M_PI / 180.0; w = obj->w - 3; h = obj->h - 3; x = xo = obj->x + obj->w / 2; y = yo = obj->y + obj->h / 2; if ( FL_IS_UPBOX( obj->boxtype ) ) boxtype = FL_OVAL3D_UPBOX; else if ( FL_IS_DOWNBOX( obj->boxtype ) ) boxtype = FL_OVAL3D_DOWNBOX; else if ( obj->boxtype == FL_FRAME_BOX ) boxtype = FL_OVAL3D_FRAMEBOX; else if ( obj->boxtype == FL_EMBOSSED_BOX ) boxtype = FL_OVAL3D_EMBOSSEDBOX; else boxtype = FL_OVAL_BOX; /* the dial itself */ radius = 0.5 * FL_min( w, h ); iradius = radius - 1; /* internal radius */ fl_draw_box( boxtype, x - radius, y - radius, 2 * radius, 2 * radius, obj->col1, obj->bw ); /* the "hand" */ if ( obj->type == FL_NORMAL_DIAL ) { FL_Coord r; r = FL_min( 0.5 * iradius, 15 ); rotate_it( xp, x + iradius - 1, y - 2, dangle ); rotate_it( xp + 1, x + iradius - 1 - r, y - 2, dangle ); rotate_it( xp + 2, x + iradius - 1 - r, y + 2, dangle ); rotate_it( xp + 3, x + iradius - 1, y + 2, dangle ); fl_polyf( xp, 4, obj->col2 ); } else if ( obj->type == FL_LINE_DIAL ) { double dx = 0.1 + 0.08 * iradius, dy = 0.1 + 0.08 * iradius; rotate_it( xp, x, y, dangle ); rotate_it( xp + 1, x + dx, y - dy, dangle ); rotate_it( xp + 2, x + iradius - 2, y, dangle ); rotate_it( xp + 3, x + dx, y + dy, dangle ); fl_polybound( xp, 4, obj->col2 ); } else if ( obj->type == FL_FILL_DIAL ) { double ti, delta; delta = ( sp->val - sp->b ) / sp->a; delta = FL_abs( sp->thetai - delta ); delta = sp->direction == FL_DIAL_CW ? -delta : delta; iradius -= boxtype != FL_OVAL_BOX; if ( sp->direction == FL_DIAL_CCW ) ti = sp->thetai + sp->origin; else ti = sp->origin - sp->thetai; if ( ( ti = fmod( ti, 360.0 ) ) < 0.0 ) ti += 360.0; fl_ovalarc( 1, xo - iradius, yo - iradius, 2 * iradius, 2 * iradius, ti * 10, delta * 10, obj->col2 ); rotate_it( xp, xo + iradius - 1, yo, dangle ); rotate_it( xp + 1, xo + iradius - 1, yo, ti * M_PI / 180.0 ); fl_simple_line( FL_crnd( xo ), FL_crnd( yo ), xp[ 0 ].x, xp[ 0 ].y, FL_BLACK ); fl_simple_line( FL_crnd( xo ), FL_crnd( yo ), xp[ 1 ].x, xp[ 1 ].y, FL_BLACK ); if ( boxtype == FL_OVAL_BOX ) fl_circ( x, y, iradius, FL_BLACK ); } else M_err( "draw_dial", "Bad type" ); fl_draw_text_beside( obj->align, obj->x, obj->y, obj->w, obj->h, obj->lcol, obj->lstyle, obj->lsize, obj->label ); } /*************************************** * Handle a mouse position change ***************************************/ static int handle_mouse( FL_OBJECT * obj, FL_Coord mousex, FL_Coord mousey ) { FLI_DIAL_SPEC *sp = obj->spec; double oldv, val, olda; double mx, my, angle, range = sp->max - sp->min; oldv = sp->val; olda = ( oldv - sp->b ) / sp->a; /* convert to sane FL_coordinate system, i.e., +y up */ mx = mousex - ( obj->x + obj->w * 0.5 ); my = - mousey + ( obj->y + obj->h * 0.5 ); /* Don't react to clicks very close to center */ if ( fabs( mx ) < 2 && fabs( my ) < 2 ) return FL_RETURN_NONE; /* Get angle and normalize to [0, 2 * PI] */ angle = atan2( my, mx ) * 180.0 / M_PI; if ( sp->direction == FL_DIAL_CW ) angle = sp->origin - angle; else angle -= sp->origin; if ( ( angle = fmod( angle, 360.0 ) ) < 0.0 ) angle += 360.0; val = fli_clamp( sp->a * angle + sp->b, sp->min, sp->max ); /* Check if crossed boundary. Fix it if it did. Fixing is necessary otherwise might be unable to reach thetaf(360) */ if ( ! sp->cross_over && fabs( oldv - val ) > 0.6 * range ) { if ( fabs( olda - sp->thetai ) < fabs( olda - sp->thetaf ) ) angle = sp->thetai; else angle = sp->thetaf; val = sp->a * angle + sp->b; } if ( sp->step != 0.0 ) val = ( int ) ( val / sp->step + 0.5 ) * sp->step; /* Allow a resolution of about 0.2 degrees */ if ( fabs( val - oldv ) > range / 1800.0 ) { sp->val = val; fl_redraw_object( obj ); return FL_RETURN_CHANGED; } return FL_RETURN_NONE; } /*************************************** * Function for handling mouse wheel events ***************************************/ static int handle_mouse_wheel( FL_OBJECT * obj, XEvent * xev, int key ) { FLI_DIAL_SPEC *sp = obj->spec; double val, step, oldv = sp->val, range = sp->max - sp->min; if ( key != FL_MBUTTON4 && key != FL_MBUTTON5 ) return FL_RETURN_NONE; step = sp->step > 0.0 ? 10.0 * sp->step : 0.1 * range; if ( shiftkey_down( ( ( XButtonEvent * ) xev )->state ) ) step *= 0.1; else if ( controlkey_down( ( ( XButtonEvent * ) xev )->state ) ) step *= 2.5; if ( sp->direction == FL_DIAL_CW ) step = key == FL_MBUTTON4 ? - step : step; else step = key == FL_MBUTTON4 ? step : - step; val = sp->val + step; if ( sp->cross_over ) { while ( val > sp->max ) val -= range; while ( val < sp->min ) val += range; } else { if ( val > sp->max ) val = sp->max; else if ( val < sp->min ) val = sp->min; } if ( val != oldv ) { sp->val = val; fl_redraw_object( obj ); return FL_RETURN_CHANGED; } return FL_RETURN_NONE; } /*************************************** * Handles an event ***************************************/ static int handle_dial( FL_OBJECT * obj, int event, FL_Coord mx, FL_Coord my, int key FL_UNUSED_ARG, void * ev ) { FLI_DIAL_SPEC *sp = obj->spec; int ret = FL_RETURN_NONE; switch ( event ) { case FL_ATTRIB : obj->align = fl_to_outside_lalign( obj->align ); break; case FL_DRAW: draw_dial( obj ); break; case FL_DRAWLABEL: fl_draw_text_beside( obj->align, obj->x, obj->y, obj->w, obj->h, obj->lcol, obj->lstyle, obj->lsize, obj->label ); break; case FL_PUSH: if ( key != FL_MBUTTON1 ) break; sp->start_val = sp->val; /* fall through */ case FL_MOTION: if ( key != FL_MBUTTON1 ) break; if ( ( ret = handle_mouse( obj, mx, my ) ) && ! ( obj->how_return & FL_RETURN_END_CHANGED ) ) sp->start_val = sp->val; break; case FL_RELEASE: if ( key == FL_MBUTTON2 || key == FL_MBUTTON3 ) break; ret = handle_mouse_wheel( obj, ev, key ) | FL_RETURN_END; if ( sp->start_val != sp->val ) ret |= FL_RETURN_CHANGED; break; case FL_FREEMEM: fl_free( obj->spec ); break; } return ret; } /*************************************** ***************************************/ static void get_mapping( FLI_DIAL_SPEC *sp ) { sp->a = ( sp->max - sp->min ) / ( sp->thetaf - sp->thetai ); sp->b = sp->max - sp->a * sp->thetaf; } /*************************************** * Creates an object ***************************************/ FL_OBJECT * fl_create_dial( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; FLI_DIAL_SPEC *sp; obj = fl_make_object( FL_DIAL, type, x, y, w, h, label, handle_dial ); obj->col1 = FL_DIAL_COL1; obj->col2 = FL_DIAL_COL2; obj->align = FL_DIAL_ALIGN; obj->lcol = FL_DIAL_LCOL; obj->boxtype = FL_DIAL_BOXTYPE; obj->spec = sp = fl_calloc( 1, sizeof *sp ); sp->min = 0.0; sp->max = 1.0; sp->val = 0.5; sp->step = 0.0; sp->thetai = 0.0; sp->thetaf = 360.0; sp->origin = 270.0; sp->direction = FL_DIAL_CW; get_mapping( sp ); return obj; } /*************************************** * Add an object ***************************************/ FL_OBJECT * fl_add_dial( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj = fl_create_dial( type, x, y, w, h, label ); /* Set default return policy for the object */ fl_set_object_return( obj, FL_RETURN_END_CHANGED ); fl_add_object( fl_current_form, obj ); fl_set_object_dblbuffer( obj, 1 ); return obj; } /*************************************** ***************************************/ void fl_set_dial_value( FL_OBJECT * obj, double val ) { FLI_DIAL_SPEC *sp = obj->spec; if ( sp->val != val ) { sp->val = sp->start_val = val; fl_redraw_object( obj ); } } /*************************************** ***************************************/ void fl_set_dial_bounds( FL_OBJECT * obj, double min, double max ) { FLI_DIAL_SPEC *sp = obj->spec; if ( sp->min != min || sp->max != max ) { sp->min = min; sp->max = max; get_mapping( sp ); sp->val = fli_clamp( sp->val, sp->min, sp->max ); fl_redraw_object( obj ); } } /*************************************** ***************************************/ void fl_set_dial_angles( FL_OBJECT * obj, double amin, double amax ) { FLI_DIAL_SPEC *sp = obj->spec; if ( ( amin = fmod( amin, 360.0 ) ) < 0.0 ) amin += 360.0; if ( ( amax = fmod( amax, 360.0 ) ) <= 0.0 ) amax += 360.0; if ( sp->thetaf != amax || sp->thetai != amin ) { sp->thetaf = amax; sp->thetai = amin; get_mapping( sp ); fl_redraw_object( obj ); } } /*************************************** ***************************************/ void fl_get_dial_angles( FL_OBJECT * obj, double * amin, double * amax ) { FLI_DIAL_SPEC *sp = obj->spec; *amin = sp->thetai; *amax = sp->thetaf; } /*************************************** ***************************************/ void fl_set_dial_cross( FL_OBJECT * obj, int flag ) { ( ( FLI_DIAL_SPEC * ) obj->spec )->cross_over = flag; } /*************************************** ***************************************/ double fl_get_dial_value( FL_OBJECT * obj ) { return ( ( FLI_DIAL_SPEC * ) obj->spec )->val; } /*************************************** ***************************************/ void fl_get_dial_bounds( FL_OBJECT * obj, double * min, double * max ) { *min = ( ( FLI_DIAL_SPEC * ) obj->spec )->min; *max = ( ( FLI_DIAL_SPEC * ) obj->spec )->max; } /*************************************** * Sets under which conditions the object is to be returned to the * application. This function should be regarded as deprecated and * fl_set_object_return() should be used instead. ***************************************/ void fl_set_dial_return( FL_OBJECT * obj, unsigned int when ) { fl_set_object_return( obj, when ); } /*************************************** * Sets the step size to which values are rounded. ***************************************/ void fl_set_dial_step( FL_OBJECT * obj, double value ) { ( ( FLI_DIAL_SPEC * ) obj->spec )->step = value; } /*************************************** * Returns the step size to which values are rounded. ***************************************/ double fl_get_dial_step( FL_OBJECT * obj ) { return ( ( FLI_DIAL_SPEC * ) obj->spec )->step; } /*************************************** ***************************************/ void fl_set_dial_direction( FL_OBJECT * obj, int dir ) { FLI_DIAL_SPEC *sp = obj->spec; if ( sp->direction != dir ) { sp->direction = dir; get_mapping( sp ); fl_redraw_object( obj ); } } /*************************************** ***************************************/ int fl_get_dial_direction( FL_OBJECT * obj ) { return ( ( FLI_DIAL_SPEC * ) obj->spec )->direction; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/errmsg.c0000644000175000017500000001125612320557103012171 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file errmsg.c * * Copyright(c) 1993,1994 by T.C. Zhao * All rights reserved. * * Error handling routines. * * Messages are divided into graphics and non-graphics types. * For graphical error messages, a user input may be demanded, * while for non-graphical messages, a string is printed and * does nothing else. * * The graphical output routine must have the following form: * void (*gmout)(const char *, const char *, const char *, int); */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include "local.h" /* up stairs */ #include "include/forms.h" #include "flinternal.h" #include "private/flvasprintf.h" #include "ulib.h" extern int errno; /* system error no */ #ifndef HAVE_STRERROR extern char *sys_errlist[ ]; #endif /********************************************************************** * msg_threshold controls amount of message to print * 0: only error 1: error and warning * 2: info 3: more info * 4: debugging 5: trace **********************************************************************/ /************ Local variables ****************************************/ static FILE *errlog; /* where the msg is going */ static int threshold; /* current threshold */ static int level; /* requested message level */ static const char *file; /* source file name */ static int lineno = 0; /* line no. in that file */ FL_ERROR_FUNC efp_; /* global pointer to shut up lint */ FL_ERROR_FUNC user_error_function_; /* hook for application error handler */ /*************************************** * set up where err is gonna go ***************************************/ void fl_set_err_logfp( FILE * fp ) { if ( fp ) errlog = fp; } /*************************************** ***************************************/ void fl_set_error_handler( FL_ERROR_FUNC user_func) { user_error_function_ = user_func; } /*************************************** ***************************************/ const char * fli_get_syserror_msg( void ) { const char *pp; #ifdef HAVE_STRERROR pp = errno ? strerror( errno ) : ""; #else pp = errno ? sys_errlist[ errno ] : ""; #endif return pp; } /*************************************** * Message levels ***************************************/ void fli_set_msg_threshold( int mlevel ) { threshold = mlevel; } /******************************************************************** * Generate two strings that contain where and why an error occured *********************************************************************/ static void P_errmsg( const char * func, const char * fmt, ... ) { char line[ ( int ) log10( INT_MAX ) + 3 ], *why; /* Return if there is nothing to do */ if ( level >= threshold ) return; if ( ! errlog ) errlog = stderr; EXPAND_FORMAT_STRING( why, fmt ); if ( lineno > 0 ) sprintf( line, "%d", lineno ); else strcpy( line, "?" ); if ( func && *func ) fprintf( errlog, "In %s() [%s:%s]: %s\n", func, file, line, why ? why : "" ); else fprintf( errlog, "In [%s:%s]: %s\n", file, line, why ? why : "" ); fli_safe_free( why ); } /********************************************************************* * Set the level, line number and file where error occurred, return * the function to use for outputting the error message ********************************************************************/ FL_ERROR_FUNC fli_error_setup( int lev, const char * f, int l ) { file = f; lineno = l; level = lev; return user_error_function_ ? user_error_function_ : P_errmsg; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/ulib.h0000664000175000017500000000657412244217405011646 00000000000000/* * * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file ulib.h * * Macros and Prototypes for the utilities routines */ #ifndef TC_ULIB_H #define TC_ULIB_H #include /* for FILE */ #include #ifndef FL_EXPORT # if ! defined FL_WIN32 || ! defined SHARED_LIB # define FL_EXPORT # else # ifdef MAKING_FORMS # define FL_EXPORT __declspec( dllexport ) extern # else # define FL_EXPORT __declspec( dllimport ) extern # endif /* MAKING_FORMS */ # endif /* FL_WIN32 */ #endif /* !def FL_EXPORT */ /***************** Portable IO operations *******************{**/ int fli_readint( FILE * ); int fli_readpint( FILE * ); int fli_readhexint( FILE * ); int fli_fget4MSBF( FILE * ); int fli_fput4MSBF( int, FILE * ); int fli_fget2LSBF( FILE * ); int fli_fput2LSBF( int, FILE * ); int fli_fget2MSBF( FILE * ); int fli_fput2MSBF( int, FILE * ); int fli_fget4LSBF( FILE *); int fli_fput4LSBF( int, FILE * ); /********** End of Portable IO *******************}**/ char * fli_de_space( char * ); char * fli_space_de( char * ); char * fli_de_space_de( char * ); char * fli_nuke_all_non_alnum( char * ); /********************************************************************* * Basic error handling routines ********************************************************************/ /* Message levels (verbosity). Error generating routine should * have a (positive) control parameter specifying how loud * to bark (i.e., amount of messages generated) */ # define ML_ERR -1 # define ML_WARN 0 # define ML_INFO1 1 # define ML_INFO2 2 # define ML_DEBUG 3 # define ML_TRACE 4 FL_ERROR_FUNC fli_error_setup( int, const char *, int ); extern FL_ERROR_FUNC efp_; extern FL_ERROR_FUNC user_error_function_; /* Define the actual names that will be used */ # define M_err \ ( efp_ = fli_error_setup( ML_ERR, __FILE__, __LINE__ ) ), efp_ # define M_warn \ ( efp_ = fli_error_setup( ML_WARN, __FILE__, __LINE__ ) ), efp_ # define M_info \ ( efp_ = fli_error_setup( ML_INFO1, __FILE__, __LINE__ ) ), efp_ # define M_info2 \ ( efp_ = fli_error_setup( ML_INFO2, __FILE__, __LINE__ ) ), efp_ # define M_debug \ ( efp_ = fli_error_setup( ML_DEBUG, __FILE__, __LINE__ ) ), efp_ # define M_trace \ ( efp_ = fli_error_setup( ML_TRACE, __FILE__, __LINE__ ) ), efp_ /****** Misc. control routines **********/ void fli_set_msg_threshold( int ); const char *fli_get_syserror_msg( void ); #endif /* TC_ULIB_H */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/keyboard.c0000644000175000017500000000257012251554136012477 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file keyboard.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao * All rights reserved. * * Misc. keyboard routines */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" /*************************************** ***************************************/ void fl_ringbell( int percent ) { if ( percent < -100 ) percent = -100; else if ( percent > 100 ) percent = 100; if ( flx->display ) XBell( flx->display, percent ); else fprintf( stderr, "\a" ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/asyn_io.c0000644000175000017500000001653012344627027012344 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file asyn_io.c *. * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao * All rights reserved. * * Handle input other than the X event queue. Mostly maintanance * here. Actual input/output handling is triggered in the main loop * via fli_watch_io(). */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include #ifndef FL_WIN32 #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #ifdef __sgi #include #endif #ifdef FL_WIN32 #include #endif static fd_set st_rfds, st_wfds, st_efds; static void add_to_freelist( FLI_IO_REC * io ); static void clear_freelist( void ); /*************************************** * Collect all the fd_sets so we don't do it inside the * critical select inner loop ***************************************/ static void collect_fds( void ) { FLI_IO_REC *p; int nf = 0; /* Initialize the sets */ FD_ZERO( &st_rfds ); FD_ZERO( &st_wfds ); FD_ZERO( &st_efds ); /* Loop through all requested IOs */ for ( p = fli_context->io_rec; p; p = p->next ) { if ( p->source < 0 ) { M_err( "collect_fds", "source < 0\n" ); continue; } if ( p->mask & FL_READ ) FD_SET( p->source, &st_rfds ); if ( p->mask & FL_WRITE ) FD_SET( p->source, &st_wfds ); if ( p->mask & FL_EXCEPT ) FD_SET( p->source, &st_efds ); if ( nf < p->source + 1 ) nf = p->source + 1; } fli_context->num_io = nf; } /*************************************** * Register a callback function for file descriptor fd ***************************************/ void fl_add_io_callback( int fd, unsigned int mask, FL_IO_CALLBACK callback, void * data ) { FLI_IO_REC *io_rec; /* Create new record and make it the start of the list */ io_rec = fl_malloc( sizeof *io_rec ); io_rec->next = fli_context->io_rec; io_rec->callback = callback; io_rec->data = data; io_rec->source = fd; io_rec->mask = mask; fli_context->io_rec = io_rec; collect_fds( ); } /*************************************** ***************************************/ void fl_remove_io_callback( int fd, unsigned int mask, FL_IO_CALLBACK cb ) { FLI_IO_REC *io, *previous_io = NULL; for ( io = fli_context->io_rec; io && ! ( io->source == fd && io->callback == cb && io->mask & mask ); io = io->next ) previous_io = io; if ( ! io ) { M_err( "fl_remove_io_callback", "Non-existent handler for %d", fd ); return; } /* If after removal the fd isn't to be checked anymore (i.e. mask == 0) remove it from global record */ if ( ! ( io->mask &= ~ mask ) ) { if ( previous_io ) previous_io->next = io->next; else fli_context->io_rec = io->next; /* Caution: the following may look idiotic at first: simply getting rid of the structure for the callback would seem to be appropriate. But things get interesting if the callback gets removed from within the callback - then just removing it gets us into trouble since then fli_watch_io(), iterating over all IO callbacks still tries to to access the 'next' field and if the structure has been deallocated completely (instead of having been temporarily moved to somewhere else where it still can be accessed) it stumbles badly. That's also why fli_watch_io() calls clear_freelist() - it's the only place where it's known when the structure isn't needed anymore. */ add_to_freelist( io ); } collect_fds( ); } /*************************************** * Watch for activities using select or poll. Timeout is in milli-seconds. ***************************************/ void fli_watch_io( FLI_IO_REC * io_rec, long msec ) { fd_set rfds, wfds, efds; struct timeval timeout; FLI_IO_REC *p; int nf; clear_freelist( ); if ( ! io_rec ) { if ( msec > 0 ) fl_msleep( msec ); return; } timeout.tv_usec = 1000 * ( msec % 1000 ); timeout.tv_sec = msec / 1000; /* Initialize the sets */ rfds = st_rfds; wfds = st_wfds; efds = st_efds; /* Now watch it. HP defines rfds to be ints. Althought compiler will bark, it is harmless. */ nf = select( fli_context->num_io, &rfds, &wfds, &efds, &timeout ); if ( nf < 0 ) /* something is wrong. */ { if ( errno == EINTR ) M_warn( "fli_watch_io", "select interrupted by signal" ); /* select() on some platforms returns -1 with errno == 0 */ else if ( errno != 0 ) M_err( "fli_watch_io", fli_get_syserror_msg( ) ); return; } /* Timeout expired */ if ( nf == 0 ) return; /* Handle it */ for ( p = io_rec; p; p = p->next ) { if ( ! p->callback || p->source < 0 || p->mask == 0 ) continue; if ( p->mask & FL_READ && FD_ISSET( p->source, &rfds ) ) p->callback( p->source, p->data ); if ( p->mask & FL_WRITE && FD_ISSET( p->source, &wfds ) ) p->callback( p->source, p->data ); if ( p->mask & FL_EXCEPT && FD_ISSET( p->source, &efds ) ) p->callback( p->source, p->data ); } clear_freelist( ); } /*************************************** ***************************************/ int fli_is_watched_io( int fd ) { FLI_IO_REC *p; for ( p = fli_context->io_rec; p; p = p->next ) if ( p->source == fd && p->mask ) return 1; return 0; } /*************************************** ***************************************/ static struct free_list { struct free_list * next; FLI_IO_REC * io; } *fl = NULL; static void add_to_freelist( FLI_IO_REC * io ) { struct free_list *cur; cur = malloc( sizeof *cur ); cur->next = fl; cur->io = io; fl = cur; } /*************************************** ***************************************/ static void clear_freelist( void ) { struct free_list *cur; while ( fl ) { fl_free( fl->io ); cur = fl; fl = fl->next; fl_free( cur ); } } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/menu.c0000664000175000017500000005735112353623325011654 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file menu.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * XForms Class FL_MENU. * call PopUp to handle the actual random access * * possible optimization: * upon first creation of the popup, set extern_menu to the popup ID * and let popup manage all the modes/values from then on. * * OR use the following to simplify code for extern pup * when extern_menu is used, gets all text and mode, then * all the code would be the same for extern and native menu. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/pmenu.h" #include #include #include #define ISPUP( sp ) ( ( sp )->extern_menu >= 0 ) /*************************************** * Returns the index into the array of items from the items menu ID ***************************************/ static int val_to_index( FL_OBJECT * ob, int val ) { int i; FLI_MENU_SPEC *sp = ob->spec; if ( ISPUP( sp ) ) return val; for ( i = 1; i <= sp->numitems; i++ ) if ( val == sp->mval[ i ] ) return i; return -1; } /*************************************** * Creates the menu and shows it. Returns the item selected. ***************************************/ static int do_menu_low_level( FL_OBJECT * ob ) { int popup_id, i, val, k; FLI_MENU_SPEC *sp = ob->spec; /* The number of items can be 0 only if the menu is an external popup */ if ( sp->numitems == 0 && ! ISPUP( sp ) ) return 0; /* If it's an external popup let the xpopup code deal with everything */ if ( ISPUP( sp ) ) { if ( ob->label && *ob->label && ob->type != FL_PULLDOWN_MENU ) fl_setpup_title( sp->extern_menu, ob->label ); if ( ( val = fl_dopup( sp->extern_menu ) ) > 0 ) sp->val = val; return val; } /* Create a new popup */ popup_id = fl_newpup( FL_ObjWin( ob ) ); if ( ob->type != FL_PULLDOWN_MENU && ! sp->no_title ) fl_setpup_title( popup_id, ob->label ); else fl_setpup_softedge( popup_id, 1 ); for ( i = 1; i <= sp->numitems; i++ ) { if ( sp->mval[ i ] == i && ! sp->cb[ i ] ) fl_addtopup( popup_id, sp->items[ i ] ); else { char *s = fl_malloc( strlen( sp->items[ i ] ) + 6 + log10( INT_MAX ) ); sprintf( s, "%s%%x%d%s", sp->items[ i ], sp->mval[ i ], sp->cb[ i ] ? "%f" : "" ); if ( ! sp->cb[ i ] ) fl_addtopup( popup_id, s ); else fl_addtopup( popup_id, s, sp->cb[ i ] ); fl_free( s ); } if ( sp->modechange[ i ] || sp->mode[ i ] != FL_PUP_NONE ) { fl_setpup_mode( popup_id, sp->mval[ i ], sp->mode[ i ] ); sp->modechange[ i ] = 0; } fl_setpup_shortcut( popup_id, sp->mval[ i ], sp->shortcut[ i ] ); } /* Pulldown menus and those without a title appear directly below the menu itself, the others more or less on top of the menu */ if ( ob->type == FL_PULLDOWN_MENU || sp->no_title ) fl_setpup_position( ob->form->x + ob->x + 1, ob->form->y + ob->y + ob->h + 1 ); else fl_setpup_position( ob->form->x + ob->x + 5, ob->form->y + ob->y + 5 ); /* Now do the user interaction */ val = fl_dopup( popup_id ); /* Deal with whatever is needed according to the return value */ if ( val > 0 && ( k = val_to_index( ob, val ) ) > 0 ) { /* If shown for the first time, need to get all mode right as the menu item string may have embedded mode setting strings in it */ if ( sp->shown == 0 ) { for ( i = 1; i <= sp->numitems; i++ ) { int m = fl_getpup_mode( popup_id, sp->mval[ i ] ); sp->modechange[ i ] = sp->mode[ i ] != m; sp->mode[ i ] = m; sp->shown = 1; } } else { sp->mode[ k ] = fl_getpup_mode( popup_id, val ); sp->modechange[ k ] = 1; /* Old val also might change mode if binary */ if ( sp->val > 0 ) { int m = fl_getpup_mode( popup_id, sp->mval[ sp->val ] ); sp->modechange[ sp->val ] = sp->mode[ sp->val ] != m; sp->mode[ sp->val ] = m; } } sp->val = k; } /* Get rid of the popup */ fl_freepup( popup_id ); return val; } /*************************************** ***************************************/ static int do_menu( FL_OBJECT *ob ) { int val; ob->pushed = 1; fl_redraw_object( ob ); val = do_menu_low_level( ob ) > 0; ob->pushed = 0; fl_redraw_object( ob ); return val > 0; } /*************************************** * Handles an event, return non-zero if an item has been selected. ***************************************/ static int handle_menu( FL_OBJECT * ob, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { FLI_MENU_SPEC *sp = ob->spec; int val, boxtype = ob->boxtype; FL_COLOR col; int ret = FL_RETURN_NONE; #if FL_DEBUG >= ML_DEBUG M_info2( "handle_menu", fli_event_name( event ) ); #endif switch ( event ) { case FL_ATTRIB : ob->align = fl_to_inside_lalign( ob->align ); break; case FL_DRAW: /* Draw the object */ if ( ob->pushed ) { boxtype = FL_UP_BOX; col = ob->col2; } else col = ob->col1; fl_draw_box( boxtype, ob->x, ob->y, ob->w, ob->h, col, ob->bw ); fl_draw_text( ob->align, ob->x, ob->y, ob->w, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); if ( sp->showsymbol ) { int dm = 0.85 * FL_min( ob->w, ob->h ); fl_draw_text( 0, ob->x + ob->w - dm - 1, ob->y + 1, dm, dm, col, 0, 0, "@menu" ); } break; case FL_ENTER: if ( ob->type == FL_TOUCH_MENU && do_menu( ob ) > 0 ) ret |= FL_RETURN_CHANGED; break; case FL_PUSH: /* Touch menus and push menus without a title don't do anything on a button press */ if ( key != FL_MBUTTON1 || ( ob->type == FL_PUSH_MENU && sp->no_title ) ) break; if ( ob->type == FL_TOUCH_MENU ) { ret |= FL_RETURN_END; break; } if ( do_menu( ob ) > 0 ) ret |= FL_RETURN_END | FL_RETURN_CHANGED; break; case FL_RELEASE : /* Button release is only important for push menus without a title, all others get started by a button press or by just moving the mouse on top of it (and they also don't expect a release - that gets eaten by the popup handler) */ if ( key != FL_MBUTTON1 || ! ( ob->type == FL_PUSH_MENU && sp->no_title ) || mx < ob->x || mx > ob->x + ob->w || my < ob->y || my > ob->y + ob->h ) break; if ( do_menu( ob ) > 0 ) ret |= FL_RETURN_CHANGED | FL_RETURN_END; break; case FL_SHORTCUT: /* Show menu as highlighted */ ob->pushed = 1; fl_redraw_object( ob ); /* Do interaction and then redraw without highlighting */ val = do_menu( ob ); ob->pushed = 0; fl_redraw_object( ob ); if ( val > 0 ) ret |= FL_RETURN_CHANGED | FL_RETURN_END; break; case FL_FREEMEM: fl_clear_menu( ob ); fl_free( ob->spec ); return 0; } return ret; } /*************************************** * Creates a menu object ***************************************/ FL_OBJECT * fl_create_menu( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; FLI_MENU_SPEC *sp; obj = fl_make_object( FL_MENU, type, x, y, w, h, label, handle_menu ); obj->boxtype = FL_FLAT_BOX; obj->col1 = FL_MENU_COL1; obj->col2 = FL_MENU_COL2; obj->lcol = FL_MENU_LCOL; obj->lstyle = FL_NORMAL_STYLE; obj->align = FL_MENU_ALIGN; if ( type == FL_TOUCH_MENU ) fl_set_object_return( obj, FL_RETURN_CHANGED ); else fl_set_object_return( obj, FL_RETURN_END_CHANGED ); sp = obj->spec = fl_calloc( 1, sizeof *sp ); sp->extern_menu = -1; return obj; } /*************************************** * Adds a menu object ***************************************/ FL_OBJECT * fl_add_menu( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob; ob = fl_create_menu( type, x, y, w, h, label ); fl_add_object( fl_current_form, ob ); return ob; } /*************************************** * Clears the menu object ***************************************/ void fl_clear_menu( FL_OBJECT * ob ) { int i; FLI_MENU_SPEC *sp = ob->spec; if ( ISPUP( sp ) ) { fl_freepup( sp->extern_menu ); sp->extern_menu = -1; return; } sp->val = 0; sp->cur_val = 0; for ( i = 1; i <= sp->numitems; i++ ) { fli_safe_free( sp->items[ i ] ); fli_safe_free( sp->shortcut[ i ] ); sp->mode[ i ] = FL_PUP_NONE; sp->cb[ i ] = NULL; } sp->numitems = 0; } /*************************************** * Adds a line to the menu item. ***************************************/ static void addto_menu( FL_OBJECT * ob, const char * str, ... ) { FLI_MENU_SPEC *sp = ob->spec; int n; char *p; if ( ISPUP( sp ) || sp->numitems >= FL_MENU_MAXITEMS || sp->cur_val == INT_MAX ) return; n = ++sp->numitems; sp->items[ n ] = fl_strdup( str ); sp->shortcut[ n ] = fl_strdup( "" ); sp->mode[ n ] = FL_PUP_NONE; sp->cb[ n ] = NULL; /* Check if a callback function needs to be set */ if ( ( p = strstr( sp->items[ n ], "%f" ) ) ) { va_list ap; va_start( ap, str ); sp->cb[ n ] = va_arg( ap, FL_PUP_CB ); va_end( ap ); memmove( p, p + 2, strlen( p ) - 1 ); } /* Set the value for the menu (either the index or extract it from "%xn" */ if ( ! ( p = strstr( sp->items[ n ], "%x" ) ) ) sp->mval[ n ] = ++sp->cur_val; else { if ( ! isdigit( ( unsigned char ) p[ 2 ] ) ) { M_err( "addto_menu", "Missing number after %%x" ); sp->mval[ n ] = ++sp->cur_val; } else { char *eptr; sp->mval[ n ] = strtol( p + 2, &eptr, 10 ); while ( *eptr && isspace( ( unsigned char ) *eptr ) ) eptr++; if ( *eptr ) memmove( p, eptr, strlen( eptr ) + 1 ); else *p = '\0'; } } } /*************************************** * Sets the menu to a particular menu string ***************************************/ void fl_set_menu( FL_OBJECT * ob, const char * menustr, ... ) { char *t, *c; va_list ap; FLI_MENU_SPEC *sp = ob->spec; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_MENU ) ) { M_err( "fl_set_menu", "%s is not Menu class", ob ? ob->label : "" ); return; } #endif fl_clear_menu( ob ); /* Split up menu string at '|' chars and create an entry for each part */ va_start( ap, menustr ); t = fl_strdup( menustr ); for ( c = strtok( t, "|" ); c && sp->numitems < FL_CHOICE_MAXITEMS; c = strtok( NULL, "|" ) ) { FL_PUP_CB cb; if ( strstr( c, "%f" ) ) { cb = va_arg( ap, FL_PUP_CB ); addto_menu( ob, c, cb ); } else addto_menu( ob, c ); } if ( t ) fl_free( t ); va_end( ap ); } /*************************************** * Adds a line to the menu item. ***************************************/ int fl_addto_menu( FL_OBJECT * ob, const char * menustr, ... ) { FLI_MENU_SPEC *sp= ob->spec; char *t, *c; va_list ap; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_MENU ) ) { M_err( "fl_addto_menu", "%s is not Menu class", ob ? ob->label : "" ); return 0; } #endif /* Split up menu string at '|' chars and create an entry for each part */ va_start( ap, menustr ); t = fl_strdup( menustr ); for ( c = strtok( t, "|" ); c && sp->numitems < FL_CHOICE_MAXITEMS; c = strtok( NULL, "|" ) ) { FL_PUP_CB cb; if ( strstr( c, "%f" ) ) { cb = va_arg( ap, FL_PUP_CB ); addto_menu( ob, c, cb ); } else addto_menu( ob, c ); } if ( t ) fl_free( t ); va_end( ap ); return sp->numitems; } /*************************************** * Replaces a line in the menu item. ***************************************/ void fl_replace_menu_item( FL_OBJECT * ob, int numb, const char * str, ... ) { FLI_MENU_SPEC *sp = ob->spec; char *s, *p, *eptr; if ( ISPUP( sp ) ) { fli_replacepup_text( sp->extern_menu, numb, str ); return; } if ( ( numb = val_to_index( ob, numb ) ) <= 0 ) return; if ( sp->items[ numb ] ) fl_free( sp->items[ numb ] ); sp->cb[ numb ] = NULL; s = strdup( str ); if ( ( p = strstr( s, "%f" ) ) ) { va_list ap; va_start( ap, str ); sp->cb[ numb ] = va_arg( ap, FL_PUP_CB ); va_end( ap ); memmove( p, p + 2, strlen( p ) - 1 ); } if ( ( p = strstr( s, "%x" ) ) ) { if ( isdigit( ( unsigned char ) p[ 2 ] ) ) { sp->mval[ numb ] = strtol( p + 2, &eptr, 10 ); while ( *eptr && isspace( ( unsigned char ) *eptr ) ) eptr++; if ( *eptr ) memmove( p, eptr, strlen( eptr ) + 1 ); else *p = '\0'; } else { M_err( "fl_replace_menu_item", "Missing number after %%x" ); memmove( p, p + 2, strlen( p ) - 1 ); } } sp->items[ numb ] = s; } /*************************************** * Removes a line from the menu item. ***************************************/ void fl_delete_menu_item( FL_OBJECT * ob, int numb ) { int i; FLI_MENU_SPEC *sp = ob->spec; if ( ISPUP( sp ) || ( numb = val_to_index( ob, numb ) ) <= 0 ) return; fli_safe_free( sp->items[ numb ] ); fli_safe_free( sp->shortcut[ numb ] ); for ( i = numb; i < sp->numitems; i++ ) { sp->items[ i ] = sp->items[ i + 1 ]; sp->mode[ i ] = sp->mode[ i + 1 ]; sp->modechange[ i ] = sp->modechange[ i + 1 ]; sp->mval[ i ] = sp->mval[ i + 1 ]; sp->shortcut[ i ] = sp->shortcut[ i + 1 ]; sp->cb[ i ] = sp->cb[ i + 1 ]; } if ( sp->val == numb ) sp->val = -1; sp->items[ sp->numitems ] = NULL; sp->shortcut[ sp->numitems ] = NULL; sp->mode[ sp->numitems ] = FL_PUP_NONE; sp->modechange[ sp->numitems ] = 0; sp->mval[ sp->numitems ] = 0; sp->cb[ sp->numitems ] = NULL; sp->numitems--; } /*************************************** * Sets a callback function for a menu item ***************************************/ FL_PUP_CB fl_set_menu_item_callback( FL_OBJECT * ob, int numb, FL_PUP_CB cb ) { FLI_MENU_SPEC *sp = ob->spec; FL_PUP_CB old_cb; if ( ISPUP( sp ) || ( numb = val_to_index( ob, numb ) ) <= 0 ) return NULL; old_cb = sp->cb[ numb ]; sp->cb[ numb ] = cb; return old_cb; } /*************************************** * Sets a shortcut for a menu item ***************************************/ void fl_set_menu_item_shortcut( FL_OBJECT * ob, int numb, const char * str ) { FLI_MENU_SPEC *sp = ob->spec; if ( ISPUP( sp ) || ( numb = val_to_index( ob, numb ) ) <= 0 ) return; fli_safe_free( sp->shortcut[ numb ] ); sp->shortcut[ numb ] = fl_strdup( str ? str : "" ); } /*************************************** * Sets the display mode for the menu item ***************************************/ void fl_set_menu_item_mode( FL_OBJECT * ob, int numb, unsigned int mode ) { FLI_MENU_SPEC *sp = ob->spec; if ( ISPUP( sp ) ) fl_setpup_mode( sp->extern_menu, numb, mode ); else { if ( ( numb = val_to_index( ob, numb ) ) <= 0 ) return; sp->mode[ numb ] = mode; sp->modechange[ numb ] = 1; if ( mode & FL_PUP_CHECK ) sp->val = numb; } } /*************************************** * Sets the display mode for the menu item ***************************************/ int fl_set_menu_item_id( FL_OBJECT * ob, int index, int id ) { FLI_MENU_SPEC *sp = ob->spec; int old_id; if ( ISPUP( sp ) || id < 1 || index < 1 || index > sp->numitems ) return -1; old_id = sp->mval[ index ]; sp->mval[ index ] = id; return old_id; } /*************************************** * Makes the menu symbol visible or not ***************************************/ void fl_show_menu_symbol( FL_OBJECT * ob, int show ) { FLI_MENU_SPEC *sp = ob->spec; if ( ISPUP( sp ) ) return; sp->showsymbol = show; fl_redraw_object( ob ); } /*************************************** * Returns the number of the menu item selected. ***************************************/ int fl_get_menu( FL_OBJECT * ob ) { FLI_MENU_SPEC *sp = ob->spec; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_MENU ) ) { M_err( "fl_get_menu", "%s is not Menu class", ob ? ob->label : "" ); return 0; } #endif if ( ISPUP( sp ) ) return sp->val; return sp->val > 0 && sp->val <= sp->numitems ? sp->mval[ sp->val ] : -1; } /*************************************** * Returns rhe number of items in a menu ***************************************/ int fl_get_menu_maxitems( FL_OBJECT * ob ) { FLI_MENU_SPEC *sp = ob->spec; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_MENU ) ) { M_err( "fl_get_menu_maxitems", "%s is not Menu class", ob ? ob->label : "" ); return 0; } #endif return ISPUP( sp ) ? fl_getpup_items( sp->extern_menu ) : sp->numitems; } /*************************************** * Returns the text of the menu item selected. ***************************************/ const char * fl_get_menu_text( FL_OBJECT * ob ) { FLI_MENU_SPEC *sp = ob->spec; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_MENU ) ) { M_err( "fl_get_menu_text", "%s is not Menu class", ob ? ob->label : "" ); return NULL; } #endif if ( ISPUP( sp ) ) return fl_getpup_text( sp->extern_menu, sp->val ); return ( sp->val < 1 || sp->val > sp->numitems ) ? NULL : sp->items[ sp->val ]; } /*************************************** * Returns a string with the menu items text ***************************************/ const char * fl_get_menu_item_text( FL_OBJECT * ob, int numb ) { FLI_MENU_SPEC *sp = ob->spec; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_MENU ) ) { M_err( "fl_get_menu_item_text", "%s is not Menu class", ob ? ob->label : "" ); return NULL; } #endif if ( ISPUP(sp ) ) return fl_getpup_text( sp->extern_menu, numb ); numb = val_to_index( ob, numb ); return numb <= 0 ? NULL : sp->items[ numb ]; } /*************************************** * Returns the mode of a menu item ***************************************/ unsigned int fl_get_menu_item_mode( FL_OBJECT * ob, int numb ) { FLI_MENU_SPEC *sp = ob->spec; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_MENU ) ) { M_err( "fl_get_menu_item_mode", "%s is not Menu class", ob ? ob->label : "" ); return 0; } #endif if ( ISPUP( sp ) ) return fl_getpup_mode( sp->extern_menu, numb ); numb = val_to_index( ob, numb ); return numb <= 0 ? 0 : sp->mode[ numb ]; } /*************************************** * Makes an already existing popup a menu ***************************************/ void fl_set_menu_popup( FL_OBJECT * ob, int pup ) { #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_MENU ) ) { M_err( "fl_set_menu_popup", "%s is not Menu class", ob ? ob->label : "" ); return; } #endif ( ( FLI_MENU_SPEC * ) ob->spec )->extern_menu = pup; if ( ob->type == FL_PULLDOWN_MENU ) fl_setpup_shadow( pup, 0 ); } /*************************************** * Creates a popup and makes that a menu ***************************************/ int fl_set_menu_entries( FL_OBJECT * ob, FL_PUP_ENTRY * ent ) { int n; fl_clear_menu( ob ); n = fl_newpup( FL_ObjWin( ob ) ); fl_set_menu_popup( ob, fl_setpup_entries( n, ent ) ); if ( ob->type == FL_PULLDOWN_MENU ) { fl_setpup_bw( n, ob->bw ); fl_setpup_shadow( n, 0 ); } return n; } /*************************************** * If the menu is really a popup in disguise returns the popups number ***************************************/ int fl_get_menu_popup( FL_OBJECT * ob ) { FLI_MENU_SPEC *sp = ob->spec; return ISPUP( sp ) ? sp->extern_menu : -1; } /*************************************** * Allows to change the no-title attribute of a menu ***************************************/ int fl_set_menu_notitle( FL_OBJECT * ob, int off ) { FLI_MENU_SPEC *sp = ob->spec; int old = sp->no_title; sp->no_title = off; return old; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/browser.c0000664000175000017500000011002612353623325012360 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file browser.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Browser composite. * scrollbar redrawing can be further optimized. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/pbrowser.h" #include "private/flvasprintf.h" /*************************************** * Some attribue of the object changed, we better recalculate how * it should oook like ***************************************/ static void attrib_change( FL_OBJECT * ob ) { FLI_BROWSER_SPEC *sp = ob->spec; /* Text box stuff */ sp->tb->x = ob->x; sp->tb->y = ob->y; fli_set_object_visibility( sp->tb, FL_VISIBLE ); sp->tb->input = ob->input; sp->tb->type = ob->type; sp->tb->boxtype = ob->boxtype; sp->tb->lcol = ob->lcol; sp->tb->col1 = ob->col1; sp->tb->col2 = ob->col2; sp->tb->bw = ob->bw; fli_notify_object( sp->tb, FL_RESIZED ); /* Scrollbars */ if ( ob->boxtype == FL_DOWN_BOX && sp->hsl->type == FL_HOR_NICE_SCROLLBAR ) { sp->hsl->boxtype = FL_FRAME_BOX; sp->vsl->boxtype = FL_FRAME_BOX; } else if ( ob->boxtype == FL_DOWN_BOX && sp->hsl->type == FL_HOR_SCROLLBAR ) { sp->hsl->boxtype = FL_UP_BOX; sp->vsl->boxtype = FL_UP_BOX; } else { sp->hsl->boxtype = ob->boxtype; sp->vsl->boxtype = ob->boxtype; } sp->hsl->bw = sp->vsl->bw = ob->bw; if ( ! sp->user_set && ob->boxtype != FL_DOWN_BOX ) sp->vw = sp->vw_def = sp->hh = sp->hh_def = fli_get_default_scrollbarsize( ob ); } /*************************************** ***************************************/ static void get_geometry( FL_OBJECT * obj ) { FLI_BROWSER_SPEC *comp = obj->spec; FL_OBJECT *tb = comp->tb; FLI_TBOX_SPEC *sp = comp->tb->spec; int h_on = comp->h_on, v_on = comp->v_on; double old_xrel = fli_tbox_get_rel_xoffset( tb ); double old_yrel = fli_tbox_get_rel_yoffset( tb ); comp->hh = comp->vw = 0; comp->h_on = comp->v_on = 0; tb->w = obj->w; tb->h = obj->h; fli_tbox_recalc_area( tb ); /* Check if we need a vertical slider */ if ( ( sp->max_height > sp->h && comp->v_pref != FL_OFF ) || comp->v_pref == FL_ON ) { comp->v_on = 1; comp->vw = comp->vw_def; tb->w -= comp->vw; fli_tbox_recalc_area( tb ); } /* Check if we need a horizontal slider */ if ( ( sp->max_width > sp->w && comp->h_pref != FL_OFF ) || comp->h_pref == FL_ON ) { comp->h_on = 1; comp->hh = comp->hh_def; tb->h -= comp->hh; fli_tbox_recalc_area( tb ); } /* Due to the addition of a horizontal slider also a vertical slider may now be needed, so recheck for this possibility */ if ( ! comp->v_on && sp->max_height > sp->h && comp->v_pref != FL_OFF ) { comp->v_on = 1; comp->vw = comp->vw_def; tb->w -= comp->vw; fli_tbox_recalc_area( tb ); } if ( comp->v_on ) { comp->vsl->x = obj->x + obj->w - comp->vw; comp->vsl->y = obj->y; comp->vsl->w = comp->vw; comp->vsl->h = obj->h - comp->hh; fli_notify_object( comp->vsl, FL_RESIZED ); comp->vval = old_yrel; comp->vsize = comp->vinc1 = ( double ) sp->h / sp->max_height; comp->vinc2 = ( double ) sp->def_height / sp->max_height; } else { comp->vsize = 1.0; comp->vval = 0.0; } if ( comp->h_on ) { comp->hsl->x = obj->x; comp->hsl->y = obj->y + obj->h - comp->hh; comp->hsl->w = obj->w - comp->vw; comp->hsl->h = comp->hh; fli_notify_object( comp->hsl, FL_RESIZED ); comp->hval = old_xrel; comp->hsize = ( double ) sp->w / sp->max_width; comp->hinc1 = ( 8.0 * sp->def_height ) / sp->max_width; comp->hinc2 = ( sp->def_height - 2.0 ) / sp->max_width; } else { comp->hsize = 1.0; comp->hval = 1.0; } comp->dead_area = comp->h_on && comp->v_on; fli_set_object_visibility( comp->hsl, comp->h_on ); fli_set_object_visibility( comp->vsl, comp->v_on ); comp->attrib = 1; sp->no_redraw = 1; if ( comp->v_on ) { comp->vval = fli_tbox_set_rel_yoffset( tb, comp->vval ); fl_set_scrollbar_value( comp->vsl, comp->vval ); fl_set_scrollbar_size( comp->vsl, comp->vsize ); } if ( comp->h_on ) { comp->hval = fli_tbox_set_rel_xoffset( tb, comp->hval ); fl_set_scrollbar_value( comp->hsl, comp->hval ); fl_set_scrollbar_size( comp->hsl, comp->hsize ); } sp->no_redraw = 0; if ( h_on != comp->h_on || v_on != comp->v_on ) fli_notify_object( tb, FL_RESIZED ); } /*************************************** * The "dead area" is the small square in the lower right hand corner * of the browser (beside the horizontal slider and below the vertical * one) that shows up when both sliders are displayed. ***************************************/ static void draw_dead_area( FL_OBJECT * obj ) { FLI_BROWSER_SPEC *sp = obj->spec; if ( FL_ObjWin( sp->tb ) ) { fl_winset( FL_ObjWin( sp->tb ) ); fl_draw_box( FL_FLAT_BOX, obj->x + obj->w - sp->vw, obj->y + obj->h - sp->hh, sp->vw, sp->hh, sp->vsl->col1, 1 ); } } /*************************************** * Called for events concerning the browser ***************************************/ static int handle_browser( FL_OBJECT * obj, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { FLI_BROWSER_SPEC *sp = obj->spec; switch ( event ) { case FL_RESIZED : case FL_ATTRIB : sp->attrib = 1; break; case FL_DRAW: if ( sp->attrib ) { attrib_change( obj ); get_geometry( obj ); sp->attrib = 0; } draw_dead_area( obj ); /* fall through */ case FL_DRAWLABEL: fl_draw_object_label( obj ); break; case FL_FREEMEM: fl_free( sp ); break; } return FL_RETURN_NONE; } /*************************************** ***************************************/ static void redraw_scrollbar( FL_OBJECT * ob ) { FLI_BROWSER_SPEC *comp = ob->spec; attrib_change( ob ); get_geometry( ob ); fl_freeze_form( ob->form ); if ( comp->v_on ) { fl_set_scrollbar_size( comp->vsl, comp->vsize ); fl_set_scrollbar_value( comp->vsl, comp->vval ); if ( comp->vsize != 1.0 ) fl_set_scrollbar_increment( comp->vsl, comp->vinc1, comp->vinc2 ); } if ( comp->h_on ) { fl_set_scrollbar_size( comp->hsl, comp->hsize ); fl_set_scrollbar_value( comp->hsl, comp->hval ); if ( comp->hsize != 1.0 ) fl_set_scrollbar_increment( comp->hsl, comp->hinc1, comp->hinc2 ); } if ( comp->attrib ) { if ( comp->v_on ) fl_redraw_object( comp->vsl ); if ( comp->h_on ) fl_redraw_object( comp->hsl ); fl_redraw_object( comp->tb ); comp->attrib = 0; } draw_dead_area( ob ); fl_unfreeze_form( ob->form ); } /*************************************** ***************************************/ static void hcb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { FLI_BROWSER_SPEC *comp = obj->parent->spec; double hp = fli_tbox_set_rel_xoffset( comp->tb, fl_get_scrollbar_value( comp->hsl ) ); if ( obj->returned & FL_RETURN_END ) obj->parent->returned |= FL_RETURN_END; if ( hp != comp->old_hp ) obj->parent->returned |= FL_RETURN_CHANGED; if ( obj->parent->how_return & FL_RETURN_END_CHANGED && ! ( obj->parent->returned & FL_RETURN_CHANGED && obj->parent->returned & FL_RETURN_END ) ) obj->parent->returned = FL_RETURN_NONE; if ( obj->parent->returned & FL_RETURN_END ) comp->old_hp = hp; if ( obj->returned & FL_RETURN_CHANGED && comp->hcb ) comp->hcb( obj->parent, fli_tbox_get_topline( comp->tb ) + 1, comp->hcb_data ); } /*************************************** ***************************************/ static void vcb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { FLI_BROWSER_SPEC *comp = obj->parent->spec; double vp = fli_tbox_set_rel_yoffset( comp->tb, fl_get_scrollbar_value( comp->vsl ) ); if ( obj->returned & FL_RETURN_END ) obj->parent->returned |= FL_RETURN_END; if ( vp != comp->old_vp ) obj->parent->returned |= FL_RETURN_CHANGED; if ( obj->parent->how_return & FL_RETURN_END_CHANGED && ! ( obj->parent->returned & FL_RETURN_CHANGED && obj->parent->returned & FL_RETURN_END ) ) obj->parent->returned = FL_RETURN_NONE; if ( obj->parent->returned & FL_RETURN_END ) comp->old_vp = vp; if ( obj->returned & FL_RETURN_CHANGED && comp->vcb ) comp->vcb( obj->parent, fli_tbox_get_topline( comp->tb ) + 1, comp->vcb_data ); } /*************************************** * Textbox callback routine, we simply pass the return value of the * textbox on as the parents new return value after a readjustment of * the scollbars. ***************************************/ static void tbcb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { FLI_BROWSER_SPEC *psp = obj->parent->spec; double vp = fli_tbox_get_rel_yoffset( obj ); double hp = fli_tbox_get_rel_xoffset( obj ); if ( obj->returned & FL_RETURN_CHANGED ) { if ( hp != psp->old_hp ) { fl_set_scrollbar_value( psp->hsl, psp->old_hp = hp ); if ( psp->hcb ) psp->hcb( obj->parent, fli_tbox_get_topline( psp->tb ) + 1, psp->hcb_data ); } if ( vp != psp->old_vp ) { fl_set_scrollbar_value( psp->vsl, psp->old_vp = vp ); if ( psp->vcb ) psp->vcb( obj->parent, fli_tbox_get_topline( psp->tb ) + 1, psp->vcb_data ); } } obj->parent->returned = obj->returned; } /*************************************** * Textbox dblclick callback ***************************************/ static void tb_dblcallback( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FLI_BROWSER_SPEC *sp = ob->parent->spec; if ( sp->callback ) sp->callback( ob->parent, sp->callback_data ); } /*************************************** ***************************************/ static int tbpost( FL_OBJECT * ob, int ev, FL_Coord mx, FL_Coord my, int key, void * xev ) { FL_OBJECT *br = ob->parent; return br->posthandle ? br->posthandle( br, ev, mx, my, key, xev ) : 0; } /*************************************** ***************************************/ static int tbpre( FL_OBJECT * ob, int ev, FL_Coord mx, FL_Coord my, int key, void * xev ) { FL_OBJECT *br = ob->parent; return br->prehandle ? br->prehandle( br, ev, mx, my, key, xev ) : 0; } /*************************************** ***************************************/ int fli_get_default_scrollbarsize( FL_OBJECT * ob ) { int delta = ( FL_abs( ob->bw ) + 3 * ( ob->bw > 0 ) ); int flat = IS_FLATBOX( ob->boxtype ) ? 2 : 0; if ( ob->w > 250 && ob->h > 250 ) return 15 + delta - flat; else if ( ob->w < 150 || ob->h < 150 ) return 13 + delta - flat; else return 14 + delta - flat; } /*************************************** * Creates a new browser object to be added to a form ***************************************/ FL_OBJECT * fl_create_browser( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob; FLI_BROWSER_SPEC *sp; int D; ob = fl_make_object( FL_BROWSER, type, x, y, w, h, label, handle_browser ); sp = ob->spec = fl_calloc( 1, sizeof *sp ); sp->tb = fli_create_tbox( type, x, y, w, h, NULL ); sp->callback = NULL; sp->hsize = sp->vsize = sp->hval = sp->vval = sp->hinc1 = sp->hinc2 = sp->vinc1 = sp->vinc2 = 0.0; sp->hcb = sp->vcb = NULL; sp->hcb_data = sp->vcb_data = NULL; sp->old_hp = sp->old_vp = 0.0; sp->attrib = 1; /* Copy browser attributes from textbox */ ob->boxtype = sp->tb->boxtype; ob->lcol = sp->tb->lcol; ob->col1 = sp->tb->col1; ob->col2 = sp->tb->col2; ob->align = sp->tb->align; /* Textbox handlers */ fl_set_object_callback( sp->tb, tbcb, 0 ); fli_tbox_set_dblclick_callback( sp->tb, tb_dblcallback, 0 ); fl_set_object_posthandler( sp->tb, tbpost ); fl_set_object_prehandler( sp->tb, tbpre ); /* Scrollbars */ D = sp->vw_def = sp->hh_def = fli_get_default_scrollbarsize( ob ); sp->v_pref = sp->h_pref = FL_AUTO; sp->hsl = fl_create_scrollbar( fli_context->hscb, x, y + h - D, w - D, D, NULL ); fli_set_object_visibility( sp->hsl, sp->h_pref == FL_ON ); fl_set_object_callback( sp->hsl, hcb, 0 ); fl_set_scrollbar_value( sp->hsl, 0.0 ); fl_set_scrollbar_bounds( sp->hsl, 0.0, 1.0 ); sp->hsl->resize = FL_RESIZE_NONE; sp->vsl = fl_create_scrollbar( fli_context->vscb, x + w - D, y, D, h - D, NULL ); fli_set_object_visibility( sp->vsl, sp->v_pref == FL_ON ); fl_set_object_callback( sp->vsl, vcb, 0 ); fl_set_scrollbar_value( sp->vsl, 0.0 ); fl_set_scrollbar_bounds( sp->hsl, 0.0, 1.0 ); sp->vsl->resize = FL_RESIZE_NONE; fl_add_child( ob, sp->tb ); fl_add_child( ob, sp->hsl ); fl_add_child( ob, sp->vsl ); /* In older versions scrollbars and browsers weren't returned to e.g. fl_do_forms() but still a callback associated with the object got called. To emulate the old behaviour we have to set the return policy to default to FL_RETURN_NONE and only change that to FL_RETURN_CHANGED when a callback is installed (which is done in fl_set_object_callback()) */ #if ! USE_BWC_BS_HACK fl_set_object_return( ob, FL_RETURN_SELECTION | FL_RETURN_DESELECTION ); #else fl_set_object_return( ob, FL_RETURN_NONE ); #endif fl_set_object_return( sp->hsl, FL_RETURN_ALWAYS ); fl_set_object_return( sp->vsl, FL_RETURN_ALWAYS ); fl_set_object_return( sp->tb, FL_RETURN_ALWAYS ); return ob; } /*************************************** * Adds a new browser object to the current form ***************************************/ FL_OBJECT * fl_add_browser( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob = fl_create_browser( type, x, y, w, h, label ); fl_add_object( fl_current_form, ob ); return ob; } /*************************************** * Switches the vertical scrollbar of the browser on or off ***************************************/ void fl_set_browser_vscrollbar( FL_OBJECT * obj, int on_off ) { FLI_BROWSER_SPEC *comp = obj->spec; if ( comp->v_pref == on_off ) return; comp->v_pref = on_off; redraw_scrollbar( obj ); fli_tbox_react_to_vert( comp->tb, on_off ); get_geometry( obj ); fl_redraw_object( obj ); } /*************************************** * Switches the horizontal scrollbar of the browser on or off ***************************************/ void fl_set_browser_hscrollbar( FL_OBJECT * obj, int on_off ) { FLI_BROWSER_SPEC *comp = obj->spec; if ( comp->h_pref == on_off ) return; comp->h_pref = on_off; redraw_scrollbar( obj ); fli_tbox_react_to_hori( comp->tb, on_off ); get_geometry( obj ); fl_redraw_object( obj ); } /*************************************** * Sets the callback for the horizontal scrollbar of the browser ***************************************/ void fl_set_browser_hscroll_callback( FL_OBJECT * ob, FL_BROWSER_SCROLL_CALLBACK cb, void * data ) { FLI_BROWSER_SPEC *comp = ob->spec; comp->hcb = cb; comp->hcb_data = data; } /*************************************** * Returns the callback for the horizontal scrollbar of the browser ***************************************/ FL_BROWSER_SCROLL_CALLBACK fl_get_browser_hscroll_callback( FL_OBJECT * ob ) { return ( ( FLI_BROWSER_SPEC * ) ob->spec )->hcb; } /*************************************** * Sets the callback for the vertical scrollbar of the browser ***************************************/ void fl_set_browser_vscroll_callback( FL_OBJECT * ob, FL_BROWSER_SCROLL_CALLBACK cb, void * data ) { FLI_BROWSER_SPEC *comp = ob->spec; comp->vcb = cb; comp->vcb_data = data; } /*************************************** * Returns the callback for the vertical scrollbar of the browser ***************************************/ FL_BROWSER_SCROLL_CALLBACK fl_get_browser_vscroll_callback( FL_OBJECT * ob ) { return ( ( FLI_BROWSER_SPEC * ) ob->spec )->vcb; } /*************************************** * Meant for the textbox to handle scroll callback properly ***************************************/ void fli_adjust_browser_scrollbar( FL_OBJECT * ob ) { FLI_BROWSER_SPEC *comp = ob->spec; fl_call_object_callback( comp->hsl ); fl_call_object_callback( comp->vsl ); } /*************************************** * Removes all text from the browser ***************************************/ void fl_clear_browser( FL_OBJECT * ob ) { FLI_BROWSER_SPEC *comp = ob->spec; fl_freeze_form( ob->form ); fli_tbox_clear( comp->tb ); fl_set_scrollbar_value( comp->hsl, 0.0 ); fl_set_scrollbar_size( comp->hsl, 1.0 ); fl_set_scrollbar_value( comp->vsl, 0.0 ); fl_set_scrollbar_size( comp->vsl, 1.0 ); redraw_scrollbar( ob ); fl_unfreeze_form( ob->form ); } /*************************************** * Returns the x-offset of the text shown in the browser as * the number of pixels ***************************************/ FL_Coord fl_get_browser_xoffset( FL_OBJECT * obj ) { FLI_BROWSER_SPEC *sp = obj->spec; return fli_tbox_get_xoffset( sp->tb ); } /*************************************** * Returns the x-offset of the text shown in the browser as a * number between 0 (starts of lines are shown) and 1 (end of * longest line is shown) ***************************************/ double fl_get_browser_rel_xoffset( FL_OBJECT * obj ) { FLI_BROWSER_SPEC *sp = obj->spec; return fli_tbox_get_rel_xoffset( sp->tb ); } /*************************************** * Sets the x-offset of the text shown in the browser as given * by the number of pixels ***************************************/ void fl_set_browser_xoffset( FL_OBJECT * ob, FL_Coord npixels ) { FLI_BROWSER_SPEC *sp = ob->spec; fli_tbox_set_xoffset( sp->tb, npixels ); redraw_scrollbar( ob ); } /*************************************** * Sets the x-offset of the text shown in the browser as given * by a value between 0 (show start of lines) and 1 (show end * of longest line) ***************************************/ void fl_set_browser_rel_xoffset( FL_OBJECT * ob, double val ) { FLI_BROWSER_SPEC *sp = ob->spec; fli_tbox_set_rel_xoffset( sp->tb, val ); redraw_scrollbar( ob ); } /*************************************** * Returns the y-offset of the text shown in the browser as * the number of pixels ***************************************/ FL_Coord fl_get_browser_yoffset( FL_OBJECT * obj ) { FLI_BROWSER_SPEC *sp = obj->spec; return fli_tbox_get_yoffset( sp->tb ); } /*************************************** * Returns the y-offset of the text shown in the browser as a * number between 0 (start of text is shown) and 1 (end of * text is shown) ***************************************/ double fl_get_browser_rel_yoffset( FL_OBJECT * obj ) { FLI_BROWSER_SPEC *sp = obj->spec; return fli_tbox_get_rel_yoffset( sp->tb ); } /*************************************** * Sets the y-offset of the text shown in the browser as given * by the number of pixels ***************************************/ void fl_set_browser_yoffset( FL_OBJECT * ob, FL_Coord npixels ) { FLI_BROWSER_SPEC *sp = ob->spec; fli_tbox_set_yoffset( sp->tb, npixels ); redraw_scrollbar( ob ); } /*************************************** * Sets the y-offset of the text shown in the browser as given * by a value between 0 (show start of text) and 1 (show end of * text) ***************************************/ void fl_set_browser_rel_yoffset( FL_OBJECT * ob, double val ) { FLI_BROWSER_SPEC *sp = ob->spec; fli_tbox_set_rel_yoffset( sp->tb, val ); redraw_scrollbar( ob ); } /*************************************** * Returns the y-offset for a line (or -1 if the line does not exist). ***************************************/ int fl_get_browser_line_yoffset( FL_OBJECT * obj, int line ) { FLI_BROWSER_SPEC *sp = obj->spec; return fli_tbox_get_line_yoffset( sp->tb, line + 1 ); } /*************************************** * Move a line to the top of the browser ***************************************/ void fl_set_browser_topline( FL_OBJECT * ob, int line ) { FLI_BROWSER_SPEC *sp = ob->spec; fli_tbox_set_topline( sp->tb, line - 1 ); redraw_scrollbar( ob ); } /*************************************** * Move a line to the bottom of the browser ***************************************/ void fl_set_browser_bottomline( FL_OBJECT * ob, int line ) { FLI_BROWSER_SPEC *sp = ob->spec; fli_tbox_set_bottomline( sp->tb, line - 1 ); redraw_scrollbar( ob ); } /*************************************** * Marks a line of the browser as selected ***************************************/ void fl_select_browser_line( FL_OBJECT * ob, int line ) { fli_tbox_select_line( ( ( FLI_BROWSER_SPEC * ) ob->spec )->tb, line - 1 ); } /*************************************** * Adds a line (given by a forma string and the appropriate number of * argumens) to the (end of the) browser and shifts the displayed * area so that the line is visible ***************************************/ void fl_addto_browser( FL_OBJECT * obj, const char * text ) { fli_tbox_add_line( ( ( FLI_BROWSER_SPEC * ) obj->spec )->tb, text, 1 ); redraw_scrollbar( obj ); } /*************************************** * Adds a line (specified using a format string and an unspecified number * of further arguments) to the (end of the) browser and shifts the * displayed area so that the line is visible ***************************************/ void fl_addto_browser_f( FL_OBJECT * obj, const char * fmt, ...) { char *buf; EXPAND_FORMAT_STRING( buf, fmt ); fl_addto_browser( obj, buf ); fl_free( buf ); } /*************************************** * Inserts a line into the browser before the line currently * having the number 'linenumb' ***************************************/ void fl_insert_browser_line( FL_OBJECT * ob, int linenumb, const char * newtext ) { FLI_BROWSER_SPEC *sp = ob->spec; FLI_TBOX_SPEC *tbsp = sp->tb->spec; /* When inserting into an empty browser or appending at the end it's treated exactly the same way as for fl_add_browser_line() (including interpretation of newline characters). */ if ( tbsp->num_lines == 0 || linenumb > tbsp->num_lines ) fli_tbox_insert_lines( sp->tb, linenumb - 1, newtext ); else fli_tbox_insert_line( sp->tb, linenumb - 1, newtext ); redraw_scrollbar( ob ); } /*************************************** * Inserts a line (given by a format string and the aprropriate number * of arguments) into the browser before the line currently having the * number 'linenumb' ***************************************/ void fl_insert_browser_line_f( FL_OBJECT * ob, int linenumb, const char * fmt, ... ) { char *buf; EXPAND_FORMAT_STRING( buf, fmt ); fl_insert_browser_line( ob, linenumb, buf ); fl_free( buf ); } /*************************************** * Deletes the line at line number 'linenumb' from the browser ***************************************/ void fl_delete_browser_line( FL_OBJECT * ob, int linenumb ) { fli_tbox_delete_line( ( ( FLI_BROWSER_SPEC * ) ob->spec )->tb, linenumb - 1 ); redraw_scrollbar( ob ); } /*************************************** * Replaces the browser line at line number 'linenumb' with a new one ***************************************/ void fl_replace_browser_line( FL_OBJECT * ob, int linenumb, const char * newtext ) { fli_tbox_replace_line( ( ( FLI_BROWSER_SPEC * ) ob->spec )->tb, linenumb - 1, newtext ); redraw_scrollbar( ob ); } /*************************************** * Replaces the browser line at line number 'linenumb' with a new one * derived from the format string and the following arguments. ***************************************/ void fl_replace_browser_line_f( FL_OBJECT * ob, int linenumb, const char * fmt, ... ) { char *buf; EXPAND_FORMAT_STRING( buf, fmt ); fl_replace_browser_line( ob, linenumb, buf ); fl_free( buf ); } /*************************************** * Returns the text of the browser's line at line number 'linenum'. * Returned text may not be modified (and not free'ed!) ***************************************/ const char * fl_get_browser_line( FL_OBJECT * ob, int linenumb ) { return fli_tbox_get_line( ( ( FLI_BROWSER_SPEC * ) ob->spec )->tb, linenumb - 1 ); } /*************************************** * Returns the number of the last line of the browser ***************************************/ int fl_get_browser_maxline( FL_OBJECT * obj ) { FLI_BROWSER_SPEC *sp = obj->spec; return fli_tbox_get_num_lines( sp->tb ); } /*************************************** * Unselects a line in the browser ***************************************/ void fl_deselect_browser_line( FL_OBJECT * ob, int line ) { fli_tbox_deselect_line( ( ( FLI_BROWSER_SPEC * ) ob->spec )->tb, line - 1 ); } /*************************************** * De-selects all lines of the browser ***************************************/ void fl_deselect_browser( FL_OBJECT * ob ) { fli_tbox_deselect( ( ( FLI_BROWSER_SPEC * ) ob->spec )->tb ); } /*************************************** * Tests if a certain line of the browser is selected ***************************************/ int fl_isselected_browser_line( FL_OBJECT * ob, int line ) { FLI_BROWSER_SPEC *sp = ob->spec; return fli_tbox_is_line_selected( sp->tb, line - 1 ); } /*************************************** * Returns the line last selected (or deselected) by the user ***************************************/ int fl_get_browser( FL_OBJECT * ob ) { FLI_BROWSER_SPEC *sp = ob->spec; return fli_tbox_get_selection( sp->tb ); } /*************************************** * Sets the font size to be used per default ***************************************/ void fl_set_browser_fontsize( FL_OBJECT * ob, int size ) { FLI_BROWSER_SPEC *sp = ob->spec; fli_tbox_set_fontsize( sp->tb, size ); redraw_scrollbar( ob ); fl_redraw_object( ob ); } /*************************************** * Sets the font style to be used per default ***************************************/ void fl_set_browser_fontstyle( FL_OBJECT * ob, int style ) { FLI_BROWSER_SPEC *sp = ob->spec; fli_tbox_set_fontstyle( sp->tb, style ); redraw_scrollbar( ob ); fl_redraw_object( ob ); } /*************************************** * Returns the number of the topmost line that is completely visible, * may return 0 if there are no lines in the browser ***************************************/ int fl_get_browser_topline( FL_OBJECT * obj ) { FLI_BROWSER_SPEC *sp = obj->spec; return fli_tbox_get_topline( sp->tb ) + 1; } /*************************************** * Loads a browser with text from a file ***************************************/ int fl_load_browser( FL_OBJECT * obj, const char * f ) { FLI_BROWSER_SPEC *sp = obj->spec; int status; fl_clear_browser( obj ); status = fli_tbox_load( sp->tb, f ); redraw_scrollbar( obj ); return status; } /*************************************** * Adds a line to the (end of the) browser (does not make the line * visible) ***************************************/ void fl_add_browser_line( FL_OBJECT * ob, const char * newtext ) { FLI_BROWSER_SPEC *sp = ob->spec; fli_tbox_add_line( sp->tb, newtext, 0 ); redraw_scrollbar( ob ); } /*************************************** * Adds a line to the (end of the) browser (does not make the line * visible) ***************************************/ void fl_add_browser_line_f( FL_OBJECT * ob, const char * fmt, ... ) { char *buf; EXPAND_FORMAT_STRING( buf, fmt ); fl_add_browser_line( ob,buf ); fl_free( buf ); } /*************************************** * Sets a callback for double clicks in the browser ***************************************/ void fl_set_browser_dblclick_callback( FL_OBJECT * ob, FL_CALLBACKPTR cb, long a ) { FLI_BROWSER_SPEC *comp = ob->spec; comp->callback = cb; comp->callback_data = a; } /*************************************** * Sets the height of the vertical and the width of the horzontal * scrollbar ***************************************/ void fl_set_browser_scrollbarsize( FL_OBJECT * ob, int hh, int vw ) { FLI_BROWSER_SPEC *comp = ob->spec; int redraw = 0; if ( hh > 0 && hh != comp->hsl->h ) { comp->hsl->h = comp->hh_def = hh; redraw = 1; } if ( vw > 0 && vw != comp->vsl->w ) { comp->vsl->w = comp->vw_def = vw; redraw = 1; } if ( redraw ) { comp->user_set = 1; fl_redraw_object( ob ); fl_redraw_object( comp->tb ); fl_redraw_object( comp->hsl ); fl_redraw_object( comp->vsl ); } } /*************************************** * Returns the position and width and height of the browsers text area ***************************************/ void fl_get_browser_dimension( FL_OBJECT * obj, FL_Coord * x, FL_Coord * y, FL_Coord * w, FL_Coord * h ) { FLI_TBOX_SPEC *sp = ( ( FLI_BROWSER_SPEC * ) obj->spec )->tb->spec; *x = obj->x + sp->x; *y = obj->y + sp->y; *w = sp->w; *h = sp->h; } /*************************************** * Makes a browser line selectable or unselectable ***************************************/ void fl_set_browser_line_selectable( FL_OBJECT * ob, int line, int flag ) { fli_tbox_make_line_selectable( ob, line - 1, flag ); } /*************************************** * Appends characters to the end of the last line in the browser ***************************************/ void fl_addto_browser_chars( FL_OBJECT * ob, const char * str ) { FLI_BROWSER_SPEC *sp = ob->spec; fli_tbox_add_chars( sp->tb, str ); redraw_scrollbar( ob ); } /*************************************** * Appends characters to the end of the last line in the browser ***************************************/ void fl_addto_browser_chars_f( FL_OBJECT * ob, const char * fmt, ... ) { char *buf; EXPAND_FORMAT_STRING( buf, fmt ); fl_addto_browser_chars_f( ob, buf ); fl_free( buf ); } /*************************************** * Returns an approximation of the number of lines shown in the browser ***************************************/ int fl_get_browser_screenlines( FL_OBJECT * ob ) { FLI_BROWSER_SPEC *sp = ob->spec; int t = fli_tbox_get_topline( sp->tb ); int b = fli_tbox_get_bottomline( sp->tb ); if ( t < 0 || b < 0 ) return 0; return b - t + 1; } /*************************************** * Sets the escape key used in the text ***************************************/ void fl_set_browser_specialkey( FL_OBJECT * ob, int specialkey ) { FLI_TBOX_SPEC *sp = ( ( FLI_BROWSER_SPEC * ) ob->spec )->tb->spec; sp->specialkey = specialkey; } /*************************************** * Brings a line into view ***************************************/ void fl_show_browser_line( FL_OBJECT * ob, int line ) { fli_tbox_set_centerline( ( ( FLI_BROWSER_SPEC * ) ob->spec )->tb, line ); redraw_scrollbar( ob ); } /*************************************** * Deprecated function, only left in for backward compatibility ***************************************/ int fl_set_default_browser_maxlinelength( int n FL_UNUSED_ARG ) { return 0; } /*************************************** ***************************************/ int fl_get_browser_scrollbar_repeat( FL_OBJECT * ob ) { return fl_get_slider_repeat( ( ( FLI_BROWSER_SPEC * ) ob->spec )->vsl ); } /*************************************** ***************************************/ void fl_set_browser_scrollbar_repeat( FL_OBJECT * ob, int millisec ) { if ( millisec > 0 ) { fl_set_slider_repeat( ( ( FLI_BROWSER_SPEC * ) ob->spec )->vsl, millisec ); fl_set_slider_repeat( ( ( FLI_BROWSER_SPEC * ) ob->spec )->hsl, millisec ); } } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/flcolor.c0000664000175000017500000014736312353623325012353 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file flcolor.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Colormap management. * * XForm will by default use the visual that has the most depth * and share colormap if possible. The default behavior can be * overridden by resource class Visual and Depth. * * Pixel is addressed via two indirections. First all colors * are addressed using the FL defined symbolic names, FL_RED, etc * which are then translated via a secondary lookup table to * get the true pixel values as known by the server. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" /******************* Local variables ************************/ static unsigned long *lut; static unsigned long max_server_cols; /* max cols in current visual */ static long cols_in_default_visual; static long predefined_cols; /* min(max_server_col, built_in_col) */ static int allow_leakage; static FL_COLOR lastmapped; /* so fli_textcolor can refresh its cache */ static void fli_free_newpixel( unsigned long ); static FL_COLOR rgb2pixel( unsigned int, unsigned int, unsigned int ); /* this needs to be changed to a lookup table */ #ifndef FL_RGB2GRAY #define FL_RGB2GRAY( r, g, b ) \ ( ( 78 * ( r ) + 150 * ( g ) + 28 * ( b ) ) >> 8 ) #endif #define NV( a ) #a,a /* Default colormap entry for FORMS, subject to gamma corrections. * * The map entries are listed in the order of importance based * on which color we need most in case the Xserver does not have * enough depths to get them all. */ static FLI_IMAP fli_imap[ FL_MAX_COLS ] = { { NV( FL_BLACK ), 0, 0, 0, 0, 0 }, { NV( FL_WHITE ), 255, 255, 255, 0, 0 }, { NV( FL_COL1 ), 173, 173, 173, 0, 0 }, { NV( FL_BOTTOM_BCOL ), 89, 89, 89, 0, 0 }, { NV( FL_RIGHT_BCOL ), 41, 41, 41, 0, 0 }, { NV( FL_MCOL ), 191, 191, 191, 0, 0 }, { NV( FL_LEFT_BCOL ), 222, 222, 222, 0, 0 }, { NV( FL_SLATEBLUE ), 113, 113, 198, 0, 0 }, { NV( FL_INDIANRED ), 198, 113, 113, 0, 0 }, { NV( FL_RED ), 255, 0, 0, 0, 0 }, { NV( FL_BLUE ), 0, 0, 255, 0, 0 }, { NV( FL_GREEN ), 0, 255, 0, 0, 0 }, { NV( FL_YELLOW ), 255, 255, 0, 0, 0 }, { NV( FL_MAGENTA ), 255, 0, 255, 0, 0 }, { NV( FL_CYAN ), 0, 255, 255, 0, 0 }, { NV( FL_TOMATO ), 255, 99, 71, 0, 0 }, { NV( FL_INACTIVE ), 110, 110, 110, 0, 0 }, { NV( FL_TOP_BCOL ), 204, 204, 204, 0, 0 }, { NV( FL_PALEGREEN ), 113, 198, 113, 0, 0 }, { NV( FL_DARKGOLD ), 205, 149, 10, 0, 0 }, { NV( FL_ORCHID ), 205, 105, 201, 0, 0 }, { NV( FL_DARKCYAN ), 40, 170, 175, 0, 0 }, { NV( FL_DARKTOMATO ), 139, 54, 38, 0, 0 }, { NV( FL_WHEAT ), 255, 231, 155, 0, 0 }, { NV( FL_DARKORANGE ), 255, 128, 0, 0, 0 }, { NV( FL_DEEPPINK ), 255, 0, 128, 0, 0 }, { NV( FL_CHARTREUSE ), 128, 255, 0, 0, 0 }, { NV( FL_DARKVIOLET ), 128, 0, 255, 0, 0 }, { NV( FL_SPRINGGREEN ), 0, 255, 128, 0, 0 }, { NV( FL_DODGERBLUE ), 0, 128, 255, 0, 0 }, { NV( FL_DOGERBLUE ), 0, 128, 255, 0, 0 }, { NV( FL_LIGHTER_COL1 ), 204, 204, 204, 0, 0 }, { NV( FL_DARKER_COL1 ), 161, 161, 161, 0, 0 }, { NV( FL_ALICEBLUE ), 240, 248, 255, 0, 0 }, { NV( FL_ANTIQUEWHITE ), 250, 235, 215, 0, 0 }, { NV( FL_AQUA ), 0, 255, 255, 0, 0 }, { NV( FL_AQUAMARINE ), 127, 255, 212, 0, 0 }, { NV( FL_AZURE ), 240, 255, 255, 0, 0 }, { NV( FL_BEIGE ), 245, 245, 220, 0, 0 }, { NV( FL_BISQUE ), 255, 228, 196, 0, 0 }, { NV( FL_BLANCHEDALMOND ), 255, 235, 205, 0, 0 }, { NV( FL_BLUEVIOLET ), 138, 43, 226, 0, 0 }, { NV( FL_BROWN ), 165, 42, 42, 0, 0 }, { NV( FL_BURLYWOOD ), 222, 184, 135, 0, 0 }, { NV( FL_CADETBLUE ), 95, 158, 160, 0, 0 }, { NV( FL_CHOCOLATE ), 210, 105, 30, 0, 0 }, { NV( FL_CORAL ), 255, 127, 80, 0, 0 }, { NV( FL_CORNFLOWERBLUE ), 100, 149, 237, 0, 0 }, { NV( FL_CORNSILK ), 255, 248, 220, 0, 0 }, { NV( FL_CRIMSON ), 220, 20, 60, 0, 0 }, { NV( FL_DARKBLUE ), 0, 0, 139, 0, 0 }, { NV( FL_DARKGOLDENROD ), 184, 134, 11, 0, 0 }, { NV( FL_DARKGRAY ), 169, 169, 169, 0, 0 }, { NV( FL_DARKGREEN ), 0, 100, 0, 0, 0 }, { NV( FL_DARKGREY ), 169, 169, 169, 0, 0 }, { NV( FL_DARKKHAKI ), 189, 183, 107, 0, 0 }, { NV( FL_DARKMAGENTA ), 139, 0, 139, 0, 0 }, { NV( FL_DARKOLIVEGREEN ), 85, 107, 47, 0, 0 }, { NV( FL_DARKORCHID ), 153, 50, 204, 0, 0 }, { NV( FL_DARKRED ), 139, 0, 0, 0, 0 }, { NV( FL_DARKSALMON ), 233, 150, 122, 0, 0 }, { NV( FL_DARKSEAGREEN ), 143, 188, 143, 0, 0 }, { NV( FL_DARKSLATEBLUE ), 72, 61, 139, 0, 0 }, { NV( FL_DARKSLATEGRAY ), 47, 79, 79, 0, 0 }, { NV( FL_DARKSLATEGREY ), 47, 79, 79, 0, 0 }, { NV( FL_DARKTURQUOISE ), 0, 206, 209, 0, 0 }, { NV( FL_DEEPSKYBLUE ), 0, 191, 255, 0, 0 }, { NV( FL_DIMGRAY ), 105, 105, 105, 0, 0 }, { NV( FL_DIMGREY ), 105, 105, 105, 0, 0 }, { NV( FL_FIREBRICK ), 178, 34, 34, 0, 0 }, { NV( FL_FLORALWHITE ), 255, 250, 240, 0, 0 }, { NV( FL_FORESTGREEN ), 34, 139, 34, 0, 0 }, { NV( FL_FUCHSIA ), 255, 0, 255, 0, 0 }, { NV( FL_GAINSBORO ), 220, 220, 220, 0, 0 }, { NV( FL_GHOSTWHITE ), 248, 248, 255, 0, 0 }, { NV( FL_GOLD ), 255, 215, 0, 0, 0 }, { NV( FL_GOLDENROD ), 218, 165, 32, 0, 0 }, { NV( FL_GRAY ), 128, 128, 128, 0, 0 }, { NV( FL_GREENYELLOW ), 173, 255, 47, 0, 0 }, { NV( FL_GREY ), 128, 128, 128, 0, 0 }, { NV( FL_HONEYDEW ), 240, 255, 240, 0, 0 }, { NV( FL_HOTPINK ), 255, 105, 180, 0, 0 }, { NV( FL_INDIGO ), 75, 0, 130, 0, 0 }, { NV( FL_IVORY ), 255, 255, 240, 0, 0 }, { NV( FL_KHAKI ), 240, 230, 140, 0, 0 }, { NV( FL_LAVENDER ), 230, 230, 250, 0, 0 }, { NV( FL_LAVENDERBLUSH ), 255, 240, 245, 0, 0 }, { NV( FL_LAWNGREEN ), 124, 252, 0, 0, 0 }, { NV( FL_LEMONCHIFFON ), 255, 250, 205, 0, 0 }, { NV( FL_LIGHTBLUE ), 173, 216, 230, 0, 0 }, { NV( FL_LIGHTCORAL ), 240, 128, 128, 0, 0 }, { NV( FL_LIGHTCYAN ), 224, 255, 255, 0, 0 }, { NV( FL_LIGHTGOLDENRODYELLOW ), 250, 250, 210, 0, 0 }, { NV( FL_LIGHTGRAY ), 211, 211, 211, 0, 0 }, { NV( FL_LIGHTGREEN ), 144, 238, 144, 0, 0 }, { NV( FL_LIGHTGREY ), 211, 211, 211, 0, 0 }, { NV( FL_LIGHTPINK ), 255, 182, 193, 0, 0 }, { NV( FL_LIGHTSALMON ), 255, 160, 122, 0, 0 }, { NV( FL_LIGHTSEAGREEN ), 32, 178, 170, 0, 0 }, { NV( FL_LIGHTSKYBLUE ), 135, 206, 250, 0, 0 }, { NV( FL_LIGHTSLATEGRAY ), 119, 136, 153, 0, 0 }, { NV( FL_LIGHTSLATEGREY ), 119, 136, 153, 0, 0 }, { NV( FL_LIGHTSTEELBLUE ), 176, 196, 222, 0, 0 }, { NV( FL_LIGHTYELLOW ), 255, 255, 224, 0, 0 }, { NV( FL_LIME ), 0, 255, 0, 0, 0 }, { NV( FL_LIMEGREEN ), 50, 205, 50, 0, 0 }, { NV( FL_LINEN ), 250, 240, 230, 0, 0 }, { NV( FL_MAROON ), 128, 0, 0, 0, 0 }, { NV( FL_MEDIUMAQUAMARINE ), 102, 205, 170, 0, 0 }, { NV( FL_MEDIUMBLUE ), 0, 0, 205, 0, 0 }, { NV( FL_MEDIUMORCHID ), 186, 85, 211, 0, 0 }, { NV( FL_MEDIUMPURPLE ), 147, 112, 219, 0, 0 }, { NV( FL_MEDIUMSEAGREEN ), 60, 179, 113, 0, 0 }, { NV( FL_MEDIUMSLATEBLUE ), 123, 104, 238, 0, 0 }, { NV( FL_MEDIUMSPRINGGREEN ), 0, 250, 154, 0, 0 }, { NV( FL_MEDIUMTURQUOISE ), 72, 209, 204, 0, 0 }, { NV( FL_MEDIUMVIOLETRED ), 199, 21, 133, 0, 0 }, { NV( FL_MIDNIGHTBLUE ), 25, 25, 112, 0, 0 }, { NV( FL_MINTCREAM ), 245, 255, 250, 0, 0 }, { NV( FL_MISTYROSE ), 255, 228, 225, 0, 0 }, { NV( FL_MOCCASIN ), 255, 228, 181, 0, 0 }, { NV( FL_NAVAJOWHITE ), 255, 222, 173, 0, 0 }, { NV( FL_NAVY ), 0, 0, 128, 0, 0 }, { NV( FL_OLDLACE ), 253, 245, 230, 0, 0 }, { NV( FL_OLIVE ), 128, 128, 0, 0, 0 }, { NV( FL_OLIVEDRAB ), 107, 142, 35, 0, 0 }, { NV( FL_ORANGE ), 255, 165, 0, 0, 0 }, { NV( FL_ORANGERED ), 255, 69, 0, 0, 0 }, { NV( FL_PALEGOLDENROD ), 238, 232, 170, 0, 0 }, { NV( FL_PALETURQUOISE ), 175, 238, 238, 0, 0 }, { NV( FL_PALEVIOLETRED ), 219, 112, 147, 0, 0 }, { NV( FL_PAPAYAWHIP ), 255, 239, 213, 0, 0 }, { NV( FL_PEACHPUFF ), 255, 218, 185, 0, 0 }, { NV( FL_PERU ), 205, 133, 63, 0, 0 }, { NV( FL_PINK ), 255, 192, 203, 0, 0 }, { NV( FL_PLUM ), 221, 160, 221, 0, 0 }, { NV( FL_POWDERBLUE ), 176, 224, 230, 0, 0 }, { NV( FL_PURPLE ), 128, 0, 128, 0, 0 }, { NV( FL_ROSYBROWN ), 188, 143, 143, 0, 0 }, { NV( FL_ROYALBLUE ), 65, 105, 225, 0, 0 }, { NV( FL_SADDLEBROWN ), 139, 69, 19, 0, 0 }, { NV( FL_SALMON ), 250, 128, 114, 0, 0 }, { NV( FL_SANDYBROWN ), 244, 164, 96, 0, 0 }, { NV( FL_SEAGREEN ), 46, 139, 87, 0, 0 }, { NV( FL_SEASHELL ), 255, 245, 238, 0, 0 }, { NV( FL_SIENNA ), 160, 82, 45, 0, 0 }, { NV( FL_SILVER ), 192, 192, 192, 0, 0 }, { NV( FL_SKYBLUE ), 135, 206, 235, 0, 0 }, { NV( FL_SLATEGRAY ), 112, 128, 144, 0, 0 }, { NV( FL_SLATEGREY ), 112, 128, 144, 0, 0 }, { NV( FL_SNOW ), 255, 250, 250, 0, 0 }, { NV( FL_STEELBLUE ), 70, 130, 180, 0, 0 }, { NV( FL_TAN ), 210, 180, 140, 0, 0 }, { NV( FL_TEAL ), 0, 128, 128, 0, 0 }, { NV( FL_THISTLE ), 216, 191, 216, 0, 0 }, { NV( FL_TURQUOISE ), 64, 224, 208, 0, 0 }, { NV( FL_VIOLET ), 238, 130, 238, 0, 0 }, { NV( FL_WHITESMOKE ), 245, 245, 245, 0, 0 }, { NV( FL_YELLOWGREEN ), 154, 205, 50, 0, 0 }, { NV( FL_FREE_COL1 ), 0, 0, 0, 0, 0 }, { NV( FL_FREE_COL2 ), 0, 0, 0, 0, 0 }, { NV( FL_FREE_COL3 ), 0, 0, 0, 0, 0 }, { NV( FL_FREE_COL4 ), 0, 0, 0, 0, 0 }, { NV( FL_FREE_COL5 ), 0, 0, 0, 0, 0 }, { NV( FL_FREE_COL6 ), 0, 0, 0, 0, 0 }, { NV( FL_FREE_COL7 ), 0, 0, 0, 0, 0 }, { NV( FL_FREE_COL8 ), 0, 0, 0, 0, 0 }, { NV( FL_FREE_COL9 ), 0, 0, 0, 0, 0 }, { NV( FL_FREE_COL10 ), 0, 0, 0, 0, 0 }, { NV( FL_FREE_COL11 ), 0, 0, 0, 0, 0 }, { NV( FL_FREE_COL12 ), 0, 0, 0, 0, 0 }, { NV( FL_FREE_COL13 ), 0, 0, 0, 0, 0 }, { NV( FL_FREE_COL14 ), 0, 0, 0, 0, 0 }, { NV( FL_FREE_COL15 ), 0, 0, 0, 0, 0 }, { NV( FL_FREE_COL16 ), 0, 0, 0, 0, 0 }, }; #define flmapsize ( ( int ) ( sizeof fli_imap / sizeof *fli_imap ) ) /*************************************** ***************************************/ const char * fli_query_colorname( FL_COLOR col ) { FLI_IMAP *flmap; static char buf[ 32 ]; for ( flmap = fli_imap; flmap < fli_imap + FL_BUILT_IN_COLS + 1; flmap++ ) if ( col == flmap->index ) return flmap->name; /* Not a built-in */ if ( col == FL_NoColor ) return "FL_NoColor"; if ( col >= FL_FREE_COL1 && col <= FL_FREE_COL16 ) sprintf( buf,"FL_FREE_COL%ld",1+col-FL_FREE_COL1 ); else sprintf( buf, "%ld", col ); return buf; } /*************************************** ***************************************/ long fli_query_namedcolor( const char *s ) { FLI_IMAP *flmap; if ( ! s ) { M_err( "fli_query_namedcolor", "Null pointer for color name" ); return FL_MAX_COLORS + 1; } for ( flmap = fli_imap; flmap < fli_imap + FL_BUILT_IN_COLS + 1; flmap++ ) if ( ! strcmp( s, flmap->name ) ) return flmap->index; if ( strstr( s, "FL_FREE_COL" ) ) return FL_FREE_COL1 + atoi( s + 11 ) - 1; if ( ! strcmp( "FL_NoColor", s ) ) return FL_NoColor; /* A wild shot */ return atoi( s ); } /*************************************** ***************************************/ #ifdef DO_GAMMA_CORRECTION #include void fl_set_gamma( double r, double g, double b ) { FLI_IMAP *fm; static double rgamma = 1.0, ggamma = 1.0, bgamma = 1.0; if ( fli_imap[ 4 ].grayval ) { /* Too lazy to shuffle colormap around */ M_err( "fl_set_gamma", "Ignored. Please call fl_set_gamma before fl_initialize()" ); return; } if ( r <= 1.e-3 || g <= 1.e-3 || b <= 1.e-3 ) { M_warn( "fl_set_gamma", "BadValue %4.2f %4.2f %4.2f. Ignored", r, g, b ); return; } for ( fm = fli_imap; fm < fli_imap + FL_BUILT_IN_COLS + 1; fm++ ) { fm->r = 0.5 + 255 * pow( fm->r / 255.0, rgamma / r ); fm->g = 0.5 + 255 * pow( fm->g / 255.0, ggamma / g ); fm->b = 0.5 + 255 * pow( fm->b / 255.0, bgamma / b ); } rgamma = r; ggamma = g; bgamma = b; } #endif /* DO_GAMMA_CORRECTION */ static XColor *defaultc = NULL; /*************************************** * Copy the first several entries in the default colormap to avoid * flashing in case we are using a private colormap or non-default * visual (can't do anyting about TrueColor/DirectColor though) ***************************************/ #define DEFAULT_SAVE 35 static int save_index[ ] = { 2, 3, 4, 5, 6, 7, 34 }; #define NSAVE ( sizeof save_index / sizeof *save_index ) static void be_nice( void ) { int i, save = FL_min( cols_in_default_visual - 210, DEFAULT_SAVE ); XColor *dc; unsigned long newpixels[ DEFAULT_SAVE ], frees[ DEFAULT_SAVE ]; int npixels, found, j, k, saved; FL_COLOR black = BlackPixel( flx->display, fl_screen ); FL_COLOR white = WhitePixel( flx->display, fl_screen ); for ( saved = 0, dc = defaultc, i = 0; i < save; i++, dc++ ) { dc->flags = DoRed | DoGreen | DoBlue; if ( XAllocColor( flx->display, fli_colormap( fl_vmode ), dc ) ) newpixels[ saved++ ] = dc->pixel; } /* Only keep the pixels in the save_index. 0 and 1 are always saved */ for ( npixels = 0, i = 2; fli_depth( fl_vmode ) > 4 && i < saved; i++ ) { k = newpixels[ i ]; for ( j = found = 0; ! found && j < ( int ) NSAVE; j++ ) found = k == save_index[ j ] || k == ( int ) white || k == ( int ) black; if ( ! found ) frees[ npixels++ ] = k; } if ( npixels ) XFreeColors( flx->display, fli_colormap( fl_vmode ), frees, npixels, 0 ); if ( save <= 0 ) { XColor xc; M_warn( "be_nice", "Black = %ld White = %ld", black, white ); /* As a minimum, we should preserve black & white */ xc.flags = DoRed | DoGreen | DoBlue; if ( black == 0 ) { xc.red = xc.green = xc.blue = 0; xc.pixel = 0; XAllocColor( flx->display, fli_colormap( fl_vmode ), &xc ); M_warn( "be_nice", "Get Black = %ld", xc.pixel ); if ( white == 1 ) { xc.pixel = white; xc.red = xc.green = xc.blue = 0xffff; XAllocColor( flx->display, fli_colormap( fl_vmode ), &xc ); M_warn( "be_nice", "Get White = %ld", xc.pixel ); } } else if ( white == 0 ) { xc.red = xc.green = xc.blue = 0xffff; XAllocColor( flx->display, fli_colormap( fl_vmode ), &xc ); M_warn( "be_nice", "Get White = %ld", xc.pixel ); if ( black == 1 ) { xc.red = xc.green = xc.blue = black; xc.pixel = 0; XAllocColor( flx->display, fli_colormap( fl_vmode ), &xc ); M_warn( "be_nice", "Get Black = %ld", xc.pixel ); } } } M_warn( "be_nice", "Total %d colors copied", save > 0 ? save : 2 ); } /*************************************** ***************************************/ static int alloc_direct_color( void ) { XColor xxc[ FL_BUILT_IN_COLS ], *xc; FLI_IMAP *fm; long pred = predefined_cols; for ( xc = xxc, fm = fli_imap; fm < fli_imap + pred; fm++, xc++ ) { xc->red = ( fm->r << 8 ) | 0xff; xc->green = ( fm->g << 8 ) | 0xff; xc->blue = ( fm->b << 8 ) | 0xff; xc->flags = DoRed | DoGreen | DoBlue; xc->pixel = lut[ fm->index ] = rgb2pixel( fm->r, fm->g, fm->b ); } XStoreColors( flx->display, fli_map( fl_vmode ), xxc, pred ); return 1; } /*************************************** * Do colormap allocation. DirectColor is handled seperately ***************************************/ static int fill_map( void ) { XColor xc; int ok; long pred = predefined_cols; unsigned int r, g, b; FLI_IMAP *fm, *fs; lut = fl_state[ fl_vmode ].lut; fli_dithered( fl_vmode ) = fli_depth( fl_vmode ) <= 2; M_warn( "fill_map", "Trying to get %d colors", pred ); xc.flags = DoRed | DoGreen | DoBlue; for ( ok = 1, fm = fli_imap, fs = fm + pred; ok && fm < fs; fm++ ) { /* If Xserver is grayscale, we are really walking the "gray" area as the server can drive the the display with any of the r, g or b, need to force a correct value */ r = FL_is_gray( fl_vmode ) ? fm->grayval : fm->r; g = FL_is_gray( fl_vmode ) ? fm->grayval : fm->g; b = FL_is_gray( fl_vmode ) ? fm->grayval : fm->b; xc.red = ( r << 8 ) | 0xff; xc.green = ( g << 8 ) | 0xff; xc.blue = ( b << 8 ) | 0xff; ok = XAllocColor( flx->display, fli_map( fl_vmode ), &xc ); if ( ok ) lut[ fm->index ] = xc.pixel; } if ( fl_state[ fl_vmode ].pcm || fli_cntl.sharedColormap || fli_dithered( fl_vmode ) ) { if ( ! ok && fm > fli_imap ) fm--; ok = 1; } /* Get approx. for the rest of needed colors */ for ( fs = fli_imap + FL_BUILT_IN_COLS; ok && fm < fs; fm++ ) fl_mapcolor( fm->index, fm->r, fm->g, fm->b ); /* Make rest of the entry invalid so we don't accidently free a valid pixel */ memset( lut + FL_BUILT_IN_COLS, 1, ( FL_MAX_COLS - FL_BUILT_IN_COLS ) * sizeof *lut ); return ok; } /*************************************** * Try to get a private colormap. Return 1 for success. Typically * this is the last color strategy we will try and in case it * fails, caller probably should terminate the program. ***************************************/ static int get_private_cmap( int vmode ) { int ok, i; M_warn( "get_private_cmap", "getting private colormap" ); /* Get a private colormap */ fli_map( vmode ) = XCreateColormap( flx->display, fl_root, fli_visual( vmode ), vmode != FL_DirectColor ? AllocNone : AllocAll ); if ( ! fli_map( vmode ) ) { M_err( "get_private_cmap", "Can't create Colormap!" ); exit( 0 ); } lut = fl_state[ vmode ].lut; if ( vmode == FL_DirectColor ) return alloc_direct_color( ); /* Copy some default entries */ be_nice( ); /* Fill colormap with predetermined colors */ fl_state[ vmode ].pcm = 1; ok = fill_map( ); for ( i = FL_BUILT_IN_COLS; i < FL_MAX_COLS; i++ ) lut[ i ] = i; M_warn( "get_private_cmap", "%s %s succesful", fli_vclass_name( vmode ), ok ? "" : "not" ); return ok; } /*************************************** * Use standard colormap only if user explicitly requests it as it * is the most un-flexible among shared,private and standard. ***************************************/ static int get_standard_cmap( int vmode ) { FLI_IMAP *fm, *fs; XStandardColormap stdcmap; XStandardColormap *sc = &stdcmap; XColor xc; Atom mapid = ( vmode == FL_GrayScale || vmode == FL_StaticGray ) ? XA_RGB_GRAY_MAP : XA_RGB_DEFAULT_MAP; #if FL_DEBUG >= ML_ERR M_warn( "get_standard_cmap", "Getting standard colormap" ); #endif if ( ! XGetStandardColormap( flx->display, fl_root, &stdcmap, mapid ) ) { M_err( "get_standard_cmap", "Can't get standard map" ); return 0; } lut = fl_state[ vmode ].lut; /* we got the map. now figure out the pixel values */ fli_map( vmode ) = sc->colormap; xc.flags = DoRed | DoGreen | DoBlue; for ( fm = fli_imap, fs = fm + FL_BUILT_IN_COLS; fm < fs; fm++ ) { xc.red = ( fm->r << 8 ) | 0xff; xc.green = ( fm->g << 8 ) | 0xff; xc.blue = ( fm->b << 8 ) | 0xff; XAllocColor( flx->display, fli_colormap( vmode ), &xc ); lut[ fm->index ] = xc.pixel; } fl_state[ vmode ].pcm = 1; return 1; } /*************************************** ***************************************/ static int get_shared_cmap( int vmode ) { int ok; /* Share colormap only if requested visual is the same as the default visual */ if ( fli_visual( vmode ) == DefaultVisual( flx->display, fl_screen ) ) { fli_map( vmode ) = DefaultColormap( flx->display, fl_screen ); M_warn( "get_shared_cmap", "Using default map %ld for %s", fli_map( vmode ), fli_vclass_name( vmode ) ); } else { fli_map( vmode ) = XCreateColormap( flx->display, fl_root, fli_visual( vmode ), vmode != FL_DirectColor ? AllocNone : AllocAll ); M_warn( "get_shared_cmap", " NewMap %ld (0x%lx) for %s (ID = 0x%lx)", fli_map( vmode ), fli_map( vmode ), fli_vclass_name( vmode ), fli_visual( vmode )->visualid ); } if ( ! fli_map( vmode ) ) { M_err( "get_shared_cmap", "Error getting colormaps" ); exit( 1 ); } #define PD( v ) \ if ( ( DefaultVisual( flx->display, fl_screen ) )->class == ( v ) ) \ fprintf( stderr, "DefaultVisual = %s CurrentVisual = %s\n", \ #v, fli_vclass_name( fli_class( vmode ) ) ); if ( fli_cntl.debug ) { PD( TrueColor ); PD( PseudoColor ); PD( DirectColor ); PD( GrayScale ); PD( StaticGray ); PD( StaticColor ); } lut = fl_state[ vmode ].lut; if ( vmode == FL_DirectColor ) return alloc_direct_color( ); /* Copy a few entries from the default colormap if we are using a map other than the defaulf */ if ( fli_visual( vmode ) != DefaultVisual( flx->display, fl_screen ) ) be_nice( ); ok = fill_map( ); /* If we can't do it, free the color we have already allocated so other applications may have an easier time getting colors */ if ( ! ok ) { M_warn( "get_shared_cmap", "can't share for %s", fli_vclass_name( vmode ) ); fli_map( vmode ) = XCopyColormapAndFree( flx->display, fli_map( vmode ) ); } return ok; } /*************************************** * Create GCs for a particular visual and depth ***************************************/ void fli_create_gc( Window win ) { GC *flgcs, *flgce; FL_State *fs = fl_state + fl_vmode; /* If gc for this visual exists, do switch */ if ( fl_state[ fl_vmode ].gc[ 0 ] ) { flx->gc = fl_state[ fl_vmode ].gc[ 0 ]; flx->textgc = fl_state[ fl_vmode ].textgc[ 0 ]; if ( fl_state[ fl_vmode ].cur_fnt ) XSetFont( flx->display, flx->textgc, fl_state[ fl_vmode ].cur_fnt->fid ); return; } /* Check if we need to dither */ fli_dithered( fl_vmode ) = fli_depth( fl_vmode ) <= 2; /* Need to create new GCs */ M_warn( "fli_create_gc", "For %s", fli_vclass_name( fl_vmode ) ); if ( ! fli_gray_pattern[ 1 ] ) { M_err( "fli_create_gc", "gray pattern not initialized" ); exit( 1 ); } flgcs = fs->gc; flgce = flgcs + sizeof fs->gc / sizeof *fs->gc; for ( ; flgcs < flgce; flgcs++ ) { *flgcs = XCreateGC( flx->display, win, 0, 0 ); XSetStipple( flx->display, *flgcs, FLI_INACTIVE_PATTERN ); XSetGraphicsExposures( flx->display, *flgcs, 0 ); } flx->gc = fl_state[ fl_vmode ].gc[ 0 ]; /* Initialize text gc */ flgcs = fs->textgc; flgce = flgcs + sizeof fs->textgc / sizeof *fs->textgc; for ( ; flgcs < flgce; flgcs++ ) { *flgcs = XCreateGC( flx->display, win, 0, 0 ); XSetStipple( flx->display, *flgcs, FLI_INACTIVE_PATTERN ); XSetGraphicsExposures( flx->display, *flgcs, 0 ); } flx->textgc = fl_state[ fl_vmode ].textgc[ 0 ]; /* Initialize a dimmed GC */ fl_state[ fl_vmode ].dimmedGC = XCreateGC( flx->display, win, 0, 0 ); XSetStipple( flx->display, fl_state[ fl_vmode ].dimmedGC, FLI_INACTIVE_PATTERN ); XSetGraphicsExposures( flx->display, fl_state[ fl_vmode ].dimmedGC, 0 ); XSetFillStyle( flx->display, fl_state[ fl_vmode ].dimmedGC, FillStippled ); /* Special for B&W and 2bits displays */ if ( fli_dithered( fl_vmode ) ) { int i; fli_whitegc = XCreateGC( flx->display, win, 0, 0 ); XSetForeground( flx->display, fli_whitegc, fl_get_flcolor( FL_WHITE ) ); for ( i = 0; i < 3; i++ ) { fli_bwgc[ i ] = XCreateGC( flx->display, win, 0, 0 ); XSetStipple( flx->display, fli_bwgc[ i ], fli_gray_pattern[ i ] ); XSetGraphicsExposures( flx->display, fli_bwgc[ i ], 0 ); XSetFillStyle( flx->display, fli_bwgc[ i ], FillStippled ); } } if ( fl_state[ fl_vmode ].cur_fnt ) XSetFont( flx->display, flx->textgc, fl_state[ fl_vmode ].cur_fnt->fid ); } /*************************************** * Global routine to initialize all things related visual and colors ***************************************/ void fli_init_colormap( int vmode ) { int i, ok; FLI_IMAP *fm = fli_imap; Colormap defmap; /* If map for this mode already exists, leave it alone, not only efficient but also necessary as fl_win_open may call init map */ if ( fli_map( vmode ) ) { #if FL_DEBUG >= ML_DEBUG M_info( "fli_init_colormap", "%s is ok", fli_vclass_name( vmode ) ); #endif return; } /* Get max colors we can have, take care there are machines where an unsigned long isn't large enough to hold the number of colors) */ if ( ( unsigned int ) fli_depth( vmode ) >= CHAR_BIT * sizeof max_server_cols ) max_server_cols = ~ 0; else max_server_cols = 1L << fli_depth( vmode ); predefined_cols = FL_min( FL_BUILT_IN_COLS, max_server_cols ); M_info( "fli_init_colormap", "MaxColors = %d PredefCol = %d", max_server_cols, predefined_cols ); fli_init_stipples( ); if ( ! defaultc ) defaultc = fl_malloc( FL_MAX_COLS * sizeof *defaultc ); /* Initialize secondary lookup table */ for ( fm = fli_imap, i = 0; i < FL_MAX_COLS; i++, fm++ ) { defaultc[ i ].pixel = i; fm->grayval = FL_RGB2GRAY( fm->r, fm->g, fm->b ); if ( i >= FL_BUILT_IN_COLS ) fm->index = i; } /* Take a snapshot of the default colormap for later use by private_colormap */ defmap = DefaultColormap( flx->display, fl_screen ); cols_in_default_visual = ( 1L << DefaultDepth( flx->display, fl_screen ) ) - 1; /* Some server may have a default visual with depth == 32 */ if ( cols_in_default_visual <= 0 ) cols_in_default_visual = 80; M_warn( "fli_init_colormap", "%ld (0x%lx)", defmap, defmap ); XQueryColors( flx->display, defmap, defaultc, FL_min( cols_in_default_visual, DEFAULT_SAVE ) ); ok = 0; if ( fli_cntl.privateColormap ) ok = get_private_cmap( vmode ); else if ( fli_cntl.standardColormap ) ok = get_standard_cmap( vmode ); if ( ! ok && ! ( ok = get_shared_cmap( vmode ) ) ) { /* If unable to share colormaps, we can either get a private colormap or force substitutions */ #if 1 M_err( "fli_init_colormap", "Failed to share colors. Using private colormap" ); ok = get_private_cmap( vmode ); #else ok = 1; fli_cntl.sharedColormap = 1; get_shared_cmap( vmode ); #endif } if ( ! ok ) { M_err( "fli_init_colormap", "I screwed up or you have a weird workstatation" ); exit( 1 ); } M_warn( "fli_init_colormap", "%s Done", fli_vclass_name( vmode ) ); #if FL_DEBUG >= ML_WARN fli_dump_state_info( vmode, "fli_init_colormap" ); #endif } /*************************************** ***************************************/ void fli_free_colormap( int vmode ) { int i; for( i = 0; i < 3; i++ ) if ( fli_gray_pattern[ i ] ) { XFreePixmap( flx->display, fli_gray_pattern[ i ] ); fli_gray_pattern[ i ] = None; } if ( fli_visual( vmode ) != DefaultVisual( flx->display, fl_screen ) ) XFreeColormap( flx->display, fli_map( vmode ) ); fli_safe_free( defaultc ); } static unsigned long get_rgb_pixel( FL_COLOR packed, int * newpix ); /*************************************** * Input col is an XForms color, e.g. FL_RED etc. The * return value is the true pixel value X understands. ***************************************/ unsigned long fl_get_pixel( FL_COLOR col ) { if ( col == FL_NoColor ) return fl_get_pixel( FL_COL1 ); if ( flx->isRGBColor ) return get_rgb_pixel( col, &flx->newpix ); if ( col >= FL_MAX_COLS ) { M_err( "fl_get_pixel", "Bad request %lu", col ); return 0; } return fl_state[ fl_vmode ].lut[ col ]; } /*************************************** ***************************************/ void fl_set_foreground( GC gc, FL_COLOR color ) { XSetForeground( fl_display, gc, fl_get_pixel( color ) ); } /*************************************** ***************************************/ void fl_set_background( GC gc, FL_COLOR color ) { XSetBackground( fl_display, gc, fl_get_pixel( color ) ); } /*************************************** ***************************************/ void fl_color( FL_COLOR col ) { static int vmode = -1; if ( flx->color != col || vmode != fl_vmode ) { unsigned long p = fl_get_pixel( col ); flx->color = col; vmode = fl_vmode; XSetForeground( flx->display, flx->gc, p ); fli_free_newpixel( p ); } } /*************************************** ***************************************/ static unsigned long get_rgb_pixel( FL_COLOR packed, int * newpix ) { FL_STATE *s = &fl_state[ fl_vmode ]; unsigned long pixel; static Colormap lastcolormap; static XColor *xcolor; static int new_col; XColor xc; unsigned int r = FL_GETR( packed ); unsigned int g = FL_GETG( packed ); unsigned int b = FL_GETB( packed ); *newpix = 0; if ( s->vclass == TrueColor || s->vclass == DirectColor ) return rgb2pixel( r, g, b ); else { int max_col; xc.flags = DoRed | DoGreen | DoBlue; xc.red = ( r << 8 ) | 0xff; xc.green = ( g << 8 ) | 0xff; xc.blue = ( b << 8 ) | 0xff; new_col++; if ( ( *newpix = XAllocColor( flx->display, s->colormap, &xc ) ) ) return xc.pixel; /* Color allocation failed. Search for best match */ if ( ( max_col = FL_min( 256, 1 << s->depth ) ) == 0 ) max_col = 256; if ( ! xcolor ) xcolor = fl_malloc( 256 * sizeof *xcolor ); /* Not theoretically correct as colormap may have changed * since the last time we asked for colors. Take a chance for * performace. */ if ( lastcolormap != s->colormap || new_col > 3 ) { int i; for ( i = 0; i < max_col; i++ ) xcolor[ i ].pixel = i; XQueryColors( flx->display, s->colormap, xcolor, max_col ); lastcolormap = s->colormap; new_col = 0; } fli_find_closest_color( r, g, b, xcolor, max_col, &pixel ); return pixel; } } /*************************************** ***************************************/ static void fli_free_newpixel( unsigned long pixel ) { if ( flx->newpix ) { XFreeColors( flx->display, flx->colormap, &pixel, 1, 0 ); flx->newpix = 0; } } /*************************************** ***************************************/ void fli_textcolor( FL_COLOR col ) { static int vmode = -1; static int switched; static GC textgc; if ( flx->textcolor != col || vmode != fl_vmode || flx->textcolor == lastmapped ) { unsigned long p; lastmapped = FL_NoColor; flx->textcolor = col; vmode = fl_vmode; if ( col == FL_INACTIVE_COL && fli_dithered( vmode ) ) { textgc = flx->textgc; flx->textgc = fl_state[ vmode ].dimmedGC; XSetFont( flx->display, flx->textgc, fl_state[ vmode ].cur_fnt->fid ); switched = 1; } else if ( switched ) { flx->textgc = textgc; XSetFont( flx->display, flx->textgc, fl_state[ vmode ].cur_fnt->fid ); switched = 0; } p = fl_get_pixel( col ); XSetForeground( flx->display, flx->textgc, p ); fli_free_newpixel( p ); } } /*************************************** * Set the background color for drawing ***************************************/ void fl_bk_color( FL_COLOR col ) { if ( flx->bkcolor != col ) { unsigned long p = fl_get_pixel( col ); flx->bkcolor = col; XSetBackground( flx->display, flx->gc, p ); fli_free_newpixel( p ); } } /*************************************** * Set the background color for text ***************************************/ void fli_bk_textcolor( FL_COLOR col ) { if ( flx->bktextcolor != col ) { unsigned long p = fl_get_pixel( col ); flx->bktextcolor = col; XSetBackground( flx->display, flx->textgc, p ); fli_free_newpixel( p ); } } /*************************************** * Map color: it involves changing the internal colormap as well as * requesting the acutal pixel value. In case a request fails, * we subsititute the closest color ***************************************/ unsigned long fl_mapcolor( FL_COLOR col, int r, int g, int b ) { XColor exact; int i, j = -1; static int totalcols; static XColor *cur_mapvals[ 6 ], *cur_map; unsigned long pixel; /* If requested color is reserved, warn */ if ( col < FL_BUILT_IN_COLS ) M_warn( "fl_mapcolor", "Changing reserved color" ); /* Must invalidate color cache */ if ( col == flx->color ) flx->color = BadPixel; lut = fl_state[ fl_vmode ].lut; if ( col >= flmapsize ) { M_err( "fl_mapcolor", "Only %d indexed colors are supported", flmapsize ); return 0; } /* col is the external colorname, FL_RED etc, which is kept in fli_imap[].index. */ if ( col == fli_imap[ col ].index ) j = col; for ( i = 0; j < 0 && i < flmapsize; i++ ) if ( col == fli_imap[ i ].index ) j = i; if ( j < 0 ) j = flmapsize - 1; /* In B&W too many colors collaps together */ if ( fli_imap[ j ].r == r && fli_imap[ j ].g == g && fli_imap[ j ].b == b && r != 0 && ! fli_dithered( fl_vmode ) && lut[ col ] ) return lut[ col ]; fli_imap[ j ].r = r; fli_imap[ j ].g = g; fli_imap[ j ].b = b; fli_imap[ j ].grayval = FL_RGB2GRAY( r, g, b ); fli_imap[ j ].index = col; lastmapped = col; M_warn( "fl_mapcolor", "mapping %ld (%d,%d,%d)", col, r, g, b ); pixel = lut[ col ]; exact.red = ( r << 8 ) | 0xff; exact.green = ( g << 8 ) | 0xff; exact.blue = ( b << 8 ) | 0xff; exact.flags = DoRed | DoGreen | DoBlue; exact.pixel = pixel; if ( fl_vmode == DirectColor ) { exact.pixel = lut[ col ] = rgb2pixel( r, g, b ); XStoreColors( flx->display, fli_map( fl_vmode ), &exact, 1 ); return lut[ col ]; } /* pixel value known by the server */ if ( ! allow_leakage && fli_depth( fl_vmode ) >= 4 && pixel != BadPixel ) fl_free_pixels( &pixel, 1 ); if ( XAllocColor( flx->display, fli_colormap( fl_vmode ), &exact ) ) { lut[ col ] = exact.pixel; return lut[ col ]; } /* Colormap is full. Warn once and substitute from now on */ if ( ! cur_mapvals[ fl_vmode ] ) { M_warn( "fl_mapcolor", "ColormapFull. Using substitutions" ); totalcols = FL_min( FL_MAX_COLS, 1L << fli_depth( fl_vmode ) ); cur_map = fl_calloc( totalcols + 1, sizeof *cur_map ); cur_mapvals[ fl_vmode ] = cur_map; /* Take a snapshot of the color map */ for ( i = 0; i < totalcols; i++ ) cur_map[ i ].pixel = i; XQueryColors( flx->display, fli_map( fl_vmode ), cur_map, totalcols ); } /* Search for the closest match */ cur_map = cur_mapvals[ fl_vmode ]; j = fli_find_closest_color( r, g, b, cur_map, totalcols, &pixel ); if ( j < 0 ) { M_err( "fl_mapcolor", "Something is very wrong" ); exit( 1 ); } /* j will be the stuff we want */ lut[ col ] = cur_map[ j ].pixel; /* We still need to allocate the color, otherwise destroying the just requested color might accidentally free a reserved pixel */ exact.red = cur_map[ j ].red; exact.green = cur_map[ j ].green; exact.blue = cur_map[ j ].blue; exact.pixel = cur_map[ j ].pixel; exact.flags = DoRed | DoGreen | DoBlue; if ( ! XAllocColor( flx->display, fli_colormap( fl_vmode ), &exact ) ) M_warn( "fl_mapcolor", "Something is wrong - will proceed" ); #if FL_DEBUG >= ML_DEBUG M_warn( "fl_mapcolor", "(%d %d %d)<->(%d %d %d)", r, g, b, cur_map[ j ].red, cur_map[ j ].green, cur_map[ j ].blue ); #endif return lut[ col ]; } /*************************************** ***************************************/ long fl_mapcolorname( FL_COLOR col, const char * name ) { XColor xc; if ( XParseColor( flx->display, fli_colormap( fl_vmode ), ( char * ) name, &xc ) ) { xc.red = ( xc.red >> 8 ) & 0xff; xc.green = ( xc.green >> 8 ) & 0xff; xc.blue = ( xc.blue >> 8 ) & 0xff; return fl_mapcolor( col, xc.red, xc.green, xc.blue ); } return -1; } /*************************************** * change internal colormap before initialization. This way, * FORMS default color can be changed ***************************************/ void fl_set_icm_color( FL_COLOR col, int r, int g, int b ) { int i; for ( i = 0; i < flmapsize; i++ ) if ( col == fli_imap[ i ].index ) { if ( FL_is_gray( fl_vmode ) ) fli_imap[ i ].grayval = FL_RGB2GRAY( r, g, b ); else { fli_imap[ i ].r = r; fli_imap[ i ].g = g; fli_imap[ i ].b = b; } return; } } /*************************************** * query internal colormap ***************************************/ void fl_get_icm_color( FL_COLOR col, int * r, int * g, int * b ) { int i; for ( i = 0; i < flmapsize; i++ ) if ( col == fli_imap[ i ].index ) { if ( FL_is_gray( fl_vmode ) ) *r = *g = *b = fli_imap[ i ].grayval; else { *r = fli_imap[ i ].r; *g = fli_imap[ i ].g; *b = fli_imap[ i ].b; } return; } } /*************************************** * query real colormap. r,g,b returned is the current color used ***************************************/ unsigned long fl_getmcolor( FL_COLOR i, int * r, int * g, int * b ) { XColor exact; if ( ( exact.pixel = fl_get_pixel( i ) ) >= max_server_cols ) { *r = *g = *b = 0; return ( unsigned long ) -1; } XQueryColor( flx->display, fli_map( fl_vmode ), &exact ); *r = ( exact.red >> 8 ) & 0xff; *g = ( exact.green >> 8 ) & 0xff; *b = ( exact.blue >> 8 ) & 0xff; return exact.pixel; } /*** End of Colormap routines *******}***************/ /*************************************** ***************************************/ int fl_get_visual_depth( void ) { return fl_state[ fl_vmode ].depth; } /*************************************** * print out the current state info. For debugging only ***************************************/ #if FL_DEBUG >= ML_WARN void fli_dump_state_info( int mode, const char * where ) { FL_State *fs = fl_state + mode; XVisualInfo xvi; if ( fli_cntl.debug ) { fprintf( stderr, "In %s", where ); fprintf( stderr, " VClass: %s", fli_vclass_name( fli_class( mode ) ) ); fprintf( stderr, " VisualID: 0x%lx", fs->xvinfo->visualid ); fprintf( stderr, " Depth: %d %d", fli_depth( mode ), fs->xvinfo->depth ); fprintf( stderr, " Colormap: 0x%lx\n", fli_map( mode ) ); } /* Some more checks */ if ( ! XMatchVisualInfo( flx->display, fl_screen, fli_depth( mode ), fli_class( mode ), &xvi ) ) { M_err( "fli_dump_state_info", "Can't match listed visual" ); exit( 1 ); } /* Possible on SGI with OpenGL selected visuals */ if ( fli_visual( mode )->visualid != xvi.visualid ) M_warn( "fli_dump_state_info", "inconsistent visualID, probably OK" ); /* State info consistency */ if ( fli_depth( mode ) != fs->xvinfo->depth ) { M_err( "fli_dump_state_info", "Bad Depth" ); exit( 1 ); } if ( fli_class( mode ) != fs->xvinfo->class ) { M_err( "fli_dump_state_info", "Bad visual class" ); exit( 1 ); } } #endif /*************************************** ***************************************/ int fl_mode_capable( int mode, int warn ) { int cap; if ( mode < 0 || mode > 5 ) { M_err( "fl_mode_capable", "Bad mode = %d", mode ); return 0; } cap = fli_depth( mode ) >= FL_MINDEPTH && fli_visual( mode ); if ( ! cap && warn ) M_warn( "fl_mode_capable", "Not capable of %s at depth = %d", fli_vclass_name( mode ), fli_depth( mode ) ); return cap; } /*************************************** * Convert a RGB triple into a pixel value usable in DirectColor * and TrueColor. Note the RGB triple is ONE-BYTE EACH. ***************************************/ static FL_COLOR rgb2pixel( unsigned int r, unsigned int g, unsigned int b ) { FL_State *s = fl_state + fl_vmode; /* This one drops bits and looks bad if primary color resolution is less than 6, but server calculates color this way. A better way should be r = ((float) r * ((1L << s->rbits) - 1) / 255.0 + 0.1); */ if ( s->rbits < 8 ) { r >>= 8 - s->rbits; g >>= 8 - s->gbits; b >>= 8 - s->bbits; } else if ( s->rbits > 8 ) { r <<= 8 - s->rbits; g <<= 8 - s->gbits; b <<= 8 - s->bbits; } return ( ( ( unsigned long ) r << s->rshift ) & s->rmask ) | ( ( ( unsigned long ) g << s->gshift ) & s->gmask ) | ( ( ( unsigned long ) b << s->bshift ) & s->bmask ); } /*************************************** * Create a colormap valid for the given visual. It also * fills the colormap with default XFORMS map ***************************************/ #define MAXFILL ( FL_BUILT_IN_COLS + 1 ) #define MAXREAD 100 Colormap fl_create_colormap( XVisualInfo * xv, int nfill ) { long black = BlackPixel( flx->display, fl_screen ); long white = WhitePixel( flx->display, fl_screen ); XColor xc; Colormap cmap; int depth = xv->depth == 32 ? 24:xv->depth; int maxcolors = 1 << depth; int maxread = FL_min( MAXREAD, maxcolors ); XColor *cur_entries = fl_malloc( maxread * sizeof *cur_entries ), *dc; unsigned long pixels[ MAXREAD ], allocated[ MAXREAD ]; int keep = maxcolors / 32; cmap = XCreateColormap( flx->display, fl_root, xv->visual, xv->class != FL_DirectColor ? AllocNone : AllocAll ); /* As a minimum try to preserve Black or White */ xc.flags = DoRed | DoGreen | DoBlue; xc.pixel = 0; if ( black == 0 && nfill >= 0 ) { xc.red = xc.green = xc.blue = 0; XAllocColor( flx->display, cmap, &xc ); } else if ( white == 0 && nfill >= 0 ) { xc.red = xc.green = xc.blue = 0xffff; XAllocColor( flx->display, cmap, &xc ); } /* Now if have the same visual, we can do event more */ if ( nfill > 0 && fl_vmode == xv->class && fl_vmode != DirectColor ) { int i, k; nfill = FL_min( MAXFILL, nfill ); nfill = FL_min( nfill, maxcolors ); if ( nfill < 4 ) /* potentially 8+1+4 colors */ nfill = 4; for ( i = 0; i < maxread; i++ ) cur_entries[ i ].pixel = i; XQueryColors( flx->display, fli_map( fl_vmode ), cur_entries, maxread ); dc = cur_entries; for ( k = i = 0; i < maxread; i++, dc++ ) { allocated[ i ] = FL_NoColor; dc->flags = DoRed | DoGreen | DoBlue; if ( XAllocColor( flx->display, cmap, dc ) ) allocated[ k++ ] = dc->pixel; } /* Now free the non-xforms colors, but keep some non-xforms entries */ for ( k = 0, i = keep; i < maxread; i++ ) { unsigned int p = allocated[ i ]; int j, found; for ( j = found = 0; ! found && j < nfill; j++ ) found = p == fl_get_pixel( j ) || p == ( unsigned long ) white || p == ( unsigned long ) black || p == 34; if ( ! found && p != FL_NoColor ) pixels[ k++ ] = p; } if ( k ) { M_warn( "fl_create_colormap", "free %d\n", k ); XFreeColors( flx->display, cmap, pixels, k, 0 ); } } fl_free( cur_entries ); return cmap; } /*************************************** ***************************************/ void fl_set_color_leak( int y ) { allow_leakage = y; } /*************************************** * if an index is being for the first time, the corresponding pixel * is either reserverd or bad, need to trap it ***************************************/ static int bad_color_handler( Display * d FL_UNUSED_ARG, XErrorEvent * xev ) { if ( xev->error_code == BadAccess ) M_warn( "bad_color_handler", "bad pixel" ); return 0; } /*************************************** ***************************************/ void fl_free_pixels( unsigned long * pix, int n ) { int ( *oh )( Display *, XErrorEvent * ); oh = XSetErrorHandler( bad_color_handler ); XFreeColors( flx->display, fli_map( fl_vmode ), pix, n, 0 ); XSync( flx->display, 0 ); XSetErrorHandler( oh ); } /*************************************** ***************************************/ void fl_free_colors( FL_COLOR * c, int n ) { int i, k, j = -1; unsigned long * pixels = fl_malloc( n * sizeof *pixels ), *pix; lut = fl_state[ fl_vmode ].lut; pix = pixels; for ( k = 0; k < n; k++, c++, pix++ ) { /* If requested color is reserved, warn */ if ( *c < FL_FREE_COL1 ) M_warn( "fl_free_colors", "Freeing reserved color" ); /* Must invalidate color cache */ if ( *c == flx->color ) flx->color = BadPixel; for ( i = 0; j < 0 && i < flmapsize; i++ ) if ( *c == fli_imap[ i ].index ) j = i; if ( j < 0 ) j = flmapsize - 1; /* Pixel value known by the server */ *pix = lut[ *c ]; /* Mark this pixel as bad */ lut[ *c ] = BadPixel; } fl_free_pixels( pixels, n ); fl_free( pixels ); } /*************************************** * (r,g,b) input should be 8bit each ***************************************/ #define LINEAR_COLOR_DISTANCE 0 int fli_find_closest_color( int r, int g, int b, XColor * map, int len, unsigned long * pix ) { long mindiff = 0x7fffffffL, diff; int dr, dg, db; int i, k; for ( k = i = 0; i < len; i++ ) { dr = r - ( ( map[ i ].red >> 8 ) & 0xff ); dg = g - ( ( map[ i ].green >> 8 ) & 0xff ); db = b - ( ( map[ i ].blue >> 8 ) & 0xff ); /* Correct formula is (.299,.587,.114) */ #if LINEAR_COLOR_DISTANCE diff = 3 * FL_abs( dr ) + 4 * FL_abs( dg ) + 2 * FL_abs( db ); #else diff = 3 * ( dr * dr ) + 4 * ( dg * dg ) + 2 * ( db * db ); #endif if ( diff < 0 ) fprintf( stderr, "dr = %d dg = %d db = %d diff = %ld\n", dr, dg, db, diff ); if ( diff < mindiff ) { mindiff = diff; k = i; *pix = map[ i ].pixel; } } return k; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/goodie_sinput.c0000644000175000017500000000654312251554163013553 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file goodie_sinput.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" /*********** Simple input ********************{*******/ typedef struct { FL_FORM * form; FL_OBJECT * str1; FL_OBJECT * input; FL_OBJECT * but; } FD_input; /*************************************** ***************************************/ static FD_input * create_input( const char * str1, const char * defstr ) { FD_input *fdui = fl_calloc( 1, sizeof *fdui ); int oldy = fli_inverted_y; int oldu = fl_get_coordunit( ); fli_inverted_y = 0; fl_set_coordunit( FL_COORD_PIXEL ); fdui->form = fl_bgn_form( FL_FLAT_BOX, 460, 130 ); fdui->input = fl_add_input( FL_NORMAL_INPUT, 30, 50, 400, 30, str1 ); fl_set_input( fdui->input, defstr ); fdui->but = fl_add_button( FL_RETURN_BUTTON, 185, 94, 90, 27, "OK" ); fli_parse_goodies_label( fdui->but, FLOKLabel ); fl_set_form_hotobject( fdui->form, fdui->but ); fl_end_form( ); fli_handle_goodie_font( fdui->but, fdui->input ); fl_register_raw_callback( fdui->form, FL_ALL_EVENT, fli_goodies_preemptive ); fl_set_form_atclose( fdui->form, fl_goodies_atclose, fdui->but ); fli_inverted_y = oldy; fl_set_coordunit( oldu ); return fdui; } static FD_input *fd_input = NULL; static char *ret_str = NULL; /*************************************** * Asks the user for textual input ***************************************/ const char * fl_show_simple_input( const char * str1, const char * defstr ) { if ( fd_input ) { fl_hide_form( fd_input->form ); fl_free_form( fd_input->form ); fli_safe_free( fd_input ); } else fl_deactivate_all_forms( ); fli_safe_free( ret_str ); fd_input = create_input( str1, defstr ); fl_show_form( fd_input->form, FL_PLACE_HOTSPOT, FL_TRANSIENT, "Input" ); fl_update_display( 0 ); while ( fl_do_only_forms( ) != fd_input->but ) /* empty */ ; ret_str = fl_strdup( fl_get_input( fd_input->input ) ); fl_hide_form( fd_input->form ); fl_free_form( fd_input->form ); fli_safe_free( fd_input ); fl_activate_all_forms( ); return ret_str; } /*************************************** ***************************************/ void fli_sinput_cleanup( void ) { fli_safe_free( fd_input ); fli_safe_free( ret_str ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/button.c0000664000175000017500000004345112353623325012217 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file button.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * All Buttons. Additional button class can be added via * fl_add_button_class and fl_create_generic_button */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include #define ISTABBOX( t ) ( t == FL_TOPTAB_UPBOX \ || t == FL_SELECTED_TOPTAB_UPBOX \ || t == FL_BOTTOMTAB_UPBOX \ || t == FL_SELECTED_BOTTOMTAB_UPBOX ) #define WITHIN( obj, mx, my ) ( ( mx ) >= ( obj )->x \ && ( mx ) < ( obj )->x + ( obj )->w \ && ( my ) >= ( obj )->y \ && ( my ) < ( obj )->y + ( obj )->h ) /*************************************** ***************************************/ static void free_pixmap( FL_BUTTON_STRUCT * sp ) { if ( sp->pixmap ) { XFreePixmap( flx->display, sp->pixmap ); sp->pixmap = None; } } /********** DRAWING *************/ /*************************************** * Draws a button object ***************************************/ void fli_draw_button( FL_OBJECT * obj ) { FL_Coord dh, dw, ww, absbw = FL_abs( obj->bw ); int off2 = 0; FL_BUTTON_STRUCT *sp = obj->spec; FL_COLOR col = sp->val ? obj->col2 : obj->col1; if ( obj->belowmouse && obj->active ) { if ( col == FL_BUTTON_COL1 ) col = FL_BUTTON_MCOL1; else if ( col == FL_BUTTON_COL2 ) col = FL_BUTTON_MCOL2; } if ( FL_IS_UPBOX( obj->boxtype ) && ( sp->val || sp->is_pushed ) ) fl_draw_box( FL_TO_DOWNBOX( obj->boxtype ), obj->x, obj->y, obj->w, obj->h, col, obj->bw ); else fl_draw_box( obj->boxtype, obj->x, obj->y, obj->w, obj->h, col, obj->bw ); dh = FL_crnd( 0.6 * obj->h ); dw = FL_crnd( FL_min( 0.6 * obj->w, dh ) ); ww = FL_crnd( 0.75 * obj->h ); if ( ww < dw + absbw + 1 + ( obj->bw > 0 ) ) ww = dw + absbw + 1 + ( obj->bw > 0 ); if ( obj->type == FL_RETURN_BUTTON ) { fl_draw_text( 0, obj->x + obj->w - ww, FL_crnd( obj->y + 0.2 * obj->h ), dw, dh, obj->lcol, 0, 0, "@returnarrow" ); off2 = dw - 2; } if ( obj->type == FL_MENU_BUTTON && obj->boxtype == FL_UP_BOX ) { int dbh = FL_max( absbw - 1, 1 ); dw = FL_max( 0.11 * obj->w, 13 ); dh = FL_max( 6 + (obj->bw > 0 ), obj->h * 0.1 ); fl_draw_box( FL_UP_BOX, obj->x + obj->w - dw - absbw - 2, obj->y + ( obj->h - dh ) / 2, dw, dh, obj->col1, -dbh ); off2 = dw - 1; } if ( obj->type == FL_MENU_BUTTON || obj->type == FL_RETURN_BUTTON ) { obj->w -= off2; fl_draw_object_label( obj ); obj->w += off2; } else if ( obj->boxtype & FLI_BROKEN_BOX || ISTABBOX( obj->boxtype ) ) { fl_set_text_clipping( obj->x + 3, obj->y, obj->w - 6, obj->h ); fl_draw_object_label( obj ); fl_unset_text_clipping( ); } else fl_draw_object_label( obj ); } /*************************************** * All button classes differ only in the way they are drawn, so we * separate this info out from generic button handlers ***************************************/ #define MAX_BUTTON_CLASS 12 typedef struct { FL_DrawButton drawbutton; FL_CleanupButton cleanup; int bclass; /* button class */ } ButtonRec; static ButtonRec how_draw[ MAX_BUTTON_CLASS ]; /*************************************** * Look up a drawing function given a button class ID ***************************************/ static FL_DrawButton lookup_drawfunc( int bclass ) { ButtonRec *db = how_draw, *dbs = how_draw + MAX_BUTTON_CLASS; for ( ; db < dbs; db++ ) if ( db->bclass == bclass ) return db->drawbutton; return NULL; } /*************************************** ***************************************/ static FL_CleanupButton lookup_cleanupfunc( int bclass ) { ButtonRec *db = how_draw, *dbs = how_draw + MAX_BUTTON_CLASS; for ( ; db < dbs; db++ ) if ( db->bclass == bclass ) return db->cleanup; return NULL; } /*************************************** * Associates a button class with a drawing function ***************************************/ void fl_add_button_class( int bclass, FL_DrawButton drawit, FL_CleanupButton cleanup ) { static int initialized; ButtonRec *db = how_draw, *dbs = how_draw + MAX_BUTTON_CLASS, *first_avail; if ( ! initialized ) { for ( ; db < dbs; db++ ) db->bclass = -1; initialized = 1; } for ( db = how_draw, first_avail = NULL; db < dbs; db++ ) if ( db->bclass == bclass ) { db->drawbutton = drawit; db->cleanup = cleanup; return; } else if ( db->bclass < 0 && ! first_avail ) first_avail = db; /* If we get here, the class is not defined yet */ if ( first_avail ) { first_avail->bclass = bclass; first_avail->drawbutton = drawit; first_avail->cleanup = cleanup; } else M_err( "fl_add_button_class", "Exceeding limit: %d", MAX_BUTTON_CLASS ); } /*************************************** ***************************************/ static void wait_for_release( XKeyEvent * ev ) { KeySym ksm; if ( ( ksm = XLookupKeysym( ev, 0 ) ) == NoSymbol ) return; while ( fl_keysym_pressed( ksm ) ) { XSync( flx->display, 0 ); fl_msleep( 15 ); } } /*************************************** * Handles an event for a button object ***************************************/ static int handle_button( FL_OBJECT * obj, int event, FL_Coord mx, FL_Coord my, int key, void * ev ) { static int oldval; int newval; FL_BUTTON_STRUCT *sp = obj->spec; FL_DrawButton drawit; FL_CleanupButton cleanup; int ret = FL_RETURN_NONE; switch ( event ) { case FL_DRAW : sp->event = FL_DRAW; if ( obj->type != FL_HIDDEN_BUTTON && obj->type != FL_HIDDEN_RET_BUTTON ) { if ( ( drawit = lookup_drawfunc( obj->objclass ) ) ) drawit( obj ); else M_err( "handle_button", "Unknown button class: %d", obj->objclass ); } break; case FL_DRAWLABEL : sp->event = FL_DRAWLABEL; break; /* TODO. Missing labels */ case FL_LEAVE: /* FL_MENU_BUTTON objects never get a FL_RELEASE event, so we have to "fake" one */ if ( obj->type == FL_MENU_BUTTON ) { sp->event = FL_RELEASE; sp->is_pushed = 0; sp->val = 0; } /* fall through */ case FL_ENTER : /* Keep active radio buttons from reacting */ if ( obj->type == FL_RADIO_BUTTON && sp->val == 1 ) obj->belowmouse = 0; sp->event = event; fl_redraw_object( obj ); break; case FL_PUSH : /* Don't accept pushes for an already pushed button (e.g. if the user pushes another mouse button) or for mouse buttons the button isn't set up to react to */ if ( sp->is_pushed ) break; if ( key < FL_MBUTTON1 || key > FL_MBUTTON5 || ! sp->react_to[ key - 1 ] ) { fli_int.pushobj = NULL; break; } sp->event = FL_PUSH; if ( obj->type == FL_RADIO_BUTTON ) { obj->belowmouse = 0; sp->val = 1; fl_redraw_object( obj ); return FL_RETURN_CHANGED | FL_RETURN_END; } oldval = sp->val; sp->val = ! sp->val; sp->is_pushed = 1; sp->mousebut = key; sp->timdel = 1; fl_redraw_object( obj ); if ( obj->type == FL_MENU_BUTTON ) ret |= FL_RETURN_END; if ( obj->type == FL_INOUT_BUTTON || obj->type == FL_MENU_BUTTON || obj->type == FL_TOUCH_BUTTON ) ret |= FL_RETURN_CHANGED; break; case FL_MOTION : if ( obj->type == FL_RADIO_BUTTON || obj->type == FL_INOUT_BUTTON || obj->type == FL_MENU_BUTTON ) break; newval = sp->val; if ( WITHIN( obj, mx, my ) ) { obj->belowmouse = 1; if ( sp->react_to[ key - 1 ] ) newval = ! oldval; } else { obj->belowmouse = 0; if ( sp->react_to[ key - 1 ] ) newval = oldval; } if ( sp->val != newval ) { sp->val = newval; fl_redraw_object( obj ); } break; case FL_RELEASE : if ( key != sp->mousebut && obj->type != FL_RADIO_BUTTON ) { fli_int.pushobj = obj; break; } sp->event = FL_RELEASE; sp->is_pushed = 0; if ( obj->type == FL_INOUT_BUTTON && ! WITHIN( obj, mx, my ) ) obj->belowmouse = 0; if ( obj->type == FL_PUSH_BUTTON ) { fl_redraw_object( obj ); if ( sp->val != oldval ) ret |= FL_RETURN_END | FL_RETURN_CHANGED; } else if ( sp->val == 0 && obj->type != FL_MENU_BUTTON ) fl_redraw_object( obj ); else { sp->val = 0; fl_redraw_object( obj ); if ( obj->type != FL_MENU_BUTTON && obj->type != FL_TOUCH_BUTTON ) ret |= FL_RETURN_END | FL_RETURN_CHANGED; if ( obj->type == FL_TOUCH_BUTTON ) ret |= FL_RETURN_END; } break; case FL_UPDATE : /* only FL_TOUCH_BUTTON receives it */ sp->event = FL_UPDATE; if ( sp->val && sp->timdel++ > 10 && ( sp->timdel & 1 ) == 0 ) ret |= FL_RETURN_CHANGED; break; case FL_SHORTCUT : sp->event = FL_SHORTCUT; /* This is a horrible hack */ if ( obj->type == FL_PUSH_BUTTON || obj->type == FL_RADIO_BUTTON ) { sp->val = ! sp->val; obj->pushed = obj->type == FL_RADIO_BUTTON; fl_redraw_object( obj ); wait_for_release( ev ); } else if ( obj->type == FL_NORMAL_BUTTON || obj->type == FL_RETURN_BUTTON ) { int obl = obj->belowmouse; sp->val = obj->belowmouse = 1; fl_redraw_object( obj ); wait_for_release( ev ); sp->val = 0; obj->belowmouse = obl; fl_redraw_object( obj ); } sp->mousebut = FL_SHORTCUT + key; ret |= FL_RETURN_END | FL_RETURN_CHANGED; break; case FL_FREEMEM : if ( ( cleanup = lookup_cleanupfunc( obj->objclass ) ) ) cleanup( sp ); free_pixmap( sp ); fli_safe_free( obj->spec ); break; } return ret; } /*************************************** * Creates a (generic) button object ***************************************/ FL_OBJECT * fl_create_generic_button( int objclass, int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; FL_BUTTON_STRUCT *sp; int i; obj = fl_make_object( objclass, type, x, y, w, h, label, handle_button ); if ( type == FL_RADIO_BUTTON ) obj->radio = 1; if ( type == FL_RETURN_BUTTON || type == FL_HIDDEN_RET_BUTTON ) fl_set_object_shortcut( obj, "^M", 0 ); if ( type == FL_HIDDEN_BUTTON || type == FL_HIDDEN_RET_BUTTON ) obj->boxtype = FL_NO_BOX; if ( obj->type == FL_TOUCH_BUTTON ) { obj->want_update = 1; obj->how_return = FL_RETURN_CHANGED; } sp = obj->spec = fl_calloc( 1, sizeof *sp ); sp->event = FL_DRAW; sp->is_pushed = 0; sp->pixmap = sp->mask = sp->focus_pixmap = sp->focus_mask = None; sp->cspecv = NULL; sp-> filename = sp->focus_filename = NULL; sp->is_pushed = 0; sp->mousebut = 0; /* Per default a button (unfortunately) reacts to all mouse buttons */ for ( i = 0; i < 5; i++ ) sp->react_to[ i ] = 1; if ( fli_cntl.buttonLabelSize ) obj->lsize = fli_cntl.buttonLabelSize; return obj; } /*************************************** * Sets the buttons state ***************************************/ void fl_set_button( FL_OBJECT * obj, int pushed ) { FL_BUTTON_STRUCT *sp = obj->spec; pushed = pushed ? 1 : 0; /* button can only be on or off */ /* Nothing to do if the new state is already what the button is set to */ if ( sp->val == pushed ) return; /* If this is a radio button to be shown as switched on unset other radio button in its group */ if ( obj->type == FL_RADIO_BUTTON && pushed ) fli_do_radio_push( obj, obj->x, obj->y, FL_MBUTTON1, NULL, 1 ); /* Set new state and redraw the button */ sp->val = pushed; fl_redraw_object( obj ); } /*************************************** * Returns the value of the button ***************************************/ int fl_get_button( FL_OBJECT * obj ) { return ( ( FL_BUTTON_STRUCT * ) obj->spec )->val; } /*************************************** * Returns the number of the last used mouse button. * fl_mouse_button will also return the mouse number ***************************************/ int fl_get_button_numb( FL_OBJECT * obj ) { return ( ( FL_BUTTON_STRUCT * ) obj->spec )->mousebut; } /*************************************** * Creates a button ***************************************/ FL_OBJECT * fl_create_button( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; fl_add_button_class( FL_BUTTON, fli_draw_button, 0 ); obj = fl_create_generic_button( FL_BUTTON, type, x, y, w, h, label ); obj->boxtype = FL_BUTTON_BOXTYPE; obj->col1 = FL_BUTTON_COL1; obj->col2 = FL_BUTTON_COL2; obj->align = FL_BUTTON_ALIGN; obj->lcol = FL_BUTTON_LCOL; return obj; } /*************************************** * Adds a button to the current form ***************************************/ FL_OBJECT * fl_add_button( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label) { FL_OBJECT *obj = fl_create_button( type, x, y, w, h, label ); fl_add_object( fl_current_form, obj ); return obj; } /*************************************** * Function allows to set up to which mouse * buttons the button object will react. ***************************************/ void fl_set_button_mouse_buttons( FL_OBJECT * obj, unsigned int mouse_buttons ) { FL_BUTTON_STRUCT *sp = obj->spec; unsigned int i; for ( i = 0; i < 5; i++, mouse_buttons >>= 1 ) sp->react_to[ i ] = mouse_buttons & 1; } /*************************************** * Function returns a value via 'mouse_buttons', indicating * which mouse buttons the button object will react to. ***************************************/ void fl_get_button_mouse_buttons( FL_OBJECT * obj, unsigned int * mouse_buttons ) { FL_BUTTON_STRUCT *sp; int i; unsigned int k; if ( ! obj ) { M_err( "fl_get_button_mouse_buttons", "NULL object" ); return; } if ( ! mouse_buttons ) return; sp = obj->spec; *mouse_buttons = 0; for ( i = 0, k = 1; i < 5; i++, k <<= 1 ) *mouse_buttons |= sp->react_to[ i ] ? k : 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/handling.c0000664000175000017500000013763312353623325012476 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" #include "flinternal.h" static void do_interaction_step( int ); static int get_next_event_or_idle( int, FL_FORM **, XEvent * ); static void handle_keyboard_event( XEvent * xev, int formevent ); static void handle_EnterNotify_event( FL_FORM * ); static void handle_LeaveNotify_event( void ); static void handle_MotionNotify_event( FL_FORM * ); static void handle_ButtonPress_event( FL_FORM * evform ); static void handle_ButtonRelease_event( FL_FORM * evform ); static void handle_Expose_event( FL_FORM *, FL_FORM ** ); static void handle_ConfigureNotify_event( FL_FORM *, FL_FORM ** ); static void handle_ClientMessage_event( FL_FORM * form, void * xev ); static int form_event_queued( XEvent *, int ); /* Waiting time (in ms) for fl_check_forms() and fl_check_only_forms(). Originally this value was 10 ms. */ #define SHORT_PAUSE 1 /* How frequently to generate FL_STEP event, in milliseconds is set here. * These are modified if an idle callback exists */ static int delta_msec = FLI_TIMER_RES; static XEvent st_xev; extern void ( * fli_handle_signal )( void ); /* defined in signal.c */ extern int ( * fli_handle_clipboard )( void * ); /* defined in clipboard.c */ /* When set results in behaviour as in version 1.0.90 and before where clicking on a non-input object didn't make an input object lose focus shortly and thus no "end of editing" was signaled to the user */ static int end_event_for_input = FL_INPUT_END_EVENT_ALWAYS; /*************************************** * Function for switching between "old" and "new" input handling * when another non-input object is clicked on ***************************************/ int fl_input_end_return_handling( int type ) { int old_end_event_for_input = end_event_for_input; end_event_for_input = type; return old_end_event_for_input; } /*************************************** ***************************************/ static int fli_XLookupString( XKeyEvent * xkey, char * buf, int buflen, KeySym * ks ) { int len = INT_MIN; if ( ! fli_context->xic ) len = XLookupString( xkey, buf, buflen, ks, 0 ); else { Status status; len = XmbLookupString( fli_context->xic, xkey, buf, buflen, ks, &status ); if ( status == XBufferOverflow ) len = -len; } return len; } /*************************************** * Converts 'state' member of the 'xkey' member of an XEvent * into the corresponding mouse button number ***************************************/ static int xmask2button( unsigned int mask ) { if ( mask & Button1Mask ) return FL_LEFT_MOUSE; if ( mask & Button2Mask ) return FL_MIDDLE_MOUSE; if ( mask & Button3Mask ) return FL_RIGHT_MOUSE; if ( mask & Button4Mask ) return FL_SCROLLUP_MOUSE; if ( mask & Button5Mask ) return FL_SCROLLDOWN_MOUSE; return 0; } /*************************************** * A radio object is pushed ***************************************/ void fli_do_radio_push( FL_OBJECT * obj, FL_Coord x, FL_Coord y, int key, void * xev, int no_callbacks ) { FL_OBJECT *o = obj; if ( ! obj || ! obj->radio ) return; /* If this radio button does not belong to any group we have to search the entire form, otherwise just treat the members of the group */ if ( obj->group_id == 0 ) { for ( o = obj->form->first; o; o = o->next ) if ( o != obj && o->radio && o->group_id == 0 && fl_get_button( o ) ) { fli_handle_object( o, FL_RELEASE, x, y, key, xev, 0 ); break; } } else { while ( o->prev && o->prev->objclass != FL_BEGIN_GROUP ) o = o->prev; for ( ; o && o->objclass != FL_END_GROUP; o = o->next ) if ( o != obj && o->radio && fl_get_button( o ) ) { fli_handle_object( o, FL_RELEASE, x, y, key, xev, 0 ); break; } } if ( ! no_callbacks ) fli_handle_object( obj, FL_PUSH, x, y, key, xev, 1 ); } /*************************************** ***************************************/ static int do_shortcut( FL_FORM * form, int key, FL_Coord x, FL_Coord y, XEvent * xev ) { int key1, key2; FL_OBJECT *obj; long *s; key1 = key2 = key; /* Check for ALT modifier key */ if ( fl_keypressed( XK_Alt_L ) || fl_keypressed( XK_Alt_R ) ) { if ( key < 256 ) { key1 = FL_ALT_MASK + ( islower( ( int ) key ) ? toupper( ( int ) key ) : key ); key2 = FL_ALT_MASK + key; } else key1 = key2 = FL_ALT_MASK + key; } M_info( "do_shortcut", "win = %ld key = %d %d %d", form->window, key, key1, key2 ); /* Check if an object has this as a shortcut */ for ( obj = form->first; obj; obj = obj->next ) { if ( ! obj->shortcut || ! obj->active || ! obj->visible) continue; for ( s = obj->shortcut; *s; s++ ) { if ( *s != key1 && *s != key2 ) continue; if ( obj->objclass == FL_INPUT ) { if ( obj != form->focusobj ) { fli_handle_object( form->focusobj, FL_UNFOCUS, x, y, 0, xev, 1 ); fli_handle_object( obj, FL_FOCUS, x, y, 0, xev, 1 ); } } else { if ( obj->radio ) fli_do_radio_push( obj, x, y, FL_MBUTTON1, xev, 0 ); XAutoRepeatOff( flx->display ); if ( ! obj->radio ) fli_handle_object( obj, FL_SHORTCUT, x, y, key1, xev, 1 ); fli_context->mouse_button = FL_SHORTCUT + key1; /* This is not exactly correct as shortcut might quit, fl_finish() will restore the keyboard state */ if ( fli_keybdcontrol.auto_repeat_mode == AutoRepeatModeOn ) XAutoRepeatOn( flx->display ); } return 1; } } return 0; } /*************************************** ***************************************/ int fli_do_shortcut( FL_FORM * form, int key, FL_Coord x, FL_Coord y, XEvent * xev ) { int ret = do_shortcut( form, key, x, y, xev ); if ( ! ret ) { if ( form->child ) ret = do_shortcut( form->child, key, x, y, xev ); if ( ! ret && form->parent ) ret = do_shortcut( form->parent, key, x, y, xev ); } return ret; } /*************************************** ***************************************/ static void handle_keyboard( FL_FORM * form, int key, FL_Coord x, FL_Coord y, void * xev ) { FL_OBJECT *obj, *special; /* Always check shortcut first */ if ( fli_do_shortcut( form, key, x, y, xev ) ) return; /* Focus policy is done as follows: Input object has the highest priority. Next comes the object that wants special keys, finally followed by 'mouseobj', having the lowest proiority. */ special = fli_find_first( form, FLI_FIND_KEYSPECIAL, 0, 0 ); obj = special ? fli_find_object( special->next, FLI_FIND_KEYSPECIAL, 0, 0 ) : NULL; /* If two or more objects want keyboard input none will get it and keyboard input will go to mouseobj instead */ if ( obj && obj != special ) special = fli_int.mouseobj; if ( form->focusobj ) { FL_OBJECT *focusobj = form->focusobj; /* Handle special keys first */ if ( key > 255 ) { if ( IsLeft( key ) || IsRight( key ) || IsHome( key ) || IsEnd( key ) ) fli_handle_object( focusobj, FL_KEYPRESS, x, y, key, xev, 1 ); else if ( ( IsUp( key ) || IsDown( key ) || IsPageUp( key ) || IsPageDown( key ) ) && focusobj->wantkey & FL_KEY_TAB ) fli_handle_object( focusobj, FL_KEYPRESS, x, y, key, xev, 1 ); else if ( special && special->wantkey & FL_KEY_SPECIAL ) { /* Moving the cursor in input field that does not have focus looks weird */ if ( special->objclass != FL_INPUT ) fli_handle_object( special, FL_KEYPRESS, x, y, key, xev, 1 ); } else if ( key == XK_BackSpace || key == XK_Delete ) fli_handle_object( focusobj, FL_KEYPRESS, x, y, key, xev, 1 ); return; } /* The and keys move the focus to the next or previous input object (depending on being pressed also, and for only if the current focus object hasn't set FL_KEY_TAB as it's the case for multiline input objects) */ if ( key == '\t' || ( key == '\r' && ! ( focusobj->wantkey & FL_KEY_TAB ) ) ) { fli_handle_object( focusobj, FL_UNFOCUS, x, y, 0, xev, 1 ); if ( ( ( XKeyEvent * ) xev )->state & fli_context->navigate_mask ) { if ( ! ( obj = fli_find_object_backwards( focusobj->prev, FLI_FIND_INPUT, 0, 0 ) ) ) obj = fli_find_last( form, FLI_FIND_INPUT, 0, 0 ); } else /* search forward */ { if ( ! ( obj = fli_find_object( focusobj->next, FLI_FIND_INPUT, 0, 0 ) ) ) obj = fli_find_first( form, FLI_FIND_INPUT, 0, 0 ); } fli_handle_object( obj, FL_FOCUS, x, y, 0, xev, 1 ); } else if ( focusobj->wantkey != FL_KEY_SPECIAL ) fli_handle_object( focusobj, FL_KEYPRESS, x, y, key, xev, 1 ); return; } /* Keyboard input is not wanted */ if ( ! special || special->wantkey == 0 ) return; /* Space is an exception for browser */ if ( ( ( key > 255 || key == ' ' ) && special->wantkey & FL_KEY_SPECIAL ) || ( key < 255 && special->wantkey & FL_KEY_NORMAL ) || ( special->wantkey == FL_KEY_ALL ) ) fli_handle_object( special, FL_KEYPRESS, x, y, key, xev, 1 ); } /*************************************** * Updates a form according to an event ***************************************/ void fli_handle_form( FL_FORM * form, int event, int key, XEvent * xev ) { FL_OBJECT *obj = NULL; FL_Coord x, y; if ( ! form || form->visible != FL_VISIBLE ) return; if ( form->deactivated && event != FL_DRAW ) return; if ( form->parent_obj && ! form->parent_obj->active && event != FL_DRAW ) return; if ( event != FL_STEP ) fli_set_form_window( form ); if ( fli_int.query_age > 0 && fli_int.mouseform ) { fl_get_form_mouse( fli_int.mouseform, &fli_int.mousex, &fli_int.mousey, &fli_int.keymask ); if ( event != FL_KEYPRESS ) key = xmask2button( fli_int.keymask ); fli_int.query_age = 0; } x = fli_int.mousex; y = fli_int.mousey; /* Except for step and draw events search for the object the event is for */ if ( event != FL_STEP && event != FL_DRAW ) obj = fli_find_last( form, FLI_FIND_MOUSE, x, y ); switch ( event ) { case FL_DRAW: /* form must be redrawn completely */ fl_redraw_form( form ); break; case FL_ENTER: /* mouse did enter the form */ fli_int.mouseobj = obj; fli_handle_object( fli_int.mouseobj, FL_ENTER, x, y, 0, xev, 1 ); break; case FL_LEAVE: /* mouse left the form */ fli_handle_object( fli_int.mouseobj, FL_LEAVE, x, y, 0, xev, 1 ); if ( fli_int.pushobj == fli_int.mouseobj ) fli_int.pushobj = NULL; fli_int.mouseobj = NULL; break; case FL_PUSH: /* mouse button was pushed inside the form */ /* Change focus: If an input object has the focus make it lose it (and thus report changes) and then set the focus to either the object that got pushed (if it's an input object) or back to the original one. Then we have to recheck that the object the FL_PUSH was for is still active - it may have become deactivated due to the handler for the object that became unfocused! */ if ( obj ) { if ( form->focusobj && form->focusobj != obj && ( obj->input || end_event_for_input ) ) { FL_OBJECT *old_focusobj = form->focusobj; fli_handle_object( old_focusobj, FL_UNFOCUS, x, y, key, xev, 1 ); if ( ! obj->input || ! obj->active ) fli_handle_object( old_focusobj, FL_FOCUS, x, y, key, xev, 1 ); } if ( obj->input && obj->active ) fli_handle_object( obj, FL_FOCUS, x, y, key, xev, 1 ); } if ( form->focusobj ) fli_int.keyform = form; if ( ! obj || ! obj->active ) break; /* Radio button only get handled on button release, other objects get the button press unless focus is overriden */ if ( ! obj->radio && ( ! obj->input || ( obj->input && obj->active && obj->focus ) ) ) { fli_int.pushobj = obj; fli_handle_object( obj, FL_PUSH, x, y, key, xev, 1 ); } else if ( obj->radio ) fli_do_radio_push( obj, x, y, key, xev, 0 ); break; case FL_RELEASE : /* mouse button was released inside the form */ if ( fli_int.pushobj ) { obj = fli_int.pushobj; fli_int.pushobj = NULL; fli_handle_object( obj, FL_RELEASE, x, y, key, xev, 1 ); } break; case FL_MOTION: /* mouse position changed in the form */ /* "Pushable" objects always get FL_MOTION events. Since there's no direct EnterNotify or LeaveNotify event for objects we "fake" them when an object gets entered or left. */ if ( fli_int.pushobj != NULL ) fli_handle_object( fli_int.pushobj, FL_MOTION, x, y, key, xev, 1 ); else if ( obj != fli_int.mouseobj ) { fli_handle_object( fli_int.mouseobj, FL_LEAVE, x, y, 0, xev, 1 ); fli_handle_object( fli_int.mouseobj = obj, FL_ENTER, x, y, 0, xev, 1 ); } /* Objects can declare that they want FL_MOTION events even though they're not "pushable" objects e.g. because they have some internal structure that depends on the mouse position (e.g. choice and counter objects). */ if ( obj != fli_int.pushobj && obj && obj->want_motion ) fli_handle_object( obj, FL_MOTION, x, y, key, xev, 1 ); break; case FL_KEYPRESS: /* key was pressed */ handle_keyboard( form, key, x, y, xev ); break; case FL_STEP: /* simple step */ obj = fli_find_first( form, FLI_FIND_AUTOMATIC, 0, 0 ); if ( obj ) fli_set_form_window( form ); /* set only if required */ while ( obj ) { fli_handle_object( obj, FL_STEP, x, y, 0, xev, 1 ); obj = fli_find_object( obj->next, FLI_FIND_AUTOMATIC, 0, 0 ); } break; case FL_UPDATE: /* "Pushable" objects may request an FL_UPDATE event by an artificial (but not very precise) timer.*/ if ( fli_int.pushobj && fli_int.pushobj->want_update ) fli_handle_object( fli_int.pushobj, FL_UPDATE, x, y, key, xev, 1 ); break; case FL_MOVEORIGIN: case FL_OTHER: /* Need to dispatch it through all objects and monitor the status of forms as it may get closed */ for ( obj = form->first; obj && form->visible == FL_VISIBLE; obj = obj->next ) if ( obj->visible ) fli_handle_object( obj, event, x, y, key, xev, 0 ); break; } } static int preemptive_consumed( FL_FORM *, int, XEvent * ); /*************************************** * Given an X event check for which of our forms it is ***************************************/ FL_FORM * fli_find_event_form( XEvent * xev ) { return fl_win_to_form( ( ( XAnyEvent * ) xev )->window ); } /*************************************** ***************************************/ const XEvent * fl_last_event( void ) { return &st_xev; } static int ignored_fake_configure; /*************************************** ***************************************/ static int button_is_really_down( void ) { FL_Coord x, y; unsigned int km; fl_get_mouse( &x, &y, &km ); return button_down( km ); } /*************************************** * Handle all events in the queue and flush output buffer ***************************************/ void fli_treat_interaction_events( int wait_io ) { XEvent xev; if ( fl_display == None ) return; /* If no event is present output buffer will be flushed. If one exists XNextEvent() in do_interaction_step() will flush the output buffer */ do do_interaction_step( wait_io ); while ( form_event_queued( &xev, QueuedAfterFlush ) ); } /*************************************** ***************************************/ static void do_interaction_step( int wait_io ) { FL_FORM *evform = NULL; static FL_FORM *redraw_form = NULL; if ( ! get_next_event_or_idle( wait_io, &evform, &st_xev ) ) return; /* Got an event for one of the forms */ #if FL_DEBUG >= ML_WARN if ( st_xev.type != MotionNotify || fli_cntl.debug > 2 ) fli_xevent_name( "MainLoop", &st_xev ); #endif fli_compress_event( &st_xev, evform->compress_mask ); fli_int.query_age++; /* Run user raw callbacks for events, we're done if we get told that we're not supposed to do anything else with the event */ if ( preemptive_consumed( evform, st_xev.type, &st_xev ) ) return; /* Otherwise we need to handle the event ourself... */ switch ( st_xev.type ) { case MappingNotify: XRefreshKeyboardMapping( ( XMappingEvent * ) &st_xev ); break; case FocusIn: if ( evform->focusobj ) fli_int.keyform = evform; if ( fli_context->xic ) XSetICValues( fli_context->xic, XNFocusWindow, st_xev.xfocus.window, XNClientWindow, st_xev.xfocus.window, ( char * ) NULL ); break; case FocusOut: fli_int.keyform = NULL; break; case KeyPress: handle_keyboard_event( &st_xev, FL_KEYPRESS ); break; case KeyRelease: handle_keyboard_event( &st_xev, FL_KEYRELEASE ); break; case EnterNotify: handle_EnterNotify_event( evform ); break; case LeaveNotify: handle_LeaveNotify_event( ); break; case MotionNotify: handle_MotionNotify_event( evform ); break; case ButtonPress: handle_ButtonPress_event( evform ); break; case ButtonRelease: handle_ButtonRelease_event( evform ); break; case Expose: handle_Expose_event( evform, &redraw_form ); break; case ConfigureNotify: handle_ConfigureNotify_event( evform, &redraw_form ); break; case ClientMessage: handle_ClientMessage_event( evform, &st_xev ); break; case DestroyNotify: /* only sub-form gets this due to parent destroy */ fl_hide_form( evform ); break; case SelectionClear: case SelectionRequest: case SelectionNotify: if ( ! fli_handle_clipboard || fli_handle_clipboard( &st_xev ) < 0 ) fli_handle_form( evform, FL_OTHER, 0, &st_xev ); break; default: fli_handle_form( evform, FL_OTHER, 0, &st_xev ); break; } } /*************************************** ***************************************/ void fli_handle_idling( XEvent * xev, long msec, int do_idle_cb ) { static int within_idle_cb = 0; /* Flag used to avoid an idle callback being called from within itself */ /* Sleep a bit while being on the lookout for async IO events */ fli_watch_io( fli_context->io_rec, msec ); /* Deal with signals */ if ( fli_handle_signal ) fli_handle_signal( ); /* Make sure we have an up-to-date set of data for the mouse position and the state of the keyboard and mouse buttons */ if ( fli_int.query_age > 0 && fli_int.mouseform ) { fl_get_form_mouse( fli_int.mouseform, &fli_int.mousex, &fli_int.mousey, &fli_int.keymask ); fli_int.query_age = 0; xev->xmotion.time = CurrentTime; } else xev->xmotion.time += msec; /* FL_UPDATE and automatic handlers as well as idle callbacks get a synthetic MotionNotify event. Make it up, then call the handler. */ xev->type = MotionNotify; xev->xany.window = fli_int.mouseform ? fli_int.mouseform->window : None; xev->xany.send_event = 1; xev->xmotion.state = fli_int.keymask; xev->xmotion.x = fli_int.mousex; xev->xmotion.y = fli_int.mousey; xev->xmotion.is_hint = 0; /* We need to send an FL_UPDATE while a mouse button is down to "pushable" objects that want it (currently touch button, slider, choice, textbox and counter objects) */ if ( button_down( fli_int.keymask ) && fli_int.pushobj && fli_int.pushobj->want_update && fli_int.mouseform ) fli_handle_form( fli_int.mouseform, FL_UPDATE, xmask2button( fli_int.keymask ), xev ); /* Handle automatic tasks */ if ( fli_int.auto_count ) { int i; for ( i = 0; i < fli_int.formnumb; i++ ) if ( fli_int.forms[ i ]->num_auto_objects ) fli_handle_form( fli_int.forms[ i ], FL_STEP, 0, xev ); } /* If there's a user idle callback invoke it (unless we got called with 'do_idle_cb' set to false or we're already running the idle callback) */ if ( do_idle_cb && ! within_idle_cb && fli_context->idle_rec && fli_context->idle_rec->callback ) { within_idle_cb = 1; fli_context->idle_rec->callback( xev, fli_context->idle_rec->data ); within_idle_cb = 0; } } /*************************************** ***************************************/ static int get_next_event_or_idle( int wait_io, FL_FORM ** form, XEvent * xev ) { static unsigned int cnt = 0; long msec; /* Timeouts should be as precise as possible, so check them each time round. Since they may dictate how long we're going to wait if there is no event determine how how much time we will have to wait now */ if ( ! wait_io ) msec = SHORT_PAUSE; else if ( fli_int.auto_count || fli_int.pushobj || fli_context->idle_rec ) msec = delta_msec; else msec = FL_min( delta_msec * 3, 300 ); if ( fli_context->timeout_rec ) fli_handle_timeouts( &msec ); /* Skip checking for an X event after 10 events, thus giving X events a 10:1 priority over async IO, UPDATE events, automatic handlers and idle callbacks etc. */ if ( ++cnt % 11 && XEventsQueued( flx->display, QueuedAfterFlush ) ) { XNextEvent( flx->display, xev ); /* There might be an input manager that wants the event - FilterEvent() returns true if this is the case and we are supposed to disregard the event */ if ( fli_context->xic && XFilterEvent( xev, None ) ) return 0; /* Find the form the event is for - if it's for one of "our" forms just return, indicating that there;s something to be done, otherwise it must be for e.g. a canvas window and thus has be put on the internal event queue */ if ( ( *form = fli_find_event_form( xev ) ) != NULL ) return 1; /* Please note: we do event compression before the user ever sees the events. This is a bit questionable, at least for mouse movements, since a user may want to get all events (e.g. because s/he wants to draw something exactly following the mouse movements). If this would be changed then care would have to be taken that in the mask for MotionNotify PointerMotionHintMask is *not* set (see the fli_xevent_to_mask() function in appwin.c) since that keeps most motion events from coming through! */ fli_compress_event( xev, ExposureMask | PointerMotionMask | ButtonMotionMask ); fl_XPutBackEvent( xev ); } else { cnt = 0; fli_handle_idling( &st_xev, msec, 1 ); } return 0; } /*************************************** * Handling for KeyPress and KeyRelease events (indicated by either FL_KEYPRESS * or FL_KEYRELEASE as the second argument) ***************************************/ static void handle_keyboard_event( XEvent * xev, int formevent ) { Window win = xev->xkey.window; KeySym keysym = 0; unsigned char keybuf[ 227 ]; int kbuflen; fli_int.mousex = xev->xkey.x; fli_int.mousey = xev->xkey.y; fli_int.keymask = xev->xkey.state; fli_int.query_age = 0; /* Before doing anything save the current modifiers key for the handlers */ if ( win && ( ! fli_int.keyform || fli_get_visible_forms_index( fli_int.keyform ) < 0 ) ) fli_int.keyform = fl_win_to_form( win ); /* Switch keyboard input only if different top-level form */ if ( fli_int.keyform && fli_int.keyform->window != win ) { M_warn( "handle_keyboard_event", "pointer/keybd focus differ" ); if ( fli_int.keyform->child && fli_int.keyform->child->window != win && fli_int.keyform->parent && fli_int.keyform->parent->window != win ) fli_int.keyform = fl_win_to_form( win ); } if ( ! fli_int.keyform ) return; kbuflen = fli_XLookupString( ( XKeyEvent * ) xev, ( char * ) keybuf, sizeof keybuf, &keysym ); if ( kbuflen < 0 ) { if ( kbuflen != INT_MIN ) M_err( "handle_keyboard_event", "keyboad buffer overflow?" ); else M_err( "handle_keyboard_event", "fli_XLookupString failed?" ); return; } /* Ignore modifier keys as they don't cause action and are taken care of by the lookupstring routine */ if ( IsModifierKey( keysym ) ) /* empty */ ; else if ( IsTab( keysym ) ) { /* Fake a tab key, on some systems shift+tab do not generate a tab */ fli_handle_form( fli_int.keyform, formevent, '\t', xev ); } else if ( IsCursorKey( keysym ) || kbuflen == 0 ) fli_handle_form( fli_int.keyform, formevent, keysym, xev ); else { unsigned char *ch; /* All regular keys, including mapped strings */ for ( ch = keybuf; ch < keybuf + kbuflen && fli_int.keyform; ch++ ) fli_handle_form( fli_int.keyform, formevent, *ch, xev ); } } /*************************************** * Handling of EnterNotiy events ***************************************/ static void handle_EnterNotify_event( FL_FORM * evform ) { Window win = st_xev.xany.window; fli_int.mousex = st_xev.xcrossing.x; fli_int.mousey = st_xev.xcrossing.y; fli_int.keymask = st_xev.xcrossing.state; fli_int.query_age = 0; if ( button_down( fli_int.keymask ) && st_xev.xcrossing.mode != NotifyUngrab ) return; if ( fli_int.mouseform ) fli_handle_form( fli_int.mouseform, FL_LEAVE, xmask2button( fli_int.keymask ), &st_xev ); if ( evform ) { fli_int.mouseform = evform; /* This is necessary because the window might be un-managed. To be friendly to other applications, grab focus only if absolutely necessary */ if ( ! fli_int.mouseform->deactivated && ! st_xev.xcrossing.focus && fli_int.unmanaged_count > 0 ) { fli_check_key_focus( "EnterNotify", win ); fl_winfocus( win ); } fli_handle_form( fli_int.mouseform, FL_ENTER, xmask2button( fli_int.keymask ), &st_xev ); } #if FL_DEBUG >= ML_DEBUG else M_err( "handle_EnterNotify_event", "Null form" ); #endif } /*************************************** * Handling of LeaveNotiy events ***************************************/ static void handle_LeaveNotify_event( void ) { fli_int.mousex = st_xev.xcrossing.x; fli_int.mousey = st_xev.xcrossing.y; fli_int.keymask = st_xev.xcrossing.state; fli_int.query_age = 0; if ( button_down( fli_int.keymask ) && st_xev.xcrossing.mode == NotifyNormal ) return; /* olvwm sends LeaveNotify with NotifyGrab whenever button is clicked, ignore it. Due to Xpopup grab, (maybe Wm bug?), end grab can also generate this event. We can tell these two situations by doing a real button_down test (as opposed to relying on the keymask in event) */ if ( st_xev.xcrossing.mode == NotifyGrab && button_is_really_down( ) ) return; if ( ! fli_int.mouseform ) return; fli_handle_form( fli_int.mouseform, FL_LEAVE, xmask2button( fli_int.keymask ), &st_xev ); } /*************************************** * Handling of MotionNotify events ***************************************/ static void handle_MotionNotify_event( FL_FORM * evform ) { Window win = st_xev.xany.window; fli_int.keymask = st_xev.xmotion.state; fli_int.mousex = st_xev.xmotion.x; fli_int.mousey = st_xev.xmotion.y; fli_int.query_age = 0; if ( ! fli_int.mouseform ) { M_warn( "handle_MotionNotify_event", "event win = %ld", win ); return; } /* If there's an object that has the mouse focus but the event isn't for the form of this object the mouse position reported is not relative to that window and we need to adjust it. */ if ( fli_int.mouseform->window != win ) { fli_int.mousex += evform->x - fli_int.mouseform->x; fli_int.mousey += evform->y - fli_int.mouseform->y; } fli_handle_form( fli_int.mouseform, FL_MOTION, xmask2button( fli_int.keymask ), &st_xev ); } /*************************************** * Handling of ButttonPress events ***************************************/ static void handle_ButtonPress_event( FL_FORM * evform FL_UNUSED_ARG ) { fli_int.mousex = st_xev.xbutton.x; fli_int.mousey = st_xev.xbutton.y; fli_int.keymask = st_xev.xbutton.state | ( Button1Mask << ( st_xev.xbutton.button - 1 ) ); fli_int.query_age = 0; fli_context->mouse_button = st_xev.xbutton.button; if ( metakey_down( fli_int.keymask ) && st_xev.xbutton.button == 2 ) fli_print_version( 1 ); else fli_handle_form( fli_int.mouseform, FL_PUSH, st_xev.xbutton.button, &st_xev ); } /*************************************** * Handling of ButttonRelease events ***************************************/ static void handle_ButtonRelease_event( FL_FORM * evform ) { fli_int.mousex = st_xev.xbutton.x; fli_int.mousey = st_xev.xbutton.y; fli_int.keymask = st_xev.xbutton.state & ~ ( Button1Mask << ( st_xev.xbutton.button - 1 ) ); fli_int.query_age = 0; fli_context->mouse_button = st_xev.xbutton.button; /* Before the button was released (but after the press) a new form window may have been created, just below the mouse. In that case the mouse form, which is the one to receive the release event isn't the one that actually gets the event - it goes instead to the newly opened form window. And in this case the coordinates of where the mouse was release are relative to the new window but all the functions called for the object in the original mouse form expect them to be relative to the previous form. Thus we need to adjust these coordinates to be relative to the original mouse form window instead of the window opened since the mouse press. Thanks to Werner Heisch for finding this weired problem... */ if ( fli_int.mouseform ) { if ( fli_int.mouseform != evform ) { st_xev.xbutton.x = fli_int.mousex += evform->x - fli_int.mouseform->x; st_xev.xbutton.y = fli_int.mousey += evform->y - fli_int.mouseform->y; } fli_handle_form( fli_int.mouseform, FL_RELEASE, st_xev.xbutton.button, &st_xev ); } fli_int.mouseform = evform; } /*************************************** * Handling of Expose events ***************************************/ static void handle_Expose_event( FL_FORM * evform, FL_FORM ** redraw_form ) { if ( ! evform ) return; /* If 'redraw_form' is the same as 'evform' we actually got a ConfigureNotify before that isn't handled yet and the data for the Exposure event must be modified - set clipping to the complete area of the form since we got to redraw it completely. */ if ( *redraw_form == evform ) { st_xev.xexpose.x = 0; st_xev.xexpose.y = 0; st_xev.xexpose.width = evform->w; st_xev.xexpose.height = evform->h; *redraw_form = NULL; } else { if ( st_xev.xexpose.x + st_xev.xexpose.width > evform->w ) st_xev.xexpose.width = evform->w - st_xev.xexpose.x; if ( st_xev.xexpose.y + st_xev.xexpose.height > evform->h ) st_xev.xexpose.height = evform->h - st_xev.xexpose.y; } fli_set_global_clipping( st_xev.xexpose.x, st_xev.xexpose.y, st_xev.xexpose.width, st_xev.xexpose.height ); /* Run into trouble by ignoring configure notify */ if ( ignored_fake_configure ) { FL_Coord neww, newh; M_warn( "handle_Expose_event", "Run into trouble - correcting it" ); fl_get_winsize( evform->window, &neww, &newh ); fli_scale_form( evform, ( double ) neww / evform->w, ( double ) newh / evform->h ); ignored_fake_configure = 0; } fli_handle_form( evform, FL_DRAW, 0, &st_xev ); fli_unset_global_clipping( ); } /*************************************** * Handling of ConfigureNotify events ***************************************/ static void handle_ConfigureNotify_event( FL_FORM * evform, FL_FORM ** redraw_form ) { Window win = st_xev.xany.window; int old_w = evform->w; int old_h = evform->h; if ( ! evform ) return; if ( ! st_xev.xconfigure.send_event ) fl_get_winorigin( win, &evform->x, &evform->y ); else { evform->x = st_xev.xconfigure.x; evform->y = st_xev.xconfigure.y; M_warn( "handle_ConfigureNotify_event", "WMConfigure:x = %d y = %d" "w = %d h = %d", evform->x, evform->y, st_xev.xconfigure.width, st_xev.xconfigure.height ); } /* mwm sends bogus ConfigureNotify randomly without following up with a redraw event, but it does set send_event. The check is somewhat dangerous, use 'ignored_fake_configure' to make sure when we got expose we can respond correctly. The correct fix is always to get window geometry in Expose handler, but that has a two-way traffic overhead */ ignored_fake_configure = st_xev.xconfigure.send_event && ( st_xev.xconfigure.width != evform->w || st_xev.xconfigure.height != evform->h ); /* Dragging a form across the screen changes its absolute x, y coords. Objects that themselves contain forms should ensure that they are up to date. */ fli_handle_form( evform, FL_MOVEORIGIN, 0, &st_xev ); if ( st_xev.xconfigure.send_event ) return; /* Can't just set form->{w,h}. Need to take care of obj gravity */ fli_scale_form( evform, ( double ) st_xev.xconfigure.width / evform->w, ( double ) st_xev.xconfigure.height / evform->h ); /* If both the width and the height got smaller (or one got smaller and the other one remained unchanged) we're not going to get an Expose event, so we need to redraw the form. If only one of the lengths got smaller or remained unchanged while the other got larger the next (compressed) Expose event will only cover the added part. In this case store the forms address so on the next Expose event we receive for it its full area will be redrawn. */ if ( evform->w <= old_w && evform->h <= old_h ) fl_redraw_form( evform ); else if ( ! ( evform->w > old_w && evform->h > old_h ) ) *redraw_form = evform; } /*************************************** * Handling of ClientMessage events, intercepts WM_DELETE_WINDOW messages ***************************************/ static void handle_ClientMessage_event( FL_FORM * form, void * xev ) { XClientMessageEvent *xcm = xev; static Atom atom_protocol; static Atom atom_del_win = None; if ( ! atom_del_win ) { atom_protocol = XInternAtom( xcm->display, "WM_PROTOCOLS", 0 ); atom_del_win = XInternAtom( xcm->display, "WM_DELETE_WINDOW", 0 ); } /* On message for deletion of top-level window quit unless handlers are installed */ if ( xcm->message_type == atom_protocol && ( Atom ) xcm->data.l[ 0 ] == atom_del_win ) { if ( form->close_callback ) { if ( form->close_callback( form, form->close_data ) != FL_IGNORE && form->visible == FL_VISIBLE ) fl_hide_form( form ); if ( form->sort_of_modal ) fl_activate_all_forms( ); } else if ( fli_context->atclose ) { if ( fli_context->atclose( form, fli_context->close_data ) != FL_IGNORE ) exit( 1 ); } else exit( 1 ); } else /* pump it through current form */ fli_handle_form( form, FL_OTHER, 0, xev ); } /*************************************** * Checks all forms. Does not wait. ***************************************/ FL_OBJECT * fl_check_forms( void ) { FL_OBJECT *obj; if ( ! ( obj = fli_object_qread( ) ) ) { fli_treat_interaction_events( 0 ); fli_treat_user_events( ); obj = fli_object_qread( ); if ( fl_display == None ) return NULL; } return obj; } /*************************************** * Same as fl_check_forms() but never returns FL_EVENT. ***************************************/ FL_OBJECT * fl_check_only_forms( void ) { FL_OBJECT *obj; if ( ! ( obj = fli_object_qread( ) ) ) { fli_treat_interaction_events( 0 ); obj = fli_object_qread( ); if ( fl_display == None ) return NULL; } return obj; } /*************************************** * Checks all forms and keeps checking as long as nothing happens. ***************************************/ FL_OBJECT * fl_do_forms( void ) { FL_OBJECT *obj; while ( ! ( obj = fli_object_qread( ) ) ) { fli_treat_interaction_events( 1 ); fli_treat_user_events( ); if ( fl_display == None ) return NULL; } return obj; } /*************************************** * Same as fl_do_forms() but never returns FL_EVENT. ***************************************/ FL_OBJECT * fl_do_only_forms( void ) { FL_OBJECT *obj; while ( ! ( obj = fli_object_qread( ) ) ) { fli_treat_interaction_events( 1 ); if ( fl_display == None ) return NULL; } if ( obj == FL_EVENT ) M_warn( "fl_do_only_forms", "Shouldn't happen" ); return obj; } /*************************************** ***************************************/ static int form_event_queued( XEvent * xev, int mode ) { if ( fl_display == None ) return 0; if ( XEventsQueued( flx->display, mode ) ) { XPeekEvent( flx->display, xev ); return fli_find_event_form( xev ) != NULL; } return 0; } /*************************************** ***************************************/ static int preemptive_consumed( FL_FORM * form, int type, XEvent * xev ) { if ( ! form || ! form->evmask || form->deactivated ) return 0; if ( ( form->evmask & FL_ALL_EVENT ) == FL_ALL_EVENT && form->all_callback ) return form->all_callback( form, xev ); switch ( type ) { case ButtonPress: if ( form->evmask & ButtonPressMask && form->push_callback ) return form->push_callback( form, xev ); break; case ButtonRelease: if ( form->evmask & ButtonReleaseMask && form->push_callback ) return form->push_callback( form, xev ); break; case KeyPress: if ( form->evmask & KeyPressMask && form->key_callback ) return form->key_callback( form, xev ); break; case KeyRelease: if ( form->evmask & KeyRelease && form->key_callback ) return form->key_callback( form, xev ); break; case EnterNotify: if ( form->evmask & EnterWindowMask && form->crossing_callback ) return form->crossing_callback( form, xev ); break; case LeaveNotify: if ( form->evmask & LeaveWindowMask && form->crossing_callback ) return form->crossing_callback( form, xev ); break; case MotionNotify: if ( form->evmask & ( ButtonMotionMask | PointerMotionMask ) && form->motion_callback ) return form->motion_callback( form, xev ); } return 0; } /*************************************** * Returns the current state of the mouse buttons ***************************************/ long fl_mouse_button( void ) { return fli_context->mouse_button; } /*************************************** * Returns the event currently being handled - only makes sense to * call this from within an object or form callback. ***************************************/ int fl_current_event( void ) { return fli_context->last_event; } /*************************************** ***************************************/ FLI_TARGET * fli_internal_init( void ) { static FLI_TARGET *default_flx; if ( ! default_flx ) default_flx = fl_calloc( 1, sizeof *default_flx ); return flx = default_flx; } /*************************************** * fl_display is exposed to the outside world. Bad ***************************************/ void fli_switch_target( FLI_TARGET * newtarget ) { flx = newtarget; fl_display = flx->display; } /*************************************** ***************************************/ void fli_restore_target( void ) { fli_internal_init( ); fl_display = flx->display; } /*************************************** * Currently only a single idle callback is support ***************************************/ static void add_idle_callback( FL_APPEVENT_CB cb, void * data ) { if ( ! cb ) { fli_safe_free( fli_context->idle_rec ); return; } if ( ! fli_context->idle_rec ) fli_context->idle_rec = fl_malloc( sizeof *fli_context->idle_rec ); fli_context->idle_rec->callback = cb; fli_context->idle_rec->data = data; } /*************************************** * Sets an idle callback ***************************************/ FL_APPEVENT_CB fl_set_idle_callback( FL_APPEVENT_CB callback, void * user_data ) { FL_APPEVENT_CB old = fli_context->idle_rec ? fli_context->idle_rec->callback : NULL; add_idle_callback( callback, user_data ); /* If we have idle callbacks, decrease the wait time */ delta_msec = FLI_TIMER_RES * ( callback ? 0.8 : 1.0 ); fli_context->idle_delta = delta_msec; return old; } /*************************************** ***************************************/ void fl_set_idle_delta( long delta ) { if ( delta < 0 ) delta = FLI_TIMER_RES; else if ( delta == 0 ) delta = FLI_TIMER_RES / 10; delta_msec = delta; fli_context->idle_delta = delta; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/fselect.c0000644000175000017500000010506712254030432012320 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fselect.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Comprehensive interactive file selector. The actual directory reading * code is isolated in listdir.c */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/flsnprintf.h" #include /******************** Limits ***************************/ #define FL_FLEN 256 #define MAXFL ( FL_PATH_MAX + FL_FLEN ) static int dirmarker = 'D'; /* directory marker */ static int bdevmarker = 'b'; /* special file marker */ static int cdevmarker = 'c'; /* special file marker */ static int fifomarker = 'p'; /* pipe marker */ static int sockmarker = 's'; /* socket marker */ static int filemarker = ' '; /* normal file marker */ static int listdirfirst = 1; /* list directory first */ extern int fli_sort_method; /* form listdir.c */ /******* GUI parameters ********/ /* Misc. buttons configurable from application program */ #define MAX_APPBUTT 3 typedef struct { /* Due to FD_FSELECTOR, the order of these objects are important. maybe put them in a union ? */ FL_FORM * fselect; void * vdata; char * cdata; long ldata; FL_OBJECT * browser, * input, * prompt, * resbutt; FL_OBJECT * patbutt, * dirbutt, * cancel, * ready; FL_OBJECT * dirlabel, * patlabel; FL_OBJECT * appbutt[ MAX_APPBUTT ]; FL_OBJECT * appbuttgrp; FL_FSCB fselect_cb; void * callback_data; char applabel[ MAX_APPBUTT ][ 32 ]; void ( * appcb[ MAX_APPBUTT ] )( void * ); void * appdata[ MAX_APPBUTT ]; FL_COLOR fg; FL_COLOR brcol; FL_COLOR brselcol; int rescan; /* if update dir cache */ int disabled_cache; int border, place; char retname[ MAXFL ]; /* complete filename */ char dname[ MAXFL ]; /* current path */ char filename[ FL_FLEN ]; /* bare filename */ char pattern[ FL_FLEN ]; /* patterns */ int last_len; int last_line; } FD_fselect; static FD_fselect * create_form_fselect( void ); static FD_fselect *fd_fselector[ FL_MAX_FSELECTOR ] = { 0 }, *fs; /*************************************** ***************************************/ static void allocate_fselector( int a ) { if ( ! fd_fselector[ a ] ) { fs = fd_fselector[ a ] = fl_calloc( 1, sizeof *fs ); fs->fg = FL_COL1; fs->brcol = FL_COL1; fs->brselcol = FL_TOP_BCOL; fs->border = FL_TRANSIENT; fs->place = FL_PLACE_FREE_CENTER; strcpy( fs->dname, "." ); strcpy( fs->pattern, "*" ); create_form_fselect( ); fl_set_form_title( fs->fselect, "FileSelector" ); fl_set_object_resize( fs->appbuttgrp, FL_RESIZE_NONE ); fl_set_object_gravity( fs->appbuttgrp, EastGravity, EastGravity ); } fs = fd_fselector[ a ]; } /*************************************** ***************************************/ void fli_free_fselectors( void ) { int i; for ( i = 0; i < FL_MAX_FSELECTOR; i++ ) fli_safe_free( fd_fselector[ i ] ); } /*************************************** ***************************************/ int fl_use_fselector( int n ) { if ( n < 0 || n >= FL_MAX_FSELECTOR ) return -1; allocate_fselector( n ); return n; } /*************************************** ***************************************/ void fl_add_fselector_appbutton( const char * label, void ( * cb )( void * ), void * data ) { int ok, i; if ( ! label || ! *label || ! cb ) return; if ( ! fs ) allocate_fselector( 0 ); for ( ok = i = 0; ! ok && i < MAX_APPBUTT; i++ ) if ( ! fs->appcb[ i ] || ! fs->applabel[ i ][ 0 ] ) { ok = i + 1; fs->appcb[ i ] = cb; fs->appdata[ i ] = data; fli_sstrcpy( fs->applabel[ i ], label, 32 ); } if ( ! ok ) M_err( "fl_add_fselector_appbutton", "Only %d allowd. %s ignored", MAX_APPBUTT, label ); } /*************************************** ***************************************/ void fl_remove_fselector_appbutton( const char * label ) { int i; if ( ! label || ! *label ) return; for ( i = 0; i < MAX_APPBUTT; i++ ) if ( strcmp( label, fs->applabel[ i ] ) == 0 ) { fs->appcb[ i ] = NULL; *fs->applabel[ i ] = '\0'; fl_hide_object( fs->appbutt[ i ] ); } } /*************************************** * Just a fake to get the prototypes right ***************************************/ static void appbutton_cb( FL_OBJECT * ob FL_UNUSED_ARG, long arg ) { if ( fs->appcb[ arg ] ) ( fs->appcb[ arg ] )( fs->appdata[ arg ] ); } /*************************************** ***************************************/ void fl_disable_fselector_cache( int yes ) { if ( ! fs ) allocate_fselector( 0 ); fs->disabled_cache = yes; } static int fill_entries( FL_OBJECT *, const char *, int ); static const char * contract_dirname( const char *, int ); /*************************************** ***************************************/ static char * append_slash( char * d ) { int n = strlen( d ); if ( d[ n - 1 ] != '/' ) { d[ n++ ] = '/'; d[ n ] = '\0'; } return d; } /*************************************** * Combine directory and file name to form a complete name ***************************************/ static char * cmplt_name( void ) { const char *f = fl_get_input( fs->input ); if ( f && *f ) { fli_sstrcpy( fs->filename, f, FL_FLEN ); if ( *f != '/' ) append_slash( strcpy( fs->retname, fs->dname ) ); else *fs->retname = '\0'; return strcat( fs->retname, f ); } else { *fs->filename = '\0'; return fs->filename; } } /*************************************** ***************************************/ static char * fli_del_tail_slash( char * d ) { int i = strlen( d ) - 1; if ( d[ i ] == '/' ) d[ i ] = '\0'; return d; } /*************************************** * Callback for selection of a file name. On double click on a directory * we change to that directory while for a double click on a normal file * the return button gets triggered ***************************************/ static void select_cb( FL_OBJECT * obj, long isdblclick ) { char seltext[ FL_PATH_MAX ]; int thisline; FD_fselect *lfs = obj->form->fdui; if ( ( thisline = fl_get_browser( obj ) ) <= 0 ) return; fli_sstrcpy( seltext, fl_get_browser_line( obj, thisline ), sizeof seltext ); lfs->last_len = strlen( seltext + 2 ); lfs->last_line = thisline; memmove( seltext, seltext + 2, lfs->last_len + 1 ); if ( seltext[ 0 ] == dirmarker && seltext[ 1 ] == ' ' ) /* directory */ { if ( isdblclick ) { strcat( append_slash( lfs->dname ), seltext ); fli_fix_dirname( lfs->dname ); if ( fill_entries( lfs->browser, NULL, 0 ) < 0 ) fli_del_tail_slash( lfs->dname ); *seltext = '\0'; } fl_set_input( lfs->input, seltext ); } else /* normal file */ { fl_set_input( lfs->input, seltext ); strcpy( lfs->filename, seltext ); if ( isdblclick ) { if ( lfs->fselect_cb || lfs->fselect->attached ) { const char *fn = cmplt_name( ); if ( lfs->fselect_cb ) lfs->fselect_cb( fn, lfs->callback_data ); if ( fli_is_valid_dir( fn ) ) fl_set_directory( fn ); } else fl_trigger_object( lfs->ready ); } } } /*************************************** ***************************************/ int fl_set_directory( const char * p ) { char tmpdir[ FL_PATH_MAX + 2 ]; if ( ! fs ) allocate_fselector( 0 ); if ( p == NULL ) { M_err( "fl_set_directory", "invalid NULL argument" ); return 1; } fli_sstrcpy( tmpdir, p, sizeof tmpdir ); fli_de_space_de( tmpdir ); if ( strcmp( tmpdir, fs->dname ) == 0 ) return 0; fli_fix_dirname( tmpdir ); if ( ! fli_is_valid_dir( tmpdir ) ) { M_err( "fl_set_directory", "invalid directory: %s", tmpdir ); return 1; } strcpy( fs->dname, tmpdir ); if ( fill_entries( fs->browser, NULL, 1 ) < 0 ) fli_del_tail_slash( fs->dname ); else fl_set_object_label( fs->dirbutt, contract_dirname( fs->dname, 38 ) ); return 0; } /*************************************** ***************************************/ static void directory_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { const char *p; FD_fselect *savefs = fs; fs = ob->form->fdui; if ( ! ( p = fl_show_input( "Enter New Directory:", fs->dname ) ) ) return; fl_set_directory( p ); fs = savefs; } /*************************************** ***************************************/ void fl_set_pattern( const char * s ) { if ( ! fs ) allocate_fselector( 0 ); if ( s && strcmp( fs->pattern, s ) ) { fli_sstrcpy( fs->pattern, s, sizeof fs->pattern ); fl_set_object_label( fs->patbutt, fs->pattern ); fill_entries( fs->browser, fs->filename, 1 ); } } /*************************************** ***************************************/ static void pattern_cb( FL_OBJECT * ob, long q FL_UNUSED_ARG ) { const char *s = fl_show_input( "New Pattern", fs->pattern ); FD_fselect *savefs = fs; fs = ob->form->fdui; if ( s ) fl_set_pattern( s ); fs = savefs; } /*************************************** * Show all files in directory dname that match selection pattern. * Note: fn indicates if we should highlight the current selection. ***************************************/ static int fill_entries( FL_OBJECT * br, const char * fn, int show ) { const FL_Dirlist *dirlist, *dl; char tt[ FL_FLEN ]; int n, i; FD_fselect *lfs = br->form->fdui; int dcount = 1; int lcount = 1; int sel_line = 0; if ( br->form->visible ) { fl_set_cursor( br->form->window, XC_watch ); fl_update_display( 0 ); } if ( ! ( dirlist = fl_get_dirlist( lfs->dname, lfs->pattern, &n, lfs->rescan || lfs->disabled_cache ) ) ) { char tmpbuf[ 256 ], *p; fli_snprintf( tmpbuf, sizeof tmpbuf, "Can't read %s", lfs->dname ); tmpbuf[ sizeof tmpbuf - 1 ] = '\0'; fl_show_alert( "ReadDir", tmpbuf, fli_get_syserror_msg( ), 0 ); M_err( "fill_entries", "Can't read %s", lfs->dname ); /* Backup */ if ( ( p = strrchr( lfs->dname, '/' ) ) ) *p = '\0'; if ( br->form->window ) fl_reset_cursor( br->form->window ); return -1; } fl_freeze_form( lfs->fselect ); fl_set_object_label( lfs->dirbutt, contract_dirname( lfs->dname, 38 ) ); fl_clear_browser( br ); for ( i = 0, dl = dirlist; dl->name; i++, dl++ ) { int cur_line; char marker; char *p; switch ( dl->type ) { case FT_DIR : marker = dirmarker; break; case FT_FIFO : marker = fifomarker; break; case FT_SOCK : marker = sockmarker; break; case FT_BLK : marker = bdevmarker; break; default : marker = filemarker; } fli_snprintf( tt, sizeof tt, "%c %s", marker, dl->name ); if ( dl->type == FT_DIR && listdirfirst ) { cur_line = dcount; if ( sel_line > 0 && sel_line >= dcount ) sel_line++; fl_insert_browser_line( br, dcount++, tt ); } else { cur_line = lcount; fl_add_browser_line( br, tt ); } lcount++; if ( sel_line <= 0 && fn && ( ! strcmp( dl->name, fn ) || ( ( p = strrchr( fn, '/' ) ) && ! strcmp( dl->name, p + 1 ) ) ) ) { sel_line = cur_line; fl_select_browser_line( br, cur_line ); } } if ( show && sel_line > 0 ) { int total = fl_get_browser_screenlines( br ); if ( sel_line <= total / 2 ) fl_set_browser_topline( br, 1 ); else if ( sel_line > lcount - total - 1 ) fl_set_browser_topline( br, lcount - total - 1 ); else fl_set_browser_topline( br, sel_line - total / 2 ); } fl_unfreeze_form( lfs->fselect ); if ( br->form->window ) fl_reset_cursor( br->form->window ); lfs->last_line = 0; lfs->last_len = 0; return 0; } /*************************************** * Handles changes of the input object the user can enter a file name * in. Tries to find a name in the browser that matches the input and * select it if it exists. ***************************************/ static void input_cb( FL_OBJECT * obj, long arg FL_UNUSED_ARG ) { FD_fselect *lfs = obj->form->fdui; const char *ip = fl_get_input( obj ); int len; int num_lines; int i; int dir; /* 1: forward, 0: backward */ if ( ! *ip ) { lfs->last_line = 0; lfs->last_len = 0; return; } len = strlen( ip ); num_lines = fl_get_browser_maxline( lfs->browser ); /* If the entries aren't sorted in alphabetical order we can't use any tricks to shorten the search, we have to run over all entries and pick the first one that matches */ if ( fli_sort_method != FL_ALPHASORT && fli_sort_method != FL_RALPHASORT ) { lfs->last_line = 0; for ( i = 1; i <= num_lines; i++ ) { const char *line = fl_get_browser_line( lfs->browser, i ); if ( line[ 1 ] == '\0' ) continue; if ( ! strncmp( line + 2, ip, len ) ) { fl_select_browser_line( lfs->browser, i ); fl_show_browser_line( lfs->browser, i ); return; } } return; } /* Otherwise we start at the entry found last time and search forward from there if the string in the input field got longer (or we haven't a stored match) and search backwards if it got shorter */ dir = len > lfs->last_len || lfs->last_line == 0; lfs->last_len = len; /* First check if the last matched entry still matches */ if ( lfs->last_line > 0 && dir && ! strncmp( fl_get_browser_line( lfs->browser, lfs->last_line ) + 2, ip, len ) ) return; if ( dir ) for ( i = lfs->last_line + 1; i <= num_lines; i++ ) { const char *line = fl_get_browser_line( lfs->browser, i ); int cmp; if ( line[ 1 ] == '\0' ) continue; if ( ! ( cmp = strncmp( line + 2, ip, len ) ) ) { fl_select_browser_line( lfs->browser, i ); fl_show_browser_line( lfs->browser, i ); lfs->last_line = i; return; } if ( ( ( fli_sort_method == FL_ALPHASORT && cmp > 0 ) || ( fli_sort_method == FL_RALPHASORT && cmp < 0 ) ) && ( ( listdirfirst && *line != dirmarker ) || ! listdirfirst ) ) return; } else { int found = 0; for ( i = lfs->last_line - 1; i > 0; i-- ) { const char *line = fl_get_browser_line( lfs->browser, i ); int cmp; if ( line[ 1 ] == '\0' ) continue; if ( ! ( cmp = strncmp( line + 2, ip, len ) ) ) found = i; if ( ( ( fli_sort_method == FL_ALPHASORT && cmp < 0 ) || ( fli_sort_method == FL_RALPHASORT && cmp > 0 ) ) && ( ( listdirfirst && *line == dirmarker ) || ! listdirfirst ) ) break; } if ( found ) { fl_select_browser_line( lfs->browser, found ); fl_show_browser_line( lfs->browser, found ); lfs->last_line = found; } } } /*************************************** ***************************************/ void fl_set_fselector_callback( FL_FSCB fscb, void * data ) { if ( ! fs ) allocate_fselector( 0 ); fs->fselect_cb = fscb; fs->callback_data = data; /* Force creation if it does not already exists */ fl_get_fselector_form( ); if ( fscb ) { fl_set_object_label( fs->cancel, "Close" ); fl_set_button_shortcut( fs->cancel, "#C#c^[", 1 ); fl_set_object_label( fs->ready, "Select" ); } else { fl_set_object_label( fs->cancel, "Cancel" ); fl_set_button_shortcut( fs->cancel, "#C#c^[", 1 ); fl_set_object_label( fs->ready, "Ready" ); } } /*************************************** ***************************************/ void fl_set_fselector_placement( int place ) { if ( ! fs ) allocate_fselector( 0 ); fs->place = place; } /*************************************** ***************************************/ void fl_set_fselector_border( int b ) { if ( ! fs ) allocate_fselector( 0 ); fs->border = b; } /*************************************** ***************************************/ void fl_invalidate_fselector_cache( void ) { if ( ! fs ) allocate_fselector( 0 ); fs->rescan = 1; } /*************************************** ***************************************/ FL_FORM * fl_get_fselector_form( void ) { if ( ! fs ) allocate_fselector( 0 ); return fs->fselect; } /*************************************** ***************************************/ FD_FSELECTOR * fl_get_fselector_fdstruct( void ) { if ( ! fs ) allocate_fselector( 0 ); return ( FD_FSELECTOR * ) fs; } /*************************************** ***************************************/ void fl_hide_fselector( void ) { FD_FSELECTOR *fd = fl_get_fselector_fdstruct( ); if ( fd->fselect && fd->fselect->visible ) fl_trigger_object( fd->cancel ); } /*************************************** ***************************************/ static void pre_attach( FL_FORM * form ) { FD_fselect *savefs = fs; fs = form->fdui; if ( ! form->attach_data ) form->attach_data = "FileName"; fl_show_fselector( form->attach_data, 0, 0, 0 ); fs = savefs; } /*************************************** ***************************************/ const char * fl_show_fselector( const char * message, const char * dir, const char * pat, const char * fname ) { FL_OBJECT *obj; int i; fl_get_fselector_form( ); /* Update directory only if requested dir is valid. This way, passing NULL for dir has the effect of keeping us where we were the last time */ if ( fli_is_valid_dir( dir ) ) strcpy( fs->dname, dir ); fli_fix_dirname( fs->dname ); *fs->filename = '\0'; if ( pat && *pat ) fli_sstrcpy( fs->pattern, pat, sizeof fs->pattern ); if ( fname && *fname ) { if ( strchr( fname, '/' ) ) fli_sstrcpy( fs->filename, strrchr( fname, '/' ) + 1, sizeof fs->filename ); else fli_sstrcpy( fs->filename, fname, sizeof fs->filename ); } for ( i = 0; i < MAX_APPBUTT; i++ ) { if ( fs->appcb[ i ] && fs->applabel[ i ][ 0 ] ) { fl_set_object_label( fs->appbutt[ i ], fs->applabel[ i ] ); fl_set_object_callback( fs->appbutt[ i ], appbutton_cb, i ); fl_show_object( fs->appbutt[ i ] ); } else fl_hide_object( fs->appbutt[ i ] ); } /* Check cache settings */ fl_fit_object_label( fs->resbutt, 1, 1 ); /* If selection call back exists, cancel has no meaning as whenever a file is selected a callback is executed and there is no backing out */ if ( ! ( fs->fselect_cb || fs->fselect->attached ) ) { fl_deactivate_all_forms( ); fs->fselect->sort_of_modal = 1; } fl_set_object_label( fs->prompt, message ); fl_set_input( fs->input, fs->filename ); fl_set_object_label( fs->patbutt, fs->pattern ); fl_set_object_label( fs->dirbutt, contract_dirname( fs->dname, 38 ) ); /* Fill the browser */ fill_entries( fs->browser, fs->filename, 1 ); if ( fs->cancel->lsize != FL_DEFAULT_SIZE ) fl_fit_object_label( fs->cancel, 16, 1 ); /* If attached to another form, don't show the form. The parent will handle it */ if ( fs->fselect->attached ) return ""; if ( ! fs->fselect->visible ) { fl_set_form_minsize( fs->fselect, fs->fselect->w, fs->fselect->w ); fl_show_form( fs->fselect, fs->place, fs->border, fs->fselect->label ); } else fl_redraw_form( fs->fselect ); do { const char *tmp = NULL; obj = fl_do_only_forms( ); if ( obj == fs->ready && ( tmp = fl_get_input( fs->input ) ) && *tmp ) { if ( *tmp != '/' && *tmp != '~' ) { strncat( append_slash( fs->dname ), tmp, sizeof fs->dname ); fs->dname[ sizeof fs->dname - 1 ] = '\0'; } else fli_sstrcpy( fs->dname, tmp, sizeof fs->dname ); fli_fix_dirname( fs->dname ); if ( fs->fselect_cb ) fs->fselect_cb( fs->dname, fs->callback_data ); if ( fli_is_valid_dir( fs->dname ) ) { fill_entries( fs->browser, 0, 1 ); fl_set_input( fs->input, "" ); fl_set_focus_object( fs->input->form, fs->input ); obj = NULL; } else { char *p; while ( ( p = strrchr( fs->dname, '/' ) ) ) { *p = '\0'; if ( fli_is_valid_dir( fs->dname ) ) break; } } } } while ( obj != fs->cancel && ( obj != fs->ready || fs->fselect_cb || fs->fselect->attached ) ); fl_hide_form( fs->fselect ); if ( ! ( fs->fselect_cb || fs->fselect->attached ) ) { fl_activate_all_forms( ); fs->fselect->sort_of_modal = 0; } /* Do we really want to remove the fselect_cb ? Previous version did, so keep the way it was */ fl_set_fselector_callback( NULL, NULL ); fs->place = FL_PLACE_FREE_CENTER; return ( obj == fs->cancel || fs->fselect_cb ) ? NULL : cmplt_name( ); } /*************************************** ***************************************/ const char * fl_get_directory( void ) { if ( ! fs ) allocate_fselector( 0 ); return fs->dname; } /*************************************** ***************************************/ const char * fl_get_pattern( void ) { if ( ! fs ) allocate_fselector( 0 ); return fs->pattern; } /*************************************** ***************************************/ const char * fl_get_filename( void ) { if ( ! fs ) allocate_fselector( 0 ); return fs->filename; } /*************************************** ***************************************/ static void rescan_cb( FL_OBJECT * ob, long arg FL_UNUSED_ARG ) { FD_fselect *lfs = ob->form->fdui; lfs->rescan = 1; fill_entries( lfs->browser, lfs->filename, 1 ); lfs->rescan = 0; } /*************************************** ***************************************/ void fl_refresh_fselector( void ) { rescan_cb( fs->resbutt, 0 ); } /****************************************************************** * Contract dirname from /usr/people/xxx to ~/ to save some length. * Also replace the middle part of a path with X if the path is longer * than limit. Useful when indicator is of limited length ******************************************************************/ static void pat_replace( char str[ ], const char * pat, const char * rep ) { char *t, *d; if ( ! ( t = strstr( str, pat ) ) ) return; d = fl_strdup( t + strlen( pat ) ); *t = '\0'; strcat( str, rep ); strcat( str, d ); fl_free( d ); } /*************************************** ***************************************/ static const char * contract_dirname( const char * dir, int limit ) { static char buf[ FL_PATH_MAX ]; const char *home = getenv( "HOME" ); char *p, *q; FL_OBJECT *ob = fs->dirbutt; int l, len; if ( fl_get_string_width( ob->lstyle, ob->lsize, dir, strlen( dir ) ) < ob->w - 4 ) return dir; strcpy( buf, dir ); if ( home ) pat_replace( buf, home, "~" ); if ( fl_get_string_width( ob->lstyle, ob->lsize, buf, strlen( buf ) ) < ob->w - 4 ) return buf; /* Try to replace middle components with ... */ if ( ( l = strlen( buf ) ) > limit ) { int k = limit / 3 - 3; if ( ( p = strchr( buf + k, '/' ) ) ) { q = buf + l - k; while ( *q != '/' && q > buf ) q--; if ( q > p + 3 ) { *++p = '.'; *++p = '.'; *++p = '.'; *++p = '\0'; memmove( p, q, strlen( q ) + 1 ); } } } /* Reolacement may have been impossible or the string may still be too long, in this case truncate and put three dots at the end and */ if ( strlen( buf ) > ( size_t ) limit ) { p = buf + limit - 3; *p++ = '.'; *p++ = '.'; *p++ = '.'; *p = '\0'; } len = strlen( buf ); while ( len > 3 && fl_get_string_width( ob->lstyle, ob->lsize, buf, len ) > ob->w - 4 ) { buf[ len - 4 ] = '.'; buf[ len - 3 ] = '.'; buf[ len - 2 ] = '.'; buf[ len - 1 ] = '\0'; len--; } return buf; } /*************************************** ***************************************/ static FD_fselect * create_form_fselect( void ) { FL_OBJECT *obj; int oldy = fli_inverted_y; int oldunit = fl_get_coordunit( ); fli_inverted_y = 0; fl_set_coordunit( FL_COORD_PIXEL ); fs->fselect = fl_bgn_form( FL_FLAT_BOX, 305, 330 ); fs->dirlabel = obj = fl_add_text( FL_NORMAL_TEXT, 12, 15, 64, 24, "D\010irectory" ); fl_set_object_boxtype( obj, FL_FRAME_BOX ); fl_set_object_lalign( obj, FL_ALIGN_CENTER ); fl_set_object_resize( obj, FL_RESIZE_NONE ); fl_set_object_gravity( obj, FL_NorthWest, FL_NorthWest ); fs->dirbutt = obj = fl_add_button( FL_NORMAL_BUTTON, 76, 15, 217, 24, "" ); fl_set_button_shortcut( obj, "#D#d", 1 ); fl_set_object_boxtype( obj, FL_FRAME_BOX ); fl_set_object_lalign( obj, fl_to_inside_lalign( FL_ALIGN_LEFT ) ); fl_set_object_resize( obj, FL_RESIZE_X ); fl_set_object_gravity( obj, FL_NorthWest, FL_NorthEast ); fl_set_object_callback( obj, directory_cb, 0 ); fs->patlabel = obj = fl_add_text( FL_NORMAL_TEXT, 12, 41, 64, 24, "P\010attern" ); fl_set_object_boxtype( obj, FL_FRAME_BOX ); fl_set_object_lalign( obj, FL_ALIGN_CENTER ); fl_set_object_resize( obj, FL_RESIZE_NONE ); fl_set_object_gravity( obj, FL_NorthWest, FL_NorthWest ); fs->patbutt = obj = fl_add_button( FL_NORMAL_BUTTON, 76, 41, 217, 24, "" ); fl_set_button_shortcut( obj, "#P#p", 1 ); fl_set_object_boxtype( obj, FL_FRAME_BOX ); fl_set_object_resize( obj, FL_RESIZE_X ); fl_set_object_gravity( obj, FL_NorthWest, FL_NorthEast ); fl_set_object_callback( obj, pattern_cb, 0 ); fs->resbutt = obj = fl_add_button( FL_NORMAL_BUTTON, 210, 80, 83, 28, "Rescan" ); fl_set_button_shortcut( obj, "#R#r", 1 ); fl_set_object_resize( obj, FL_RESIZE_NONE ); fl_set_object_gravity( obj, FL_NorthEast, FL_NorthEast ); fl_set_object_callback( obj, rescan_cb, 0 ); fs->cancel = obj = fl_add_button( FL_NORMAL_BUTTON, 210, 203, 83, 28, "Cancel" ); fl_set_button_shortcut( obj, "#C#c^[", 1 ); fl_set_object_color( obj, FL_COL1, FL_GREEN ); fl_set_object_resize( obj, FL_RESIZE_NONE ); fl_set_object_gravity( obj, FL_SouthEast, FL_SouthEast ); fs->ready = obj = fl_add_button( FL_RETURN_BUTTON, 210, 233, 83, 28, "Ready" ); fl_set_object_color( obj, FL_COL1, FL_GREEN ); fl_set_object_resize( obj, FL_RESIZE_NONE ); fl_set_object_gravity( obj, FL_SouthEast, FL_SouthEast ); fs->prompt = obj = fl_add_text( FL_NORMAL_TEXT, 20, 270, 264, 18, "File name:" ); fl_set_object_lalign( obj, fl_to_inside_lalign( FL_ALIGN_LEFT ) ); fl_set_object_resize( obj, FL_RESIZE_NONE ); fl_set_object_gravity( obj, FL_SouthWest, FL_SouthWest ); fs->input = obj = fl_add_input( FL_NORMAL_INPUT, 30, 290, 235, 27, "" ); fl_set_object_boxtype( obj, FL_SHADOW_BOX ); fl_set_object_color( obj, FL_WHITE, FL_WHITE ); fl_set_object_resize( obj, FL_RESIZE_X ); fl_set_object_gravity( obj, FL_SouthWest, FL_SouthEast ); fl_set_object_callback( obj, input_cb, 0 ); fl_set_object_return( obj, FL_RETURN_CHANGED ); fs->browser = obj = fl_add_browser( FL_HOLD_BROWSER, 15, 80, 185, 180, "" ); fl_set_object_callback( obj, select_cb, 0 ); fl_set_browser_dblclick_callback( obj, select_cb, 1 ); fl_set_object_resize( obj, FL_RESIZE_ALL ); fl_set_object_gravity( obj, FL_NorthWest, FL_SouthEast ); obj->click_timeout = FL_CLICK_TIMEOUT; fs->appbuttgrp = fl_bgn_group( ); fs->appbutt[ 0 ] = fl_add_button( FL_NORMAL_BUTTON, 210, 114, 83, 28, "" ); fs->appbutt[ 1 ] = fl_add_button( FL_NORMAL_BUTTON, 210, 142, 83, 28, "" ); fs->appbutt[ 2 ] = fl_add_button( FL_NORMAL_BUTTON, 210, 170, 83, 28, "" ); fl_end_group( ); fl_end_form( ); fs->fselect->fdui = fs; fs->fselect->pre_attach = pre_attach; fl_set_form_atclose( fs->fselect, fl_goodies_atclose, fs->cancel ); fli_inverted_y = oldy; fl_set_coordunit( oldunit ); /* These labels sometimes don't fit the above set sizes, so we resize the whole file selector box to make them fit */ fl_fit_object_label( fs->dirlabel, 0, 0 ); fl_fit_object_label( fs->resbutt, 0, 0 ); return fs; } /*************************************** ***************************************/ void fl_set_fselector_filetype_marker( int dir, int fifo, int sock, int cdev, int bdev ) { dirmarker = dir; fifomarker = fifo; cdevmarker = cdev; bdevmarker = bdev; sockmarker = sock; } /*************************************** ***************************************/ void fl_set_fselector_fontsize( int fsize ) { int i; if ( ! fs ) allocate_fselector( 0 ); fl_freeze_form( fs->fselect ); fl_set_object_lsize( fs->input, fsize ); fl_set_object_lsize( fs->prompt, fsize ); fl_set_object_lsize( fs->patbutt, fsize ); fl_set_object_lsize( fs->dirbutt, fsize ); fl_set_object_lsize( fs->resbutt, fsize ); fl_set_object_lsize( fs->cancel, fsize ); fl_set_object_lsize( fs->dirlabel, fsize ); fl_set_object_lsize( fs->patlabel, fsize ); fl_set_object_lsize( fs->ready, fsize ); fl_set_browser_fontsize( fs->browser, fsize ); for ( i = 0; i < MAX_APPBUTT; i++ ) fl_set_object_lsize( fs->appbutt[ i ], fsize ); fl_fit_object_label( fs->dirlabel, 0, 0 ); fl_fit_object_label( fs->resbutt, 0, 0 ); fl_unfreeze_form( fs->fselect ); } /*************************************** ***************************************/ void fl_set_fselector_fontstyle( int fstyle ) { int i; if ( ! fs ) allocate_fselector( 0 ); fl_freeze_form( fs->fselect ); fl_set_object_lstyle( fs->input, fstyle ); fl_set_object_lstyle( fs->prompt, fstyle ); fl_set_object_lstyle( fs->patbutt, fstyle ); fl_set_object_lstyle( fs->dirbutt, fstyle ); fl_set_object_lstyle( fs->resbutt, fstyle ); fl_set_object_lstyle( fs->cancel, fstyle ); fl_set_object_lstyle( fs->dirlabel, fstyle ); fl_set_object_lstyle( fs->patlabel, fstyle ); fl_set_object_lstyle( fs->ready, fstyle ); fl_set_browser_fontstyle( fs->browser, fstyle ); for ( i = 0; i < MAX_APPBUTT; i++ ) fl_set_object_lstyle( fs->appbutt[ i ], fstyle ); fl_fit_object_label( fs->dirlabel, 0, 0 ); fl_fit_object_label( fs->resbutt, 0, 0 ); fl_unfreeze_form( fs->fselect ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/events.c0000664000175000017500000010142312346414737012211 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file events.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Events handlers for the application window */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/flsnprintf.h" static void handle_input_object( FL_OBJECT * obj, int event ); /*** Global event handlers for all windows ******/ static FL_APPEVENT_CB fli_event_callback; static void *fli_user_data; FL_OBJECT *fli_handled_obj = NULL; FL_OBJECT *fli_handled_parent = NULL; /*************************************** * Function returns 1 if the event is consumed so it will never * reach the application window event queue ***************************************/ int fli_handle_event_callbacks( XEvent * xev ) { Window win = ( ( XAnyEvent * ) xev )->window; FLI_WIN *fwin = fli_app_win; while ( fwin && fwin->win != win ) fwin = fwin->next; if ( ! fwin ) { /* If there's a callback for events for independendly created user windows that returns 0 the event has been handled, otherwise ignore it */ if ( fli_event_callback && ! fli_event_callback( xev, fli_user_data ) ) return 1; M_warn( "fli_handle_event_callbacks", "Unknown window = %ld", xev->xany.window ); fli_xevent_name( "Ignored", xev ); return 1; } if ( fwin->pre_emptive && fwin->pre_emptive( xev, fwin->pre_emptive_data ) == FL_PREEMPT ) return 1; if ( fwin->callback[ xev->type ] ) { fwin->callback[ xev->type ]( xev, fwin->user_data[ xev->type ] ); return 1; } return 0; } /*************************************** * Sets the callback routine for the events ***************************************/ FL_APPEVENT_CB fl_set_event_callback( FL_APPEVENT_CB callback, void * user_data ) { FL_APPEVENT_CB old = fli_event_callback; fli_event_callback = callback; fli_user_data = user_data; return old; } /********* End of Application Window management ***********}*****/ /*************** THE OBJECT EVENTS *************{******/ /*************** CALL-BACK ROUTINE HANDLING ***********/ /* Normally, the object queue doesn't have to be large and a default size is sufficient. In the case that more objects need to be stored the queue isn't increased by just another element but instead by the same number of objects we started with, reducing the number of calls of malloc() a bit */ #define FLI_QSIZE 64 /* chunk size of object queue */ typedef struct FLI_OBJECT_QUEUE_ENTRY_ { FL_OBJECT * obj; int ret; int event; struct FLI_OBJECT_QUEUE_ENTRY_ * next; } FLI_OBJECT_QUEUE_ENTRY; typedef struct FLI_OBJECT_QUEUE_ { FLI_OBJECT_QUEUE_ENTRY * head; /* here objects get added to */ FLI_OBJECT_QUEUE_ENTRY * tail; /* and here they get removed from */ FLI_OBJECT_QUEUE_ENTRY * empty; /* linked list of empty entries */ FLI_OBJECT_QUEUE_ENTRY * blocks; /* pointer to linked list of blocks */ } FLI_OBJECT_QUEUE; static FLI_OBJECT_QUEUE obj_queue = { NULL, NULL, NULL, NULL }; /*************************************************** * Function for creating/extending the object queue * (gets called automatically the first time an * object gets pushed on the queue, so no previous * call, e.g. from fl_initialize(), is necessary) ***************************************************/ static void extend_obj_queue( void ) { FLI_OBJECT_QUEUE_ENTRY *p = fl_malloc( ( FLI_QSIZE + 1 ) * sizeof *p ); size_t i; /* The first element of the (new) area is used for book-keeping purposes */ p->next = obj_queue.blocks; obj_queue.blocks = p++; /* The rest gets added to (or makes up) the empty list */ obj_queue.empty = p; for ( i = 0; i < FLI_QSIZE - 1; p++, i++ ) p->next = p + 1; p->next = NULL; } /****************************************************** * Fuction for removing the object queue, should be * called when all forms and application windows have * been closed to get rid of allocated memory. ******************************************************/ void fli_obj_queue_delete( void ) { FLI_OBJECT_QUEUE_ENTRY *b; while ( ( b = obj_queue.blocks ) != NULL ) { obj_queue.blocks = b->next; fl_free( b ); } obj_queue.tail = obj_queue.head = obj_queue.empty = NULL; } /*********************************************************** * Function for appending a new element to the object queue ***********************************************************/ static void add_to_obj_queue( FL_OBJECT * obj, int event ) { if ( obj == NULL ) return; if ( obj_queue.empty == NULL ) extend_obj_queue( ); if ( obj_queue.head ) obj_queue.head = obj_queue.head->next = obj_queue.empty; else obj_queue.tail = obj_queue.head = obj_queue.empty; obj_queue.empty = obj_queue.empty->next; obj_queue.head->next = NULL; obj_queue.head->obj = obj; obj_queue.head->event = event; if ( obj != FL_EVENT ) obj_queue.head->ret = obj->returned; } /***************************************************************** * Function for fetching the oldest element from the object queue *****************************************************************/ static FL_OBJECT * get_from_obj_queue( int * event ) { FLI_OBJECT_QUEUE_ENTRY *t = obj_queue.tail; if ( t == NULL ) return NULL; if ( t->next == NULL ) obj_queue.tail = obj_queue.head = NULL; else obj_queue.tail = t->next; t->next = obj_queue.empty; obj_queue.empty = t; if ( t->obj != FL_EVENT ) t->obj->returned = t->ret; if ( event ) *event = t->event; return t->obj; } /************************************************************************* * Function for removing all entries for a certain object from the queue. * This routine is called as part of hiding and deletion of an object. *************************************************************************/ void fli_object_qflush_object( FL_OBJECT * obj ) { FLI_OBJECT_QUEUE_ENTRY *c, *p; while ( obj_queue.tail && obj_queue.tail->obj == obj ) get_from_obj_queue( NULL ); if ( ! obj_queue.tail ) return; p = obj_queue.tail; c = p->next; while ( c ) { if ( c->obj == obj ) { p->next = c->next; c->next = obj_queue.empty; obj_queue.empty = c; } else p = c; c = p->next; } } /********************************************************************** * Function for removing all entries for a certain form from the queue * - here the object handler must be executed for FL_INPUT objects. * This should be called as part of free_form process. **********************************************************************/ void fli_object_qflush( FL_FORM * form ) { FLI_OBJECT_QUEUE_ENTRY *c, *p; while ( obj_queue.tail && obj_queue.tail->obj != FL_EVENT && obj_queue.tail->obj->form == form ) { if ( obj_queue.tail->obj->objclass == FL_INPUT ) handle_input_object( obj_queue.tail->obj, obj_queue.tail->event ); get_from_obj_queue( NULL ); } if ( ! obj_queue.tail ) return; for ( p = obj_queue.tail, c = p->next; c != NULL; c = p->next ) if ( c->obj != FL_EVENT && c->obj->form == form ) { if ( c->obj->objclass == FL_INPUT ) handle_input_object( c->obj, c->event ); p->next = c->next; c->next = obj_queue.empty; obj_queue.empty = c; } else p = c; } /*************************************** * Adds an object to the queue ***************************************/ void fli_object_qenter( FL_OBJECT * obj, int event ) { if ( ! obj ) { M_err( "fli_object_qenter", "NULL object" ); return; } #ifndef DELAYED_ACTION if ( obj != FL_EVENT && ( ! obj->form || ! obj->visible || obj->active <= 0 ) ) { #if FL_DEBUG >= ML_DEBUG M_err( "fli_object_qenter", "Bad object" ); #endif return; } /* Please note: if 'DELAYED_ACTION' should ever be switched on don't forget to deal correctly with also handling callbacks of parent objects (if the object entered is a child object) */ if ( obj != FL_EVENT ) { if ( obj->object_callback ) { XFlush( flx->display ); fli_context->last_event = event; obj->object_callback( obj, obj->argument ); fli_context->last_event = FL_NOEVENT; return; } else if ( obj->form->form_callback ) { XFlush( flx->display ); fli_context->last_event = event; obj->form->form_callback( obj, obj->form->form_cb_data ); fli_context->last_event = FL_NOEVENT; return; } } #endif /* ! DELAYED_ACTION */ add_to_obj_queue( obj, event ); } /*************************************** * Returns a pointer to the oldest element in the object queue ***************************************/ FL_OBJECT * fli_object_qtest( void ) { return obj_queue.tail ? obj_queue.tail->obj : NULL; } /*************************************** * Filter out result bits that don't fit what the object is set up to * return, and make sure the FL_RETURN_END_CHANGED bit is set correctly, * which requires that both FL_RETURN_CHANGED and FL_RETURN_END are set ***************************************/ void fli_filter_returns( FL_OBJECT * obj ) { if ( obj->how_return & FL_RETURN_END_CHANGED && obj->returned & FL_RETURN_CHANGED && obj->returned & FL_RETURN_END ) { obj->returned |= FL_RETURN_END_CHANGED; obj->returned &= ~ ( FL_RETURN_CHANGED | FL_RETURN_END ); } if ( obj->how_return != FL_RETURN_NONE ) obj->returned &= obj->how_return | FL_RETURN_TRIGGERED; else obj->returned = FL_RETURN_NONE; } /*************************************** * Reads an object from the queue, calls callbacks for the object (if * they exist) or passes it on to the user via fl_do_forms() etc. ***************************************/ FL_OBJECT * fli_object_qread( void ) { int event = -1; FL_OBJECT *obj = get_from_obj_queue( &event ); if ( obj == FL_EVENT ) return obj; if ( ! obj || ! obj->form ) return NULL; /* If the object has a callback execute it and return NULL unless the object is a child object (in that case we're supposed to also check for callbacks for the parent etc.). It's also important to make sure the object didn't get deleted within its callback - if that's the case it would be catastrophic to check for the parent... */ if ( obj->object_callback ) { fli_handled_obj = obj; fli_context->last_event = event; obj->object_callback( obj, obj->argument ); fli_context->last_event = FL_NOEVENT; if ( fli_handled_obj ) obj->returned = FL_RETURN_NONE; if ( ! fli_handled_obj || ! obj->parent ) return NULL; } /* If the object is a child object check if there is a callback for the parent and execute that (and return NULL in that case). In between also check if there are further events for other childs of the same parent in the queue and also execute their callbacks. And keep in mind that execution of one of these callbacks may delete the object (and even its parent...) */ if ( obj->parent ) { obj = obj->parent; fli_filter_returns( obj ); while ( obj->parent ) { if ( ! obj->returned ) return NULL; if ( obj->object_callback ) { fli_handled_obj = obj; fli_context->last_event = event; obj->object_callback( obj, obj->argument ); fli_context->last_event = FL_NOEVENT; if ( fli_handled_obj ) obj->returned = FL_RETURN_NONE; else return NULL; } obj = obj->parent; fli_filter_returns( obj ); } fli_handled_parent = obj; while ( fli_handled_parent ) { FL_OBJECT *n, *p; if ( ! ( n = fli_object_qtest( ) ) || n == FL_EVENT || ! n->parent ) break; p = n->parent; while ( p->parent ) p = p->parent; if ( p != obj ) break; n = get_from_obj_queue( &event ); do { fli_filter_returns( n ); if ( ! n->returned ) break; if ( n->object_callback ) { fli_handled_obj = n; fli_context->last_event = event; n->object_callback( n, n->argument ); fli_context->last_event = FL_NOEVENT; if ( fli_handled_obj ) n->returned = FL_RETURN_NONE; else break; } } while ( fli_handled_parent && ( n = n->parent ) != obj ); fli_filter_returns( obj ); } if ( ! fli_handled_parent ) return NULL; } /* If we arrive here the original object either was a child object or it had no callback. Run either the parents callback or the forms callback (if there's one). */ if ( ! obj->returned ) return NULL; else if ( obj->object_callback ) { fli_handled_obj = obj; fli_context->last_event = event; obj->object_callback( obj, obj->argument ); fli_context->last_event = FL_NOEVENT; if ( fli_handled_obj ) obj->returned = FL_RETURN_NONE; return NULL; } else if ( obj->form->form_callback ) { fli_handled_obj = obj; fli_context->last_event = event; obj->form->form_callback( obj, obj->form->form_cb_data ); fli_context->last_event = FL_NOEVENT; if ( fli_handled_obj ) obj->returned = FL_RETURN_NONE; return NULL; } if ( obj->child && obj->returned == FL_RETURN_NONE) return NULL; return obj; } /*************************************** * This is mainly used to handle the input correctly when a form * is being hidden ***************************************/ static void handle_input_object( FL_OBJECT * obj, int event ) { if ( obj != FL_EVENT || ! obj->form ) return; fli_context->last_event = event; if ( obj->object_callback ) obj->object_callback( obj, obj->argument ); else if ( obj->form->form_callback ) obj->form->form_callback( obj, obj->form->form_cb_data ); fli_context->last_event = FL_NOEVENT; } /***************** End of object queue handling *****************/ /**************** Normal Events ********************/ typedef struct FL_EVENT_QUEUE_ENTRY_ { XEvent xev; struct FL_EVENT_QUEUE_ENTRY_ * next; } FL_EVENT_QUEUE_ENTRY; typedef struct FL_EVENT_QUEUE_ { FL_EVENT_QUEUE_ENTRY * head; /* here events get added to */ FL_EVENT_QUEUE_ENTRY * tail; /* and here they get removed from */ FL_EVENT_QUEUE_ENTRY * empty; /* linked list of empty entries */ FL_EVENT_QUEUE_ENTRY * blocks; /* pointer to linked list of blocks */ unsigned long count; } FL_EVENT_QUEUE; static FL_EVENT_QUEUE event_queue = { NULL, NULL, NULL, NULL, 0 }; /*************************************************** * Function for creating/extending the event queue * (gets called automatically the first time an * event gets pushed onto the queue, so no initia- * lization, e.g. from fl_initialize(), is needed) ***************************************************/ static void extend_event_queue( void ) { FL_EVENT_QUEUE_ENTRY *p = fl_malloc( ( FLI_QSIZE + 1 ) * sizeof *p ); size_t i; /* The first element of the area gets used for book-keeping purposes */ p->next = event_queue.blocks; event_queue.blocks = p++; /* The rest gets added to (or makes up) the empty list */ event_queue.empty = p; for ( i = 0; i < FLI_QSIZE - 1; p++, i++ ) p->next = p + 1; p->next = NULL; } /****************************************************** * Fuction for removing the event queue, should be * called when all forms and application windows have * been closed to get rid of allocated memory. ******************************************************/ void fli_event_queue_delete( void ) { FL_EVENT_QUEUE_ENTRY *b; while ( ( b = event_queue.blocks ) != NULL ) { event_queue.blocks = b->next; fl_free( b ); } event_queue.tail = event_queue.head = event_queue.empty = NULL; } /*********************************************************** * Function for appending a new element to the event queue ***********************************************************/ static void add_to_event_queue( XEvent * xev ) { if ( event_queue.empty == NULL ) extend_event_queue( ); if ( event_queue.head ) event_queue.head = event_queue.head->next = event_queue.empty; else event_queue.tail = event_queue.head = event_queue.empty; event_queue.empty = event_queue.empty->next; event_queue.head->next = NULL; event_queue.head->xev = *xev; event_queue.count++; } /**************************************************************** * Function for removing the oldest element form the event queue ****************************************************************/ static XEvent get_from_event_queue( void ) { FL_EVENT_QUEUE_ENTRY *t = event_queue.tail; if ( t->next == NULL ) event_queue.tail = event_queue.head = NULL; else event_queue.tail = t->next; t->next = event_queue.empty; event_queue.empty = t; return t->xev; } /*************************************** * Replacement for the Xlib XPutBackEvent() function: * allows to push back an event onto the queue ***************************************/ void fl_XPutBackEvent( XEvent * xev ) { static int mm; if ( xev->type != ClientMessage && fli_handle_event_callbacks( xev ) ) return; /* These must have come from simulating double buffering, throw them away */ if ( xev->type == NoExpose ) { if ( ++mm % 20 == 0 ) { M_warn( "fl_XPutbackEvent", "20 NoExpose discarded" ); mm = 0; } return; } fli_xevent_name( "fl_XPutBackEvent", xev ); add_to_event_queue( xev ); } /*************************************** * Replacement for the Xlib XEventsQueued() function: returns * if there are any events in the event queue. ***************************************/ int fl_XEventsQueued( int mode FL_UNUSED_ARG ) { if ( event_queue.tail == NULL ) { if ( fl_display == None ) return 0; fli_treat_interaction_events( 0 ); fli_treat_user_events( ); } return event_queue.tail != NULL; } /*************************************** * Replacement for the Xlib XNextEvent() function: copies the oldest * event into the XEvent structure and removes it from the queue. If * the queue is empty it blocks until an event has been received. ***************************************/ int fl_XNextEvent( XEvent * xev ) { if ( fl_display == None ) return 0; while ( event_queue.tail == NULL ) { if ( fl_display == None ) return 0; fli_treat_interaction_events( 1 ); fli_treat_user_events( ); } *xev = get_from_event_queue( ); return 1; } /*************************************** * Replacement for the Xlib XPeekEvent() function: returns a copy * of the first event avaialable but does not remove it. Blocks * if there is no event until a new one has arrived. ***************************************/ int fl_XPeekEvent( XEvent * xev ) { if ( fl_display == None ) return 0; while ( event_queue.tail == NULL ) { if ( fl_display == None ) return 0; fli_treat_interaction_events( 1 ); fli_treat_user_events( ); } *xev = event_queue.tail->xev; return 1; } /*************************************** * Get all user events and treat them: either "consume" them by * calling the callback routine or put them onto the internal * object queue for later retrival ***************************************/ void fli_treat_user_events( void ) { XEvent xev; while ( fl_display != None && event_queue.count ) { if ( fli_event_callback ) { fl_XNextEvent( &xev ); fli_event_callback( &xev, fli_user_data ); } else fli_object_qenter( FL_EVENT, FL_NOEVENT ); event_queue.count--; } } /******************** DEBUG use only *****************/ #define NV( a ) { #a, a } typedef struct { const char * name; int type; } ev_name; static ev_name evname[ ] = { NV( 0 ), NV( 1 ), NV( KeyPress ), NV( KeyRelease ), NV( ButtonPress ), NV( ButtonRelease ), NV( MotionNotify ), NV( EnterNotify ), NV( LeaveNotify ), NV( FocusIn ), NV( FocusOut ), NV( KeymapNotify ), NV( Expose ), NV( GraphicsExpose ), NV( NoExpose ), NV( VisibilityNotify ), NV( CreateNotify ), NV( DestroyNotify ), NV( UnmapNotify ), NV( MapNotify ), NV( MapRequest ), NV( ReparentNotify ), NV( ConfigureNotify ), NV( ConfigureRequest ), NV( GravityNotify ), NV( ResizeRequest ), NV( CirculateNotify ), NV( CirculateRequest ), NV( PropertyNotify ), NV( SelectionClear ), NV( SelectionRequest ), NV( SelectionNotify ), NV( ColormapNotify ), NV( ClientMessage ), NV( MappingNotify ) }; /*************************************** ***************************************/ const char * fli_get_xevent_name( const XEvent *xev ) { size_t i; static char buf[ 128 ]; for ( i = KeyPress; i < LASTEvent; i++ ) { if ( evname[ i ].type == xev->type ) { fli_snprintf( buf, sizeof buf, "%s(0x%x)", evname[ i ].name, xev->type ); return buf; } } return "unknown event"; } /*************************************** ***************************************/ XEvent * fl_print_xevent_name( const char * where, const XEvent * xev ) { size_t i, known; Window win = ( ( XAnyEvent * ) xev )->window; for ( i = KeyPress, known = 0; ! known && i < LASTEvent; i++ ) if ( evname[ i ].type == xev->type ) { fprintf( stderr, "%s Event (%d, win = %ld serial = %ld) %s ", where ? where : "", xev->type, win, ( ( XAnyEvent * ) xev)->serial, evname[ i ].name ); if ( xev->type == Expose ) fprintf( stderr, "count = %d serial = %ld\n", xev->xexpose.count, xev->xexpose.serial ); else if ( xev->type == LeaveNotify || xev->type == EnterNotify ) fprintf(stderr, "Mode %s\n", xev->xcrossing.mode == NotifyGrab ? "Grab" : ( xev->xcrossing.mode == NotifyNormal ? "Normal" : "UnGrab" ) ); else if ( xev->type == MotionNotify ) fprintf(stderr, "Mode %s\n", xev->xmotion.is_hint ? "Hint" : "Normal" ); else if ( xev->type == ConfigureNotify ) fprintf( stderr, "(x = %d y = %d w = %d h = %d) %s\n", xev->xconfigure.x, xev->xconfigure.y, xev->xconfigure.width, xev->xconfigure.height, xev->xconfigure.send_event ? "Syn" : "Non-Syn" ); else if ( xev->type == ButtonPress ) fprintf( stderr, "button: %d\n", xev->xbutton.button ); else if ( xev->type == ButtonRelease ) fprintf( stderr, "button: %d\n", xev->xbutton.button ); else fputc( '\n', stderr ); known = 1; } if ( ! known ) fprintf( stderr, "Unknown event %d, win = %ld\n", xev->type, win ); return ( XEvent * ) xev; } /*************************************** ***************************************/ XEvent * fli_xevent_name( const char * where, const XEvent * xev ) { if ( fli_cntl.debug >= 2 ) fl_print_xevent_name( where, xev ); return ( XEvent * ) xev; } /*************************************** ***************************************/ static int badwin_handler( Display * dpy FL_UNUSED_ARG, XErrorEvent * xev ) { if ( xev->type != BadWindow && xev->type != BadDrawable ) M_err( "badwin_handler", "X error happened when expecting only BadWindow/Drawable\n" ); return 0; } /*********************************************************************** * Received an Expose event ev, see if next event is the same as the * the current one, drop it if it is, but we need consolidate all the * dirty rectangles into one. * * Must not block. ************************************************************************/ static void compress_redraw( XEvent * ev ) { XEvent expose_ev; Window win = ev->xexpose.window; Region reg = XCreateRegion( ); XRectangle rec; /* Original comment: this is theoretically not correct as we can't peek ahead and ignore the events in between, but it works in XForms as we always update the form size and position when dealing with Expose event. This has been changed a bit since 1.0.90: There was a problem with e.g. KDE or Gnome when they were set up to redraw also during resizing and the mouse was moved around rather fast. We collect now not only Expose events, compressing them to a single one, covering the combined area of all of them, but also ConfigureNotify events. If there was one or more ConfigureNotify events we put back the "consolidated" Expose event onto the event queue and return the last ConfigureNotify event instead of the original Expose event we got started with. This hope- fully is not only a solution that covers all cases but also keeps the numbers of redraws to a minimum. The only drawback is that in the do_interaction_step() function, handling the Expose event, one has to check if the area specified by the event isn't larger than the (new) size of the window and prune it if necessary. JTT */ /* Collect all Expose events, combining their areas */ do { rec.x = ev->xexpose.x; rec.y = ev->xexpose.y; rec.width = ev->xexpose.width; rec.height = ev->xexpose.height; XUnionRectWithRegion( &rec, reg, reg ); } while ( XCheckTypedWindowEvent( flx->display, win, Expose, ev ) ); /* Set the area of the last events to that of the "consolidated" event and make a backup copy */ XClipBox( reg, &rec ); ev->xexpose.x = rec.x; ev->xexpose.y = rec.y; ev->xexpose.width = rec.width; ev->xexpose.height = rec.height; expose_ev = *ev; XDestroyRegion( reg ); /* Now get all ConfigureNotify events */ while ( XCheckTypedWindowEvent( flx->display, win, ConfigureNotify, ev ) ) /*empty */ ; /* If there was at least one ConfigureNotify event put the "consolidated" Expose event back onto the event queue and return the last ConfigureNotify event we got, otherwise the Expose event itself. Since e.g. KDE and Gnome can send the ConfigureNotify event artificially to achieve an update of the display while resizing is still going on, the 'send_event' member of the XEvent structure might be set. On the other hand, in do_interaction_step(), where the events are handled, this member is checked for to get around a bug in mwm. So we got to reset it here to avoid the event getting flagged as spurious. This hopefully won't interfere with the mwm bug detection since it's for cases were a ConfigureNotify gets send, but no corresponding Expose events, and in this case we wouldn't have ended up here... */ if ( ev->type == ConfigureNotify ) { XPutBackEvent( flx->display, &expose_ev ); ev->xconfigure.send_event = 0; } } /*************************************** ***************************************/ static void compress_motion( XEvent * xme ) { Window win = xme->xmotion.window; unsigned long evm = PointerMotionMask | ButtonMotionMask; if ( xme->type != MotionNotify ) return; do { #if FL_DEBUG >= ML_DEBUG M_info2( "compress_motion", "win = %ld (%d, %d) %s", xme->xany.window, xme->xmotion.x, xme->xmotion.y, xme->xmotion.is_hint ? "hint" : "" ) #endif /* empty */ ; } while ( XCheckWindowEvent( flx->display, win, evm, xme ) ); if ( xme->xmotion.is_hint ) { int ( *old )( Display *, XErrorEvent * ); /* We must protect against BadWindow here, because we have only looked for Motion events, and there could be a Destroy event which makes the XQueryPointer fail as the window is deleted. */ old = XSetErrorHandler( badwin_handler ); fl_get_win_mouse( xme->xmotion.window, &xme->xmotion.x, &xme->xmotion.y, &xme->xmotion.state ); XSetErrorHandler( old ); xme->xmotion.is_hint = 0; } } /*************************************** ***************************************/ void fli_compress_event( XEvent * xev, unsigned long mask ) { if ( xev->type == Expose && mask & ExposureMask ) compress_redraw( xev ); else if ( xev->type == MotionNotify && mask & ( PointerMotionMask | ButtonMotionMask ) ) compress_motion( xev ); } /*************************************** ***************************************/ int fl_keysym_pressed( KeySym k ) { char kvec[ 32 ]; KeyCode code; if ( ( code = XKeysymToKeycode( flx->display, k ) ) == NoSymbol ) { M_warn( "fl_keysym_pressed", "Bad KeySym %d", ( int ) k ); return 0; } XQueryKeymap( flx->display, kvec ); return 1 & ( kvec[ code / 8 ] >> ( code & 7 ) ); } /*************************************** * Add an event ***************************************/ long fl_addto_selected_xevent( Window win, long mask ) { XWindowAttributes xwa; XGetWindowAttributes( flx->display, win, &xwa ); xwa.your_event_mask |= mask; /* On some SGI machines, 'your_event_mask' has bogus value 0x80??????, causing an X protocol error. Fix this here */ xwa.your_event_mask &= AllEventsMask; XSelectInput( flx->display, win, xwa.your_event_mask ); return xwa.your_event_mask; } /*************************************** ***************************************/ long fl_remove_selected_xevent( Window win, long mask ) { XWindowAttributes xwa; XGetWindowAttributes( flx->display, win, &xwa ); xwa.your_event_mask &= ~mask; /* On some SGI machines 'your_event_mask' has bogus value of 0x80??????, causing an X protocol error. Fix this here */ xwa.your_event_mask &= AllEventsMask; XSelectInput( flx->display, win, xwa.your_event_mask ); return xwa.your_event_mask; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/xsupport.c0000664000175000017500000003051612353623326012607 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file xsupport.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Form initialization and Windowing support. * * Further isolation of dependencies of FORMS on underlining window * systems. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" static int xerror_detected = 0; /*************************************** * For debugging only ***************************************/ void fli_check_key_focus( const char * s, Window win ) { int r; Window w; if ( fli_cntl.debug > 1 ) { XGetInputFocus( flx->display, &w, &r ); M_info( "fli_check_key_focus", "%s:%s FWin = %lu ReqW = %lu", s ? s : "", w == win ? "OK" : "Wrong", w, win ); } } /***************************************************************** * Pointer query routines ***********************************************************{*****/ /*************************************** * Return the window ID mouse currently is in and sets the mouse location * relative to root ***************************************/ Window fl_get_mouse( FL_Coord * x, FL_Coord * y, unsigned int * keymask ) { Window rjunk, childwin; int cx, cy, xx, yy; XQueryPointer( flx->display, fl_root, &rjunk, &childwin, &xx, &yy, &cx, &cy, keymask ); *x = xx; *y = yy; return childwin; } /*************************************** * Find the mouse position relative to win and return the child win * the mouse is currently in ***************************************/ Window fl_get_win_mouse( Window win, FL_Coord * x, FL_Coord * y, unsigned int * keymask ) { Window rjunk, childwin; int dummy, ix, iy; XQueryPointer( flx->display, win, &rjunk, &childwin, &dummy, &dummy, &ix, &iy, keymask ); *x = ix; *y = iy; return childwin; } /*************************************** ***************************************/ Window fl_get_form_mouse( FL_FORM * form, FL_Coord * x, FL_Coord * y, unsigned int * keymask ) { Window win = None; if ( fli_get_visible_forms_index( form ) >= 0 ) { FL_pixmap *flp = form->flpixmap; win = ( flp && flp->win != None ) ? flp->win : form->window; fl_get_win_mouse( win, x, y, keymask ); } return win; } /*************************************** * warp mouse to (mx, my) relative to root window ***************************************/ void fl_set_mouse( FL_Coord mx, FL_Coord my ) { XWarpPointer( flx->display, None, fl_root, 0, 0, 0, 0, mx, my ); } /*** End of pointer query routines ******************/ Pixmap fli_gray_pattern[ 3 ] = { None, None, None }; GC fli_bwgc[ 3 ]; GC fli_whitegc; GC fl_drawgc[ 18 ]; static unsigned char gray40_bits[] = { 0xee, 0xbb, 0xee, 0xbb, 0xee, 0xbb, 0xee, 0xbb }; static unsigned char gray50_bits[] = { 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55 }; static unsigned char gray60_bits[] = { 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44 }; /*************************************** ***************************************/ void fli_init_stipples( void ) { if ( ! fli_gray_pattern[ 0 ] ) { fli_gray_pattern[ 0 ] = XCreateBitmapFromData( flx->display, fl_root, ( char * ) gray40_bits, 8, 8 ); fli_gray_pattern[ 1 ] = XCreateBitmapFromData( flx->display, fl_root, ( char * ) gray50_bits, 8, 8 ); fli_gray_pattern[ 2 ] = XCreateBitmapFromData( flx->display, fl_root, ( char * ) gray60_bits, 8, 8 ); } } /*************************************** * Must NOT allow object pixmap and form pixmap active at the * same time ***************************************/ static void change_object_drawable( FL_pixmap * p, FL_OBJECT * obj ) { p->x = obj->x; p->y = obj->y; p->win = FL_ObjWin( obj ); obj->form->window = p->pixmap; obj->x = 0; obj->y = 0; fl_winset( p->pixmap ); } /*************************************** ***************************************/ static void change_form_drawable( FL_pixmap * p, FL_FORM * form ) { p->x = form->x; p->y = form->y; p->win = form->window; form->window = p->pixmap; form->x = 0; form->y = 0; fl_winset( p->pixmap ); } /*************************************** ***************************************/ static int xerror_handler( Display * d FL_UNUSED_ARG, XErrorEvent * xev ) { if ( xev->error_code == BadAlloc ) M_err( "xerror_handler", "XError: can't allocate - ignored " ); else M_err( "xerror_handler", "XError: %d", xev->error_code ); xerror_detected = 1; return 0; } /* non-square box can't be double buffered */ #define NON_SQB( a ) ( ( a )->boxtype == FL_NO_BOX ) /* Pixmap support */ /*************************************** ***************************************/ void fli_create_object_pixmap( FL_OBJECT * obj ) { FL_pixmap *p = obj->flpixmap; int ( * oldhandler )( Display *, XErrorEvent * ); /* Check to see if we need to create a pixmap. Don't do it for none-square boxes as it is not easy to figure out the object color beneath the object we are trying to paint. It also makes no sense to draw to a pixmap for the object if we're already been directed to draw to a pixmap for the form itself. */ if ( ! obj->use_pixmap || ( obj->form->flpixmap && obj->form->flpixmap->win ) || obj->w <= 0 || obj->h <= 0 || NON_SQB( obj ) ) return; /* If we already got a pixmap that fits the objects properties just switch to it */ if ( p && p->pixmap && p->w == obj->w && p->h == obj->h && p->depth == fli_depth( fl_vmode ) && p->visual == fli_visual( fl_vmode ) && p->dbl_background == obj->dbl_background && p->pixel == fl_get_pixel( obj->dbl_background ) ) { change_object_drawable( p, obj ); fl_rectf( 0, 0, obj->w, obj->h, obj->dbl_background ); return; } if ( ! p ) p = obj->flpixmap = fl_calloc( 1, sizeof *p ); else if ( p->pixmap ) XFreePixmap( flx->display, p->pixmap ); oldhandler = XSetErrorHandler( xerror_handler ); p->pixmap = XCreatePixmap( flx->display, FL_ObjWin( obj ), obj->w, obj->h, fli_depth( fl_vmode ) ); XSetErrorHandler( oldhandler ); /* Test if creating the pixmap succeeded or we can't use one */ if ( xerror_detected ) { xerror_detected = 0; p->pixmap = None; return; } p->w = obj->w; p->h = obj->h; p->depth = fli_depth( fl_vmode ); p->visual = fli_visual( fl_vmode ); p->dbl_background = obj->dbl_background; p->pixel = fl_get_pixel( obj->dbl_background ); change_object_drawable( p, obj ); fl_rectf( 0, 0, obj->w, obj->h, obj->dbl_background ); } /*************************************** ***************************************/ void fli_show_object_pixmap( FL_OBJECT * obj ) { FL_pixmap *p = obj->flpixmap; if ( ! p || ! p->pixmap || ! p->win || NON_SQB( obj ) ) return; XCopyArea( flx->display, p->pixmap, p->win, flx->gc, 0, 0, p->w, p->h, p->x, p->y ); obj->x = p->x; obj->y = p->y; obj->form->window = p->win; p->win = None; fl_winset( obj->form->window ); } /*************************************** ***************************************/ void fli_free_flpixmap( FL_pixmap * p ) { if ( p && p->pixmap ) { XFreePixmap( flx->display, p->pixmap ); p->pixmap = None; } } /*************************************** ***************************************/ static int form_pixmapable( FL_FORM * form ) { /* Check to see if we can use a pixmap. None-square boxes can't be used as it is not easy to figure out the object color beneath the form we're trying to paint. Take care, sometimes a form can have a fake NO_BOX as the first object */ return form->use_pixmap && ( form->first && ( ! NON_SQB( form->first ) || ( form->first->next && ! NON_SQB( form->first->next ) ) ) ); } /*************************************** ***************************************/ void fli_create_form_pixmap( FL_FORM * form ) { FL_pixmap *p = form->flpixmap; int ( * oldhandler )( Display *, XErrorEvent * ); if ( form->w <= 0 || form->h <= 0 || ! form_pixmapable( form ) ) return; if ( p && p->pixmap && p->w == form->w && p->h == form->h && p->depth == fli_depth( fl_vmode ) && p->visual == fli_visual( fl_vmode ) ) { change_form_drawable( p, form ); return; } if ( ! p ) p = form->flpixmap = fl_calloc( 1, sizeof *p ); else if ( p->pixmap ) XFreePixmap( flx->display, p->pixmap ); oldhandler = XSetErrorHandler( xerror_handler ); p->pixmap = XCreatePixmap( flx->display, form->window, form->w, form->h, fli_depth( fl_vmode ) ); XSetErrorHandler( oldhandler ); /* Test if creating a pixmap worked, otherwise we can't use one */ if ( xerror_detected ) { xerror_detected = 0; p->pixmap = None; return; } XSetErrorHandler( oldhandler ); p->w = form->w; p->h = form->h; p->depth = fli_depth( fl_vmode ); p->visual = fli_visual( fl_vmode ); change_form_drawable( p, form ); } /*************************************** ***************************************/ void fli_show_form_pixmap( FL_FORM * form ) { FL_pixmap *p = form->flpixmap; if ( ! form_pixmapable( form ) || ! p || ! p->pixmap || ! p->win || p->w <= 0 || p->h <= 0 ) return; XCopyArea( flx->display, p->pixmap, p->win, flx->gc, 0, 0, p->w, p->h, 0, 0 ); form->x = p->x; form->y = p->y; form->window = p->win; p->win = None; fl_winset( form->window ); } /******** VisualClass name **************/ #define VN( a ) { a, #a } static FLI_VN_PAIR xvclass[ ] = { VN( PseudoColor ), VN( TrueColor ), VN( DirectColor ), VN( StaticColor ), VN( GrayScale ), VN( GreyScale ), VN( StaticGray ), VN( StaticGrey ), { FL_DefaultVisual, "DefaultVisual" }, { -1, NULL } }; /*************************************** ***************************************/ const char * fli_vclass_name( int n ) { FLI_VN_PAIR *xc = xvclass; for ( ; xc->name; xc++ ) if ( n == xc->val ) return xc->name; return "InvalidVisual"; } /*************************************** * fli_get_vn_val can't be used. caller relies on the returning * of FL_IllegalVisual ***************************************/ int fli_vclass_val( const char * v ) { FLI_VN_PAIR *vn; if ( ! v ) return FL_IllegalVisual; for ( vn = xvclass; vn->name; vn++ ) if ( ! strcmp( vn->name, v ) ) return vn->val; return FL_IllegalVisual; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/select.c0000664000175000017500000010062612353623326012162 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/pselect.h" #include "private/flvasprintf.h" static void timeout_cb( int, void * ); static int handle_select( FL_OBJECT *, int, FL_Coord, FL_Coord, int, void * ); static int handle_push( FL_OBJECT *, int ); static FL_POPUP_RETURN * find_first_item( FL_OBJECT * ); static FL_POPUP_RETURN * find_last_item( FL_OBJECT * ); static FL_POPUP_RETURN * find_next_item( FL_OBJECT * ); static FL_POPUP_RETURN * find_prev_item( FL_OBJECT * ); static void draw_select( FL_OBJECT * ); static void draw_droplist( FL_OBJECT * ); #define IS_ACTIVATABLE( e ) \ ( ( e )->type != FL_POPUP_LINE \ && ! ( ( e ) ->state & ( FL_POPUP_HIDDEN | FL_POPUP_DISABLED ) ) ) /*************************************** * Create a select object ***************************************/ FL_OBJECT * fl_create_select( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; FLI_SELECT_SPEC *sp; obj = fl_make_object( FL_SELECT, type, x, y, w, h, label, handle_select ); obj->boxtype = type == FL_NORMAL_SELECT ? FL_ROUNDED_BOX : FL_UP_BOX; obj->col1 = FL_SELECT_COL1; obj->col2 = FL_SELECT_COL2; obj->lcol = FL_SELECT_LCOL; obj->align = FL_SELECT_ALIGN; obj->want_update = 1; sp = obj->spec = fl_malloc( sizeof *sp ); sp->popup = NULL; sp->sel = NULL; sp->align = FL_ALIGN_CENTER; sp->style = FL_NORMAL_STYLE; sp->size = FL_NORMAL_SIZE; sp->color = FL_BLACK; sp->timeout_id = -1; sp->repeat_ms = 500; fl_set_object_return( obj, FL_RETURN_CHANGED ); return obj; } /*************************************** * Add a select object ***************************************/ FL_OBJECT * fl_add_select( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; obj = fl_create_select( type, x, y, w, h, label ); fl_add_object( fl_current_form, obj ); /* Popup can only be created after the object has been added to its form, otherwise we don't know which window is its parent window... */ ( ( FLI_SELECT_SPEC * ) obj->spec )->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_add_select" ); return obj; } /*************************************** * Remove all items from select objects popup ***************************************/ int fl_clear_select( FL_OBJECT * obj ) { FLI_SELECT_SPEC *sp; if ( obj == NULL ) { M_err( "fl_clear_select_popup", "NULL object" ); return -1; } sp = obj->spec; /* Remove all existing entries and reset the popups internal counter */ if ( sp->popup != NULL ) { while ( sp->popup->entries != NULL ) fl_popup_entry_delete( sp->popup->entries ); fli_popup_reset_counter( sp->popup ); } else sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_clear_select" ); sp->sel = NULL; fl_redraw_object( obj ); return 0; } /*************************************** * Add item(s) to the select object ***************************************/ FL_POPUP_ENTRY * fl_add_select_items( FL_OBJECT * obj, const char * items, ... ) { FLI_SELECT_SPEC *sp; FL_POPUP_ENTRY *new_entries; va_list ap; if ( obj == NULL ) { M_err( "fl_add_select_items", "NULL object" ); return NULL; } sp = obj->spec; if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_add_select_items" ); /* Create and append the new entries to the popup */ va_start( ap, items ); new_entries = fli_popup_add_entries( sp->popup, items, ap, "fl_add_select_items", 1 ); va_end( ap ); /* If there's no currently selected entry try to find one */ if ( sp->sel == NULL ) sp->sel = find_first_item( obj ); fl_redraw_object( obj ); return new_entries; } /*************************************** * Insert item(s) into the select object after an already existing item ***************************************/ FL_POPUP_ENTRY * fl_insert_select_items( FL_OBJECT * obj, FL_POPUP_ENTRY * after, const char * items, ... ) { FLI_SELECT_SPEC *sp; FL_POPUP_ENTRY *new_entries; va_list ap; if ( obj == NULL ) { M_err( "fl_add_select_items", "NULL object" ); return NULL; } sp = obj->spec; if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_insert_select_items" ); if ( after != NULL && fli_check_popup_entry_exists( after ) != 0 ) { M_err( "fl_add_select_items", "Item to insert after doesn't exist" ); return NULL; } va_start( ap, items ); new_entries = fli_popup_insert_entries( sp->popup, after, items, ap, "fl_insert_select_items", 1 ); va_end( ap ); /* If there's no currently selected entry try to find one */ if ( sp->sel == NULL ) sp->sel = find_first_item( obj ); fl_redraw_object( obj ); return new_entries; } /*************************************** * Replace an item by new item(s) ***************************************/ FL_POPUP_ENTRY * fl_replace_select_item( FL_OBJECT * obj, FL_POPUP_ENTRY * old_item, const char * items, ... ) { FLI_SELECT_SPEC *sp; FL_POPUP_ENTRY *new_entries; va_list ap; if ( obj == NULL ) { M_err( "fl_replace_select_items", "NULL object" ); return NULL; } if ( ! items || ! *items ) { M_err( "fl_replace_select_items", "Items string NULL or empty" ); return NULL; } sp = obj->spec; if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_replace_select_items" ); /* Test if the item we're supposed to replace exists */ if ( fli_check_popup_entry_exists( old_item ) ) { M_err( "fl_replace_select_items", "Item to replace doesn't exist" ); return NULL; } /* Add the new item(s) after the one to replaced */ va_start( ap, items ); new_entries = fli_popup_insert_entries( sp->popup, old_item, items, ap, "fl_replace_select_items", 1 ); va_end( ap ); /* If the insert worked out ok delete the old item (and check if we have to set a new displayed item) */ if ( new_entries != NULL ) { if ( sp->sel != NULL && sp->sel->entry == old_item ) sp->sel = find_next_item( obj ); fl_popup_entry_delete( old_item ); if ( sp->sel != NULL && sp->sel->entry == old_item ) sp->sel = find_first_item( obj ); } else sp->sel = NULL; fl_redraw_object( obj ); return new_entries; } /*************************************** * Delete an item of a select object ***************************************/ int fl_delete_select_item( FL_OBJECT * obj, FL_POPUP_ENTRY * item ) { FLI_SELECT_SPEC *sp; if ( obj == NULL ) { M_err( "fl_delete_select_item", "NULL object" ); return -1; } sp = obj->spec; if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_delete_select_items" ); if ( fli_check_popup_entry_exists( item ) != 0 ) { M_err( "fl_delete_select_item", "Item doesn't exist" ); return -1; } /* Delete the entry */ fl_popup_entry_delete( item ); /* Check if we have to change the currently selected item */ if ( item == sp->sel->entry ) sp->sel = find_next_item( obj ); fl_redraw_object( obj ); return 0; } /*************************************** * (Re)populate a select object's popup via an * array of FL_POPUP_ITEM structures ***************************************/ long fl_set_select_items( FL_OBJECT * obj, FL_POPUP_ITEM * items ) { FLI_SELECT_SPEC *sp; FL_POPUP_ENTRY *e; long count; if ( obj == NULL ) { M_err( "fl_set_select_items", "NULL object" ); return -1; } sp = obj->spec; /* If no popup exists yet create it, otherwise remove all entries */ if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_set_select_items" ); else { while ( sp->popup->entries != NULL ) fl_popup_entry_delete( sp->popup->entries ); fli_popup_reset_counter( sp->popup ); } /* Now add the new ones */ for ( count = 0; items && items->text != NULL; count++, items++ ) { size_t len = strlen( items->text ) + 9; char *txt; char *t = ( char * ) items->text; /* Figure out how many chars we need for the text */ while ( ( t = strchr( t, '%' ) ) != NULL ) if ( *++t != 'S' ) len++; t = txt = fl_malloc( len ); strcpy( txt, items->text ); while ( ( t = strchr( t, '%' ) ) != NULL ) { if ( *++t == 'S' ) continue; memmove( t + 1, t, strlen( t ) + 1 ); *t++ = '%'; } if ( items->state & FL_POPUP_DISABLED ) strcat( txt, "%d" ); if ( items->state & FL_POPUP_HIDDEN ) strcat( txt, "%h" ); strcat( txt, "%f%s" ); e = fl_popup_add_entries( sp->popup, txt, items->callback, items->shortcut ); fl_free( txt ); fli_safe_free( e->text ); e->text = fl_strdup( items->text ); } if ( count > 0 ) sp->sel = find_first_item( obj ); return count; } /*************************************** * Returns the popup of a select object ***************************************/ FL_POPUP * fl_get_select_popup( FL_OBJECT * obj ) { return ( ( FLI_SELECT_SPEC * ) obj->spec )->popup; } /*************************************** * Set a (new) popup for a select object ***************************************/ int fl_set_select_popup( FL_OBJECT * obj, FL_POPUP * popup ) { FLI_SELECT_SPEC *sp; FL_POPUP *old_popup; FL_POPUP_ENTRY *e; /* We need a valid object */ if ( obj == NULL ) { M_err( "fl_set_select_popup", "NULL object" ); return -1; } sp = obj->spec; /* The popup must exist */ if ( fli_check_popup_exists( popup ) ) { M_err( "fl_set_select_popup", "Popup doesn't exist" ); return -1; } /* The popup can't be a sub-popup nor may it contain any entries that are not "normal" entries */ if ( popup->parent != NULL ) { M_err( "fl_set_select_popup", "Popup is a sub-popup" ); return -1; } for ( e = popup->entries; e != NULL; e = e->next ) if ( e->type != FL_POPUP_NORMAL ) { M_err( "fl_set_select_popup", "Invalid entries in popup" ); return -1; } /* Delete a popup already associated with the select object */ old_popup = ( ( FLI_SELECT_SPEC * ) obj->spec )->popup; if ( old_popup != NULL ) fl_popup_delete( old_popup ); /* Set the new popup as the select pbjects popup and redraw */ sp->popup = popup; sp->sel = find_first_item( obj ); fl_redraw_object( obj ); return 1; } /*************************************** * Return currently selected item ***************************************/ FL_POPUP_RETURN * fl_get_select_item( FL_OBJECT * obj ) { if ( obj == NULL ) { M_err( "fl_get_select_item", "NULL object" ); return NULL; } return ( ( FLI_SELECT_SPEC * ) obj->spec )->sel; } /*************************************** * Set a new item as currently selected ***************************************/ FL_POPUP_RETURN * fl_set_select_item( FL_OBJECT * obj, FL_POPUP_ENTRY * entry ) { FL_POPUP_ENTRY *e; FLI_SELECT_SPEC *sp; FL_POPUP_RETURN *r; if ( obj == NULL ) { M_err( "fl_get_select_item", "NULL object" ); return NULL; } if ( entry == NULL ) { M_err( "fl_set_select_item", "NULL entry" ); return NULL; } sp = obj->spec; if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_set_select_items" ); for ( e = sp->popup->entries; e != NULL; e = e->next ) if ( e == entry ) break; if ( e == NULL ) { M_err( "fl_set_select_item", "Entry does not exist" ); return NULL; } if ( ! IS_ACTIVATABLE( entry ) ) { M_err( "fl_set_select_item", "Entry can't be set as selected" ); return NULL; } r = fli_set_popup_return( entry ); fl_redraw_object( obj ); return r; } /*************************************** ***************************************/ FL_POPUP_ENTRY * fl_get_select_item_by_value( FL_OBJECT * obj, long int val ) { FLI_SELECT_SPEC *sp; if ( obj == NULL ) { M_err( "fl_get_select_item_by_value", "NULL object" ); return NULL; } sp = obj->spec; if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_get_select_item_by_value" ); return fl_popup_entry_get_by_value( sp->popup, val ); } /*************************************** ***************************************/ FL_POPUP_ENTRY * fl_get_select_item_by_label( FL_OBJECT * obj, const char * label ) { FLI_SELECT_SPEC *sp; if ( obj == NULL ) { M_err( "fl_get_select_item_by_label", "NULL object" ); return NULL; } sp = obj->spec; if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_get_select_item_by_label" ); return fl_popup_entry_get_by_label( sp->popup, label ); } /*************************************** ***************************************/ FL_POPUP_ENTRY * fl_get_select_item_by_label_f( FL_OBJECT * obj, const char * fmt, ... ) { FL_POPUP_ENTRY *e; char *buf; EXPAND_FORMAT_STRING( buf, fmt ); e = fl_get_select_item_by_label( obj, buf ); fl_free( buf ); return e; } /*************************************** ***************************************/ FL_POPUP_ENTRY * fl_get_select_item_by_text( FL_OBJECT * obj, const char * text ) { FLI_SELECT_SPEC *sp; if ( obj == NULL ) { M_err( "fl_get_select_item_by_text", "NULL object" ); return NULL; } sp = obj->spec; if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_get_select_item_by_text" ); return fl_popup_entry_get_by_text( sp->popup, text ); } /*************************************** ***************************************/ FL_POPUP_ENTRY * fl_get_select_item_by_text_f( FL_OBJECT * obj, const char * fmt, ... ) { FL_POPUP_ENTRY *e; char *buf; EXPAND_FORMAT_STRING( buf, fmt ); e = fl_get_select_item_by_text( obj, buf ); fl_free( buf ); return e; } /*************************************** * Returns one of the different colors set for the object and its popup ***************************************/ FL_COLOR fl_get_select_text_color( FL_OBJECT * obj ) { FLI_SELECT_SPEC *sp; if ( obj == NULL ) { M_err( "fl_get_select_color", "NULL object" ); return FL_MAX_COLORS; } sp = obj->spec; return sp->color; } /*************************************** * Set one of the different colors of the object ***************************************/ FL_COLOR fl_set_select_text_color( FL_OBJECT * obj, FL_COLOR color ) { FLI_SELECT_SPEC *sp; FL_COLOR old_color; if ( obj == NULL ) { M_err( "fl_set_select_color", "NULL object" ); return FL_MAX_COLORS; } if ( color >= FL_MAX_COLORS ) { M_err( "fl_select_set_color", "Invalid color argument" ); return FL_MAX_COLORS; } sp = obj->spec; old_color = sp->color; sp->color = color; fl_redraw_object( obj ); return old_color; } /*************************************** * Returns style and size of the fonts used for the text on the object ***************************************/ int fl_get_select_text_font( FL_OBJECT * obj, int * style, int * size ) { FLI_SELECT_SPEC *sp; if ( obj == NULL ) { M_err( "fl_get_select_font", "NULL object" ); return -1; } sp = obj->spec; if ( style != NULL ) *style = sp->style; if ( size != NULL ) *size = sp->size; return 0; } /*************************************** * Sets style and size of the fonts used for the text on the object ***************************************/ int fl_set_select_text_font( FL_OBJECT * obj, int style, int size ) { FLI_SELECT_SPEC *sp; if ( obj == NULL ) { M_err( "fl_set_select_font", "NULL object" ); return -1; } sp = obj->spec; sp->style = style; sp->size = size; fl_redraw_object( obj ); return 0; } /*************************************** * Gets the alignment of the text within the box of the object ***************************************/ int fl_get_select_text_align( FL_OBJECT * obj ) { if ( obj == NULL ) { M_err( "fl_set_select_text_align", "NULL object" ); return -1; } return ( ( FLI_SELECT_SPEC * ) obj->spec )->align; } /*************************************** * Sets the alignment of the text within the box of the object ***************************************/ int fl_set_select_text_align( FL_OBJECT * obj, int align ) { FLI_SELECT_SPEC *sp; int old_align; if ( obj == NULL ) { M_err( "fl_set_select_text_align", "NULL object" ); return -1; } if ( fl_is_outside_lalign( align ) ) { M_warn( "fl_set_select_text_align", "Adding FL_ALIGN_INSIDE flag" ); align = fl_to_inside_lalign( align ); } if ( fl_to_outside_lalign( align ) < FL_ALIGN_CENTER || fl_to_outside_lalign( align ) > FL_ALIGN_RIGHT_BOTTOM ) { M_err( "fl_set_select_text_align", "Invalid value for align" ); return -1; } sp = obj->spec; old_align = sp->align; sp->align = align; fl_redraw_object( obj ); return old_align; } /*************************************** * Sets how the popup of the object behaves ***************************************/ int fl_set_select_policy( FL_OBJECT * obj, int policy ) { FLI_SELECT_SPEC *sp; int old_policy; if ( obj == NULL ) { M_err( "fl_set_select_policy", "NULL object" ); return INT_MIN; } if ( policy < FL_POPUP_NORMAL_SELECT || policy > FL_POPUP_DRAG_SELECT ) { M_err( "fl_set_select_policy", "Invalid policy argument" ); return -1; } sp = obj->spec; if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_set_select_policy" ); old_policy = fl_popup_get_policy( sp->popup ); fl_popup_set_policy( sp->popup, policy ); return old_policy; } /*************************************** * Callback for timeout used when mouse buttons 2 or 3 are kept pressed down ***************************************/ static void timeout_cb( int val FL_UNUSED_ARG, void * data ) { ( ( FLI_SELECT_SPEC * ) data )->timeout_id = -1; } /*************************************** * Central routine for interaction with object ***************************************/ static int handle_select( FL_OBJECT * obj, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key, void * ev FL_UNUSED_ARG ) { FLI_SELECT_SPEC *sp = obj->spec; FL_POPUP_RETURN *ret = NULL; unsigned int w, h; int sret = FL_RETURN_NONE; switch ( event ) { case FL_ATTRIB : obj->align = fl_to_outside_lalign( obj->align ); if ( fl_is_center_lalign( obj->align ) ) obj->align = FL_SELECT_ALIGN; break; case FL_DRAW : if ( obj->type != FL_DROPLIST_SELECT ) draw_select( obj ); else draw_droplist( obj ); /* fall through */ case FL_DRAWLABEL : fl_draw_text_beside( obj->align, obj->x, obj->y, obj->w, obj->h, obj->lcol, obj->lstyle, obj->lsize, obj->label ); break; case FL_ENTER : case FL_LEAVE : fl_redraw_object( obj ); break; case FL_SHORTCUT : obj->pushed = 1; key = FL_MBUTTON1; fl_popup_get_size( sp->popup, &w, &h ); fl_popup_set_position( sp->popup, obj->form->x + obj->x + ( obj->w - w ) / 2, obj->form->y + obj->y + obj->h ); sret |= FL_RETURN_END; /* fall through */ case FL_PUSH : if ( handle_push( obj, key ) ) sret |= FL_RETURN_CHANGED; break; case FL_RELEASE : if ( key != FL_MBUTTON2 && key != FL_MBUTTON3 ) break; if ( sp->timeout_id != -1 ) { fl_remove_timeout( sp->timeout_id ); sp->timeout_id = -1; } fl_redraw_object( obj ); sret |= FL_RETURN_END; break; case FL_UPDATE: if ( ( key == FL_MBUTTON2 || key == FL_MBUTTON3 ) && sp->timeout_id == -1 ) { const FL_POPUP_ENTRY *old_entry = sp->sel ? sp->sel->entry : NULL; ret = ( key == FL_MBUTTON2 ? find_prev_item : find_next_item )( obj ); if ( ret != NULL && ret->entry != old_entry && ret->entry->callback && ret->entry->callback( ret ) == FL_IGNORE ) ret = NULL; fl_redraw_object( obj ); sp->timeout_id = fl_add_timeout( sp->repeat_ms, timeout_cb, sp ); if ( ret != NULL ) sret |= FL_RETURN_CHANGED; } break; case FL_FREEMEM : if ( sp && sp->popup ) fl_popup_delete( sp->popup ); fli_safe_free( obj->spec ); break; } return sret; } /*************************************** * Deals with pushes on the select object ***************************************/ static int handle_push( FL_OBJECT * obj, int key ) { FLI_SELECT_SPEC *sp = obj->spec; FL_POPUP_RETURN *ret = NULL; const FL_POPUP_ENTRY *old_entry = sp->sel ? sp->sel->entry : NULL; unsigned int w, h; if ( key == FL_MBUTTON1 ) { fl_redraw_object( obj ); if ( obj->type == FL_DROPLIST_SELECT ) { fl_popup_get_size( sp->popup, &w, &h ); if ( obj->w >= 2 ) fl_popup_set_position( sp->popup, obj->form->x + obj->x + obj->w - w, obj->form->y + obj->y + obj->h ); else fl_popup_set_position( sp->popup, obj->form->x + obj->x + ( obj->w - w ) / 2, obj->form->y + obj->y + obj->h ); } if ( ( ret = fl_popup_do( sp->popup ) ) != NULL ) sp->sel = ret; obj->pushed = 0; } else if ( key == FL_MBUTTON2 || key == FL_MBUTTON3 ) { sp->timeout_id = fl_add_timeout( sp->repeat_ms, timeout_cb, sp ); fl_redraw_object( obj ); ret = ( key == FL_MBUTTON2 ? find_prev_item : find_next_item )( obj ); if ( ret != NULL && ret->entry != old_entry && ret->entry->callback && ret->entry->callback( ret ) == FL_IGNORE ) ret = NULL; } else if ( key == FL_MBUTTON4 || key == FL_MBUTTON5 ) { obj->pushed = 0; ret = ( key == FL_MBUTTON4 ? find_prev_item : find_next_item )( obj ); if ( ret != NULL && ret->entry != old_entry && ret->entry->callback && ret->entry->callback( ret ) == FL_IGNORE ) ret = NULL; } fl_redraw_object( obj ); return ret != NULL; } /*************************************** * Returns the first "activatable" entry of a select object ***************************************/ static FL_POPUP_RETURN * find_first_item( FL_OBJECT * obj ) { FL_POPUP_ENTRY *e = ( ( FLI_SELECT_SPEC * ) obj->spec )->popup->entries; for ( ; e != NULL; e = e->next ) if ( IS_ACTIVATABLE( e ) ) return fli_set_popup_return( e ); return NULL; } /*************************************** * Returns the last "activatable" entry of a select object ***************************************/ static FL_POPUP_RETURN * find_last_item( FL_OBJECT * obj ) { FL_POPUP_ENTRY *ec = ( ( FLI_SELECT_SPEC * ) obj->spec )->popup->entries, *e = ec->next; for ( ; e != NULL; e = e->next ) if ( IS_ACTIVATABLE( e ) ) ec = e; if ( ec != NULL ) return fli_set_popup_return( ec ); return NULL; } /*************************************** * Returns the next "activatable" entry of a select object after the * currently selected entry ***************************************/ static FL_POPUP_RETURN * find_next_item( FL_OBJECT * obj ) { FL_POPUP_ENTRY *e; FLI_SELECT_SPEC *sp = obj->spec; for ( e = sp->sel->entry->next; e != NULL; e = e->next ) if ( IS_ACTIVATABLE( e ) ) return fli_set_popup_return( e ); return find_first_item( obj );; } /*************************************** * Returns the previous "activatable" entry of a select object before the * currently selected entry ***************************************/ static FL_POPUP_RETURN * find_prev_item( FL_OBJECT * obj ) { FL_POPUP_ENTRY *e; FLI_SELECT_SPEC *sp = obj->spec; for ( e = sp->sel->entry->prev; e != NULL; e = e->prev ) if ( IS_ACTIVATABLE( e ) ) return fli_set_popup_return( e ); return find_last_item( obj ); } /*************************************** * Draws select objects of type FL_NORMAL_SELECT and FL_MENU_SELECT ***************************************/ static void draw_select( FL_OBJECT * obj ) { FL_COLOR color; FLI_SELECT_SPEC *sp = obj->spec; int bw = FL_abs( obj->bw ) + ( obj->bw > 0 ); int box_w = 0; color = ( obj->belowmouse && sp->popup ) ? obj->col2 : obj->col1; /* Draw the box of the object, possibly lowered if the object is pushed */ if ( FL_IS_UPBOX( obj->boxtype ) && obj->pushed ) fl_draw_box( FL_TO_DOWNBOX( obj->boxtype ), obj->x, obj->y, obj->w, obj->h, color, obj->bw ); else fl_draw_box( obj->boxtype, obj->x, obj->y, obj->w, obj->h, color, obj->bw ); /* The FL_MENU_SELECT type has a small raised box on the right hand side */ if ( obj->type == FL_MENU_SELECT ) { int box_h = FL_max( 6 + ( obj->bw > 0 ), 0.1 * obj->h ), box_bw = - FL_max( bw - ( obj->bw > 0 ), 1 ); box_w = FL_max( 0.11 * obj->w, 13 ); if ( box_w <= obj->w - 2 * bw && box_h <= obj->h - 2 * bw && box_w >= 2 * box_bw && box_h >= 2 * box_bw ) { int box_x = obj->x + obj->w -box_w - bw - 2; int box_y = obj->y + ( obj->h - box_h ) / 2; fl_draw_box( FL_UP_BOX, box_x, box_y, box_w, box_h, obj->col1, box_bw ); box_w += 3; } } if ( sp->sel && sp->sel->label && *sp->sel->label ) { fl_set_text_clipping( obj->x + bw, obj->y + bw, obj->w - box_w - 2 * bw, obj->h - 2 * bw ); fl_draw_text( sp->align, obj->x + bw, obj->y + bw, obj->w - box_w - 2 * bw, obj->h - 2 * bw, sp->color, sp->style, sp->size, sp->sel->label ); fl_unset_text_clipping( ); } } /*************************************** * Draws select objects of type FL_DROPLIST_SELECT ***************************************/ static void draw_droplist( FL_OBJECT * obj ) { int box_x = obj->x, box_y = obj->y, box_w, box_h, button_x, button_y, button_w, button_h; FL_COLOR color; FLI_SELECT_SPEC *sp = obj->spec; int bw = FL_abs( obj->bw ) + ( obj->bw > 0 ); /* Calculate the size of the box with the arrow - if the object is higher than wide place it below the text of the currently selected item */ if ( obj->w >= obj->h ) { button_x = obj->x + obj->w - obj->h; button_y = obj->y; button_w = button_h = obj->h; box_w = obj->w - obj->h; box_h = obj->h; } else { button_x = obj->x; button_y = obj->y + obj->h - obj->w; button_w = button_h = obj->w; box_w = obj->w; box_h = obj->h - obj->w; } color = ( obj->belowmouse && sp->popup ) ? obj->col2 : obj->col1; /* Draw the box for the text of the selected item */ fl_draw_box( obj->boxtype, box_x, box_y, box_w, box_h, obj->col1, obj->bw ); /* Draw the box for the arrow button, possibly lowered if the object is pushed */ if ( FL_IS_UPBOX( obj->boxtype ) && obj->pushed ) fl_draw_box( FL_TO_DOWNBOX( obj->boxtype ), button_x, button_y, button_w, button_h, color, obj->bw ); else fl_draw_box( obj->boxtype, button_x, button_y, button_w, button_h, color, obj->bw ); /* Draw the arrow */ fl_draw_text( FL_ALIGN_CENTER, button_x + bw, button_y + bw, button_w - 2 * bw, button_h - 2 * bw, sp->color, 0, 0, "@#2->" ); /* Draw the text of the currently selected item */ if ( sp->sel && sp->sel->label && *sp->sel->label ) { fl_set_text_clipping( box_x + bw, box_y + bw, box_w - 2 * bw, box_h - 2 * bw ); fl_draw_text( sp->align, box_x + bw, box_y + bw, box_w - 2 * bw, box_h - 2 * bw, sp->color, sp->style, sp->size, sp->sel->label ); fl_unset_text_clipping( ); } } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/frame.c0000664000175000017500000000560112353623325011771 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file frame.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" /*************************************** ***************************************/ static int handle_frame( FL_OBJECT * ob, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { switch ( event ) { case FL_ATTRIB : ob->align = fl_to_inside_lalign( ob->align ); break; case FL_DRAW: fl_draw_frame( ob->type, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); /* fall through */ case FL_DRAWLABEL: fl_draw_text( ob->align, ob->x, ob->y, ob->w, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); break; } return FL_RETURN_NONE; } /*************************************** ***************************************/ FL_OBJECT * fl_create_frame( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; obj = fl_make_object( FL_FRAME, type, x, y, w, h, label, handle_frame ); obj->boxtype = FL_NO_BOX; obj->col1 = FL_FRAME_COL1; obj->col2 = FL_FRAME_COL2; obj->lcol = FL_FRAME_LCOL; obj->align = FL_ALIGN_CENTER; obj->active = 0; return obj; } /*************************************** ***************************************/ FL_OBJECT * fl_add_frame( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj = fl_create_frame( type, x, y, w, h, label ); fl_add_object( fl_current_form, obj ); return obj; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/oneliner.c0000644000175000017500000000635412251554103012510 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file oneliner.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao * All rights reserved. * * Show message in a top-level unmanaged window. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" static int fntstyle = FL_NORMAL_STYLE, fntsize = FL_DEFAULT_SIZE; static FL_COLOR background = FL_YELLOW, textcolor = FL_BLACK; static FL_FORM *oneliner; static FL_OBJECT *text; /*************************************** ***************************************/ static void create_it( void ) { if ( oneliner ) return; oneliner = fl_bgn_form( FL_NO_BOX, 5, 5 ); text = fl_add_box( FL_BORDER_BOX, 0, 0, 5, 5, "" ); fl_set_object_lstyle( text, fntstyle ); fl_set_object_lsize( text, fntsize ); fl_set_object_lcolor( text, textcolor ); fl_set_object_color( text, background, background ); fl_end_form( ); } /*************************************** ***************************************/ void fl_show_oneliner( const char * s, FL_Coord x, FL_Coord y ) { int w, h; if ( ! s ) return; create_it( ); fl_get_string_dimension( fntstyle, fntsize, s, strlen( s ), &w, &h ); w += ( 2 * fntsize ) / 3; h += ( 2 * fntsize ) / 3; fl_freeze_form( oneliner ); fl_set_form_geometry( oneliner, x, y, w, h ); fl_set_object_label( text, s ); fl_unfreeze_form( oneliner ); if ( oneliner->visible == FL_INVISIBLE ) fl_show_form( oneliner, FL_PLACE_GEOMETRY | FL_FREE_SIZE, FL_NOBORDER, "OneLiner" ); fl_update_display( 1 ); } /*************************************** ***************************************/ void fl_hide_oneliner( void ) { if ( oneliner && oneliner->visible ) fl_hide_form( oneliner ); } /*************************************** ***************************************/ void fl_set_oneliner_color( FL_COLOR tc, FL_COLOR bc ) { create_it( ); fl_set_object_lcolor( text, textcolor = tc ); background = bc; fl_set_object_color( text, background, background ); } /*************************************** ***************************************/ void fl_set_oneliner_font( int style, int size ) { create_it( ); fl_set_object_lstyle( text, fntstyle = style ); fl_set_object_lsize( text, fntsize = size ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/read2msbf.c0000644000175000017500000000267212251554061012544 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file read2msbf.c * * Copyright(c) 1993,1994 by T.C. Zhao * All rights reserved. * * Read 2bytes MSB first */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" #include "flinternal.h" #include "ulib.h" /*************************************** ***************************************/ int fli_fget2MSBF( FILE * fp ) { int ret = getc(fp); return (ret << 8) + getc(fp); } /*************************************** ***************************************/ int fli_fput2MSBF( int code, FILE * fp ) { putc( ( code >> 8 ) & 0xff, fp ); putc( code & 0xff, fp ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/lframe.c0000664000175000017500000001252512353623325012150 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file lframe.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao * All rights reserved. * * similar to FL_FRAME, but label is drawn on the frame */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" /*************************************** ***************************************/ static int handle_lframe( FL_OBJECT * ob, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { int sx, sy, sw, sh, align, bw = FL_abs( ob->bw ), dy; int margin, len; switch ( event ) { case FL_ATTRIB : if ( ! ( ob->align & ~ FL_ALIGN_INSIDE ) ) ob->align = FL_ALIGN_TOP; else ob->align = fl_to_outside_lalign( ob->align ); if ( ob->align == FL_ALIGN_RIGHT ) ob->align = FL_ALIGN_RIGHT_TOP; if ( ob->align == FL_ALIGN_LEFT ) ob->align = FL_ALIGN_LEFT_TOP; break; case FL_DRAW : fl_draw_frame( ob->type, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); /* fall through */ case FL_DRAWLABEL : if ( ! ( len = strlen( ob->label ) ) ) return 0; fl_get_string_dimension( ob->lstyle, ob->lsize, ob->label, len, &sw, &sh ); align = fl_to_outside_lalign( ob->align ); sw += 8; margin = 11 + ob->w * 0.02; dy = 0; if ( ob->type == FL_ROUNDED_FRAME ) margin += 7; if ( ob->w - sw < 2 * margin ) { margin /= 2; sw -= 2; } if ( ob->w - sw < 2 * margin ) { margin /= 2; sw -= 2; } if ( ob->type == FL_UP_FRAME || ob->type == FL_DOWN_FRAME ) dy = ( bw + 1 ) / 2; switch ( align ) { case FL_ALIGN_RIGHT_TOP : case FL_ALIGN_RIGHT : sx = ob->x + ob->w - margin - sw; sy = ob->y - sh / 2 - dy; break; case FL_ALIGN_TOP : sx = ob->x + ( ob->w - sw ) / 2; sy = ob->y - sh / 2 - dy; break; case FL_ALIGN_LEFT_BOTTOM : sx = ob->x + margin; sy = ob->y + ob->h - sh / 2 + dy; break; case FL_ALIGN_RIGHT_BOTTOM : sx = ob->x + ob->w - margin - sw; sy = ob->y + ob->h - sh / 2 + dy; break; case FL_ALIGN_BOTTOM : sx = ob->x + ( ob->w - sw ) / 2; sy = ob->y + ob->h - sh / 2 + dy; break; default : sx = ob->x + margin; sy = ob->y - sh / 2 - dy; break; } fl_draw_box( FL_FLAT_BOX, sx, sy, sw, sh, ob->col2, 0 ); fl_draw_text( FL_ALIGN_CENTER, sx, sy, sw, sh, ob->lcol, ob->lstyle, ob->lsize, ob->label ); break; } return FL_RETURN_NONE; } /*************************************** ***************************************/ FL_OBJECT * fl_create_labelframe( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob; ob = fl_make_object( FL_LABELFRAME, type, x, y, w, h, label, handle_lframe ); ob->boxtype = FL_NO_BOX; ob->col1 = FL_FRAME_COL1; ob->col2 = FL_FRAME_COL2; ob->lcol = FL_FRAME_LCOL; ob->align = FL_ALIGN_LEFT_TOP; ob->active = 0; return ob; } /*************************************** ***************************************/ FL_OBJECT * fl_add_labelframe( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob = fl_create_labelframe( type, x, y, w, h, label ); fl_add_object( fl_current_form, ob ); return ob; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/include/0000775000175000017500000000000012353624652012240 500000000000000xforms-1.2.4/lib/include/slider.h0000664000175000017500000001370512353623325013615 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file slider.h * * Object Class: Slider */ #ifndef FL_SLIDER_H #define FL_SLIDER_H #define FL_HOR_FLAG 1 #define FL_SCROLL_FLAG 16 typedef enum { FL_VERT_SLIDER = 0, FL_HOR_SLIDER = FL_VERT_SLIDER | FL_HOR_FLAG, FL_VERT_FILL_SLIDER = 2, FL_HOR_FILL_SLIDER = FL_VERT_FILL_SLIDER | FL_HOR_FLAG, FL_VERT_NICE_SLIDER = 4, FL_HOR_NICE_SLIDER = FL_VERT_NICE_SLIDER | FL_HOR_FLAG, FL_VERT_BROWSER_SLIDER = 6, FL_HOR_BROWSER_SLIDER = FL_VERT_BROWSER_SLIDER | FL_HOR_FLAG, FL_VERT_PROGRESS_BAR = 8, FL_HOR_PROGRESS_BAR = FL_VERT_PROGRESS_BAR | FL_HOR_FLAG, /* The following are for use with scrollbars only! */ /* For FL_VERT_SCROLLBAR and FL_HOR_SCROLLBAR */ FL_VERT_BROWSER_SLIDER2 = FL_VERT_SLIDER | FL_SCROLL_FLAG, FL_HOR_BROWSER_SLIDER2 = FL_HOR_SLIDER | FL_SCROLL_FLAG, /* for FL_VERT_THIN_SCROLLBAR and FL_VERT_THIN_SCROLLBAR */ FL_VERT_THIN_SLIDER = FL_VERT_FILL_SLIDER | FL_SCROLL_FLAG, FL_HOR_THIN_SLIDER = FL_HOR_FILL_SLIDER | FL_SCROLL_FLAG, /* For FL_VERT_NICE_SCROLLBAR and FL_HOR_NICE_SCROLLBAR */ FL_VERT_NICE_SLIDER2 = FL_VERT_NICE_SLIDER | FL_SCROLL_FLAG, FL_HOR_NICE_SLIDER2 = FL_HOR_NICE_SLIDER | FL_SCROLL_FLAG, /* for use as FL_VERT_PLAIN_SCROLLBAR and FL_VERT_PLAIN_SCROLLBAR */ FL_VERT_BASIC_SLIDER = FL_VERT_BROWSER_SLIDER | FL_SCROLL_FLAG, FL_HOR_BASIC_SLIDER = FL_HOR_BROWSER_SLIDER | FL_SCROLL_FLAG } FL_SLIDER_TYPE; /***** Defaults *****/ #define FL_SLIDER_BW1 FL_BOUND_WIDTH #define FL_SLIDER_BW2 FL_abs( FL_BOUND_WIDTH ) #define FL_SLIDER_BOXTYPE FL_DOWN_BOX #define FL_SLIDER_COL1 FL_COL1 #define FL_SLIDER_COL2 FL_COL1 #define FL_SLIDER_LCOL FL_LCOL #define FL_SLIDER_ALIGN FL_ALIGN_BOTTOM /***** Others *****/ #define FL_SLIDER_FINE 0.25 #define FL_SLIDER_WIDTH 0.10 #define FL_SLIDER_MAX_PREC 10 /***** Routines *****/ FL_EXPORT FL_OBJECT * fl_create_slider( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_slider( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_create_valslider( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_valslider( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT void fl_set_slider_value( FL_OBJECT * ob, double val ); FL_EXPORT double fl_get_slider_value( FL_OBJECT * ob ); FL_EXPORT void fl_set_slider_bounds( FL_OBJECT * ob, double min, double max ); FL_EXPORT void fl_get_slider_bounds( FL_OBJECT * ob, double * min, double * max ); FL_EXPORT void fl_set_slider_return( FL_OBJECT * ob, unsigned int value ); FL_EXPORT void fl_set_slider_step( FL_OBJECT * ob, double value ); FL_EXPORT void fl_set_slider_increment( FL_OBJECT * ob, double l, double r ); FL_EXPORT void fl_get_slider_increment( FL_OBJECT * ob, double * l, double * r ); FL_EXPORT void fl_set_slider_size( FL_OBJECT * ob, double size ); FL_EXPORT double fl_get_slider_size( FL_OBJECT * obj ); FL_EXPORT void fl_set_slider_precision( FL_OBJECT * ob, int prec ); FL_EXPORT void fl_set_slider_filter( FL_OBJECT * ob, FL_VAL_FILTER filter ); FL_EXPORT int fl_get_slider_repeat( FL_OBJECT * obj ); FL_EXPORT void fl_set_slider_repeat( FL_OBJECT * obj, int millisec ); FL_EXPORT void fl_set_slider_mouse_buttons( FL_OBJECT * obj, unsigned int mouse_buttons ); FL_EXPORT void fl_get_slider_mouse_buttons( FL_OBJECT * obj, unsigned int * mouse_buttons ); #endif /* ! defined FL_SLIDER_H */ xforms-1.2.4/lib/include/cursor.h0000664000175000017500000000401512353623325013642 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file cursor.h * * Cursor defs and prototypes */ #ifndef FL_CURSOR_H #define FL_CURSOR_H #include enum { FL_INVISIBLE_CURSOR = -2, FL_DEFAULT_CURSOR = -1, FL_BUSY_CURSOR = XC_watch, FL_CROSSHAIR_CURSOR = XC_tcross, FL_KILL_CURSOR = XC_pirate, FL_NWARROW_CURSOR = XC_top_left_arrow, FL_NEARROW_CURSOR = XC_arrow }; #ifndef XC_invisible #define XC_invisible FL_INVISIBLE_CURSOR #endif FL_EXPORT void fl_set_cursor( Window win, int name ); FL_EXPORT void fl_set_cursor_color( int name, FL_COLOR fg, FL_COLOR bg ); FL_EXPORT int fl_create_bitmap_cursor( const char * source, const char * mask, int w, int h, int hotx, int hoty ); FL_EXPORT int fl_create_animated_cursor( int * cur_names, int timeout ); #define fl_reset_cursor( win ) fl_set_cursor( win, FL_DEFAULT_CURSOR ); #endif /* ! defined FL_CURSOR_H */ xforms-1.2.4/lib/include/Makefile.in0000664000175000017500000003656312353624173014240 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/AAA.h.in \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/common.am subdir = lib/include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = AAA.h CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(includedir)" HEADERS = $(nodist_include_HEADERS) $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FL_FIXLEVEL = @FL_FIXLEVEL@ FL_REVISION = @FL_REVISION@ FL_VERSION = @FL_VERSION@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIB = @JPEG_LIB@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ TEXI2DVI = @TEXI2DVI@ TEXI2DVI_NEEDS_PDF = @TEXI2DVI_NEEDS_PDF@ TEXI2HTML = @TEXI2HTML@ VERSION = @VERSION@ XMKMF = @XMKMF@ XPM_LIB = @XPM_LIB@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign DISTCLEANFILES = *.orig *.rej *~ *.bak core makelog MAINTAINERCLEANFILES = $(srcdir)/Makefile.in makelog AM_INSTALL_DATA_FLAGS = $(INSTALL) -m 644 -D nodist_include_HEADERS = forms.h CLEANFILES = forms.h AAA.h stamp-forms noinst_HEADERS = \ Basic.h \ XBasic.h \ popup.h \ bitmap.h \ box.h \ browser.h \ button.h \ canvas.h \ chart.h \ choice.h \ clipbd.h \ clock.h \ counter.h \ cursor.h \ dial.h \ filesys.h \ flps.h \ formbrowser.h \ frame.h \ free.h \ goodies.h \ input.h \ menu.h \ nmenu.h \ positioner.h \ scrollbar.h \ select.h \ slider.h \ spinner.h \ tabfolder.h \ text.h \ thumbwheel.h \ timer.h \ xpopup.h \ xyplot.h \ zzz.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/common.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/include/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/common.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): AAA.h: $(top_builddir)/config.status $(srcdir)/AAA.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nodist_includeHEADERS: $(nodist_include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-nodist_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-nodist_includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-nodist_includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool ctags distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-nodist_includeHEADERS \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-nodist_includeHEADERS forms.h: stamp-forms @: stamp-forms: AAA.h $(noinst_HEADERS) rm -f tmpforms sed "1,/crop here for forms/d" AAA.h > tmpforms for i in $(noinst_HEADERS); do \ sed "1,/crop here for forms/d" ${srcdir}/`basename $$i` >> tmpforms; \ done if cmp -s tmpforms forms.h ; then \ rm -f tmpforms ;\ else \ rm -f forms.h ;\ mv tmpforms forms.h ;\ fi echo timestamp > $@ # 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: xforms-1.2.4/lib/include/nmenu.h0000664000175000017500000000566212353623325013460 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ #ifndef FL_NMENU_H #define FL_NMENU_H /* Nmenu object types */ enum { FL_NORMAL_NMENU, FL_NORMAL_TOUCH_NMENU, FL_BUTTON_NMENU, FL_BUTTON_TOUCH_NMENU }; FL_EXPORT FL_OBJECT *fl_create_nmenu( int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char * ); FL_EXPORT FL_OBJECT *fl_add_nmenu( int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char * ); FL_EXPORT int fl_clear_nmenu( FL_OBJECT * ); FL_EXPORT FL_POPUP_ENTRY *fl_add_nmenu_items( FL_OBJECT *, const char *, ... ); FL_EXPORT FL_POPUP_ENTRY *fl_insert_nmenu_items( FL_OBJECT *, FL_POPUP_ENTRY *, const char *, ... ); FL_EXPORT FL_POPUP_ENTRY *fl_replace_nmenu_item( FL_OBJECT *, FL_POPUP_ENTRY *, const char *, ... ); FL_EXPORT int fl_delete_nmenu_item( FL_OBJECT *, FL_POPUP_ENTRY * ); FL_EXPORT FL_POPUP_ENTRY *fl_set_nmenu_items( FL_OBJECT *, FL_POPUP_ITEM * ); FL_EXPORT FL_POPUP_ENTRY *fl_add_nmenu_items2( FL_OBJECT *, FL_POPUP_ITEM * ); FL_EXPORT FL_POPUP_ENTRY *fl_insert_nmenu_items2( FL_OBJECT *, FL_POPUP_ENTRY *, FL_POPUP_ITEM * ); FL_EXPORT FL_POPUP_ENTRY *fl_replace_nmenu_items2( FL_OBJECT *, FL_POPUP_ENTRY *, FL_POPUP_ITEM * ); FL_EXPORT FL_POPUP *fl_get_nmenu_popup( FL_OBJECT * ); FL_EXPORT int fl_set_nmenu_popup( FL_OBJECT *, FL_POPUP * ); FL_EXPORT FL_POPUP_RETURN *fl_get_nmenu_item( FL_OBJECT * ); FL_EXPORT FL_POPUP_ENTRY *fl_get_nmenu_item_by_value( FL_OBJECT *, long int ); FL_EXPORT FL_POPUP_ENTRY *fl_get_nmenu_item_by_label( FL_OBJECT *, const char * ); FL_EXPORT FL_POPUP_ENTRY *fl_get_nmenu_item_by_text( FL_OBJECT *, const char * ); FL_EXPORT int fl_set_nmenu_policy( FL_OBJECT *, int ); FL_EXPORT FL_COLOR fl_set_nmenu_hl_text_color( FL_OBJECT *, FL_COLOR ); #endif /* ! defined FL_NMENU_H */ xforms-1.2.4/lib/include/canvas.h0000664000175000017500000001126212353623325013602 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file canvas.h * * Header for FL_CANVAS * */ #ifndef FL_CANVAS_H_ #define FL_CANVAS_H_ typedef enum { FL_NORMAL_CANVAS, FL_SCROLLED_CANVAS } FL_CANVAS_TYPE; typedef int ( * FL_HANDLE_CANVAS )( FL_OBJECT *, Window, int, int, XEvent *, void * ); typedef int ( * FL_MODIFY_CANVAS_PROP )( FL_OBJECT * ); /******************** Default *********************/ #define FL_CANVAS_BOXTYPE FL_DOWN_BOX /* really the decoration frame */ #define FL_CANVAS_ALIGN FL_ALIGN_TOP /************ Interfaces ************************/ FL_EXPORT FL_OBJECT * fl_create_generic_canvas( int canvas_class, int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_canvas( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_create_canvas( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); /* backward compatibility */ #define fl_set_canvas_decoration fl_set_object_boxtype FL_EXPORT void fl_set_canvas_colormap( FL_OBJECT * ob, Colormap colormap ); FL_EXPORT void fl_set_canvas_visual( FL_OBJECT * obj, Visual * vi ); FL_EXPORT void fl_set_canvas_depth( FL_OBJECT * obj, int depth ); FL_EXPORT void fl_set_canvas_attributes( FL_OBJECT * ob, unsigned int mask, XSetWindowAttributes * xswa ); FL_EXPORT FL_HANDLE_CANVAS fl_add_canvas_handler( FL_OBJECT * ob, int ev, FL_HANDLE_CANVAS h, void * udata ); FL_EXPORT Window fl_get_canvas_id( FL_OBJECT * ob ); FL_EXPORT Colormap fl_get_canvas_colormap( FL_OBJECT * ob ); FL_EXPORT int fl_get_canvas_depth( FL_OBJECT * obj ); FL_EXPORT void fl_remove_canvas_handler( FL_OBJECT * ob, int ev, FL_HANDLE_CANVAS h ); FL_EXPORT void fl_share_canvas_colormap( FL_OBJECT * ob, Colormap colormap ); FL_EXPORT void fl_clear_canvas( FL_OBJECT * ob ); FL_EXPORT void fl_modify_canvas_prop( FL_OBJECT * obj, FL_MODIFY_CANVAS_PROP init, FL_MODIFY_CANVAS_PROP activate, FL_MODIFY_CANVAS_PROP cleanup ); FL_EXPORT void fl_canvas_yield_to_shortcut( FL_OBJECT * ob, int yes ); /* This is an attempt to maintain some sort of backwards compatibility * with old code whilst also getting rid of the old, system-specific * hack. */ #ifdef AUTOINCLUDE_GLCANVAS_H #include #endif #endif /* ! defined FL_CANVAS_H */ xforms-1.2.4/lib/include/Basic.h0000664000175000017500000014560212353623325013356 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file Basic.h * * Basic definitions and limits. * Window system independent prototypes * * Modify with care */ #ifndef FL_BASIC_H #define FL_BASIC_H #include #include #include #include #include #include #if defined __GNUC__ #define FL_UNUSED_ARG __attribute__ ((unused)) #else #define FL_UNUSED_ARG #endif /* Some general constants */ enum { FL_ON = 1, FL_OK = 1, FL_VALID = 1, FL_PREEMPT = 1, FL_AUTO = 2, FL_WHEN_NEEDED = FL_AUTO, FL_OFF = 0, FL_CANCEL = 0, FL_INVALID = 0, /* WM_DELETE_WINDOW callback return */ FL_IGNORE = -1 }; /* Max directory length */ #ifndef FL_PATH_MAX #ifndef PATH_MAX #define FL_PATH_MAX 1024 #else #define FL_PATH_MAX PATH_MAX #endif #endif /* ! def FL_PATH_MAX */ /* The screen coordinate unit, FL_Coord, must be of signed type */ typedef int FL_Coord; #define FL_COORD FL_Coord typedef unsigned long FL_COLOR; /* Coordinates can be in pixels, milli-meters or points (1/72inch) */ typedef enum { FL_COORD_PIXEL, /* default, Pixel */ FL_COORD_MM, /* milli-meter */ FL_COORD_POINT, /* point */ FL_COORD_centiMM, /* one hundredth of a mm */ FL_COORD_centiPOINT /* one hundredth of a point */ } FL_COORD_UNIT; /* All object classes. */ typedef enum { FL_INVALID_CLASS, /* 0 */ FL_BUTTON, /* 1 */ FL_LIGHTBUTTON, /* 2 */ FL_ROUNDBUTTON, /* 3 */ FL_ROUND3DBUTTON, /* 4 */ FL_CHECKBUTTON, /* 5 */ FL_BITMAPBUTTON, /* 6 */ FL_PIXMAPBUTTON, /* 7 */ FL_BITMAP, /* 8 */ FL_PIXMAP, /* 9 */ FL_BOX, /* 10 */ FL_TEXT, /* 11 */ FL_MENU, /* 12 */ FL_CHART, /* 13 */ FL_CHOICE, /* 14 */ FL_COUNTER, /* 15 */ FL_SLIDER, /* 16 */ FL_VALSLIDER, /* 17 */ FL_INPUT, /* 18 */ FL_BROWSER, /* 19 */ FL_DIAL, /* 20 */ FL_TIMER, /* 21 */ FL_CLOCK, /* 22 */ FL_POSITIONER, /* 23 */ FL_FREE, /* 24 */ FL_XYPLOT, /* 25 */ FL_FRAME, /* 26 */ FL_LABELFRAME, /* 27 */ FL_CANVAS, /* 28 */ FL_GLCANVAS, /* 29 */ FL_TABFOLDER, /* 30 */ FL_SCROLLBAR, /* 31 */ FL_SCROLLBUTTON, /* 32 */ FL_MENUBAR, /* 33 */ FL_TEXTBOX, /* 34, for internal use only */ FL_LABELBUTTON, /* 35 */ FL_COMBOBOX, /* 36 */ FL_IMAGECANVAS, /* 37 */ FL_THUMBWHEEL, /* 38 */ FL_COLORWHEEL, /* 39 */ FL_FORMBROWSER, /* 40 */ FL_SELECT, /* 41 */ FL_NMENU, /* 42 */ FL_SPINNER, /* 43 */ FL_TBOX, /* 44 */ FL_CLASS_END /* sentinel */ } FL_CLASS; #define FL_BEGIN_GROUP 10000 #define FL_END_GROUP 20000 #define FL_USER_CLASS_START 1001 /* min. user class value */ #define FL_USER_CLASS_END 9999 /* max. user class value */ /* Maximum border width (in pixel) */ #define FL_MAX_BW 10 /* How to display a form onto screen */ typedef enum { FL_PLACE_FREE = 0, /* size remain resizable */ FL_PLACE_MOUSE = 1, /* mouse centered on form */ FL_PLACE_CENTER = 2, /* center of the screen */ FL_PLACE_POSITION = 4, /* specific position */ FL_PLACE_SIZE = 8, /* specific size */ FL_PLACE_GEOMETRY = 16, /* specific size and position */ FL_PLACE_ASPECT = 32, /* keep aspect ratio */ FL_PLACE_FULLSCREEN = 64, /* scale to fit to screen */ FL_PLACE_HOTSPOT = 128, /* so mouse fall on (x,y) */ FL_PLACE_ICONIC = 256, /* start in iconified form */ /* Modifiers */ FL_FREE_SIZE = ( 1 << 14 ), FL_FIX_SIZE = ( 1 << 15 ) /* seems to be useless, but some programs seem to rely on it... */ } FL_PLACE; #define FL_PLACE_FREE_CENTER ( FL_PLACE_CENTER | FL_FREE_SIZE ) #define FL_PLACE_CENTERFREE ( FL_PLACE_CENTER | FL_FREE_SIZE ) /* Window manager decoration request and forms attributes */ enum { FL_FULLBORDER = 1, /* normal */ FL_TRANSIENT, /* set TRANSIENT_FOR property */ FL_NOBORDER /* use override_redirect to supress decor. */ }; /* All box types */ typedef enum { FL_NO_BOX, /* 0 */ FL_UP_BOX, /* 1 */ FL_DOWN_BOX, /* 2 */ FL_BORDER_BOX, /* 3 */ FL_SHADOW_BOX, /* 4 */ FL_FRAME_BOX, /* 5 */ FL_ROUNDED_BOX, /* 6 */ FL_EMBOSSED_BOX, /* 7 */ FL_FLAT_BOX, /* 8 */ FL_RFLAT_BOX, /* 9 */ FL_RSHADOW_BOX, /* 10 */ FL_OVAL_BOX, /* 11 */ FL_ROUNDED3D_UPBOX, /* 12 */ FL_ROUNDED3D_DOWNBOX, /* 13 */ FL_OVAL3D_UPBOX, /* 14 */ FL_OVAL3D_DOWNBOX, /* 15 */ FL_OVAL3D_FRAMEBOX, /* 16 */ FL_OVAL3D_EMBOSSEDBOX, /* 17 */ /* for internal use only */ FL_TOPTAB_UPBOX, FL_SELECTED_TOPTAB_UPBOX, FL_BOTTOMTAB_UPBOX, FL_SELECTED_BOTTOMTAB_UPBOX, FL_MAX_BOX_STYLES /* sentinel */ } FL_BOX_TYPE; #define FL_IS_UPBOX( t ) ( ( t ) == FL_UP_BOX \ || ( t ) == FL_OVAL3D_UPBOX \ || ( t ) == FL_ROUNDED3D_UPBOX) #define FL_IS_DOWNBOX( t ) ( ( t ) == FL_DOWN_BOX \ || ( t ) == FL_OVAL3D_DOWNBOX \ || ( t ) == FL_ROUNDED3D_DOWNBOX) #define FL_TO_DOWNBOX( t ) ( ( t ) == FL_UP_BOX ? FL_DOWN_BOX: \ ( ( t ) == FL_ROUNDED3D_UPBOX ? \ FL_ROUNDED3D_DOWNBOX: \ ( ( t ) == FL_OVAL3D_UPBOX ? \ FL_OVAL3D_DOWNBOX : ( t ) ) ) ) /* How to place text relative to a box */ typedef enum { FL_ALIGN_CENTER, FL_ALIGN_TOP = 1, FL_ALIGN_BOTTOM = 2, FL_ALIGN_LEFT = 4, FL_ALIGN_RIGHT = 8, FL_ALIGN_LEFT_TOP = ( FL_ALIGN_TOP | FL_ALIGN_LEFT ), FL_ALIGN_RIGHT_TOP = ( FL_ALIGN_TOP | FL_ALIGN_RIGHT ), FL_ALIGN_LEFT_BOTTOM = ( FL_ALIGN_BOTTOM | FL_ALIGN_LEFT ), FL_ALIGN_RIGHT_BOTTOM = ( FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT ), FL_ALIGN_INSIDE = ( 1 << 13 ), FL_ALIGN_VERT = ( 1 << 14 ), /* not functional yet */ /* the rest is for backward compatibility only, don't use! */ FL_ALIGN_TOP_LEFT = FL_ALIGN_LEFT_TOP, FL_ALIGN_TOP_RIGHT = FL_ALIGN_RIGHT_TOP, FL_ALIGN_BOTTOM_LEFT = FL_ALIGN_LEFT_BOTTOM, FL_ALIGN_BOTTOM_RIGHT = FL_ALIGN_RIGHT_BOTTOM } FL_ALIGN; FL_EXPORT int fl_is_inside_lalign( int align ); FL_EXPORT int fl_is_outside_lalign( int align ); FL_EXPORT int fl_is_center_lalign( int align ); FL_EXPORT int fl_to_inside_lalign( int align ); FL_EXPORT int fl_to_outside_lalign( int align ); /* Mouse buttons */ enum { FL_MBUTTON1 = 1, FL_MBUTTON2, FL_MBUTTON3, FL_MBUTTON4, FL_MBUTTON5 }; #define FL_LEFT_MOUSE FL_MBUTTON1 #define FL_MIDDLE_MOUSE FL_MBUTTON2 #define FL_RIGHT_MOUSE FL_MBUTTON3 #define FL_SCROLLUP_MOUSE FL_MBUTTON4 #define FL_SCROLLDOWN_MOUSE FL_MBUTTON5 #define FL_LEFTMOUSE FL_LEFT_MOUSE #define FL_MIDDLEMOUSE FL_MIDDLE_MOUSE #define FL_RIGHTMOUSE FL_RIGHT_MOUSE #define FL_SCROLLUPMOUSE FL_SCROLLUP_MOUSE #define FL_SCROLLDOWNMOUSE FL_SCROLLDOWN_MOUSE /* Flags for when to return an object */ #define FL_RETURN_NONE 0U #define FL_RETURN_CHANGED 1U #define FL_RETURN_END 2U #define FL_RETURN_END_CHANGED 4U #define FL_RETURN_SELECTION 8U #define FL_RETURN_DESELECTION 16U #define FL_RETURN_TRIGGERED 1024U #define FL_RETURN_ALWAYS ( ~ FL_RETURN_END_CHANGED ) /* Some special color indices for FL private colormap. It does not matter * what the value of each enum is, but it must start from 0 and be * consecutive. */ typedef enum { FL_BLACK, FL_RED, FL_GREEN, FL_YELLOW, FL_BLUE, FL_MAGENTA, FL_CYAN, FL_WHITE, FL_TOMATO, FL_INDIANRED, FL_SLATEBLUE, FL_COL1, FL_RIGHT_BCOL, FL_BOTTOM_BCOL, FL_TOP_BCOL, FL_LEFT_BCOL, FL_MCOL, FL_INACTIVE, FL_PALEGREEN, FL_DARKGOLD, FL_ORCHID, FL_DARKCYAN, FL_DARKTOMATO, FL_WHEAT, FL_DARKORANGE, FL_DEEPPINK, FL_CHARTREUSE, FL_DARKVIOLET, FL_SPRINGGREEN, FL_DODGERBLUE, FL_LIGHTER_COL1, FL_DARKER_COL1, FL_ALICEBLUE, FL_ANTIQUEWHITE, FL_AQUA, FL_AQUAMARINE, FL_AZURE, FL_BEIGE, FL_BISQUE, FL_BLANCHEDALMOND, FL_BLUEVIOLET, FL_BROWN, FL_BURLYWOOD, FL_CADETBLUE, FL_CHOCOLATE, FL_CORAL, FL_CORNFLOWERBLUE, FL_CORNSILK, FL_CRIMSON, FL_DARKBLUE, FL_DARKGOLDENROD, FL_DARKGRAY, FL_DARKGREEN, FL_DARKGREY, FL_DARKKHAKI, FL_DARKMAGENTA, FL_DARKOLIVEGREEN, FL_DARKORCHID, FL_DARKRED, FL_DARKSALMON, FL_DARKSEAGREEN, FL_DARKSLATEBLUE, FL_DARKSLATEGRAY, FL_DARKSLATEGREY, FL_DARKTURQUOISE, FL_DEEPSKYBLUE, FL_DIMGRAY, FL_DIMGREY, FL_FIREBRICK, FL_FLORALWHITE, FL_FORESTGREEN, FL_FUCHSIA, FL_GAINSBORO, FL_GHOSTWHITE, FL_GOLD, FL_GOLDENROD, FL_GRAY, FL_GREENYELLOW, FL_GREY, FL_HONEYDEW, FL_HOTPINK, FL_INDIGO, FL_IVORY, FL_KHAKI, FL_LAVENDER, FL_LAVENDERBLUSH, FL_LAWNGREEN, FL_LEMONCHIFFON, FL_LIGHTBLUE, FL_LIGHTCORAL, FL_LIGHTCYAN, FL_LIGHTGOLDENRODYELLOW, FL_LIGHTGRAY, FL_LIGHTGREEN, FL_LIGHTGREY, FL_LIGHTPINK, FL_LIGHTSALMON, FL_LIGHTSEAGREEN, FL_LIGHTSKYBLUE, FL_LIGHTSLATEGRAY, FL_LIGHTSLATEGREY, FL_LIGHTSTEELBLUE, FL_LIGHTYELLOW, FL_LIME, FL_LIMEGREEN, FL_LINEN, FL_MAROON, FL_MEDIUMAQUAMARINE, FL_MEDIUMBLUE, FL_MEDIUMORCHID, FL_MEDIUMPURPLE, FL_MEDIUMSEAGREEN, FL_MEDIUMSLATEBLUE, FL_MEDIUMSPRINGGREEN, FL_MEDIUMTURQUOISE, FL_MEDIUMVIOLETRED, FL_MIDNIGHTBLUE, FL_MINTCREAM, FL_MISTYROSE, FL_MOCCASIN, FL_NAVAJOWHITE, FL_NAVY, FL_OLDLACE, FL_OLIVE, FL_OLIVEDRAB, FL_ORANGE, FL_ORANGERED, FL_PALEGOLDENROD, FL_PALETURQUOISE, FL_PALEVIOLETRED, FL_PAPAYAWHIP, FL_PEACHPUFF, FL_PERU, FL_PINK, FL_PLUM, FL_POWDERBLUE, FL_PURPLE, FL_ROSYBROWN, FL_ROYALBLUE, FL_SADDLEBROWN, FL_SALMON, FL_SANDYBROWN, FL_SEAGREEN, FL_SEASHELL, FL_SIENNA, FL_SILVER, FL_SKYBLUE, FL_SLATEGRAY, FL_SLATEGREY, FL_SNOW, FL_STEELBLUE, FL_TAN, FL_TEAL, FL_THISTLE, FL_TURQUOISE, FL_VIOLET, FL_WHITESMOKE, FL_YELLOWGREEN, FL_COLOR_CHOOSER_COLOR = 255, FL_FREE_COL1 = 256, FL_FREE_COL2, FL_FREE_COL3, FL_FREE_COL4, FL_FREE_COL5, FL_FREE_COL6, FL_FREE_COL7, FL_FREE_COL8, FL_FREE_COL9, FL_FREE_COL10, FL_FREE_COL11, FL_FREE_COL12, FL_FREE_COL13, FL_FREE_COL14, FL_FREE_COL15, FL_FREE_COL16, FL_NOCOLOR = INT_MAX } FL_PD_COL; #define FL_BUILT_IN_COLS ( FL_YELLOWGREEN + 1 ) #define FL_INACTIVE_COL FL_INACTIVE /* Some aliases for a number of colors */ #define FL_GRAY16 FL_RIGHT_BCOL #define FL_GRAY35 FL_BOTTOM_BCOL #define FL_GRAY80 FL_TOP_BCOL #define FL_GRAY90 FL_LEFT_BCOL #define FL_GRAY63 FL_COL1 #define FL_GRAY75 FL_MCOL #define FL_LCOL FL_BLACK #define FL_NoColor FL_NOCOLOR /* An alias probably for an earlier typo */ #define FL_DOGERBLUE FL_DODGERBLUE /* Events that a form reacts to */ typedef enum { FL_NOEVENT, /* 0 No event */ FL_DRAW, /* 1 object is asked to redraw itself */ FL_PUSH, /* 2 mouse button was pressed on the object */ FL_RELEASE, /* 3 mouse button was release gain */ FL_ENTER, /* 4 mouse entered the object */ FL_LEAVE, /* 5 mouse left the object */ FL_MOTION, /* 6 mouse motion over the object happend */ FL_FOCUS, /* 7 object obtained focus */ FL_UNFOCUS, /* 8 object lost focus */ FL_KEYPRESS, /* 9 key was pressed while object has focus */ FL_UPDATE, /* 10 for objects that need to update something from time to time */ FL_STEP, /* 11 */ FL_SHORTCUT, /* 12 */ FL_FREEMEM, /* 13 object is asked to free all its memory */ FL_OTHER, /* 14 property, selection etc */ FL_DRAWLABEL, /* 15 */ FL_DBLCLICK, /* 16 double click on object */ FL_TRPLCLICK, /* 17 triple click on object */ FL_ATTRIB, /* 18 an object attribute changed */ FL_KEYRELEASE, /* 19 key was released while object has focus */ FL_PS, /* 20 dump a form into EPS */ FL_MOVEORIGIN, /* 21 dragging the form across the screen changes its absolute x,y coords. Objects that themselves contain forms should ensure that they are up to date. */ FL_RESIZED, /* 22 the object has been resized by scale_form Tell it that this has happened so that it can resize any FL_FORMs that it contains. */ FL_PASTE, /* 23 text was pasted into input object */ FL_TRIGGER, /* 24 result of fl_trigger_object() */ /* The following are only for backward compatibility, not used anymore */ FL_MOVE = FL_MOTION, FL_KEYBOARD = FL_KEYPRESS, FL_MOUSE = FL_UPDATE } FL_EVENTS; /* Resize policies */ typedef enum { FL_RESIZE_NONE, FL_RESIZE_X, FL_RESIZE_Y, FL_RESIZE_ALL = ( FL_RESIZE_X | FL_RESIZE_Y ) } FL_RESIZE_T; /* Keyboard focus control */ typedef enum { FL_KEY_NORMAL = 1, /* normal keys(0-255) - tab +left/right */ FL_KEY_TAB = 2, /* normal keys + 4 direction cursor */ FL_KEY_SPECIAL = 4, /* only needs special keys (>255) */ FL_KEY_ALL = 7 /* all keys */ } FL_KEY; #define FL_ALT_MASK ( 1L << 25 ) /* alt + Key --> FL_ALT_MASK + key */ #define FL_CONTROL_MASK ( 1L << 26 ) #define FL_SHIFT_MASK ( 1L << 27 ) #define FL_ALT_VAL FL_ALT_MASK /* Don' use! */ #define MAX_SHORTCUTS 8 /* Pop-up menu item attributes. NOTE if more than 8, need to change * choice and menu class where mode is kept by a single byte */ enum { FL_PUP_NONE, FL_PUP_GREY = 1, FL_PUP_BOX = 2, FL_PUP_CHECK = 4, FL_PUP_RADIO = 8 }; #define FL_PUP_GRAY FL_PUP_GREY #define FL_PUP_TOGGLE FL_PUP_BOX /* not used anymore */ #define FL_PUP_INACTIVE FL_PUP_GREY /* Popup and menu entries */ typedef int ( * FL_PUP_CB )( int ); /* callback prototype */ typedef struct { const char * text; /* label of a popup/menu item */ FL_PUP_CB callback; /* the callback function */ const char * shortcut; /* hotkeys */ int mode; /* FL_PUP_GRAY, FL_PUP_CHECK etc */ } FL_PUP_ENTRY; #define FL_MENU_ENTRY FL_PUP_ENTRY /******************************************************************* * FONTS ******************************************************************/ #define FL_MAXFONTS 48 /* max number of fonts */ typedef enum { FL_INVALID_STYLE = -1, FL_NORMAL_STYLE, FL_BOLD_STYLE, FL_ITALIC_STYLE, FL_BOLDITALIC_STYLE, FL_FIXED_STYLE, FL_FIXEDBOLD_STYLE, FL_FIXEDITALIC_STYLE, FL_FIXEDBOLDITALIC_STYLE, FL_TIMES_STYLE, FL_TIMESBOLD_STYLE, FL_TIMESITALIC_STYLE, FL_TIMESBOLDITALIC_STYLE, FL_MISC_STYLE, FL_MISCBOLD_STYLE, FL_MISCITALIC_STYLE, FL_SYMBOL_STYLE, /* modfier masks. Need to fit a short */ FL_SHADOW_STYLE = ( 1 << 9 ), FL_ENGRAVED_STYLE = ( 1 << 10 ), FL_EMBOSSED_STYLE = ( 1 << 11 ) } FL_TEXT_STYLE; #define FL_FONT_STYLE FL_TEXT_STYLE #define special_style( a ) ( ( a ) >= FL_SHADOW_STYLE \ && ( a ) <= ( FL_EMBOSSED_STYLE + FL_MAXFONTS ) ) /* Standard sizes in XForms */ #define FL_TINY_SIZE 8 #define FL_SMALL_SIZE 10 #define FL_NORMAL_SIZE 12 #define FL_MEDIUM_SIZE 14 #define FL_LARGE_SIZE 18 #define FL_HUGE_SIZE 24 #define FL_DEFAULT_SIZE FL_SMALL_SIZE /* Defines for compatibility */ #define FL_TINY_FONT FL_TINY_SIZE #define FL_SMALL_FONT FL_SMALL_SIZE #define FL_NORMAL_FONT FL_NORMAL_SIZE #define FL_MEDIUM_FONT FL_MEDIUM_SIZE #define FL_LARGE_FONT FL_LARGE_SIZE #define FL_HUGE_FONT FL_HUGE_SIZE #define FL_NORMAL_FONT1 FL_SMALL_FONT #define FL_NORMAL_FONT2 FL_NORMAL_FONT #define FL_DEFAULT_FONT FL_SMALL_FONT #define FL_BOUND_WIDTH ( FL_Coord ) 1 /* Border width of boxes */ /* Definition of basic struct that holds an object */ #define FL_CLICK_TIMEOUT 400 /* double click interval */ typedef struct FL_FORM_ FL_FORM; typedef struct FL_OBJECT_ FL_OBJECT; typedef struct FL_pixmap_ FL_pixmap; struct FL_OBJECT_ { FL_FORM * form; /* the form this object belongs to */ void * u_vdata; /* anything the user likes */ char * u_cdata; /* anything the user likes */ long u_ldata; /* anything the user likes */ int objclass; /* class of object, button, slider etc */ int type; /* type within the class */ int boxtype; /* what kind of box type */ FL_Coord x, /* current obj. location and size */ y, w, h; double fl1, /* distances of upper left hand (1) and */ fr1, /* lower right hand corner (2) to left, */ ft1, /* right, top and bottom of enclosing */ fb1, /* form */ fl2, fr2, ft2, fb2; FL_Coord bw; FL_COLOR col1, /* colors of obj */ col2; char * label; /* object label */ FL_COLOR lcol; /* label color */ int align; int lsize, /* label size and style */ lstyle; long * shortcut; int ( * handle )( FL_OBJECT *, int, FL_Coord, FL_Coord, int, void * ); void ( * object_callback )( FL_OBJECT *, long ); long argument; void * spec; /* instantiation */ int ( * prehandle )( FL_OBJECT *, int, FL_Coord, FL_Coord, int, void * ); int ( * posthandle )( FL_OBJECT *, int, FL_Coord, FL_Coord, int, void * ); void ( * set_return )( FL_OBJECT *, unsigned int ); /* Re-configure preference */ unsigned int resize; /* what to do if WM resizes the FORM */ unsigned int nwgravity; /* how to re-position top-left corner */ unsigned int segravity; /* how to re-position lower-right corner */ FL_OBJECT * prev; /* prev. obj in form */ FL_OBJECT * next; /* next. obj in form */ FL_OBJECT * parent; FL_OBJECT * child; FL_OBJECT * nc; /* next child */ FL_pixmap * flpixmap; /* pixmap double buffering stateinfo */ int use_pixmap; /* true to use pixmap double buffering*/ /* Some interaction flags */ int returned; /* what last interaction returned */ unsigned int how_return; /* under which conditions to return */ int double_buffer; /* only used by mesa/gl canvas */ int pushed; int focus; int belowmouse; int active; /* if object accepts events */ int input; int wantkey; int radio; int automatic; int redraw; int visible; int is_under; /* if (partially) hidden by other object */ int clip; unsigned long click_timeout; void * c_vdata; /* for class use */ char * c_cdata; /* for class use */ long c_ldata; /* for class use */ FL_COLOR dbl_background; /* double buffer background */ char * tooltip; int tipID; int group_id; int want_motion; int want_update; }; /* Callback function for an entire form */ typedef void ( * FL_FORMCALLBACKPTR )( FL_OBJECT *, void * ); /* Object callback function */ typedef void ( * FL_CALLBACKPTR )( FL_OBJECT *, long ); /* Preemptive callback function */ typedef int ( * FL_RAW_CALLBACK )( FL_FORM *, void * ); /* At close (WM menu delete/close etc.) function */ typedef int ( * FL_FORM_ATCLOSE )( FL_FORM *, void * ); /* Deactivate/activate callback */ typedef void ( * FL_FORM_ATDEACTIVATE )( FL_FORM *, void * ); typedef void ( * FL_FORM_ATACTIVATE )( FL_FORM *, void * ); typedef int ( * FL_HANDLEPTR )( FL_OBJECT *, int, FL_Coord, FL_Coord, int, void * ); /* Error callback */ typedef void ( * FL_ERROR_FUNC )( const char *, const char *, ... ); FL_EXPORT FL_OBJECT *FL_EVENT; /*** FORM ****/ /* Form visibility state: form->visible */ enum { FL_BEING_HIDDEN = -1, FL_HIDDEN = 0, FL_INVISIBLE = FL_HIDDEN, FL_VISIBLE = 1 }; struct FL_FORM_ { void * fdui; /* for fdesign */ void * u_vdata; /* for application */ char * u_cdata; /* for application */ long u_ldata; /* for application */ char * label; /* window title */ Window window; /* X resource ID for window */ FL_Coord x, /* current geometry info */ y, w, h; int handle_dec_x, handle_dec_y; FL_Coord hotx, /* hot-spot of the form */ hoty; double w_hr, /* high resolution width and height */ h_hr; /* (needed for precise scaling) */ FL_OBJECT * first; FL_OBJECT * last; FL_OBJECT * focusobj; FL_FORMCALLBACKPTR form_callback; FL_FORM_ATACTIVATE activate_callback; FL_FORM_ATDEACTIVATE deactivate_callback; void * form_cb_data; void * activate_data; void * deactivate_data; FL_RAW_CALLBACK key_callback; FL_RAW_CALLBACK push_callback; FL_RAW_CALLBACK crossing_callback; FL_RAW_CALLBACK motion_callback; FL_RAW_CALLBACK all_callback; unsigned long compress_mask; unsigned long evmask; /* WM_DELETE_WINDOW message handler */ FL_FORM_ATCLOSE close_callback; void * close_data; FL_pixmap * flpixmap; /* back buffer */ Pixmap icon_pixmap; Pixmap icon_mask; /* Interaction and other flags */ int deactivated; /* non-zero if deactivated */ int use_pixmap; /* true if dbl buffering */ int frozen; /* true if sync change */ int visible; /* true if mapped */ int wm_border; /* window manager info */ unsigned int prop; /* other attributes */ int num_auto_objects; int needs_full_redraw; int sort_of_modal; /* internal use */ FL_FORM * parent; FL_FORM * child; FL_OBJECT * parent_obj; int attached; /* not independent anymore */ void ( * pre_attach )( FL_FORM * ); void * attach_data; int in_redraw; }; /* All FD_xxx structure emitted by fdesign contains at least the * following */ typedef struct { FL_FORM * form; void * vdata; char * cdata; long ldata; } FD_Any; /* Async IO stuff */ enum { FL_READ = 1, FL_WRITE = 2, FL_EXCEPT = 4 }; /* IO other than XEvent Q */ typedef void ( * FL_IO_CALLBACK )( int, void * ); FL_EXPORT void fl_add_io_callback( int fd, unsigned int mask, FL_IO_CALLBACK callback, void * data ); FL_EXPORT void fl_remove_io_callback( int fd, unsigned int mask, FL_IO_CALLBACK cb ); /* signals */ typedef void ( * FL_SIGNAL_HANDLER )( int, void * ); FL_EXPORT void fl_add_signal_callback( int s, FL_SIGNAL_HANDLER cb, void * data ); FL_EXPORT void fl_remove_signal_callback( int s ); FL_EXPORT void fl_signal_caught( int s ); FL_EXPORT void fl_app_signal_direct( int y ); enum { FL_INPUT_END_EVENT_CLASSIC = 0, FL_INPUT_END_EVENT_ALWAYS = 1 }; FL_EXPORT int fl_input_end_return_handling( int type ); /* Timeouts */ typedef void (* FL_TIMEOUT_CALLBACK )( int, void * ); FL_EXPORT int fl_add_timeout( long msec, FL_TIMEOUT_CALLBACK callback, void * data ); FL_EXPORT void fl_remove_timeout( int id ); /* Basic public routine prototypes */ FL_EXPORT int fl_library_version( int * ver, int * rev ); FL_EXPORT long fl_library_full_version( int * version, int * revision, int * fix_level, const char ** extra ); /** Generic routines that deal with FORMS **/ FL_EXPORT FL_FORM * fl_bgn_form( int type, FL_Coord w, FL_Coord h ); FL_EXPORT void fl_end_form( void ); FL_EXPORT FL_OBJECT * fl_do_forms( void ); FL_EXPORT FL_OBJECT * fl_check_forms( void ); FL_EXPORT FL_OBJECT * fl_do_only_forms( void ); FL_EXPORT FL_OBJECT * fl_check_only_forms( void ); FL_EXPORT void fl_freeze_form( FL_FORM * form ); FL_EXPORT void fl_set_focus_object( FL_FORM * form, FL_OBJECT * obj ); FL_EXPORT FL_OBJECT *fl_get_focus_object( FL_FORM * form ); FL_EXPORT void fl_reset_focus_object( FL_OBJECT * ob ); #define fl_set_object_focus fl_set_focus_object FL_EXPORT FL_FORM_ATCLOSE fl_set_form_atclose( FL_FORM * form, FL_FORM_ATCLOSE fmclose, void * data ); FL_EXPORT FL_FORM_ATCLOSE fl_set_atclose( FL_FORM_ATCLOSE fmclose, void * data ); FL_EXPORT FL_FORM_ATACTIVATE fl_set_form_atactivate( FL_FORM * form, FL_FORM_ATACTIVATE cb, void * data ); FL_EXPORT FL_FORM_ATDEACTIVATE fl_set_form_atdeactivate( FL_FORM * form, FL_FORM_ATDEACTIVATE cb, void * data ); FL_EXPORT void fl_unfreeze_form( FL_FORM * form ); FL_EXPORT int fl_form_is_activated( FL_FORM * form ); FL_EXPORT void fl_deactivate_form( FL_FORM * form ); FL_EXPORT void fl_activate_form( FL_FORM * form ); FL_EXPORT void fl_deactivate_all_forms( void ); FL_EXPORT void fl_activate_all_forms( void ); FL_EXPORT void fl_freeze_all_forms( void ); FL_EXPORT void fl_unfreeze_all_forms( void ); FL_EXPORT void fl_scale_form( FL_FORM * form, double xsc, double ysc ); FL_EXPORT void fl_set_form_position( FL_FORM * form, FL_Coord x, FL_Coord y ); FL_EXPORT void fl_set_form_title( FL_FORM * form, const char * name ); FL_EXPORT void fl_set_form_title_f( FL_FORM * form, const char * fmt, ... ); FL_EXPORT void fl_set_app_mainform( FL_FORM * form ); FL_EXPORT FL_FORM * fl_get_app_mainform( void ); FL_EXPORT void fl_set_app_nomainform( int flag ); FL_EXPORT void fl_set_form_callback( FL_FORM * form, FL_FORMCALLBACKPTR callback, void * d ); #define fl_set_form_call_back fl_set_form_callback FL_EXPORT void fl_set_form_size( FL_FORM * form, FL_Coord w, FL_Coord h ); FL_EXPORT void fl_set_form_background_color( FL_FORM * form, FL_COLOR color ); FL_EXPORT FL_COLOR fl_get_form_background_color( FL_FORM * form ); FL_EXPORT void fl_set_form_hotspot( FL_FORM * form, FL_Coord x, FL_Coord y ); FL_EXPORT void fl_set_form_hotobject( FL_FORM * form, FL_OBJECT * ob ); FL_EXPORT void fl_set_form_minsize( FL_FORM * form, FL_Coord w, FL_Coord h ); FL_EXPORT void fl_set_form_maxsize( FL_FORM * form, FL_Coord w, FL_Coord h ); FL_EXPORT void fl_set_form_event_cmask( FL_FORM * form, unsigned long cmask ); FL_EXPORT unsigned long fl_get_form_event_cmask( FL_FORM * form ); FL_EXPORT void fl_set_form_geometry( FL_FORM * form, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h ); #define fl_set_initial_placement fl_set_form_geometry FL_EXPORT Window fl_show_form( FL_FORM * form, int place, int border, const char * name ); FL_EXPORT Window fl_show_form_f( FL_FORM * form, int place, int border, const char * fmt, ... ); FL_EXPORT void fl_hide_form( FL_FORM * form ); FL_EXPORT void fl_free_form( FL_FORM * form ); FL_EXPORT void fl_redraw_form( FL_FORM * form ); FL_EXPORT void fl_set_form_dblbuffer( FL_FORM * form, int y ); FL_EXPORT Window fl_prepare_form_window( FL_FORM * form, int place, int border, const char * name ); FL_EXPORT Window fl_prepare_form_window_f( FL_FORM * form, int place, int border, const char * fmt, ... ); FL_EXPORT Window fl_show_form_window( FL_FORM * form ); FL_EXPORT double fl_adjust_form_size( FL_FORM * form ); FL_EXPORT int fl_form_is_visible( FL_FORM * form ); FL_EXPORT int fl_form_is_iconified( FL_FORM * form ); FL_EXPORT FL_RAW_CALLBACK fl_register_raw_callback( FL_FORM * form, unsigned long mask, FL_RAW_CALLBACK rcb ); #define fl_register_call_back fl_register_raw_callback FL_EXPORT FL_OBJECT * fl_bgn_group( void ); FL_EXPORT void fl_end_group( void ); FL_EXPORT FL_OBJECT *fl_addto_group( FL_OBJECT * group ); /****** Routines that deal with FL_OBJECTS ********/ FL_EXPORT int fl_get_object_objclass( FL_OBJECT * obj ); FL_EXPORT int fl_get_object_type( FL_OBJECT * obj ); FL_EXPORT void fl_set_object_boxtype( FL_OBJECT * ob, int boxtype ); FL_EXPORT int fl_get_object_boxtype( FL_OBJECT * obj ); FL_EXPORT void fl_set_object_bw( FL_OBJECT * ob, int bw ); FL_EXPORT int fl_get_object_bw( FL_OBJECT * ob ); FL_EXPORT void fl_set_object_resize( FL_OBJECT * ob, unsigned int what ); FL_EXPORT void fl_get_object_resize( FL_OBJECT * ob, unsigned int * what ); FL_EXPORT void fl_set_object_gravity( FL_OBJECT * ob, unsigned int nw, unsigned int se ); FL_EXPORT void fl_get_object_gravity( FL_OBJECT * ob, unsigned int * nw, unsigned int * se ); FL_EXPORT void fl_set_object_lsize( FL_OBJECT * obj, int lsize ); FL_EXPORT int fl_get_object_lsize( FL_OBJECT * obj ); FL_EXPORT void fl_set_object_lstyle( FL_OBJECT * obj, int lstyle ); FL_EXPORT int fl_get_object_lstyle( FL_OBJECT * obj ); FL_EXPORT void fl_set_object_lcol( FL_OBJECT * ob, FL_COLOR lcol ); FL_EXPORT FL_COLOR fl_get_object_lcol( FL_OBJECT * obj ); FL_EXPORT int fl_set_object_return( FL_OBJECT * ob, unsigned int when ); FL_EXPORT void fl_set_object_lalign( FL_OBJECT * obj, int align ); FL_EXPORT int fl_get_object_lalign( FL_OBJECT * obj ); FL_EXPORT void fl_set_object_shortcut( FL_OBJECT * obj, const char * sstr, int showit ); FL_EXPORT void fl_set_object_shortcutkey( FL_OBJECT * obj, unsigned int keysym ); FL_EXPORT void fl_set_object_dblbuffer( FL_OBJECT * ob, int y ); FL_EXPORT void fl_set_object_color( FL_OBJECT * ob, FL_COLOR col1, FL_COLOR col2 ); FL_EXPORT void fl_get_object_color( FL_OBJECT * obj, FL_COLOR * col1, FL_COLOR * col2 ); FL_EXPORT void fl_set_object_label( FL_OBJECT * ob, const char * label ); FL_EXPORT void fl_set_object_label_f( FL_OBJECT * obj, const char * fmt, ... ); FL_EXPORT const char * fl_get_object_label( FL_OBJECT * obj ); FL_EXPORT void fl_set_object_helper( FL_OBJECT * ob, const char * tip ); FL_EXPORT void fl_set_object_helper_f( FL_OBJECT * ob, const char * fmt, ... ); FL_EXPORT void fl_set_object_position( FL_OBJECT * obj, FL_Coord x, FL_Coord y ); FL_EXPORT void fl_get_object_size( FL_OBJECT * obj, FL_Coord * w, FL_Coord * h ); FL_EXPORT void fl_set_object_size( FL_OBJECT * obj, FL_Coord w, FL_Coord h ); FL_EXPORT void fl_set_object_automatic( FL_OBJECT * obj, int flag ); FL_EXPORT int fl_object_is_automatic( FL_OBJECT * obj ); FL_EXPORT void fl_draw_object_label( FL_OBJECT * ob ); FL_EXPORT void fl_draw_object_label_outside( FL_OBJECT * ob ); FL_EXPORT FL_OBJECT * fl_get_object_component( FL_OBJECT * composite, int objclass, int type, int numb ); FL_EXPORT void fl_for_all_objects( FL_FORM * form, int ( * cb )( FL_OBJECT *, void * ), void * v ); #define fl_draw_object_outside_label fl_draw_object_label_outside FL_EXPORT void fl_set_object_dblclick( FL_OBJECT * obj, unsigned long timeout ); FL_EXPORT unsigned long fl_get_object_dblclick( FL_OBJECT * obj ); FL_EXPORT void fl_set_object_geometry( FL_OBJECT * obj, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h ); FL_EXPORT void fl_move_object( FL_OBJECT * obj, FL_Coord dx, FL_Coord dy ); #define fl_set_object_lcolor fl_set_object_lcol #define fl_get_object_lcolor fl_get_object_lcol FL_EXPORT void fl_fit_object_label( FL_OBJECT * obj, FL_Coord xmargin, FL_Coord ymargin ); FL_EXPORT void fl_get_object_geometry( FL_OBJECT * ob, FL_Coord * x, FL_Coord * y, FL_Coord * w, FL_Coord * h ); FL_EXPORT void fl_get_object_position( FL_OBJECT * ob, FL_Coord * x, FL_Coord * y ); /* This one takes into account the label */ FL_EXPORT void fl_get_object_bbox( FL_OBJECT * obj, FL_Coord * x, FL_Coord * y, FL_Coord * w, FL_Coord * h ); #define fl_compute_object_geometry fl_get_object_bbox FL_EXPORT void fl_call_object_callback( FL_OBJECT * ob ); FL_EXPORT FL_HANDLEPTR fl_set_object_prehandler( FL_OBJECT * ob, FL_HANDLEPTR phandler ); FL_EXPORT FL_HANDLEPTR fl_set_object_posthandler( FL_OBJECT * ob, FL_HANDLEPTR post ); FL_EXPORT FL_CALLBACKPTR fl_set_object_callback( FL_OBJECT * obj, FL_CALLBACKPTR callback, long argument ); #define fl_set_object_align fl_set_object_lalign #define fl_set_call_back fl_set_object_callback FL_EXPORT void fl_redraw_object( FL_OBJECT * obj ); FL_EXPORT void fl_show_object( FL_OBJECT * ob ); FL_EXPORT void fl_hide_object( FL_OBJECT * ob ); FL_EXPORT int fl_object_is_visible( FL_OBJECT * obj ); FL_EXPORT void fl_free_object( FL_OBJECT * obj ); FL_EXPORT void fl_delete_object( FL_OBJECT * obj ); FL_EXPORT int fl_get_object_return_state( FL_OBJECT *obj ); FL_EXPORT void fl_trigger_object( FL_OBJECT * obj ); FL_EXPORT void fl_activate_object( FL_OBJECT * ob ); FL_EXPORT void fl_deactivate_object( FL_OBJECT * ob ); FL_EXPORT int fl_object_is_active( FL_OBJECT * obj ); FL_EXPORT int fl_enumerate_fonts( void ( * output )( const char * s ), int shortform ); FL_EXPORT int fl_set_font_name( int n, const char * name ); FL_EXPORT int fl_set_font_name_f( int n, const char * fmt, ... ); FL_EXPORT const char * fl_get_font_name( int n ); FL_EXPORT void fl_set_font( int numb, int size ); /* Routines that facilitate free object */ FL_EXPORT int fl_get_char_height( int style, int size, int * asc, int * desc ); FL_EXPORT int fl_get_char_width( int style, int size ); FL_EXPORT int fl_get_string_height( int style, int size, const char * s, int len, int * asc, int * desc ); FL_EXPORT int fl_get_string_width( int style, int size, const char * s, int len ); FL_EXPORT int fl_get_string_widthTAB( int style, int size, const char * s, int len ); FL_EXPORT void fl_get_string_dimension( int fntstyle, int fntsize, const char * s, int len, int * width, int * height ); #define fl_get_string_size fl_get_string_dimension FL_EXPORT void fl_get_align_xy( int align, int x, int y, int w, int h, int xsize, int ysize, int xoff, int yoff, int * xx, int * yy ); FL_EXPORT int fl_get_label_char_at_mouse( FL_OBJECT * obj ); #define fl_drw_text fl_draw_text FL_EXPORT void fl_draw_text( int align, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR c, int style, int size, const char * istr ); #define fl_drw_text_beside fl_draw_text_beside FL_EXPORT void fl_draw_text_beside( int align, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR c, int style, int size, const char * str ); #define fl_drw_text_cursor fl_draw_text_cursor FL_EXPORT void fl_draw_text_cursor( int align, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR c, int style, int size, const char * str, FL_COLOR cc, int pos ); #define fl_draw_box fl_draw_box FL_EXPORT void fl_draw_box( int style, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR c, int bw_in ); typedef void ( * FL_DRAWPTR )( FL_Coord, FL_Coord, FL_Coord, FL_Coord, int, FL_COLOR); FL_EXPORT int fl_add_symbol( const char * name, FL_DRAWPTR drawit, int scalable ); FL_EXPORT int fl_delete_symbol( const char * name ); FL_EXPORT int fl_draw_symbol( const char * label, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col ); FL_EXPORT unsigned long fl_mapcolor( FL_COLOR col, int r, int g, int b ); FL_EXPORT long fl_mapcolorname( FL_COLOR col, const char * name ); #define fl_mapcolor_name fl_mapcolorname FL_EXPORT void fl_free_colors( FL_COLOR * c, int n ); FL_EXPORT void fl_free_pixels( unsigned long * pix, int n ); FL_EXPORT void fl_set_color_leak( int y ); FL_EXPORT unsigned long fl_getmcolor( FL_COLOR i, int * r, int * g, int * b ); FL_EXPORT unsigned long fl_get_pixel( FL_COLOR col ); #define fl_get_flcolor fl_get_pixel FL_EXPORT void fl_get_icm_color( FL_COLOR col, int * r, int * g, int * b ); FL_EXPORT void fl_set_icm_color( FL_COLOR col, int r, int g, int b ); FL_EXPORT void fl_color( FL_COLOR col ); FL_EXPORT void fl_bk_color( FL_COLOR col ); FL_EXPORT void fl_set_gamma( double r, double g, double b ); FL_EXPORT void fl_show_errors( int y ); /* Some macros */ #define FL_max( a, b ) ( ( a ) > ( b ) ? ( a ) : ( b ) ) #define FL_min( a, b ) ( ( a ) < ( b ) ? ( a ) : ( b ) ) #define FL_abs( a ) ( ( a ) > 0 ? ( a ) : ( - ( a ) ) ) #define FL_nint( a ) ( ( int ) ( ( a ) > 0 ? \ ( ( a ) + 0.5 ) : \ ( ( a ) - 0.5 ) ) ) #define FL_nlong( a ) ( ( long ) ( ( a ) > 0 ? \ ( ( a ) + 0.5 ) : \ ( ( a ) - 0.5 ) ) ) #define FL_clamp( a, amin, amax ) ( ( a ) < ( amin ) ? \ ( amin ) : ( ( a ) > ( amax ) ? \ ( amax ) : ( a ) ) ) #define FL_crnd( a ) ( ( FL_Coord ) ( ( a ) > 0 ? \ ( ( a ) + 0.5 ) : \ ( ( a ) - 0.5 ) ) ) typedef int ( * FL_FSCB )( const char *, void * ); /* Utilities for new objects */ FL_EXPORT FL_FORM *fl_current_form; FL_EXPORT void fl_add_object( FL_FORM * form, FL_OBJECT * obj ); FL_EXPORT FL_FORM *fl_addto_form( FL_FORM * form ); FL_EXPORT FL_OBJECT * fl_make_object( int objclass, int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label, FL_HANDLEPTR handle ); FL_EXPORT void fl_add_child( FL_OBJECT *, FL_OBJECT * ); FL_EXPORT void fl_set_coordunit( int u ); FL_EXPORT void fl_set_border_width( int bw ); FL_EXPORT void fl_set_scrollbar_type( int t ); #define fl_set_thinscrollbar( t ) \ fl_set_scrollbar_type( t ? FL_THIN_SCROLLBAR : FL_NORMAL_SCROLLBAR ) FL_EXPORT void fl_flip_yorigin( void ); FL_EXPORT int fl_get_coordunit( void ); FL_EXPORT int fl_get_border_width( void ); /* Misc. routines */ FL_EXPORT void fl_ringbell( int percent ); FL_EXPORT void fl_gettime( long * sec, long * usec ); FL_EXPORT const char * fl_now( void ); FL_EXPORT const char * fl_whoami( void ); FL_EXPORT long fl_mouse_button( void ); FL_EXPORT int fl_current_event( void ); FL_EXPORT char * fl_strdup( const char * s ); FL_EXPORT void fl_set_err_logfp( FILE * fp ); FL_EXPORT void fl_set_error_handler( FL_ERROR_FUNC user_func ); FL_EXPORT char ** fl_get_cmdline_args( int * ); /* This function was called 'fl_set_error_logfp/' in XForms 0.89. */ #define fl_set_error_logfp fl_set_err_logfp #define fl_mousebutton fl_mouse_button /* These give more flexibility for future changes. Also application * can re-assign these pointers to whatever function it wants, e.g., * to a shared memory pool allocator. */ FL_EXPORT void ( * fl_free )( void * ); FL_EXPORT void * ( * fl_malloc )( size_t ); FL_EXPORT void * ( * fl_calloc )( size_t, size_t ); FL_EXPORT void * ( * fl_realloc )( void *, size_t ); FL_EXPORT int fl_msleep( unsigned long msec ); #define FL_MAX_MENU_CHOICE_ITEMS 128 typedef const char * ( * FL_VAL_FILTER )( FL_OBJECT *, double, int ); FL_EXPORT int fl_is_same_object( FL_OBJECT * obj1, FL_OBJECT * obj2 ); #endif /* ! defined FL_BASIC_H */ xforms-1.2.4/lib/include/spinner.h0000664000175000017500000000520212353623325014002 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ #ifndef FL_SPINNER_H #define FL_SPINNER_H typedef enum { FL_INT_SPINNER, FL_FLOAT_SPINNER } FL_SPINNER_TYPE; FL_EXPORT FL_OBJECT * fl_create_spinner( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_spinner( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT double fl_get_spinner_value( FL_OBJECT * obj ); FL_EXPORT double fl_set_spinner_value( FL_OBJECT * obj, double val ); FL_EXPORT void fl_set_spinner_bounds( FL_OBJECT * obj, double min, double max ); FL_EXPORT void fl_get_spinner_bounds( FL_OBJECT * obj, double * min, double * max ); FL_EXPORT void fl_set_spinner_step( FL_OBJECT * obj, double step ); FL_EXPORT double fl_get_spinner_step( FL_OBJECT * obj ); FL_EXPORT void fl_set_spinner_precision( FL_OBJECT * obj, int prec ); FL_EXPORT int fl_get_spinner_precision( FL_OBJECT * obj ); FL_EXPORT FL_OBJECT * fl_get_spinner_input( FL_OBJECT * obj ); FL_EXPORT FL_OBJECT * fl_get_spinner_up_button( FL_OBJECT * obj ); FL_EXPORT FL_OBJECT * fl_get_spinner_down_button( FL_OBJECT * obj ); #endif /* ! defined FL_SPINNER_H */ xforms-1.2.4/lib/include/select.h0000664000175000017500000001051212353623325013603 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file select.h */ #ifndef FL_SELECT_H #define FL_SELECT_H /* Select object types */ enum { FL_NORMAL_SELECT, FL_MENU_SELECT, FL_DROPLIST_SELECT }; /* Defaults */ #define FL_SELECT_COL1 FL_COL1 #define FL_SELECT_COL2 FL_MCOL #define FL_SELECT_LCOL FL_LCOL #define FL_SELECT_ALIGN FL_ALIGN_LEFT FL_EXPORT FL_OBJECT *fl_create_select( int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char * ); FL_EXPORT FL_OBJECT *fl_add_select( int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, const char * ); FL_EXPORT int fl_clear_select( FL_OBJECT * ); FL_EXPORT FL_POPUP_ENTRY *fl_add_select_items( FL_OBJECT *, const char *, ... ); FL_EXPORT FL_POPUP_ENTRY *fl_insert_select_items( FL_OBJECT *, FL_POPUP_ENTRY *, const char *, ... ); FL_EXPORT FL_POPUP_ENTRY *fl_replace_select_item( FL_OBJECT *, FL_POPUP_ENTRY *, const char *, ... ); FL_EXPORT int fl_delete_select_item( FL_OBJECT *, FL_POPUP_ENTRY * ); FL_EXPORT long fl_set_select_items( FL_OBJECT *, FL_POPUP_ITEM * ); FL_EXPORT FL_POPUP *fl_get_select_popup( FL_OBJECT * ); FL_EXPORT int fl_set_select_popup( FL_OBJECT *, FL_POPUP * ); FL_EXPORT FL_POPUP_RETURN *fl_get_select_item( FL_OBJECT * ); FL_EXPORT FL_POPUP_RETURN *fl_set_select_item( FL_OBJECT *, FL_POPUP_ENTRY * ); FL_EXPORT FL_POPUP_ENTRY *fl_get_select_item_by_value( FL_OBJECT *, long ); FL_EXPORT FL_POPUP_ENTRY *fl_get_select_item_by_label( FL_OBJECT *, const char * ); FL_EXPORT FL_POPUP_ENTRY * fl_get_select_item_by_label_f( FL_OBJECT *, const char *, ... ); FL_EXPORT FL_POPUP_ENTRY * fl_get_select_item_by_text_f( FL_OBJECT * obj, const char * fmt, ... ); FL_EXPORT FL_POPUP_ENTRY *fl_get_select_item_by_text( FL_OBJECT *, const char * ); FL_EXPORT FL_COLOR fl_get_select_text_color( FL_OBJECT * ); FL_EXPORT FL_COLOR fl_set_select_text_color( FL_OBJECT *, FL_COLOR ); FL_EXPORT int fl_get_select_text_font( FL_OBJECT *, int *, int * ); FL_EXPORT int fl_set_select_text_font( FL_OBJECT *, int, int ); FL_EXPORT int fl_get_select_text_align( FL_OBJECT * ); FL_EXPORT int fl_set_select_text_align( FL_OBJECT *, int ); FL_EXPORT int fl_set_select_policy( FL_OBJECT *, int ); #endif /* ! defined FL_SELECT_H */ xforms-1.2.4/lib/include/AAA.h.in0000664000175000017500000000527212353623325013322 00000000000000/* There has to be at least one line preceding the next one*/ /********************** crop here for forms.h **********************/ /* * * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file forms.h * *. All XForms files as distributed in this package are * Copyright(c) 1996-2002 by T.C. Zhao and Mark Overmars, * with part of the code Copyright (c) 1999-2002 by T.C. Zhao * and Steve Lamont. * ALL RIGHTS RESERVED. * * Permission to use, copy, and distribute this software in its entirety * without fee, is hereby granted, provided that the above copyright * notice and this permission notice appear in all copies and their * documentation. * * As of April 2002, xforms is released under the GNU LGPL license. * You can use xforms for any purpose that's compatible with * LGPL with the restriction that you will need a special license * for distributed binary commercial software that requires or is * based on xforms or its derivative. * * This software is provided "as is" without expressed or implied * warranty of any kind. * * The homepage for XForms is at * https://savannah.nongnu.org/projects/xforms/ * * If you have questions about XForms or encounter problems please * subscribe to the mailing list at * http://cweblog.usuhs.mil/mailman/listinfo/xforms * * ******** This file is generated automatically. DO NOT CHANGE ********* */ #ifndef FL_FORMS_H #define FL_FORMS_H #define FL_VERSION @FL_VERSION@ #define FL_REVISION @FL_REVISION@ #define FL_FIXLEVEL "@FL_FIXLEVEL@" #define FL_INCLUDE_VERSION ( FL_VERSION * 1000 + FL_REVISION ) #include #include #include #include #if defined __cplusplus extern "C" { #endif #if defined _WIN32 #define FL_WIN32 #include #endif #if ! defined FL_WIN32 || ! defined SHARED_LIB #define FL_EXPORT extern #else #ifdef MAKING_FORMS #define FL_EXPORT __declspec( dllexport ) extern #else #define FL_EXPORT __declspec( dllimport ) extern #endif /* MAKING_FORMS */ #endif /* FL_WIN32 */ xforms-1.2.4/lib/include/popup.h0000664000175000017500000003131712353623325013475 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ #ifndef FL_POPUP_H #define FL_POPUP_H typedef struct FL_POPUP_ FL_POPUP; typedef struct FL_POPUP_ENTRY_ FL_POPUP_ENTRY; typedef struct FL_POPUP_RETURN_ FL_POPUP_RETURN; typedef int ( * FL_POPUP_CB )( FL_POPUP_RETURN * ); struct FL_POPUP_RETURN_ { long int val; /* value assigned to popup entry */ void * user_data; /* pointer to user data */ const char * text; /* text of the selected popup entry */ const char * label; /* left-flushed label part */ const char * accel; /* right-flushed label part */ const FL_POPUP_ENTRY * entry; /* pointer to selected popup entry */ const FL_POPUP * popup; /* popup we're called for */ }; struct FL_POPUP_ { FL_POPUP * next; /* next in linked list */ FL_POPUP * prev; /* previous in linked list */ FL_POPUP * parent; /* for sub-popups: direct parent */ FL_POPUP * top_parent; /* and top-most parent */ FL_POPUP_ENTRY * entries; /* pointer to list of entries */ char * title; Window win; /* popup window */ Window parent_win; /* parent window of popup window */ Cursor cursor; /* cursor for the popup */ FL_POPUP_CB callback; int use_req_pos; /* if set use req_x, req_y */ int req_x, req_y; int x, /* position of popup window */ y; unsigned int w, /* dimensions of popup window */ h; int min_width; /* minimum width of popup */ int title_box_x, /* position of title box */ title_box_y; unsigned int title_box_w, /* dimensions of title box */ title_box_h; int has_subs, has_boxes; int counter; int title_font_style; int title_font_size; int entry_font_style; int entry_font_size; unsigned long event_mask; int bw; /* border width */ FL_COLOR bg_color; /* background color of popup*/ FL_COLOR on_color; /* color of entry under mouse */ FL_COLOR title_color; /* color of title text */ FL_COLOR text_color; /* normal text color of entry */ FL_COLOR text_on_color; /* text color when mouse on entry */ FL_COLOR text_off_color; /* text color of disabled entry */ FL_COLOR radio_color; /* color of radio buttons */ int policy; int need_recalc; /* do we need to recalc position? */ FL_POPUP_RETURN ret; /* structure passed to calbacks and returned on selection */ }; struct FL_POPUP_ENTRY_ { FL_POPUP_ENTRY * prev; /* next in linked list */ FL_POPUP_ENTRY * next; /* previous in linked list */ FL_POPUP * popup; /* popup it belongs to */ int is_act; /* set while mouse is over it */ char * text; /* complete text of entry */ char * label; /* cleaned-up label text */ char * accel; /* cleaned-up accelerator key text */ long int val; /* value associated with entry */ void * user_data; /* pointer to user data */ int type; /* normal, toggle, radio, sub-popup */ unsigned int state; /* disabled, hidden, checked */ int group; /* group (for radio entries only) */ FL_POPUP * sub; /* sub-popup bound to entry */ long int * shortcut; /* keyboard shortcuts */ int ulpos; /* underline position in text */ FL_POPUP_CB callback; /* callback for entry */ FL_POPUP_CB enter_callback; /* callback for entering entry */ FL_POPUP_CB leave_callback; /* callback for leaving entry */ int x, /* position of entry text */ y; unsigned int w, h; /* height of entry text */ int box_x, box_y; unsigned int box_w, box_h; unsigned int sl_h; int ul_x, ul_y; unsigned int ul_w, ul_h; }; typedef struct { const char * text; /* text of entry */ FL_POPUP_CB callback; /* (selection) callback */ const char * shortcut; /* keyboard shortcut description */ int type; /* type of entry */ int state; /* disabled, hidden, checked */ } FL_POPUP_ITEM; /* Popup policies */ enum { FL_POPUP_NORMAL_SELECT, FL_POPUP_DRAG_SELECT }; /* Popup states */ enum { FL_POPUP_NONE = 0, FL_POPUP_DISABLED = 1, /* entry is disabled */ FL_POPUP_HIDDEN = 2, /* entry is temporarily hidden */ FL_POPUP_CHECKED = 4 /* tooogle/radio item is in on state */ }; /* Popup entry types */ enum { FL_POPUP_NORMAL, /* normal popup entry */ FL_POPUP_TOGGLE, /* toggle ("binary") popup entry */ FL_POPUP_RADIO, /* radio popup entry */ FL_POPUP_SUB, /* sub-popup popup entry */ FL_POPUP_LINE /* line popup entry */ }; /* Popup color types */ enum { FL_POPUP_BACKGROUND_COLOR, FL_POPUP_HIGHLIGHT_COLOR, FL_POPUP_TITLE_COLOR, FL_POPUP_TEXT_COLOR, FL_POPUP_HIGHLIGHT_TEXT_COLOR, FL_POPUP_DISABLED_TEXT_COLOR, FL_POPUP_RADIO_COLOR }; FL_EXPORT FL_POPUP *fl_popup_add( Window, const char * ); FL_EXPORT FL_POPUP_ENTRY *fl_popup_add_entries( FL_POPUP *, const char *, ... ); FL_EXPORT FL_POPUP_ENTRY *fl_popup_insert_entries( FL_POPUP *, FL_POPUP_ENTRY *, const char *, ... ); FL_EXPORT FL_POPUP *fl_popup_create( Window, const char *, FL_POPUP_ITEM * ); FL_EXPORT FL_POPUP_ENTRY *fl_popup_add_items( FL_POPUP *, FL_POPUP_ITEM * ); FL_EXPORT FL_POPUP_ENTRY *fl_popup_insert_items( FL_POPUP *, FL_POPUP_ENTRY *, FL_POPUP_ITEM * ); FL_EXPORT int fl_popup_delete( FL_POPUP * ); FL_EXPORT int fl_popup_entry_delete( FL_POPUP_ENTRY * ); FL_EXPORT FL_POPUP_RETURN *fl_popup_do( FL_POPUP * ); FL_EXPORT void fl_popup_set_position( FL_POPUP *, int, int ); FL_EXPORT int fl_popup_get_policy( FL_POPUP * ); FL_EXPORT int fl_popup_set_policy( FL_POPUP *, int ); FL_EXPORT FL_POPUP_CB fl_popup_set_callback( FL_POPUP *, FL_POPUP_CB ); FL_EXPORT void fl_popup_get_title_font( FL_POPUP *, int *, int * ); FL_EXPORT void fl_popup_set_title_font( FL_POPUP *, int, int ); FL_EXPORT void fl_popup_entry_get_font( FL_POPUP *, int *, int * ); FL_EXPORT void fl_popup_entry_set_font( FL_POPUP *, int, int ); FL_EXPORT int fl_popup_get_bw( FL_POPUP * ); FL_EXPORT int fl_popup_set_bw( FL_POPUP *, int ); FL_EXPORT FL_COLOR fl_popup_get_color( FL_POPUP *, int ); FL_EXPORT FL_COLOR fl_popup_set_color( FL_POPUP *, int, FL_COLOR ); FL_EXPORT void fl_popup_set_cursor( FL_POPUP *, int ); FL_EXPORT const char *fl_popup_get_title( FL_POPUP * ); FL_EXPORT FL_POPUP *fl_popup_set_title( FL_POPUP *, const char * ); FL_EXPORT FL_POPUP * fl_popup_set_title_f( FL_POPUP * popup, const char * fmt, ... ); FL_EXPORT FL_POPUP_CB fl_popup_entry_set_callback( FL_POPUP_ENTRY *, FL_POPUP_CB ); FL_EXPORT FL_POPUP_CB fl_popup_entry_set_enter_callback( FL_POPUP_ENTRY *, FL_POPUP_CB ); FL_EXPORT FL_POPUP_CB fl_popup_entry_set_leave_callback( FL_POPUP_ENTRY *, FL_POPUP_CB ); FL_EXPORT unsigned int fl_popup_entry_get_state( FL_POPUP_ENTRY * ); FL_EXPORT unsigned int fl_popup_entry_set_state( FL_POPUP_ENTRY *, unsigned int ); FL_EXPORT unsigned int fl_popup_entry_clear_state( FL_POPUP_ENTRY *, unsigned int ); FL_EXPORT unsigned int fl_popup_entry_raise_state( FL_POPUP_ENTRY *, unsigned int ); FL_EXPORT unsigned int fl_popup_entry_toggle_state( FL_POPUP_ENTRY *, unsigned int ); FL_EXPORT int fl_popup_entry_set_text( FL_POPUP_ENTRY *, const char * ); FL_EXPORT void fl_popup_entry_set_shortcut( FL_POPUP_ENTRY *, const char * ); FL_EXPORT long int fl_popup_entry_set_value( FL_POPUP_ENTRY *, long int ); FL_EXPORT void *fl_popup_entry_set_user_data( FL_POPUP_ENTRY *, void * ); FL_EXPORT FL_POPUP_ENTRY *fl_popup_entry_get_by_position( FL_POPUP *, int ); FL_EXPORT FL_POPUP_ENTRY *fl_popup_entry_get_by_value( FL_POPUP *, long ); FL_EXPORT FL_POPUP_ENTRY *fl_popup_entry_get_by_user_data( FL_POPUP *, void * ); FL_EXPORT FL_POPUP_ENTRY *fl_popup_entry_get_by_text( FL_POPUP *, const char * ); FL_EXPORT FL_POPUP_ENTRY * fl_popup_entry_get_by_text_f( FL_POPUP *, const char *, ... ); FL_EXPORT FL_POPUP_ENTRY *fl_popup_entry_get_by_label( FL_POPUP *, const char * ); FL_EXPORT FL_POPUP_ENTRY * fl_popup_entry_get_by_label_f( FL_POPUP *, const char *, ... ); FL_EXPORT int fl_popup_entry_get_group( FL_POPUP_ENTRY * ); FL_EXPORT int fl_popup_entry_set_group( FL_POPUP_ENTRY *, int ); FL_EXPORT FL_POPUP *fl_popup_entry_get_subpopup( FL_POPUP_ENTRY * ); FL_EXPORT FL_POPUP *fl_popup_entry_set_subpopup( FL_POPUP_ENTRY *, FL_POPUP * ); FL_EXPORT int fl_popup_get_size( FL_POPUP *, unsigned int *, unsigned int * ); FL_EXPORT int fl_popup_get_min_width( FL_POPUP * ); FL_EXPORT int fl_popup_set_min_width( FL_POPUP *, int ); #endif /* ! defined FL_POPUP_H */ xforms-1.2.4/lib/include/xyplot.h0000664000175000017500000003364512353623325013677 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file xyplot.h */ #ifndef FL_XYPLOT_H #define FL_XYPLOT_H /* Class FL_XYPLOT */ typedef enum { FL_NORMAL_XYPLOT, /* solid line */ FL_SQUARE_XYPLOT, /* with added square */ FL_CIRCLE_XYPLOT, /* with added circle */ FL_FILL_XYPLOT, /* fill completely */ FL_POINTS_XYPLOT, /* only data points */ FL_DASHED_XYPLOT, /* dashed line */ FL_IMPULSE_XYPLOT, FL_ACTIVE_XYPLOT, /* accepts interactive manipulations */ FL_EMPTY_XYPLOT, FL_DOTTED_XYPLOT, FL_DOTDASHED_XYPLOT, FL_LONGDASHED_XYPLOT, FL_LINEPOINTS_XYPLOT /* line & points */ } FL_XYPLOT_TYPE; enum { FL_LINEAR, FL_LOG }; enum { FL_GRID_NONE = 0, FL_GRID_MAJOR = 1, FL_GRID_MINOR = 2 }; /***** Defaults *****/ #define FL_XYPLOT_BOXTYPE FL_FLAT_BOX #define FL_XYPLOT_COL1 FL_COL1 #define FL_XYPLOT_LCOL FL_LCOL #define FL_XYPLOT_ALIGN FL_ALIGN_BOTTOM #define FL_MAX_XYPLOTOVERLAY 32 /***** Others *****/ FL_EXPORT FL_OBJECT * fl_create_xyplot( int t, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_xyplot( int t, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT void fl_set_xyplot_data( FL_OBJECT * ob, float * x, float * y, int n, const char * title, const char * xlabel, const char * ylabel ); FL_EXPORT void fl_set_xyplot_data_double( FL_OBJECT * ob, double * x, double * y, int n, const char * title, const char * xlabel, const char * ylabel ); FL_EXPORT int fl_set_xyplot_file( FL_OBJECT * ob, const char * f, const char * title, const char * xl, const char * yl ); FL_EXPORT void fl_insert_xyplot_data( FL_OBJECT * ob, int id, int n, double x, double y ); #define fl_set_xyplot_datafile fl_set_xyplot_file FL_EXPORT void fl_add_xyplot_text( FL_OBJECT * ob, double x, double y, const char * text, int al, FL_COLOR col ); FL_EXPORT void fl_delete_xyplot_text( FL_OBJECT * ob, const char * text ); FL_EXPORT int fl_set_xyplot_maxoverlays( FL_OBJECT * ob, int maxover ); FL_EXPORT void fl_add_xyplot_overlay( FL_OBJECT * ob, int id, float * x, float * y, int n, FL_COLOR col ); FL_EXPORT int fl_add_xyplot_overlay_file( FL_OBJECT * ob, int id, const char * f, FL_COLOR c ); FL_EXPORT void fl_set_xyplot_return( FL_OBJECT * ob, unsigned int when ); FL_EXPORT void fl_set_xyplot_xtics( FL_OBJECT * ob, int major, int minor ); FL_EXPORT void fl_set_xyplot_ytics( FL_OBJECT * ob, int major, int minor ); FL_EXPORT void fl_set_xyplot_xbounds( FL_OBJECT * ob, double xmin, double xmax ); FL_EXPORT void fl_set_xyplot_ybounds( FL_OBJECT * ob, double ymin, double ymax ); FL_EXPORT void fl_get_xyplot_xbounds( FL_OBJECT * ob, float * xmin, float * xmax ); FL_EXPORT void fl_get_xyplot_ybounds( FL_OBJECT * ob, float * ymin, float * ymax ); FL_EXPORT void fl_get_xyplot( FL_OBJECT * ob, float * x, float * y, int * i ); FL_EXPORT int fl_get_xyplot_data_size( FL_OBJECT * obj ); FL_EXPORT void fl_get_xyplot_data( FL_OBJECT * ob, float * x, float * y, int * n ); FL_EXPORT void fl_get_xyplot_data_pointer( FL_OBJECT * ob, int id, float ** x, float ** y, int *n ); FL_EXPORT void fl_get_xyplot_overlay_data( FL_OBJECT * ob, int id, float * x, float * y, int * n ); FL_EXPORT void fl_set_xyplot_overlay_type( FL_OBJECT * ob, int id, int type ); FL_EXPORT void fl_delete_xyplot_overlay( FL_OBJECT * ob, int id ); FL_EXPORT void fl_set_xyplot_interpolate( FL_OBJECT * ob, int id, int deg, double grid ); FL_EXPORT void fl_set_xyplot_inspect( FL_OBJECT * ob, int yes ); FL_EXPORT void fl_set_xyplot_symbolsize( FL_OBJECT * ob, int n ); FL_EXPORT void fl_replace_xyplot_point( FL_OBJECT * ob, int i, double x, double y ); /* Replace the value of a particular point in dataset setID, * where setID=0 is the first data set. * This routine is an extension of fl_replace_xyplot_point * which acts on the first dataset only. */ FL_EXPORT void fl_replace_xyplot_point_in_overlay( FL_OBJECT * ob, int i, int setID, double x, double y ); FL_EXPORT void fl_get_xyplot_xmapping( FL_OBJECT * ob, float * a, float * b ); FL_EXPORT void fl_get_xyplot_ymapping( FL_OBJECT * ob, float * a, float * b ); FL_EXPORT void fl_set_xyplot_keys( FL_OBJECT * ob, char ** keys, float x, float y, int align ); FL_EXPORT void fl_set_xyplot_key( FL_OBJECT * ob, int id, const char * key ); FL_EXPORT void fl_set_xyplot_key_position( FL_OBJECT * ob, float x, float y, int align ); FL_EXPORT void fl_set_xyplot_key_font( FL_OBJECT * ob, int style, int size ); FL_EXPORT int fl_get_xyplot_numdata( FL_OBJECT * ob, int id ); /* The following two functions will be removed. * Use fl_set_object_l[size|style] for the functionalities */ FL_EXPORT void fl_set_xyplot_fontsize( FL_OBJECT * ob, int size ); FL_EXPORT void fl_set_xyplot_fontstyle( FL_OBJECT * ob, int style ); FL_EXPORT void fl_xyplot_s2w( FL_OBJECT * ob, double sx, double sy, float * wx, float * wy ); FL_EXPORT void fl_xyplot_w2s( FL_OBJECT * ob, double wx, double wy, float * sx, float * sy ); FL_EXPORT void fl_set_xyplot_xscale( FL_OBJECT * ob, int scale, double base ); FL_EXPORT void fl_set_xyplot_yscale( FL_OBJECT * ob, int scale, double base ); FL_EXPORT void fl_clear_xyplot( FL_OBJECT * ob ); FL_EXPORT void fl_set_xyplot_linewidth( FL_OBJECT * ob, int id, int lw ); FL_EXPORT void fl_set_xyplot_xgrid( FL_OBJECT * ob, int xgrid ); FL_EXPORT void fl_set_xyplot_ygrid( FL_OBJECT * ob, int ygrid ); FL_EXPORT int fl_set_xyplot_grid_linestyle( FL_OBJECT * ob, int style ); FL_EXPORT void fl_set_xyplot_alphaxtics( FL_OBJECT * ob, const char * m, const char * s ); FL_EXPORT void fl_set_xyplot_alphaytics( FL_OBJECT * ob, const char * m, const char * s ); FL_EXPORT void fl_set_xyplot_fixed_xaxis( FL_OBJECT * ob, const char * lm, const char * rm ); FL_EXPORT void fl_set_xyplot_fixed_yaxis( FL_OBJECT * ob, const char * bm, const char * tm ); FL_EXPORT int fl_interpolate( const float * wx, const float * wy, int nin, float * x, float * y, double grid, int ndeg ); typedef void ( * FL_XYPLOT_SYMBOL )( FL_OBJECT *, int, FL_POINT *, int, int, int ); FL_EXPORT FL_XYPLOT_SYMBOL fl_set_xyplot_symbol( FL_OBJECT * ob, int id, FL_XYPLOT_SYMBOL symbol ); FL_EXPORT int fl_set_xyplot_mark_active( FL_OBJECT * ob, int y ); FL_EXPORT void fl_get_xyplot_screen_area( FL_OBJECT * obj, FL_COORD * llx, FL_COORD * lly, FL_COORD * urx, FL_COORD * ury ); FL_EXPORT void fl_get_xyplot_world_area( FL_OBJECT * obj, float * llx, float * lly, float * urx, float * ury ); FL_EXPORT int fl_set_xyplot_log_minor_xtics( FL_OBJECT * obj, int yesno ); FL_EXPORT int fl_set_xyplot_log_minor_ytics( FL_OBJECT * obj, int yesno ); FL_EXPORT void fl_set_xyplot_mouse_buttons( FL_OBJECT * obj, unsigned int mouse_buttons ); FL_EXPORT void fl_get_xyplot_mouse_buttons( FL_OBJECT * obj, unsigned int * mouse_buttons ); #endif /* ! defined FL_XYPLOT_H */ xforms-1.2.4/lib/include/button.h0000664000175000017500000003364112353623325013647 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file button.h * * All Buttons: regular button, light button and round button * */ #ifndef FL_BUTTON_H #define FL_BUTTON_H typedef enum { FL_NORMAL_BUTTON, FL_PUSH_BUTTON, FL_RADIO_BUTTON, FL_HIDDEN_BUTTON, FL_TOUCH_BUTTON, FL_INOUT_BUTTON, FL_RETURN_BUTTON, FL_HIDDEN_RET_BUTTON, FL_MENU_BUTTON } FL_BUTTON_TYPE; #define FL_TOGGLE_BUTTON FL_PUSH_BUTTON typedef struct { Pixmap pixmap, mask; unsigned int bits_w, bits_h; int val; /* state of button (on/off) */ int mousebut; /* mouse button that caused the push */ int timdel; /* time since last touch (TOUCH buttons) */ int event; /* what event triggers redraw */ int is_pushed; /* set while drawn as pushed down */ int react_to[ 5 ]; /* mouse buttons button reacts to */ long cspecl; /* reserved for class specfic stuff */ void * cspecv; /* misc. things */ char * filename; Pixmap focus_pixmap, focus_mask; char * focus_filename; } FL_BUTTON_SPEC; #define FL_BUTTON_STRUCT FL_BUTTON_SPEC typedef void ( * FL_DrawButton )( FL_OBJECT * ); typedef void ( * FL_CleanupButton )( FL_BUTTON_STRUCT * ); #define FL_DRAWBUTTON FL_DrawButton #define FL_CLEANUPBUTTON FL_CleanupButton /* normal button default */ #define FL_BUTTON_BOXTYPE FL_UP_BOX #define FL_BUTTON_COL1 FL_COL1 #define FL_BUTTON_COL2 FL_COL1 #define FL_BUTTON_LCOL FL_LCOL #define FL_BUTTON_ALIGN FL_ALIGN_CENTER #define FL_BUTTON_MCOL1 FL_MCOL #define FL_BUTTON_MCOL2 FL_MCOL #define FL_BUTTON_BW FL_BOUND_WIDTH /* light button defaults */ #define FL_LIGHTBUTTON_BOXTYPE FL_UP_BOX #define FL_LIGHTBUTTON_COL1 FL_COL1 #define FL_LIGHTBUTTON_COL2 FL_YELLOW #define FL_LIGHTBUTTON_LCOL FL_LCOL #define FL_LIGHTBUTTON_ALIGN ( FL_ALIGN_CENTER | FL_ALIGN_INSIDE ) #define FL_LIGHTBUTTON_TOPCOL FL_COL1 #define FL_LIGHTBUTTON_MCOL FL_MCOL #define FL_LIGHTBUTTON_MINSIZE ( ( FL_Coord ) 12 ) /* round button defaults */ #define FL_ROUNDBUTTON_BOXTYPE FL_NO_BOX #define FL_ROUNDBUTTON_COL1 FL_MCOL #define FL_ROUNDBUTTON_COL2 FL_YELLOW #define FL_ROUNDBUTTON_LCOL FL_LCOL #define FL_ROUNDBUTTON_ALIGN FL_ALIGN_CENTER #define FL_ROUNDBUTTON_TOPCOL FL_COL1 #define FL_ROUNDBUTTON_MCOL FL_MCOL /* round3d button defaults */ #define FL_ROUND3DBUTTON_BOXTYPE FL_NO_BOX #define FL_ROUND3DBUTTON_COL1 FL_COL1 #define FL_ROUND3DBUTTON_COL2 FL_BLACK #define FL_ROUND3DBUTTON_LCOL FL_LCOL #define FL_ROUND3DBUTTON_ALIGN FL_ALIGN_CENTER #define FL_ROUND3DBUTTON_TOPCOL FL_COL1 #define FL_ROUND3DBUTTON_MCOL FL_MCOL /* check button defaults */ #define FL_CHECKBUTTON_BOXTYPE FL_NO_BOX #define FL_CHECKBUTTON_COL1 FL_COL1 #define FL_CHECKBUTTON_COL2 FL_YELLOW #define FL_CHECKBUTTON_LCOL FL_LCOL #define FL_CHECKBUTTON_ALIGN FL_ALIGN_CENTER #define FL_CHECKBUTTON_TOPCOL FL_COL1 #define FL_CHECKBUTTON_MCOL FL_MCOL /* bitmap button defaults */ #define FL_BITMAPBUTTON_BOXTYPE FL_UP_BOX #define FL_BITMAPBUTTON_COL1 FL_COL1 /* bitmap background */ #define FL_BITMAPBUTTON_COL2 FL_BLUE /* "focus" color */ #define FL_BITMAPBUTTON_LCOL FL_LCOL /* bitmap foreground */ #define FL_BITMAPBUTTON_ALIGN FL_ALIGN_BOTTOM /* bitmap button defaults */ #define FL_PIXMAPBUTTON_BOXTYPE FL_UP_BOX #define FL_PIXMAPBUTTON_COL1 FL_BUTTON_COL1 #define FL_PIXMAPBUTTON_COL2 FL_BUTTON_COL2 #define FL_PIXMAPBUTTON_LCOL FL_BUTTON_LCOL #define FL_PIXMAPBUTTON_MCOL1 FL_BUTTON_MCOL1 #define FL_PIXMAPBUTTON_MCOL2 FL_BUTTON_MCOL2 #define FL_PIXMAPBUTTON_ALIGN FL_ALIGN_BOTTOM /***** Routines *****/ FL_EXPORT FL_OBJECT * fl_create_button( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_create_roundbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_create_round3dbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_create_lightbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_create_checkbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_create_bitmapbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_create_pixmapbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_create_scrollbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_create_labelbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT *fl_add_roundbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_round3dbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_lightbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_checkbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_button( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_bitmapbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_scrollbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_labelbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); #define fl_set_bitmapbutton_file fl_set_bitmap_file FL_EXPORT void fl_set_bitmapbutton_data( FL_OBJECT * ob, int w, int h, unsigned char * bits ); #define fl_set_bitmapbutton_datafile fl_set_bitmapbutton_file FL_EXPORT FL_OBJECT * fl_add_pixmapbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); #define fl_set_pixmapbutton_data fl_set_pixmap_data #define fl_set_pixmapbutton_file fl_set_pixmap_file #define fl_set_pixmapbutton_pixmap fl_set_pixmap_pixmap #define fl_get_pixmapbutton_pixmap fl_get_pixmap_pixmap #define fl_set_pixmapbutton_align fl_set_pixmap_align #define fl_free_pixmapbutton_pixmap fl_free_pixmap_pixmap #define fl_set_pixmapbutton_datafile fl_set_pixmapbutton_file #define fl_set_pixmapbutton_show_focus fl_set_pixmapbutton_focus_outline FL_EXPORT void fl_set_pixmapbutton_focus_outline( FL_OBJECT * ob, int yes ); FL_EXPORT void fl_set_pixmapbutton_focus_data( FL_OBJECT * ob, char ** bits ); FL_EXPORT void fl_set_pixmapbutton_focus_file( FL_OBJECT * ob, const char * fname ); FL_EXPORT void fl_set_pixmapbutton_focus_pixmap( FL_OBJECT * ob, Pixmap id, Pixmap mask ); FL_EXPORT int fl_get_button( FL_OBJECT * ob ); FL_EXPORT void fl_set_button( FL_OBJECT * ob, int pushed ); FL_EXPORT int fl_get_button_numb( FL_OBJECT * ob ); #define fl_set_button_shortcut fl_set_object_shortcut FL_EXPORT FL_OBJECT * fl_create_generic_button( int objclass, int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT void fl_add_button_class( int bclass, FL_DrawButton drawit, FL_CleanupButton cleanup ); FL_EXPORT void fl_set_button_mouse_buttons( FL_OBJECT * ob, unsigned int buttons ); FL_EXPORT void fl_get_button_mouse_buttons( FL_OBJECT * ob, unsigned int * buttons ); #endif /* ! defined FL_BUTTON_H */ xforms-1.2.4/lib/include/scrollbar.h0000664000175000017500000000663612353623325014323 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ #ifndef FL_SCROLLBAR_H #define FL_SCROLLBAR_H enum { FL_VERT_SCROLLBAR, FL_HOR_SCROLLBAR, FL_VERT_THIN_SCROLLBAR, FL_HOR_THIN_SCROLLBAR, FL_VERT_NICE_SCROLLBAR, FL_HOR_NICE_SCROLLBAR, FL_VERT_PLAIN_SCROLLBAR, FL_HOR_PLAIN_SCROLLBAR, FL_HOR_BASIC_SCROLLBAR = FL_HOR_PLAIN_SCROLLBAR, FL_VERT_BASIC_SCROLLBAR = FL_VERT_PLAIN_SCROLLBAR }; enum { FL_NORMAL_SCROLLBAR, FL_THIN_SCROLLBAR, FL_NICE_SCROLLBAR, FL_PLAIN_SCROLLBAR }; #define FL_SCROLLBAR_ALIGN FL_ALIGN_BOTTOM FL_EXPORT FL_OBJECT * fl_create_scrollbar( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_scrollbar( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT double fl_get_scrollbar_value( FL_OBJECT * ob ); FL_EXPORT void fl_set_scrollbar_value( FL_OBJECT * ob, double val ); FL_EXPORT void fl_set_scrollbar_size( FL_OBJECT * ob, double val ); FL_EXPORT double fl_get_scrollbar_size( FL_OBJECT * obj ); FL_EXPORT void fl_set_scrollbar_increment( FL_OBJECT * ob, double l, double r ); FL_EXPORT void fl_get_scrollbar_increment( FL_OBJECT * ob, double * a, double * b ); FL_EXPORT void fl_set_scrollbar_bounds( FL_OBJECT * ob, double b1, double b2 ); FL_EXPORT void fl_get_scrollbar_bounds( FL_OBJECT * ob, double * b1, double * b2 ); FL_EXPORT void fl_set_scrollbar_return( FL_OBJECT * ob, unsigned int when ); FL_EXPORT void fl_set_scrollbar_step( FL_OBJECT * ob, double step ); FL_EXPORT int fl_get_scrollbar_repeat( FL_OBJECT * obj ); FL_EXPORT void fl_set_scrollbar_repeat( FL_OBJECT * obj, int millisec ); #endif /* ! defined FL_SCROLLBAR_H */ xforms-1.2.4/lib/include/tabfolder.h0000664000175000017500000001064312353623325014273 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file tabfolder.h */ #ifndef FL_FOLDER_H #define FL_FOLDER_H enum { FL_TOP_TABFOLDER, /* tab on top */ FL_BOTTOM_TABFOLDER, FL_LEFT_TABFOLDER, FL_RIGHT_TABFOLDER, FL_NORMAL_TABFOLDER = FL_TOP_TABFOLDER }; enum { FL_NO, FL_FIT, FL_ENLARGE_ONLY }; FL_EXPORT FL_OBJECT * fl_create_tabfolder( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_tabfolder( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_addto_tabfolder( FL_OBJECT * ob, const char * title, FL_FORM * form ); FL_EXPORT FL_FORM * fl_get_tabfolder_folder_bynumber( FL_OBJECT * ob, int num ); FL_EXPORT FL_FORM * fl_get_tabfolder_folder_byname( FL_OBJECT * ob, const char * name ); FL_EXPORT FL_FORM * fl_get_tabfolder_folder_byname_f( FL_OBJECT * ob, const char * fmt, ...); FL_EXPORT void fl_delete_folder( FL_OBJECT * ob, FL_FORM * form ); FL_EXPORT void fl_delete_folder_bynumber( FL_OBJECT * ob, int num ); FL_EXPORT void fl_delete_folder_byname( FL_OBJECT * ob, const char * name ); FL_EXPORT void fl_delete_folder_byname_f( FL_OBJECT * ob, const char * fmt, ... ); FL_EXPORT void fl_set_folder( FL_OBJECT * ob, FL_FORM * form ); FL_EXPORT void fl_set_folder_byname( FL_OBJECT * ob, const char * name ); FL_EXPORT void fl_set_folder_byname_f( FL_OBJECT * ob, const char * fmt, ... ); FL_EXPORT void fl_set_folder_bynumber( FL_OBJECT * ob, int num ); FL_EXPORT FL_FORM * fl_get_folder( FL_OBJECT * ob ); FL_EXPORT int fl_get_folder_number( FL_OBJECT * ob ); FL_EXPORT const char * fl_get_folder_name( FL_OBJECT * ob ); FL_EXPORT int fl_get_tabfolder_numfolders( FL_OBJECT * ob ); FL_EXPORT FL_FORM * fl_get_active_folder( FL_OBJECT * ob ); FL_EXPORT int fl_get_active_folder_number( FL_OBJECT * ob ); FL_EXPORT const char * fl_get_active_folder_name( FL_OBJECT * ob ); FL_EXPORT void fl_get_folder_area( FL_OBJECT * ob, FL_Coord * x, FL_Coord * y, FL_Coord * w, FL_Coord * h ); FL_EXPORT void fl_replace_folder_bynumber( FL_OBJECT * ob, int num, FL_FORM * form ); FL_EXPORT int fl_set_tabfolder_autofit( FL_OBJECT * ob, int y ); FL_EXPORT int fl_set_default_tabfolder_corner( int n ); FL_EXPORT int fl_set_tabfolder_offset( FL_OBJECT * obj, int offset ); FL_EXPORT int fl_get_tabfolder_offset( FL_OBJECT * obj ); #endif /* ! defined FL_FOLDER_H */ xforms-1.2.4/lib/include/frame.h0000664000175000017500000000516512353623325013426 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file frame.h */ #ifndef FL_FRAME_H #define FL_FRAME_H /* types of frames */ enum { FL_NO_FRAME, FL_UP_FRAME, FL_DOWN_FRAME, FL_BORDER_FRAME, FL_SHADOW_FRAME, FL_ENGRAVED_FRAME, FL_ROUNDED_FRAME, FL_EMBOSSED_FRAME, FL_OVAL_FRAME }; #define FL_FRAME_COL1 FL_BLACK /* border color */ #define FL_FRAME_COL2 FL_COL1 /* label background */ #define FL_FRAME_LCOL FL_BLACK /* label color */ FL_EXPORT FL_OBJECT * fl_create_frame( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_frame( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); /* labeld frame */ FL_EXPORT FL_OBJECT * fl_create_labelframe( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_labelframe( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); #endif /* ! defined FL_FRAME_H */ xforms-1.2.4/lib/include/timer.h0000664000175000017500000000474212353623325013454 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file timer.h * * Object Class: Timer */ #ifndef FL_TIMER_H #define FL_TIMER_H typedef enum { FL_NORMAL_TIMER, FL_VALUE_TIMER, FL_HIDDEN_TIMER } FL_TIMER_TYPE; /***** Defaults *****/ #define FL_TIMER_BOXTYPE FL_DOWN_BOX #define FL_TIMER_COL1 FL_COL1 #define FL_TIMER_COL2 FL_RED #define FL_TIMER_LCOL FL_LCOL #define FL_TIMER_ALIGN FL_ALIGN_CENTER /***** Others *****/ #define FL_TIMER_BLINKRATE 0.2 /***** Routines *****/ typedef char * ( * FL_TIMER_FILTER )( FL_OBJECT *, double ); FL_EXPORT FL_OBJECT * fl_create_timer( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_timer( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT void fl_set_timer( FL_OBJECT * ob, double total ); FL_EXPORT double fl_get_timer( FL_OBJECT * ob ); FL_EXPORT void fl_set_timer_countup( FL_OBJECT * ob, int yes ); FL_EXPORT FL_TIMER_FILTER fl_set_timer_filter( FL_OBJECT * ob, FL_TIMER_FILTER filter ); FL_EXPORT void fl_suspend_timer( FL_OBJECT * ob ); FL_EXPORT void fl_resume_timer( FL_OBJECT * ob ); #endif /* ! defined FL_TIMER_H */ xforms-1.2.4/lib/include/clipbd.h0000664000175000017500000000326412353623325013567 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file clipbd.h * * prototypes for clipboard stuff */ #ifndef FL_CLIPBD_H #define FL_CLIPBD_H typedef Atom FL_CPTYPE; typedef int ( * FL_LOSE_SELECTION_CB )( FL_OBJECT *, long ); typedef int ( * FL_SELECTION_CB )( FL_OBJECT *, long, const void *, long ); #define FL_SELECTION_CALLBACK FL_SELECTION_CB #define FL_LOSE_SELECTION_CALLBACK FL_LOSE_SELECTION_CB FL_EXPORT int fl_stuff_clipboard( FL_OBJECT * ob, long type, const void * data, long size, FL_LOSE_SELECTION_CB lose_callback ); FL_EXPORT int fl_request_clipboard( FL_OBJECT * ob, long type, FL_SELECTION_CB got_it_callback ); #endif /* ! defined FL_CLIPBD_H */ xforms-1.2.4/lib/include/menu.h0000664000175000017500000001030712353623325013272 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file menu.h */ #ifndef FL_MENU_H #define FL_MENU_H /************ Object Class: Menu ************/ typedef enum { FL_TOUCH_MENU, FL_PUSH_MENU, FL_PULLDOWN_MENU } FL_MENU_TYPE; /***** Defaults *****/ #define FL_MENU_BOXTYPE FL_BORDER_BOX #define FL_MENU_COL1 FL_COL1 #define FL_MENU_COL2 FL_MCOL #define FL_MENU_LCOL FL_LCOL #define FL_MENU_ALIGN FL_ALIGN_CENTER /***** Others *****/ #define FL_MENU_MAXITEMS 128 #define FL_MENU_MAXSTR 64 /* not used anymore! JTT */ /***** Routines *****/ FL_EXPORT FL_OBJECT * fl_create_menu( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_menu( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT void fl_clear_menu( FL_OBJECT * ob ); FL_EXPORT void fl_set_menu( FL_OBJECT * ob, const char * menustr , ... ); FL_EXPORT int fl_addto_menu( FL_OBJECT * ob, const char * menustr, ... ); FL_EXPORT void fl_replace_menu_item( FL_OBJECT * ob, int numb, const char * str, ... ); FL_EXPORT void fl_delete_menu_item( FL_OBJECT * ob, int numb ); FL_EXPORT FL_PUP_CB fl_set_menu_item_callback( FL_OBJECT * ob, int numb, FL_PUP_CB cb ); FL_EXPORT void fl_set_menu_item_shortcut( FL_OBJECT * ob, int numb, const char * str ); FL_EXPORT void fl_set_menu_item_mode( FL_OBJECT * ob, int numb, unsigned int mode ); FL_EXPORT void fl_show_menu_symbol( FL_OBJECT * ob, int show ); FL_EXPORT void fl_set_menu_popup( FL_OBJECT * ob, int pup ); FL_EXPORT int fl_get_menu_popup( FL_OBJECT * ob ); FL_EXPORT int fl_get_menu( FL_OBJECT * ob ); FL_EXPORT const char * fl_get_menu_item_text( FL_OBJECT * ob, int numb ); FL_EXPORT int fl_get_menu_maxitems( FL_OBJECT * ob ); FL_EXPORT unsigned int fl_get_menu_item_mode( FL_OBJECT * ob, int numb ); FL_EXPORT const char *fl_get_menu_text( FL_OBJECT * ob ); FL_EXPORT int fl_set_menu_entries( FL_OBJECT * ob, FL_PUP_ENTRY * ent ); FL_EXPORT int fl_set_menu_notitle( FL_OBJECT * ob, int off ); FL_EXPORT int fl_set_menu_item_id( FL_OBJECT * ob, int item, int id ); #endif /* ! defined FL_MENU_H */ xforms-1.2.4/lib/include/counter.h0000664000175000017500000000751512353623325014014 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file counter.h */ #ifndef FL_COUNTER_H #define FL_COUNTER_H typedef enum { FL_NORMAL_COUNTER, FL_SIMPLE_COUNTER } FL_COUNTER_TYPE; /***** Defaults *****/ #define FL_COUNTER_BOXTYPE FL_UP_BOX #define FL_COUNTER_COL1 FL_COL1 #define FL_COUNTER_COL2 FL_BLUE /* ct label */ #define FL_COUNTER_LCOL FL_LCOL /* ct reporting */ #define FL_COUNTER_ALIGN FL_ALIGN_BOTTOM /***** Others *****/ #define FL_COUNTER_BW FL_BOUND_WIDTH /***** Routines *****/ FL_EXPORT FL_OBJECT * fl_create_counter( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_counter( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT void fl_set_counter_value( FL_OBJECT * ob, double val ); FL_EXPORT void fl_set_counter_bounds( FL_OBJECT * ob, double min, double max ); FL_EXPORT void fl_set_counter_step( FL_OBJECT * ob, double s, double l ); FL_EXPORT void fl_set_counter_precision( FL_OBJECT * ob, int prec ); FL_EXPORT int fl_get_counter_precision( FL_OBJECT * ob ); FL_EXPORT void fl_set_counter_return( FL_OBJECT * ob, unsigned int how ); FL_EXPORT double fl_get_counter_value( FL_OBJECT * ob ); FL_EXPORT void fl_get_counter_bounds( FL_OBJECT * ob, double * min, double * max ); FL_EXPORT void fl_get_counter_step( FL_OBJECT * ob, double * s, double * l ); FL_EXPORT void fl_set_counter_filter( FL_OBJECT * ob, FL_VAL_FILTER filter ); /* Functions to set and get the timeout value used by the * counter code to control modification of the counter value. */ FL_EXPORT int fl_get_counter_repeat( FL_OBJECT * ob ); FL_EXPORT void fl_set_counter_repeat( FL_OBJECT * ob, int millisec ); FL_EXPORT int fl_get_counter_min_repeat( FL_OBJECT * ob ); FL_EXPORT void fl_set_counter_min_repeat( FL_OBJECT * ob, int millisec ); FL_EXPORT int fl_get_counter_speedjump( FL_OBJECT * ob ); FL_EXPORT void fl_set_counter_speedjump( FL_OBJECT * ob, int yes_no ); #endif /* ! defined FL_COUNTER_H */ xforms-1.2.4/lib/include/filesys.h0000664000175000017500000000503412353623325014005 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file filesys.h * * Convenience functions to read a directory */ #ifndef FL_FILESYS_H #define FL_FILESYS_H /* File types */ enum { FT_FILE, FT_DIR, FT_LINK, FT_SOCK, FT_FIFO, FT_BLK, FT_CHR, FT_OTHER }; typedef struct { char * name; /* entry name */ int type; /* FILE_TYPE */ long dl_mtime; /* file modification time */ unsigned long dl_size; /* file size in bytes */ } FL_Dirlist; enum { FL_ALPHASORT = 1, /* sort in alphabetic order */ FL_RALPHASORT, /* sort in reverse alphabetic order */ FL_MTIMESORT, /* sort according to modifcation time */ FL_RMTIMESORT, /* sort in reverse modificaiton time */ FL_SIZESORT, /* sort in increasing size order */ FL_RSIZESORT, /* sort in decreasing size order */ FL_CASEALPHASORT, /* sort case insensitive */ FL_RCASEALPHASORT /* sort case insensitive */ }; typedef int ( * FL_DIRLIST_FILTER )( const char *, int ); /* read dir with pattern filtering. All dirs read might be cached. * Must not change dirlist in anyway. */ FL_EXPORT const FL_Dirlist * fl_get_dirlist( const char * dir, const char * pattern, int * n, int rescan ); FL_EXPORT FL_DIRLIST_FILTER fl_set_dirlist_filter( FL_DIRLIST_FILTER filter ); FL_EXPORT int fl_set_dirlist_sort( int method ); FL_EXPORT int fl_set_dirlist_filterdir( int yes ); FL_EXPORT void fl_free_dirlist( FL_Dirlist * dl ); #endif /* ! defined FL_FILESYS_H */ xforms-1.2.4/lib/include/xpopup.h0000664000175000017500000001136312353623325013664 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file xpopup.h * * Prototypes for xpop-up menus */ #ifndef FL_XPOPUP_H #define FL_XPOPUP_H #define FL_MAXPUPI 128 /* max item each pup */ #define FL_PUP_PADH 4 /* space between each items */ typedef void ( * FL_PUP_ENTERCB )( int, void * ); /* call back prototype */ typedef void ( * FL_PUP_LEAVECB )( int, void * ); /* call back prototype */ FL_EXPORT int fl_setpup_entries( int nm, FL_PUP_ENTRY * entries ); FL_EXPORT int fl_newpup( Window win ); FL_EXPORT int fl_defpup( Window win, const char * str, ... ); FL_EXPORT int fl_addtopup( int n, const char * str, ... ); FL_EXPORT int fl_setpup_mode( int nm, int ni, unsigned int mode ); FL_EXPORT void fl_freepup( int n ); FL_EXPORT int fl_dopup( int n ); FL_EXPORT Cursor fl_setpup_default_cursor( int cursor ); FL_EXPORT void fl_setpup_default_color( FL_COLOR fg, FL_COLOR bg ); FL_EXPORT void fl_setpup_default_pup_checked_color( FL_COLOR col ); FL_EXPORT int fl_setpup_default_fontsize( int size ); FL_EXPORT int fl_setpup_default_fontstyle( int style ); #define fl_setpup_fontsize fl_setpup_default_fontsize #define fl_setpup_fontstyle fl_setpup_default_fontstyle #define fl_setpup_color fl_setpup_default_color #define fl_setpup_default_checkcolor fl_setpup_default_pup_checked_color #define fl_setpup_checkcolor fl_setpup_default_pup_checked_color FL_EXPORT int fl_setpup_default_bw( int bw ); FL_EXPORT void fl_setpup_shortcut( int nm, int ni, const char * sc ); FL_EXPORT void fl_setpup_position( int x, int y ); FL_EXPORT void fl_setpup_align_bottom( void ); FL_EXPORT void fl_setpup_selection( int nm, int ni ); FL_EXPORT void fl_setpup_shadow( int n, int y ); FL_EXPORT void fl_setpup_softedge( int n, int y ); FL_EXPORT void fl_setpup_bw( int n, int bw ); FL_EXPORT void fl_setpup_title( int nm, const char * title ); FL_EXPORT void fl_setpup_title_f( int nm, const char * fmt, ... ); FL_EXPORT FL_PUP_ENTERCB fl_setpup_entercb( int nm, FL_PUP_ENTERCB cb, void * data ); FL_EXPORT FL_PUP_LEAVECB fl_setpup_leavecb( int nm, FL_PUP_LEAVECB cb, void * data ); FL_EXPORT void fl_setpup_pad( int n, int padw, int padh ); FL_EXPORT Cursor fl_setpup_cursor( int nm, int cursor ); FL_EXPORT int fl_setpup_maxpup( int n ); FL_EXPORT unsigned int fl_getpup_mode( int nm, int ni ); FL_EXPORT const char * fl_getpup_text( int nm, int ni ); FL_EXPORT void fl_showpup( int n ); FL_EXPORT void fl_hidepup( int n ); FL_EXPORT int fl_getpup_items( int n ); FL_EXPORT int fl_current_pup( void ); #define fl_setpup_hotkey fl_setpup_shortcut FL_EXPORT FL_PUP_CB fl_setpup_itemcb( int nm, int ni, FL_PUP_CB cb ); FL_EXPORT FL_PUP_CB fl_setpup_menucb( int nm, FL_PUP_CB cb ); FL_EXPORT void fl_setpup_submenu( int m, int i, int subm ); #define fl_setpup fl_setpup_mode #endif /* ! defined FL_XPOPUP_H */ xforms-1.2.4/lib/include/bitmap.h0000664000175000017500000001307612353623325013610 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file bitmap.h * * Object Class: Bitmap */ #ifndef FL_BITMAP_H #define FL_BITMAP_H #define FL_NORMAL_BITMAP 0 /***** Defaults *****/ #define FL_BITMAP_BOXTYPE FL_NO_BOX #define FL_BITMAP_COL1 FL_COL1 /* background of bitmap */ #define FL_BITMAP_COL2 FL_COL1 /* not used currently */ #define FL_BITMAP_LCOL FL_LCOL /* foreground of bitmap */ #define FL_BITMAP_ALIGN FL_ALIGN_BOTTOM /***** Routines *****/ FL_EXPORT FL_OBJECT * fl_create_bitmap( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_bitmap( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT void fl_set_bitmap_data( FL_OBJECT * ob, int w, int h, unsigned char * data ); FL_EXPORT void fl_set_bitmap_file( FL_OBJECT * ob, const char * fname ); FL_EXPORT Pixmap fl_read_bitmapfile( Window win, const char * file, unsigned int * w, unsigned int * h, int * hotx, int * hoty ); FL_EXPORT Pixmap fl_create_from_bitmapdata( Window win, const char * data, int width, int height ); /* for compatibility */ #define fl_set_bitmap_datafile fl_set_bitmap_file /* PIXMAP stuff */ #define FL_NORMAL_PIXMAP 0 FL_EXPORT FL_OBJECT * fl_create_pixmap( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_pixmap( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT void fl_set_pixmap_data( FL_OBJECT * ob, char ** bits ); FL_EXPORT void fl_set_pixmap_file( FL_OBJECT * ob, const char * fname ); FL_EXPORT void fl_set_pixmap_align( FL_OBJECT * ob, int align, int xmargin, int ymargin ); FL_EXPORT void fl_set_pixmap_pixmap( FL_OBJECT * ob, Pixmap id, Pixmap mask ); FL_EXPORT void fl_set_pixmap_colorcloseness( int red, int green, int blue ); FL_EXPORT void fl_free_pixmap_pixmap( FL_OBJECT * ob ); FL_EXPORT void fl_free_pixmap_focus_pixmap( FL_OBJECT * obj ); FL_EXPORT Pixmap fl_get_pixmap_pixmap( FL_OBJECT * ob, Pixmap * p, Pixmap * m ); FL_EXPORT Pixmap fl_read_pixmapfile( Window win, const char * file, unsigned int * w, unsigned int * h, Pixmap * shape_mask, int * hotx, int * hoty, FL_COLOR tran ); FL_EXPORT Pixmap fl_create_from_pixmapdata( Window win, char ** data, unsigned int * w, unsigned int * h, Pixmap * sm, int * hotx, int * hoty, FL_COLOR tran ); FL_EXPORT void fl_free_pixmap( Pixmap id ); #endif /* ! defined FL_BITMAP_H */ xforms-1.2.4/lib/include/browser.h0000664000175000017500000002014012353623325014005 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /* * \file browser.h * * Object class Browser */ #ifndef FL_BROWSER_H #define FL_BROWSER_H /***** Types *****/ typedef enum { FL_NORMAL_BROWSER, FL_SELECT_BROWSER, FL_HOLD_BROWSER, FL_MULTI_BROWSER, FL_DESELECTABLE_HOLD_BROWSER } FL_BROWSER_TYPE; /***** Defaults *****/ #define FL_BROWSER_BOXTYPE FL_DOWN_BOX #define FL_BROWSER_COL1 FL_COL1 #define FL_BROWSER_COL2 FL_YELLOW #define FL_BROWSER_LCOL FL_LCOL #define FL_BROWSER_ALIGN FL_ALIGN_BOTTOM /***** Others *****/ #define FL_BROWSER_SLCOL FL_COL1 #define FL_BROWSER_FONTSIZE FL_SMALL_SIZE /* This exists only for backward compatibility and isn't used anymore! */ #define FL_BROWSER_LINELENGTH 2048 /***** Routines *****/ FL_EXPORT FL_OBJECT * fl_create_browser( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_browser( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT void fl_clear_browser( FL_OBJECT * ob ); FL_EXPORT void fl_add_browser_line( FL_OBJECT * ob, const char * newtext ); FL_EXPORT void fl_add_browser_line_f( FL_OBJECT * ob, const char * fmt, ... ); FL_EXPORT void fl_addto_browser( FL_OBJECT * obj, const char * text ); FL_EXPORT void fl_addto_browser_f( FL_OBJECT * obj, const char * fmt, ...); #define fl_append_browser fl_addto_browser_chars FL_EXPORT void fl_addto_browser_chars( FL_OBJECT * ob, const char * str ); FL_EXPORT void fl_addto_browser_chars_f( FL_OBJECT * ob, const char * fmt, ... ); #define fl_append_browser_f fl_addto_browser_chars_f FL_EXPORT void fl_insert_browser_line( FL_OBJECT * ob, int linenumb, const char * newtext ); FL_EXPORT void fl_insert_browser_line_f( FL_OBJECT * ob, int linenumb, const char * fmt, ... ); FL_EXPORT void fl_delete_browser_line( FL_OBJECT * ob, int linenumb ); FL_EXPORT void fl_replace_browser_line( FL_OBJECT * ob, int linenumb, const char * newtext ); FL_EXPORT void fl_replace_browser_line_f( FL_OBJECT * ob, int linenumb, const char * fmt, ... ); FL_EXPORT const char *fl_get_browser_line( FL_OBJECT * ob, int linenumb ); FL_EXPORT int fl_load_browser( FL_OBJECT * ob, const char * filename ); FL_EXPORT void fl_select_browser_line( FL_OBJECT * ob, int line ); FL_EXPORT void fl_deselect_browser_line( FL_OBJECT * ob, int line ); FL_EXPORT void fl_deselect_browser( FL_OBJECT * ob ); FL_EXPORT int fl_isselected_browser_line( FL_OBJECT * ob, int line ); FL_EXPORT int fl_get_browser_topline( FL_OBJECT * ob ); FL_EXPORT int fl_get_browser( FL_OBJECT * ob ); FL_EXPORT int fl_get_browser_maxline( FL_OBJECT * ob ); FL_EXPORT int fl_get_browser_screenlines( FL_OBJECT * ob ); FL_EXPORT void fl_set_browser_topline( FL_OBJECT * ob, int line ); FL_EXPORT void fl_set_browser_bottomline( FL_OBJECT * ob, int line ); FL_EXPORT void fl_set_browser_fontsize( FL_OBJECT * ob, int size ); FL_EXPORT void fl_set_browser_fontstyle( FL_OBJECT * ob, int style ); FL_EXPORT void fl_set_browser_specialkey( FL_OBJECT * ob, int specialkey ); FL_EXPORT void fl_set_browser_vscrollbar( FL_OBJECT * ob, int on ); FL_EXPORT void fl_set_browser_hscrollbar( FL_OBJECT * ob, int on ); FL_EXPORT void fl_set_browser_line_selectable( FL_OBJECT * ob, int line, int flag ); FL_EXPORT void fl_get_browser_dimension( FL_OBJECT * ob, FL_Coord * x, FL_Coord * y, FL_Coord * w, FL_Coord * h ); FL_EXPORT void fl_set_browser_dblclick_callback( FL_OBJECT * ob, FL_CALLBACKPTR cb, long a ); FL_EXPORT FL_Coord fl_get_browser_xoffset( FL_OBJECT * ob ); FL_EXPORT double fl_get_browser_rel_xoffset( FL_OBJECT * ob ); FL_EXPORT void fl_set_browser_xoffset( FL_OBJECT * ob, FL_Coord npixels ); FL_EXPORT void fl_set_browser_rel_xoffset( FL_OBJECT * ob, double val ); FL_EXPORT FL_Coord fl_get_browser_yoffset( FL_OBJECT * ob ); FL_EXPORT double fl_get_browser_rel_yoffset( FL_OBJECT * ob ); FL_EXPORT void fl_set_browser_yoffset( FL_OBJECT * ob, FL_Coord npixels ); FL_EXPORT void fl_set_browser_rel_yoffset( FL_OBJECT * ob, double val ); FL_EXPORT void fl_set_browser_scrollbarsize( FL_OBJECT * ob, int hh, int vw ); FL_EXPORT void fl_show_browser_line( FL_OBJECT * ob, int j ); FL_EXPORT int fl_set_default_browser_maxlinelength( int n ); #ifndef FL_BROWSER_SCROLL_CALLBACKt #define FL_BROWSER_SCROLL_CALLBACKt typedef void ( * FL_BROWSER_SCROLL_CALLBACK )( FL_OBJECT *, int, void * ); #endif FL_EXPORT void fl_set_browser_hscroll_callback( FL_OBJECT *, FL_BROWSER_SCROLL_CALLBACK, void * ); FL_EXPORT void fl_set_browser_vscroll_callback( FL_OBJECT *, FL_BROWSER_SCROLL_CALLBACK, void * ); FL_EXPORT int fl_get_browser_line_yoffset( FL_OBJECT *, int ); FL_EXPORT FL_BROWSER_SCROLL_CALLBACK fl_get_browser_hscroll_callback( FL_OBJECT * ); FL_EXPORT FL_BROWSER_SCROLL_CALLBACK fl_get_browser_vscroll_callback( FL_OBJECT * ); FL_EXPORT int fl_get_browser_scrollbar_repeat( FL_OBJECT * ); FL_EXPORT void fl_set_browser_scrollbar_repeat( FL_OBJECT *, int ); #endif /* ! defined FL_BROWSER_H */ xforms-1.2.4/lib/include/XBasic.h0000664000175000017500000006746312353623325013516 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file XBasic.h * * X Window dependent stuff * */ #ifndef FL_XBASIC_H #define FL_XBASIC_H /* Draw mode */ enum { FL_XOR = GXxor, FL_COPY = GXcopy, FL_AND = GXand }; #define FL_MINDEPTH 1 /* FL_xxx does not do anything anymore, but kept for compatibility */ enum { FL_IllegalVisual = -1, FL_StaticGray = StaticGray, FL_GrayScale = GrayScale, FL_StaticColor = StaticColor, FL_PseudoColor = PseudoColor, FL_TrueColor = TrueColor, FL_DirectColor = DirectColor, FL_DefaultVisual = 10 /* special request */ }; enum { FL_North = NorthGravity, FL_NorthEast = NorthEastGravity, FL_NorthWest = NorthWestGravity, FL_South = SouthGravity, FL_SouthEast = SouthEastGravity, FL_SouthWest = SouthWestGravity, FL_East = EastGravity, FL_West = WestGravity, FL_NoGravity = ForgetGravity, FL_ForgetGravity = ForgetGravity }; #ifndef GreyScale #define GreyScale GrayScale #define StaticGrey StaticGray #endif #define FL_is_gray( v ) ( ( v ) == GrayScale || ( v ) == StaticGray ) #define FL_is_rgb( v ) ( ( v ) == TrueColor || ( v ) == DirectColor ) /* Internal colormap size. Not really very meaningful as fl_mapcolor * and company allow color "leakage", that is, although only FL_MAX_COLS * are kept in the internal colormap, the server might have substantially * more colors allocated */ #define FL_MAX_COLORS 1024 #define FL_MAX_COLS FL_MAX_COLORS /* FL graphics state information. Some are redundant. */ typedef struct { XVisualInfo * xvinfo; XFontStruct * cur_fnt; /* current font in default GC */ Colormap colormap; /* colormap valid for xvinfo */ Window trailblazer; /* a valid window for xvinfo */ int vclass, /* visual class and color depth */ depth; int rgb_bits; /* primary color resolution */ int dithered; /* true if dithered color */ int pcm; /* true if colormap is not shared */ GC gc[ 16 ]; /* working GC */ GC textgc[ 16 ]; /* GC used exclusively for text */ GC dimmedGC; /* A GC having a checkboard stipple */ unsigned long lut[ FL_MAX_COLS ]; /* secondary lookup table */ unsigned int rshift, rmask, rbits; unsigned int gshift, gmask, gbits; unsigned int bshift, bmask, bbits; } FL_State; #define FL_STATE FL_State /* for compatibility */ /***** Global variables ******/ FL_EXPORT Display *fl_display; FL_EXPORT int fl_screen; FL_EXPORT Window fl_root; /* root window */ FL_EXPORT Window fl_vroot; /* virtual root window */ FL_EXPORT int fl_scrh, /* screen dimension in pixels */ fl_scrw; FL_EXPORT int fl_vmode; #define fl_visual ( fl_state[ fl_vmode ].xvinfo->visual ) #define fl_colormap ( fl_state[ fl_vmode ].colormap ) #define fl_get_visual( ) ( fl_state[ fl_vmode ].xvinfo->visual ) #define fl_get_colormap( ) ( fl_state[ fl_vmode ].colormap ) /* Current version only runs in single visual mode */ #define fl_get_vclass( ) fl_vmode #define fl_get_form_vclass( a ) fl_vmode #define fl_get_gc( ) fl_state[ fl_vmode ].gc[ 0 ] FL_EXPORT FL_State fl_state[ ]; FL_EXPORT char *fl_ul_magic_char; FL_EXPORT double fl_dpi; #define fl_get_dpi( ) ( fl_dpi ) FL_EXPORT int fl_mode_capable( int mode, int warn ); #define fl_default_win( ) ( fl_state[ fl_vmode ].trailblazer ) #define fl_default_window( ) ( fl_state[ fl_vmode ].trailblazer ) /* All pixmaps used by FL_OBJECT to simulate double buffering have the * following entries in the structure. FL_Coord x,y are used to shift * the origin of the drawing routines */ struct FL_pixmap_ { Pixmap pixmap; Window win; Visual * visual; FL_Coord x, y, w, h; int depth; FL_COLOR dbl_background; FL_COLOR pixel; }; /* Fonts related */ #define FL_MAX_FONTSIZES 10 #define FL_MAX_FONTNAME_LENGTH 80 typedef struct { XFontStruct * fs[ FL_MAX_FONTSIZES ]; /* cached fontstruct */ short size[ FL_MAX_FONTSIZES ]; /* cached sizes */ short nsize; /* cached so far */ char fname[ FL_MAX_FONTNAME_LENGTH + 1 ]; /* without size info */ } FL_FONT; /* Some basic drawing routines */ typedef XPoint FL_POINT; typedef XRectangle FL_RECT; /* Rectangles */ FL_EXPORT void fl_rectangle( int fill, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col ); FL_EXPORT void fl_rectbound( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col ); #define fl_rectf( x, y, w, h, c) fl_rectangle( 1, x, y, w, h, c ) #define fl_rect( x, y, w, h, c ) fl_rectangle( 0, x, y, w, h, c ) /* Rectangle with rounded-corners */ FL_EXPORT void fl_roundrectangle( int fill, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col ); #define fl_roundrectf( x, y, w, h, c ) fl_roundrectangle( 1, x, y, w, h, c ) #define fl_roundrect( x, y, w, h, c ) fl_roundrectangle( 0, x, y, w, h, c ) /* General polygon and polylines */ FL_EXPORT void fl_polygon( int fill, FL_POINT * xp, int n, FL_COLOR col ); #define fl_polyf( p, n, c ) fl_polygon( 1, p, n, c ) #define fl_polyl( p, n, c ) fl_polygon( 0, p, n, c ) #define fl_polybound( p, n, c ) \ do { fl_polygon( 1, p, n, c ); \ fl_polygon( 0, p, n, FL_BLACK ); \ } while( 0 ) FL_EXPORT void fl_lines( FL_POINT * xp, int n, FL_COLOR col ); FL_EXPORT void fl_line( FL_Coord xi, FL_Coord yi, FL_Coord xf, FL_Coord yf, FL_COLOR c ); FL_EXPORT void fl_point( FL_Coord x, FL_Coord y, FL_COLOR c ); FL_EXPORT void fl_points( FL_POINT * p, int np, FL_COLOR c ); #define fl_simple_line fl_line FL_EXPORT void fl_dashedlinestyle( const char * dash, int ndash ); FL_EXPORT void fl_update_display( int block ); #define fl_diagline( x, y, w, h, c ) \ do \ { \ FL_COORD fli_x = ( x ), fli_y = ( y ); \ fl_line( fli_x, fli_y, fli_x + ( w ) - 1, fli_y + ( h ) - 1, ( c ) ); \ } while ( 0 ) /* Line attributes */ enum { FL_SOLID = LineSolid, FL_USERDASH = LineOnOffDash, FL_USERDOUBLEDASH = LineDoubleDash, FL_DOT, FL_DOTDASH, FL_DASH, FL_LONGDASH }; FL_EXPORT void fl_linewidth( int n ); FL_EXPORT void fl_linestyle( int n ); FL_EXPORT void fl_drawmode( int request ); FL_EXPORT int fl_get_linewidth( void ); FL_EXPORT int fl_get_linestyle( void ); FL_EXPORT int fl_get_drawmode( void ); #define fl_set_linewidth fl_linewidth #define fl_set_linestyle fl_linestyle #define fl_set_drawmode fl_drawmode /** Ellipses **/ FL_EXPORT void fl_circ( FL_COORD x, FL_COORD y, FL_COORD r, FL_COLOR col ); FL_EXPORT void fl_circf( FL_COORD x, FL_COORD y, FL_COORD r, FL_COLOR col ); FL_EXPORT void fl_circbound( FL_COORD x, FL_COORD y, FL_COORD r, FL_COLOR col ); FL_EXPORT void fl_oval( int fill, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col ); FL_EXPORT void fl_ovalbound( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col ); FL_EXPORT void fl_ovalarc( int fill, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int t0, int dt, FL_COLOR col ); #define fl_ovalf( x, y, w, h, c ) fl_oval( 1, x, y, w, h, c ) #define fl_ovall( x, y, w, h, c ) fl_oval( 0, x, y, w, h, c ) #define fl_oval_bound fl_ovalbound /* Arcs */ FL_EXPORT void fl_arcf( FL_COORD x, FL_Coord y, FL_COORD r, int a1, int a2, FL_COLOR col ); FL_EXPORT void fl_arc( FL_COORD x, FL_Coord y, FL_COORD r, int a1, int a2, FL_COLOR col ); FL_EXPORT void fl_pieslice( int fill, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int a1, int a2, FL_COLOR col ); /* High level drawing routines */ #define fl_drw_frame fl_draw_frame FL_EXPORT void fl_draw_frame( int style, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR c, int bw ); /* * Interfaces */ FL_EXPORT XFontStruct *fl_get_fontstruct( int style, int size ); #define fl_get_font_struct fl_get_fontstruct #define fl_get_fntstruct fl_get_font_struct FL_EXPORT Window fl_get_mouse( FL_Coord * x, FL_Coord * y, unsigned int * keymask ); FL_EXPORT void fl_set_mouse( FL_Coord mx, FL_Coord my ); FL_EXPORT Window fl_get_win_mouse( Window win, FL_Coord * x, FL_Coord * y, unsigned int * keymask ); FL_EXPORT Window fl_get_form_mouse( FL_FORM * fm, FL_Coord * x, FL_Coord * y, unsigned int * keymask ); FL_EXPORT FL_FORM * fl_win_to_form( Window win ); FL_EXPORT void fl_set_form_icon( FL_FORM * form, Pixmap p, Pixmap m ); FL_EXPORT int fl_get_decoration_sizes( FL_FORM * form, int * top, int * right, int * bottom, int * left ); FL_EXPORT void fl_raise_form( FL_FORM * form ); FL_EXPORT void fl_lower_form( FL_FORM * form ); FL_EXPORT void fl_set_foreground( GC gc, FL_COLOR color ); FL_EXPORT void fl_set_background( GC gc, FL_COLOR color ); /* General windowing support */ FL_EXPORT Window fl_wincreate( const char * label ); FL_EXPORT Window fl_winshow( Window win ); FL_EXPORT Window fl_winopen( const char * label ); FL_EXPORT void fl_winhide( Window win ); FL_EXPORT void fl_winclose( Window win ); FL_EXPORT void fl_winset( Window win ); FL_EXPORT int fl_winreparent( Window win, Window new_parent ); FL_EXPORT void fl_winfocus( Window win ); FL_EXPORT Window fl_winget( void ); FL_EXPORT int fl_iconify( Window win ); FL_EXPORT void fl_winresize( Window win, FL_Coord neww, FL_Coord newh ); FL_EXPORT void fl_winmove( Window win, FL_Coord dx, FL_Coord dy ); FL_EXPORT void fl_winreshape( Window win, FL_Coord dx, FL_Coord dy, FL_Coord w, FL_Coord h ); FL_EXPORT void fl_winicon( Window win, Pixmap p, Pixmap m ); FL_EXPORT void fl_winbackground( Window win, unsigned long bk ); FL_EXPORT void fl_winstepsize( Window win, FL_Coord dx, FL_Coord dy ); FL_EXPORT int fl_winisvalid( Window win ); FL_EXPORT void fl_wintitle( Window win, const char * title ); FL_EXPORT void fl_wintitle_f( Window win, const char * fmt, ... ); FL_EXPORT void fl_winicontitle( Window win, const char * title ); FL_EXPORT void fl_winicontitle_f( Window win, const char * fmt, ... ); FL_EXPORT void fl_winposition( FL_Coord x, FL_Coord y ); #define fl_pref_winposition fl_winposition #define fl_win_background fl_winbackground #define fl_winstepunit fl_winstepsize #define fl_set_winstepunit fl_winstepsize FL_EXPORT void fl_winminsize( Window win, FL_Coord w, FL_Coord h ); FL_EXPORT void fl_winmaxsize( Window win, FL_Coord w, FL_Coord h ); FL_EXPORT void fl_winaspect( Window win, FL_Coord x, FL_Coord y ); FL_EXPORT void fl_reset_winconstraints( Window win ); FL_EXPORT void fl_winsize( FL_Coord w, FL_Coord h ); FL_EXPORT void fl_initial_winsize( FL_Coord w, FL_Coord h ); #define fl_pref_winsize fl_winsize FL_EXPORT void fl_initial_winstate( int state ); FL_EXPORT Colormap fl_create_colormap( XVisualInfo * xv, int nfill ); FL_EXPORT void fl_wingeometry( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h ); #define fl_pref_wingeometry fl_wingeometry FL_EXPORT void fl_initial_wingeometry( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h ); FL_EXPORT void fl_noborder( void ); FL_EXPORT void fl_transient( void ); FL_EXPORT void fl_get_winsize( Window win, FL_Coord * w, FL_Coord * h ); FL_EXPORT void fl_get_winorigin( Window win, FL_Coord * x, FL_Coord * y ); FL_EXPORT void fl_get_wingeometry( Window win, FL_Coord * x, FL_Coord * y, FL_Coord * w, FL_Coord * h ); /* For compatibility */ #define fl_get_win_size fl_get_winsize #define fl_get_win_origin fl_get_winorigin #define fl_get_win_geometry fl_get_wingeometry #define fl_initial_winposition fl_pref_winposition #define fl_get_display( ) fl_display #define FL_FormDisplay( form ) fl_display #define FL_ObjectDisplay( object ) fl_display #define FL_IS_CANVAS( o ) \ ( ( o )->objclass == FL_CANVAS || ( o )->objclass == FL_GLCANVAS ) /* The window an object belongs to - for drawing */ #define FL_ObjWin( o ) \ ( FL_IS_CANVAS( o ) ? fl_get_canvas_id( o ) : ( o )->form->window ) FL_EXPORT Window fl_get_real_object_window( FL_OBJECT * ob ); #define FL_OBJECT_WID FL_ObjWin /* All registerable events, including Client Message */ #define FL_ALL_EVENT ( KeyPressMask \ | KeyReleaseMask \ | ButtonPressMask \ | ButtonReleaseMask \ | EnterWindowMask \ | LeaveWindowMask \ | ButtonMotionMask \ | PointerMotionMask ) /* Replacements for X functions that access the event queue */ FL_EXPORT int fl_XNextEvent( XEvent * xev ); FL_EXPORT int fl_XPeekEvent( XEvent * xev ); FL_EXPORT int fl_XEventsQueued( int mode ); FL_EXPORT void fl_XPutBackEvent( XEvent * xev ); FL_EXPORT const XEvent *fl_last_event( void ); typedef int ( * FL_APPEVENT_CB )( XEvent *, void * ); FL_EXPORT FL_APPEVENT_CB fl_set_event_callback( FL_APPEVENT_CB callback, void * user_data ); FL_EXPORT FL_APPEVENT_CB fl_set_idle_callback( FL_APPEVENT_CB callback, void * user_data ); FL_EXPORT long fl_addto_selected_xevent( Window win, long mask ); FL_EXPORT long fl_remove_selected_xevent( Window win, long mask ); #define fl_add_selected_xevent fl_addto_selected_xevent FL_EXPORT void fl_set_idle_delta( long delta ); FL_EXPORT FL_APPEVENT_CB fl_add_event_callback( Window win, int ev, FL_APPEVENT_CB wincb, void * user_data ); FL_EXPORT void fl_remove_event_callback( Window win, int ev ); FL_EXPORT void fl_activate_event_callbacks( Window win ); FL_EXPORT XEvent *fl_print_xevent_name( const char * where, const XEvent * xev ); FL_EXPORT void fl_XFlush( void ); #define metakey_down( mask ) ( ( mask ) & Mod1Mask ) #define shiftkey_down( mask ) ( ( mask ) & ShiftMask ) #define controlkey_down( mask ) ( ( mask ) & ControlMask ) #define button_down( mask ) ( ( ( mask ) & Button1Mask ) \ || ( ( mask ) & Button2Mask ) \ || ( ( mask ) & Button3Mask ) \ || ( ( mask ) & Button4Mask ) \ || ( ( mask ) & Button5Mask ) ) #define fl_keypressed fl_keysym_pressed /****************** Resources ***************/ typedef enum { FL_NONE, FL_SHORT = 10, FL_BOOL, FL_INT, FL_LONG, FL_FLOAT, FL_STRING } FL_RTYPE; typedef struct { const char * res_name; /* resource name */ const char * res_class; /* resource class */ FL_RTYPE type; /* FL_INT, FL_FLOAT, FL_BOOL, FL_STRING */ void * var; /* address for the variable */ const char * defval; /* default setting in string form */ int nbytes; /* used only for strings */ } FL_RESOURCE; #define FL_resource FL_RESOURCE #define FL_CMD_OPT XrmOptionDescRec FL_EXPORT Display * fl_initialize( int * na, char * arg[ ], const char * appclass, FL_CMD_OPT * appopt, int nappopt ); FL_EXPORT void fl_finish( void ); FL_EXPORT const char * fl_get_resource( const char * rname, const char * cname, FL_RTYPE dtype, const char * defval, void * val, int size ); FL_EXPORT void fl_set_resource( const char * str, const char * val ); FL_EXPORT void fl_get_app_resources( FL_RESOURCE * appresource, int n ); FL_EXPORT void fl_set_visualID( long id ); FL_EXPORT int fl_keysym_pressed( KeySym k ); #define buttonLabelSize buttonFontSize #define sliderLabelSize sliderFontSize #define inputLabelSize inputFontSize /* All Form control variables. Named closely as its resource name */ typedef struct { float rgamma, ggamma, bgamma; int debug, sync; int depth, vclass, doubleBuffer; int ulPropWidth, /* underline stuff */ ulThickness; int buttonFontSize; int sliderFontSize; int inputFontSize; int browserFontSize; int menuFontSize; int choiceFontSize; int labelFontSize; /* all other labels fonts */ int pupFontSize, /* font for pop-up menus */ pupFontStyle; int privateColormap; int sharedColormap; int standardColormap; int scrollbarType; int backingStore; int coordUnit; int borderWidth; int safe; char * rgbfile; /* where RGB file is, not used */ char vname[ 24 ]; } FL_IOPT; #define FL_PDButtonLabelSize FL_PDButtonFontSize #define FL_PDSliderLabelSize FL_PDSliderFontSize #define FL_PDInputLabelSize FL_PDInputFontSize /* Program default masks */ enum { FL_PDDepth = ( 1 << 1 ), FL_PDClass = ( 1 << 2 ), FL_PDDouble = ( 1 << 3 ), FL_PDSync = ( 1 << 4 ), FL_PDPrivateMap = ( 1 << 5 ), FL_PDScrollbarType = ( 1 << 6 ), FL_PDPupFontSize = ( 1 << 7 ), FL_PDButtonFontSize = ( 1 << 8 ), FL_PDInputFontSize = ( 1 << 9 ), FL_PDSliderFontSize = ( 1 << 10 ), FL_PDVisual = ( 1 << 11 ), FL_PDULThickness = ( 1 << 12 ), FL_PDULPropWidth = ( 1 << 13 ), FL_PDBS = ( 1 << 14 ), FL_PDCoordUnit = ( 1 << 15 ), FL_PDDebug = ( 1 << 16 ), FL_PDSharedMap = ( 1 << 17 ), FL_PDStandardMap = ( 1 << 18 ), FL_PDBorderWidth = ( 1 << 19 ), FL_PDSafe = ( 1 << 20 ), FL_PDMenuFontSize = ( 1 << 21 ), FL_PDBrowserFontSize = ( 1 << 22 ), FL_PDChoiceFontSize = ( 1 << 23 ), FL_PDLabelFontSize = ( 1 << 24 ) }; #define FL_PDButtonLabel FL_PDButtonLabelSize FL_EXPORT void fl_set_defaults( unsigned long mask, FL_IOPT * cntl ); FL_EXPORT void fl_set_tabstop( const char * s ); FL_EXPORT int fl_get_visual_depth( void ); FL_EXPORT int fl_is_global_clipped( void ); FL_EXPORT int fl_is_clipped( int include_global ); FL_EXPORT int fl_is_text_clipped( int include_global ); FL_EXPORT void fl_set_clipping( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h ); FL_EXPORT void fl_unset_clipping( void ); FL_EXPORT void fl_set_text_clipping( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h ); FL_EXPORT void fl_unset_text_clipping( void ); FL_EXPORT int fl_get_global_clipping( FL_COORD * x, FL_COORD * y, FL_COORD * w, FL_COORD * h ); FL_EXPORT int fl_get_clipping( int include_global, FL_COORD * x, FL_COORD * y, FL_COORD * w, FL_COORD * h ); FL_EXPORT int fl_get_text_clipping( int include_global, FL_COORD * x, FL_COORD * y, FL_COORD * w, FL_COORD * h ); FL_EXPORT void fl_set_gc_clipping( GC gc, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h ); FL_EXPORT void fl_unset_gc_clipping( GC gc ); /* How we pack and unpack colors */ #ifndef FL_PCBITS typedef unsigned char FL_PCTYPE; /* primary color type */ #define FL_PCBITS 8 /* primary color bits */ #define FL_PCMAX ( ( 1 << FL_PCBITS ) - 1 ) #define FL_PCCLAMP( a ) \ ( ( a ) > ( FL_PCMAX ) ? ( FL_PCMAX ) : ( ( a ) < 0 ? 0 : ( a ) ) ) typedef unsigned int FL_PACKED4; #define FL_PACKED FL_PACKED4 #define FL_RMASK 0x000000ff #define FL_RSHIFT 0 #define FL_GMASK 0x0000ff00 #define FL_GSHIFT 8 #define FL_BMASK 0x00ff0000 #define FL_BSHIFT 16 #define FL_AMASK 0xff000000 #define FL_ASHIFT 24 /* If PCBITS is not 8, we need to apply the RGBmask */ #define FL_GETR( packed ) ( ( ( packed ) >> FL_RSHIFT ) & FL_RMASK ) #define FL_GETG( packed ) ( ( ( packed ) >> FL_GSHIFT ) & FL_PCMAX ) #define FL_GETB( packed ) ( ( ( packed ) >> FL_BSHIFT ) & FL_PCMAX ) #define FL_GETA( packed ) ( ( ( packed ) >> FL_ASHIFT ) & FL_PCMAX ) #define FL_PACK3( r, g, b ) \ ( ( ( r ) << FL_RSHIFT ) | ( ( g ) << FL_GSHIFT ) | ( ( b ) << FL_BSHIFT ) ) #define FL_PACK FL_PACK3 #define FL_PACK4( r, g, b, a ) ( FL_PACK3( r, g, b ) | ( ( a ) << FL_ASHIFT ) ) #define FL_UNPACK( p, r, g, b ) \ do { r = FL_GETR( p ); \ g = FL_GETG( p ); \ b = FL_GETB( p ); \ } while( 0 ) #define FL_UNPACK3 FL_UNPACK #define FL_UNPACK4( p, r, g, b, a ) \ do { FL_UNPACK3( p, r, g, b ); \ a = FL_GETA( p ); \ } while( 0 ) #endif typedef struct { unsigned int rshift, rmask, rbits; unsigned int gshift, gmask, gbits; unsigned int bshift, bmask, bbits; int bits_per_rgb; int colormap_size; } FL_RGB2PIXEL_; #define FL_RGB2PIXEL FL_RGB2PIXEL_ #endif /* ! defined FL_XBASIC_H */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/include/clock.h0000664000175000017500000000426312353623325013425 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file clock.h */ #ifndef FL_CLOCK_H #define FL_CLOCK_H enum { FL_ANALOG_CLOCK, FL_DIGITAL_CLOCK }; #define FL_CLOCK_BOXTYPE FL_UP_BOX #define FL_CLOCK_COL1 FL_INACTIVE_COL #define FL_CLOCK_COL2 FL_BOTTOM_BCOL #define FL_CLOCK_LCOL FL_BLACK #define FL_CLOCK_ALIGN FL_ALIGN_BOTTOM #define FL_CLOCK_TOPCOL FL_COL1 FL_EXPORT FL_OBJECT * fl_create_clock( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * s ); FL_EXPORT FL_OBJECT * fl_add_clock( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * s ); FL_EXPORT void fl_get_clock( FL_OBJECT * ob, int * h, int * m, int * s ); FL_EXPORT long fl_set_clock_adjustment( FL_OBJECT * ob, long offset ); FL_EXPORT void fl_set_clock_ampm( FL_OBJECT * ob, int y ); #endif /* ! defined FL_CLOCK_H */ xforms-1.2.4/lib/include/input.h0000664000175000017500000001705112353623325013470 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file input.h */ #ifndef FL_INPUT_H #define FL_INPUT_H /***** Types *****/ typedef enum { FL_NORMAL_INPUT, FL_FLOAT_INPUT, FL_INT_INPUT, FL_DATE_INPUT, FL_MULTILINE_INPUT, FL_HIDDEN_INPUT, FL_SECRET_INPUT } FL_INPUT_TYPE; /* for date input */ enum { FL_INPUT_MMDD, FL_INPUT_DDMM }; enum { FL_NORMAL_INPUT_MODE, FL_DOS_INPUT_MODE }; /***** Defaults *****/ #define FL_INPUT_BOXTYPE FL_DOWN_BOX #define FL_INPUT_COL1 FL_COL1 #define FL_INPUT_COL2 FL_MCOL #define FL_INPUT_LCOL FL_LCOL #define FL_INPUT_ALIGN FL_ALIGN_LEFT /***** Others *****/ #define FL_INPUT_TCOL FL_LCOL #define FL_INPUT_CCOL FL_BLUE #define FL_RINGBELL ( 1 << 4 ) /***** Routines *****/ FL_EXPORT FL_OBJECT * fl_create_input( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_input( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT void fl_set_input( FL_OBJECT * ob, const char * str ); FL_EXPORT void fl_set_input_f( FL_OBJECT * obj, const char * fmt, ... ); FL_EXPORT void fl_set_input_return( FL_OBJECT * ob, unsigned int when ); FL_EXPORT void fl_set_input_color( FL_OBJECT * ob, FL_COLOR textcol, FL_COLOR curscol ); FL_EXPORT void fl_get_input_color( FL_OBJECT * ob, FL_COLOR * textcol, FL_COLOR * curscol ); FL_EXPORT void fl_set_input_scroll( FL_OBJECT * ob, int yes ); FL_EXPORT void fl_set_input_cursorpos( FL_OBJECT * ob, int xpos, int ypos ); FL_EXPORT void fl_set_input_selected( FL_OBJECT * ob, int yes ); FL_EXPORT void fl_set_input_selected_range( FL_OBJECT * ob, int begin, int end ); FL_EXPORT const char *fl_get_input_selected_range( FL_OBJECT * ob, int * begin, int * end ); FL_EXPORT void fl_set_input_maxchars( FL_OBJECT * ob, int maxchars ); FL_EXPORT void fl_set_input_format( FL_OBJECT * ob, int fmt, int sep ); FL_EXPORT void fl_set_input_hscrollbar( FL_OBJECT * ob, int pref ); FL_EXPORT void fl_set_input_vscrollbar( FL_OBJECT * ob, int pref ); FL_EXPORT void fl_set_input_topline( FL_OBJECT * ob, int top ); FL_EXPORT void fl_set_input_scrollbarsize( FL_OBJECT * ob, int hh, int vw ); FL_EXPORT void fl_get_input_scrollbarsize( FL_OBJECT * ob, int * hh, int * vw ); FL_EXPORT void fl_set_input_xoffset( FL_OBJECT * ob, int xoff ); FL_EXPORT int fl_get_input_xoffset( FL_OBJECT * ob ); FL_EXPORT int fl_set_input_fieldchar( FL_OBJECT * ob, int fchar ); FL_EXPORT int fl_get_input_topline( FL_OBJECT * ob ); FL_EXPORT int fl_get_input_screenlines( FL_OBJECT * ob ); FL_EXPORT int fl_get_input_cursorpos( FL_OBJECT * ob, int * x, int * y ); FL_EXPORT void fl_set_input_cursor_visible( FL_OBJECT * ob, int visible ); FL_EXPORT int fl_get_input_numberoflines( FL_OBJECT * ob ); FL_EXPORT void fl_get_input_format( FL_OBJECT * ob, int * fmt, int * sep ); FL_EXPORT const char * fl_get_input( FL_OBJECT * ob ); typedef int ( * FL_INPUT_VALIDATOR )(FL_OBJECT *, const char *, const char *, int ); #define FL_INPUTVALIDATOR FL_INPUT_VALIDATOR FL_EXPORT FL_INPUT_VALIDATOR fl_set_input_filter( FL_OBJECT * ob, FL_INPUT_VALIDATOR validate ); FL_EXPORT int fl_validate_input( FL_OBJECT *obj ); #define fl_set_input_shortcut fl_set_object_shortcut /* edit keys. */ typedef struct { /* basic editing */ long del_prev_char; /* delete previous char */ long del_next_char; /* delete next char */ long del_prev_word; /* delete previous word */ long del_next_word; /* delete next word */ /* movement */ long moveto_prev_line; /* one line up */ long moveto_next_line; /* one line down */ long moveto_prev_char; /* one char left */ long moveto_next_char; /* one char right */ long moveto_prev_word; /* one word left */ long moveto_next_word; /* one word right */ long moveto_prev_page; /* one page up */ long moveto_next_page; /* one page down */ long moveto_bol; /* move to begining of line */ long moveto_eol; /* move to end of line */ long moveto_bof; /* move to begin of file */ long moveto_eof; /* move to end of file */ /* misc. stuff */ long transpose; /* switch two char positions */ long paste; /* paste the edit buffer */ long backspace; /* another del_prev_char */ long del_to_bol; /* cut to begining of line */ long del_to_eol; /* cut to end of line */ long clear_field; /* delete everything */ long del_to_eos; /* not implemented */ } FL_EditKeymap; FL_EXPORT void fl_set_input_editkeymap( const FL_EditKeymap * keymap ); FL_EXPORT void fl_get_input_editkeymap( FL_EditKeymap * keymap ); FL_EXPORT void fl_set_default_editkeymap( void ); FL_EXPORT int fl_set_input_mode( int mode ); #endif /* ! defined FL_INPUT_H */ xforms-1.2.4/lib/include/box.h0000664000175000017500000000302612353623325013116 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file box.h * */ #ifndef FL_BOX_H #define FL_BOX_H /* Type is already defined in Basic.h */ FL_EXPORT FL_OBJECT * fl_create_box( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_box( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); #endif /* ! defined FL_BOX_H */ xforms-1.2.4/lib/include/flps.h0000664000175000017500000000360712353623325013277 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file flps.h */ #ifndef FLPS_H #define FLPS_H /* postscript stuff */ enum { FLPS_AUTO, /* switch to landscale if does not fit */ FLPS_LANDSCAPE, /* landscape always */ FLPS_PORTRAIT, /* portrait always */ FLPS_BESTFIT /* even margins/best fit */ }; enum { FLPS_BW = -1, FLPS_GRAYSCALE, FLPS_COLOR }; typedef struct { int ps_color; int orientation; int auto_fit; int drawbox; int eps; float xdpi, ydpi; float paper_w, paper_h; float gamma; const char * tmpdir; int printer_dpi; float hm, vm; float xscale, yscale; int scale_text; int first_page_only; int clip; } FLPS_CONTROL; FL_EXPORT FLPS_CONTROL * flps_init( void ); FL_EXPORT int fl_object_ps_dump( FL_OBJECT * ob, const char * fname ); #endif /* ! defined FLPS_H */ xforms-1.2.4/lib/include/chart.h0000664000175000017500000000754212353623325013436 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file chart.h * * Object Class: Chart * */ #ifndef FL_CHART_H #define FL_CHART_H typedef enum { FL_BAR_CHART, FL_HORBAR_CHART, FL_LINE_CHART, FL_FILL_CHART, FL_SPIKE_CHART, FL_PIE_CHART, FL_SPECIALPIE_CHART } FL_CHART_TYPE; #define FL_FILLED_CHART FL_FILL_CHART /* for backward compatibility */ /***** Defaults *****/ #define FL_CHART_BOXTYPE FL_BORDER_BOX #define FL_CHART_COL1 FL_COL1 #define FL_CHART_LCOL FL_LCOL #define FL_CHART_ALIGN FL_ALIGN_BOTTOM /***** Others *****/ #define FL_CHART_MAX 2048 /***** Routines *****/ FL_EXPORT FL_OBJECT * fl_create_chart( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_chart( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT void fl_clear_chart( FL_OBJECT * ob ); FL_EXPORT void fl_add_chart_value( FL_OBJECT * ob, double val, const char * str, FL_COLOR col ); FL_EXPORT void fl_insert_chart_value( FL_OBJECT * ob, int indx, double val, const char * str, FL_COLOR col ); FL_EXPORT void fl_replace_chart_value( FL_OBJECT * ob, int indx, double val, const char * str, FL_COLOR col ); FL_EXPORT void fl_set_chart_bounds( FL_OBJECT * ob, double min, double max ); FL_EXPORT void fl_get_chart_bounds( FL_OBJECT * ob, double * min, double * max ); FL_EXPORT void fl_set_chart_maxnumb( FL_OBJECT * ob, int maxnumb ); FL_EXPORT void fl_set_chart_autosize( FL_OBJECT * ob, int autosize ); FL_EXPORT void fl_set_chart_lstyle( FL_OBJECT * ob, int lstyle ); FL_EXPORT void fl_set_chart_lsize( FL_OBJECT * ob, int lsize ); FL_EXPORT void fl_set_chart_lcolor( FL_OBJECT * ob, FL_COLOR lcol ); FL_EXPORT void fl_set_chart_baseline( FL_OBJECT * ob, int iYesNo ); #define fl_set_chart_lcol fl_set_chart_lcolor #endif /* ! defined FL_CHART_H */ xforms-1.2.4/lib/include/goodies.h0000664000175000017500000002035112353623325013757 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file goodies.h */ #ifndef FL_GOODIES_H #define FL_GOODIES_H /***** Resources and misc. goodie routines ******/ #define FLAlertDismissLabel "flAlert.dismiss.label" #define FLAlertTitle "flAlert.title" #define FLQuestionYesLabel "flQuestion.yes.label" #define FLQuestionNoLabel "flQuestion.no.label" #define FLQuestionTitle "flQuestion.title" #define FLOKLabel "flInput.ok.label" #define FLInputClearLabel "flInput.clear.label" #define FLInputCancelLabel "flInput.cancel.label" #define FLInputTitle "flInput.title" #define FLChoiceTitle "flChoice.title" FL_EXPORT void fl_set_goodies_font( int style, int size ); /*********** messages and questions **************/ FL_EXPORT void fl_show_message( const char *, const char *, const char * ); FL_EXPORT void fl_show_messages( const char * ); #define fl_show_msg fl_show_messages_f FL_EXPORT void fl_show_messages_f( const char *, ... ); FL_EXPORT void fl_hide_message( void ); #define fl_hide_msg fl_hide_message #define fl_hide_messages fl_hide_message FL_EXPORT int fl_show_question( const char *, int ); FL_EXPORT void fl_hide_question( void ); FL_EXPORT void fl_show_alert( const char *, const char *, const char *, int ); #define fl_show_alert2 fl_show_alert_f FL_EXPORT void fl_show_alert_f( int c, const char * fmt, ... ); FL_EXPORT void fl_hide_alert( void ); FL_EXPORT const char * fl_show_input( const char *, const char * ); FL_EXPORT void fl_hide_input( void ); FL_EXPORT const char * fl_show_simple_input( const char *, const char * ); FL_EXPORT int fl_show_colormap( int ); /********* choices *****************/ FL_EXPORT int fl_show_choices( const char *, int, const char *, const char *, const char *, int ); FL_EXPORT int fl_show_choice( const char *, const char *, const char *, int, const char *, const char *, const char *, int ); FL_EXPORT void fl_hide_choice( void ); FL_EXPORT void fl_set_choices_shortcut( const char *, const char *, const char * ); #define fl_set_choice_shortcut fl_set_choices_shortcut /************ one liner ***************/ FL_EXPORT void fl_show_oneliner( const char *, FL_Coord, FL_Coord ); FL_EXPORT void fl_hide_oneliner( void ); FL_EXPORT void fl_set_oneliner_font( int, int ); FL_EXPORT void fl_set_oneliner_color( FL_COLOR, FL_COLOR ); FL_EXPORT void fl_set_tooltip_font( int, int ); FL_EXPORT void fl_set_tooltip_color( FL_COLOR, FL_COLOR ); FL_EXPORT void fl_set_tooltip_boxtype( int ); FL_EXPORT void fl_set_tooltip_lalign( int ); /************* command log **************/ typedef struct { FL_FORM * form; void * vdata; /* UNUSED, remove in later version */ char * cdata; /* UNUSED, remove in later version */ long ldata; /* UNUSED, remove in later version */ FL_OBJECT * browser; FL_OBJECT * close_browser; FL_OBJECT * clear_browser; } FD_CMDLOG; #ifdef FL_WIN32 #define FL_PID_T HANDLE #else #define FL_PID_T long #endif FL_EXPORT FL_PID_T fl_exe_command( const char *, int ); FL_EXPORT int fl_end_command( FL_PID_T ); FL_EXPORT int fl_check_command( FL_PID_T ); FL_EXPORT FILE * fl_popen( const char *, const char * ); FL_EXPORT int fl_pclose( FILE * ); FL_EXPORT int fl_end_all_command( void ); FL_EXPORT void fl_show_command_log( int ); FL_EXPORT void fl_hide_command_log( void ); FL_EXPORT void fl_clear_command_log( void ); FL_EXPORT void fl_addto_command_log( const char * ); FL_EXPORT void fl_addto_command_log_f( const char *, ...); FL_EXPORT void fl_set_command_log_position( int, int ); FL_EXPORT FD_CMDLOG * fl_get_command_log_fdstruct( void ); /* Aliases */ #define fl_open_command fl_exe_command #define fl_close_command fl_end_command /******* File selector *****************/ #define FL_MAX_FSELECTOR 6 typedef struct { FL_FORM * fselect; void * vdata; void * cdata; long ldata; FL_OBJECT * browser, * input, * prompt, * resbutt; FL_OBJECT * patbutt, * dirbutt, * cancel, * ready; FL_OBJECT * dirlabel, * patlabel; FL_OBJECT * appbutt[ 3 ]; } FD_FSELECTOR; FL_EXPORT int fl_use_fselector( int ); FL_EXPORT const char * fl_show_fselector( const char *, const char *, const char *, const char * ); FL_EXPORT void fl_hide_fselector( void ); FL_EXPORT void fl_set_fselector_fontsize( int ); FL_EXPORT void fl_set_fselector_fontstyle( int ); FL_EXPORT void fl_set_fselector_placement( int ); FL_EXPORT void fl_set_fselector_border( int ); #define fl_set_fselector_transient( b ) \ fl_set_fselector_border( ( b ) ? FL_TRANSIENT : FL_FULLBORDER ) FL_EXPORT void fl_set_fselector_callback( FL_FSCB, void * ); FL_EXPORT const char * fl_get_filename( void ); FL_EXPORT const char * fl_get_directory( void ); FL_EXPORT const char * fl_get_pattern( void ); FL_EXPORT int fl_set_directory( const char * ); FL_EXPORT void fl_set_pattern( const char * ); FL_EXPORT void fl_refresh_fselector( void ); FL_EXPORT void fl_add_fselector_appbutton( const char *, void ( * )( void * ), void * ); FL_EXPORT void fl_remove_fselector_appbutton( const char * ); FL_EXPORT void fl_disable_fselector_cache( int ); FL_EXPORT void fl_invalidate_fselector_cache( void ); FL_EXPORT FL_FORM * fl_get_fselector_form( void ); FL_EXPORT FD_FSELECTOR * fl_get_fselector_fdstruct( void ); FL_EXPORT void fl_hide_fselector( void ); FL_EXPORT void fl_set_fselector_filetype_marker( int, int, int, int, int ); #define fl_show_file_selector fl_show_fselector #define fl_set_fselector_cb fl_set_fselector_callback #define fl_set_fselector_title( s ) \ fl_set_form_title( fl_get_fselector_form( ), s ) FL_EXPORT int fl_goodies_atclose( FL_FORM *, void * ); FL_EXPORT int fl_show_color_chooser( const int * rgb_in, int * rgb_out ); #endif /* ! defined FL_GOODIES_H */ xforms-1.2.4/lib/include/formbrowser.h0000664000175000017500000001033412353623325014675 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file formbrowser.h * */ #ifndef FL_FORMBROWSER_H #define FL_FORMBROWSER_H enum { FL_NORMAL_FORMBROWSER }; enum { FL_SMOOTH_SCROLL, FL_JUMP_SCROLL }; #define FL_FORMBROWSER_BOXTYPE FL_DOWN_BOX #define FL_FORMBROWSER_COL1 FL_COL1 #define FL_FORMBROWSER_ALIGN FL_ALIGN_TOP FL_EXPORT int fl_addto_formbrowser( FL_OBJECT * ob, FL_FORM * form ); FL_EXPORT FL_FORM * fl_delete_formbrowser_bynumber( FL_OBJECT * ob, int num ); FL_EXPORT int fl_delete_formbrowser( FL_OBJECT * ob, FL_FORM * form ); FL_EXPORT FL_FORM * fl_replace_formbrowser( FL_OBJECT * ob, int num, FL_FORM * form ); FL_EXPORT int fl_insert_formbrowser( FL_OBJECT * ob, int line, FL_FORM * new_form ); FL_EXPORT int fl_get_formbrowser_area( FL_OBJECT * ob, int * x, int * y, int * w, int * h ); FL_EXPORT void fl_set_formbrowser_scroll( FL_OBJECT * ob, int how ); FL_EXPORT void fl_set_formbrowser_hscrollbar( FL_OBJECT * ob, int how ); FL_EXPORT void fl_set_formbrowser_vscrollbar( FL_OBJECT * ob, int how ); FL_EXPORT FL_FORM *fl_get_formbrowser_topform( FL_OBJECT * ob ); FL_EXPORT int fl_set_formbrowser_topform( FL_OBJECT * ob, FL_FORM * form ); FL_EXPORT FL_FORM * fl_set_formbrowser_topform_bynumber( FL_OBJECT * ob, int n ); FL_EXPORT int fl_set_formbrowser_xoffset( FL_OBJECT * ob, int offset ); FL_EXPORT int fl_set_formbrowser_yoffset( FL_OBJECT * ob, int offset ); FL_EXPORT int fl_get_formbrowser_xoffset( FL_OBJECT * ob ); FL_EXPORT int fl_get_formbrowser_yoffset( FL_OBJECT * ob ); FL_EXPORT int fl_find_formbrowser_form_number( FL_OBJECT * ob, FL_FORM * form ); FL_EXPORT FL_OBJECT * fl_add_formbrowser( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_create_formbrowser( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT int fl_get_formbrowser_numforms( FL_OBJECT * ob ); #define fl_get_formbrowser_forms fl_get_formbrowser_numforms FL_EXPORT FL_FORM * fl_get_formbrowser_form( FL_OBJECT * ob, int n ); #endif /* ! defined FL_FORMBROWSER_H */ xforms-1.2.4/lib/include/positioner.h0000664000175000017500000001043012353623325014516 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file positioner.h */ #ifndef FL_POSITIONER_H #define FL_POSITIONER_H #define FL_NORMAL_POSITIONER 0 #define FL_OVERLAY_POSITIONER 1 #define FL_INVISIBLE_POSITIONER 2 /***** Defaults *****/ #define FL_POSITIONER_BOXTYPE FL_DOWN_BOX #define FL_POSITIONER_COL1 FL_COL1 #define FL_POSITIONER_COL2 FL_RED #define FL_POSITIONER_LCOL FL_LCOL #define FL_POSITIONER_ALIGN FL_ALIGN_BOTTOM typedef int ( * FL_POSITIONER_VALIDATOR )( FL_OBJECT * obj, double x, double y, double * x_repl, double * y_repl ); #define FL_POSITIONER_INVALID 0 #define FL_POSITIONER_VALID 1 #define FL_POSITIONER_REPLACED 2 /***** Routines *****/ FL_EXPORT FL_OBJECT * fl_create_positioner( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_positioner( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT int fl_set_positioner_values( FL_OBJECT * obj, double new_x, double new_y ); FL_EXPORT int fl_set_positioner_xvalue( FL_OBJECT * ob, double val ); FL_EXPORT double fl_get_positioner_xvalue( FL_OBJECT * ob ); FL_EXPORT void fl_set_positioner_xbounds( FL_OBJECT * ob, double min, double max ); FL_EXPORT void fl_get_positioner_xbounds( FL_OBJECT * ob, double * min, double * max ); FL_EXPORT int fl_set_positioner_yvalue( FL_OBJECT * ob, double val ); FL_EXPORT double fl_get_positioner_yvalue( FL_OBJECT * ob ); FL_EXPORT void fl_set_positioner_ybounds( FL_OBJECT * ob, double min, double max ); FL_EXPORT void fl_get_positioner_ybounds( FL_OBJECT * ob, double * min, double * max ); FL_EXPORT void fl_set_positioner_xstep( FL_OBJECT * ob, double value ); FL_EXPORT double fl_get_positioner_xstep( FL_OBJECT * ob ); FL_EXPORT void fl_set_positioner_ystep( FL_OBJECT * ob, double value ); FL_EXPORT double fl_get_positioner_ystep( FL_OBJECT * ob ); FL_EXPORT void fl_set_positioner_return( FL_OBJECT * ob, unsigned int when ); FL_EXPORT void fl_set_positioner_mouse_buttons( FL_OBJECT * obj, unsigned int mouse_buttons ); FL_EXPORT void fl_get_positioner_mouse_buttons( FL_OBJECT * obj, unsigned int * mouse_buttons ); FL_EXPORT int fl_get_positioner_numb( FL_OBJECT * obj ); FL_EXPORT FL_POSITIONER_VALIDATOR fl_set_positioner_validator( FL_OBJECT * obj, FL_POSITIONER_VALIDATOR validator ); FL_EXPORT void fl_reset_positioner( FL_OBJECT * obj ); #endif /* ! defined FL_POSITIONER_H */ xforms-1.2.4/lib/include/thumbwheel.h0000664000175000017500000000547312353623325014502 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file thumbwheel.h */ #ifndef FL_THUMBWHEEL_H #define FL_THUMBWHEEL_H enum { FL_VERT_THUMBWHEEL, FL_HOR_THUMBWHEEL }; /* defaults */ #define FL_THUMBWHEEL_COL1 FL_COL1 #define FL_THUMBWHEEL_COL2 FL_COL1 #define FL_THUMBWHEEL_LCOL FL_BLACK #define FL_THUMBWHEEL_BOXTYPE FL_BORDER_BOX #define FL_THUMBWHEEL_ALIGN FL_ALIGN_BOTTOM FL_EXPORT double fl_get_thumbwheel_value( FL_OBJECT * ob ); FL_EXPORT double fl_set_thumbwheel_value( FL_OBJECT * ob, double value ); FL_EXPORT double fl_get_thumbwheel_step( FL_OBJECT * ob ); FL_EXPORT double fl_set_thumbwheel_step( FL_OBJECT * ob, double step ); FL_EXPORT int fl_set_thumbwheel_return( FL_OBJECT * ob, unsigned int when ); FL_EXPORT int fl_set_thumbwheel_crossover( FL_OBJECT * ob, int flag ); FL_EXPORT void fl_set_thumbwheel_bounds( FL_OBJECT * ob, double min, double max ); FL_EXPORT void fl_get_thumbwheel_bounds( FL_OBJECT * ob, double * min, double * max ); FL_EXPORT FL_OBJECT * fl_create_thumbwheel( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_thumbwheel( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); #endif /* ! defined FL_THUMBWHEEL_H */ xforms-1.2.4/lib/include/choice.h0000664000175000017500000001054212353623325013561 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file choice.h * */ #ifndef FL_CHOICE_H #define FL_CHOICE_H typedef enum { FL_NORMAL_CHOICE, FL_NORMAL_CHOICE2, FL_DROPLIST_CHOICE, FL_BROWSER_CHOICE } FL_CHOICE_TYPE; #define FL_SIMPLE_CHOICE FL_NORMAL_CHOICE /***** Defaults *****/ #define FL_CHOICE_BOXTYPE FL_ROUNDED_BOX #define FL_CHOICE_COL1 FL_COL1 #define FL_CHOICE_COL2 FL_LCOL #define FL_CHOICE_LCOL FL_LCOL #define FL_CHOICE_ALIGN FL_ALIGN_LEFT /***** Others *****/ #define FL_CHOICE_MCOL FL_MCOL #define FL_CHOICE_MAXITEMS 128 /***** Routines *****/ FL_EXPORT FL_OBJECT * fl_create_choice( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_choice( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT void fl_clear_choice( FL_OBJECT * ob ); FL_EXPORT int fl_addto_choice( FL_OBJECT * ob, const char * str ); FL_EXPORT int fl_addto_choice_f( FL_OBJECT * ob, const char * fmt, ... ); FL_EXPORT void fl_replace_choice( FL_OBJECT * ob, int numb, const char * str ); FL_EXPORT void fl_replace_choice_f( FL_OBJECT * ob, int numb, const char * fmt, ... ); FL_EXPORT void fl_delete_choice( FL_OBJECT * ob, int numb ); FL_EXPORT void fl_set_choice( FL_OBJECT * ob, int choice ); FL_EXPORT void fl_set_choice_text( FL_OBJECT * ob, const char * txt ); FL_EXPORT void fl_set_choice_text_f( FL_OBJECT * ob, const char * fmt, ... ); FL_EXPORT int fl_get_choice( FL_OBJECT * ob ); FL_EXPORT const char * fl_get_choice_item_text( FL_OBJECT * ob, int n ); FL_EXPORT int fl_get_choice_maxitems( FL_OBJECT * ob ); FL_EXPORT const char * fl_get_choice_text( FL_OBJECT * ob ); FL_EXPORT void fl_set_choice_fontsize( FL_OBJECT * ob, int size ); FL_EXPORT void fl_set_choice_fontstyle( FL_OBJECT * ob, int style ); FL_EXPORT void fl_set_choice_align( FL_OBJECT * ob, int align ); FL_EXPORT int fl_get_choice_item_mode( FL_OBJECT * ob, int item ); FL_EXPORT void fl_set_choice_item_mode( FL_OBJECT * ob, int item, unsigned int mode ); FL_EXPORT void fl_set_choice_item_shortcut( FL_OBJECT * ob, int item, const char * sc ); FL_EXPORT int fl_set_choice_entries( FL_OBJECT * ob, FL_PUP_ENTRY * ent ); FL_EXPORT int fl_set_choice_notitle( FL_OBJECT * ob, int n ); FL_EXPORT int fl_set_choice_align_bottom( FL_OBJECT * ob, int n ); #endif /* ! defined FL_CHOICE_H */ xforms-1.2.4/lib/include/text.h0000664000175000017500000000334712353623325013320 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file text.h */ #ifndef FL_TEXT_H #define FL_TEXT_H enum { FL_NORMAL_TEXT }; #define FL_TEXT_BOXTYPE FL_FLAT_BOX #define FL_TEXT_COL1 FL_COL1 #define FL_TEXT_COL2 FL_MCOL #define FL_TEXT_LCOL FL_LCOL #define FL_TEXT_ALIGN ( FL_ALIGN_LEFT | FL_ALIGN_INSIDE ) FL_EXPORT FL_OBJECT * fl_create_text( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_text( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); #endif /* ! defined FL_TEXT_H */ xforms-1.2.4/lib/include/zzz.h0000664000175000017500000000311312353623325013160 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /* the following (fl_fheight) etc. were never documented and were removed from V0.89, but apparently this broke some applications that were using them. Put them back in 10/22/00 */ #define fl_textgc fl_textgc_( ) #define fl_gc fl_gc_( ) #define fl_cur_win fl_cur_win_( ) #define fl_fheight fl_fheight_( ) #define fl_fdesc fl_fdesc_( ) #define fl_cur_fs fl_cur_fs_( ) FL_EXPORT GC fl_gc_( void ); FL_EXPORT GC fl_textgc_( void ); FL_EXPORT int fl_fheight_( void ); FL_EXPORT int fl_fdesc_( void ); FL_EXPORT Window fl_cur_win_( void ); FL_EXPORT XFontStruct * fl_cur_fs_( void ); FL_EXPORT Display * fl_display_( void ); #if ! defined FL_TRUE && ! defined FL_FALSE #define FL_FALSE 0 #define FL_TRUE ( ! FL_FALSE ) #endif #if defined __cplusplus } #endif #endif /* FL_FORMS_H */ xforms-1.2.4/lib/include/free.h0000664000175000017500000000352412353623325013252 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file free.h * * Object Class: Free */ #ifndef FL_FREE_H #define FL_FREE_H typedef enum { FL_NORMAL_FREE, FL_INACTIVE_FREE, FL_INPUT_FREE, FL_CONTINUOUS_FREE, FL_ALL_FREE } FL_FREE_TYPE; #define FL_SLEEPING_FREE FL_INACTIVE_FREE FL_EXPORT FL_OBJECT * fl_create_free( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label, FL_HANDLEPTR handle ); FL_EXPORT FL_OBJECT * fl_add_free( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label, FL_HANDLEPTR handle ); #endif /* ! defined FL_FREE_H */ xforms-1.2.4/lib/include/dial.h0000664000175000017500000000645212353623325013245 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /********************** crop here for forms.h **********************/ /** * \file dial.h */ #ifndef FL_DIAL_H #define FL_DIAL_H typedef enum { FL_NORMAL_DIAL, FL_LINE_DIAL, FL_FILL_DIAL } FL_DIAL_TYPE; enum { FL_DIAL_CW, FL_DIAL_CCW }; /***** Defaults *****/ #define FL_DIAL_BOXTYPE FL_FLAT_BOX #define FL_DIAL_COL1 FL_COL1 #define FL_DIAL_COL2 FL_RIGHT_BCOL #define FL_DIAL_LCOL FL_LCOL #define FL_DIAL_ALIGN FL_ALIGN_BOTTOM /***** Others *****/ #define FL_DIAL_TOPCOL FL_COL1 /***** Routines *****/ FL_EXPORT FL_OBJECT * fl_create_dial( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT FL_OBJECT * fl_add_dial( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ); FL_EXPORT void fl_set_dial_value( FL_OBJECT * obj, double val ); FL_EXPORT double fl_get_dial_value( FL_OBJECT * obj ); FL_EXPORT void fl_set_dial_bounds( FL_OBJECT * obj, double min, double max ); FL_EXPORT void fl_get_dial_bounds( FL_OBJECT * obj, double * min, double * max ); FL_EXPORT void fl_set_dial_step( FL_OBJECT * obj, double value ); FL_EXPORT double fl_get_dial_step( FL_OBJECT * obj ); FL_EXPORT void fl_set_dial_return( FL_OBJECT * obj, unsigned int value ); FL_EXPORT void fl_set_dial_angles( FL_OBJECT * obj, double amin, double amax ); FL_EXPORT void fl_get_dial_angles( FL_OBJECT * obj, double * amin, double * amax ); FL_EXPORT void fl_set_dial_cross( FL_OBJECT * obj, int flag ); #define fl_set_dial_crossover fl_set_dial_cross FL_EXPORT void fl_set_dial_direction( FL_OBJECT * obj, int dir ); FL_EXPORT int fl_get_dial_direction( FL_OBJECT * obj ); #endif /* ! defined FL_DIAL_H */ xforms-1.2.4/lib/include/Makefile.am0000664000175000017500000000165212353623325014214 00000000000000include $(top_srcdir)/config/common.am nodist_include_HEADERS = forms.h CLEANFILES = forms.h AAA.h stamp-forms noinst_HEADERS = \ Basic.h \ XBasic.h \ popup.h \ bitmap.h \ box.h \ browser.h \ button.h \ canvas.h \ chart.h \ choice.h \ clipbd.h \ clock.h \ counter.h \ cursor.h \ dial.h \ filesys.h \ flps.h \ formbrowser.h \ frame.h \ free.h \ goodies.h \ input.h \ menu.h \ nmenu.h \ positioner.h \ scrollbar.h \ select.h \ slider.h \ spinner.h \ tabfolder.h \ text.h \ thumbwheel.h \ timer.h \ xpopup.h \ xyplot.h \ zzz.h forms.h: stamp-forms @: stamp-forms: AAA.h $(noinst_HEADERS) rm -f tmpforms sed "1,/crop here for forms/d" AAA.h > tmpforms for i in $(noinst_HEADERS); do \ sed "1,/crop here for forms/d" ${srcdir}/`basename $$i` >> tmpforms; \ done if cmp -s tmpforms forms.h ; then \ rm -f tmpforms ;\ else \ rm -f forms.h ;\ mv tmpforms forms.h ;\ fi echo timestamp > $@ xforms-1.2.4/lib/xdraw.c0000664000175000017500000010361712353623326012033 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file xdraw.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Basic low level drawing routines in Xlib. * * BUGS: All form window share a common GC and color map. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" static int fli_mono_dither( unsigned long ); static void fli_set_current_gc( GC ); static GC dithered_gc; /******************************************************************* * Rectangle routines ****************************************************************{**/ /*************************************** * Function for drawing a (possibly filled) rectangle ***************************************/ void fl_rectangle( int fill, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col ) { int bw = fli_dithered( fl_vmode ) && fli_mono_dither( col ); GC gc = flx->gc; int ( * draw_as )( Display *, Drawable, GC, int, int, unsigned int, unsigned int ); if ( flx->win == None || w <= 0 || h <= 0 ) return; fli_canonicalize_rect( &x, &y, &w, &h ); draw_as = fill ? XFillRectangle : XDrawRectangle; if ( bw && fill ) { fli_set_current_gc( fli_whitegc ); draw_as( flx->display, flx->win, flx->gc, x, y, w, h ); fli_set_current_gc( dithered_gc ); } fl_color( bw ? FL_BLACK : col ); draw_as( flx->display, flx->win, flx->gc, x, y, w, h ); if ( bw ) fli_set_current_gc( gc ); } /****** End of rectangle routines ***********************}***/ /**************************************************************** * Polygon and polylines ***********************************************************{****/ /*************************************** * Function for drawing a closed (possibly filled) polygon. * The 'xp' argument must point to an array with n + 1 elements! ***************************************/ void fl_polygon( int fill, FL_POINT * xp, int n, FL_COLOR col ) { int bw = fli_dithered( fl_vmode ) && fli_mono_dither( col ); GC gc = flx->gc; if ( flx->win == None || n <= 0 ) return; if ( bw ) { flx->gc = dithered_gc; fl_color( FL_WHITE ); if ( fill ) XFillPolygon( flx->display, flx->win, flx->gc, xp, n, Nonconvex, CoordModeOrigin ); else { xp[ n ].x = xp[ 0 ].x; xp[ n ].y = xp[ 0 ].y; XDrawLines( flx->display, flx->win, flx->gc, xp, n + 1, CoordModeOrigin ); } } fl_color( bw ? FL_BLACK : col ); if ( fill ) XFillPolygon( flx->display, flx->win, flx->gc, xp, n, Nonconvex, CoordModeOrigin ); else { xp[ n ].x = xp[ 0 ].x; xp[ n ].y = xp[ 0 ].y; XDrawLines( flx->display, flx->win, flx->gc, xp, n + 1, CoordModeOrigin ); } if ( bw ) flx->gc = gc; } /**************************************************************** * Draws a circle at (x, y) woth radius r and col as to color * of the outline **********************************************************{******/ void fl_circ( FL_COORD x, FL_COORD y, FL_COORD r, FL_COLOR col ) { fl_oval( 0, x - r, y - r, 2 * r, 2 * r, col ); } /**************************************************************** * Draws a filled circle at (x, y) woth radius r in color col **********************************************************{******/ void fl_circf( FL_COORD x, FL_COORD y, FL_COORD r, FL_COLOR col ) { fl_oval( 1, x - r, y - r, 2 * r, 2 * r, col ); } /**************************************************************** * Draws a filled circle at (x, y) woth radius r in color col and * the circumfence in black. **********************************************************{******/ void fl_circbound( FL_COORD x, FL_COORD y, FL_COORD r, FL_COLOR col ) { fl_ovalbound( x - r, y - r, 2 * r, 2 * r, col ); } /**************************************************************** * Function for drawing a (possibly filled) ellipse. **********************************************************{******/ void fl_oval( int fill, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col ) { int bw = fli_dithered( fl_vmode ) && fli_mono_dither( col ); GC gc = flx->gc; int ( * draw_as )( Display *, Drawable, GC, int, int, unsigned int, unsigned int, int, int ); if ( flx->win == None || w <= 0 || h <= 0 ) return; draw_as = fill ? XFillArc : XDrawArc; if ( bw ) { fli_set_current_gc( fli_whitegc ); draw_as( flx->display, flx->win, flx->gc, x, y, w, h, 0, 360 * 64 ); fli_set_current_gc( dithered_gc ); } fl_color( bw ? FL_BLACK : col ); if ( w >= 0 && h >= 0 ) draw_as( flx->display, flx->win, flx->gc, x, y, w, h, 0, 360 * 64 ); if ( bw ) fli_set_current_gc( gc ); } /*************************************** * Draws a filled ellipse with a black border ***************************************/ void fl_ovalbound( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col ) { if ( flx->win == None || w <= 0 || h <= 0 ) return; fl_color( col ); XFillArc( flx->display, flx->win, flx->gc, x, y, w, h, 0, 360 * 64 ); fl_color( FL_BLACK ); XDrawArc( flx->display, flx->win, flx->gc, x, y, w - 1, h - 1, 0, 360 * 64 ); } /******* End of ellipse routines ****************}***********/ /**************************************************************** * * Arcs ****************************************************************/ /*************************************** ***************************************/ void fl_ovalarc( int fill, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int t0, int dt, FL_COLOR col ) { int mono = fli_dithered( fl_vmode ) && fli_mono_dither( col ); int ( * draw_as )( Display *, Drawable, GC, int, int, unsigned int, unsigned int, int, int ); if ( flx->win == None || w <= 0 || h <= 0 ) return; draw_as = fill ? XFillArc : XDrawArc; if ( mono ) { fli_set_current_gc( fli_whitegc ); draw_as( flx->display, flx->win, flx->gc, x, y, w, h, t0 * 6.4, dt * 6.4 ); fli_set_current_gc( dithered_gc ); } fl_color( mono ? FL_BLACK : col ); if ( w >= 0 && h >= 0 ) draw_as( flx->display, flx->win, flx->gc, x, y, w, h, t0 * 6.4, dt * 6.4 ); if ( mono ) fli_set_current_gc( fl_state[ fl_vmode ].gc[ 0 ] ); } /*************************************** ***************************************/ void fl_arcf( FL_COORD x, FL_Coord y, FL_COORD r, int a1, int a2, FL_COLOR col ) { fl_pieslice( 1, x - r, y - r, 2 * r, 2 * r, a1, a2, col ); } /*************************************** ***************************************/ void fl_arc( FL_COORD x, FL_Coord y, FL_COORD r, int a1, int a2, FL_COLOR col ) { fl_pieslice( 0, x - r, y - r, 2 * r, 2 * r, a1, a2, col ); } /*************************************** ***************************************/ void fl_pieslice( int fill, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int a1, int a2, FL_COLOR col ) { int delta = a2 - a1, bw = fli_dithered( fl_vmode ) && fli_mono_dither( col ); GC gc = flx->gc; int ( * draw_as )( Display *, Drawable, GC, int, int, unsigned int, unsigned int, int, int ); if ( flx->win == None || w <= 0 || h <= 0) return; draw_as = fill ? XFillArc : XDrawArc; if ( bw ) { fli_set_current_gc( fli_whitegc ); draw_as( flx->display, flx->win, flx->gc, x, y, w, h, a1 * 6.4, delta * 6.4 ); fli_set_current_gc( dithered_gc ); } fl_color( bw ? FL_BLACK : col ); if ( w >= 0 && h >= 0 ) draw_as( flx->display, flx->win, flx->gc, x, y, w, h, a1 * 6.4, delta * 6.4 ); if ( bw ) fli_set_current_gc( gc ); } /********************************************************************* * Line segments *****************************************************************{***/ /*************************************** ***************************************/ void fl_lines( FL_POINT * xp, int n, FL_COLOR col ) { if ( flx->win == None || n <= 0 ) return; fl_color( col ); /* We may need to break up the request into smaller pieces */ if ( fli_context->ext_request_size >= n ) XDrawLines( flx->display, flx->win, flx->gc, xp, n, CoordModeOrigin ); else { int req = fli_context->ext_request_size; int i, nchunks = ( n + ( n / req ) ) / req, left; FL_POINT *p = xp; for ( i = 0; i < nchunks; i++, p += req - 1 ) XDrawLines( flx->display, flx->win, flx->gc, p, req, CoordModeOrigin ); left = xp + n - p; if ( left ) { if ( left == 1 ) { p--; left++; } XDrawLines( flx->display, flx->win, flx->gc, p, left, CoordModeOrigin ); } } } /*************************************** * Drwas a simple line from (x1,y1) to (x2,y2) ***************************************/ void fl_line( FL_Coord xi, FL_Coord yi, FL_Coord xf, FL_Coord yf, FL_COLOR c ) { if ( flx->win == None ) return; fl_color( c ); XDrawLine( flx->display, flx->win, flx->gc, xi, yi, xf, yf ); } /**************** End of line segments *******************}*********/ /* points */ /*************************************** * Draws a simple point at the given position ***************************************/ void fl_point( FL_Coord x, FL_Coord y, FL_COLOR c ) { if ( flx->win == None ) return; fl_color( c ); XDrawPoint( flx->display, flx->win, flx->gc, x, y ); } /*************************************** * Draws a set of simple point at the given positions ***************************************/ void fl_points( FL_POINT * p, int np, FL_COLOR c ) { if ( flx->win == None || np <= 0 ) return; fl_color( c ); XDrawPoints( flx->display, flx->win, flx->gc, p, np, CoordModeOrigin ); } /******************************************************************** * Basic drawing attributes ****************************************************************{*/ static int lw = 0, ls = LineSolid, drmode = GXcopy; /*************************************** ***************************************/ void fl_linewidth( int n ) { XGCValues gcvalue; unsigned long gcmask; if ( lw == n ) return; gcmask = GCLineWidth; gcvalue.line_width = lw = n; XChangeGC( flx->display, flx->gc, gcmask, &gcvalue ); } /*************************************** ***************************************/ int fl_get_linewidth( void ) { return lw; } static void fli_xdashedlinestyle( Display *, GC, const char *, int ); /*************************************** ***************************************/ void fli_xlinestyle( Display * d, GC gc, int n ) { static char dots[ ] = { 2, 4 }; static char dotdash[ ] = { 7, 3, 2, 3 }; static char ldash[ ] = { 10, 4 }; XGCValues gcvalue; unsigned long gcmask; if ( ls == n ) return; ls = n; gcmask = GCLineStyle; if ( n == FL_DOT ) fli_xdashedlinestyle( d, gc, dots, 2 ); else if ( n == FL_DOTDASH ) fli_xdashedlinestyle( d, gc, dotdash, 4 ); else if ( n == FL_LONGDASH ) fli_xdashedlinestyle( d, gc, ldash, 2 ); if ( n > LineDoubleDash ) n = LineOnOffDash; gcvalue.line_style = n; XChangeGC( d, gc, gcmask, &gcvalue ); } /*************************************** ***************************************/ void fl_linestyle( int n ) { fli_xlinestyle( flx->display, flx->gc, n ); } /*************************************** ***************************************/ int fl_get_linestyle( void ) { return ls; } /*************************************** ***************************************/ int fl_get_drawmode( void ) { return drmode; } /*************************************** ***************************************/ void fl_drawmode( int request ) { if ( drmode != request ) XSetFunction( flx->display, flx->gc, drmode = request ); } /*************************************** ***************************************/ static void fli_xdashedlinestyle( Display * d, GC gc, const char * dash, int ndash ) { static char default_dash[ ] = { 4, 4 }; if ( dash == NULL ) { dash = default_dash; ndash = 2; } XSetDashes( d, gc, 0, ( char * ) dash, ndash ); } /*************************************** ***************************************/ void fl_dashedlinestyle( const char * dash, int ndash ) { static char default_dash[ ] = { 4, 4 }; /* Check that the input is reasonable - XSetDashes() requires that there's at least one element in the 'dash' array and that none of its elements are 0. If one of these conditions isn't satis- fied (or 'dash' itself is NULL) set the defaut dash pattern. */ if ( dash ) { int i; for ( i = 0; i < ndash; i++ ) if ( dash[ i ] == '\0' ) { M_warn( "fl_dashedlinestyle", "Invalid '\0' in dash pattern " "array, using default pattern" ); ndash = 0; break; } } if ( ! dash || ! ndash ) { dash = default_dash; ndash = 2; } XSetDashes( flx->display, flx->gc, 0, ( char * ) dash, ndash ); } /************************************************************************ * Clipping stuff ***********************************************************************/ /* * Remember global clipping so unset_clipping will restore it. Most * useful as part of event dispatching */ enum { FLI_GLOBAL_CLIP = 0, FLI_NORMAL_CLIP = 1, FLI_TEXT_CLIP = 2, FLI_GC_CLIP = 3 }; static int fli_is_clipped[ ] = { 0, 0, 0, 0 }; static FL_RECT fli_clip_rect[ ] = { { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 } }; #define SET_RECT( t, a, b, c, d ) \ do { \ ( t ).x = a; \ ( t ).y = b; \ ( t ).width = c; \ ( t ).height = d; \ } while ( 0 ) #define GET_RECT( t, a, b, c, d ) \ do { \ *a = ( t ).x; \ *b = ( t ).y; \ *c = ( t ).width; \ *d = ( t ).height; \ } while ( 0 ) /*************************************** * Returns if global clipping is switched on - in which case * the region for global clipping can be obtained via a call * of fli_get_global_clipping( ). ***************************************/ int fl_is_global_clipped( void ) { return fli_is_clipped[ FLI_GLOBAL_CLIP ]; } /*************************************** * Helper function for determining if normal or text clipping is set * (also reports if global clipping is set when 'include_global' is * set). ***************************************/ static int is_clipped( int type, int include_global ) { return fli_is_clipped[ type ] || ( include_global && fli_is_clipped[ FLI_GLOBAL_CLIP ] ); } /*************************************** * Sets global clipping to the specified rectangle. If normal clipping * is already on the rectange use is the one resulting from intersecting * the requested rectangle with the one for normal clipping. Text is * clipped in the same way. If called with a negative width or height * global clipping is switched off. ***************************************/ void fli_set_global_clipping( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h ) { /* Calling the function with a rectangle with a negative width or height results in switching off of global clipping */ if ( w < 0 || h < 0 ) { fli_unset_global_clipping( ); return; } SET_RECT( fli_clip_rect[ FLI_GLOBAL_CLIP ], x, y, w, h ); /* If normal clipping is already on intersect the new global and the normal clip area and set clipping to the result. If normal clipping is off just use the rectangle specified by the arguments. */ if ( fli_is_clipped[ FLI_NORMAL_CLIP ] ) { FL_RECT * r = fli_intersect_rects( fli_clip_rect + FLI_GLOBAL_CLIP, fli_clip_rect + FLI_NORMAL_CLIP ); if ( r ) { XSetClipRectangles( flx->display, flx->gc, 0, 0, r, 1, Unsorted ); fli_safe_free( r ); } else { FL_RECT n = { 0, 0, 0, 0 }; XSetClipRectangles( flx->display, flx->gc, 0, 0, &n, 1, Unsorted ); } } else XSetClipRectangles( flx->display, flx->gc, 0, 0, &fli_clip_rect[ FLI_GLOBAL_CLIP ], 1, Unsorted ); /* The same again for text clipping */ if ( fli_is_clipped[ FLI_TEXT_CLIP ] ) { FL_RECT * r = fli_intersect_rects( fli_clip_rect + FLI_GLOBAL_CLIP, fli_clip_rect + FLI_TEXT_CLIP ); if ( r ) { XSetClipRectangles( flx->display, flx->textgc, 0, 0, r, 1, Unsorted ); fli_safe_free( r ); } else { FL_RECT n = { 0, 0, 0, 0 }; XSetClipRectangles( flx->display, flx->textgc, 0, 0, &n, 1, Unsorted ); } } else XSetClipRectangles( flx->display, flx->textgc, 0, 0, fli_clip_rect + FLI_GLOBAL_CLIP, 1, Unsorted ); fli_is_clipped[ FLI_GLOBAL_CLIP ] = 1; } /*************************************** * Unsets global clipping - "normal" and text clipping, if set, are retained ***************************************/ void fli_unset_global_clipping( void ) { if ( ! fli_is_clipped[ FLI_GLOBAL_CLIP ] ) return; SET_RECT( fli_clip_rect[ FLI_GLOBAL_CLIP ], 0, 0, 0, 0 ); /* If normal clipping is also on set the clipping rectangle to that set for normal clipping, otherwise switch clipping off completely. */ if ( fli_is_clipped[ FLI_NORMAL_CLIP ] ) XSetClipRectangles( flx->display, flx->gc, 0, 0, fli_clip_rect + FLI_NORMAL_CLIP, 1, Unsorted ); else XSetClipMask( flx->display, flx->gc, None ); /* Same for text clipping */ if ( fli_is_clipped[ FLI_TEXT_CLIP ] ) XSetClipRectangles( flx->display, flx->textgc, 0, 0, fli_clip_rect + FLI_TEXT_CLIP, 1, Unsorted ); else XSetClipMask( flx->display, flx->textgc, None ); fli_is_clipped[ FLI_GLOBAL_CLIP ] = 0; } /*************************************** * Returns a pointer to the rectangle used for global clipping (only * to be used when global clipping is on!) ***************************************/ FL_RECT * fli_get_global_clip_rect( void ) { return fli_clip_rect + FLI_GLOBAL_CLIP; } /*************************************** * Function returns as its return value if global clipping is on or off * and, via the pointer arguments, the clipping rectangle. ***************************************/ int fl_get_global_clipping( FL_Coord * x, FL_Coord * y, FL_Coord * w, FL_Coord * h ) { GET_RECT( fli_clip_rect[ FLI_GLOBAL_CLIP ], x, y, w, h ); return fli_is_clipped[ FLI_GLOBAL_CLIP ]; } /*************************************** * Helper function to switch off normal, text or GC clipping - if global * clipping is on it will be retained. ***************************************/ static void unset_clipping( int type, GC gc ) { if ( ! fli_is_clipped[ type ] ) return; SET_RECT( fli_clip_rect[ type ], 0, 0, 0, 0 ); if ( fli_is_clipped[ FLI_GLOBAL_CLIP ] ) XSetClipRectangles( flx->display, gc, 0, 0, fli_clip_rect + FLI_GLOBAL_CLIP, 1, Unsorted ); else XSetClipMask( flx->display, gc, None ); fli_is_clipped[ type ] = 0; } /*************************************** * Helper function to switch normal, text or GC clipping on for a certain * a certain region. 'type' is the type of clipping and 'gc' the GC for * which the clipping is to be set. If global clipping is already on the * clipping region is the intersection of the requested clipping region * with the clipping region for global clipping. ***************************************/ static void set_clipping( int type, GC gc, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h ) { if ( w < 0 || h < 0 ) { unset_clipping( type, gc ); return; } SET_RECT( fli_clip_rect[ type ], x, y, w, h ); if ( fli_is_clipped[ FLI_GLOBAL_CLIP ] ) { FL_RECT * r = fli_intersect_rects( fli_clip_rect + FLI_GLOBAL_CLIP, fli_clip_rect + type ); if ( r ) { XSetClipRectangles( flx->display, gc, 0, 0, r, 1, Unsorted ); fli_safe_free( r ); } else { FL_RECT n = { 0, 0, 0, 0 }; XSetClipRectangles( flx->display, gc, 0, 0, &n, 1, Unsorted ); } } else XSetClipRectangles( flx->display, gc, 0, 0, &fli_clip_rect[ type ], 1, Unsorted ); fli_is_clipped[ type ] = 1; } /*************************************** * Helper function for determining if normal or text clipping is on and the * region clipped to. 'type' is the type of clipping. If 'include_global' is * set also clipping due to global clipping is taken into account (and the * reported clipping region is the one resulting from intersection of the * clipping region for the requested type of clipping and the one for global * clipping). The function returns as its return value if there's clipping * going on (which may, when 'include_global', also be due to global clipping). ***************************************/ static int get_clipping( int type, int include_global, FL_Coord * x, FL_Coord * y, FL_Coord * w, FL_Coord * h ) { if ( ! ( include_global && fli_is_clipped[ FLI_GLOBAL_CLIP ] ) && fli_is_clipped[ type ] ) GET_RECT( fli_clip_rect[ type ], x, y, w, h ); else if ( include_global && fli_is_clipped[ FLI_GLOBAL_CLIP ] ) { if ( fli_is_clipped[ type ] ) { FL_RECT * r = fli_intersect_rects( fli_clip_rect + FLI_GLOBAL_CLIP, fli_clip_rect + type ); if ( r ) { GET_RECT( *r, x, y, w, h ); fl_free( r ); } } else GET_RECT( fli_clip_rect[ FLI_GLOBAL_CLIP ], x, y, w, h ); } return is_clipped( type, include_global ); } /*************************************** * Returns if "normal" (i.e. non-text) clipping is switched on. * If 'include_global' is set also also global clipping (used * e.g. when redrawing on an expose event) is on, otherwise only * clipping set via a call of fl_set_clipping() is reported. ***************************************/ int fl_is_clipped( int include_global ) { return is_clipped( FLI_NORMAL_CLIP, include_global ); } /*************************************** * Function for setting normal clipping. If global clipping is on the * rectangle set for clipping is the intersection of the rectangle specified * by the arguments and the one for global clipping. Specifying a negative * clipping width or height results in clipping becoming switched off. ***************************************/ void fl_set_clipping( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h ) { set_clipping( FLI_NORMAL_CLIP, flx->gc, x, y, w, h ); } /**************************************** * Function for switching of normal clipping. Note that global clipping * will be retained. ***************************************/ void fl_unset_clipping( void ) { unset_clipping( FLI_NORMAL_CLIP, flx->gc ); } /*************************************** * Function for determining if normal clipping is on and the region clipped * to. If 'include_global' is set also clipping due to global clipping is * taken into account (and the reported clipping region is the one resulting * from intersection of the normal clipping region and the one for global * clipping). The function returns as its return value if there's clipping * going on (which may, when 'include_global', also be due to global clipping). ***************************************/ int fl_get_clipping( int include_global, FL_Coord * x, FL_Coord * y, FL_Coord * w, FL_Coord * h ) { return get_clipping( FLI_NORMAL_CLIP, include_global, x, y, w, h ); } /*************************************** * Returns if "text" clipping is switched on. If 'include_global' * is set also also global clipping (used e.g. when redrawing on * an expose event) is on, otherwise only clipping set via a call * of fl_set_text_clipping() is reported. ***************************************/ int fl_is_text_clipped( int include_global ) { return is_clipped( FLI_TEXT_CLIP, include_global ); } /*************************************** * Function for setting text clipping. If global clipping is on the rectangle * set for clipping is the intersection of the rectangle specified by the * arguments and the one for global clipping. Specifying a negative clipping * width or height results in clipping becoming switched off. ***************************************/ void fl_set_text_clipping( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h ) { set_clipping( FLI_TEXT_CLIP, flx->textgc, x, y, w, h ); } /*************************************** * Function for switching of text clipping. Note that global clipping * will be retained. ***************************************/ void fl_unset_text_clipping( void ) { unset_clipping( FLI_TEXT_CLIP, flx->textgc ); } /*************************************** * Function for determining if text clipping is on and the region clipped * to. If 'include_global' is set also clipping due to global clipping is * taken into account (and the reported clipping region is the one resulting * from intersection of the text clipping region and the one for global * clipping). The function returns as its return value if there's clipping * going on (which may, when 'include_global', also be due to global clipping). ***************************************/ int fl_get_text_clipping( int include_global, FL_Coord * x, FL_Coord * y, FL_Coord * w, FL_Coord * h ) { return get_clipping( FLI_TEXT_CLIP, include_global, x, y, w, h ); } /*************************************** * Function for setting clipping for the specified GC. If global clipping is * on the rectangle set for clipping is the intersection of the rectangle * specified by the arguments and the one for global clipping. Specifying a * negative clipping width or height results in clipping becoming switched off. ***************************************/ void fl_set_gc_clipping( GC gc, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h ) { fli_is_clipped[ FLI_GC_CLIP ] = 1; set_clipping( FLI_GC_CLIP, gc, x, y, w, h ); } /*************************************** * Function for switching of clipping for the given gc. Note that global * clipping will be retained. ***************************************/ void fl_unset_gc_clipping( GC gc ) { fli_is_clipped[ FLI_GC_CLIP ] = 1; unset_clipping( FLI_GC_CLIP, gc ); } /*************************************** * Function that allows to set additional (always reducing the clipping * rectangle further) to already set clipping - the intersection of the * region and the already set clipping region is calculated and clipping * then set to the resulting rectangle. ***************************************/ void fli_set_additional_clipping( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h ) { FL_RECT rect; SET_RECT( rect, x, y, w, h ); if ( fli_is_clipped[ FLI_NORMAL_CLIP ] ) { FL_RECT * r = fli_intersect_rects( fli_clip_rect + FLI_NORMAL_CLIP, &rect ); if ( r ) { rect = *r; fli_safe_free( r ); } else SET_RECT( rect, 0, 0, 0, 0 ); } fl_set_clipping( rect.x, rect.y, rect.width, rect.height ); } /*************************************** ***************************************/ static void fli_set_current_gc( GC gc ) { if ( flx->gc == gc ) return; flx->gc = gc; flx->color = FL_NoColor; if ( fli_is_clipped[ FLI_GLOBAL_CLIP ] && fli_is_clipped[ FLI_NORMAL_CLIP ] ) { FL_RECT * r = fli_intersect_rects( fli_clip_rect + FLI_GLOBAL_CLIP, fli_clip_rect + FLI_NORMAL_CLIP ); if ( r ) { XSetClipRectangles( flx->display, gc, 0, 0, r, 1, Unsorted ); fli_safe_free( r ); } else { FL_RECT n = { 0, 0, 0, 0 }; XSetClipRectangles( flx->display, gc, 0, 0, &n, 1, Unsorted ); } } else if ( fli_is_clipped[ FLI_GLOBAL_CLIP ] ) XSetClipRectangles( flx->display, gc, 0, 0, fli_clip_rect + FLI_GLOBAL_CLIP, 1, Unsorted ); else if ( fli_is_clipped[ FLI_NORMAL_CLIP ] ) XSetClipRectangles( flx->display, gc, 0, 0, fli_clip_rect + FLI_NORMAL_CLIP, 1, Unsorted ); else XSetClipMask( flx->display, gc, None ); } /*************************************** * Manually dither non-gray scale colors by changing default GC. Grayscales * are typically used in buttons, boxes etc, better not to dither them ***************************************/ static int fli_mono_dither( unsigned long col ) { int bwtrick = 0; switch ( col ) { case FL_RED: case FL_MAGENTA: case FL_SLATEBLUE: case FL_PALEGREEN: case FL_DARKGOLD: case FL_INACTIVE_COL: dithered_gc = fli_bwgc[ 1 ]; bwtrick = 1; break; case FL_YELLOW: case FL_CYAN: case FL_INDIANRED: case FL_GREEN: dithered_gc = fli_bwgc[ 2 ]; bwtrick = 1; break; case FL_BLUE: dithered_gc = fli_bwgc[ 0 ]; bwtrick = 1; break; default: if ( col >= FL_FREE_COL1 ) { int r, g, b; fl_get_icm_color( col, &r, &g, &b ); if ( ( bwtrick = ( r > 70 && r <= 210 ) ) ) dithered_gc = fli_bwgc[ r / 70 - 1 ]; } break; } return bwtrick; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/bitmaps/0000775000175000017500000000000012353624652012254 500000000000000xforms-1.2.4/lib/bitmaps/Makefile.in0000664000175000017500000002454312353624173014247 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/common.am subdir = lib/bitmaps ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FL_FIXLEVEL = @FL_FIXLEVEL@ FL_REVISION = @FL_REVISION@ FL_VERSION = @FL_VERSION@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIB = @JPEG_LIB@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ TEXI2DVI = @TEXI2DVI@ TEXI2DVI_NEEDS_PDF = @TEXI2DVI_NEEDS_PDF@ TEXI2HTML = @TEXI2HTML@ VERSION = @VERSION@ XMKMF = @XMKMF@ XPM_LIB = @XPM_LIB@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign DISTCLEANFILES = *.orig *.rej *~ *.bak core makelog MAINTAINERCLEANFILES = $(srcdir)/Makefile.in makelog AM_INSTALL_DATA_FLAGS = $(INSTALL) -m 644 -D EXTRA_DIST = plaid.xpm q.xbm warn.xbm colorwheel.xpm all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/common.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/bitmaps/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/bitmaps/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/common.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: xforms-1.2.4/lib/bitmaps/colorwheel.xpm0000664000175000017500000043561012340346606015072 00000000000000/* XPM */ static char * colorwheel[] = { /* columns rows colors chars-per-pixel */ "221 221 2977 2", ". c #FFFFFF", "+ c #63FF00", "@ c #6BFF00", "# c #73FF00", "$ c #7BFF00", "% c #84FF00", "& c #8CFF00", "* c #94FF00", "= c #9CFF00", "- c #52FF00", "; c #5AFF00", "> c #A5FF00", ", c #ADFF00", "' c #4AFF00", ") c #6BFF08", "! c #73FF08", "~ c #7BFF08", "{ c #84FF08", "] c #8CFF08", "^ c #94FF08", "/ c #B5FF00", "( c #42FF00", "_ c #5AFF08", ": c #63FF08", "< c #9CFF08", "[ c #A5FF08", "} c #ADFF08", "| c #BDFF00", "1 c #3AFF00", "2 c #4AFF08", "3 c #52FF08", "4 c #B5FF08", "5 c #C5FF00", "6 c #31FF00", "7 c #42FF08", "8 c #73FF10", "9 c #7BFF10", "0 c #84FF10", "a c #8CFF10", "b c #94FF10", "c c #9CFF10", "d c #BDFF08", "e c #CEFF00", "f c #29FF00", "g c #3AFF08", "h c #5AFF10", "i c #63FF10", "j c #6BFF10", "k c #A5FF10", "l c #ADFF10", "m c #C5FF08", "n c #D6FF00", "o c #21FF00", "p c #31FF08", "q c #52FF10", "r c #B5FF10", "s c #BDFF10", "t c #CEFF08", "u c #DEFF00", "v c #29FF08", "w c #4AFF10", "x c #C5FF10", "y c #D6FF08", "z c #DEFF08", "A c #19FF00", "B c #42FF10", "C c #73FF19", "D c #7BFF19", "E c #84FF19", "F c #8CFF19", "G c #94FF19", "H c #9CFF19", "I c #A5FF19", "J c #CEFF10", "K c #E6FF00", "L c #10FF00", "M c #21FF08", "N c #3AFF10", "O c #63FF19", "P c #6BFF19", "Q c #ADFF19", "R c #B5FF19", "S c #D6FF10", "T c #E6FF08", "U c #EFFF00", "V c #19FF08", "W c #31FF10", "X c #5AFF19", "Y c #BDFF19", "Z c #DEFF10", "` c #00FF00", " . c #08FF00", ".. c #10FF08", "+. c #29FF10", "@. c #4AFF19", "#. c #52FF19", "$. c #7BFF21", "%. c #84FF21", "&. c #8CFF21", "*. c #94FF21", "=. c #9CFF21", "-. c #A5FF21", ";. c #C5FF19", ">. c #E6FF10", ",. c #EFFF08", "'. c #F7FF08", "). c #F7FF00", "!. c #FFFF00", "~. c #21FF10", "{. c #42FF19", "]. c #6BFF21", "^. c #73FF21", "/. c #ADFF21", "(. c #B5FF21", "_. c #CEFF19", ":. c #08FF08", "<. c #5AFF21", "[. c #63FF21", "}. c #BDFF21", "|. c #D6FF19", "1. c #EFFF10", "2. c #FFFF08", "3. c #00FF08", "4. c #19FF10", "5. c #3AFF19", "6. c #52FF21", "7. c #7BFF29", "8. c #84FF29", "9. c #8CFF29", "0. c #94FF29", "a. c #9CFF29", "b. c #A5FF29", "c. c #C5FF21", "d. c #CEFF21", "e. c #DEFF19", "f. c #F7FF10", "g. c #FFF700", "h. c #00FF10", "i. c #31FF19", "j. c #4AFF21", "k. c #6BFF29", "l. c #73FF29", "m. c #ADFF29", "n. c #B5FF29", "o. c #D6FF21", "p. c #E6FF19", "q. c #FFEF00", "r. c #08FF10", "s. c #10FF10", "t. c #29FF19", "u. c #42FF21", "v. c #63FF29", "w. c #BDFF29", "x. c #C5FF29", "y. c #DEFF21", "z. c #EFFF19", "A. c #FFFF10", "B. c #FFF708", "C. c #00FF19", "D. c #3AFF21", "E. c #5AFF29", "F. c #84FF31", "G. c #8CFF31", "H. c #94FF31", "I. c #9CFF31", "J. c #A5FF31", "K. c #ADFF31", "L. c #CEFF29", "M. c #FFE600", "N. c #08FF19", "O. c #10FF19", "P. c #21FF19", "Q. c #52FF29", "R. c #73FF31", "S. c #7BFF31", "T. c #B5FF31", "U. c #D6FF29", "V. c #E6FF21", "W. c #F7FF19", "X. c #FFF710", "Y. c #FFEF08", "Z. c #FFE608", "`. c #00FF21", " + c #19FF19", ".+ c #31FF21", "++ c #4AFF29", "@+ c #63FF31", "#+ c #6BFF31", "$+ c #BDFF31", "%+ c #C5FF31", "&+ c #DEFF29", "*+ c #EFFF21", "=+ c #FFFF19", "-+ c #FFDE00", ";+ c #08FF21", ">+ c #10FF21", ",+ c #42FF29", "'+ c #84FF3A", ")+ c #8CFF3A", "!+ c #94FF3A", "~+ c #9CFF3A", "{+ c #A5FF3A", "]+ c #ADFF3A", "^+ c #CEFF31", "/+ c #FFEF10", "(+ c #00FF29", "_+ c #08FF29", ":+ c #29FF21", "<+ c #3AFF29", "[+ c #5AFF31", "}+ c #73FF3A", "|+ c #7BFF3A", "1+ c #B5FF3A", "2+ c #BDFF3A", "3+ c #D6FF31", "4+ c #E6FF29", "5+ c #F7FF21", "6+ c #FFDE08", "7+ c #FFD600", "8+ c #10FF29", "9+ c #19FF21", "0+ c #21FF21", "a+ c #31FF29", "b+ c #4AFF31", "c+ c #52FF31", "d+ c #6BFF3A", "e+ c #C5FF3A", "f+ c #DEFF31", "g+ c #EFFF29", "h+ c #FFFF21", "i+ c #FFF719", "j+ c #FFE610", "k+ c #00FF31", "l+ c #63FF3A", "m+ c #CEFF3A", "n+ c #D6FF3A", "o+ c #E6FF31", "p+ c #F7FF29", "q+ c #FFCE00", "r+ c #08FF31", "s+ c #19FF29", "t+ c #21FF29", "u+ c #29FF29", "v+ c #42FF31", "w+ c #5AFF3A", "x+ c #8CFF42", "y+ c #94FF42", "z+ c #9CFF42", "A+ c #A5FF42", "B+ c #ADFF42", "C+ c #B5FF42", "D+ c #DEFF3A", "E+ c #FFFF29", "F+ c #FFF721", "G+ c #FFEF19", "H+ c #FFDE10", "I+ c #FFD608", "J+ c #00FF3A", "K+ c #10FF31", "L+ c #19FF31", "M+ c #3AFF31", "N+ c #52FF3A", "O+ c #7BFF42", "P+ c #84FF42", "Q+ c #BDFF42", "R+ c #C5FF42", "S+ c #EFFF31", "T+ c #FFE619", "U+ c #FFCE08", "V+ c #FFC500", "W+ c #08FF3A", "X+ c #21FF31", "Y+ c #4AFF3A", "Z+ c #73FF42", "`+ c #CEFF42", " @ c #E6FF3A", ".@ c #F7FF31", "+@ c #FFEF21", "@@ c #FFD610", "#@ c #10FF3A", "$@ c #19FF3A", "%@ c #29FF31", "&@ c #31FF31", "*@ c #6BFF42", "=@ c #94FF4A", "-@ c #9CFF4A", ";@ c #A5FF4A", ">@ c #ADFF4A", ",@ c #B5FF4A", "'@ c #D6FF42", ")@ c #EFFF3A", "!@ c #FFFF31", "~@ c #FFF729", "{@ c #FFDE19", "]@ c #FFC508", "^@ c #00FF42", "/@ c #08FF42", "(@ c #21FF3A", "_@ c #42FF3A", ":@ c #63FF42", "<@ c #84FF4A", "[@ c #8CFF4A", "}@ c #BDFF4A", "|@ c #C5FF4A", "1@ c #DEFF42", "2@ c #FFEF29", "3@ c #FFE621", "4@ c #FFCE10", "5@ c #FFBD00", "6@ c #10FF42", "7@ c #19FF42", "8@ c #29FF3A", "9@ c #3AFF3A", "0@ c #5AFF42", "a@ c #7BFF4A", "b@ c #CEFF4A", "c@ c #E6FF42", "d@ c #F7FF3A", "e@ c #FFF731", "f@ c #FFDE21", "g@ c #FFD619", "h@ c #FFBD08", "i@ c #00FF4A", "j@ c #21FF42", "k@ c #31FF3A", "l@ c #52FF42", "m@ c #6BFF4A", "n@ c #73FF4A", "o@ c #94FF52", "p@ c #9CFF52", "q@ c #A5FF52", "r@ c #ADFF52", "s@ c #B5FF52", "t@ c #BDFF52", "u@ c #D6FF4A", "v@ c #DEFF4A", "w@ c #FFFF3A", "x@ c #FFE629", "y@ c #FFC510", "z@ c #FFB500", "A@ c #08FF4A", "B@ c #10FF4A", "C@ c #29FF42", "D@ c #63FF4A", "E@ c #84FF52", "F@ c #8CFF52", "G@ c #C5FF52", "H@ c #CEFF52", "I@ c #EFFF42", "J@ c #FFEF31", "K@ c #FFCE19", "L@ c #19FF4A", "M@ c #21FF4A", "N@ c #31FF42", "O@ c #4AFF42", "P@ c #7BFF52", "Q@ c #D6FF52", "R@ c #E6FF4A", "S@ c #F7FF42", "T@ c #FFF73A", "U@ c #FFE631", "V@ c #FFDE29", "W@ c #FFB508", "X@ c #00FF52", "Y@ c #08FF52", "Z@ c #29FF4A", "`@ c #31FF4A", " # c #3AFF42", ".# c #42FF42", "+# c #5AFF4A", "@# c #73FF52", "## c #94FF5A", "$# c #9CFF5A", "%# c #A5FF5A", "&# c #ADFF5A", "*# c #B5FF5A", "=# c #BDFF5A", "-# c #DEFF52", ";# c #EFFF4A", "># c #FFFF42", ",# c #FFEF3A", "'# c #FFD621", ")# c #FFC519", "!# c #FFBD10", "~# c #FFAD00", "{# c #10FF52", "]# c #19FF52", "^# c #21FF52", "/# c #3AFF4A", "(# c #52FF4A", "_# c #6BFF52", ":# c #8CFF5A", "<# c #C5FF5A", "[# c #CEFF5A", "}# c #F7FF4A", "|# c #FFCE21", "1# c #FFAD08", "2# c #00FF5A", "3# c #29FF52", "4# c #42FF4A", "5# c #4AFF4A", "6# c #63FF52", "7# c #7BFF5A", "8# c #84FF5A", "9# c #D6FF5A", "0# c #E6FF52", "a# c #FFF742", "b# c #FFDE31", "c# c #FFD629", "d# c #FFB510", "e# c #08FF5A", "f# c #10FF5A", "g# c #21FF5A", "h# c #31FF52", "i# c #5AFF52", "j# c #DEFF5A", "k# c #EFFF52", "l# c #FFFF4A", "m# c #FFE63A", "n# c #FFC521", "o# c #FFBD19", "p# c #FFA500", "q# c #19FF5A", "r# c #29FF5A", "s# c #3AFF52", "t# c #42FF52", "u# c #73FF5A", "v# c #9CFF63", "w# c #A5FF63", "x# c #ADFF63", "y# c #B5FF63", "z# c #BDFF63", "A# c #E6FF5A", "B# c #F7FF52", "C# c #FFEF42", "D# c #FFD631", "E# c #FFCE29", "F# c #FFA508", "G# c #00FF63", "H# c #08FF63", "I# c #10FF63", "J# c #31FF5A", "K# c #4AFF52", "L# c #52FF52", "M# c #6BFF5A", "N# c #94FF63", "O# c #C5FF63", "P# c #CEFF63", "Q# c #EFFF5A", "R# c #FFF74A", "S# c #FFDE3A", "T# c #FFB519", "U# c #FFAD10", "V# c #19FF63", "W# c #3AFF5A", "X# c #63FF5A", "Y# c #84FF63", "Z# c #8CFF63", "`# c #D6FF63", " $ c #DEFF63", ".$ c #FFFF52", "+$ c #FFE642", "@$ c #FFC529", "#$ c #FFBD21", "$$ c #FF9C00", "%$ c #00FF6B", "&$ c #21FF63", "*$ c #29FF63", "=$ c #31FF63", "-$ c #42FF5A", ";$ c #4AFF5A", ">$ c #7BFF63", ",$ c #A5FF6B", "'$ c #ADFF6B", ")$ c #B5FF6B", "!$ c #BDFF6B", "~$ c #C5FF6B", "{$ c #F7FF5A", "]$ c #FFEF4A", "^$ c #FFDE42", "/$ c #FFD63A", "($ c #FFCE31", "_$ c #FFA510", ":$ c #FF9C08", "<$ c #08FF6B", "[$ c #10FF6B", "}$ c #19FF6B", "|$ c #3AFF63", "1$ c #42FF63", "2$ c #52FF5A", "3$ c #5AFF5A", "4$ c #73FF63", "5$ c #94FF6B", "6$ c #9CFF6B", "7$ c #CEFF6B", "8$ c #D6FF6B", "9$ c #E6FF63", "0$ c #FFFF5A", "a$ c #FFF752", "b$ c #FFE64A", "c$ c #FFB521", "d$ c #FF9400", "e$ c #21FF6B", "f$ c #29FF6B", "g$ c #4AFF63", "h$ c #8CFF6B", "i$ c #DEFF6B", "j$ c #EFFF63", "k$ c #FFCE3A", "l$ c #FFC531", "m$ c #FFBD29", "n$ c #FFAD19", "o$ c #FF9408", "p$ c #00FF73", "q$ c #31FF6B", "r$ c #3AFF6B", "s$ c #52FF63", "t$ c #6BFF63", "u$ c #84FF6B", "v$ c #A5FF73", "w$ c #ADFF73", "x$ c #B5FF73", "y$ c #BDFF73", "z$ c #C5FF73", "A$ c #E6FF6B", "B$ c #F7FF63", "C$ c #FFF75A", "D$ c #FFEF52", "E$ c #FFD642", "F$ c #FFAD21", "G$ c #FF9C10", "H$ c #08FF73", "I$ c #10FF73", "J$ c #19FF73", "K$ c #42FF6B", "L$ c #4AFF6B", "M$ c #5AFF63", "N$ c #63FF63", "O$ c #7BFF6B", "P$ c #9CFF73", "Q$ c #CEFF73", "R$ c #D6FF73", "S$ c #EFFF6B", "T$ c #FFE652", "U$ c #FFDE4A", "V$ c #FFC53A", "W$ c #FFBD31", "X$ c #FFB529", "Y$ c #FFA519", "Z$ c #FF8C00", "`$ c #21FF73", " % c #29FF73", ".% c #31FF73", "+% c #52FF6B", "@% c #8CFF73", "#% c #94FF73", "$% c #DEFF73", "%% c #FFFF63", "&% c #FFEF5A", "*% c #FF8C08", "=% c #00FF7B", "-% c #3AFF73", ";% c #42FF73", ">% c #5AFF6B", ",% c #73FF6B", "'% c #ADFF7B", ")% c #B5FF7B", "!% c #BDFF7B", "~% c #C5FF7B", "{% c #CEFF7B", "]% c #E6FF73", "^% c #F7FF6B", "/% c #FFF763", "(% c #FFDE52", "_% c #FFD64A", ":% c #FFCE42", "<% c #FFB531", "[% c #FFAD29", "}% c #FF9410", "|% c #08FF7B", "1% c #10FF7B", "2% c #19FF7B", "3% c #21FF7B", "4% c #4AFF73", "5% c #52FF73", "6% c #63FF6B", "7% c #6BFF6B", "8% c #84FF73", "9% c #9CFF7B", "0% c #A5FF7B", "a% c #D6FF7B", "b% c #EFFF73", "c% c #FFE65A", "d% c #FFBD3A", "e% c #FFA521", "f% c #FF9C19", "g% c #FF8400", "h% c #29FF7B", "i% c #31FF7B", "j% c #3AFF7B", "k% c #42FF7B", "l% c #5AFF73", "m% c #7BFF73", "n% c #94FF7B", "o% c #DEFF7B", "p% c #F7FF73", "q% c #FFFF6B", "r% c #FFEF63", "s% c #FFD652", "t% c #FFCE4A", "u% c #FFC542", "v% c #FF8408", "w% c #00FF84", "x% c #08FF84", "y% c #10FF84", "z% c #21FF84", "A% c #4AFF7B", "B% c #52FF7B", "C% c #63FF73", "D% c #6BFF73", "E% c #73FF73", "F% c #8CFF7B", "G% c #E6FF7B", "H% c #EFFF7B", "I% c #FFF76B", "J% c #FFDE5A", "K% c #FFB53A", "L% c #FFA529", "M% c #FF9C21", "N% c #FF9419", "O% c #FF8C10", "P% c #FF7B00", "Q% c #19FF84", "R% c #29FF84", "S% c #31FF84", "T% c #5AFF7B", "U% c #ADFF84", "V% c #B5FF84", "W% c #BDFF84", "X% c #C5FF84", "Y% c #CEFF84", "Z% c #FFFF73", "`% c #FFE663", " & c #FFAD31", ".& c #3AFF84", "+& c #42FF84", "@& c #63FF7B", "#& c #6BFF7B", "$& c #84FF7B", "%& c #A5FF84", "&& c #D6FF84", "*& c #DEFF84", "=& c #F7FF7B", "-& c #FFEF6B", ";& c #FFD65A", ">& c #FFCE52", ",& c #FFC54A", "'& c #FFBD42", ")& c #FF8410", "!& c #FF7B08", "~& c #00FF8C", "{& c #08FF8C", "]& c #10FF8C", "^& c #19FF8C", "/& c #4AFF84", "(& c #52FF84", "_& c #5AFF84", ":& c #7BFF7B", "<& c #9CFF84", "[& c #E6FF84", "}& c #FFF773", "|& c #FFDE63", "1& c #FFAD3A", "2& c #FFA531", "3& c #FF9421", "4& c #FF8C19", "5& c #FF7300", "6& c #21FF8C", "7& c #29FF8C", "8& c #31FF8C", "9& c #3AFF8C", "0& c #4AFF8C", "a& c #63FF84", "b& c #73FF7B", "c& c #94FF84", "d& c #B5FF8C", "e& c #BDFF8C", "f& c #C5FF8C", "g& c #CEFF8C", "h& c #D6FF8C", "i& c #EFFF84", "j& c #FFFF7B", "k& c #FFE66B", "l& c #FFC552", "m& c #FFBD4A", "n& c #FFB542", "o& c #FF9C29", "p& c #42FF8C", "q& c #52FF8C", "r& c #6BFF84", "s& c #73FF84", "t& c #8CFF84", "u& c #ADFF8C", "v& c #DEFF8C", "w& c #F7FF84", "x& c #FFF77B", "y& c #FFEF73", "z& c #FFCE5A", "A& c #FF7B10", "B& c #FF7308", "C& c #00FF94", "D& c #08FF94", "E& c #10FF94", "F& c #19FF94", "G& c #21FF94", "H& c #29FF94", "I& c #5AFF8C", "J& c #63FF8C", "K& c #7BFF84", "L& c #9CFF8C", "M& c #A5FF8C", "N& c #E6FF8C", "O& c #FFE673", "P& c #FFDE6B", "Q& c #FFD663", "R& c #FFA53A", "S& c #FF9429", "T& c #FF8C21", "U& c #FF8419", "V& c #FF6B00", "W& c #31FF94", "X& c #3AFF94", "Y& c #6BFF8C", "Z& c #73FF8C", "`& c #84FF84", " * c #BDFF94", ".* c #C5FF94", "+* c #CEFF94", "@* c #D6FF94", "#* c #EFFF8C", "$* c #FFFF84", "%* c #FFEF7B", "&* c #FFBD52", "** c #FFB54A", "=* c #FFAD42", "-* c #FF9C31", ";* c #42FF94", ">* c #4AFF94", ",* c #52FF94", "'* c #5AFF94", ")* c #63FF94", "!* c #7BFF8C", "~* c #94FF8C", "{* c #ADFF94", "]* c #B5FF94", "^* c #DEFF94", "/* c #E6FF94", "(* c #F7FF8C", "_* c #FFD66B", ":* c #FFCE63", "<* c #FFC55A", "[* c #FF7B19", "}* c #FF7310", "|* c #FF6B08", "1* c #00FF9C", "2* c #08FF9C", "3* c #10FF9C", "4* c #19FF9C", "5* c #21FF9C", "6* c #6BFF94", "7* c #84FF8C", "8* c #A5FF94", "9* c #EFFF94", "0* c #FFF784", "a* c #FFE67B", "b* c #FFDE73", "c* c #FFBD5A", "d* c #FFB552", "e* c #FF9C3A", "f* c #FF9431", "g* c #FF8C29", "h* c #FF8421", "i* c #FF6300", "j* c #29FF9C", "k* c #31FF9C", "l* c #3AFF9C", "m* c #42FF9C", "n* c #73FF94", "o* c #7BFF94", "p* c #8CFF8C", "q* c #9CFF94", "r* c #BDFF9C", "s* c #C5FF9C", "t* c #CEFF9C", "u* c #D6FF9C", "v* c #DEFF9C", "w* c #FFFF8C", "x* c #FFAD4A", "y* c #FFA542", "z* c #4AFF9C", "A* c #52FF9C", "B* c #5AFF9C", "C* c #63FF9C", "D* c #84FF94", "E* c #8CFF94", "F* c #B5FF9C", "G* c #E6FF9C", "H* c #F7FF94", "I* c #FFF78C", "J* c #FFEF84", "K* c #FFDE7B", "L* c #FFD673", "M* c #FFC563", "N* c #FF943A", "O* c #FF8C31", "P* c #FF6B10", "Q* c #FF6308", "R* c #00FFA5", "S* c #08FFA5", "T* c #10FFA5", "U* c #31FFA5", "V* c #6BFF9C", "W* c #73FF9C", "X* c #94FF94", "Y* c #ADFF9C", "Z* c #EFFF9C", "`* c #FFFF94", " = c #FFCE6B", ".= c #FFB55A", "+= c #FFAD52", "@= c #FF9C42", "#= c #FF5A00", "$= c #19FFA5", "%= c #21FFA5", "&= c #29FFA5", "*= c #3AFFA5", "== c #42FFA5", "-= c #4AFFA5", ";= c #52FFA5", ">= c #5AFFA5", ",= c #7BFF9C", "'= c #84FF9C", ")= c #A5FF9C", "!= c #C5FFA5", "~= c #CEFFA5", "{= c #D6FFA5", "]= c #DEFFA5", "^= c #F7FF9C", "/= c #FFEF8C", "(= c #FFE684", "_= c #FFA54A", ":= c #FF8429", "<= c #FF7B21", "[= c #FF7319", "}= c #63FFA5", "|= c #6BFFA5", "1= c #8CFF9C", "2= c #94FF9C", "3= c #9CFF9C", "4= c #B5FFA5", "5= c #BDFFA5", "6= c #E6FFA5", "7= c #FFF794", "8= c #FFD67B", "9= c #FFCE73", "0= c #FFC56B", "a= c #FFBD63", "b= c #FF6310", "c= c #00FFAD", "d= c #08FFAD", "e= c #10FFAD", "f= c #21FFAD", "g= c #73FFA5", "h= c #7BFFA5", "i= c #84FFA5", "j= c #ADFFA5", "k= c #EFFFA5", "l= c #FFFF9C", "m= c #FFE68C", "n= c #FFDE84", "o= c #FFAD5A", "p= c #FFA552", "q= c #FF9C4A", "r= c #FF8C3A", "s= c #FF8431", "t= c #FF7B29", "u= c #FF7321", "v= c #FF5A08", "w= c #FF5200", "x= c #19FFAD", "y= c #29FFAD", "z= c #31FFAD", "A= c #3AFFAD", "B= c #42FFAD", "C= c #4AFFAD", "D= c #52FFAD", "E= c #8CFFA5", "F= c #F7FFA5", "G= c #FFF79C", "H= c #FFEF94", "I= c #FFC573", "J= c #FFBD6B", "K= c #FFB563", "L= c #FF9442", "M= c #FF6B19", "N= c #5AFFAD", "O= c #63FFAD", "P= c #6BFFAD", "Q= c #73FFAD", "R= c #7BFFAD", "S= c #94FFA5", "T= c #9CFFA5", "U= c #A5FFA5", "V= c #C5FFAD", "W= c #CEFFAD", "X= c #D6FFAD", "Y= c #DEFFAD", "Z= c #FFCE7B", "`= c #FF5A10", " - c #08FFB5", ".- c #10FFB5", "+- c #84FFAD", "@- c #8CFFAD", "#- c #BDFFAD", "$- c #E6FFAD", "%- c #EFFFAD", "&- c #FFFFA5", "*- c #FFE694", "=- c #FFDE8C", "-- c #FFD684", ";- c #FFA55A", ">- c #FF944A", ",- c #FF8C42", "'- c #FF843A", ")- c #FF7B31", "!- c #FF7329", "~- c #FF6B21", "{- c #FF5208", "]- c #00FFB5", "^- c #19FFB5", "/- c #21FFB5", "(- c #29FFB5", "_- c #31FFB5", ":- c #3AFFB5", "<- c #42FFB5", "[- c #4AFFB5", "}- c #52FFB5", "|- c #5AFFB5", "1- c #63FFB5", "2- c #94FFAD", "3- c #9CFFAD", "4- c #B5FFAD", "5- c #FFF7A5", "6- c #FFEF9C", "7- c #FFC57B", "8- c #FFBD73", "9- c #FFB56B", "0- c #FFAD63", "a- c #FF9C52", "b- c #FF6319", "c- c #FF4A00", "d- c #6BFFB5", "e- c #73FFB5", "f- c #7BFFB5", "g- c #84FFB5", "h- c #8CFFB5", "i- c #A5FFAD", "j- c #CEFFB5", "k- c #D6FFB5", "l- c #DEFFB5", "m- c #E6FFB5", "n- c #F7FFAD", "o- c #FFDE94", "p- c #FFCE84", "q- c #FF7B3A", "r- c #FF5210", "s- c #08FFBD", "t- c #94FFB5", "u- c #9CFFB5", "v- c #ADFFAD", "w- c #C5FFB5", "x- c #EFFFB5", "y- c #FFFFAD", "z- c #FFEFA5", "A- c #FFE69C", "B- c #FFD68C", "C- c #FF9C5A", "D- c #FF9452", "E- c #FF7331", "F- c #FF6B29", "G- c #FF6321", "H- c #FF4A08", "I- c #00FFBD", "J- c #10FFBD", "K- c #19FFBD", "L- c #21FFBD", "M- c #29FFBD", "N- c #31FFBD", "O- c #3AFFBD", "P- c #42FFBD", "Q- c #4AFFBD", "R- c #52FFBD", "S- c #5AFFBD", "T- c #A5FFB5", "U- c #BDFFB5", "V- c #F7FFB5", "W- c #FFBD7B", "X- c #FFB573", "Y- c #FFAD6B", "Z- c #FFA563", "`- c #FF8C4A", " ; c #FF8442", ".; c #FF5A19", "+; c #FF4200", "@; c #63FFBD", "#; c #6BFFBD", "$; c #73FFBD", "%; c #7BFFBD", "&; c #84FFBD", "*; c #94FFBD", "=; c #ADFFB5", "-; c #B5FFB5", ";; c #CEFFBD", ">; c #D6FFBD", ",; c #DEFFBD", "'; c #E6FFBD", "); c #FFFFB5", "!; c #FFF7AD", "~; c #FFE6A5", "{; c #FFDE9C", "]; c #FFD694", "^; c #FFCE8C", "/; c #FFC584", "(; c #8CFFBD", "_; c #9CFFBD", ":; c #A5FFBD", "<; c #C5FFBD", "[; c #EFFFBD", "}; c #FFEFAD", "|; c #FFB57B", "1; c #FFAD73", "2; c #FF945A", "3; c #FF7B42", "4; c #FF733A", "5; c #FF6B31", "6; c #FF5A21", "7; c #FF4A10", "8; c #FF4208", "9; c #00FFC5", "0; c #08FFC5", "a; c #10FFC5", "b; c #19FFC5", "c; c #29FFC5", "d; c #31FFC5", "e; c #3AFFC5", "f; c #42FFC5", "g; c #4AFFC5", "h; c #63FFC5", "i; c #ADFFBD", "j; c #BDFFBD", "k; c #F7FFBD", "l; c #FFF7B5", "m; c #FFA56B", "n; c #FF9C63", "o; c #FF8C52", "p; c #FF844A", "q; c #FF6329", "r; c #FF5219", "s; c #FF3A00", "t; c #21FFC5", "u; c #52FFC5", "v; c #5AFFC5", "w; c #6BFFC5", "x; c #73FFC5", "y; c #7BFFC5", "z; c #84FFC5", "A; c #8CFFC5", "B; c #94FFC5", "C; c #B5FFBD", "D; c #D6FFC5", "E; c #DEFFC5", "F; c #E6FFC5", "G; c #FFFFBD", "H; c #FFDEA5", "I; c #FFD69C", "J; c #FFCE94", "K; c #FFC58C", "L; c #FFBD84", "M; c #9CFFC5", "N; c #A5FFC5", "O; c #CEFFC5", "P; c #EFFFC5", "Q; c #F7FFC5", "R; c #FFEFB5", "S; c #FFE6AD", "T; c #FF8C5A", "U; c #FF8452", "V; c #FF6B3A", "W; c #FF6331", "X; c #FF4210", "Y; c #08FFCE", "Z; c #10FFCE", "`; c #19FFCE", " > c #29FFCE", ".> c #3AFFCE", "+> c #42FFCE", "@> c #ADFFC5", "#> c #B5FFC5", "$> c #C5FFC5", "%> c #FFF7BD", "&> c #FFD6A5", "*> c #FFCE9C", "=> c #FFAD7B", "-> c #FFA573", ";> c #FF9C6B", ">> c #FF9463", ",> c #FF7B4A", "'> c #FF7342", ")> c #FF5A29", "!> c #FF4A19", "~> c #FF3A08", "{> c #00FFCE", "]> c #21FFCE", "^> c #31FFCE", "/> c #4AFFCE", "(> c #52FFCE", "_> c #5AFFCE", ":> c #63FFCE", "<> c #6BFFCE", "[> c #73FFCE", "}> c #7BFFCE", "|> c #84FFCE", "1> c #8CFFCE", "2> c #94FFCE", "3> c #9CFFCE", "4> c #A5FFCE", "5> c #BDFFC5", "6> c #FFFFC5", "7> c #FFDEAD", "8> c #FFC594", "9> c #FFBD8C", "0> c #FFB584", "a> c #FF5221", "b> c #FF3100", "c> c #ADFFCE", "d> c #B5FFCE", "e> c #DEFFCE", "f> c #E6FFCE", "g> c #EFFFCE", "h> c #FFF7C5", "i> c #FFEFBD", "j> c #FFE6B5", "k> c #FF3A10", "l> c #08FFD6", "m> c #19FFD6", "n> c #21FFD6", "o> c #31FFD6", "p> c #3AFFD6", "q> c #BDFFCE", "r> c #C5FFCE", "s> c #D6FFCE", "t> c #F7FFCE", "u> c #FFCEA5", "v> c #FFC59C", "w> c #FFBD94", "x> c #FFB58C", "y> c #FFA57B", "z> c #FF9C73", "A> c #FF946B", "B> c #FF845A", "C> c #FF7B52", "D> c #FF734A", "E> c #FF633A", "F> c #FF5A31", "G> c #FF5229", "H> c #FF4A21", "I> c #FF4219", "J> c #FF3108", "K> c #00FFD6", "L> c #10FFD6", "M> c #29FFD6", "N> c #42FFD6", "O> c #4AFFD6", "P> c #52FFD6", "Q> c #5AFFD6", "R> c #63FFD6", "S> c #6BFFD6", "T> c #73FFD6", "U> c #7BFFD6", "V> c #84FFD6", "W> c #8CFFD6", "X> c #94FFD6", "Y> c #9CFFD6", "Z> c #CEFFCE", "`> c #FFFFCE", " , c #FFE6BD", "., c #FFDEB5", "+, c #FFD6AD", "@, c #FFAD84", "#, c #FF8C63", "$, c #FF6B42", "%, c #FF2900", "&, c #A5FFD6", "*, c #ADFFD6", "=, c #B5FFD6", "-, c #BDFFD6", ";, c #DEFFD6", ">, c #E6FFD6", ",, c #EFFFD6", "', c #F7FFD6", "), c #FFEFC5", "!, c #FF5A3A", "~, c #FF3110", "{, c #08FFDE", "], c #21FFDE", "^, c #C5FFD6", "/, c #CEFFD6", "(, c #D6FFD6", "_, c #FFFFD6", ":, c #FFF7CE", "<, c #FFBD9C", "[, c #FF9C7B", "}, c #FF7B5A", "|, c #FF7352", "1, c #FF6B4A", "2, c #FF6342", "3, c #FF5231", "4, c #FF4A29", "5, c #FF4221", "6, c #FF2908", "7, c #10FFDE", "8, c #19FFDE", "9, c #29FFDE", "0, c #31FFDE", "a, c #3AFFDE", "b, c #42FFDE", "c, c #4AFFDE", "d, c #52FFDE", "e, c #5AFFDE", "f, c #63FFDE", "g, c #6BFFDE", "h, c #73FFDE", "i, c #7BFFDE", "j, c #84FFDE", "k, c #8CFFDE", "l, c #94FFDE", "m, c #9CFFDE", "n, c #A5FFDE", "o, c #FFE6C5", "p, c #FFDEBD", "q, c #FFD6B5", "r, c #FFCEAD", "s, c #FFC5A5", "t, c #FFB594", "u, c #FFAD8C", "v, c #FFA584", "w, c #FF9473", "x, c #FF8C6B", "y, c #FF8463", "z, c #FF3A19", "A, c #00FFDE", "B, c #ADFFDE", "C, c #B5FFDE", "D, c #BDFFDE", "E, c #C5FFDE", "F, c #CEFFDE", "G, c #E6FFDE", "H, c #EFFFDE", "I, c #F7FFDE", "J, c #FFEFCE", "K, c #FF2910", "L, c #FF2100", "M, c #D6FFDE", "N, c #DEFFDE", "O, c #FFFFDE", "P, c #FFF7D6", "Q, c #FFBDA5", "R, c #FFB59C", "S, c #FF947B", "T, c #FF735A", "U, c #FF6B52", "V, c #FF634A", "W, c #FF523A", "X, c #FF4A31", "Y, c #FF3A21", "Z, c #10FFE6", "`, c #29FFE6", " ' c #31FFE6", ".' c #42FFE6", "+' c #52FFE6", "@' c #5AFFE6", "#' c #63FFE6", "$' c #7BFFE6", "%' c #FFDEC5", "&' c #FFD6BD", "*' c #FFCEB5", "=' c #FFC5AD", "-' c #FFAD94", ";' c #FFA58C", ">' c #FF9C84", ",' c #FF8C73", "'' c #FF846B", ")' c #FF7B63", "!' c #FF5A42", "~' c #FF4229", "{' c #FF2108", "]' c #00FFE6", "^' c #08FFE6", "/' c #19FFE6", "(' c #21FFE6", "_' c #3AFFE6", ":' c #4AFFE6", "<' c #6BFFE6", "[' c #73FFE6", "}' c #84FFE6", "|' c #8CFFE6", "1' c #94FFE6", "2' c #9CFFE6", "3' c #A5FFE6", "4' c #ADFFE6", "5' c #B5FFE6", "6' c #BDFFE6", "7' c #C5FFE6", "8' c #CEFFE6", "9' c #E6FFE6", "0' c #EFFFE6", "a' c #F7FFE6", "b' c #FFF7DE", "c' c #FFEFD6", "d' c #FFE6CE", "e' c #FF3119", "f' c #FF1900", "g' c #D6FFE6", "h' c #DEFFE6", "i' c #FFFFE6", "j' c #FF4A3A", "k' c #FF2110", "l' c #08FFEF", "m' c #10FFEF", "n' c #31FFEF", "o' c #FFE6D6", "p' c #FFD6C5", "q' c #FFCEBD", "r' c #FFC5B5", "s' c #FFBDAD", "t' c #FFB5A5", "u' c #FFAD9C", "v' c #FFA594", "w' c #FF9C8C", "x' c #FF8C7B", "y' c #FF8473", "z' c #FF7B6B", "A' c #FF7363", "B' c #FF6B5A", "C' c #FF5A4A", "D' c #FF5242", "E' c #FF4231", "F' c #FF3A29", "G' c #FF3121", "H' c #FF1908", "I' c #19FFEF", "J' c #21FFEF", "K' c #29FFEF", "L' c #3AFFEF", "M' c #42FFEF", "N' c #4AFFEF", "O' c #52FFEF", "P' c #5AFFEF", "Q' c #63FFEF", "R' c #6BFFEF", "S' c #73FFEF", "T' c #7BFFEF", "U' c #84FFEF", "V' c #8CFFEF", "W' c #94FFEF", "X' c #9CFFEF", "Y' c #A5FFEF", "Z' c #ADFFEF", "`' c #B5FFEF", " ) c #BDFFEF", ".) c #C5FFEF", "+) c #CEFFEF", "@) c #D6FFEF", "#) c #DEFFEF", "$) c #EFFFEF", "%) c #F7FFEF", "&) c #FFF7E6", "*) c #FFEFDE", "=) c #FFDECE", "-) c #FF9484", ";) c #FF6352", ">) c #FF2919", ",) c #00FFEF", "') c #E6FFEF", ")) c #FFFFEF", "!) c #FF1000", "~) c #FFF7EF", "{) c #FFE6DE", "]) c #FFCEC5", "^) c #FFC5BD", "/) c #FFADA5", "() c #FFA59C", "_) c #FF9C94", ":) c #FF948C", "<) c #FF847B", "[) c #FF7B73", "}) c #FF635A", "|) c #FF5A52", "1) c #FF423A", "2) c #FF3A31", "3) c #FF3129", "4) c #08FFF7", "5) c #10FFF7", "6) c #19FFF7", "7) c #21FFF7", "8) c #29FFF7", "9) c #31FFF7", "0) c #42FFF7", "a) c #4AFFF7", "b) c #52FFF7", "c) c #5AFFF7", "d) c #6BFFF7", "e) c #73FFF7", "f) c #7BFFF7", "g) c #84FFF7", "h) c #8CFFF7", "i) c #94FFF7", "j) c #9CFFF7", "k) c #A5FFF7", "l) c #ADFFF7", "m) c #B5FFF7", "n) c #BDFFF7", "o) c #C5FFF7", "p) c #CEFFF7", "q) c #D6FFF7", "r) c #DEFFF7", "s) c #E6FFF7", "t) c #FFEFE6", "u) c #FFDED6", "v) c #FFD6CE", "w) c #FFBDB5", "x) c #FFB5AD", "y) c #FF8C84", "z) c #FF736B", "A) c #FF6B63", "B) c #FF524A", "C) c #FF4A42", "D) c #FF2921", "E) c #FF2119", "F) c #FF1910", "G) c #FF1008", "H) c #00FFF7", "I) c #3AFFF7", "J) c #63FFF7", "K) c #EFFFF7", "L) c #F7FFF7", "M) c #FFFFF7", "N) c #FF0800", "O) c #FFEFEF", "P) c #FFE6E6", "Q) c #FFDEDE", "R) c #FFC5C5", "S) c #FFBDBD", "T) c #FF9C9C", "U) c #FF7B7B", "V) c #FF7373", "W) c #FF5252", "X) c #FF4A4A", "Y) c #FF3A3A", "Z) c #FF3131", "`) c #FF2929", " ! c #00FFFF", ".! c #08FFFF", "+! c #10FFFF", "@! c #19FFFF", "#! c #21FFFF", "$! c #29FFFF", "%! c #31FFFF", "&! c #3AFFFF", "*! c #7BFFFF", "=! c #84FFFF", "-! c #8CFFFF", ";! c #A5FFFF", ">! c #ADFFFF", ",! c #BDFFFF", "'! c #C5FFFF", ")! c #FFF7F7", "!! c #FFD6D6", "~! c #FFCECE", "{! c #FFB5B5", "]! c #FFADAD", "^! c #FFA5A5", "/! c #FF9494", "(! c #FF8C8C", "_! c #FF8484", ":! c #FF6B6B", "~ c #08F7FF", ",~ c #10F7FF", "'~ c #19F7FF", ")~ c #21F7FF", "!~ c #29F7FF", "~~ c #31F7FF", "{~ c #84F7FF", "]~ c #FFEFFF", "^~ c #FFDEEF", "/~ c #FFD6E6", "(~ c #FFCEDE", "_~ c #FFC5D6", ":~ c #FFA5B5", "<~ c #FF94A5", "[~ c #FF8494", "}~ c #FF7B8C", "|~ c #FF6373", "1~ c #FF5A6B", "2~ c #FF3A4A", "3~ c #FF293A", "4~ c #FF2131", "5~ c #FF1929", "6~ c #00EFFF", "7~ c #31EFFF", "8~ c #3AEFFF", "9~ c #42EFFF", "0~ c #5AEFFF", "a~ c #63EFFF", "b~ c #6BEFFF", "c~ c #7BEFFF", "d~ c #94EFFF", "e~ c #A5EFFF", "f~ c #ADEFFF", "g~ c #BDEFFF", "h~ c #C5EFFF", "i~ c #CEEFFF", "j~ c #D6EFFF", "k~ c #DEEFFF", "l~ c #E6EFFF", "m~ c #EFEFFF", "n~ c #F7EFFF", "o~ c #FFE6F7", "p~ c #FFBDCE", "q~ c #FFB5C5", "r~ c #FFADBD", "s~ c #FF9CAD", "t~ c #FF8C9C", "u~ c #FF7384", "v~ c #FF6B7B", "w~ c #FF5263", "x~ c #FF4A5A", "y~ c #FF4252", "z~ c #FF3142", "A~ c #FF1021", "B~ c #FF0819", "C~ c #FF0010", "D~ c #08EFFF", "E~ c #10EFFF", "F~ c #19EFFF", "G~ c #21EFFF", "H~ c #29EFFF", "I~ c #4AEFFF", "J~ c #52EFFF", "K~ c #73EFFF", "L~ c #84EFFF", "M~ c #8CEFFF", "N~ c #9CEFFF", "O~ c #B5EFFF", "P~ c #E6E6FF", "Q~ c #FFE6FF", "R~ c #FFD6EF", "S~ c #FFC5DE", "T~ c #FFA5BD", "U~ c #FF849C", "V~ c #FF7B94", "W~ c #FF637B", "X~ c #FF213A", "Y~ c #00E6FF", "Z~ c #08E6FF", "`~ c #29E6FF", " { c #31E6FF", ".{ c #4AE6FF", "+{ c #52E6FF", "@{ c #63E6FF", "#{ c #73E6FF", "${ c #8CE6FF", "%{ c #C5E6FF", "&{ c #CEE6FF", "*{ c #DEE6FF", "={ c #EFE6FF", "-{ c #FFDEF7", ";{ c #FFCEE6", ">{ c #FFBDD6", ",{ c #FFB5CE", "'{ c #FFADC5", "){ c #FF9CB5", "!{ c #FF94AD", "~{ c #FF8CA5", "{{ c #FF738C", "]{ c #FF6B84", "^{ c #FF5A73", "/{ c #FF526B", "({ c #FF4A63", "_{ c #FF425A", ":{ c #FF3A52", "<{ c #FF314A", "[{ c #FF2942", "}{ c #FF1931", "|{ c #FF1029", "1{ c #FF0821", "2{ c #FF0019", "3{ c #10E6FF", "4{ c #19E6FF", "5{ c #21E6FF", "6{ c #3AE6FF", "7{ c #42E6FF", "8{ c #5AE6FF", "9{ c #6BE6FF", "0{ c #7BE6FF", "a{ c #84E6FF", "b{ c #94E6FF", "c{ c #9CE6FF", "d{ c #A5E6FF", "e{ c #ADE6FF", "f{ c #B5E6FF", "g{ c #BDE6FF", "h{ c #D6E6FF", "i{ c #F7E6FF", "j{ c #DEDEFF", "k{ c #FFDEFF", "l{ c #FFD6F7", "m{ c #FFCEEF", "n{ c #FFC5E6", "o{ c #FF7B9C", "p{ c #FF6384", "q{ c #FF3A5A", "r{ c #08DEFF", "s{ c #29DEFF", "t{ c #BDDEFF", "u{ c #C5DEFF", "v{ c #CEDEFF", "w{ c #D6DEFF", "x{ c #E6DEFF", "y{ c #F7DEFF", "z{ c #FFBDDE", "A{ c #FFB5D6", "B{ c #FFADCE", "C{ c #FFA5C5", "D{ c #FF9CBD", "E{ c #FF94B5", "F{ c #FF8CAD", "G{ c #FF84A5", "H{ c #FF7394", "I{ c #FF6B8C", "J{ c #FF5A7B", "K{ c #FF4A6B", "L{ c #FF4263", "M{ c #FF294A", "N{ c #FF193A", "O{ c #FF1031", "P{ c #FF0829", "Q{ c #00DEFF", "R{ c #10DEFF", "S{ c #19DEFF", "T{ c #21DEFF", "U{ c #31DEFF", "V{ c #3ADEFF", "W{ c #42DEFF", "X{ c #4ADEFF", "Y{ c #52DEFF", "Z{ c #5ADEFF", "`{ c #63DEFF", " ] c #6BDEFF", ".] c #73DEFF", "+] c #7BDEFF", "@] c #84DEFF", "#] c #8CDEFF", "$] c #94DEFF", "%] c #9CDEFF", "&] c #A5DEFF", "*] c #ADDEFF", "=] c #B5DEFF", "-] c #EFDEFF", ";] c #FFD6FF", ">] c #FF5273", ",] c #FF3152", "'] c #FF2142", ")] c #FF0021", "!] c #DED6FF", "~] c #FFCEF7", "{] c #FFC5EF", "]] c #FFA5CE", "^] c #C5D6FF", "/] c #CED6FF", "(] c #D6D6FF", "_] c #F7D6FF", ":] c #FFBDE6", "<] c #FFB5DE", "[] c #FFADD6", "}] c #FF9CC5", "|] c #FF84AD", "1] c #FF7BA5", "2] c #FF6B94", "3] c #FF638C", "4] c #FF5A84", "5] c #FF426B", "6] c #FF3A63", "7] c #FF2952", "8] c #FF1942", "9] c #FF103A", "0] c #00D6FF", "a] c #19D6FF", "b] c #31D6FF", "c] c #42D6FF", "d] c #52D6FF", "e] c #5AD6FF", "f] c #63D6FF", "g] c #6BD6FF", "h] c #73D6FF", "i] c #7BD6FF", "j] c #8CD6FF", "k] c #94D6FF", "l] c #9CD6FF", "m] c #A5D6FF", "n] c #ADD6FF", "o] c #B5D6FF", "p] c #BDD6FF", "q] c #E6D6FF", "r] c #EFD6FF", "s] c #FFCEFF", "t] c #FFC5F7", "u] c #FF94BD", "v] c #FF8CB5", "w] c #FF739C", "x] c #FF527B", "y] c #FF4A73", "z] c #FF315A", "A] c #FF214A", "B] c #FF0831", "C] c #FF0029", "D] c #08D6FF", "E] c #10D6FF", "F] c #21D6FF", "G] c #29D6FF", "H] c #3AD6FF", "I] c #4AD6FF", "J] c #84D6FF", "K] c #C5CEFF", "L] c #CECEFF", "M] c #D6CEFF", "N] c #FFADDE", "O] c #BDCEFF", "P] c #DECEFF", "Q] c #F7CEFF", "R] c #FFC5FF", "S] c #FFBDEF", "T] c #FFB5E6", "U] c #FFA5D6", "V] c #FF9CCE", "W] c #FF94C5", "X] c #FF8CBD", "Y] c #FF84B5", "Z] c #FF7BAD", "`] c #FF5A8C", " ^ c #FF3A6B", ".^ c #FF194A", "+^ c #FF1042", "@^ c #00CEFF", "#^ c #08CEFF", "$^ c #19CEFF", "%^ c #29CEFF", "&^ c #5ACEFF", "*^ c #63CEFF", "=^ c #7BCEFF", "-^ c #84CEFF", ";^ c #8CCEFF", ">^ c #94CEFF", ",^ c #9CCEFF", "'^ c #A5CEFF", ")^ c #ADCEFF", "!^ c #B5CEFF", "~^ c #CEC5FF", "{^ c #E6CEFF", "]^ c #EFCEFF", "^^ c #FF73A5", "/^ c #FF6B9C", "(^ c #FF6394", "_^ c #FF4A7B", ":^ c #FF4273", "<^ c #FF3163", "[^ c #FF295A", "}^ c #FF2152", "|^ c #FF083A", "1^ c #FF0031", "2^ c #10CEFF", "3^ c #21CEFF", "4^ c #31CEFF", "5^ c #3ACEFF", "6^ c #42CEFF", "7^ c #4ACEFF", "8^ c #52CEFF", "9^ c #6BCEFF", "0^ c #73CEFF", "a^ c #C5C5FF", "b^ c #F7C5FF", "c^ c #FFBDF7", "d^ c #FFB5EF", "e^ c #FF5284", "f^ c #B5C5FF", "g^ c #BDC5FF", "h^ c #D6C5FF", "i^ c #EFC5FF", "j^ c #FFADE6", "k^ c #FFA5DE", "l^ c #FF9CD6", "m^ c #FF6BA5", "n^ c #FF104A", "o^ c #29C5FF", "p^ c #5AC5FF", "q^ c #63C5FF", "r^ c #7BC5FF", "s^ c #84C5FF", "t^ c #8CC5FF", "u^ c #94C5FF", "v^ c #9CC5FF", "w^ c #A5C5FF", "x^ c #ADC5FF", "y^ c #BDBDFF", "z^ c #DEC5FF", "A^ c #E6C5FF", "B^ c #FFBDFF", "C^ c #FF94CE", "D^ c #FF8CC5", "E^ c #FF84BD", "F^ c #FF7BB5", "G^ c #FF73AD", "H^ c #FF639C", "I^ c #FF5A94", "J^ c #FF427B", "K^ c #FF3A73", "L^ c #FF2963", "M^ c #FF215A", "N^ c #FF1952", "O^ c #FF0842", "P^ c #00C5FF", "Q^ c #08C5FF", "R^ c #10C5FF", "S^ c #19C5FF", "T^ c #21C5FF", "U^ c #31C5FF", "V^ c #3AC5FF", "W^ c #42C5FF", "X^ c #4AC5FF", "Y^ c #52C5FF", "Z^ c #6BC5FF", "`^ c #73C5FF", " / c #B5BDFF", "./ c #C5BDFF", "+/ c #FFB5F7", "@/ c #FFADEF", "#/ c #FF528C", "$/ c #FF4A84", "%/ c #FF316B", "&/ c #FF003A", "*/ c #A5BDFF", "=/ c #ADBDFF", "-/ c #F7BDFF", ";/ c #FFA5E6", ">/ c #FF9CDE", ",/ c #FF94D6", "'/ c #FF8CCE", ")/ c #FF7BBD", "!/ c #FF63A5", "~/ c #73BDFF", "{/ c #7BBDFF", "]/ c #84BDFF", "^/ c #8CBDFF", "// c #94BDFF", "(/ c #9CBDFF", "_/ c #B5B5FF", ":/ c #CEBDFF", "( c #6BB5FF", ",( c #73B5FF", "'( c #A5ADFF", ")( c #D6B5FF", "!( c #DEB5FF", "~( c #E6B5FF", "{( c #F7ADFF", "]( c #FF9CEF", "^( c #FF529C", "/( c #FF2973", "(( c #FF216B", "_( c #FF0852", ":( c #00B5FF", "<( c #94ADFF", "[( c #9CADFF", "}( c #A5A5FF", "|( c #BDADFF", "1( c #EFADFF", "2( c #FFA5FF", "3( c #FF94E6", "4( c #FF8CDE", "5( c #FF84D6", "6( c #FF7BCE", "7( c #FF317B", "8( c #73ADFF", "9( c #7BADFF", "0( c #84ADFF", "a( c #8CADFF", "b( c #ADA5FF", "c( c #C5ADFF", "d( c #E6ADFF", "e( c #FF9CF7", "f( c #FF73C5", "g( c #FF6BBD", "h( c #FF63B5", "i( c #FF5AAD", "j( c #FF52A5", "k( c #FF196B", "l( c #FF1063", "m( c #21ADFF", "n( c #29ADFF", "o( c #3AADFF", "p( c #42ADFF", "q( c #52ADFF", "r( c #5AADFF", "s( c #63ADFF", "t( c #6BADFF", "u( c #9CA5FF", "v( c #B5A5FF", "w( c #CEADFF", "x( c #D6ADFF", "y( c #DEADFF", "z( c #F7A5FF", "A( c #FF94EF", "B( c #FF8CE6", "C( c #FF84DE", "D( c #FF4A9C", "E( c #FF4294", "F( c #FF3A8C", "G( c #FF3184", "H( c #FF297B", "I( c #FF2173", "J( c #FF085A", "K( c #00ADFF", "L( c #08ADFF", "M( c #10ADFF", "N( c #19ADFF", "O( c #31ADFF", "P( c #4AADFF", "Q( c #8CA5FF", "R( c #94A5FF", "S( c #BDA5FF", "T( c #EFA5FF", "U( c #FF9CFF", "V( c #FF7BD6", "W( c #FF73CE", "X( c #FF5AB5", "Y( c #FF0052", "Z( c #6BA5FF", "`( c #73A5FF", " _ c #7BA5FF", "._ c #84A5FF", "+_ c #9C9CFF", "@_ c #C5A5FF", "#_ c #DEA5FF", "$_ c #E6A5FF", "%_ c #FF94F7", "&_ c #FF6BC5", "*_ c #FF63BD", "=_ c #FF52AD", "-_ c #FF429C", ";_ c #FF3A94", ">_ c #FF217B", ",_ c #FF106B", "'_ c #FF005A", ")_ c #19A5FF", "!_ c #29A5FF", "~_ c #3AA5FF", "{_ c #42A5FF", "]_ c #4AA5FF", "^_ c #52A5FF", "/_ c #5AA5FF", "(_ c #63A5FF", "__ c #8C9CFF", ":_ c #949CFF", "<_ c #A59CFF", "[_ c #CEA5FF", "}_ c #D6A5FF", "|_ c #F79CFF", "1_ c #FF8CEF", "2_ c #FF84E6", "3_ c #FF7BDE", "4_ c #FF4AA5", "5_ c #FF318C", "6_ c #FF2984", "7_ c #FF1973", "8_ c #FF0863", "9_ c #00A5FF", "0_ c #08A5FF", "a_ c #10A5FF", "b_ c #21A5FF", "c_ c #31A5FF", "d_ c #7B9CFF", "e_ c #849CFF", "f_ c #9494FF", "g_ c #AD9CFF", "h_ c #EF9CFF", "i_ c #FF94FF", "j_ c #FF6BCE", "k_ c #FF63C5", "l_ c #639CFF", "m_ c #6B9CFF", "n_ c #739CFF", "o_ c #8C94FF", "p_ c #9C94FF", "q_ c #B59CFF", "r_ c #E69CFF", "s_ c #FF8CF7", "t_ c #FF84EF", "u_ c #FF7BE6", "v_ c #FF73D6", "w_ c #FF5ABD", "x_ c #FF52B5", "y_ c #FF4AAD", "z_ c #FF42A5", "A_ c #109CFF", "B_ c #199CFF", "C_ c #299CFF", "D_ c #319CFF", "E_ c #3A9CFF", "F_ c #429CFF", "G_ c #4A9CFF", "H_ c #529CFF", "I_ c #5A9CFF", "J_ c #8494FF", "K_ c #BD9CFF", "L_ c #DE9CFF", "M_ c #F794FF", "N_ c #FF8CFF", "O_ c #FF3A9C", "P_ c #FF3194", "Q_ c #FF298C", "R_ c #FF197B", "S_ c #FF1073", "T_ c #FF086B", "U_ c #FF0063", "V_ c #009CFF", "W_ c #089CFF", "X_ c #219CFF", "Y_ c #7394FF", "Z_ c #7B94FF", "`_ c #8C8CFF", " : c #A594FF", ".: c #C59CFF", "+: c #CE9CFF", "@: c #D69CFF", "#: c #EF94FF", "$: c #FF84F7", "%: c #FF73DE", "&: c #FF6BD6", "*: c #FF63CE", "=: c #FF2184", "-: c #5294FF", ";: c #5A94FF", ">: c #6394FF", ",: c #6B94FF", "': c #848CFF", "): c #948CFF", "!: c #AD94FF", "~: c #E694FF", "{: c #F78CFF", "]: c #FF7BEF", "^: c #FF5AC5", "/: c #FF52BD", "(: c #FF4AB5", "_: c #FF3AA5", ":: c #3194FF", "<: c #3A94FF", "[: c #4294FF", "}: c #4A94FF", "|: c #7B8CFF", "1: c #9C8CFF", "2: c #B594FF", "3: c #DE94FF", "4: c #FF84FF", "5: c #FF73E6", "6: c #FF6BDE", "7: c #FF42AD", "8: c #FF319C", "9: c #FF2994", "0: c #FF218C", "a: c #FF1984", "b: c #FF107B", "c: c #FF0873", "d: c #FF006B", "e: c #0894FF", "f: c #1094FF", "g: c #1994FF", "h: c #2194FF", "i: c #2994FF", "j: c #738CFF", "k: c #8484FF", "l: c #8C84FF", "m: c #A58CFF", "n: c #BD94FF", "o: c #C594FF", "p: c #CE94FF", "q: c #D694FF", "r: c #EF8CFF", "s: c #FF7BF7", "t: c #FF63D6", "u: c #FF5ACE", "v: c #0094FF", "w: c #5A8CFF", "x: c #638CFF", "y: c #6B8CFF", "z: c #7B84FF", "A: c #9484FF", "B: c #AD8CFF", "C: c #E68CFF", "D: c #F784FF", "E: c #FF52C5", "F: c #FF4ABD", "G: c #FF42B5", "H: c #FF3AAD", "I: c #318CFF", "J: c #428CFF", "K: c #4A8CFF", "L: c #528CFF", "M: c #7384FF", "N: c #7B7BFF", "O: c #B58CFF", "P: c #D68CFF", "Q: c #DE8CFF", "R: c #EF84FF", "S: c #FF7BFF", "T: c #FF73EF", "U: c #FF6BE6", "V: c #FF63DE", "W: c #FF31A5", "X: c #FF299C", "Y: c #FF2194", "Z: c #FF198C", "`: c #FF1084", " < c #FF087B", ".< c #FF0073", "+< c #088CFF", "@< c #108CFF", "#< c #198CFF", "$< c #218CFF", "%< c #298CFF", "&< c #3A8CFF", "*< c #5A84FF", "=< c #6384FF", "-< c #6B84FF", ";< c #847BFF", ">< c #9C84FF", ",< c #BD8CFF", "'< c #C58CFF", ")< c #CE8CFF", "!< c #FF73F7", "~< c #FF5AD6", "{< c #008CFF", "]< c #5284FF", "^< c #737BFF", "/< c #8C7BFF", "(< c #A584FF", "_< c #DE84FF", ":< c #E684FF", "<< c #F77BFF", "[< c #FF6BEF", "}< c #FF63E6", "|< c #FF5ADE", "1< c #FF52CE", "2< c #FF4AC5", "3< c #FF42BD", "4< c #FF3AB5", "5< c #FF219C", "6< c #1984FF", "7< c #2184FF", "8< c #2984FF", "9< c #3A84FF", "0< c #4284FF", "a< c #4A84FF", "b< c #637BFF", "c< c #6B7BFF", "d< c #947BFF", "e< c #AD84FF", "f< c #B584FF", "g< c #D684FF", "h< c #EF7BFF", "i< c #FF73FF", "j< c #FF31AD", "k< c #FF29A5", "l< c #FF1994", "m< c #FF108C", "n< c #FF0884", "o< c #FF007B", "p< c #0884FF", "q< c #1084FF", "r< c #3184FF", "s< c #5A7BFF", "t< c #6B73FF", "u< c #7373FF", "v< c #7B73FF", "w< c #BD84FF", "x< c #C584FF", "y< c #CE84FF", "z< c #E67BFF", "A< c #FF6BF7", "B< c #FF63EF", "C< c #0084FF", "D< c #3A7BFF", "E< c #427BFF", "F< c #4A7BFF", "G< c #527BFF", "H< c #9C7BFF", "I< c #DE7BFF", "J< c #F773FF", "K< c #FF52D6", "L< c #FF4ACE", "M< c #FF42C5", "N< c #FF3ABD", "O< c #FF31B5", "P< c #FF199C", "Q< c #FF1094", "R< c #197BFF", "S< c #217BFF", "T< c #297BFF", "U< c #317BFF", "V< c #5A73FF", "W< c #6373FF", "X< c #8473FF", "Y< c #A57BFF", "Z< c #AD7BFF", "`< c #D67BFF", " [ c #EF73FF", ".[ c #FF6BFF", "+[ c #FF5AE6", "@[ c #FF52DE", "#[ c #FF29AD", "$[ c #FF21A5", "%[ c #FF088C", "&[ c #FF0084", "*[ c #007BFF", "=[ c #087BFF", "-[ c #107BFF", ";[ c #4A73FF", ">[ c #5273FF", ",[ c #636BFF", "'[ c #6B6BFF", ")[ c #736BFF", "![ c #8C73FF", "~[ c #B57BFF", "{[ c #BD7BFF", "][ c #C57BFF", "^[ c #CE7BFF", "/[ c #F76BFF", "([ c #FF63F7", "_[ c #FF5AEF", ":[ c #FF4AD6", "<[ c #FF42CE", "[[ c #FF3AC5", "}[ c #3173FF", "|[ c #3A73FF", "1[ c #4273FF", "2[ c #5A6BFF", "3[ c #9473FF", "4[ c #E673FF", "5[ c #FF63FF", "6[ c #FF52E6", "7[ c #FF31BD", "8[ c #FF29B5", "9[ c #FF109C", "0[ c #1073FF", "a[ c #1973FF", "b[ c #2173FF", "c[ c #2973FF", "d[ c #526BFF", "e[ c #6363FF", "f[ c #6B63FF", "g[ c #7B6BFF", "h[ c #9C73FF", "i[ c #DE73FF", "j[ c #EF6BFF", "k[ c #FF5AF7", "l[ c #FF4ADE", "m[ c #FF42D6", "n[ c #FF21AD", "o[ c #FF19A5", "p[ c #FF0894", "q[ c #FF008C", "r[ c #0073FF", "s[ c #0873FF", "t[ c #426BFF", "u[ c #4A6BFF", "v[ c #5A63FF", "w[ c #846BFF", "x[ c #A573FF", "y[ c #CE73FF", "z[ c #D673FF", "A[ c #E66BFF", "B[ c #F763FF", "C[ c #FF3ACE", "D[ c #296BFF", "E[ c #316BFF", "F[ c #3A6BFF", "G[ c #5263FF", "H[ c #7363FF", "I[ c #8C6BFF", "J[ c #AD73FF", "K[ c #B573FF", "L[ c #BD73FF", "M[ c #C573FF", "N[ c #DE6BFF", "O[ c #EF63FF", "P[ c #FF5AFF", "Q[ c #FF52EF", "R[ c #FF4AE6", "S[ c #FF42DE", "T[ c #FF3AD6", "U[ c #FF31C5", "V[ c #FF29BD", "W[ c #FF21B5", "X[ c #FF10A5", "Y[ c #006BFF", "Z[ c #086BFF", "`[ c #106BFF", " } c #196BFF", ".} c #216BFF", "+} c #4A63FF", "@} c #5A5AFF", "#} c #635AFF", "$} c #7B63FF", "%} c #946BFF", "&} c #D66BFF", "*} c #FF19AD", "=} c #FF089C", "-} c #FF0094", ";} c #3A63FF", ">} c #4263FF", ",} c #525AFF", "'} c #9C6BFF", ")} c #A56BFF", "!} c #CE6BFF", "~} c #E663FF", "{} c #F75AFF", "]} c #FF52F7", "^} c #FF29C5", "/} c #FF21BD", "(} c #2163FF", "_} c #2963FF", ":} c #3163FF", "<} c #425AFF", "[} c #4A5AFF", "}} c #6B5AFF", "|} c #8463FF", "1} c #AD6BFF", "2} c #B56BFF", "3} c #BD6BFF", "4} c #C56BFF", "5} c #DE63FF", "6} c #EF5AFF", "7} c #FF4AEF", "8} c #FF42E6", "9} c #FF3ADE", "0} c #FF31CE", "a} c #FF19B5", "b} c #FF10AD", "c} c #FF08A5", "d} c #0063FF", "e} c #0863FF", "f} c #1063FF", "g} c #1963FF", "h} c #3A5AFF", "i} c #5252FF", "j} c #735AFF", "k} c #8C63FF", "l} c #D663FF", "m} c #E65AFF", "n} c #FF52FF", "o} c #FF4AF7", "p} c #FF31D6", "q} c #FF29CE", "r} c #FF009C", "s} c #215AFF", "t} c #295AFF", "u} c #315AFF", "v} c #4A52FF", "w} c #5A52FF", "x} c #7B5AFF", "y} c #9463FF", "z} c #9C63FF", "A} c #C563FF", "B} c #CE63FF", "C} c #F752FF", "D} c #FF42EF", "E} c #FF21C5", "F} c #FF19BD", "G} c #FF10B5", "H} c #195AFF", "I} c #3A52FF", "J} c #4252FF", "K} c #6352FF", "L} c #845AFF", "M} c #A563FF", "N} c #AD63FF", "O} c #B563FF", "P} c #BD63FF", "Q} c #DE5AFF", "R} c #FF4AFF", "S} c #FF42F7", "T} c #FF3AE6", "U} c #FF31DE", "V} c #FF08AD", "W} c #005AFF", "X} c #085AFF", "Y} c #105AFF", "Z} c #3152FF", "`} c #424AFF", " | c #4A4AFF", ".| c #524AFF", "+| c #8C5AFF", "@| c #CE5AFF", "#| c #D65AFF", "$| c #EF52FF", "%| c #FF3AEF", "&| c #FF00A5", "*| c #2952FF", "=| c #3A4AFF", "-| c #6B52FF", ";| c #945AFF", ">| c #9C5AFF", ",| c #BD5AFF", "'| c #C55AFF", ")| c #E652FF", "!| c #F74AFF", "~| c #FF29D6", "{| c #FF21CE", "]| c #FF19C5", "^| c #1052FF", "/| c #1952FF", "(| c #2152FF", "_| c #314AFF", ":| c #4242FF", "<| c #5A4AFF", "[| c #7352FF", "}| c #A55AFF", "|| c #AD5AFF", "1| c #B55AFF", "2| c #DE52FF", "3| c #EF4AFF", "4| c #FF42FF", "5| c #FF31E6", "6| c #FF10BD", "7| c #FF08B5", "8| c #FF00AD", "9| c #0052FF", "0| c #0852FF", "a| c #294AFF", "b| c #3A42FF", "c| c #4A42FF", "d| c #7B52FF", "e| c #FF3AF7", "f| c #FF29DE", "g| c #FF21D6", "h| c #FF19CE", "i| c #104AFF", "j| c #194AFF", "k| c #214AFF", "l| c #3142FF", "m| c #634AFF", "n| c #6B4AFF", "o| c #8452FF", "p| c #CE52FF", "q| c #D652FF", "r| c #E64AFF", "s| c #F742FF", "t| c #FF3AFF", "u| c #FF31EF", "v| c #FF29E6", "w| c #FF10C5", "x| c #FF08BD", "y| c #004AFF", "z| c #084AFF", "A| c #2942FF", "B| c #3A3AFF", "C| c #423AFF", "D| c #5242FF", "E| c #734AFF", "F| c #8C52FF", "G| c #9452FF", "H| c #BD52FF", "I| c #C552FF", "J| c #DE4AFF", "K| c #EF42FF", "L| c #FF21DE", "M| c #FF19D6", "N| c #FF00B5", "O| c #1942FF", "P| c #2142FF", "Q| c #313AFF", "R| c #5A42FF", "S| c #9C52FF", "T| c #A552FF", "U| c #AD52FF", "V| c #B552FF", "W| c #D64AFF", "X| c #E642FF", "Y| c #F73AFF", "Z| c #FF31F7", "`| c #FF10CE", " 1 c #0842FF", ".1 c #1042FF", "+1 c #213AFF", "@1 c #293AFF", "#1 c #4A3AFF", "$1 c #6342FF", "%1 c #7B4AFF", "&1 c #844AFF", "*1 c #C54AFF", "=1 c #CE4AFF", "-1 c #EF3AFF", ";1 c #FF29EF", ">1 c #FF21E6", ",1 c #FF08C5", "'1 c #0042FF", ")1 c #3131FF", "!1 c #523AFF", "~1 c #6B42FF", "{1 c #8C4AFF", "]1 c #944AFF", "^1 c #BD4AFF", "/1 c #DE42FF", "(1 c #FF31FF", "_1 c #FF19DE", ":1 c #FF10D6", "<1 c #FF00BD", "[1 c #103AFF", "}1 c #193AFF", "|1 c #2931FF", "11 c #3A31FF", "21 c #7342FF", "31 c #9C4AFF", "41 c #A54AFF", "51 c #AD4AFF", "61 c #B54AFF", "71 c #CE42FF", "81 c #D642FF", "91 c #E63AFF", "01 c #F731FF", "a1 c #FF29F7", "b1 c #FF08CE", "c1 c #003AFF", "d1 c #083AFF", "e1 c #2131FF", "f1 c #5A3AFF", "g1 c #7B42FF", "h1 c #C542FF", "i1 c #DE3AFF", "j1 c #FF29FF", "k1 c #FF21EF", "l1 c #FF19E6", "m1 c #FF10DE", "n1 c #FF00C5", "o1 c #1031FF", "p1 c #1931FF", "q1 c #2929FF", "r1 c #4231FF", "s1 c #633AFF", "t1 c #8442FF", "u1 c #8C42FF", "v1 c #B542FF", "w1 c #BD42FF", "x1 c #D63AFF", "y1 c #EF31FF", "z1 c #FF21F7", "A1 c #FF08D6", "B1 c #0831FF", "C1 c #1929FF", "D1 c #2129FF", "E1 c #3129FF", "F1 c #4A31FF", "G1 c #6B3AFF", "H1 c #9442FF", "I1 c #9C42FF", "J1 c #A542FF", "K1 c #AD42FF", "L1 c #CE3AFF", "M1 c #F729FF", "N1 c #FF19EF", "O1 c #FF10E6", "P1 c #0031FF", "Q1 c #1029FF", "R1 c #2121FF", "S1 c #3A29FF", "T1 c #733AFF", "U1 c #7B3AFF", "V1 c #C53AFF", "W1 c #E631FF", "X1 c #FF21FF", "Y1 c #FF08DE", "Z1 c #FF00CE", "`1 c #0029FF", " 2 c #0829FF", ".2 c #1921FF", "+2 c #2921FF", "@2 c #5231FF", "#2 c #843AFF", "$2 c #B53AFF", "%2 c #BD3AFF", "&2 c #DE31FF", "*2 c #EF29FF", "=2 c #FF19F7", "-2 c #FF10EF", ";2 c #FF00D6", ">2 c #1021FF", ",2 c #4229FF", "'2 c #5A31FF", ")2 c #8C3AFF", "!2 c #943AFF", "~2 c #9C3AFF", "{2 c #A53AFF", "]2 c #AD3AFF", "^2 c #D631FF", "/2 c #E629FF", "(2 c #F721FF", "_2 c #FF19FF", ":2 c #0821FF", "<2 c #1919FF", "[2 c #3121FF", "}2 c #4A29FF", "|2 c #6331FF", "12 c #CE31FF", "22 c #DE29FF", "32 c #EF21FF", "42 c #FF10F7", "52 c #0021FF", "62 c #1019FF", "72 c #2119FF", "82 c #3A21FF", "92 c #5229FF", "02 c #6B31FF", "a2 c #7331FF", "b2 c #C531FF", "c2 c #D629FF", "d2 c #F719FF", "e2 c #FF08E6", "f2 c #FF00DE", "g2 c #0819FF", "h2 c #2919FF", "i2 c #5A29FF", "j2 c #7B31FF", "k2 c #8431FF", "l2 c #AD31FF", "m2 c #B531FF", "n2 c #BD31FF", "o2 c #CE29FF", "p2 c #E621FF", "q2 c #FF10FF", "r2 c #FF08EF", "s2 c #0019FF", "t2 c #1010FF", "u2 c #1910FF", "v2 c #3119FF", "w2 c #4221FF", "x2 c #6329FF", "y2 c #8C31FF", "z2 c #9431FF", "A2 c #9C31FF", "B2 c #A531FF", "C2 c #DE21FF", "D2 c #EF19FF", "E2 c #FF00E6", "F2 c #0810FF", "G2 c #4A21FF", "H2 c #6B29FF", "I2 c #BD29FF", "J2 c #C529FF", "K2 c #D621FF", "L2 c #E619FF", "M2 c #F710FF", "N2 c #FF08F7", "O2 c #0010FF", "P2 c #2110FF", "Q2 c #3A19FF", "R2 c #5221FF", "S2 c #7329FF", "T2 c #7B29FF", "U2 c #AD29FF", "V2 c #B529FF", "W2 c #CE21FF", "X2 c #FF08FF", "Y2 c #FF00EF", "Z2 c #0808FF", "`2 c #2910FF", " 3 c #4219FF", ".3 c #5A21FF", "+3 c #8429FF", "@3 c #8C29FF", "#3 c #9429FF", "$3 c #9C29FF", "%3 c #A529FF", "&3 c #C521FF", "*3 c #D619FF", "=3 c #DE19FF", "-3 c #EF10FF", ";3 c #0008FF", ">3 c #1008FF", ",3 c #4A19FF", "'3 c #6321FF", ")3 c #6B21FF", "!3 c #BD21FF", "~3 c #E610FF", "{3 c #FF00F7", "]3 c #0000FF", "^3 c #1908FF", "/3 c #3110FF", "(3 c #5219FF", "_3 c #7321FF", ":3 c #7B21FF", "<3 c #AD21FF", "[3 c #B521FF", "}3 c #CE19FF", "|3 c #DE10FF", "13 c #F708FF", "23 c #FF00FF", "33 c #3A10FF", "43 c #5A19FF", "53 c #8421FF", "63 c #8C21FF", "73 c #9421FF", "83 c #9C21FF", "93 c #A521FF", "03 c #C519FF", "a3 c #D610FF", "b3 c #EF08FF", "c3 c #0800FF", "d3 c #2108FF", "e3 c #4210FF", "f3 c #6319FF", "g3 c #B519FF", "h3 c #BD19FF", "i3 c #CE10FF", "j3 c #F700FF", "k3 c #1000FF", "l3 c #2908FF", "m3 c #4A10FF", "n3 c #6B19FF", "o3 c #7319FF", "p3 c #A519FF", "q3 c #AD19FF", "r3 c #C510FF", "s3 c #DE08FF", "t3 c #E608FF", "u3 c #EF00FF", "v3 c #3108FF", "w3 c #5210FF", "x3 c #7B19FF", "y3 c #8419FF", "z3 c #8C19FF", "A3 c #9419FF", "B3 c #9C19FF", "C3 c #BD10FF", "D3 c #1900FF", "E3 c #5A10FF", "F3 c #6310FF", "G3 c #B510FF", "H3 c #D608FF", "I3 c #E600FF", "J3 c #2100FF", "K3 c #3A08FF", "L3 c #6B10FF", "M3 c #7310FF", "N3 c #A510FF", "O3 c #AD10FF", "P3 c #CE08FF", "Q3 c #DE00FF", "R3 c #2900FF", "S3 c #4208FF", "T3 c #7B10FF", "U3 c #8410FF", "V3 c #8C10FF", "W3 c #9410FF", "X3 c #9C10FF", "Y3 c #C508FF", "Z3 c #D600FF", "`3 c #4A08FF", " 4 c #5208FF", ".4 c #BD08FF", "+4 c #3100FF", "@4 c #5A08FF", "#4 c #AD08FF", "$4 c #B508FF", "%4 c #CE00FF", "&4 c #3A00FF", "*4 c #6308FF", "=4 c #6B08FF", "-4 c #9C08FF", ";4 c #A508FF", ">4 c #C500FF", ",4 c #4200FF", "'4 c #4A00FF", ")4 c #7308FF", "!4 c #7B08FF", "~4 c #8408FF", "{4 c #8C08FF", "]4 c #9408FF", "^4 c #B500FF", "/4 c #BD00FF", "(4 c #5200FF", "_4 c #AD00FF", ":4 c #5A00FF", "<4 c #6300FF", "[4 c #6B00FF", "}4 c #9C00FF", "|4 c #A500FF", "14 c #7300FF", "24 c #7B00FF", "34 c #8400FF", "44 c #8C00FF", "54 c #9400FF", /* pixels */". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + @ @ @ # # # # $ $ $ % % & & & & * * * = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - ; ; ; + + + + @ @ # # # $ $ $ $ % % % & & & & * * * = = = = > > > , . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ' ' ' - - ; ; ; + + + @ @ ) ) ! ! ! ~ ~ ~ ~ { { { ] ] ] ^ ^ ^ ^ = = = > > > > , , , / / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ( ( ( ' ' ' ' - - _ _ _ : : : ) ) ) ) ! ! ! ~ ~ ~ ~ { { { ] ] ^ ^ ^ ^ ^ < < < [ [ [ [ } , , / / / / | | | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 1 ( ( ' ' 2 3 3 3 3 _ _ _ : : : : ) ! ! ! ! ~ ~ ~ { { { ] ] ] ] ^ ^ ^ < < < < < [ [ [ [ } } } 4 4 4 / | | | 5 5 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 6 6 1 1 1 7 7 2 2 2 3 3 3 3 _ _ : : : ) ) ) 8 8 8 8 9 9 9 0 0 0 a a a a b b b c c < [ [ [ [ } } } 4 4 4 4 4 d d d d 5 5 5 e e e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . f f 6 6 6 6 g g 7 7 7 2 2 2 3 3 _ _ _ h i i i j j j 8 8 8 8 9 9 9 0 0 0 a a a a b b b c c c k k k k l l } 4 4 4 d 4 d d d d m m m e e e e n n . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . o o f f f f p g g g g 7 7 2 2 2 3 q q q h h i i i j j j j 8 8 9 9 9 0 0 0 0 a a a b b b b b c c c k k k l l l l r r r s d d d m m m m m t t t n n n n u u . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . o o o o f v p p p p g 7 7 7 7 w w w q q h h h i i i i j j j 8 8 8 9 9 9 0 0 0 0 a a a b b b c c c k c k k k l l l l r r r s s s x x m m t t t y y y y z n u u u u . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A A A o o v v v p p g g g g B B B w w q q q h h h h i j j j j j 8 C D D D D D E E E F F F G G G H H H I k k l l l l r r r r r s s s x x x J J t t y y y y z z z u u K K K . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . L L A A M M M v v v p p p N N N B B w w w q q h h h i i O P P P P C C C D D D E E E F F F G G G G G H H H I I I Q Q Q Q R r r r s s s s x x x J J J J S y y z z z z z z T K K U U . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . L L L L V V M M M v v p W W W N N B B B w w q q q X X X O O O O P P P C C C D D D E E E F F F G G G H H H H H I I I Q Q Q R R R R R Y Y s s x x x J J J S S S S Z z z z z T T T T U U U U . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ` . .L ..V V V M M v +.+.+.W W N N N B B w w @.#.#.#.X X X X O P P P P P C C $.$.$.%.%.%.%.&.&.&.*.*.*.=.=.=.-.-.-.I I Q Q Q R R R Y Y Y Y Y ;.;.;.x J J J S S S Z Z Z Z >.z T T T ,.,.'.U ).).!.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ` ` . .......V V M M ~.~.+.W W W W N N B B {.@.@.@.#.#.X X X O O O ].].].^.^.^.^.$.$.$.%.%.%.&.&.&.*.*.*.*.=.=.=.-.-.-./././././.(.(.R Y Y Y ;.;.;.;.;._._._.J S S S Z Z Z Z >.>.>.,.,.,.,.'.'.'.).!.!.!.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ` ` ` ` :.:.......V V ~.~.+.+.+.W W W N N {.{.{.@.@.@.#.#.#.X X <.[.[.[.].].].].^.^.^.$.$.$.%.%.%.&.&.&.*.*.*.=.=.=.=.-.-.-./././.(.(.(.(.(.}.}.}.;.;.;._.;._._._.|.|.|.S Z Z Z >.>.>.>.1.1.,.'.'.'.'.2.2.!.!.!.!.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.` 3.` :.:.:.....V 4.~.~.~.~.+.+.W W W 5.5.{.{.{.@.@.@.#.6.<.<.<.[.[.[.].].].^.^.^.$.$.7.8.8.8.9.9.9.9.9.0.0.0.a.a.a.b.b.b.b./././.(.(.(.}.(.}.}.}.c.c.c.d._._.|.|.|.|.|.e.e.Z Z >.>.>.1.1.1.1.f.'.'.'.2.2.2.!.!.!.g.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . h.h.3.3.:.:.:.:.....4.4.4.4.~.+.+.+.+.i.i.5.5.5.{.{.@.@.j.6.6.6.<.<.<.[.[.[.].].k.l.l.l.7.7.7.8.8.8.9.9.9.0.0.0.0.0.a.a.a.b.b.b.m.m.m.m.n.n.n.}.}.}.}.}.c.c.c.d.d.d.o.|.|.|.|.e.e.e.p.p.>.>.1.1.1.f.f.f.f.2.2.2.2.2.2.g.g.q.q.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . h.h.h.r.r.r.:.r.:.s.s.4.4.~.~.~.~.+.t.i.i.i.5.5.{.{.u.j.j.j.6.6.<.<.<.<.v.v.k.k.k.l.l.l.l.l.7.8.8.8.8.9.9.9.0.0.0.a.a.a.a.a.b.b.m.m.m.m.m.n.n.n.w.w.w.x.x.c.c.c.d.d.d.o.o.o.y.|.e.e.e.p.p.p.z.1.1.1.f.f.f.f.A.A.2.2.2.B.B.B.q.q.q.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C.C.h.h.r.r.r.r.r.r.s.s.s.s.4.4.~.~.t.t.t.i.i.5.5.D.u.u.j.j.j.6.6.6.E.E.E.v.v.v.k.k.k.l.l.l.7.7.7.F.F.F.G.G.G.G.H.H.H.I.I.I.J.J.J.J.K.K.m.n.n.n.n.n.w.w.w.x.x.x.x.L.L.d.o.o.o.o.y.y.y.y.p.p.p.p.z.z.z.f.f.f.f.A.A.A.A.2.2.B.B.B.B.q.q.M.M.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C.C.C.N.N.N.r.N.r.O.s.s.s.s.4.4.4.P.P.t.t.i.i.i.D.D.u.u.u.j.j.j.Q.Q.Q.E.E.E.E.v.k.k.k.k.R.R.R.S.S.S.F.F.F.G.G.G.H.H.H.H.I.I.I.J.J.J.K.K.K.K.T.T.T.T.T.w.w.x.x.x.x.x.L.L.L.U.U.o.y.y.y.y.y.V.V.p.z.z.z.z.W.W.f.A.A.A.A.A.A.X.B.B.B.Y.Y.Z.M.M.M.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . `.C.C.N.N.N.N.N.O.O.O.s.O.s.s.4. +P.P.P.t.t.i..+.+D.D.u.u.u.++++++Q.Q.E.E.E.v.v.@+#+#+#+R.R.R.S.S.S.F.F.F.G.G.G.G.H.H.H.I.I.I.I.J.J.J.K.K.K.K.T.T.T.$+$+$+$+%+%+%+L.L.L.L.L.U.U.U.&+&+y.y.y.V.V.V.*+z.z.W.W.W.W.=+A.A.A.A.A.X.X.X.Y.Y.Z.Z.Z.M.M.-+. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . `.`.`.`.;+;+N.;+N.>+O.O.O.O.O.O. + +P.P.P.t.t..+.+.+D.D.D.D.,+++++++++Q.Q.Q.E.@+@+@+#+#+#+#+R.R.R.S.S.S.F.F.'+)+)+)+!+!+!+!+~+~+~+{+{+{+{+]+]+K.T.T.T.T.$+$+$+$+%+%+%+^+^+^+L.U.U.U.&+&+&+&+&+V.V.V.V.*+*+*+W.W.W.=+=+=+=+A.A.X.X.X.X./+Y.Y.Z.Z.Z.-+-+-+-+. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (+`.`._+;+;+;+;+>+>+>+>+>+>+O.O. + + +P.P.P.:+:+:+.+D.D.<+<+,+,+,+++Q.Q.Q.[+[+[+@+@+@+#+#+#+R.R.}+|+|+|+|+'+'+)+)+)+)+!+!+!+!+~+~+~+{+{+]+]+]+]+1+1+1+1+1+2+2+%+%+%+%+%+^+^+^+3+3+3+U.&+&+&+&+&+4+4+4+*+*+*+5+5+5+W.=+=+=+=+=+X.X.X.X./+/+/+/+Z.Z.6+6+6+-+-+7+. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (+(+(+_+_+;+_+_+>+>+>+8+>+>+>+9+9+9+9+ + +0+0+:+:+.+.+a+<+<+,+,+,+++++b+c+c+c+[+[+@+@+@+@+d+d+}+}+}+|+|+|+'+'+'+)+)+!+!+!+!+~+~+~+~+~+{+{+]+]+]+]+1+1+1+1+2+2+2+e+e+e+e+^+^+^+3+3+3+3+3+f+f+&+4+4+4+4+4+g+g+*+5+5+5+h+h+=+=+=+=+i+i+X./+/+/+/+j+j+6+6+6+6+6+7+7+7+. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . k+(+(+_+_+_+_+_+8+8+8+8+8+>+>+9+9+9+9+9+0+0+0+0+:+:+a+a+a+<+<+,+,+b+b+b+c+c+c+[+[+[+l+l+d+d+d+}+}+}+|+|+|+|+'+'+'+)+)+)+!+!+!+!+~+~+{+{+{+{+]+]+]+1+1+1+1+2+2+2+2+e+e+e+m+m+m+m+n+3+3+f+f+f+f+o+o+o+4+4+g+g+g+p+p+5+5+h+h+h+h+=+i+i+i+i+/+/+/+/+j+j+j+6+6+6+6+6+7+7+q+. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . k+k+(+r+r+_+r+8+8+8+8+8+8+8+s+s+s+9+s+9+t+0+0+0+:+u+u+a+a+<+<+<+v+v+b+b+b+c+c+c+w+w+w+l+d+d+d+d+}+}+}+|+|+|+'+'+'+'+x+x+x+y+y+z+z+z+z+A+A+A+B+B+B+B+C+1+1+1+2+2+e+e+e+e+e+m+m+m+m+n+n+n+D+f+f+f+o+o+o+o+o+g+g+g+p+p+p+E+h+h+h+h+F+i+i+i+G+G+G+/+j+j+j+j+H+H+6+6+I+I+7+q+q+. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . J+k+k+r+r+r+r+r+K+K+K+K+K+K+8+L+s+s+s+s+t+t+t+0+t+0+u+u+a+a+<+<+M+v+v+v+b+b+b+N+N+w+w+w+l+l+l+d+d+}+}+}+}+|+O+O+P+P+P+x+x+y+y+y+y+z+z+z+A+A+A+A+B+B+B+B+C+C+C+C+Q+Q+R+e+e+e+m+m+m+m+n+n+n+D+D+D+D+D+o+o+o+o+S+S+S+p+p+p+p+E+E+h+h+h+F+F+F+G+G+G+G+T+j+j+j+H+H+H+H+6+I+I+U+U+q+q+V+. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . J+J+J+W+W+r+W+r+K+K+K+K+K+K+L+L+L+s+L+X+X+t+t+t+t+u+u+u+u+a+a+M+M+v+v+v+b+b+Y+N+N+N+w+w+l+l+l+d+d+d+Z+Z+Z+O+O+O+P+P+P+P+x+x+y+y+y+z+z+z+z+A+A+A+A+B+B+C+C+C+C+Q+Q+Q+Q+R+R+R+R+`+`+m+n+n+n+n+D+D+D+D+ @ @ @S+S+S+S+S+.@.@p+E+E+E+E+E+F+F+F+F++@+@G+G+T+T+T+j+H+H+H+H+@@I+I+I+U+U+V+V+V+. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . J+J+J+W+W+W+W+W+#@#@#@K+#@K+$@L+L+L+L+X+X+X+X+X+%@u+u+u+u+u+&@&@M+M+M+v+v+Y+Y+N+N+N+w+w+w+l+l+l+*@*@*@Z+Z+O+O+O+P+P+P+P+x+x+=@=@=@=@-@-@-@-@;@;@>@>@>@>@,@,@,@C+Q+Q+Q+Q+R+R+`+`+`+`+'@'@'@n+n+D+D+D+D+ @ @ @)@)@S+S+.@.@.@.@!@E+E+E+E+~@~@F++@+@+@+@T+T+T+T+{@H+H+H+@@@@@@I+U+U+]@]@V+V+V+. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ^@^@J+/@W+W+W+W+#@#@#@#@#@#@$@$@$@$@$@X+(@X+(@X+%@%@%@%@%@&@&@&@&@M+M+M+_@_@Y+Y+Y+N+N+w+w+w+:@:@:@*@*@*@Z+Z+O+O+O+<@<@<@[@[@[@=@=@=@=@-@-@-@;@;@;@>@>@>@,@,@,@,@,@}@}@|@|@|@R+`+`+`+`+'@'@'@'@1@1@D+D+ @ @ @)@)@)@)@)@.@.@.@!@!@!@!@E+~@~@~@2@+@+@+@3@3@T+T+{@{@{@H+@@@@@@@@4@U+U+]@]@]@V+5@5@. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ^@^@^@/@/@/@/@/@#@6@6@#@6@#@7@$@$@$@(@(@(@(@(@8@%@8@%@8@%@&@&@&@&@M+M+9@_@_@_@Y+Y+Y+N+N+0@0@:@:@:@*@*@*@Z+Z+a@a@a@a@<@<@<@[@[@[@=@=@=@-@-@-@-@;@;@>@>@>@>@,@,@,@}@}@}@}@|@|@|@|@b@b@b@`+'@'@'@'@1@1@1@1@c@ @ @)@)@)@)@d@d@d@.@!@!@!@!@e@~@~@~@2@2@2@3@3@3@3@f@{@{@{@g@@@@@@@4@4@4@U+U+]@]@h@5@5@5@. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i@^@i@/@/@/@/@6@6@6@6@6@6@7@7@7@7@7@j@(@j@(@(@8@8@8@8@8@k@k@k@&@k@&@9@9@_@_@_@Y+Y+Y+N+l@l@0@:@:@:@*@*@m@m@n@n@n@a@a@<@<@<@[@[@[@=@o@o@o@p@p@q@q@q@q@r@r@r@r@s@s@s@t@}@}@}@|@|@|@|@b@b@u@b@u@u@v@1@1@1@c@c@c@c@c@)@)@)@)@d@d@d@w@w@!@!@!@e@e@e@2@2@2@2@x@3@3@f@f@f@{@g@g@g@g@@@4@4@4@4@y@]@h@h@h@5@5@z@. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i@i@i@A@A@/@A@B@6@B@6@6@6@7@7@7@7@7@j@j@j@j@(@C@C@C@8@8@k@k@k@k@k@9@9@9@9@_@_@Y+Y+Y+l@l@l@0@0@0@:@D@m@m@m@n@n@n@a@a@a@<@E@E@F@F@o@o@o@o@p@p@p@p@q@q@q@r@r@s@s@s@s@t@t@t@t@t@G@G@H@|@b@b@u@u@u@u@v@v@v@v@c@c@c@c@I@I@I@)@d@d@d@w@w@w@w@w@e@e@e@e@J@2@2@x@x@x@3@f@f@f@f@g@g@g@g@K@4@4@4@y@y@y@]@h@h@h@z@z@z@. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i@i@A@A@A@A@B@B@B@B@B@B@L@7@L@L@L@j@M@j@j@C@C@C@C@C@N@N@N@N@k@k@9@9@9@9@9@_@_@_@O@O@l@l@0@0@0@D@D@D@m@m@m@n@n@n@P@P@E@E@E@F@F@F@o@o@o@o@p@p@q@q@q@q@r@r@r@s@s@s@s@t@t@t@t@G@G@G@H@H@H@H@Q@u@u@u@v@v@v@v@R@R@c@c@I@I@I@I@S@d@d@w@w@w@w@w@T@e@e@J@J@J@U@x@x@x@V@V@f@f@f@f@g@g@K@K@K@4@y@y@y@y@y@h@h@W@W@z@z@. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X@i@Y@A@A@Y@B@B@B@B@B@B@L@L@L@L@L@M@M@M@M@Z@Z@C@Z@C@`@N@N@N@N@ # # # # # #9@_@.#O@O@O@l@l@+#+#+#D@D@D@m@m@n@@#@#P@P@E@E@E@E@F@F@o@o@o@##$#$#$#%#%#%#%#&#&#&#*#*#*#*#=#=#t@G@G@G@G@H@H@H@H@Q@Q@Q@-#v@v@v@R@R@R@R@;#;#I@S@S@S@S@>#w@w@w@w@T@T@T@,#J@J@J@U@U@x@x@V@V@V@f@f@'#'#g@g@K@K@)#y@y@y@y@!#!#h@W@W@W@z@~#. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X@X@Y@Y@Y@Y@Y@{#{#{#B@{#]#L@]#L@^#M@M@M@M@Z@Z@Z@Z@Z@`@`@N@`@N@/# # # # # # #.#.#.#O@O@O@(#+#+#+#D@D@D@m@_#_#_#@#@#P@P@P@E@E@:#:#:#:#####$#$#$#%#%#%#%#&#&#&#*#*#*#*#=#=#=#=#<#<#<#[#[#H@H@Q@Q@Q@Q@-#-#-#-#R@R@R@R@;#;#;#}#S@S@S@>#>#>#w@T@T@T@T@,#,#J@J@U@U@U@x@V@V@V@V@'#'#'#'#|#K@)#)#)#y@y@!#!#!#h@W@W@W@1#~#~#. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X@2#2#Y@Y@Y@Y@{#{#{#{#{#]#]#]#]#^#^#^#^#^#Z@3#Z@3#`@`@`@`@`@/#/#/#/#/# #/#4#.#.#.#O@O@5#(#(#(#+#+#+#6#_#_#_#_#@#@#P@P@7#8#8#8#:#:#:#######$#$#$#%#%#%#%#&#&#&#*#*#*#*#=#=#=#<#<#<#[#[#[#[#9#9#9#-#-#-#-#-#0#0#0#0#;#;#;#}#}#}#}#>#>#>#>#>#a#T@T@,#,#,#,#,#U@U@U@b#b#V@V@c#c#'#'#|#|#|#K@)#)#)#!#!#!#!#d#W@W@W@1#~#~#~#. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2#2#2#e#e#e#e#{#f#f#{#f#]#]#]#]#g#^#^#^#^#3#3#3#3#h#h#h#`@`@/#/#/#/#/#/#/#4#4#4#.#.#.#5#5#(#(#+#+#i#6#6#_#_#_#@#@#7#7#7#7#8#8#:#:#:#:#######$#$#%#%#%#%#&#&#&#*#*#*#*#=#=#=#=#<#<#<#[#[#[#[#9#9#9#j#j#j#-#0#0#0#0#0#k#k#;#}#}#}#}#l#>#>#>#a#a#a#,#,#,#,#,#m#m#U@U@b#b#b#c#c#c#c#|#|#|#|#n#)#)#o#o#!#!#d#d#d#W@W@1#1#~#p#p#. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2#2#2#e#e#e#e#f#f#f#f#f#q#q#q#q#g#g#g#g#g#3#r#3#3#h#h#h#h#h#s#s#s#s#/#/#t#4#4#4#4#4#5#5#5#5#(#(#i#i#6#6#6#_#_#u#u#u#7#7#7#8#8#8#8#:#:#######$#$#v#v#w#w#w#x#x#x#y#y#y#z#z#z#z#=#<#<#<#[#[#[#9#9#9#9#j#j#j#A#A#A#0#k#k#k#k#B#B#}#}#l#l#l#l#a#a#a#a#C#C#,#,#m#m#m#m#b#b#b#D#D#c#c#E#E#|#|#n#n#n#)#)#o#o#d#d#d#d#d#1#1#1#F#p#p#p#. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2#G#H#e#e#H#f#I#f#f#I#q#q#q#q#g#g#g#g#g#r#r#r#r#J#J#h#h#h#s#s#s#s#s#s#t#t#t#t#4#K#5#5#5#5#(#L#L#i#i#6#6#6#M#M#u#u#u#7#7#7#8#8#8#:#:#N#N#N#N#v#v#v#w#w#w#x#x#x#y#y#y#y#z#z#z#O#O#O#O#P#P#P#[#9#9#j#9#j#j#j#A#A#A#A#Q#k#k#k#B#B#B#B#l#l#l#l#R#R#a#a#C#C#C#,#m#m#m#S#S#b#b#D#D#D#E#E#E#E#n#n#n#n#n#o#o#T#T#d#d#d#U#U#1#F#F#F#p#p#. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G#G#H#H#H#H#I#I#I#I#I#V#V#q#V#g#g#g#g#g#r#r#r#r#J#J#J#J#W#W#W#W#W#W#s#t#t#t#t#t#K#K#K#K#K#L#L#L#i#i#i#6#X#M#M#M#M#u#u#7#7#7#8#Y#Z#Z#Z#N#N#N#v#v#v#w#w#w#w#x#x#x#y#y#y#z#z#z#O#O#O#O#O#P#P#P#`#`#`# $j#j#j#j#A#A#A#Q#Q#Q#Q#B#B#B#B#.$.$.$l#R#R#R#R#a#C#C#C#+$m#m#S#S#S#S#S#b#D#D#D#E#E#@$@$n#n#n##$#$o#o#T#T#d#U#U#U#U#1#F#F#F#$$$$. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . G#%$G#H#H#H#I#I#I#I#I#I#V#V#V#V#&$&$&$g#*$r#*$*$=$=$J#J#W#W#W#W#W#W#-$-$-$-$-$;$;$K#K#K#K#L#L#L#L#i#i#X#X#M#M#M#M#u#u#7#7#>$Y#Y#Z#Z#Z#N#N#N#N#v#v#v#,$,$,$'$'$'$)$)$)$)$!$!$!$~$~$O#O#P#P#P#P#`#`#`# $ $ $ $A#A#A#A#Q#Q#Q#Q#{${$B#B#.$.$.$.$R#R#R#R#]$]$C#+$+$+$^$S#S#S#S#S#/$D#D#($($E#E#@$@$n##$#$#$o#T#T#T#d#d#U#U#U#_$F#:$:$$$$$$$. . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . %$G#%$<$H#<$<$I#[$[$[$[$V#V#}$V#&$&$&$&$*$*$*$*$=$=$=$=$|$W#|$|$|$W#1$-$-$-$-$;$;$;$;$;$2$2$2$L#L#L#3$3$X#X#M#M#M#u#u#4$>$>$Y#Y#Y#Z#Z#Z#Z#5$5$5$6$6$6$,$,$'$'$'$'$)$)$)$!$!$!$!$~$~$~$7$7$7$8$8$`#`#`# $ $ $ $9$9$9$A#Q#Q#Q#{${${${$0$.$.$.$a$a$a$R#]$]$]$b$+$+$+$^$^$S#S#S#/$/$/$D#($($($E#@$@$@$#$#$#$c$T#T#T#T#U#U#_$_$_$F#F#:$:$$$$$d$. . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . %$%$<$<$<$<$[$[$[$[$[$}$}$}$}$e$e$e$&$f$*$f$*$=$=$=$=$|$|$|$|$|$|$1$1$1$1$-$g$g$;$;$;$2$2$2$2$2$3$3$3$3$X#X#M#M#M#4$4$>$>$>$Y#Y#Y#h$h$h$5$5$5$6$6$6$,$,$,$'$'$'$)$)$)$)$!$!$!$~$~$~$~$7$7$7$8$8$8$8$i$i$ $ $9$9$9$9$j$j$Q#Q#{${${$0$0$0$0$a$a$a$a$a$]$]$]$b$b$+$+$^$^$^$S#/$/$/$/$k$($($($l$@$@$@$m$#$#$c$c$T#T#n$n$U#_$_$_$_$F#:$:$o$d$d$. . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . %$p$<$<$<$<$[$[$[$[$[$}$}$}$}$e$e$e$e$f$f$f$f$q$q$q$q$r$r$r$|$r$|$1$1$1$1$g$g$g$g$g$s$s$s$2$2$2$3$3$3$3$X#X#X#X#t$t$4$4$>$>$>$u$u$u$h$h$5$5$5$6$6$6$,$,$v$w$w$w$w$x$x$x$y$y$y$y$z$z$z$7$7$7$7$8$8$8$i$i$i$i$A$A$9$9$9$j$j$j$B${${${$0$0$0$0$C$a$a$a$D$D$D$b$b$b$b$b$^$^$^$E$/$/$/$k$k$k$l$l$l$l$@$m$m$m$#$c$c$F$n$n$n$n$_$_$_$G$G$:$o$o$o$d$d$. . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . p$%$p$H$<$H$I$[$[$I$[$J$J$}$}$e$e$e$e$f$f$f$f$q$q$q$q$r$r$r$r$r$r$K$K$K$K$L$g$g$L$g$s$s$s$s$s$M$M$M$M$M$3$X#X#N$t$t$4$4$4$>$O$O$u$u$h$h$5$5$5$5$P$P$P$v$v$w$w$w$w$x$x$x$x$y$y$y$z$z$z$z$Q$Q$Q$R$R$8$8$i$i$i$i$A$A$A$S$j$j$j$j$B$B$B$0$0$0$0$C$C$C$C$D$D$D$T$T$b$b$b$U$U$^$E$E$E$/$/$k$k$k$V$l$l$l$W$m$m$m$X$c$c$c$F$n$n$Y$Y$_$G$G$G$G$:$o$o$d$d$Z$. . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . p$p$H$H$H$H$I$I$I$I$I$J$J$J$`$`$`$`$ %f$ %f$.%q$q$.%r$r$r$r$r$r$K$K$K$K$L$L$L$L$L$+%+%s$+%s$M$M$M$M$M$M$M$N$N$t$t$t$4$4$O$O$O$u$u$h$h$h$@%#%#%#%P$P$v$v$v$w$w$w$x$x$x$x$y$y$y$y$z$z$z$Q$Q$Q$Q$R$R$R$$%$%$%i$i$A$A$A$S$S$S$j$B$B$B$B$%%%%0$0$C$C$C$C$&%D$D$D$T$T$b$U$U$U$U$^$E$E$E$/$k$k$k$V$V$l$W$W$W$m$X$X$X$c$F$F$F$Y$Y$Y$_$_$G$G$G$o$o$o$*%Z$Z$. . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . p$=%H$H$H$H$I$I$I$I$I$J$J$J$J$`$`$`$ % % % %.%.%.%.%-%-%-%-%-%-%;%K$K$K$L$L$L$L$L$+%+%+%+%>%>%>%>%>%M$M$N$N$N$N$t$t$,%,%,%O$O$O$u$u$@%@%@%#%#%#%#%P$P$v$v$v$'%'%'%)%)%)%)%!%!%!%~%~%~%~%{%Q$Q$R$R$R$$%$%$%$%$%]%]%A$S$S$S$S$S$^%^%B$%%%%%%%%/%C$C$C$&%&%&%&%T$T$T$(%U$U$U$U$_%E$E$E$:%k$k$V$V$V$V$W$W$W$<%X$X$X$[%F$F$F$Y$Y$Y$Y$G$G$G$}%}%o$o$*%*%Z$Z$. . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . =%=%=%|%|%|%1%1%I$1%1%2%2%2%J$3%`$3%3% % % %.%.%.%.%-%-%-%-%-%-%;%;%;%;%4%4%4%4%+%+%+%5%+%>%>%>%>%>%>%>%6%N$6%N$N$t$7%,%,%,%O$O$8%8%8%@%@%@%#%#%#%P$9%9%0%0%0%'%'%)%)%)%)%!%!%!%!%~%~%~%{%{%{%a%a%a%a%$%$%$%$%]%]%]%]%b%b%S$^%^%^%^%^%%%%%%%/%/%/%C$&%&%&%&%c%c%T$T$(%(%(%U$_%_%_%E$:%:%:%V$V$V$V$d%d%W$W$<%<%X$[%[%F$F$F$e%Y$f%f%f%G$}%}%}%}%o$*%*%Z$g%g%. . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . =%=%|%|%|%|%1%1%1%1%1%2%2%2%3%3%3%3%h%h%h%h%.%i%i%.%j%-%j%-%-%;%k%;%;%4%4%4%4%5%5%5%5%5%l%l%>%>%>%>%6%6%6%6%6%6%7%7%7%,%,%,%m%m%8%8%@%@%@%#%n%n%9%9%9%0%0%0%'%'%'%)%)%)%!%!%!%!%~%~%~%{%{%{%{%a%a%a%a%o%o%o%o%]%]%]%]%b%b%b%p%^%^%^%q%q%q%%%/%/%/%/%r%&%&%&%c%c%c%T$(%(%(%s%_%_%_%t%:%:%:%u%V$V$d%d%d%W$<%<%<%X$X$[%[%e%e%e%e%f%f%f%G$G$}%}%}%*%*%*%v%g%g%. . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . =%w%w%|%|%x%1%1%y%1%1%2%2%2%z%3%3%3%h%h%h%h%i%i%i%i%j%j%j%j%j%k%k%k%k%A%A%4%4%B%5%5%5%5%l%l%l%l%l%l%C%C%C%C%6%D%7%7%7%,%,%E%E%m%m%8%8%@%F%F%n%n%n%9%9%0%0%0%0%'%'%'%)%)%)%!%!%!%!%~%~%{%{%{%{%{%a%a%a%o%o%o%o%G%G%G%H%b%b%b%p%p%p%p%^%q%q%q%I%I%/%/%r%r%r%&%c%c%c%c%J%(%(%s%s%s%_%_%t%t%:%:%u%u%V$d%d%d%K%<%<%<%<%[%[%[%L%e%e%e%M%f%f%N%}%}%}%O%O%*%v%v%g%g%P%. . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . w%w%x%x%x%x%y%y%y%y%Q%Q%Q%2%z%z%3%R%R%h%R%i%S%S%i%j%j%j%j%j%k%k%k%k%A%A%A%A%B%B%B%B%B%T%T%T%l%l%l%C%C%C%C%C%D%D%D%D%D%E%E%E%m%m%8%8%F%F%F%n%n%n%9%9%9%0%0%0%'%'%U%V%V%V%V%W%W%W%X%X%X%Y%Y%Y%Y%a%a%a%o%o%o%o%G%G%G%G%H%H%H%b%p%p%p%p%Z%Z%q%q%I%I%I%r%r%r%r%`%c%c%c%J%J%J%(%(%s%s%s%t%t%t%t%u%u%u%u%d%d%d%K%K%<% & & &[%[%L%L%e%M%M%f%N%N%N%}%}%O%O%*%*%v%v%g%P%. . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . w%w%x%x%x%x%y%y%y%y%y%Q%Q%Q%z%z%z%z%R%R%R%S%S%S%S%.&.&.&j%.&+&+&k%+&A%A%A%A%B%B%B%B%T%T%T%T%T%T%@&@&@&@&@&#&D%D%D%D%D%E%E%E%E%m%m%$&$&F%F%F%n%n%n%9%9%9%%&%&%&U%U%U%V%V%V%W%W%W%X%X%X%Y%Y%Y%Y%Y%&&&&*&*&*&o%o%G%G%G%H%H%H%H%=&=&p%p%p%Z%Z%Z%I%I%I%I%-&-&r%`%`%`%`%J%J%J%J%J%;&s%s%>&>&t%t%,&,&u%u%'&'&d%d%K%K%K%<% & & &L%L%L%M%M%M%M%f%N%N%}%O%O%O%)&v%v%!&!&P%P%. . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . ~&~&x%x%{&y%y%y%]&y%Q%^&Q%Q%z%z%z%R%R%R%R%S%S%S%.&.&.&.&.&+&+&+&+&/&/&/&/&(&(&(&(&_&T%_&T%T%T%@&@&@&@&@&#&#&#&#&D%E%E%E%E%E%m%:&:&$&$&F%F%F%n%n%n%<&<&%&%&%&U%U%U%V%V%V%V%W%W%W%X%X%X%Y%Y%Y%Y%&&&&&&*&*&*&*&[&[&G%G%H%H%H%H%=&=&=&=&Z%Z%Z%}&}&}&I%I%-&-&-&r%`%`%`%|&J%J%J%;&;&;&>&>&>&>&,&,&,&,&'&'&'&'&K%K%K%K%1& & &2&L%L%L%L%M%M%3&N%N%N%4&O%O%)&)&)&v%!&!&P%5&. . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . ~&~&{&{&{&{&]&]&]&]&^&Q%^&^&z%6&6&7&7&7&R%8&8&8&8&.&9&.&.&.&+&+&+&0&/&/&/&(&(&(&(&_&_&_&_&_&_&a&a&a&@&@&#&#&#&#&#&b&b&b&b&b&:&:&:&:&$&$&F%F%n%c&c&<&<&<&%&%&U%U%U%U%V%d&d&e&e&e&f&f&f&f&g&g&g&h&&&&&&&*&*&*&*&[&[&[&[&i&H%H%=&=&=&j&j&j&j&Z%}&}&}&}&-&-&-&-&k&`%`%|&|&|&J%;&;&;&;&;&>&>&>&l&,&,&,&m&'&'&n&K%K%K%1&1& & &2&2&L%o&o&o&M%3&3&N%N%4&4&O%O%)&)&v%!&!&!&P%5&. . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . ~&~&{&{&{&]&]&]&]&]&^&^&^&6&6&6&6&7&7&7&8&8&8&8&9&9&9&9&9&p&p&p&p&0&0&0&0&(&q&(&(&_&_&_&_&_&a&a&a&a&a&r&r&r&r&s&b&b&b&b&b&:&:&:&:&$&$&F%F%t&c&c&c&<&<&%&%&%&u&u&u&d&d&d&e&e&e&e&f&f&f&g&g&g&g&h&h&h&v&v&v&*&[&[&[&i&i&i&i&w&=&=&=&j&j&j&j&x&}&}&}&}&y&y&-&k&k&k&`%|&|&|&|&J%;&;&;&z&>&>&l&l&,&,&m&m&'&'&n&n&K%1&1&1&1&2&2&2&2&o&o&o&M%3&3&3&4&4&4&)&)&)&A&A&!&!&B&5&5&. . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . C&C&{&D&D&D&]&]&E&]&^&F&F&^&6&G&6&7&H&7&7&8&8&8&9&9&9&9&9&p&p&p&p&0&0&0&0&q&q&q&q&I&I&I&_&I&J&a&J&a&r&r&r&r&r&s&s&s&s&s&K&:&:&:&:&:&$&$&t&t&c&c&c&<&<&L&M&M&M&u&u&u&d&d&d&e&e&e&e&f&f&f&g&g&g&h&h&h&h&v&v&v&v&N&N&N&i&i&i&i&w&w&w&j&j&j&j&j&j&x&x&}&y&y&y&O&k&k&k&P&P&|&|&|&Q&;&;&z&z&z&l&l&l&l&m&m&m&m&n&n&n&n&1&1&1&1&R&2&2&2&o&o&S&S&3&3&T&4&4&4&U&)&)&A&A&!&B&B&B&5&V&. . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . C&C&D&D&D&E&E&E&E&E&F&F&F&G&G&G&G&H&H&H&8&W&W&8&X&X&X&X&p&p&p&p&0&0&0&0&q&q&q&q&I&I&I&I&I&J&J&J&J&Y&Y&Y&Y&Y&Z&Z&s&Z&s&K&K&K&K&K&K&:&`&`&t&t&c&c&c&L&L&L&M&M&M&u&u&u&d&d& * * * *.*.*.*+*+*+*+*@*@*h&v&v&v&v&N&N&N&N&#*#*i&w&w&w&w&$*$*j&j&j&x&x&x&%*y&y&y&O&O&k&k&P&P&P&|&Q&Q&Q&z&z&z&z&z&l&l&l&&*m&m&m&**n&n&=*=*1&1&R&R&2&-*-*-*o&S&S&3&3&3&T&4&4&U&)&)&A&A&A&!&B&B&5&V&. . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . C&C&D&D&D&D&E&E&E&E&F&F&F&F&G&G&G&H&H&H&W&W&W&W&X&X&X&X&X&;*;*;*>*>*>*>*,*,*,*,*'*'*I&I&I&)*J&J&J&Y&Y&Y&Y&Y&Z&Z&Z&Z&!*!*!*!*!*!*K&`&`&`&`&t&t&c&~*~*L&L&L&M&M&u&{*{*]*]*]* * * *.*.*.*.*+*+*+*@*@*@*@*^*^*^*/*N&N&N&#*#*#*#*(*w&w&$*$*$*$*$*x&x&x&%*%*%*%*O&O&O&O&P&P&P&P&_*Q&Q&Q&:*z&z&z&<*<*l&&*&*&*m&******n&=*=*1&R&R&R&R&-*-*-*-*S&S&S&T&T&T&U&U&U&[*A&A&A&}*B&B&B&|*V&V&. . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . 1*1*D&D&2*3*E&E&E&E&F&F&4*G&G&5*H&H&H&H&W&W&W&X&X&X&X&X&;*;*;*;*>*>*>*,*,*,*,*'*'*'*'*'*)*)*)*)*6*6*6*6*6*Z&Z&Z&Z&!*!*!*!*!*!*!*7*`&`&`&t&t&~*~*~*~*L&L&M&8*8*{*{*{*]*]*]* * * *.*.*.*+*+*+*@*@*@*@*^*^*^*^*/*/*/*9*#*#*#*(*(*(*(*$*$*$*$*$*0*x&x&%*%*%*%*a*O&O&O&b*P&P&P&_*_*Q&:*:*:*z&<*<*<*c*&*&*&*d*******=*=*=*=*R&R&R&e*e*-*f*f*S&S&g*g*T&T&h*U&U&[*A&A&A&}*}*B&|*|*V&i*. . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . 1*1*2*2*2*2*3*3*3*3*4*4*4*4*5*5*5*j*j*j*k*k*W&k*l*X&l*X&m*m*;*m*>*>*>*>*,*,*,*'*'*'*'*'*)*)*)*)*6*6*6*6*6*n*n*n*n*o*o*o*o*!*!*7*7*7*7*7*7*p*p*~*~*~*L&q*q*8*8*{*{*]*]*]*]*]*r*r*s*s*s*t*t*t*t*u*u*u*v*^*^*^*/*/*/*/*9*9*9*9*(*(*(*w*w*w*$*$*0*0*0*0*%*%*%*a*a*a*O&b*b*b*P&_*_*_*_*:*:*:*:*<*<*<*c*c*&*&*d*******x*=*=*y*y*R&e*e*e*-*f*f*f*S&g*g*T&h*h*U&U&[*[*A&}*}*}*B&|*|*|*V&i*. . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . 1*1*2*2*2*3*3*3*3*3*4*4*4*5*5*5*j*j*j*j*k*k*k*l*l*l*l*l*m*m*m*z*z*z*z*A*A*A*,*B*B*B*B*'*)*)*C*)*6*6*6*6*n*n*n*n*o*o*o*o*o*o*D*D*D*D*7*E*p*p*p*~*~*q*q*q*8*8*8*{*{*{*F*F*F*r*r*s*s*s*s*t*t*t*u*u*u*u*v*v*v*v*G*/*/*/*9*9*9*H*H*H*(*w*w*w*w*I*0*0*0*J*J*%*%*a*a*a*K*b*b*b*L*_*_*_*_*:*:*:*M*<*<*c*c*c*&*d*d*d***x*x*x*y*y*y*R&e*e*e*N*f*f*O*g*g*g*g*h*h*h*[*[*[*}*}*}*P*P*|*|*Q*i*i*. . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . R*R*1*2*2*S*3*3*3*T*4*4*4*4*5*5*5*j*j*j*U*k*k*k*l*l*l*l*m*m*m*m*z*z*z*A*A*A*A*B*B*B*B*B*C*C*C*C*V*V*V*V*W*n*W*n*o*o*o*o*o*o*D*D*D*D*D*E*E*E*E*p*X*X*q*q*q*8*8*Y*Y*Y*F*F*F*F*r*r*s*s*s*t*t*t*u*u*u*u*v*v*v*v*G*G*G*Z*Z*Z*9*H*H*H*H*`*`*w*w*w*I*I*0*0*J*J*J*a*a*a*K*K*K*b*b*b*L*_* = = =:*M*M*M*c*c*c*c*.=d*d*d*+=x*x*x*y*y*y*@=e*e*N*N*f*f*f*O*g*g*g*h*h*h*[*[*[*[*}*}*P*P*|*Q*Q*i*#=#=. . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . R*R*S*S*S*T*T*T*3*T*$=$=4*%=%=%=&=&=&=j*U*U*k**=*=l*l**=m*====z*-=z*z*A*A*;=B*>=B*B*B*C*C*C*C*V*V*V*V*W*W*W*W*,=,=,=,=,=,='='=D*D*E*E*E*E*E*E*X*X*X*q*q*q*)=)=)=Y*Y*F*F*F*r*r*!=!=!=!=~=~=~={={={={=]=]=v*v*G*G*G*Z*Z*Z*Z*^=H*H*H*`*`*`*w*I*I*I*I*/=J*J*J*(=a*a*a*K*K*K*L*L*L*L* = = = =M*M*M*M*c*c*c*.=.=d*d*+=x*x*_=_=y*y*@=e*e*e*N*N*f*O*O*g*:=:=:=<=<=<=[*[=[=}*}*P*P*P*|*Q*Q*i*#=. . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . R*R*S*S*S*T*T*T*T*$=$=$=$=%=%=%=&=&=&=U*U*U*U**=*=*=*=========-=-=-=;=;=;=;=>=>=>=>=}=C*}=}=|=|=V*|=W*W*W*W*,=,=,=,=,=,='='='='=1=1=1=1=E*2=X*X*X*X*q*3=)=)=)=Y*Y*F*F*4=5=5=5=!=!=!=!=~=~=~={={={=]=]=]=]=6=6=6=G*Z*Z*Z*^=^=^=^=`*`*`*`*7=7=I*I*/=/=/=J*(=(=(=a*K*K*K*8=8=L*L*L*9= = =0=0=M*a=a=a=c*.=.=.=d*+=+=+=x*_=_=y*@=@=@=N*N*N*N*O*O*O*O*:=:=:=<=<=<=[=[=[=[=P*P*P*b=Q*Q*Q*#=#=. . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . c=R*S*S*S*d=T*T*T*e=$=$=$=f=%=%=&=&=&=&=U*U*U**=*=*=*=*=======-=-=-=;=;=;=;=>=>=>=>=>=}=}=}=|=|=|=|=g=g=g=g=h=h=,=h=h=i='='='='=1=1=1=1=1=2=2=2=2=X*3=3=)=)=)=Y*Y*j=4=4=4=5=5=5=!=!=!=~=~=~={={={=]=]=]=]=]=6=6=6=k=k=k=Z*^=^=^=^=l=l=`*`*7=7=7=/=/=/=/=m=(=(=(=n=n=K*K*8=8=8=9=9=9=9= =0=0=0=M*a=a=.=.=.=.=o=+=+=+=p=_=_=q=@=@=@=N*N*N*N*r=O*O*s=:=:=t=t=<=<=u=[=[=[=P*P*P*b=Q*v=v=v=#=w=. . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . c=c=d=d=d=e=e=e=e=e=x=x=$=f=f=f=&=y=y=z=z=z=z=*=A=A=*=B=B===C=C=-=C=;=;=D=>=>=>=>=>=}=}=}=}=|=|=|=g=g=g=g=h=h=h=h=h=h=i=i=i=i=E=E=1=1=2=2=2=2=2=3=3=3=3=)=)=)=j=j=4=4=4=5=5=5=5=!=!=~=~=~=~={={={=]=]=]=]=6=6=6=6=k=k=k=k=F=^=^=l=l=l=l=G=7=7=7=H=H=/=/=m=m=(=(=n=n=K*K*8=8=8=8=9=9=9=I=0=0=J=a=a=a=K=.=.=.=o=o=+=p=p=_=_=q=q=@=L=L=N*N*r=r=O*s=s=s=:=t=t=<=u=u=[=M=M=P*P*b=b=b=Q*v=v=#=w=. . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . c=c=d=d=d=e=e=e=e=x=x=x=f=f=f=f=y=y=y=z=z=z=A=A=A=A=A=B=B=B=C=C=C=D=D=D=D=N=N=N=N=O=O=O=O=P=P=P=|=Q=Q=g=R=h=h=h=h=h=i=i=i=i=E=E=E=E=S=S=S=S=S=T=3=3=3=3=3=U=U=j=j=4=4=4=5=5=5=!=!=V=W=W=W=X=X=X=X=Y=Y=Y=]=6=6=6=k=k=k=F=F=F=F=F=l=l=l=l=G=G=7=7=H=H=H=m=m=m=m=n=n=n=n=8=8=8=8=Z=Z=9=I=I=0=0=J=J=a=K=K=K=.=o=o=o=+=p=p=p=q=q=q=@=L=L=N*N*r=r=r=s=s=s=t=t=t=<=u=u=u=M=M=M=P*b=b=`=v=v=v=#=w=. . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . c=c=d= - -d=e=e=e=.-x=x=x=f=f=f=y=y=y=z=z=z=z=A=A=A=A=B=B=B=C=C=C=C=D=D=D=N=N=N=N=N=O=O=O=P=P=P=P=Q=Q=Q=Q=R=R=R=R=R=+-+-+-+-@-@-E=E=S=S=S=S=S=T=T=T=T=T=U=U=U=U=j=j=4=4=4=5=#-#-V=V=W=W=W=W=X=X=X=Y=Y=Y=Y=$-$-$-%-k=k=k=F=F=F=F=&-&-&-l=G=G=G=G=H=H=H=H=*-m=m==-=-n=n=n=--8=8=Z=Z=Z=9=I=I=I=J=J=J=J=K=K=K=.=o=o=o=;-p=p=p=q=q=q=>-L=L=,-r=r=r='-s=s=)-)-t=!-!-u=u=~-M=M=M=b=b=b=`=v=v={-{-w=w=. . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . ]-]- - - -.-.-.-.-^-^-^-^-f=/-/-(-y=(-_-_-_-:-:-A=A=:-B=B=<-[-[-[-D=}-}-D=N=N=N=|-O=1-O=O=P=P=P=Q=Q=Q=Q=R=R=R=R=R=+-+-+-+-@-@-@-@-2-2-2-2-3-T=3-T=T=U=U=U=U=U=j=j=4=4=4-4-#-#-V=V=V=W=W=W=X=X=X=Y=Y=Y=Y=$-$-$-$-%-%-%-%-F=F=F=&-&-&-&-5-5-G=G=6-6-6-H=*-*-*-m==-=-=-n=------Z=Z=Z=Z=7-I=I=I=8-J=J=9-K=K=K=0-o=o=o=;-p=a-a-a-q=>->-L=L=,-r=r=r='-'-s=)-)-t=!-!-u=~-~-M=b-b-b-b=`=`=`=v={-{-c-c-. . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . ]-]- - - -.-.-.-.-^-^-^-/-/-/-(-(-(-(-_-_-_-:-:-:-:-<-<-<-[-[-[-[-}-}-}-|-|-|-|-|-1-1-1-d-d-d-d-Q=e-e-f-f-R=f-R=+-g-+-+-@-h-@-@-2-2-2-2-3-3-3-3-3-i-i-i-U=U=U=j=j=4-4-4-#-#-#-V=V=V=j-j-j-k-k-k-l-l-l-m-m-$-$-%-%-%-%-n-n-n-&-&-&-&-&-5-5-5-G=6-6-6-6-*-*-*-o-=-=-=-=-------p-Z=Z=Z=7-7-I=8-8-J=9-9-9-K=K=0-o=;-;-;-;-p=a-a->->->->-,-,-,-'-'-'-q-)-)-)-!-!-!-!-~-~-~-M=b-b-b=`=`=r-{-{-{-c-c-. . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . ]-]- - -s- -.-.-.-.-^-^-^-/-/-/-(-(-(-_-_-_-:-:-:-:-:-<-<-<-[-[-[-}-}-}-}-|-|-|-|-1-1-1-1-d-d-d-e-e-e-e-f-f-f-f-g-g-g-g-h-h-h-h-t-t-2-t-u-3-3-3-3-i-i-i-i-i-i-U=v-v-4-4-#-#-#-w-w-w-w-j-j-k-k-k-l-l-l-l-m-m-m-x-x-x-%-n-n-n-n-y-y-&-&-&-5-5-5-z-6-6-6-A-A-*-o-o-o-=-B-B-B---p-p-p-Z=7-7-7-8-8-8-8-9-9-9-0-0-0-0-;-;-;-C-a-a-a-D->->->-,-,-,-'-'-'-q-q-)-)-E-!-!-F-~-~-G-b-b-b-`=`=`=r-{-{-H-H-c-c-. . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . I-I- - -s-J-J-J-.-^-K-K-K-/-/-L-M-(-(-_-N-N-:-:-O-:-<-P-P-<-[-Q-[-}-R-}-|-S-|-|-|-1-1-1-d-d-d-e-e-e-e-f-f-f-f-f-g-g-g-h-h-h-h-t-t-t-t-u-u-u-u-u-T-T-i-i-T-i-v-v-v-v-4-4-U-U-U-w-w-w-j-j-k-k-k-k-l-l-l-l-m-m-m-x-x-x-x-V-V-n-y-y-y-y-y-5-5-5-5-z-z-6-A-A-A-A-o-o-o-o-B-B-B-B-p-p-p-7-7-7-W-W-8-8-X-X-9-9-Y-0-0-Z-;-;-;-C-C-a-D-D->-`-`-,- ; ; ;'-q-q-q-E-E-E-!-!-F-~-~-G-b-b-.;.;`=r-r-r-{-H-H-c-+;. . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . I-I-s-s-s-J-J-J-J-K-K-K-L-L-L-M-M-M-M-N-N-N-O-O-O-O-P-P-P-Q-Q-Q-R-R-R-R-S-S-S-S-@;@;@;#;#;#;#;$;$;$;%;%;f-%;f-&;&;g-g-h-h-h-*;t-t-t-u-u-u-u-T-T-T-T-T-T-T-=;=;v-=;4--;-;U-U-U-w-w-w-j-;;>;>;>;,;,;,;,;';';';x-x-x-x-V-V-V-V-);y-y-y-!;!;5-5-z-z-z-z-~;A-A-{;{;o-o-];];B-B-^;p-p-p-/;7-7-W-W-W-8-X-X-9-Y-Y-Y-0-Z-Z-;-C-C-C-D-D-D-D->-`-`-,- ; ;'-q-q-q-E-E-E-F-F-F-F-G-G-G-b-.;.;`=r-r-r-H-H-H-c-+;. . . . . . . . . . . . . . ", ". . . . . . . . . . . . . I-I-s-s-s-s-J-J-J-J-K-K-K-L-L-L-M-M-M-N-N-N-O-O-O-O-O-P-P-P-Q-Q-Q-R-R-R-S-S-S-S-S-@;@;@;#;#;#;$;$;$;$;%;%;%;%;&;&;&;&;(;(;(;(;*;*;*;_;u-u-_;:;T-T-T-T-T-=;=;=;=;=;=;-;-;-;U-U-w-w-<;;;;;>;>;>;>;,;,;,;,;';';';[;[;[;x-V-V-V-);););y-y-!;!;!;};z-z-z-~;~;~;A-{;{;{;o-];];B-B-^;^;p-/;/;/;W-W-W-|;X-X-X-1;Y-Y-Y-Z-Z-Z-;-C-C-C-2;D-D-D-`-`-`- ; ;3;q-q-q-4;4;E-E-5;F-F-F-G-G-6;.;.;.;r-r-r-7;H-H-8;8;+;+;. . . . . . . . . . . . . ", ". . . . . . . . . . . . . 9;I-s-s-0;a;a;J-J-K-K-b;b;L-L-L-c;c;M-N-N-d;e;O-O-e;f;P-P-g;g;Q-Q-R-R-R-S-S-S-S-@;@;h;@;#;#;#;$;$;$;%;%;%;%;%;&;&;&;(;(;(;(;*;*;*;*;_;_;_;_;:;:;:;:;:;i;=;i;=;=;-;-;-;-;U-U-j;<;<;;;;;;;>;>;>;,;,;,;,;';';';[;[;[;[;k;k;k;V-););););l;!;!;!;};};z-~;~;~;~;{;{;{;{;];];];];^;^;^;^;/;/;/;W-W-W-W-|;X-X-1;Y-Y-m;Z-Z-Z-n;C-C-C-2;D-D-o;`-`-p;p; ; ;3;q-q-4;4;E-5;5;F-q;q;G-G-6;.;.;r;r;r-r-7;7;H-8;8;+;s;. . . . . . . . . . . . . ", ". . . . . . . . . . . . . 9;9;0;0;0;a;a;a;a;b;b;b;t;t;t;c;c;c;c;d;d;d;e;e;e;e;f;f;f;g;g;g;u;u;u;v;v;v;v;v;h;h;h;w;w;w;x;x;x;$;y;%;y;%;z;z;z;&;(;A;(;*;B;*;*;_;_;_;_;:;:;:;:;:;i;i;i;i;i;C;C;C;C;-;j;j;<;<;<;;;;;;;>;D;D;E;E;E;E;F;F;F;[;[;[;[;k;k;k;G;G;););l;l;l;!;};};};};~;~;~;~;H;{;{;{;I;];];J;J;^;K;K;/;/;/;L;W-W-|;|;X-1;1;1;Y-m;m;Z-n;n;C-2;2;2;2;D-o;o;`-p;p; ;3;3;4;4;4;4;E-5;5;F-q;q;q;6;6;6;.;r;r;r-7;7;7;8;8;8;s;s;. . . . . . . . . . . . . ", ". . . . . . . . . . . . . 9;9;0;0;0;a;a;a;a;b;b;b;t;t;t;c;c;c;d;d;d;e;e;e;e;e;f;f;f;g;g;g;u;u;u;v;v;v;v;h;h;h;h;w;w;w;x;x;x;y;y;y;y;y;z;z;z;A;A;A;A;B;B;B;M;M;M;M;N;N;N;N;:;i;i;i;i;C;C;C;C;C;j;j;j;j;<;<;<;O;O;O;D;D;E;E;E;E;F;F;F;P;P;P;P;Q;k;k;G;G;G;G;G;l;l;l;R;R;};};S;S;~;~;H;H;H;{;I;I;I;];J;J;^;K;K;K;L;L;L;W-|;|;|;|;1;1;1;m;m;m;Z-n;n;n;2;2;2;T;o;o;U;p;p;p;3;3;3;4;4;4;4;V;5;5;W;q;q;q;6;6;6;r;r;r;7;7;7;X;8;8;8;s;s;. . . . . . . . . . . . . ", ". . . . . . . . . . . . 9;9;0;0;0;Y;Z;a;a;a;b;b;`;t;t;t;c;c; >d;d;d;e;.>e;e;f;+>+>g;g;g;g;u;u;u;v;v;v;v;h;h;h;w;w;w;x;x;x;x;y;y;y;y;z;z;z;z;A;A;A;B;B;B;M;M;M;M;N;N;N;N;N;@>@>@>@>#>#>#>#>C;j;j;j;j;j;<;$>O;O;O;D;D;E;E;E;E;F;F;F;F;P;P;P;Q;Q;Q;Q;G;G;G;G;%>%>l;l;R;R;R;};S;S;S;H;H;H;H;&>I;I;I;*>J;J;J;K;K;K;L;L;L;L;|;|;|;=>1;1;->->m;m;;>n;n;>>2;2;2;T;o;o;U;p;p;p;,>3;3;'>4;4;V;V;5;5;W;q;)>)>6;6;6;r;r;!>7;7;7;X;8;~>~>~>s;s;. . . . . . . . . . . . ", ". . . . . . . . . . . . {>{>Y;Y;Y;Z;Z;Z;Z;`;`;`;`;]>]>]> >c; >^>^>^>.>.>.>.>+>+>+>/>/>/>(>(>(>_>_>_>_>v;:>:>h;<><><>[>[>[>}>}>}>y;}>z;|>z;1>A;1>2>B;B;B;M;3>3>4>N;N;N;N;@>@>@>@>#>#>#>#>#>5>5>5>5>j;$>$>$>O;O;D;D;D;E;E;E;E;F;F;F;P;P;P;P;Q;Q;Q;Q;6>6>G;G;%>%>%>R;R;R;R;R;S;S;S;7>H;H;H;&>&>I;*>*>J;8>8>8>K;K;9>L;L;0>|;|;|;=>=>1;->->m;;>;>n;>>>>2;T;T;T;T;U;U;U;,>,>,>3;'>'>4;V;V;V;W;W;W;q;)>)>6;a>a>r;r;!>!>7;X;X;X;8;~>~>b>b>. . . . . . . . . . . . ", ". . . . . . . . . . . . {>{>Y;Y;Y;Z;Z;Z;Z;`;`;`;]>]>]> > > >^>^>^>^>.>.>.>.>+>+>+>/>/>/>(>(>(>_>_>_>_>:>:>:><><><><>[>[>[>}>}>}>}>|>|>|>|>1>1>1>2>2>2>3>3>3>3>4>4>4>4>4>c>c>c>d>#>#>#>#>5>5>5>5>$>$>$>$>O;O;O;D;D;D;e>e>e>f>f>f>g>g>g>P;Q;Q;Q;Q;6>6>6>6>h>%>%>%>i>R;R;R;j>j>S;7>7>H;H;H;&>&>I;*>*>*>8>8>8>9>9>9>0>0>0>0>=>=>=>=>->->->m;;>;>;>>>>>>>T;T;T;T;U;U;U;,>,>,>'>'>'>V;V;V;V;W;W;W;W;)>)>)>a>a>a>!>!>!>7;X;X;k>~>~>~>b>b>. . . . . . . . . . . . ", ". . . . . . . . . . . . {>{>Y;l>l>Z;Z;Z;Z;`;`;m>n>]>]> > > >o>^>^>.>.>.>p>+>+>+>+>/>/>/>(>(>(>_>_>_>_>:>:>:><><><>[>[>[>}>}>}>}>}>|>|>|>1>1>1>2>2>2>2>3>3>3>4>4>4>4>4>c>c>c>c>d>d>d>d>q>q>q>q>r>$>$>$>$>O;O;O;s>s>s>e>e>e>f>f>f>g>g>g>g>t>t>Q;6>6>6>6>6>h>h>%>i>i>i>R;j>j>j>7>7>7>7>&>&>&>&>u>*>*>v>8>8>8>w>9>9>x>0>0>0>=>=>=>y>y>->->z>;>;>A>>>>>>>T;T;T;B>U;U;C>,>,>D>'>'>'>'>V;V;V;E>W;W;F>)>)>G>a>a>H>!>!>I>X;X;X;k>~>J>J>b>b>. . . . . . . . . . . . ", ". . . . . . . . . . . . K>{>Y;l>l>L>L>L>L>m>`;m>n>n>n>M>M> >o>o>o>p>p>p>p>N>N>N>O>O>O>P>P>P>Q>Q>Q>Q>_>R>R>:>S>S>S>T>T>T>U>U>}>U>V>V>V>|>W>1>W>2>X>X>3>Y>Y>3>4>4>4>4>c>c>c>c>d>d>d>d>q>q>q>q>r>r>r>r>r>r>O;Z>Z>s>s>e>e>e>f>f>f>f>g>g>g>t>t>t>t>`>6>6>6>h>h>h>h>i>i>i> ,j>j>j>.,7>7>7>+,&>&>u>u>*>*>v>v>8>w>w>9>9>x>0>0>0>@,=>=>y>y>->z>z>;>A>A>>>>>#,T;B>B>B>B>C>C>C>,>D>D>'>$,$,V;E>E>E>W;F>F>)>G>G>a>H>H>!>!>I>X;k>k>k>~>J>J>b>%,. . . . . . . . . . . . ", ". . . . . . . . . . . K>K>l>l>l>l>L>L>L>L>m>m>m>n>n>n>M>M>M>o>o>o>p>p>p>p>N>N>N>O>O>O>P>P>P>Q>Q>Q>Q>R>R>R>S>S>S>S>T>T>T>U>U>U>U>V>V>V>W>W>W>X>X>X>X>Y>Y>Y>&,&,&,&,&,*,*,*,=,=,=,=,-,-,-,q>r>r>r>r>r>r>Z>Z>Z>s>s>e>e>;,;,>,>,>,,,,,,,',t>t>t>`>`>`>`>6>h>h>h>),),i>i> , ,j>.,.,.,7>+,+,&>&>u>u>u>*>v>v>8>w>w>w>9>x>x>0>@,@,=>y>y>y>z>z>z>A>A>A>A>#,#,#,T;B>B>B>C>C>C>D>D>D>$,$,$,V;E>E>!,F>F>F>G>G>G>H>H>H>!>I>I>X;k>k>~,J>J>J>J>%,%,. . . . . . . . . . . ", ". . . . . . . . . . . K>K>{,{,l>L>L>L>L>m>m>m>],n>n>n>M>M>M>o>o>o>p>p>p>p>N>N>N>O>O>O>P>P>P>Q>Q>Q>Q>R>R>R>S>S>S>T>T>T>U>U>U>U>U>V>V>V>W>W>W>X>X>X>Y>Y>Y>Y>&,&,&,&,*,*,*,*,=,=,=,-,-,-,-,^,^,^,^,^,r>/,/,Z>s>s>(,;,;,;,>,>,>,,,,,,,,,',',',_,`>`>`>`>:,h>h>h>),),), , , , ,.,.,.,7>+,+,+,u>u>u>u>v>v>v><,w>w>w>x>x>x>@,@,@,y>y>y>y>[,z>z>z>A>A>A>#,#,#,B>B>B>},C>C>|,D>D>1,$,$,2,E>E>E>!,F>3,3,G>G>4,H>H>H>5,I>I>I>k>k>k>~,J>6,6,%,%,. . . . . . . . . . . ", ". . . . . . . . . . . K>K>{,{,{,7,7,7,7,8,m>m>],],],9,9,9,0,o>0,a,a,a,a,a,N>N>b,c,c,c,P>P>d,e,e,Q>e,f,f,R>S>g,g,T>h,h,i,U>i,i,j,j,j,k,k,W>k,X>l,X>m,Y>m,&,n,n,&,&,*,*,*,=,=,=,-,-,-,-,^,^,^,^,^,^,/,/,/,/,(,(,(,;,;,;,>,>,>,,,,,,,',',',',_,_,_,`>:,:,:,h>),),),),o, , ,p,p,.,.,q,+,+,r,u>u>u>s,s,v>v><,w>t,t,x>x>u,u,@,@,v,y>y>[,[,z>w,w,A>A>x,#,#,y,B>B>},},C>|,|,D>1,1,$,$,2,E>E>E>!,!,F>3,3,G>4,4,H>H>5,I>I>z,k>~,~,~,J>6,6,%,%,. . . . . . . . . . . ", ". . . . . . . . . . . A,A,{,{,{,7,7,7,7,8,8,8,],],],9,9,9,0,0,0,a,a,a,a,b,b,b,c,c,c,d,d,d,e,e,e,e,e,f,f,f,g,g,g,h,h,h,i,i,i,i,j,j,j,k,k,k,l,l,l,m,m,m,m,n,n,n,n,B,B,B,C,C,C,C,D,D,D,E,E,E,E,E,^,/,/,F,/,(,(,(,(,;,;,;,G,G,H,H,H,H,I,',',_,_,_,_,_,:,:,:,J,),),),o,o,o, ,p,p,.,q,q,q,+,r,r,u>s,s,s,v><,<,<,t,t,t,u,u,u,@,v,v,y>[,[,[,w,w,w,A>x,x,#,y,y,B>},},},},|,|,|,1,1,1,$,2,2,E>!,!,!,3,3,3,G>4,4,5,5,5,I>z,z,k>~,~,K,6,6,6,L,L,. . . . . . . . . . . ", ". . . . . . . . . . . A,A,{,{,{,7,7,7,7,8,8,8,],],],9,9,9,0,0,0,a,a,a,a,b,b,b,c,c,c,d,d,d,e,e,e,e,f,f,f,g,g,g,g,h,h,h,i,i,i,i,j,j,j,k,k,k,l,l,l,m,m,m,n,n,n,n,n,B,B,B,C,C,C,D,D,D,D,E,E,E,E,E,F,F,F,F,M,M,M,M,;,N,N,G,G,G,H,H,H,I,I,I,I,O,_,_,_,P,P,:,:,J,J,),o,o,o,o,p,p,p,p,q,q,q,r,r,r,u>s,s,s,Q,<,<,R,t,t,t,u,u,u,v,v,v,[,[,[,S,w,w,w,x,x,x,x,y,y,y,},},},T,|,|,U,1,1,V,2,2,2,!,!,!,W,3,3,X,4,4,4,5,5,Y,z,z,z,~,~,~,K,6,6,6,L,L,. . . . . . . . . . . ", ". . . . . . . . . . . A,A,{,{,{,Z,Z,Z,7,8,8,8,],],],9,9,`, '0,0,a,a,a,a,b,.'.'c,c,c,d,d,+'@'e,e,e,f,f,#'g,g,g,h,h,h,i,i,$'i,j,j,j,j,k,k,k,l,l,l,m,m,m,n,n,n,n,B,B,B,C,C,C,C,D,D,D,E,E,E,E,E,F,F,F,F,M,M,M,M,N,N,N,N,G,G,H,H,H,H,I,I,I,O,O,O,O,_,P,P,P,J,J,J,J,o,o,o,o,%'p,p,&'q,q,*'*'r,r,='s,s,Q,Q,<,R,R,t,t,-'u,u,;'v,v,>'>'[,[,S,S,w,w,,'x,x,''y,y,)'},},},T,|,U,U,1,1,V,2,2,!'!,!,W,W,3,3,X,4,~'~'5,5,Y,z,z,z,~,~,K,K,6,{'{'L,L,. . . . . . . . . . . ", ". . . . . . . . . . . ]']'^'{,{,Z,Z,Z,Z,/'/'/'('('('`,9,`, ' ' '_'_'_'_'.'.'.':':':'+'+'+'@'@'@'@'#'#'#'<'<'<'['['['$'$'$'$'}'}'}'|'|'|'1'1'1'1'2'2'2'3'3'3'3'4'4'4'5'5'5'6'6'6'D,E,7'7'7'8'8'F,F,M,M,M,M,N,N,N,N,G,G,9'0'0'0'a'a'a'I,O,O,O,O,b'P,P,P,c'J,J,J,d'o,o,%'%'p,p,&'&'q,*'*'r,='='s,Q,Q,Q,<,R,R,t,t,-'-'u,;';'v,>'>'[,S,S,S,w,,','x,''''y,)')'},T,T,T,U,U,U,1,V,V,2,2,!'!,W,W,W,X,X,X,4,~'~'Y,Y,Y,z,e'e'~,~,K,K,6,{'{'f'f'. . . . . . . . . . . ", ". . . . . . . . . . ]']']'^'^'^'Z,Z,Z,Z,/'/'/'('('('`,`,`, ' ' '_'_'_'_'.'.'.':':':'+'+'+'@'@'@'@'#'#'#'<'<'<'['['['$'$'$'$'}'}'}'|'|'|'1'1'1'2'2'2'3'3'3'3'3'4'4'4'5'5'5'6'6'6'7'7'7'7'7'8'8'8'g'g'g'g'h'h'h'h'N,9'9'0'0'0'0'a'a'a'i'i'O,O,b'b'b'P,c'c'c'J,d'd'o,%'%'%'%'&'&'&'*'*'*'='='='Q,Q,Q,Q,Q,R,R,R,-'-'-';';';'>'>'>'[,S,S,S,,',',''''''')')')'T,T,T,T,U,U,U,V,V,V,!'!'!'!,W,W,j'X,X,X,~'~'~'Y,Y,Y,e'e'e'K,K,K,k'{'{'{'f'f'f'. . . . . . . . . . ", ". . . . . . . . . . ]']'^'^'l'm'm'Z,Z,/'/'/'('('('`,`,`, ' ' 'n'_'_'_'_'.'.'.':':':'+'+'+'@'@'@'@'#'#'#'<'<'<'['['['$'$'$'$'}'}'}'|'|'|'1'1'1'2'2'2'3'3'3'3'4'4'4'5'5'5'5'6'6'6'7'7'7'7'8'8'8'g'g'g'g'h'h'h'h'9'9'9'9'0'0'0'a'a'a'a'i'i'i'i'b'b'b'b'c'c'c'o'd'd'd'%'%'%'p'&'&'q'*'*'*'r'='='s'Q,Q,t't'R,R,u'-'-'v';';'w'>'>'>'S,S,S,x',','y'''''z')')'A'T,T,B'B'U,U,U,V,V,C'!'!'D'W,W,W,j'X,E'E'E'~'~'F'Y,Y,G'e'e'e'K,K,k'k'{'H'H'f'f'. . . . . . . . . . ", ". . . . . . . . . . ]']'^'^'l'm'm'm'm'I'I'I'J'J'J'K'K'`, ' 'n'L'L'L'L'M'M'M'N'N':'+'O'O'P'P'P'P'P'Q'#'Q'R'R'R'S'S'['T'T'T'T'U'U'U'V'V'|'W'W'W'X'X'X'Y'Y'Y'Y'Z'Z'Z'`'`'`' ) ) ).).).)7'7'+)+)8'@)@)@)#)h'h'h'9'9'9'9'9'0'$)$)%)%)%)i'i'i'i'&)&)b'b'*)*)c'c'o'd'd'=)%'%'%'p'p'&'q'q'*'r'r'='s's'Q,t't't'R,u'u'-'v'v';'w'w'>'>'-)S,S,x'x','y'y'''z'z')')'A'T,B'B'B'B'U,;);)V,C'C'!'D'D'W,j'j'j'X,E'E'~'F'F'Y,G'G'e'>)>)K,K,k'k'{'H'H'f'f'. . . . . . . . . . ", ". . . . . . . . . . ,),)l'l'l'm'm'm'm'I'I'I'J'J'J'K'K'K'n'n'n'L'L'L'L'M'M'M'N'N'N'O'O'O'P'P'P'P'Q'Q'Q'R'R'R'S'S'S'T'T'T'T'U'U'U'U'V'V'V'W'W'W'X'X'X'Y'Y'Y'Y'Z'Z'Z'`'`'`' ) ) ).).).).)+)+)+)@)@)@)@)#)#)#)')')')')9'$)$)$)%)%)%)))))))i'i'&)&)&)*)*)*)c'o'o'o'=)=)=)%'p'p'p'q'q'q'r'r'r's's's'Q,t't't'u'u'u'v'v'v'w'w'w'>'-)-)-)S,x'x'x'y'y'y'z'z'z')'A'A'B'B'B'B';););)C'C'C'D'D'D'j'j'j'j'E'E'E'F'F'F'Y,G'G'>)>)>)k'k'k'k'H'H'H'!)!). . . . . . . . . . ", ". . . . . . . . . . ,),)l'l'l'm'm'm'm'I'I'I'J'J'J'K'K'K'n'n'n'L'L'L'L'M'M'M'N'N'N'O'O'O'P'P'P'P'Q'Q'Q'R'R'R'S'S'S'T'T'T'T'U'U'U'V'V'V'W'W'W'X'X'X'Y'Y'Y'Y'Y'Z'Z'Z'`'`'`' ) ) ).).).).)+)+)+)@)@)@)#)#)#)#)')')')$)$)$)$)%)%)%)%)))))))))~)&)&)&)*)*)*){)o'o'o'=)=)=)p'p'p'])q'q'^)r'r'r's's's't't't't'/)u'u'()v'v'_)w'w':)-)-)-)x'x'x'<)y'y'[)z'z'z'A'A'A'B'B'B'}););)|)C'C'C'D'D'D'j'j'1)1)E'E'2)F'F'3)G'G'G'>)>)>)k'k'k'k'H'H'H'!)!). . . . . . . . . . ", ". . . . . . . . . . ,),)4)4)4)5)5)5)5)6)6)6)7)7)7)8)8)8)9)n'n'L'L'L'L'M'M'0)a)a)a)b)b)b)c)c)c)P'Q'Q'Q'R'd)d)e)e)e)f)f)T'T'g)g)g)h)h)h)W'i)i)j)j)j)Y'k)k)k)Z'l)l)m)m)m)n)n)n) )o).)o)o)+)+)p)q)q)@)r)#)r)')s)s)')$)$)$)$)%)%)%)))))))))))~)&)&)t)t)*)*){)o'u)u)=)=)v)p'p'])])q'q'^)^)r'w)w)s's'x)t't'/)/)u'()()v'_)_)w':):)-)-)y)x'x'<)<)y'[)[)z'z)z)A'A'A)B'B'})});)|)|)C'B)B)D'D'C)j'j'1)1)E'E'2)F'3)3)G'D)D)>)E)E)k'k'F)F)H'G)G)!)!). . . . . . . . . . ", ". . . . . . . . . . H)H)4)4)4)5)5)5)5)6)6)6)7)7)7)8)8)8)9)9)9)I)I)I)I)0)0)0)a)a)a)b)b)b)c)c)c)c)J)J)J)d)d)d)e)e)e)f)f)f)f)g)g)g)h)h)h)i)i)i)j)j)j)k)k)k)k)l)l)l)m)m)m)n)n)n)o)o)o)o)p)p)p)q)q)q)q)r)r)r)s)s)s)K)K)K)K)K)L)L)L)M)M)))))~)~)~)t)t)t)*){){)o'u)u)u)=)v)v)p'])])])^)^)^)w)w)w)x)x)x)t'/)/)/)()()()v'_)_):):):)-)y)y)x'<)<)<)[)[)[)z)z)z)A'A)A)B'B'})})|)|)|)B)B)B)C)C)C)j'1)1)1)2)2)2)F'3)3)G'D)D)>)E)E)F)F)F)F)G)G)G)N)N). . . . . . . . . . ", ". . . . . . . . . . H)H)4)4)4)5)5)5)5)6)6)6)7)7)7)8)8)8)9)9)9)I)I)I)I)0)0)0)a)a)a)b)b)b)c)c)c)c)J)J)J)d)d)d)e)e)e)f)f)f)f)g)g)g)h)h)h)i)i)i)j)j)j)k)k)k)k)l)l)l)m)m)m)n)n)n)o)o)o)o)p)p)p)q)q)q)r)r)r)s)s)s)s)K)K)K)K)L)L)L)M)M)M)M)~)~)~)O)t)t)t)P){){)Q)u)u)u)v)v)v)])])])R)^)^)S)w)w)w)x)x)x)/)/)/)/)()()T)_)_)_):):):)y)y)y)<)<)<)U)[)[)V)z)z)z)A)A)A)})})})})|)|)W)B)B)X)C)C)C)1)1)1)Y)2)2)Z)3)3)`)D)D)D)E)E)E)F)F)F)F)G)G)G)N)N). . . . . . . . . . ", ". . . . . . . . . . ! !.!.!.!+!+!+!+!@!@!@!#!#!#!$!$!$!%!%!%!&!&!&!I)0)0)0)a)a)a)b)b)b)c)c)c)c)J)J)J)d)d)d)e)e)e)f)*!*!*!=!=!=!-!h)h)i)i)i)j)j)j)k)k);!;!>!l)l)m)m)m)n),!n)o)o)o)'!p)p)p)q)q)q)r)r)r)s)s)s)K)K)K)K)L)L)L)L)M)M)M)M))!~)~)O)O)t)P)P){){)Q)u)u)!!v)v)~!])])R)R)^)S)S)w)w){!x)x)]!/)/)^!^!()()T)_)_)/!:):)(!y)y)_!<)<)U)U)[)V)V)z)z):!A)A)!>!>!c!c!c!,!,!,!'!'!'!'!d!d!d!e!e!e!f!f!f!g!g!g!h!h!h!h!i!i!i!. . . M))!)!~)O)O)O)P)P)P){)Q)Q)u)!!!!v)~!~!])])R)R)S)S)S)w){!{!x)]!]!/)/)^!^!()T)T)/!/!/!:)(!(!y)_!_!<)U)U)U)[)V)V)z):!:!A)!>!>!c!c!c!,!,!,!'!'!'!'!d!d!d!e!e!e!f!f!f!g!g!g!h!h!h!h!i!i!i!. . . )!)!)!O)O)O)O)P)P)P)Q)Q)Q)!!!!!!~!~!~!R)R)R)R)S)S)S){!{!{!]!]!]!^!^!^!^!T)T)T)/!/!/!(!(!(!_!_!_!U)U)U)U)V)V)V):!:!:!!>!>!c!c!c!,!,!,!'!'!'!'!d!d!d!e!e!e!f!f!f!g!g!g!h!h!h!h!i!i!i!. . . k!)!)!l!O)O)O)P)P)P)m!Q)Q)n!!!!!o!~!~!p!p!R)R)S)S)S)q!{!{!r!]!]!s!s!^!^!t!T)T)/!/!/!u!(!(!v!_!_!w!U)U)U)x!V)V)y!:!:!z!!Z!Z!`!`!`! ~,! ~.~.~.~'!+~+~+~@~@~@~#~#~#~$~$~$~%~%~%~%~&~&~&~&~k!k!k!k!)!l!l!O)O)*~P)P)m!m!Q)n!n!!!o!o!~!p!p!R)R)=~S)S)q!q!{!r!r!]!s!s!^!^!t!t!T)-~-~/!u!u!(!v!v!_!w!w!U)U)x!V)V)y!y!:!z!z!~>~>~,~,~,~,~'~'~'~)~)~)~!~!~!~~~~~~~M!M!M!M!N!N!N!O!O!O!P!P!P!Q!Q!Q!Q!R!R!R!S!S!S!T!T!T!U!U!U!U!{~{~{~V!V!V!W!W!W!X!X!X!Y!Y!Y!Y!Z!Z!Z!`!`!`! ~ ~ ~.~.~.~.~+~+~+~@~@~@~#~#~#~$~$~$~$~%~%~%~%~&~&~&~k!k!k!k!l!l!l!O)*~*~*~P)m!m!Q)n!n!n!o!o!o!p!p!p!R)=~=~S)q!q!q!r!r!r!s!s!s!s!t!t!T)-~-~-~u!u!u!v!v!v!w!w!w!U)x!x!V)y!y!y!z!z!z!A!A!A!A!B!B!W)C!C!X)D!D!D!E!E!E!Y)F!F!Z)G!G!`)H!H!H!I!I!I!J!J!J!J!K!K!K!L!L!. . . . . . . . . . ", ". . . . . . . . . . ;~;~>~>~>~,~,~,~,~'~'~'~)~)~)~!~!~!~~~~~~~M!M!M!M!N!N!N!O!O!O!P!P!P!Q!Q!Q!Q!R!R!R!S!S!S!T!T!T!U!U!U!U!{~{~{~V!V!V!W!W!W!X!X!X!Y!Y!Y!Y!Z!Z!Z!`!`!`! ~ ~ ~.~.~.~.~+~+~+~@~@~@~@~#~#~#~$~$~$~%~%~%~%~%~&~&~&~k!k!]~]~l!l!l!*~*~*~^~m!m!/~n!n!n!(~o!o!_~p!p!p!=~=~=~q!q!q!r!r!r!:~s!s!s!t!t!t!<~-~-~u!u!u![~v!v!}~w!w!w!x!x!x!y!y!y!|~z!z!1~1~A!A!B!B!B!C!C!C!D!D!D!2~E!E!E!F!F!F!3~G!G!4~H!H!5~I!I!J!J!J!J!K!K!K!L!L!. . . . . . . . . . ", ". . . . . . . . . . 6~6~>~>~>~,~,~,~,~'~'~'~)~)~)~!~!~!~~~7~7~8~8~8~8~9~9~N!O!O!O!P!P!P!Q!Q!Q!0~a~a~a~b~S!S!T!T!T!U!U!c~c~{~{~{~V!V!V!d~W!W!X!X!X!e~Y!Y!Y!f~Z!Z!`!`!`! ~ ~ ~g~.~h~.~.~i~i~+~@~@~j~#~k~#~l~$~$~l~m~m~m~m~n~n~n~]~]~]~]~]~l!o~o~*~*~^~^~m!/~n!n!(~(~o!_~_~p!p!p~p~=~=~q~q!q!r~r~r!:~:~s!s!s~t!t!<~-~-~t~u!u![~[~v!}~}~w!w!u~x!x!v~y!y!|~|~z!1~1~A!A!w~B!B!x~C!C!y~y~D!2~2~E!E!z~z~F!3~G!G!4~H!H!5~I!I!A~A~J!J!B~K!K!C~C~. . . . . . . . . . ", ". . . . . . . . . . 6~6~D~D~D~E~E~E~E~F~F~F~G~G~G~H~H~H~7~7~7~8~8~8~8~9~9~9~I~I~I~J~J~J~0~0~0~0~a~a~a~b~b~b~K~K~K~c~c~c~c~L~L~L~M~M~M~d~d~d~N~N~N~e~e~e~e~e~f~f~f~O~O~O~g~g~g~h~h~h~h~i~i~i~j~j~j~k~k~k~k~l~l~l~m~m~m~m~n~n~n~n~]~]~]~]~l!o~o~o~^~^~^~m!/~/~/~(~(~(~_~_~_~p!p~p~=~q~q~q~r~r~r~:~:~:~:~s!s~s~t!<~<~-~t~t~u![~[~[~}~}~}~w!u~u~x!v~v~v~|~|~|~1~1~1~A!w~w~B!x~x~x~y~y~y~2~2~E!E!z~z~F!3~3~G!4~4~4~5~5~5~A~A~A~A~B~B~B~C~C~. . . . . . . . . . ", ". . . . . . . . . . 6~6~D~D~D~E~E~E~E~F~F~F~G~G~G~H~H~H~7~7~7~8~8~8~8~9~9~9~I~I~I~J~J~J~0~0~0~0~a~a~a~b~b~b~K~K~K~c~c~c~c~L~L~L~L~M~M~M~d~d~d~N~N~N~e~e~e~e~f~f~f~O~O~O~g~g~g~h~h~h~h~i~i~i~j~j~j~j~k~k~k~l~l~l~l~P~m~m~m~n~n~n~]~]~]~Q~Q~o~o~o~^~^~^~R~/~/~/~(~(~(~S~_~_~_~p~p~p~q~q~q~r~r~r~T~:~:~:~s~s~s~<~<~<~t~t~t~U~[~[~[~V~}~}~}~u~u~u~v~v~v~W~|~|~1~1~1~1~w~w~w~x~x~x~y~y~y~2~2~2~2~z~z~z~3~3~3~X~4~4~5~5~5~A~A~A~A~B~B~B~C~C~. . . . . . . . . . ", ". . . . . . . . . . Y~Y~Z~Z~D~E~E~E~E~F~F~F~G~G~G~H~H~`~ { {7~8~8~8~8~9~9~9~I~I~.{+{J~J~0~0~0~0~0~a~@{a~b~b~b~K~K~#{c~c~c~c~L~L~L~M~M~${d~d~d~N~N~N~e~e~e~e~f~f~f~O~O~O~g~g~g~h~h~h~%{%{i~i~&{j~j~j~k~*{*{*{P~P~P~P~P~={m~m~n~n~n~Q~Q~Q~Q~o~o~-{-{^~^~R~R~/~;{;{(~S~S~S~_~_~>{p~p~,{q~q~'{r~r~T~:~:~:~){s~s~!{<~<~~{t~t~U~U~[~V~V~}~}~{{u~u~]{v~v~W~W~|~^{1~1~1~1~/{w~w~({x~x~_{y~y~:{2~2~2~<{z~z~[{3~3~X~4~4~}{5~5~|{|{A~A~1{B~B~2{2{. . . . . . . . . . ", ". . . . . . . . . . Y~Y~Z~Z~D~E~E~3{3{4{4{4{5{5{5{`~`~`~ { { {7~6{6{6{6{7{7{7{.{.{.{+{+{+{8{8{8{8{@{@{@{9{9{9{#{#{#{0{0{0{0{a{a{a{${${${b{b{b{c{c{c{d{d{d{d{e{e{e{f{f{f{f{g{g{g{%{%{%{%{&{&{&{h{h{h{h{*{*{*{*{P~P~P~P~={={={i{i{i{i{Q~Q~Q~Q~-{-{-{-{R~R~R~/~;{;{;{S~S~S~_~>{>{p~,{,{,{q~'{'{r~T~T~:~:~){){s~!{!{<~~{~{t~U~U~U~V~V~V~}~{{{{u~]{]{v~W~W~|~^{^{1~1~/{/{/{({({x~_{_{y~:{:{:{2~<{z~z~z~[{[{3~X~X~4~}{}{}{|{|{A~A~1{B~B~2{2{. . . . . . . . . . ", ". . . . . . . . . . Y~Y~Y~Z~Z~Z~3{3{3{3{4{4{4{5{5{5{`~`~`~ { { {6{6{6{6{7{7{7{.{.{.{+{+{+{8{8{8{8{@{@{@{9{9{9{#{#{#{0{0{0{0{a{a{a{${${${b{b{b{c{c{c{d{d{d{d{d{e{e{e{f{f{f{g{g{g{%{%{%{%{%{&{&{&{h{h{h{h{*{*{*{*{j{P~P~={={={={i{i{i{Q~Q~k{k{-{-{-{l{R~R~R~m{;{;{n{S~S~S~S~>{>{>{,{,{,{'{'{'{T~T~T~T~T~){){){!{!{!{~{~{~{U~U~U~o{V~V~V~{{{{{{]{]{]{p{W~W~^{^{^{^{/{/{/{({({({_{_{_{q{:{:{2~<{<{<{[{[{[{X~X~X~}{}{}{|{|{|{A~1{1{1{2{2{2{. . . . . . . . . . ", ". . . . . . . . . . . Y~Y~Z~r{r{3{3{3{3{4{4{4{5{5{5{`~s{`~ { { {6{6{6{6{7{7{7{.{.{.{+{+{+{8{8{8{8{@{@{@{9{9{9{#{#{#{0{0{0{0{a{a{a{${${${b{b{b{b{c{c{c{d{d{d{d{e{e{e{f{f{f{g{g{g{t{u{%{%{%{&{&{v{v{w{w{w{w{j{j{j{j{x{x{P~={={={i{i{i{y{k{k{k{k{-{l{l{l{R~m{m{m{;{n{n{S~S~z{z{>{>{A{,{,{B{'{'{C{T~T~T~D{){){E{E{!{!{F{~{~{G{U~U~o{V~V~V~H{{{{{I{]{]{p{W~W~J{^{^{^{/{/{/{K{({({L{L{_{q{:{:{:{<{<{<{M{[{[{X~X~X~N{}{}{O{O{|{|{P{1{1{2{2{. . . . . . . . . . . ", ". . . . . . . . . . . Q{Q{r{r{r{3{3{3{R{S{S{S{T{T{T{s{s{`~ {U{U{V{V{V{V{W{7{7{X{X{X{Y{Y{+{8{Z{Z{Z{`{`{@{ ] ] ].].].]+]+]0{+]@]@]@]@]#]#]#]$]$]$]%]%]%]&]&]&]&]*]*]*]=]=]=]=]t{t{t{u{u{u{u{u{v{v{v{v{w{w{w{w{j{j{j{j{x{x{-]-]-]-]y{y{y{k{k{k{k{;]l{l{l{m{m{m{m{n{n{n{n{S~z{z{>{A{A{,{,{B{B{'{C{C{T~T~D{){){E{E{!{F{F{~{G{G{U~U~o{o{V~V~H{H{{{I{I{]{p{p{W~J{J{J{^{>]/{/{K{K{({L{L{_{q{q{:{:{,],]<{M{[{[{']']X~N{N{N{O{O{|{|{P{1{1{)])]. . . . . . . . . . . ", ". . . . . . . . . . . Q{Q{r{r{r{R{R{R{R{S{S{S{T{T{T{s{s{s{U{U{U{V{V{V{V{W{W{W{X{X{X{Y{Y{Y{Z{Z{Z{Z{`{`{`{ ] ] ] ].].].]+]+]+]+]@]@]@]#]#]#]$]$]$]%]%]%]&]&]&]&]&]*]*]*]=]=]=]t{t{t{t{u{u{u{u{u{v{v{v{v{w{w{w{w{!]j{j{x{x{x{-]-]-]y{y{y{y{k{;];];]l{l{~]~]m{m{{]n{n{n{n{z{z{z{z{A{A{A{B{B{B{]]C{C{C{T~D{D{){E{E{E{F{F{F{G{G{G{o{o{o{V~H{H{H{I{I{I{I{p{p{p{J{J{J{^{>]>]/{K{K{({L{L{L{q{q{q{:{,],]<{M{M{M{']']X~N{N{N{O{O{O{|{P{P{P{)])]. . . . . . . . . . . ", ". . . . . . . . . . . Q{Q{r{r{r{R{R{R{R{S{S{S{T{T{T{s{s{s{U{U{U{V{V{V{V{W{W{W{X{X{X{Y{Y{Y{Z{Z{Z{Z{Z{`{`{`{ ] ] ].].].]+]+]+]+]@]@]@]#]#]#]$]$]$]%]%]%]%]&]&]&]&]*]*]*]=]=]=]=]t{t{t{u{u{u{u{u{^]/]/]v{/](](](](]!]!]!]x{x{-]-]-]-]y{_]_];];];];];]~]~]~]m{{]{]{]n{n{n{:]z{z{<]A{A{A{[]B{B{]]C{C{C{}]D{D{D{E{E{E{F{F{F{|]G{G{1]o{o{o{H{H{H{2]I{I{3]p{p{4]J{J{J{J{>]>]>]K{K{K{5]L{L{6]q{q{q{,],],]7]M{M{']']']8]N{N{9]O{O{|{P{P{P{)])]. . . . . . . . . . . ", ". . . . . . . . . . . 0]0]r{r{r{R{R{R{R{S{a]a]T{T{T{s{s{s{U{b]U{V{V{V{V{V{c]c]W{X{X{X{d]d]Y{Z{Z{e]Z{`{`{f]g] ] ]h].].]+]i]+]+]@]@]@]#]#]j]#]k]$]k]%]l]%]m]&]&]m]m]n]n]n]o]o]o]p]p]p]p]^]^]^]^]^]^]/]/]/]/](](](]!]!]!]q]q]q]r]r]r]_]_]_]_];];];]s]~]~]~]t]{]{]{]{]n{:]:]z{z{<]<]A{[][]B{]]]]]]C{C{}]}]D{u]E{E{v]v]F{F{|]|]G{1]1]o{o{w]H{H{2]2]I{3]3]p{4]4]J{J{x]>]>]y]K{K{5]5]L{6]6]6]q{q{z],],]7]M{M{A]A]']8]8]N{9]O{O{O{B]P{P{C]C]. . . . . . . . . . . ", ". . . . . . . . . . . 0]0]r{r{D]E]E]E]E]a]a]a]T{F]F]F]G]G]G]b]b]b]H]H]H]H]c]c]c]I]I]I]d]d]d]e]e]e]e]f]f]f]g]g]g]h]h]h]i]i]i]i]i]J]J]J]j]j]j]k]k]k]l]l]l]l]m]m]m]m]n]n]n]n]o]o]o]p]p]p]p]^]^]^]^]^]K]/]/]L]M]M](]!]!]!]q]q]q]r]r]r]r]_]_]_];]s]s]s]s]~]t]t]t]{]{]{]:]:]:]:]<]<]<]N][][][]]]]]]]]]}]}]}]D{u]u]u]v]v]v]|]|]|]1]1]1]1]o{w]w]w]2]2]2]3]3]3]4]4]4]J{x]x]>]y]y]K{5]5]L{6]6]6]q{z],],]7]7]M{A]A]A]']8]8]8]9]9]9]O{B]P{P{C]C]. . . . . . . . . . . ", ". . . . . . . . . . . 0]0]D]D]D]D]E]E]E]E]a]a]a]F]F]F]G]G]G]b]b]b]H]H]H]H]c]c]c]I]I]I]d]d]d]e]e]e]e]f]f]f]g]g]g]g]h]h]h]i]i]i]i]J]J]J]j]j]j]k]k]k]k]l]l]l]m]m]m]m]m]n]n]n]o]o]o]o]p]p]p]O]K]K]K]K]K]K]L]L]L]M]M]P]P]!]!]q]q]q]r]r]r]_]Q]Q]Q]s]s]s]s]R]t]t]t]{]{]S]S]:]:]T]<]<]<]N][][]U]U]]]]]]]V]}]}]W]u]u]u]X]v]v]Y]|]|]Z]1]1]1]w]w]w]2]2]2]2]3]3]3]`]4]4]4]x]x]x]y]y]y]5]5]5] ^6]6]q{z]z]z]7]7]7]A]A]A].^8]8]+^9]9]O{B]B]B]B]C]C]. . . . . . . . . . . ", ". . . . . . . . . . . . 0]@^#^D]D]E]E]E]E]a]$^a]F]F]F]G]G]%^b]b]b]H]H]H]H]c]c]c]I]I]I]d]d]d]e]e]e]e]&^f]f]*^g]g]g]h]h]h]i]i]=^i]J]J]J]-^j];^j]>^k]k],^l]l],^'^'^'^'^)^)^)^)^!^!^!^!^O]O]O]O]K]K]K]K]K]K]~^L]L]M]M]P]P]P]{^{^{^{^]^]^]^Q]Q]Q]Q]s]R]R]R]t]t]t]t]S]S]S]:]T]T]T]<]N]N]N][]U]U]]]]]V]V]}]}]W]u]u]X]X]v]Y]Y]Y]|]Z]Z]1]1]^^w]w]/^2]2](^(^3]`]4]4]4]4]x]x]x]_^y]y]:^5]5] ^6]6]6]<^z]z][^7]7]}^A]A].^.^8]+^9]9]9]|^B]B]1^C]. . . . . . . . . . . . ", ". . . . . . . . . . . . @^@^#^D]D]2^2^2^2^$^$^a]F]3^3^%^%^%^b]4^4^5^5^5^H]6^6^6^6^7^7^7^8^8^8^&^&^&^&^*^*^*^9^9^9^0^0^0^=^=^=^=^=^-^-^-^;^;^;^>^>^>^>^,^,^,^'^'^'^'^'^)^)^)^)^!^!^!^!^O]O]O]O]K]a^a^a^a^~^~^~^M]M]M]P]P]P]{^{^{^]^]^]^]^Q]Q]b^R]R]R]R]R]t]t]c^S]S]S]d^T]T]T]N]N]N]N]U]U]U]U]]]V]V]}]W]W]W]u]X]X]v]Y]Y]Y]Z]Z]Z]1]1]^^^^w]/^/^2](^(^(^`]`]`]4]e^e^x]_^_^y]:^:^:^:^ ^ ^ ^6]<^<^z][^[^7]}^}^A].^.^8]+^+^+^9]|^B]B]1^1^. . . . . . . . . . . . ", ". . . . . . . . . . . . @^@^#^#^#^2^2^2^2^$^$^$^3^3^3^%^%^%^4^4^4^4^5^5^5^5^6^6^6^7^7^7^8^8^8^&^&^&^&^*^*^*^9^9^9^9^0^0^0^=^=^=^=^-^-^-^-^;^;^;^>^>^>^,^,^,^,^'^'^'^'^'^)^)^)^!^f^f^f^f^g^g^g^g^a^a^a^a^~^~^~^h^h^h^P]P]P]{^{^{^]^]^]^i^b^b^b^b^R]R]R]R]t]c^c^c^S]d^d^d^T]T]j^N]N]k^k^k^U]U]l^V]V]V]W]W]W]X]X]X]Y]Y]Y]Y]Z]Z]Z]Z]^^^^^^m^/^/^/^(^(^(^`]`]`]`]e^e^e^_^_^_^:^:^:^ ^ ^ ^ ^<^<^<^<^[^[^[^}^}^}^.^.^.^n^+^+^9]|^|^|^1^1^. . . . . . . . . . . . ", ". . . . . . . . . . . . @^@^#^#^#^2^2^2^2^$^$^$^$^3^3^3^%^o^%^4^4^4^5^5^5^5^6^6^6^7^7^7^8^8^8^&^&^&^&^p^*^*^q^9^9^9^0^0^0^=^=^=^r^=^s^-^s^;^t^;^>^u^u^u^v^,^,^'^w^w^w^w^x^x^x^x^f^f^f^f^f^g^g^g^g^y^a^a^a^~^~^h^h^h^z^z^z^z^A^A^A^i^i^i^i^b^b^b^b^R]R]B^B^c^c^c^d^d^d^d^d^j^j^j^N]k^k^k^U]U]l^V]V]C^W]W]W]D^D^X]E^E^Y]F^F^F^Z]Z]G^^^^^m^/^/^H^(^(^I^`]`]`]`]e^e^e^_^_^_^J^:^:^K^ ^ ^ ^<^<^<^L^[^[^M^}^}^N^N^.^.^n^+^+^+^O^|^|^1^1^. . . . . . . . . . . . ", ". . . . . . . . . . . . P^P^Q^Q^Q^#^2^R^R^R^S^S^$^T^T^T^o^o^%^U^U^U^V^5^V^V^W^6^6^X^X^X^X^Y^Y^Y^p^p^p^p^q^q^q^Z^Z^Z^`^`^`^`^r^r^r^r^s^s^s^s^t^t^t^u^u^u^v^v^v^v^w^w^w^w^w^x^x^x^x^f^f^f^f^ /y^y^y^y^y^./a^~^~^~^h^h^z^z^z^z^A^A^A^A^i^i^i^b^b^b^b^B^B^B^B^c^c^+/+/d^d^d^@/j^j^j^k^k^k^k^U]l^l^l^V]C^C^C^D^D^D^E^E^E^E^F^F^F^Z]G^G^^^^^m^m^/^H^H^(^I^I^I^`]#/#/e^$/$/$/_^J^J^:^K^K^ ^ ^%/%/<^L^[^[^M^M^M^N^N^.^n^n^n^+^O^|^|^|^&/&/. . . . . . . . . . . . ", ". . . . . . . . . . . . . P^P^Q^Q^Q^R^R^R^R^S^S^S^T^T^T^o^o^o^U^U^U^V^V^V^V^V^W^W^W^X^X^X^Y^Y^Y^p^p^p^p^q^q^q^q^Z^Z^Z^`^`^`^r^r^r^r^r^s^s^s^t^t^t^t^u^u^u^v^v^v^v^w^w^w^w^*/=/=/=/=/ / / / / /y^y^y^y^./././~^~^~^h^h^z^z^z^z^A^A^A^i^i^i^i^b^-/-/B^B^B^B^B^+/+/+/d^d^@/@/j^j^;/;/k^k^k^>/l^l^l^,/C^C^'/D^D^D^E^E^E^)/F^F^F^F^G^G^G^m^m^m^!/H^H^H^I^I^I^`]#/#/e^$/$/$/J^J^J^K^K^K^K^ ^%/%/<^L^L^L^M^M^M^N^N^N^n^n^n^+^O^O^O^&/&/. . . . . . . . . . . . . ", ". . . . . . . . . . . . . P^P^Q^Q^Q^R^R^R^R^S^S^S^T^T^T^o^o^o^o^U^U^U^V^V^V^V^W^W^W^X^X^X^Y^Y^Y^p^p^p^p^p^q^q^q^Z^Z^Z^`^`^`^~/r^{/r^{/s^s^s^]/^/t^^///u^////(/(/(/(/*/*/*/*/*/=/=/=/=/=/ / / / /_/y^y^./././:/:/://>/>/l^,/,/C^C^'/D^D^1/1/1/E^)/)/F^F^2/G^G^G^3/m^m^!/H^H^4/I^I^I^I^5/#/#/6/$/$/7/J^J^K^K^K^K^8/%/%/9/L^L^L^M^M^M^0/N^N^a/n^n^n^O^O^O^&/&/. . . . . . . . . . . . . ", ". . . . . . . . . . . . . P^b/c/c/Q^R^R^d/d/e/e/S^S^f/f/f/o^o^g/h/h/U^V^i/i/V^W^j/j/X^X^k/k/l/l/l/m/m/m/m/n/n/q^n/o/o/o/~/~/~/{/{/{/{/{/]/]/]/^/^/^/^/////////(/(/(/(/*/*/*/*/*/=/p/=/p/p/_/_/_/_/q/q/y^././:/:/://>/>/>/,/,/,/,/'/'/'/'/1/1/1/)/)/)/)/F^2/2/G^3/3/m^!/!/!/H^4/4/4/I^5/5/#/6/6/$/$/7/7/J^v/v/K^K^8/%/%/9/L^L^w/w/M^0/0/N^N^a/a/n^n^x/O^O^y/&/. . . . . . . . . . . . . ", ". . . . . . . . . . . . . b/b/c/c/c/c/d/d/d/d/e/e/e/f/f/f/g/g/g/h/h/h/i/i/i/i/i/j/j/j/k/k/k/l/l/l/m/m/m/m/m/n/n/n/o/o/o/~/~/~/~/{/{/{/{/]/]/]/]/^/^/^/^///////(/z/z/(/*/A/A/A/A/A/p/p/p/p/p/p/_/_/_/q/q/B/B/./:/://>/>/F/,/,/G/G/'/'/H/1/1/1/)/)/)/F^2/2/2/G^3/3/3/!/!/!/I/4/4/4/I^5/5/5/6/6/6/7/7/J^v/v/v/K^K^8/8/%/9/9/9/w/w/M^0/0/0/a/a/a/n^x/x/O^O^y/y/. . . . . . . . . . . . . ", ". . . . . . . . . . . . . . b/b/c/c/c/d/d/d/d/e/e/e/f/f/f/g/g/g/g/h/h/h/i/i/i/i/j/j/j/k/k/k/l/l/l/l/m/m/m/m/n/n/n/o/o/o/o/~/~/~/{/{/J/{/J/]/]/K/K/L/L/L///M/M/M/z/z/z/z/A/A/A/A/A/A/A/p/p/N/p/O/_/_/q/q/q/B/B/B/P/://>/F/F/,/,/G/G/'/H/H/H/1/R/R/)/)/)/S/2/2/T/3/3/3/U/!/!/I/4/4/4/5/5/5/5/V/6/6/W/7/7/X/v/v/v/8/8/8/9/9/9/9/w/w/w/Y/0/0/Z/a/a/a/x/x/x/`/y/. . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . b/b/ ( (c/d/d/d/.(+(e/e/e/@(@(f/g/#(#($(h/h/%(%(i/%(&(j/j/&(*(k/*(=(l/=(-(m/-(-(-(;(;(;(>(>(>(,(,(,(,(J/J/J/J/J/K/K/K/L/L/L/L/M/M/M/M/z/z/z/z/z/A/A/'('(A/'(N/N/N/N/O/O/q/q/q/B/B/B/P/P/)()()()(!(!(!(!(~(~(~(C/C/C/C/t/t/{(D/D/D/D/D/Q/Q/Q/Q/u/u/](E/E/E/E/F/F/F/F/G/G/G/G/H/H/H/R/R/R/)/)/S/S/2/2/T/T/3/U/U/!/I/I/I/4/4/^(5/5/V/6/6/W/7/7/7/X/v/v/v/8/8/8//(/(9/((((w/Y/Y/0/0/Z/a/a/a/_(x/x/`/y/. . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . :(:( ( (c/ (.(.(.(.(+(+(+(@(@(@(#(#(#($($($(%(%(%(%(%(&(&(&(*(*(*(=(=(=(=(-(-(-(-(;(;(;(;(>(>(>(,(,(,(,(J/J/J/J/K/K/K/K/L/L/L/L/M/M/<(M/z/[([([([('('('('('('(}(N/N/O/O/|(|(|(B/B/B/B/P/P/)()()(!(!(!(!(~(~(~(C/C/C/1({({({({(D/D/2(2(2(Q/Q/Q/u/](](](E/E/3(F/F/F/4(G/G/G/5(H/H/H/6(R/R/R/S/S/S/S/T/T/T/U/U/U/U/I/I/I/4/^(^(^(5/V/V/V/W/W/W/X/X/X/v/v/7(7(8//(/(9/((((w/Y/Y/Y/Z/Z/Z/a/_(_(x/x/`/`/. . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . :(:( ( ( (.(.(.(.(+(+(+(@(@(@(#(#(#(#($($($(%(%(%(%(&(&(&(*(*(*(*(=(=(=(-(-(-(-(-(;(;(;(>(>(>(>(8(,(,(J/J/9(J/9(0(K/0(0(a(L/a(a(<(<(<(<([([([([([('('('(}(}(}(b(b(O/O/O/|(|(|(c(c(c(P/P/P/)()()(!(!(!(~(~(d(d(1(1(1(1({({({(2(2(2(2(2(Q/Q/Q/e(](](](](3(3(3(F/4(4(4(4(5(5(5(H/6(6(6(R/R/f(S/S/g(T/T/T/h(h(U/i(I/I/I/I/j(^(^(V/V/V/V/W/W/W/X/X/X/v/7(7(7(/(/(/(/(((((((k(Y/Y/l(Z/Z/a/_(_(_(`/`/. . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . :(:( ( ( (.(.(.(.(+(+(+(+(m(@(@(#(n(#($($($(%(%(o(o(%(p(p(&(*(*(*(q(=(=(q(r(r(r(-(s(;(s(s(t(t(t(8(8(8(8(9(9(9(9(9(0(0(0(0(a(a(a(a(<(<(<(<([(u([(u(u(}(}(}(}(}(b(b(v(v(O/O/|(|(c(c(c(w(w(w(x(x(x(y(y(y(y(d(d(d(d(1(1(1(1(z(z(z(2(2(2(2(Q/Q/e(e(](](](A(3(3(3(B(4(4(4(C(5(5(5(6(6(6(6(R/f(f(f(S/g(g(T/h(h(h(U/i(i(i(I/j(^(^(^(D(V/V/E(E(W/F(F(F(X/X/G(7(7(H(/(/(I(((((k(Y/Y/Y/l(Z/Z/Z/J(_(_(`/`/. . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . K(K(L( ( (L(M(M(M(.(N(N(N(m(m(m(n(n(n(O(O(O(O(o(o(o(o(p(p(p(P(P(P(P(q(q(q(r(r(r(r(r(s(s(s(t(t(t(t(8(8(8(8(9(9(9(9(9(0(0(0(0(a(a(Q(Q(R(R(R(R(R(u(u(u(u(u(}(}(}(}(b(b(v(v(v(S(|(|(c(c(w(w(w(w(x(x(x(y(y(y(y(d(d(d(1(T(T(T(z(z(z(z(2(2(2(U(e(e(e(e(A(A(A(A(3(B(B(4(4(C(C(C(5(V(V(6(6(6(W(f(f(f(g(g(g(g(h(h(h(X(i(i(i(I/j(j(j(D(D(D(V/E(E(W/F(F(F(X/G(G(7(7(H(/(/(I(I(((k(k(k(l(l(l(Z/J(J(_(_(Y(Y(. . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . K(K(L(L(L(M(M(M(M(N(N(N(m(m(m(m(n(n(n(O(O(O(o(o(o(o(o(p(p(p(P(P(P(q(q(q(q(r(r(r(r(s(s(s(s(t(t(t(Z(8(8(`(9( _ _ _ _ _._._._._Q(Q(Q(Q(R(R(R(R(R(u(+_+_+_+_+_}(}(b(b(v(v(v(S(S(S(@_@_c(w(w(w(x(x(x(x(y(y(y(#_$_$_$_T(T(T(z(z(z(z(z(U(U(U(U(e(e(%_%_A(A(A(B(B(B(B(C(C(C(C(V(V(V(V(6(6(W(f(f(&_&_g(g(*_h(h(h(X(i(i(i(=_j(j(j(D(D(D(-_E(E(;_;_F(F(F(G(G(G(H(H(H(>_I(I(I(k(k(k(,_l(l(Z/J(J(J('_Y(. . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . K(K(L(L(L(M(M(M(M(M(N(N()_m(m(m(!_n(n(O(O(O(O(~_o(o(~_p(p({_P(P(]_P(^_^_q(/_/_/_/_/_(_(_(_(_Z(Z(Z(`(`(`(`( _ _ _ _ _ _._._._._Q(Q(____:_:_:_:_:_+_+_+_+_<_<_<_b(b(v(v(v(S(S(S(S(@_@_[_[_[_[_}_}_}_#_#_#_#_$_$_$_$_T(T(T(T(z(|_|_U(U(U(U(e(%_%_%_A(A(1_1_B(B(2_2_C(C(3_3_V(V(V(V(W(W(W(f(&_&_g(*_*_*_h(X(X(X(i(i(=_j(j(4_4_D(D(-_E(E(;_;_F(F(5_G(G(G(6_H(H(>_I(I(7_k(k(,_,_l(l(l(8_J(J('_Y(. . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . K(9_0_0_0_L(a_a_a_M()_)_)_m(b_b_!_!_!_!_c_c_c_~_~_~_~_~_{_{_{_]_]_]_^_^_^_^_/_/_/_/_/_(_(_(_Z(Z(Z(Z(`(`(`(`( _ _d_ _ _._e_e_e_e___________:_:_:_:_f_+_+_<_<_<_g_g_b(v(v(v(S(S(S(@_@_@_[_[_[_}_}_}_#_#_#_#_#_$_$_$_T(T(T(h_|_|_|_|_U(U(i_i_%_%_%_1_1_1_1_B(2_2_2_C(C(3_3_V(V(V(W(W(W(W(j_&_&_&_k_*_*_X(X(X(X(i(=_=_=_j(4_4_D(-_-_-_;_;_;_;_F(5_5_G(6_6_H(H(>_>_I(7_7_7_,_,_,_l(8_J(J(J('_Y(. . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . 9_9_0_0_0_a_a_a_a_)_)_)_)_b_b_b_!_!_!_c_c_c_c_~_~_~_~_{_{_{_{_]_]_]_^_^_^_^_/_/_/_/_(_l_(_(_Z(Z(m_Z(n_n_n_n_d_d_d_d_d_d_e_e_e_e_________o_:_f_f_f_f_p_+_<_<_<_g_g_q_q_v(S(S(S(@_@_@_@_[_[_[_}_}_}_#_#_#_#_$_$_$_r_h_h_h_|_|_|_|_i_i_i_i_%_%_s_s_1_1_1_t_2_2_2_u_3_3_3_V(V(v_v_v_W(j_j_&_&_k_*_*_*_w_X(X(X(x_=_=_=_y_4_4_z_-_-_-_;_;_;_;_5_5_5_5_6_6_6_>_>_>_7_7_7_7_,_,_,_l(8_8_8_'_'_. . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . 9_9_0_0_0_a_a_a_A_a_)_)_B_b_b_b_!_!_!_C_c_c_D_~_~_E_E_~_F_{_{_G_]_G_G_H_H_^_I_/_I_I_I_l_l_l_l_m_m_m_m_n_n_n_n_d_d_d_d_d_d_e_e_J_J_o_o_o_o_o_o_f_f_f_p_p_p_<_<_<_g_g_q_q_q_K_K_@_@_@_@_[_[_[_}_}_}_}_#_#_L_L_r_r_r_h_h_h_h_|_M_M_M_i_i_i_N_s_s_s_s_1_t_t_t_2_u_u_u_3_3_3_v_v_v_v_j_j_j_j_k_k_k_k_w_w_w_X(X(x_x_=_y_y_4_4_z_z_-_O_O_O_;_;_P_5_5_Q_6_6_6_>_>_>_R_7_7_S_S_,_,_,_T_8_8_U_'_. . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . 9_9_V_W_W_0_A_A_A_a_B_B_B_B_X_X_X_C_C_C_c_D_D_D_E_E_E_E_F_F_F_F_G_G_G_H_H_H_H_I_I_I_I_I_l_l_l_l_m_m_m_m_n_Y_n_Y_Z_Z_Z_Z_Z_Z_J_J_J_J_J_o_o_o_o_`_f_f_p_p_p_ : :g_g_g_q_q_q_q_K_K_.:.:.:+:+:+:@:@:@:@:L_L_L_L_r_r_r_h_h_h_#:M_M_M_M_i_i_N_N_N_s_s_$:$:t_t_t_u_u_u_3_3_3_%:%:%:v_&:j_j_j_*:k_k_k_w_w_w_w_X(x_x_x_=_y_y_y_z_z_z_-_O_O_;_;_P_P_P_5_Q_Q_Q_=:=:=:R_R_R_R_S_S_,_,_T_8_8_U_'_'_. . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . V_V_W_W_W_A_A_A_A_A_B_B_B_X_X_X_C_C_C_C_D_D_D_E_E_E_E_E_F_F_F_G_G_G_G_H_H_H_-:I_I_I_I_;:>:>:l_>:,:,:,:,:Y_Y_Y_Y_Z_Z_Z_Z_Z_Z_J_J_J_J_':o_`_`_`_):):p_p_p_ : : :!:!:!:q_q_q_K_K_.:.:.:.:+:+:+:@:@:@:@:L_L_L_L_r_~:~:~:#:#:#:M_M_M_{:N_N_N_N_s_$:$:$:t_t_]:]:u_u_u_3_%:%:%:v_&:&:&:&:*:*:*:k_^:^:w_w_w_/:x_x_x_(:y_y_y_z_z_z__:O_O_O_;_P_P_5_Q_Q_Q_Q_=:=:=:R_R_R_S_S_S_,_,_T_T_8_U_U_. . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . V_V_W_W_W_W_A_A_A_A_B_B_B_B_X_X_X_C_C_C_D_D_::D_E_<:E_<:F_F_[:F_}:}:}:}:-:-:-:;:;:;:;:;:>:>:>:>:,:,:,:,:,:Y_Y_Y_Y_Z_Z_Z_Z_|:|:':':':':':':`_`_):):):1:p_p_ : :!:!:2:2:2:2:2:K_K_.:.:.:+:+:+:+:@:@:@:L_3:3:3:~:~:~:~:#:#:#:#:{:{:{:N_N_N_4:4:$:$:$:$:]:]:]:u_u_u_5:%:%:%:6:&:&:&:&:*:*:*:*:^:^:^:w_w_/:/:x_(:(:(:y_7:7:z_z__:O_O_O_8:P_P_P_9:Q_Q_0:=:=:a:a:R_R_b:S_S_S_c:T_T_T_d:U_. . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . V_V_e:e:W_A_f:f:f:f:g:g:B_h:h:X_i:i:i:i:::::::<:<:<:<:<:[:[:[:[:}:}:}:-:-:-:-:;:;:;:;:;:>:>:>:>:,:,:,:,:,:j:j:j:j:|:|:|:|:|:|:|:':k:k:k:l:l:):):):):1:1:m: : :!:!:!:2:2:2:n:n:n:o:o:o:p:p:p:q:q:q:q:3:3:3:3:~:~:~:#:r:r:r:{:{:{:{:4:4:4:4:4:$:s:s:]:]:]:]:u_5:5:5:%:6:6:6:&:&:t:*:*:*:u:^:^:^:w_/:/:/:x_(:(:(:7:7:7:7:_:_:_:O_O_8:P_P_9:9:Q_Q_0:0:=:a:a:R_b:b:b:S_S_c:T_T_d:U_. . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . v:v:e:e:e:e:f:f:f:f:g:g:g:g:h:h:h:i:i:i:::::::::<:<:<:<:<:[:[:[:}:}:}:}:-:-:-:-:;:;:w:w:w:>:x:x:x:y:y:y:y:y:j:j:j:j:|:|:|:|:|:|:z:k:k:k:k:l:l:A:):):1:1:1:m:m:B:!:!:2:2:2:n:n:n:o:o:o:o:p:p:p:q:q:q:q:3:3:3:~:C:C:C:r:r:r:r:{:D:D:4:4:4:4:4:s:s:s:]:]:]:]:5:5:5:5:6:6:6:6:&:t:t:t:*:u:u:u:^:^:E:/:/:/:F:(:(:(:G:7:7:H:_:_:_:_:8:8:8:8:9:9:9:0:0:0:a:a:a:R_b:b:b:S_c:c:c:T_d:d:. . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . v:v:e:e:e:f:f:f:f:f:g:g:g:h:h:h:h:i:i:i:I:::::I:<:<:<:<:J:J:J:J:K:K:K:K:L:L:L:L:w:w:w:w:w:x:x:x:x:y:y:y:y:y:j:j:M:j:M:z:z:z:z:z:z:N:k:k:l:l:A:A:A:1:1:1:m:m:m:B:B:B:O:O:n:n:n:n:o:o:o:p:p:p:p:q:q:P:Q:Q:Q:Q:C:C:C:C:r:r:R:D:D:D:D:4:4:S:S:S:s:s:s:]:T:T:T:5:5:U:U:6:6:6:V:t:t:t:u:u:u:u:u:E:E:E:/:F:F:F:(:G:G:7:7:H:H:_:_:W:8:8:8:X:9:9:Y:Y:Y:0:Z:Z:a:`:`:b:b:b: <><1:m:m:m:B:B:B:O:O:O:,<,<,<,<'<'<'<)<)<)<><(<(<(<><><(<(<><(<(<([>[>[>[V[>[>[>[>[V[d[2[2[2[2[2[2[2[,[e[,[e[e[f['[)[)[)[g[g[X}>}>}>}+}+}+}+}+}G[G[G[,},},}@}@}@}@}#}#}#}#}f[f[H[H[$}$}$}w[w[w[I[I[%}%}%}'}'}'})})}x[J[J[J[J[K[K[K[L[L[L[L[M[M[M[!}!}!}!}&}&}&}N[N[N[N[A[A[~}~}~}O[O[O[B[{}{}{}P[P[P[P[k[]}]}]}Q[Q[Q[R[R[R[R[R[S[S[S[m[T[T[T[C[C[C[U[U[U[U[^}V[V[V[/}W[W[n[*}*}*}*}X[X[X[9[9[=}p[p[p[-}-}. . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . Y[Y[Z[Z[Z[Z[`[`[`[`[`[ } } } }.}.}.}(}D[_}D[_}:}:}:}:};};};};};};}>}>}>}>}<}+}+}[}[}[},},},},},}@}@}@}@}#}#}}}}}}}H[H[$}$}$}|}|}|}I[I[I[%}%}%}'}'}'})})})}1}1}1}2}2}2}2}3}3}3}4}4}4}4}!}!}!}&}&}&}&}N[N[5}5}~}~}~}~}O[O[6}6}{}{}{}P[P[P[P[]}]}]}]}]}7}7}7}R[R[8}8}S[S[S[9}T[T[T[T[C[0}0}0}U[^}^}^}V[/}/}W[W[a}a}*}*}b}X[X[X[X[c}=}=}p[-}-}. . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . Y[d}Y[Z[e}Z[Z[f}`[`[`[`[g}g} }g}(}(}(}(}_}_}_}_}:}:}:}:};}h};};};}h}>}<}<}<}<}[}[}[}[}[},},},}i}i}i}@}@}#}#}}}}}}}j}j}H[$}$}|}|}|}k}k}k}k}%}%}%}'}'}'})})}1}1}1}1}2}2}2}3}3}3}3}4}4}4}!}!}!}&}&}l}l}l}5}5}5}5}~}~}~}m}6}6}6}{}{}{}{}P[n}n}n}]}]}]}o}7}7}7}R[8}8}8}S[S[9}9}9}T[T[T[p}0}0}0}q}^}^}^}/}/}/}W[a}a}a}a}b}b}X[X[X[c}c}=}=}r}r}-}. . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . d}Y[d}e}e}e}f}f}f}f}f}f}g}g}g}g}(}(}(}s}_}t}_}_}:}:}u}u}h}h}h}h}h}h}<}<}<}<}<}[}[}v}v}v}v}i}i}i}i}w}w}#}#}}}}}}}}}j}j}x}x}$}|}|}k}k}k}y}y}y}y}z}z}z})})})}1}1}1}2}2}2}2}3}3}3}4}4}A}A}B}B}B}B}l}l}l}5}5}5}5}m}m}m}m}6}6}6}6}{}{}C}C}n}n}n}n}o}o}o}o}7}7}D}8}8}8}S[9}9}9}9}9}T[p}p}0}0}q}q}^}^}E}/}/}/}F}a}a}a}G}G}b}b}b}X[c}=}=}r}r}r}. . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . d}d}e}e}e}e}f}f}f}f}f}g}g}H}g}s}s}s}s}s}t}t}t}t}u}u}u}u}h}h}h}h}h}h}I}J}J}J}J}J}v}v}v}v}v}i}i}i}w}w}w}K}#}}}}}}}}}j}j}x}x}x}L}|}k}k}k}y}y}y}z}z}z}M}M}M}M}N}N}N}O}O}O}P}P}P}A}A}A}A}A}B}B}B}l}l}l}5}Q}Q}Q}Q}m}m}m}6}6}6}6}C}C}C}C}n}n}n}R}o}o}o}o}S}D}D}D}8}T}T}9}9}9}9}9}U}p}p}p}q}q}^}^}E}E}E}/}/}F}F}a}a}G}b}b}b}b}V}c}c}c}r}r}. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . W}d}e}X}X}e}Y}f}Y}Y}f}H}H}H}H}s}s}s}s}s}t}t}t}t}u}u}Z}Z}Z}I}I}I}I}I}I}J}J}J}J}`}v} | | | |.|i}i}w}w}K}K}K}}}}}j}j}j}x}x}x}L}L}L}+|+|y}y}y}y}z}z}z}M}M}M}N}N}N}O}O}O}O}P}P}P}A}A}A}A}B}B}B}@|#|#|Q}#|Q}Q}Q}m}m}m}m}6}$|$|$|C}C}C}C}R}R}R}R}o}o}S}S}D}D}D}%|T}T}T}9}9}U}U}p}p}p}q}q}q}q}E}E}E}E}E}F}F}a}a}G}G}G}b}b}V}c}c}c}&|&|. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . W}W}W}X}X}X}X}Y}Y}Y}Y}Y}H}H}H}H}s}s}s}s}s}*|t}*|*|Z}Z}Z}Z}Z}I}I}I}I}=|=|J}`}`}`}`}`} | | | |.|.|w}w}K}K}K}-|-|j}j}j}x}x}x}L}L}L}L}+|+|;|;|;|>|>|z}z}M}M}M}N}N}N}O}O}O}P}P}P}P},|'|'|'|@|@|@|#|#|#|#|Q}Q}Q}m}m}m})|$|$|$|$|C}C}!|!|R}R}R}R}S}S}S}S}D}D}%|%|T}T}T}T}U}U}U}p}p}~|~|q}q}{|{|E}E}E}]|]|F}F}G}G}G}G}G}V}V}V}c}&|&|&|. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . W}W}W}X}X}X}X}^|Y}Y}^|Y}/|/|/|/|s}(|(|(|(|*|*|*|*|Z}Z}Z}_|_|=|=|=|=|=|=|=|`}`}`}:|:|:| | |.|.|<|<|w}K}K}-|-|-|[|[|x}x}x}x}L}L}+|+|+|+|;|;|;|>|>|}|}|}|}|||||||1|1|1|1|,|,|,|,|'|'|'|@|@|@|@|#|#|#|Q}Q}Q}2|)|)|)|)|)|$|$|3|!|!|!|!|R}4|4|4|S}S}S}%|%|%|%|%|T}T}5|5|U}U}U}~|~|~|~|{|{|{|{|E}]|]|F}F}6|6|G}G}G}7|7|V}V}8|&|&|. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9|W}W}0|0|0|0|^|^|^|^|^|/|/|/|/|(|(|(|(|(|a|*|a|*|_|_|_|_|_|=|=|=|=|=|b|=|`}:|:|:|c|c| |.|.|.|<|<|<|K}-|-|-|-|[|[|d|d|x}L}L}L}+|+|+|;|;|;|>|>|>|}|}|}|}|||||||1|1|1|1|,|,|,|'|'|'|@|@|@|@|#|#|#|2|2|2|2|2|)|)|)|)|3|3|3|!|!|!|!|4|4|4|4|4|S}e|e|%|%|%|%|%|5|5|5|U}U}f|f|~|~|g|g|{|{|{|h|]|]|]|6|6|6|6|G}7|7|7|V}8|8|8|. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9|9|0|0|0|0|0|^|^|^|i|^|/|j|/|j|(|k|k|k|k|a|a|a|a|a|_|_|l|_|l|=|b|b|b|b|b|b|:|:|:|c|c|c|.|<|<|<|m|m|m|n|-|-|-|[|[|d|d|d|o|o|+|+|+|+|;|;|>|>|>|}|}|}|}|||||||1|1|1|1|,|,|,|,|'|'|'|@|@|p|p|q|q|q|q|2|2|2|2|r|r|r|r|3|3|3|!|s|s|s|4|4|4|t|e|e|e|e|%|%|u|u|5|5|5|v|f|f|f|f|g|g|g|g|{|h|]|]|]|w|w|6|6|6|x|7|7|7|V}8|8|. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9|y|0|z|z|0|i|i|i|i|i|i|j|j|j|j|j|k|k|k|k|a|a|A|a|A|_|l|l|l|l|b|b|b|b|b|b|B|C|:|c|c|c|D|D|<|<|<|m|m|m|n|n|E|[|[|d|d|o|o|o|o|F|F|G|G|G|;|>|>|>|}|}|}|}|||||||1|1|1|1|,|,|H|I|I|I|I|p|p|p|p|q|q|q|2|J|J|J|r|r|r|r|3|3|K|s|s|s|s|4|t|t|t|t|e|e|e|%|u|u|u|5|5|v|v|f|f|f|L|L|g|g|M|M|h|h|]|w|w|w|w|6|6|x|7|7|7|N|8|. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . y|y|z|z|z|z|i|i|i|i|i|i|j|O|j|j|j|P|k|P|P|A|A|A|A|A|l|l|l|l|Q|Q|B|B|B|B|B|C|C|C|c|c|D|D|R|R|R|m|m|m|n|n|n|E|E|E|d|d|o|o|o|F|F|F|G|G|G|G|S|S|T|T|T|T|U|U|U|V|V|V|V|H|H|H|H|I|I|I|p|p|p|p|q|W|W|W|J|J|J|J|r|r|X|X|K|K|K|K|s|Y|Y|t|t|t|t|t|e|Z|Z|u|u|u|5|v|v|v|f|f|L|L|L|L|M|M|h|h|h|`|w|w|w|w|w|x|x|7|7|N|N|. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . y|y|y|z|z| 1z|i|.1i|.1.1.1O|O|O|O|O|P|P|P|P|+1A|A|A|@1@1Q|Q|Q|Q|Q|B|B|B|B|C|C|#1#1#1D|D|D|R|R|R|$1m|n|n|n|E|E|E|%1%1%1&1o|o|F|F|G|G|G|G|S|S|S|S|T|T|T|U|U|V|V|V|V|H|H|H|H|H|I|I|p|*1=1=1W|W|W|W|J|J|J|J|X|X|X|X|K|K|K|-1Y|Y|Y|t|t|t|t|t|Z|Z|Z|Z|u|;1;1v|v|v|>1L|L|L|L|M|M|M|M|h|`|`|`|w|w|w|,1x|x|x|N|N|N|. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . y|'1y| 1 1 1 1.1.1.1.1.1.1O|O|O|O|O|P|+1P|+1+1@1@1@1@1@1Q|Q|Q|)1Q|)1B|B|C|C|C|#1#1#1!1D|D|R|$1$1$1~1~1n|n|E|E|E|%1%1&1&1&1{1{1{1]1G|G|G|S|S|T|T|T|T|U|U|U|U|V|V|V|H|^1^1^1*1*1*1*1=1=1W|=1W|W|J|/1/1/1X|X|X|X|X|-1-1-1-1Y|Y|Y|t|t|(1(1(1Z|Z|Z|;1;1;1;1v|>1>1L|L|L|_1M|M|M|M|:1`|`|`|`|w|,1x|x|x|<1<1N|. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . '1'1'1 1 1 1 1 1[1.1.1[1.1[1O|}1}1}1+1+1+1+1+1@1|1@1|1@1|1)1)1)1)11111B|C|C|C|#1#1#1!1!1R|R|$1$1$1~1~1~12121%1%1%1%1&1&1&1{1{1{1]1]1]131313131414151515151616161^1^1^1^1*1*1*1*1=1=1=17181818181/1/1/1/1X|9191-1-1-1-1Y|Y|Y|01(1(1(1(1Z|a1a1a1;1;1;1>1>1>1>1L|_1_1_1M|:1:1:1`|`|`|b1b1,1,1x|<1<1<1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . '1'1c1 1d1d1d1d1[1[1[1[1[1[1}1}1}1}1}1e1+1e1+1e1|1|1|1|1|1)1)1)1)1111111C|C|#1#1#1!1!1f1f1f1$1$1$1~1~1~12121g1g1g1&1&1&1{1{1{1]1]1]1]13131314141415151516161616161^1^1*1*1*1h17171717181818181/1/1i1i1919191-1-1-1-1-1010101(1(1(1(1j1a1a1a1;1k1k1k1>1>1l1l1_1_1_1m1:1:1:1:1`|b1b1,1,1,1n1<1<1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . c1c1c1d1d1d1d1d1[1[1[1o1[1o1}1p1p1p1p1e1e1e1e1e1|1q1q1q1q1q1)1)1111111r1r1#1#1!1!1!1f1f1f1s1s1s1~1~1~12121g1g1g1t1t1t1t1u1u1]1]1]1]131313131414151515151616161v1w1w1w1w1h1h171717171818181x1x1i1i1i1i1919191-1-1y1y101010101(1j1j1j1j1a1a1z1k1k1k1k1l1l1l1l1_1m1m1m1:1:1:1A1b1b1,1,1n1n1n1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . c1c1c1d1d1B1d1B1o1o1o1o1o1o1p1p1p1C1p1e1e1D1D1D1D1q1q1q1q1E1E11111r1r1r1F1F1#1!1!1!1f1f1s1s1s1G1G1G1212121g1g1g1t1t1t1t1u1u1H1H1H1I1I1I1I1J1J1J1J1K1K1v1v1v1v1w1w1w1w1h1h1h1h17171L1x1x1x1x1i1i1i1i1919191y1y1y1y1y10101M1j1j1j1j1j1z1z1z1z1k1k1N1N1l1l1l1O1m1m1m1m1:1A1A1A1b1b1n1n1n1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . c1P1P1B1B1B1B1B1o1o1o1o1o1o1Q1p1C1C1C1C1D1D1D1R1D1R1q1q1E1E1S1S111r1r1r1F1F1F1!1!1f1f1f1s1s1s1G1G1T1T1T1T1U1g1g1t1t1t1u1u1H1H1H1H1I1I1I1J1J1J1J1K1K1K1K1v1v1v1v1w1w1h1V1V1V1L1L1L1L1x1x1x1i1i1i1i1i1W1W1W1W1y1y1y1M1M1M1M1j1j1X1X1X1z1z1z1N1N1N1N1l1O1O1O1m1m1m1m1Y1A1A1b1b1Z1Z1n1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P1P1`1B1B1 2B1Q1Q1Q1Q1Q1Q1Q1C1C1C1.2C1.2D1R1R1R1+2q1q1E1E1S1S1S1r1r1F1F1F1@2@2@2f1f1f1s1G1G1G1G1T1T1T1U1U1U1#2#2#2#2u1u1u1H1H1I1I1I1I1J1J1J1K1K1K1K1v1$2$2$2%2%2V1V1V1V1V1L1L1L1L1x1x1x1i1&2&2&2W1W1W1W1W1*2*2*2M1M1M1j1X1X1X1X1z1=2=2=2N1N1N1-2O1O1O1O1m1m1Y1Y1A1A1;2Z1Z1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P1`1`1 2 2 2 2 2Q1Q1Q1Q1Q1>2>2.2.2.2.2.2R1R1R1R1+2+2E1E1E1S1S1,2,2F1F1F1@2@2@2'2'2'2s1s1G1G1G1T1T1T1U1U1U1U1#2#2#2)2)2)2!2!2!2!2~2~2{2{2{2{2]2]2]2$2$2$2$2%2%2%2%2V1V1V1L1L1L1L1x1^2^2&2&2&2&2W1W1W1/2/2*2*2*2M1M1(2(2X1X1X1X1_2=2=2=2=2-2-2-2-2O1O1O1Y1Y1Y1Y1Y1;2;2Z1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . `1`1`1 2 2:2 2 2>2>2>2Q1>2>2>2.2.2.2.2<2<2R1R1+2+2[2[2E1S1S1,2,2,2}2}2F1@2@2@2'2'2|2|2|2|2G1G1T1T1T1U1U1U1#2#2#2)2)2!2!2!2!2~2~2~2~2~2{2{2]2]2]2]2$2$2$2$2%2%2%2V1V1V1V1121212^2^2^2^2^2&2&222/2/2/2/2/2*2*232(2(2(2X1X1_2_2_2_2=2=242-2-2-2-2O1O1Y1Y1Y1Y1Y1;2;2;2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . `15252 2:2:2:2:2>2>2>2>2>2>26262<2<2<2727272+2+2+2[28282S1S1,2,2,2}2929292'2'2'2|2|2|2020202a2a2T1U1U1U1U1#2#2)2)2)2)2!2!2!2!2~2~2~2{2{2]2]2]2]2$2$2$2$2$2%2%2b2b2b2b2b2121212^2^2^2c22222222222/2/2/2323232(2(2(2d2_2_2_2_2_242424242-2-2-2-2e2e2Y1Y1Y1f2f2;2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52525252:2:2g2:2g2>2626262626262<2<2727272h2h2[2[2[282828282,2}2}2}2}2929292i2|2|2|202020202a2a2a2j2j2j2k2k2#2)2)2)2!2!2!2!2~2~2~2{2{2{2{2]2]2l2m2m2m2m2n2n2n2n2b2b2b2121212o2c2c2c22222222222p2p2p2p2323232d2d2d2_2_2_2_2q2q242424242-2r2r2e2e2e2f2f2f2f2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52s2s2g2g2g2g2g2626262t262t2t2u2<2727272h2h2v2[2[28282w2w2w2}2}2}29292i2i2i2x2x2|2020202a2a2a2j2j2j2k2k2k2y2y2y2y2z2z2z2A2A2A2A2B2B2B2l2l2l2l2m2m2m2n2n2n2n2b2b2b2o2o2o2o2o2c2c2c22222C2C2C2p2p2p232D2D2d2d2d2d2_2q2q2q2q2q2424242r2r2e2e2e2E2E2f2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . s2s2s2g2g2g2F2g2F262t2t2t2t2u2u2u27272h2h2v2v2v28282w2w2w2G2G2G2929292i2i2i2i2x2H2H2H2H2a2a2a2j2j2j2k2k2k2y2y2y2z2z2z2z2A2A2A2B2B2B2l2l2l2l2m2m2m2m2m2I2I2J2J2J2J2J2o2o2o2c2c2K2C2C2C2C2C2p2p2L2D2D2D2D2d2d2M2q2q2q2q2q2q242N2N2N2r2r2e2E2E2E2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . s2s2O2O2F2F2F2F2F2F2t2t2t2t2u2u2P2P2h2h2h2v2v2Q2Q282w2w2G2G2G2R2R2R2i2i2i2x2x2x2H2H2H2S2S2S2T2T2T2k2k2k2y2y2y2y2z2z2z2A2A2A2B2B2B2B2l2l2U2V2V2V2V2V2I2I2I2J2J2J2J2o2o2W2K2K2K2K2C2C2C2C2L2L2L2L2D2D2D2M2M2M2M2q2q2q2q2X2X2N2N2N2N2Y2Y2E2E2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . O2O2O2F2F2F2Z2F2Z2t2t2u2u2P2P2P2P2`2h2v2v2v2Q2Q2 3 3w2G2G2G2R2R2.3.3.3.3x2x2H2H2H2S2S2S2S2S2T2+3+3+3+3@3@3@3#3#3#3$3$3$3$3$3%3%3U2U2U2U2U2V2V2V2I2I2I2J2J2&3&3&3W2W2W2K2K2K2C2*3=3=3=3L2L2L2D2-3-3-3M2M2M2M2q2q2X2X2X2N2N2N2Y2Y2Y2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . O2O2;3;3Z2Z2Z2Z2>3>3u2u2u2u2P2`2`2`2`2v2v2Q2Q2Q2 3 3,3,3G2R2R2R2.3.3.3'3'3'3)3)3H2S2S2S2T2T2T2+3+3+3@3@3@3#3#3#3#3#3$3$3$3%3%3%3U2U2U2U2V2V2V2!3!3!3!3!3&3&3&3W2W2W2K2*3*3*3*3=3=3=3L2L2~3~3-3-3-3M2M2M2M2X2X2X2X2X2X2{3{3Y2Y2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ;3]3;3]3Z2Z2Z2>3>3^3u2P2P2P2P2`2`2/3/3/3Q2Q2 3 3 3,3,3,3(3R2.3.3.3'3'3'3)3)3)3_3_3_3:3:3T2+3+3+3@3@3@3@3@3#3#3#3$3$3$3%3%3%3%3<3<3<3[3[3[3!3[3!3!3!3&3&3&3W2}3}3*3*3*3*3*3=3=3|3|3~3~3~3-3-3-3-3M2131313X2X2X2232323{3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ]3]3]3]3Z2Z2>3>3>3^3^3P2P2`2`2`2/3/3/33333 3 3 3,3,3,3(3(3(34343.3'3'3'3)3)3)3)3_3_3_3:3:3:353535363636373737383838383939393<3<3<3[3[3[3[3[3!3!3!3030303}303}3}3}3*3*3*3a3|3|3|3~3~3~3~3-3-3b313131313X2X223232323. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ]3]3c3c3>3>3>3^3^3d3d3P2P2`2/3/3/3/33333e3e3 3,3,3,3(3(3434343f3f3f3)3)3)3_3_3_3_3:3:3:353535363636373737373838383939393<3<3<3<3<3[3[3g3h3h3h30303030303}3}3}3i3a3a3a3|3|3|3|3~3~3~3b3b3b3b3131313j3232323. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ]3c3c3k3>3^3^3^3d3d3l3`2`2`2/3/3333333e3e3m3m3,3(3(3(343434343f3n3n3n3n3n3o3o3:3:3:353535353636363737373838383939393p3p3q3q3q3g3g3g3h3h3h3h3h3030303r3i3i3i3a3a3a3|3|3|3|3~3s3t3t3t3b3b313u3j3j323. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . k3k3k3k3^3^3d3d3d3l3l3v3/3/3/33333e3e3e3m3m3w3w3w3434343f3f3f3f3n3n3n3o3o3o3x3x3x3y3y3y3z3z3z3A3A3A3B3B3B3B3B3p3p3p3q3q3q3g3g3g3g3g3h3h3C3C3r3r3r3i3i3i3a3a3a3a3|3s3s3s3s3t3t3t3t3u3u3u3u3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . k3k3D3D3d3d3d3l3l3l3v3v3v3333333e3e3m3m3m3w3w3E3E3E3F3F3f3n3n3n3n3o3o3o3x3x3x3y3y3y3z3z3z3A3A3A3A3A3B3B3B3p3p3p3q3q3q3q3g3G3G3G3C3C3C3C3r3r3r3i3i3i3i3a3H3H3s3s3s3s3s3s3t3I3I3u3u3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D3D3D3J3J3l3l3l3v3v3K3K3K3K3e3e3e3m3m3w3w3w3E3E3E3E3F3L3L3L3L3L3M3o3x3x3x3x3x3y3y3y3z3z3z3A3A3A3B3B3B3p3N3N3O3O3O3O3G3G3G3G3G3C3C3C3r3r3r3i3i3P3P3H3H3H3H3s3s3s3Q3Q3I3I3I3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . J3J3J3J3R3l3v3v3v3v3K3S3S3S3S3m3m3m3w3w3E3E3E3F3F3F3F3L3L3L3M3M3M3T3T3T3U3U3U3U3V3V3V3W3W3W3X3X3X3N3X3N3N3N3O3O3O3O3G3G3G3C3C3C3r3r3Y3Y3P3P3P3H3H3H3H3s3Z3Q3Q3Q3Q3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . J3J3R3R3R3R3v3K3K3K3K3S3S3`3`3`3 4w3w3w3E3E3F3F3F3L3L3L3L3M3M3T3T3T3U3U3U3U3V3V3V3W3W3W3W3W3X3X3X3N3N3N3O3O3O3O3G3G3G3C3.4.4.4Y3Y3Y3Y3Y3P3P3P3Z3Z3Z3Z3Q3Q3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . R3R3+4+4+4+4K3K3S3S3S3`3`3`3 4 4@4@4@4E3F3F3F3L3L3L3M3M3M3M3T3T3T3U3U3U3V3V3V3V3W3W3W3X3X3X3N3N3N3N3O3O3#4$4$4$4.4$4.4.4.4.4Y3Y3Y3%4%4%4%4Z3Z3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . +4+4+4&4&4&4S3S3`3`3`3 4 4 4 4@4@4*4*4*4=4=4=4M3M3M3M3T3T3T3U3U3U3V3V3V3V3W3W3W3X3X3-4;4;4;4;4#4#4#4$4$4$4$4$4.4.4.4.4>4>4>4%4%4%4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . &4&4&4,4,4'4'4`3 4 4 4 4@4@4@4*4*4*4*4=4)4)4)4)4!4!4!4~4~4~4{4{4{4{4]4]4]4-4-4-4-4-4;4;4;4;4#4#4#4$4$4$4^4/4/4/4>4>4>4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ,4,4,4'4'4'4'4(4(4@4@4@4*4*4*4=4=4=4=4)4)4)4!4!4!4!4~4~4~4{4{4]4]4]4]4]4-4-4-4;4;4;4;4#4_4_4^4^4^4^4/4/4/4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . '4'4'4(4(4:4:4:4<4<4<4[4[4=4=4)4)4)4!4!4!4!4~4~4~4{4{4{4]4]4]4]4}4}4}4|4|4|4|4_4_4_4^4^4^4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (4:4:4:4<4<4<4<4[4[41414142424242434343444444444545454}4}4}4}4|4|4|4_4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <4[4[4[414141414242424343444444444545454}4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "}; xforms-1.2.4/lib/bitmaps/plaid.xpm0000644000175000017500000000247511665175617014030 00000000000000/* XPM */ static char * plaid[] = { /* plaid pixmap * width height ncolors chars_per_pixel */ "22 22 4 2 ", /* colors */ " c red m white s light_color ", "Y c green m black s lines_in_mix ", "+ c yellow m white s lines_in_dark ", "x m black s dark_color ", /* pixels */ "x x x x x x x x x x x x + x x x x x ", " x x x x x x x x x x x x x x x x ", "x x x x x x x x x x x x + x x x x x ", " x x x x x x x x x x x x x x x x ", "x x x x x x x x x x x x + x x x x x ", "Y Y Y Y Y x Y Y Y Y Y + x + x + x + x + x + ", "x x x x x x x x x x x x + x x x x x ", " x x x x x x x x x x x x x x x x ", "x x x x x x x x x x x x + x x x x x ", " x x x x x x x x x x x x x x x x ", "x x x x x x x x x x x x + x x x x x ", " x x x x Y x x x ", " x x x Y x x ", " x x x x Y x x x ", " x x x Y x x ", " x x x x Y x x x ", "x x x x x x x x x x x x x x x x x x x x x x ", " x x x x Y x x x ", " x x x Y x x ", " x x x x Y x x x ", " x x x Y x x ", " x x x x Y x x x " } ; xforms-1.2.4/lib/bitmaps/warn.xbm0000644000175000017500000000043511665175617013662 00000000000000#define warn_width 16 #define warn_height 16 static unsigned char warn_bits[] = { 0x80, 0x03, 0xc0, 0x07, 0xc0, 0x07, 0xc0, 0x07, 0xc0, 0x07, 0xc0, 0x07, 0x80, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x03, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x80, 0x03, 0x80, 0x03, 0x80, 0x03 }; xforms-1.2.4/lib/bitmaps/q.xbm0000644000175000017500000000034411665175617013152 00000000000000#define q_width 12 #define q_height 12 static unsigned char q_bits[] = { 0xf8, 0x01, 0xfc, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x84, 0x03, 0xf0, 0x01, 0xf0, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x70, 0x00, 0x70, 0x00 }; xforms-1.2.4/lib/bitmaps/Makefile.am0000664000175000017500000000013512340166201014212 00000000000000include $(top_srcdir)/config/common.am EXTRA_DIST = plaid.xpm q.xbm warn.xbm colorwheel.xpm xforms-1.2.4/lib/dirent_vms.h0000644000175000017500000000376611665175616013100 00000000000000/* * * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /* ** Header file for VMS readdir() routines. ** Written by Rich Salz, in August, 1990. ** This code has no copyright. ** ** Feb'95 -- eliminate reliance on ; safeguard multiple ** inclusion; fully prototype the routines provided. [pr] */ #ifndef DIRENT_H #define DIRENT_H /* Data structure returned by READDIR(). */ struct dirent { char d_name[100]; /* File name */ int vms_verscount; /* Number of versions */ short vms_versions[64]; /* Version numbers */ }; /* Handle returned by opendir(), used by the other routines. You * are not supposed to care what's inside this structure. */ typedef struct _dirdesc { unsigned long context; int count; int vms_wantversions; char *pattern; struct dirent entry; /* pattern string descriptor */ struct { unsigned short len, mbz; char *adr; } pat; } DIR; #define rewinddir(dirp) seekdir((dirp), 0L) extern DIR *opendir(const char *); extern struct dirent *readdir(DIR *); extern long telldir(DIR *); extern void seekdir(DIR *,long); extern void closedir(DIR *); extern int vmsreaddirversions(DIR *,int); #endif /* DIRENT_H */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/objects.c0000664000175000017500000030073412353623325012335 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file objects.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/flvasprintf.h" #define TRANSLATE_Y( obj, form ) ( form->h - obj->h - obj->y ) extern FL_FORM * fli_fast_free_object; /* defined in forms.c */ extern FL_OBJECT * fli_handled_obj; /* defined in events.c */ extern FL_OBJECT * fli_handled_parent; /* defined in events.c */ static void redraw( FL_FORM *, int ); static void lose_focus( FL_OBJECT * ); static void get_object_rect( const FL_OBJECT * obj, XRectangle * rect, int extra ); static XRectangle * get_label_rect( const FL_OBJECT * obj, XRectangle * rect ); static int objects_intersect( const FL_OBJECT *, const FL_OBJECT * ); static void mark_object_for_redraw( FL_OBJECT * ); static int object_is_under( const FL_OBJECT * ); static void checked_hide_tooltip( FL_OBJECT *, XEvent * ); static int prep_recalc( FL_FORM * form, FL_OBJECT * start_obj ); static void finish_recalc( FL_FORM * form, FL_OBJECT * start_obj ); static FL_OBJECT *refocus; static void **tmp_vdata = NULL; static FL_RECT *tmp_rects = NULL; #define IS_BUTTON_CLASS( i ) ( i == FL_BUTTON \ || i == FL_ROUNDBUTTON \ || i == FL_ROUND3DBUTTON \ || i == FL_LIGHTBUTTON \ || i == FL_CHECKBUTTON \ || i == FL_BITMAPBUTTON \ || i == FL_PIXMAPBUTTON ) /* Macro for checking of a FL_FORM pointer points to a form that should be actually drawn to */ #define FORM_IS_UPDATABLE( form ) ( form \ && ( form )->visible == FL_VISIBLE \ && ( form )->frozen == 0 ) /* Macro for checking if a label is to be considered to be "outside" of its object for redrawing purposes. When a label is outside of its object and we change the position or size of the object, the text, or style or font size of the label then other objects under the label also need to be redrawn. In priciple calling fl_is_outside_lalign() should do the job but there are some semi-transparent objects which we need to treat as if their labels are always "outside" even if they aren't marked that way. */ #define OL( o ) ( fl_is_outside_lalign( ( o )->align ) \ || ( o )->objclass == FL_ROUNDBUTTON \ || ( o )->objclass == FL_ROUND3DBUTTON \ || ( o )->objclass == FL_CHECKBUTTON ) #define IN_REDRAW 1 #define HIDE_WHILE_FROZEN 2 /*************************************** * Returns the "background object" of a form or NULL if there isn't one * (this is either the first object of a form or, if that object has the * box type FL_NO_BOX, the next one). ***************************************/ static FL_OBJECT * bg_object( FL_FORM * form ) { if ( ! form || ! form->first ) return NULL; return form->first->boxtype == FL_NO_BOX ? form->first->next : form->first; } /*************************************** * Creates an object - NOT MEANT FOR USE BY USERS OF THE LIBRARY! ***************************************/ FL_OBJECT * fl_make_object( int objclass, int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label, FL_HANDLEPTR handle ) { FL_OBJECT *obj; #ifdef FL_WIN32 int def = -2; #else int def = FL_BOUND_WIDTH; #endif obj = fl_calloc( 1, sizeof *obj ); obj->objclass = objclass; obj->type = type; obj->resize = FL_RESIZE_ALL; obj->nwgravity = obj->segravity = FL_NoGravity; obj->boxtype = FL_NO_BOX; obj->bw = ( fli_cntl.borderWidth && FL_abs( fli_cntl.borderWidth ) <= FL_MAX_BW ) ? fli_cntl.borderWidth : def; obj->x = x; obj->y = y; obj->w = w; obj->h = h; obj->u_vdata = NULL; obj->u_cdata = NULL; switch ( fli_cntl.coordUnit ) { case FL_COORD_PIXEL : break; case FL_COORD_MM : fli_scale_object( obj, fl_dpi / 25.4, fl_dpi / 25.4 ); break; case FL_COORD_POINT : fli_scale_object( obj, fl_dpi / 72.0, fl_dpi / 72.0 ); break; case FL_COORD_centiPOINT : fli_scale_object( obj, fl_dpi / 7200.0, fl_dpi / 7200.0 ); break; case FL_COORD_centiMM : fli_scale_object( obj, fl_dpi / 2540.0, fl_dpi / 2540.0 ); break; default: M_err( "fl_make_object", "Unknown unit: %d. Reset", fli_cntl.coordUnit ); fli_cntl.coordUnit = FL_COORD_PIXEL; } obj->wantkey = FL_KEY_NORMAL; obj->flpixmap = NULL; obj->label = fl_strdup( label ? label : "" ); obj->handle = handle; obj->align = FL_ALIGN_CENTER; obj->lcol = FL_BLACK; obj->col1 = FL_COL1; obj->col2 = FL_MCOL; if ( IS_BUTTON_CLASS( objclass ) && fli_cntl.buttonFontSize ) obj->lsize = fli_cntl.buttonFontSize; else if ( objclass == FL_MENU && fli_cntl.menuFontSize ) obj->lsize = fli_cntl.menuFontSize; else if ( ( objclass == FL_CHOICE || objclass == FL_SELECT ) && fli_cntl.choiceFontSize ) obj->lsize = fli_cntl.choiceFontSize; else if ( objclass == FL_INPUT && fli_cntl.inputFontSize ) obj->lsize = fli_cntl.inputFontSize; else if ( objclass == FL_SLIDER && fli_cntl.sliderFontSize ) obj->lsize = fli_cntl.sliderFontSize; #if 0 else if ( objclass == FL_BROWSER && fli_cntl.browserFontSize ) obj->lsize = fli_cntl.browserFontSize; #endif else if ( fli_cntl.labelFontSize ) obj->lsize = fli_cntl.labelFontSize; else obj->lsize = FL_DEFAULT_SIZE; obj->lstyle = FL_NORMAL_STYLE; obj->shortcut = fl_calloc( 1, sizeof( long ) ); *obj->shortcut = 0; obj->active = 1; obj->visible = FL_VISIBLE; obj->object_callback = NULL; obj->spec = NULL; obj->next = obj->prev = NULL; obj->form = NULL; obj->dbl_background = FL_COL1; obj->parent = NULL; obj->child = NULL; obj->nc = NULL; obj->group_id = 0; obj->set_return = NULL; obj->how_return = FL_RETURN_ALWAYS; obj->returned = 0; obj->is_under = 0; return obj; } /*************************************** * Adds an object to a form ***************************************/ void fl_add_object( FL_FORM * form, FL_OBJECT * obj ) { /* Checking for correct arguments. */ if ( ! obj ) { M_err( "fl_add_object", "NULL object" ); return; } if ( ! form ) { M_err( "fl_add_object", "NULL form for '%s'", fli_object_class_name( obj ) ); return; } if ( obj->form ) { M_err( "fl_add_object", "Object already belongs to a form" ); return; } if ( obj->objclass == FL_BEGIN_GROUP || obj->objclass == FL_END_GROUP ) { M_err( "fl_add_object", "Can't add an pseudo-object that marks the " "start or end of a group" ); return; } obj->prev = obj->next = NULL; obj->form = form; if ( obj->automatic ) { form->num_auto_objects++; fli_recount_auto_objects( ); } if ( fli_inverted_y ) obj->y = TRANSLATE_Y( obj, form ); obj->fl1 = obj->x; obj->fr1 = form->w_hr - obj->fl1; obj->ft1 = obj->y; obj->fb1 = form->h_hr - obj->ft1; obj->fl2 = obj->x + obj->w; obj->fr2 = form->w - obj->fl2; obj->ft2 = obj->y + obj->h; obj->fb2 = form->h - obj->ft2; /* If adding to a group, set objects group ID, then find the end of the group or the end of the object list of this form */ if ( fli_current_group ) { FL_OBJECT *end = fli_current_group; obj->group_id = fli_current_group->group_id; while ( end && end->objclass != FL_END_GROUP ) end = end->next; /* If 'end' exists must've opened the group with fl_addto_group */ if ( end ) { end->prev->next = obj; obj->prev = end->prev; obj->next = end; end->prev = obj; if ( obj->child ) { FL_OBJECT * tmp; for ( tmp = obj->child; tmp; tmp = tmp->nc ) fl_add_object( form, tmp ); } if ( fl_current_form != form && FORM_IS_UPDATABLE( obj->form ) && ! obj->parent ) { fli_recalc_intersections( form ); fl_redraw_object( obj ); } return; } } if ( ! form->first ) form->first = form->last = obj; else { obj->prev = form->last; form->last->next = obj; form->last = obj; } if ( obj->input && obj->active && ! form->focusobj ) fl_set_focus_object( form, obj ); /* If the object has child objects also add them to the form */ if ( obj->child ) fli_add_composite( obj ); if ( obj->form->first && obj->form->first != obj ) { FL_COLOR bkcol = obj->form->first->col1; if ( obj->form->first->boxtype == FL_NO_BOX ) { bkcol = obj->form->first->next->col1; if ( obj == obj->form->first->next ) obj->col1 = obj->form->first->col1; } obj->dbl_background = bkcol; } /* It only make sense to recalculate intersections between objects and to redraw the form with the new object when we're not within a fl_bgn_form()/fl_end_form() pair and also only for objects that aren't child objects */ if ( fl_current_form != form && FORM_IS_UPDATABLE( obj->form ) && ! obj->parent ) { fli_recalc_intersections( form ); fl_redraw_object( obj ); } } /*************************************** * Inserts object 'obj' in front of the object 'before' ***************************************/ void fli_insert_object( FL_OBJECT * obj, FL_OBJECT * before ) { FL_FORM * form; /* Checking for correct arguments */ if ( ! obj || ! before ) { M_err( "fli_insert_object", "NULL object" ); return; } if ( ! before->form ) { M_err( "fli_insert_object", "Trying to insert object into NULL form" ); return; } form = before->form; obj->next = before; if ( before->type != FL_BEGIN_GROUP ) obj->group_id = before->group_id; if ( before == form->first ) { form->first = obj; obj->prev = NULL; } else { obj->prev = before->prev; obj->prev->next = obj; } obj->fl1 = obj->x; obj->fr1 = form->w_hr - obj->fl1; obj->ft1 = obj->y; obj->fb1 = form->h_hr - obj->ft1; obj->fl2 = obj->x + obj->w; obj->fr2 = form->w - obj->fl2; obj->ft2 = obj->y + obj->h; obj->fb2 = form->h - obj->ft2; before->prev = obj; obj->form = form; if ( obj->automatic ) { form->num_auto_objects++; fli_recount_auto_objects( ); } if ( fli_inverted_y ) obj->y = TRANSLATE_Y( obj, form ); if ( obj->input && obj->active && ! form->focusobj ) fl_set_focus_object( form, obj ); /* If the object has child objects also insert them into the form */ if ( obj->child ) fli_insert_composite( obj, before ); if ( fl_current_form != form && FORM_IS_UPDATABLE( form ) && ! obj->parent ) { fli_recalc_intersections( form ); fl_redraw_object( obj ); } } /*************************************** * Unlinks an object from its form ***************************************/ void fl_delete_object( FL_OBJECT * obj ) { FL_FORM * form; if ( ! obj ) { M_err( "fl_delete_object", "NULL object" ); return; } if ( ! obj->form ) { M_err( "fl_delete_object", "Delete '%s' from NULL form", ( obj->label && *obj->label ) ? obj->label : "object" ); return; } checked_hide_tooltip( obj, NULL ); /* If object is the pseudo-object starting a group delete the complete group */ if ( obj->objclass == FL_BEGIN_GROUP ) { FL_OBJECT *o; fl_freeze_form( obj->form ); for ( o = obj->next; o; o = o->next ) { /* Hack for fdesign to allow deletion of the FL_BEGIN_GROUP and FL_END_GROUP objects while keeping the objects in the group if their group ID was unset */ if ( o->group_id != obj->group_id || ( o->parent && o->parent->group_id != obj->group_id ) ) continue; fl_delete_object( o ); if ( o->objclass == FL_END_GROUP ) break; } fl_unfreeze_form( obj->form ); } /* Avoid deleting an object that represents the end of a group if the group isn't empty */ if ( obj->objclass == FL_END_GROUP ) { FL_OBJECT *o; for ( o = obj->form->first; o && o != obj; o = o->next ) { /* Hack for fdesign to allow deletion of the FL_BEGIN_GROUP and FL_END_GROUP objects with the objects in the group (if there group ID was unset) */ if ( o->group_id != obj->group_id || ( o->parent && o->parent->group_id != obj->group_id ) ) continue; if ( o->group_id == obj->group_id && o->objclass != FL_BEGIN_GROUP ) break; } if ( o != obj ) { M_err( "fl_delete_object", "Can't delete end of group object " "while the group still has members" ); return; } } /* If this object has childs also unlink them */ if ( obj->child ) fli_delete_composite( obj ); form = obj->form; if ( obj->automatic ) { form->num_auto_objects--; fli_recount_auto_objects( ); } lose_focus( obj ); if ( obj == fli_int.pushobj ) fli_int.pushobj = NULL; if ( obj == fli_int.mouseobj ) fli_int.mouseobj = NULL; #ifdef DELAYED_ACTION fli_object_qflush_object( obj ); #endif /* Object also loses its group membership */ if ( obj->objclass != FL_BEGIN_GROUP && obj->objclass != FL_END_GROUP ) obj->group_id = 0; obj->form = NULL; if ( obj->prev ) obj->prev->next = obj->next; else form->first = obj->next; if ( obj->next ) obj->next->prev = obj->prev; else form->last = obj->prev; /* Redraw the form (except when the complete form is being deleted, in that case 'fli_fast_free_object' is set to the form being deleted) */ if ( fli_fast_free_object != form && ! obj->parent ) { fli_recalc_intersections( form ); redraw( form, 1 ); } } /*************************************** * Frees the memory used by an object ***************************************/ void fl_free_object( FL_OBJECT * obj ) { /* Check whether it's ok to free it */ if ( ! obj ) { M_err( "fl_free_object", "NULL object" ); return; } /* If the object is the pseudo-object starting a group free the complete group */ if ( obj->objclass == FL_BEGIN_GROUP ) { FL_OBJECT *o, *on; for ( o = obj->next; o && o->objclass != FL_END_GROUP; o = on ) { on = o->next; /* Skip child objects, they get removed automatically when the parent gets deleted */ while ( on->parent ) on = on->next; fl_free_object( o ); } if ( o ) fl_free_object( o ); } /* Avoid deleting an object that represents the end of a group if the group isn't empty */ if ( obj->objclass == FL_END_GROUP ) { FL_OBJECT *o; for ( o = obj->form->first; o && o != obj; o = o->next ) if ( o->group_id == obj->group_id && o->objclass != FL_BEGIN_GROUP ) break; if ( o != obj ) { M_err( "fl_free_object", "Can't free end of group object " "while the group still has members" ); return; } } /* If the object hasn't yet been unlinked from its form do it know */ if ( obj->form ) fl_delete_object( obj ); /* If this is a parent object free its children first */ if ( obj->child ) fli_free_composite( obj ); /* If it's a child object remove it from the linked list of childs of the parent object */ if ( obj->parent ) { FL_OBJECT *o = obj->parent->child; if ( o == obj ) obj->parent->child = obj->nc; else { while ( o->nc != obj ) o = o->nc; o->nc = obj->nc; } } /* Make the object release all memory it may have allocated */ fli_handle_object( obj, FL_FREEMEM, 0, 0, 0, NULL, 0 ); /* Finally free all other memory we allocated for the object */ fli_safe_free( obj->label ); fli_safe_free( obj->tooltip ); fli_safe_free( obj->shortcut ); if ( obj->flpixmap ) { fli_free_flpixmap( obj->flpixmap ) ; fli_safe_free( obj->flpixmap ); } /* We might have arrived here due to a callback for the object we just deleted (or one of it's child objects). The following tests allow the routine that invoked the callback to check if that is the case and avoid further uses of the object/parent. */ if ( obj == fli_handled_obj ) fli_handled_obj = NULL; if ( obj == fli_handled_parent ) fli_handled_parent = NULL; fl_free( obj ); } /*----------------------------------------------------------------------- Setting/getting attributes. -----------------------------------------------------------------------*/ /*************************************** * Returns the object class of the object ***************************************/ int fl_get_object_objclass( FL_OBJECT * obj ) { if ( ! obj ) { M_err( "fl_get_object_objclass", "NULL object" ); return -1; } return obj->objclass; } /*************************************** * Returns the type of the object ***************************************/ int fl_get_object_type( FL_OBJECT * obj ) { if ( ! obj ) { M_err( "fl_get_object_type", "NULL object" ); return -1; } return obj->type; } /*************************************** * Sets the boxtype of the object ***************************************/ void fl_set_object_boxtype( FL_OBJECT * obj, int boxtype ) { int need_show = 0; if ( ! obj ) { M_err( "fl_set_object_boxtype", "NULL object" ); return; } if ( obj->boxtype == boxtype ) return; if ( obj->visible ) { need_show = 1; fl_hide_object( obj ); } obj->boxtype = boxtype; fli_handle_object( obj, FL_ATTRIB, 0, 0, 0, NULL, 0 ); if ( need_show ) fl_show_object( obj ); } /*************************************** * Returns the boxtype of the object ***************************************/ int fl_get_object_boxtype( FL_OBJECT * obj ) { if ( ! obj ) { M_err( "fl_get_object_boxtype", "NULL object" ); return -1; } return obj->boxtype; } /*************************************** * Sets the resize property of an object ***************************************/ void fl_set_object_resize( FL_OBJECT * obj, unsigned int what ) { if ( ! obj ) { M_err( "fl_set_object_resize", "NULL object" ); return; } obj->resize = what & FL_RESIZE_ALL; /* Check if thr object has childs, if so also change all of them */ if ( obj->child ) fli_set_composite_resize( obj, obj->resize ); /* Check if thr object is a group, if so also change all members */ if ( obj->objclass == FL_BEGIN_GROUP ) for ( obj = obj->next; obj && obj->objclass != FL_END_GROUP; obj = obj->next ) fl_set_object_resize( obj, what ); } /*************************************** * Returns the resize setting of an object ***************************************/ void fl_get_object_resize( FL_OBJECT * obj, unsigned int * resize ) { if ( ! obj ) { M_err( "fl_get_object_resize", "NULL object" ); return; } if ( resize ) *resize = obj->resize; } /*************************************** * Sets the gravity properties of an object ***************************************/ void fl_set_object_gravity( FL_OBJECT * obj, unsigned int nw, unsigned int se ) { if ( ! obj ) { M_err( "fl_set_object_gravity", "NULL object" ); return; } obj->nwgravity = nw; obj->segravity = se; /* Check if the object has childs, if so also change all of them */ if ( obj->child ) fli_set_composite_gravity( obj, nw, se ); /* Check if object is a group, if so change also all members */ if ( obj->objclass == FL_BEGIN_GROUP ) for ( ; obj && obj->objclass != FL_END_GROUP; obj = obj->next ) { obj->nwgravity = nw; obj->segravity = se; fli_set_composite_gravity( obj, nw, se ); } } /*************************************** * Returns the gravity settings for an object ***************************************/ void fl_get_object_gravity( FL_OBJECT * obj, unsigned int * nw, unsigned int * se ) { if ( ! obj ) { M_err( "fl_get_object_gravity", "NULL object" ); return; } if ( nw ) *nw = obj->nwgravity; if ( se ) *se = obj->segravity; } /*************************************** * Sets the color of the object ***************************************/ void fl_set_object_color( FL_OBJECT * obj, FL_COLOR col1, FL_COLOR col2 ) { FL_COLOR old_col1; if ( ! obj ) { M_err( "fl_set_object_color", "NULL object" ); return; } if ( col1 >= FL_MAX_COLORS || col2 >= FL_MAX_COLORS ) { M_err( "fl_set_object_color", "Invalid color" ); return; } if ( obj->col1 == col1 && obj->col2 == col2 && obj->objclass != FL_TABFOLDER ) return; old_col1 = obj->col1; obj->col1 = col1; obj->col2 = col2; fli_handle_object( obj, FL_ATTRIB, 0, 0, 0, NULL, 0 ); /* If this is the object for the background of the form all of its objects must be told about the new color. */ if ( obj->col1 != old_col1 && obj == bg_object( obj->form ) ) { FL_OBJECT *o; for ( o = obj->next; o; o = o->next ) o->dbl_background = col1; } if ( obj->objclass == FL_TABFOLDER ) fli_set_tab_color( obj, col1, col2 ); fl_redraw_object( obj ); } /*************************************** * Returns the colors of the object ***************************************/ void fl_get_object_color( FL_OBJECT * obj, FL_COLOR * col1, FL_COLOR * col2 ) { if ( ! obj ) { M_err( "fl_get_object_color", "NULL object" ); return; } if ( col1 ) *col1 = obj->col1; if ( col2 ) *col2 = obj->col2; } /*************************************** * If called with a non-zero value for 'timeout' the object will * receive FL_DBLCLICK events if the mouse is clicked twice within * 'timeout' milliseconds, if called with 0 no FL_DBLCLICK events * are received. ***************************************/ void fl_set_object_dblclick( FL_OBJECT * obj, unsigned long timeout ) { if ( ! obj ) { M_err( "fl_set_object_dblclick", "NULL object" ); return; } obj->click_timeout = timeout; } /*************************************** * Returns the double click timeout for the object ***************************************/ unsigned long fl_get_object_dblclick( FL_OBJECT * obj ) { if ( ! obj ) { M_err( "fl_get_object_dblclick", "NULL object" ); return ULONG_MAX; } return obj->click_timeout; } /*************************************** ***************************************/ void fl_set_object_dblbuffer( FL_OBJECT * obj, int yesno ) { FL_OBJECT *o;; if ( ! obj ) { M_err( "fl_set_object_dblbuffer", "NULL object" ); return; } /* Never bother with composite objects */ if ( obj->child || obj->parent ) return; if ( obj->use_pixmap == yesno ) return; obj->use_pixmap = yesno ? 1 : 0; /* Figure out the background color to be used */ if ( obj->form && ( o = bg_object( obj->form ) ) ) obj->dbl_background = o->col1; } /* Test if an object is really visible */ #define ObjIsVisible( obj ) ( ( obj )->visible \ && ( obj )->form \ && ( obj )->form->visible == FL_VISIBLE ) /*************************************** * Sets the label of an object ***************************************/ void fl_set_object_label( FL_OBJECT * obj, const char * label ) { int need_show = 0; if ( ! obj ) { M_err( "fl_set_object_label", "NULL object" ); return; } if ( ! label ) label = ""; if ( ! strcmp( obj->label, label ) ) return; if ( OL( obj ) && obj->visible ) { need_show = 1; fl_hide_object( obj ); } obj->label = fl_realloc( obj->label, strlen( label ) + 1 ); strcpy( obj->label, label ); if ( need_show ) fl_show_object( obj ); else if ( obj->visible ) { fli_recalc_intersections( obj->form ); fl_redraw_object( obj ); } } /*************************************** * Sets the label of an object using a format string and an appropriate * number of (unspecified) argiments ***************************************/ void fl_set_object_label_f( FL_OBJECT * obj, const char * fmt, ... ) { char * buf; EXPAND_FORMAT_STRING( buf, fmt ); fl_set_object_label( obj, buf ); fl_free( buf ); } /*************************************** * Returns the objects label string ***************************************/ const char * fl_get_object_label( FL_OBJECT * obj ) { if ( ! obj ) { M_err( "fl_get_object_label", "NULL object" ); return NULL; } return obj->label; } /*************************************** * Sets the label color of an object ***************************************/ void fl_set_object_lcol( FL_OBJECT * obj, FL_COLOR lcol ) { FL_FORM * form; if ( ! obj ) { M_err( "fl_set_object_lcol", "NULL object" ); return; } form = obj->form; if ( obj->objclass == FL_BEGIN_GROUP ) { obj->lcol = lcol; if ( form ) fl_freeze_form( form ); for ( obj = obj->next; obj && obj->objclass != FL_END_GROUP; obj = obj->next ) fl_set_object_lcol( obj, lcol ); if ( form ) fl_unfreeze_form( form ); } else if ( obj->lcol != lcol ) { obj->lcol = lcol; if ( obj->objclass == FL_TABFOLDER ) fli_set_tab_lcolor( obj, lcol ); fli_handle_object( obj, FL_ATTRIB, 0, 0, 0, NULL, 0 ); fl_redraw_object( obj ); } } /*************************************** * Returns the label color of an object ***************************************/ FL_COLOR fl_get_object_lcol( FL_OBJECT * obj ) { if ( ! obj ) { M_err( "fl_get_object_lcol", "NULL object" ); return FL_NOCOLOR; } return obj->lcol; } /*************************************** * Sets the label's text size of an object ***************************************/ void fl_set_object_lsize( FL_OBJECT * obj, int lsize ) { FL_OBJECT *o; int need_show = 0; if ( ! obj ) { M_err( "fl_set_object_lsize", "NULL object" ); return; } if ( obj->objclass != FL_BEGIN_GROUP && obj->lsize == lsize ) return; /* For objects that have their label on the outside (or that are transparent) we hide the object and, after setting the new label font size, re-show them in order to get everything beneath them redrawn */ if ( OL( obj ) && obj->visible ) { need_show = 1; fl_hide_object( obj ); } obj->lsize = lsize; fli_handle_object( obj, FL_ATTRIB, 0, 0, 0, NULL, 0 ); if ( obj->objclass == FL_TABFOLDER ) fli_set_tab_lsize( obj, lsize ); if ( obj->objclass == FL_BEGIN_GROUP ) for ( o = obj->next; o && o->objclass != FL_END_GROUP; o = o->next ) { obj->lsize = lsize; fli_handle_object( o, FL_ATTRIB, 0, 0, 0, NULL, 0 ); } if ( need_show ) fl_show_object( obj ); else if ( obj->visible ) { fli_recalc_intersections( obj->form ); fl_redraw_object( obj ); } } /*************************************** * Returns the labels text size of an object ***************************************/ int fl_get_object_lsize( FL_OBJECT * obj ) { if ( ! obj ) { M_err( "fl_get_object_lsize", "NULL object" ); return -1; } return obj->lsize; } /*************************************** * Sets the label style of an object ***************************************/ void fl_set_object_lstyle( FL_OBJECT * obj, int lstyle ) { FL_OBJECT *o; int need_show = 0; if ( ! obj ) { M_err( "fl_set_object_lstyle", "NULL object" ); return; } if ( obj->objclass != FL_BEGIN_GROUP && obj->lstyle == lstyle ) return; if ( OL( obj ) && obj->visible ) { need_show = 1; fl_hide_object( obj ); } obj->lstyle = lstyle; fli_handle_object( obj, FL_ATTRIB, 0, 0, 0, NULL, 0 ); if ( obj->objclass == FL_TABFOLDER ) fli_set_tab_lstyle( obj, lstyle ); if ( obj->objclass == FL_BEGIN_GROUP ) for ( o = obj->next; o && o->objclass != FL_END_GROUP; o = o->next ) { obj->lstyle = lstyle; fli_handle_object( o, FL_ATTRIB, 0, 0, 0, NULL, 0 ); } if ( need_show ) fl_show_object( obj ); else if ( obj->visible ) { fli_recalc_intersections( obj->form ); fl_redraw_object( obj ); } } /*************************************** * Returns the label style of an object ***************************************/ int fl_get_object_lstyle( FL_OBJECT * obj ) { if ( ! obj ) { M_err( "fl_get_object_lstyle", "NULL object" ); return -1; } return obj->lstyle; } /*************************************** * Sets the label alignment of an object ***************************************/ void fl_set_object_lalign( FL_OBJECT * obj, int align ) { int need_show = 0; if ( ! obj ) { M_err( "fl_set_object_lalign", "NULL object" ); return; } if ( fl_is_center_lalign( align ) ) align = FL_ALIGN_CENTER; if ( ! fli_test_lalign( align, "fl_set_object_lalign" ) ) return; if ( OL( obj ) && obj->visible ) { need_show = 1; fl_hide_object( obj ); } obj->align = align; fli_handle_object( obj, FL_ATTRIB, 0, 0, 0, NULL, 0 ); if ( obj->objclass == FL_TABFOLDER ) fli_set_tab_lalign( obj, align ); if ( need_show ) fl_show_object( obj ); else if ( obj->visible ) { fli_recalc_intersections( obj->form ); fl_redraw_object( obj ); } } /*************************************** * Returns the label alignment of an object ***************************************/ int fl_get_object_lalign( FL_OBJECT * obj ) { if ( ! obj ) { M_err( "fl_get_object_lalign", "NULL object" ); return -1; } return obj->align; } /*************************************** * Makes an object active ***************************************/ static void activate_object( FL_OBJECT * obj ) { if ( obj->active ) return; obj->active = 1; if ( obj->input && obj->active && ! obj->form->focusobj ) fl_set_focus_object( obj->form, obj ); if ( obj->child ) fli_activate_composite( obj ); } /*************************************** * Public function for making an object active ***************************************/ void fl_activate_object( FL_OBJECT * obj ) { if ( ! obj ) { M_err( "fl_activate_object", "NULL object" ); return; } if ( obj->objclass == FL_BEGIN_GROUP ) { obj->active = 1; for ( obj = obj->next; obj && obj->objclass != FL_END_GROUP; obj = obj->next ) activate_object( obj ); } else activate_object( obj ); } /*************************************** * Deactivates an object ***************************************/ static void deactivate_object( FL_OBJECT * obj ) { if ( ! obj->active ) return; obj->active = 0; lose_focus( obj ); if ( obj->child ) fli_deactivate_composite( obj ); } /*************************************** * Public function for deactivating an object ***************************************/ void fl_deactivate_object( FL_OBJECT * obj ) { if ( ! obj ) { M_err( "fl_deactive_object", "NULL object" ); return; } if ( obj->objclass == FL_BEGIN_GROUP ) { obj->active = 0; for ( obj = obj->next; obj && obj->objclass != FL_END_GROUP; obj = obj->next ) deactivate_object( obj ); } else deactivate_object( obj ); } /*************************************** * Returns if an object is in active state, i.e. reacting to events ***************************************/ int fl_object_is_active( FL_OBJECT * obj ) { if ( ! obj ) { M_err( "fl_object_is_active", "NULL object" ); return 0; } return obj->active; } /*************************************** * Makes an object visible and sets the visible flag to 1 ***************************************/ void fli_show_object( FL_OBJECT * obj ) { if ( obj->visible ) return; obj->visible = 1; if ( obj->child ) { fli_show_composite( obj ); fli_handle_object( obj, FL_ATTRIB, 0, 0, 0, NULL, 0 ); } if ( obj->input && obj->active && obj->form && ! obj->form->focusobj ) fl_set_focus_object( obj->form, obj ); } /*************************************** * Public function for making an object visible ***************************************/ void fl_show_object( FL_OBJECT * obj ) { if ( ! obj ) { M_err( "fl_show_object", "NULL object" ); return; } if ( obj->objclass == FL_BEGIN_GROUP ) { FL_OBJECT *o; for ( o = obj->next; o && o->objclass != FL_END_GROUP; o = o->next ) fli_show_object( o ); } else fli_show_object( obj ); fli_recalc_intersections( obj->form ); fl_redraw_object( obj ); } /*************************************** * Returns if an object is shown (given that the form it * belongs to is visible!) ***************************************/ int fl_object_is_visible( FL_OBJECT * obj ) { if ( ! obj ) { M_err( "fl_object_is_visible", "NULL object" ); return 0; } return obj->visible; } /*************************************** * Sets an object up for being hidden and * adds the area it covers to a region ***************************************/ void fli_hide_and_get_region( FL_OBJECT * obj, Region * reg ) { FL_RECT xrect; #ifdef DELAYED_ACTION /* Remove all entries for the object from the object queue */ fli_object_qflush_object( obj ); #endif if ( ! FORM_IS_UPDATABLE( obj->form ) ) { obj->visible = 0; /* If the form is just frozen remember this because when the form laten becomes unfrozen it needs a complete redraw (and not just a redraw of all modified objects) */ if ( obj->form && obj->form->frozen ) obj->form->in_redraw |= HIDE_WHILE_FROZEN; return; } /* The object can't be the object anymore that has the focus and it also can't be the pushed object or the object the mouse is on */ lose_focus( obj ); if ( obj == fli_int.pushobj ) fli_int.pushobj = NULL; if ( obj == fli_int.mouseobj ) fli_int.mouseobj = NULL; /* Get the area the object covers and add that to the region passed to the function */ if ( obj->objclass == FL_CANVAS || obj->objclass == FL_GLCANVAS ) fli_hide_canvas( obj ); get_object_rect( obj, &xrect, 0 ); XUnionRectWithRegion( &xrect, *reg, *reg ); /* Mark it as invisible (must be last, fli_hide_canvas() tests for visibility and doesn't do anything if already marked as invisible) */ obj->visible = 0; } /*************************************** * Makes an object (and all its children) invisible ***************************************/ void fl_hide_object( FL_OBJECT * obj ) { FL_OBJECT *tmp; FL_RECT xrect; Region reg; if ( ! obj ) { M_err( "fl_hide_object", "NULL object" ); return; } if ( ! obj->visible ) { M_warn( "fl_hide_object", "Object '%s' already is invisible", obj->label ? obj->label : "Object" ); return; } reg = XCreateRegion( ); /* If this is an object that marks the start of a group hide all objects that belong to the group */ if ( obj->objclass == FL_BEGIN_GROUP ) for ( tmp = obj->next; tmp && tmp->objclass != FL_END_GROUP; tmp = tmp->next ) { if ( tmp->child ) { fli_hide_composite( tmp, ® ); fli_handle_object( tmp, FL_ATTRIB, 0, 0, 0, NULL, 0 ); } fli_hide_and_get_region( tmp, ® ); } else { if ( obj->child ) { fli_hide_composite( obj, ® ); fli_handle_object( obj, FL_ATTRIB, 0, 0, 0, NULL, 0 ); } fli_hide_and_get_region( obj, ® ); } /* No redraw is needed if the object has no form or the form isn't shown or is frozen. */ if ( ! FORM_IS_UPDATABLE( obj->form ) ) { XDestroyRegion( reg ); return; } /* Determine the rectangle that covers the area of the object */ XClipBox( reg, &xrect ); XDestroyRegion( reg ); /* Redraw only the area covered by the object */ fli_set_global_clipping( xrect.x, xrect.y, xrect.width, xrect.height ); redraw( obj->form, 1 ); fli_unset_global_clipping( ); } /*************************************** * Sets the list of shortcuts for the object. Shortcuts are specified * with a string with the following special sequences: * '^x' stands for Ctrl-x (for a-z case doesn't matter) * '#x' stands for Alt-x (case matters!) * '&n' with n = 1,...,34 stands for function key n * '&A', '&B', '&C' '&D' stand for up down, right and left cursor keys * '^[' stand for escape key * '^^ stand for '^' * '^#' stand for '#' * '^&' stand for '&' * Note: '&' followed by anything else than the above will be skipped, * e.g. '&E' or '&0'. If '&' is followed by a number larger than 34 * only the first digit of the number is used. * Not escapable are Crtl-^, Crtl-# and Ctrl-&. ***************************************/ #include int fli_convert_shortcut( const char * str, long * sc ) { int i = 0; long offset = 0; const char *c; for ( c = str; *c && i < MAX_SHORTCUTS; c++ ) { switch ( *c ) { case '^' : if ( offset & FL_CONTROL_MASK && c[ -1 ] == '^' ) { sc[ i++ ] = '^' + offset - FL_CONTROL_MASK; offset = 0; } else { if ( c[ 1 ] == '[' ) { sc[ i++ ] = 0x1b; c++; offset = 0; } else offset += FL_CONTROL_MASK; } break; case '#' : if ( offset & FL_CONTROL_MASK && c[ -1 ] == '^' ) { sc[ i++ ] = '#' + offset - FL_CONTROL_MASK; offset = 0; } else offset += FL_ALT_MASK; break; case '&' : if ( offset & FL_CONTROL_MASK && c[ -1 ] == '^' ) { sc[ i++ ] = '&' + offset - FL_CONTROL_MASK; offset = 0; break; } else if ( c[ 1 ] == 'A' ) sc[ i++ ] = XK_Up + offset; else if ( c[ 1 ] == 'B' ) sc[ i++ ] = XK_Down + offset; else if ( c[ 1 ] == 'C' ) sc[ i++ ] = XK_Right + offset; else if ( c[ 1 ] == 'D' ) sc[ i++ ] = XK_Left + offset; else if ( isdigit( ( unsigned char ) c[ 1 ] ) && c[ 1 ] > '0' ) { long j = c[ 1 ] - '0'; if ( isdigit( ( unsigned char ) c[ 2 ] ) && 10 * j + c[ 2 ] - '0' <= 35 ) { j = 10 * c[ 2 ] - '0'; c++; } sc[ i++ ] = offset + XK_F1 + j - 1; } offset = 0; c++; break; default : if ( offset & ( FL_CONTROL_MASK | FL_ALT_MASK ) ) { sc[ i ] = toupper( ( int ) *c ); if ( offset & FL_CONTROL_MASK ) sc[ i ] -= 'A' - 1; sc[ i++ ] += offset & ~ FL_CONTROL_MASK; } else sc[ i++ ] = *c + offset; offset = 0; break; } } sc[ i ] = 0; if ( *c ) { M_err( "fli_convert_shortcut", "Too many shortcuts (>%d)", MAX_SHORTCUTS ); } return i; } /*************************************** ***************************************/ int fli_get_underline_pos( const char * label, const char * sc ) { int c; const char *p; /* Find the first non-special char in the shortcut string */ for ( c = '\0', p = sc; ! c && *p; p++ ) { if ( isalnum( ( unsigned char ) *p ) ) { if ( p == sc ) c = *p; else if ( * ( p - 1 ) != '&' && ! isdigit( ( unsigned char ) * ( p - 1 ) ) ) c = *p; } } if ( ! c ) return -1; /* Find where the match occurs */ if ( c == *sc ) p = strchr( label, c ); else if ( ! ( p = strchr( label, c ) ) ) p = strchr( label, islower( ( unsigned char ) c ) ? toupper( c ) : tolower( c ) ); if ( ! p ) return -1; return p - label + 1; } /*************************************** ***************************************/ void fl_set_object_shortcut( FL_OBJECT * obj, const char * sstr, int showit ) { int scsize, n; long sc[ MAX_SHORTCUTS + 1 ]; /* converted shortcuts - we need one more than max for trailing 0 */ if ( ! obj ) { M_err( "fl_set_object_shortcut", "NULL object" ); return; } if ( ! sstr || ! *sstr ) { *obj->shortcut = 0; return; } n = fli_convert_shortcut( sstr, sc ); scsize = ( n + 1 ) * sizeof *obj->shortcut; obj->shortcut = fl_realloc( obj->shortcut, scsize ); memcpy( obj->shortcut, sc, scsize ); if ( ! showit || ! obj->label || ! *obj->label || *obj->label == '@' ) return; /* Find out where to underline */ if ( ( n = fli_get_underline_pos( obj->label, sstr ) ) > 0 && ! strchr( obj->label, *fl_ul_magic_char ) ) { size_t len = strlen( obj->label ) + 1; obj->label = fl_realloc( obj->label, len + 1 ); memmove( obj->label + n + 1, obj->label + n, len - n ); obj->label[ n ] = *fl_ul_magic_char; } } /*************************************** * Set a shortcut with keysyms directly ***************************************/ void fl_set_object_shortcutkey( FL_OBJECT * obj, unsigned int keysym ) { size_t n; for ( n = 0; obj->shortcut[ n ]; n++ ) /* empty */; /* Always have a terminator, thus n + 2 */ obj->shortcut = fl_realloc( obj->shortcut, ( n + 2 ) * sizeof *obj->shortcut ); obj->shortcut[ n ] = keysym; obj->shortcut[ n + 1 ] = 0; } /*************************************** * Sets the object in the form that gets keyboard input. ***************************************/ void fl_set_focus_object( FL_FORM * form, FL_OBJECT * obj ) { if ( ! form ) { M_err( "fl_set_focus_object", "NULL form" ); return; } if ( obj == form->focusobj ) return; if ( form->focusobj ) fli_handle_object( form->focusobj, FL_UNFOCUS, 0, 0, 0, NULL, 0 ); fli_handle_object( obj, FL_FOCUS, 0, 0, 0, NULL, 0 ); } /*************************************** * Returns the object that has the focus (take care, 'focusobj' * may be set to an input object that's a child of the object * we need to return) ***************************************/ FL_OBJECT * fl_get_focus_object( FL_FORM * form ) { FL_OBJECT *fo = NULL;; if ( form && ( fo = form->focusobj ) ) while ( fo->parent ) fo = fo->parent; return fo; } /*----------------------------------------------------------------------- Searching in forms -----------------------------------------------------------------------*/ /*************************************** * Returns an object of type 'find' in a form, starting at 'obj'. * If the function does not return an object the event that * triggered the call will be eaten. This is how the deactived * and inactive objects reject events. * Modify with care! ***************************************/ FL_OBJECT * fli_find_object( FL_OBJECT * obj, int find, FL_Coord mx, FL_Coord my ) { while ( obj ) { if ( obj->objclass != FL_BEGIN_GROUP && obj->objclass != FL_END_GROUP && obj->visible && ( obj->active || ( obj->posthandle && ! obj->active ) || ( obj->tooltip && *obj->tooltip && ! obj->active ) ) ) { if ( find == FLI_FIND_INPUT && obj->input && obj->active ) return obj; if ( find == FLI_FIND_AUTOMATIC && obj->automatic ) return obj; if ( find == FLI_FIND_RETURN && obj->type == FL_RETURN_BUTTON ) return obj; if ( find == FLI_FIND_MOUSE && mx >= obj->x && mx <= obj->x + obj->w && my >= obj->y && my <= obj->y + obj->h ) return obj; if ( find == FLI_FIND_KEYSPECIAL && obj->wantkey & FL_KEY_SPECIAL ) return obj; } obj = obj->next; } return NULL; } /*************************************** * Same as above but going backwards through the linked list of objects. ***************************************/ FL_OBJECT * fli_find_object_backwards( FL_OBJECT * obj, int find, FL_Coord mx, FL_Coord my ) { for ( ; obj; obj = obj->prev ) if ( obj->objclass != FL_BEGIN_GROUP && obj->objclass != FL_END_GROUP && obj->visible && ( obj->active || ( obj->posthandle && ! obj->active ) || ( obj->tooltip && *obj->tooltip && ! obj->active ) ) ) { if ( find == FLI_FIND_INPUT && obj->input && obj->active ) return obj; if ( find == FLI_FIND_AUTOMATIC && obj->automatic ) return obj; if ( find == FLI_FIND_MOUSE && mx >= obj->x && mx <= obj->x + obj->w && my >= obj->y && my <= obj->y + obj->h ) return obj; if ( find == FLI_FIND_KEYSPECIAL && obj->wantkey & FL_KEY_SPECIAL ) return obj; } return NULL; } /*************************************** * Returns the first object of type 'find' in 'form' ***************************************/ FL_OBJECT * fli_find_first( FL_FORM * form, int find, FL_Coord mx, FL_Coord my ) { return fli_find_object( form->first, find, mx, my ); } /*************************************** * Returns the last object of the type find ***************************************/ FL_OBJECT * fli_find_last( FL_FORM * form, int find, FL_Coord mx, FL_Coord my ) { FL_OBJECT *last, *obj; last = obj = fli_find_first( form, find, mx, my ); while ( obj ) { last = obj; obj = fli_find_object( obj->next, find, mx, my ); } return last; } /*----------------------------------------------------------------------- Drawing Routines. -----------------------------------------------------------------------*/ /*************************************** ***************************************/ static int is_object_clipped( FL_OBJECT * obj ) { FL_RECT obj_rect, *xc; if ( ! fl_is_global_clipped( ) ) return 0; get_object_rect( obj, &obj_rect, 1 ); xc = fli_intersect_rects( &obj_rect, fli_get_global_clip_rect( ) ); if ( ! xc ) return 1; fl_free( xc ); return 0; } /*************************************** * Marks an object (and other objects them also needing a redraw) * for redraw ***************************************/ static void mark_object_for_redraw( FL_OBJECT * obj ) { FL_OBJECT *o; if ( ! obj ) { M_err( "mark_object_for_redraw", "Redrawing NULL object" ); return; } if ( obj->redraw || ! obj->form || ! obj->visible || ( obj->parent && ! obj->parent->visible ) || obj->objclass == FL_BEGIN_GROUP || obj->objclass == FL_END_GROUP ) return; obj->redraw = 1; for ( o = obj->child; o; o = o->nc ) mark_object_for_redraw( o ); /* If an object is marked as being under another object we have to find the object(s) it is beneath and also mark them for a redraw. For the special case that the object to be redraw is the first object of the form (i.e. the one for the background) we don't have to check if the other object are on top of it, they all are. */ if ( obj == bg_object( obj->form ) ) { for ( o = obj->next; o; o = o->next ) { if ( ! o->visible || ( o->parent && ! o->parent->visible ) || o->objclass == FL_BEGIN_GROUP || o->objclass == FL_END_GROUP ) continue; obj->redraw = 1; } } else if ( obj->is_under ) { /* If it hasn't been done yet pre-calculate the sizes of all objects possibly concerned */ int need_finish = prep_recalc( obj->form, obj ); int cnt = 0; for ( o = obj->next; o; o = o->next ) { if ( o->redraw || ! o->visible || ( o->parent && ! o->parent->visible ) || o->objclass == FL_BEGIN_GROUP || o->objclass == FL_END_GROUP ) continue; if ( objects_intersect( obj, o ) ) { mark_object_for_redraw( o ); /* Since we know how many objects are on top of our object we can stop if all of them have been marked for redraw. */ if ( ++cnt >= obj->is_under ) break; } } if ( need_finish ) finish_recalc( obj->form, obj ); } } /*************************************** * Function for (re)drawing an object ***************************************/ void fl_redraw_object( FL_OBJECT * obj ) { if ( ! obj ) { M_err( "fl_redraw_object", "NULL object" ); return; } if ( ! obj->form || ! obj->visible ) return; if ( obj->objclass == FL_BEGIN_GROUP ) { FL_OBJECT *o = obj->next; /* If it hasn't been done yet pre-calculate the sizes of all objects possibly concerned */ int need_finish = prep_recalc( o->form, o ); for ( ; o && o->objclass != FL_END_GROUP; o = o->next ) mark_object_for_redraw( o ); if ( need_finish ) finish_recalc( obj->form, obj->next ); } else mark_object_for_redraw( obj ); redraw( obj->form, 0 ); } /*************************************** * Function to test if the areas of two objects (including their labels if * they're outside the object) intersect ***************************************/ static int objects_intersect( const FL_OBJECT * obj1, const FL_OBJECT * obj2 ) { if ( tmp_vdata ) { FL_RECT *r1 = obj1->u_vdata, *r2 = obj2->u_vdata; return r1->x + r1->width > r2->x && r2->x + r2->width > r1->x && r1->y + r1->height > r2->y && r2->y + r2->height > r1->y; } else { FL_RECT r1, r2; get_object_rect( obj1, &r1, 0 ); get_object_rect( obj2, &r2, 0 ); return r1.x + r1.width > r2.x && r2.x + r2.width > r2.x && r1.y + r1.height > r2.y && r2.y + r2.height > r1.y; } } /*************************************** * Redraws a form or only a subset of its objects - when called with the * 'draw_all' argument being set it redraws the complete form with all its * objects while, with 'draw_all' being unset (when getting call from e.g. * fl_redraw_object() or fl_unfreeze_form()), only draws those objects that * are marked for needing a redraw (and all objects as well that would be * obscured by that because they're "higher up"). ***************************************/ static void redraw( FL_FORM * form, int draw_all ) { FL_OBJECT *obj; /* If the form is invisible or frozen we're already done */ if ( ! FORM_IS_UPDATABLE( form ) || ( form->in_redraw & IN_REDRAW ) ) return; form->in_redraw |= IN_REDRAW; /* Remember when we're asked to do a full redraw - we might leave without drawing at all since the form is invisible or frozen and then the next time the function is called, even for a partial redraw, we need to draw all its objects. */ form->needs_full_redraw = form->needs_full_redraw || draw_all; /* Set the window (or drawable) to be drawn and, if necessary, set up a pixmap for the form */ fli_set_form_window( form ); fli_create_form_pixmap( form ); for ( obj = bg_object( form ); obj; obj = obj->next ) { int needs_redraw = obj->redraw; obj->redraw = 0; /* Only draw objects that are visible and, unless we're asked to draw all objects, are marked for a redraw and are within the current clipping area */ if ( ! obj->visible || ! ( needs_redraw || form->needs_full_redraw ) || obj->objclass == FL_BEGIN_GROUP || obj->objclass == FL_END_GROUP || is_object_clipped( obj ) ) continue; /* Set up a pixmap for the object (does nothing if the form already has a pixmap we're drawing to) */ fli_create_object_pixmap( obj ); /* Don't allow free objects to draw outside of their boxes. */ if ( obj->objclass == FL_FREE ) { fl_set_clipping( obj->x, obj->y, obj->w, obj->h ); fl_set_text_clipping( obj->x, obj->y, obj->w, obj->h ); } fli_handle_object( obj, FL_DRAW, 0, 0, 0, NULL, 0 ); if ( obj->objclass == FL_FREE ) { fl_unset_clipping( ); fl_unset_text_clipping( ); } /* Copy the objects pixmap to the form window (does nothing if the form has a pixmap we're drawing to since then we've drawn to it) */ fli_show_object_pixmap( obj ); fli_handle_object( obj, FL_DRAWLABEL, 0, 0, 0, NULL, 0 ); } /* Copy the forms pixmap to its window (if double buffering is on) */ fli_show_form_pixmap( form ); form->needs_full_redraw = 0; form->in_redraw &= ~ IN_REDRAW; } /*************************************** * Exported function for drawing a form ***************************************/ void fl_redraw_form( FL_FORM * form ) { fli_recalc_intersections( form ); redraw( form, 1 ); } /*************************************** * Disables drawing of form ***************************************/ void fl_freeze_form( FL_FORM * form ) { if ( ! form ) { M_err( "fl_freeze_form", "NULL form" ); return; } form->frozen++; } /*************************************** * Enables drawing of form ***************************************/ void fl_unfreeze_form( FL_FORM * form ) { if ( ! form ) { M_err( "fl_unfreeze_form", "NULL form" ); return; } if ( form->frozen == 0 ) { M_err( "fl_unfreeze_form", "Unfreezing non-frozen form" ); return; } /* If the form becomes unfrozen at last and is visible recalculate overlaps between the objects and then redraw all objects that have been marked for a redraw since it became frozen or, if some objects became hidden during that time, all objects. */ if ( --form->frozen == 0 && form->visible == FL_VISIBLE ) { fli_recalc_intersections( form ); redraw( form, form->in_redraw & HIDE_WHILE_FROZEN ); form->in_redraw &= ~ HIDE_WHILE_FROZEN; } } /*----------------------------------------------------------------------- Handling Routines. -----------------------------------------------------------------------*/ /*************************************** * Should only be used as a response to FL_UNFOCUS ***************************************/ void fl_reset_focus_object( FL_OBJECT * obj ) { refocus = obj; } /*** handle tooltips ***/ /*************************************** ***************************************/ static FL_OBJECT * get_parent( FL_OBJECT * obj ) { if ( obj ) while ( obj->parent && obj->parent != obj ) obj = obj->parent; return obj; } /*************************************** ***************************************/ static void tooltip_handler( int ID FL_UNUSED_ARG, void * data ) { FL_OBJECT * const obj = get_parent( data ); if ( obj->tooltip && *obj->tooltip && obj->visible ) fli_show_tooltip( obj->tooltip, obj->form->x + obj->x, obj->form->y + obj->y + obj->h + 1 ); obj->tipID = 0; } /*************************************** ***************************************/ static void checked_hide_tooltip( FL_OBJECT * obj, XEvent * xev ) { FL_OBJECT * const parent = get_parent( obj ); char const * const tooltip = parent->tooltip; if ( ! tooltip || ! *tooltip ) return; /* If obj is part of a composite widget, it may well be that we're leaving a child widget but are still within the parent. If that is the case, we don't want to hide the tooltip at all. */ if ( parent != obj && xev && xev->xmotion.x >= parent->x && xev->xmotion.x <= parent->x + parent->w && xev->xmotion.y >= parent->y && xev->xmotion.y <= parent->y + parent->h ) return; fli_hide_tooltip( ); if ( parent->tipID ) { fl_remove_timeout( parent->tipID ); parent->tipID = 0; } } /*************************************** ***************************************/ static void unconditional_hide_tooltip( FL_OBJECT * obj ) { FL_OBJECT * const parent = get_parent( obj ); fli_hide_tooltip( ); if ( parent->tipID ) { fl_remove_timeout( parent->tipID ); parent->tipID = 0; } } /*************************************** * Handles an event for an object ***************************************/ static int handle_object( FL_OBJECT * obj, int event, FL_Coord mx, FL_Coord my, int key, XEvent * xev, int keep_ret ) { static unsigned long last_clicktime = 0; static int last_dblclick = 0, last_key = 0; static FL_Coord last_mx, last_my; int cur_event; FL_OBJECT *p; if ( ! obj ) return FL_RETURN_NONE; #if FL_DEBUG >= ML_WARN if ( ! obj->form && event != FL_FREEMEM && event != FL_ATTRIB && event != FL_RESIZED ) { M_err( "handle_object", "Bad object '%s', event = %s", obj->label ? obj->label : "", fli_event_name( event ) ); return FL_RETURN_NONE; } #endif if ( obj->objclass == FL_BEGIN_GROUP || obj->objclass == FL_END_GROUP ) return FL_RETURN_NONE; if ( ! obj->handle ) return FL_RETURN_NONE; /* Make sure return states of parents, grandparents etc. of current object are all set to FL_NO_RETURN */ if ( ! keep_ret ) { p = obj; while ( ( p = p->parent ) ) p->returned = FL_RETURN_NONE; } switch ( event ) { case FL_ENTER: { /* In the case of a composite object we assign the timer to the parent widget as that's the thing that's actually got the tip. */ FL_OBJECT * const parent = get_parent( obj ); if ( ! parent->tipID ) { char const * const tooltip = parent->tooltip; if ( tooltip && *tooltip ) parent->tipID = fl_add_timeout( fli_context->tooltip_time, tooltip_handler, parent ); } obj->belowmouse = 1; break; } case FL_LEAVE: checked_hide_tooltip( obj, xev ); obj->belowmouse = 0; break; case FL_PUSH: unconditional_hide_tooltip( obj ); obj->pushed = 1; break; case FL_KEYPRESS: unconditional_hide_tooltip( obj ); break; case FL_RELEASE: if ( ! obj->radio ) obj->pushed = 0; /* Changed: before double and triple clicks weren't accepted for the middle mouse button (which didn't make too much sense IMHO), now they don't get flagged for the mouse wheel "buttons". JTT */ if ( key == last_key && ! ( key == FL_MBUTTON4 || key == FL_MBUTTON5 ) && ! ( FL_abs( last_mx - mx ) > 4 || FL_abs( last_my - my ) > 4 ) && xev && xev->xbutton.time - last_clicktime < obj->click_timeout ) event = last_dblclick ? FL_TRPLCLICK : FL_DBLCLICK; last_dblclick = event == FL_DBLCLICK; last_clicktime = xev ? xev->xbutton.time : 0; last_key = key; last_mx = mx; last_my = my; break; case FL_FOCUS: /* 'refocus' is set if on the last FL_UNFOCUS it was found that the text in the input field didn't validate. In that case the focus has to go back to that field and *not* to a different one */ if ( refocus && refocus->form ) { obj = refocus; refocus = NULL; } if ( obj->form ) { obj->form->focusobj = obj; obj->focus = 1; } break; case FL_UNFOCUS: obj->form->focusobj = NULL; obj->focus = 0; break; case FL_DRAW: if ( obj->objclass == FL_FREE ) { fl_set_clipping( obj->x, obj->y, obj->w, obj->h ); fl_set_text_clipping( obj->x, obj->y, obj->w, obj->h ); } break; } cur_event = event; if ( event == FL_DBLCLICK || event == FL_TRPLCLICK ) event = FL_RELEASE; recover: /* Call a pre-handler if it exists and return if it tells us the event has been handled completely */ if ( obj->prehandle && event != FL_FREEMEM && obj->prehandle( obj, event, mx, my, key, xev ) == FL_PREEMPT ) return FL_RETURN_NONE; /* Now finally call the real object handler and filter the status it returns (to limit the value to what it expects) */ if ( ! keep_ret ) { obj->returned = obj->handle( obj, event, mx, my, key, xev ); fli_filter_returns( obj ); } else obj->handle( obj, event, mx, my, key, xev ); /* Call post-handler if one exists */ if ( obj->posthandle && event != FL_FREEMEM ) obj->posthandle( obj, event, mx, my, key, xev ); if ( cur_event == FL_DBLCLICK || cur_event == FL_TRPLCLICK ) { event = cur_event; cur_event = 0; if ( ! keep_ret && obj->returned ) fli_object_qenter( obj, cur_event ); goto recover; } if ( obj->objclass == FL_FREE && event == FL_DRAW ) { fl_unset_clipping( ); fl_unset_text_clipping( ); } return ( event == FL_DBLCLICK || event == FL_TRPLCLICK ) ? ( int ) FL_RETURN_NONE : obj->returned; } /*************************************** * Handle and store object in object queue if handler returns non-zero ***************************************/ void fli_handle_object( FL_OBJECT * obj, int event, FL_Coord mx, FL_Coord my, int key, XEvent * xev, int enter_it ) { if ( ! obj ) return; /* If 'enter_it' is set the object is inserted into the object queue and it's 'returned' member is modified. If not, just the handler for the object is called, but it doesn't appear in the queue and the 'returned' member remains unmodified. Also don't enter the object into the queue if it's form doesn't exist or the forms window isn't mapped. */ if ( enter_it && obj->form && obj->form->window ) { int res; if ( ( res = handle_object( obj, event, mx, my, key, xev, 0 ) ) ) fli_object_qenter( obj, event ); } else handle_object( obj, event, mx, my, key, xev, 1 ); } /*************************************** * Sets the callback routine for the object ***************************************/ FL_CALLBACKPTR fl_set_object_callback( FL_OBJECT * obj, FL_CALLBACKPTR callback, long argument ) { FL_CALLBACKPTR old; if ( ! obj ) { M_err( "fl_set_object_callback", "NULL object" ); return NULL; } old = obj->object_callback; obj->object_callback = callback; obj->argument = argument; /* In older versions scrollbars and browsers didn't return to the application on e.g. fl_do_forms() but still a callback associated with the object got called. To emulate the old behaviour we have to set the return policy to FL_RETURN_NEVER if the callback is removed and to (FL_RETURN_SELECTION|FL_RETURN_DESELECTION) or FL_RETURN_CHANGED when a callback is installed. */ #if defined USE_BWC_BS_HACK if ( obj->objclass == FL_BROWSER ) fl_set_object_return( obj, callback ? ( FL_RETURN_SELECTION | FL_RETURN_DESELECTION ) : FL_RETURN_NONE ); else if ( obj->objclass == FL_SCROLLBAR ) fl_set_object_return( obj, callback ? FL_RETURN_CHANGED : FL_RETURN_NONE); #endif return old; } /*************************************** * Sets the borderwidth of an object ***************************************/ void fl_set_object_bw( FL_OBJECT * obj, int bw ) { /* Clamp border width to a reasonable range */ if ( FL_abs( bw ) > FL_MAX_BW ) bw = bw > 0 ? FL_MAX_BW : - FL_MAX_BW; if ( bw == 0 ) bw = -1; if ( ! obj ) { M_err( "fl_set_object_bw", "NULL object" ); return; } /* Check if this object is a group, if so, change all members */ if ( obj->objclass == FL_BEGIN_GROUP ) { FL_FORM * form = obj->form; obj->bw = bw; if ( form ) fl_freeze_form( form ); for ( obj = obj->next; obj && obj->objclass != FL_END_GROUP; obj = obj->next ) if ( obj->bw != bw ) { obj->bw = bw; fli_handle_object( obj, FL_ATTRIB, 0, 0, 0, NULL, 0 ); mark_object_for_redraw( obj ); } if ( form ) fl_unfreeze_form( form ); } else if ( obj->bw != bw && obj->objclass != FL_TABFOLDER ) { obj->bw = bw; fli_handle_object( obj, FL_ATTRIB, 0, 0, 0, NULL, 0 ); if ( obj->objclass == FL_TABFOLDER ) fli_set_tab_bw( obj, bw ); fl_redraw_object( obj ); } } /*************************************** * Returns the borderwidth of an object ***************************************/ int fl_get_object_bw( FL_OBJECT * obj ) { if ( ! obj ) { M_err( "fl_get_object_bw", "NULL object" ); return -1; } return obj->bw; } /*************************************** ***************************************/ Window fl_get_real_object_window( FL_OBJECT * obj ) { FL_pixmap *objp = obj->flpixmap; FL_pixmap *formp = obj->form->flpixmap; if ( objp && objp->win ) return objp->win; else if ( ( obj->objclass == FL_CANVAS || obj->objclass == FL_GLCANVAS ) && fl_get_canvas_id( obj ) ) return fl_get_canvas_id( obj ); else if ( formp && formp->win ) return formp->win; return obj->form->window; } /*************************************** * Takes two rectangles and returns a pointer to a new rectangle * (memory for it is allocated in the function and must be released * by the caller!) of the intersection of both - or a NULL pointer * if the two rectangles have no common area. ***************************************/ FL_RECT * fli_intersect_rects( const FL_RECT * r1, const FL_RECT * r2 ) { FL_RECT * p = fl_malloc( sizeof *p ); int x = FL_min( r1->x + r1->width, r2->x + r2->width ), y = FL_min( r1->y + r1->height, r2->y + r2->height ); p->x = FL_max( r1->x, r2->x ); p->y = FL_max( r1->y, r2->y ); p->width = x - p->x; p->height = y - p->y; if ( p->width <= 0 || p->height <= 0 ) fli_safe_free( p ); return p; } /*************************************** * Returns (via the first argument) the smallest rectangle covering * both the two argument rectangles ***************************************/ static void fli_combine_rectangles( FL_RECT * r1, const FL_RECT * r2 ) { int xf = FL_max( r1->x + r1->width, r2->x + r2->width ), yf = FL_max( r1->y + r1->height, r2->y + r2->height ); r1->x = FL_min( r1->x, r2->x ); r1->y = FL_min( r1->y, r2->y ); r1->width = xf - r1->x; r1->height = yf - r1->y; } /*************************************** * Scale an object. No gravity and resize settings for the object are * taken into account. The calculation takes care of rounding errors * and has the property that if two objects were "glued" together be- * fore scaling they will remain so. The function also doesn't re- * calculates intersection between objects, this has to be done by the * caller if necessary. ***************************************/ void fli_scale_object( FL_OBJECT * obj, double xs, double ys ) { if ( xs == 1.0 && ys == 1.0 ) return; if ( ! obj->form ) { obj->x = FL_crnd( xs * obj->x ); obj->y = FL_crnd( ys * obj->y ); obj->w = FL_crnd( xs * obj->w ); obj->h = FL_crnd( ys * obj->h ); } else { double new_w = xs * ( obj->fl2 - obj->fl1 ), new_h = ys * ( obj->ft2 - obj->ft1 ); obj->fl1 *= xs; obj->fr1 = obj->form->w_hr - obj->fl1; obj->ft1 *= ys; obj->fb1 = obj->form->h_hr - obj->ft1; obj->fl2 = obj->fl1 + new_w; obj->fr2 = obj->form->w_hr - obj->fl2; obj->ft2 = obj->ft1 + new_h;; obj->fb2 = obj->form->h_hr - obj->ft2;; obj->x = FL_crnd( obj->fl1 ); obj->y = FL_crnd( obj->ft1 ); obj->w = FL_crnd( new_w ); obj->h = FL_crnd( new_h ); fli_handle_object( obj, FL_RESIZED, 0, 0, 0, NULL, 0 ); /* If there are child objects also inform them about the size change */ if ( obj->child ) fli_composite_has_been_resized( obj ); } } /*************************************** * Register a preemptive object handler ***************************************/ FL_HANDLEPTR fl_set_object_prehandler( FL_OBJECT * obj, FL_HANDLEPTR phandler ) { FL_HANDLEPTR oldh = obj->prehandle; obj->prehandle = phandler; return oldh; } /*************************************** ***************************************/ FL_HANDLEPTR fl_set_object_posthandler( FL_OBJECT * obj, FL_HANDLEPTR post ) { FL_HANDLEPTR oldh = obj->posthandle; obj->posthandle = post; return oldh; } /*************************************** ***************************************/ int fl_get_object_return_state( FL_OBJECT *obj ) { return obj->returned; } /*************************************** ***************************************/ void fl_trigger_object( FL_OBJECT * obj ) { if ( obj && obj != FL_EVENT && obj->form && obj->visible && obj->active ) { obj->returned = FL_RETURN_TRIGGERED; fli_object_qenter( obj, FL_TRIGGER ); } } /*************************************** ***************************************/ void fl_draw_object_label( FL_OBJECT * obj ) { int align; if ( ! obj->label || ! *obj->label ) return; align = fl_to_outside_lalign( obj->align ); if ( fl_is_inside_lalign( obj->align ) ) fl_draw_text( align, obj->x, obj->y, obj->w, obj->h, obj->lcol, obj->lstyle, obj->lsize, obj->label ); else fl_draw_text_beside( align, obj->x, obj->y, obj->w, obj->h, obj->lcol, obj->lstyle, obj->lsize, obj->label ); } /*************************************** ***************************************/ void fl_draw_object_label_outside( FL_OBJECT * obj ) { fl_draw_text_beside( fl_to_outside_lalign( obj->align ), obj->x, obj->y, obj->w, obj->h, obj->lcol, obj->lstyle, obj->lsize, obj->label ); } /*************************************** ***************************************/ void fl_call_object_callback( FL_OBJECT * obj ) { if ( ! obj ) { M_err( "fl_call_object_callback", "NULL object" ); return; } if ( obj->object_callback ) obj->object_callback( obj, obj->argument ); } /*************************************** * Function to test if an object is (at least partially) hidden by any of * its successors in the forms list of objects (objects are always sorted in * a way that objects earlier in the list are drawn under those following * it). We don't need to look at objects that have a parent since for * them the tests for the parent objects will do. It returns the number * of objects that are "over" the object. ***************************************/ static int object_is_under( const FL_OBJECT * obj ) { FL_OBJECT *o; int cnt = 0; /* The first object of a form is always below all others */ if ( obj == bg_object( obj->form ) ) return 1; if ( obj->parent || obj->objclass == FL_BEGIN_GROUP || obj->objclass == FL_END_GROUP ) return 0; for ( o = obj->next; o; o = o->next ) { if ( o->parent || o->objclass == FL_BEGIN_GROUP || o->objclass == FL_END_GROUP ) continue; if ( objects_intersect( obj, o ) ) cnt++; } return cnt; } /*************************************** * Helper function for fli_recalc_intersections() and other functions - * without this is a O(N^2) operation with respect to the recalculations * of the N object bounding boxes. Here we use that the 'u_vdata' pointers * of the objects don't get used during fli_recalc_intersections() and * replace them all by pointers to pre-calculated bounding boxes, thus * reducing the number of recalculations to N (in objects_intersect() it * gets checked if 'tmp_vdata' is non-NULL and then uses the pre-calculated * bounding boxes). ***************************************/ static int prep_recalc( FL_FORM * form, FL_OBJECT * start_obj ) { FL_OBJECT *obj; int cnt = 0; int i = 0; if ( ! form || tmp_vdata ) return 0; if ( ! start_obj ) start_obj = bg_object( form ); /* Count how many objects the form contains */ for ( obj = start_obj; obj; obj = obj->next ) cnt++; if ( cnt < 2 ) return 0; /* Get memory for temporary storing the 'u_vdata' pointers of all objects and as many FL_RECT's */ if ( ( tmp_vdata = fl_malloc( cnt * sizeof *tmp_vdata ) ) ) { if ( ! ( tmp_rects = fl_malloc( cnt * sizeof *tmp_rects ) ) ) { fli_safe_free( tmp_vdata ); return 0; } } else return 0; /* Save the 'u_vdata' pointers and replace them by pointers to the bounding box rectangles */ for ( obj = start_obj; obj; obj = obj->next ) { tmp_vdata[ i ] = obj->u_vdata; obj->u_vdata = tmp_rects + i; get_object_rect( obj, tmp_rects + i++, 0 ); } return 1; } /*************************************** * Another helper function for fli_recalc_intersections() - to be called when * it's finished, restoring all objects 'u_vdata' pointers and getting rid * of allocated memory. ***************************************/ static void finish_recalc( FL_FORM * form, FL_OBJECT * start_obj ) { FL_OBJECT *obj; int i = 0; if ( ! tmp_vdata ) return; for ( obj = start_obj ? start_obj : bg_object( form ); obj; obj = obj->next ) obj->u_vdata = tmp_vdata[ i++ ]; fli_safe_free( tmp_rects ); fli_safe_free( tmp_vdata ); } /*************************************** * Rechecks for all objects of a form if they are * partially or fully hidden by another object ***************************************/ void fli_recalc_intersections( FL_FORM * form ) { FL_OBJECT *obj; /* When we're still adding to a form (and thus 'fl_current_form' isn't NULL) there typically are a lot of calls that normally would require a recalculation of intersections. The same applies if the form is frozen. Delay this until the form gets closed (i.e. only recalculate the intersections during the final call of fl_end_form()) or when it isn't frozen anymore. */ if ( fl_current_form || ! form || ( form && form->frozen ) ) return; prep_recalc( form, NULL ); for ( obj = bg_object( form ); obj && obj->next; obj = obj->next ) obj->is_under = object_is_under( obj ); finish_recalc( form, NULL ); } /*************************************** ***************************************/ void fl_move_object( FL_OBJECT * obj, FL_Coord dx, FL_Coord dy ) { FL_Coord x, y; if ( fli_inverted_y ) dy = - dy; if ( obj->objclass == FL_BEGIN_GROUP ) { FL_FORM * form = obj->form; if ( form ) fl_freeze_form( form ); for ( obj = obj->next; obj && obj->objclass != FL_END_GROUP; obj = obj->next ) { fl_get_object_position( obj, &x, &y ); fl_set_object_position( obj, x + dx, y + dy ); } if ( form ) fl_unfreeze_form( form ); } else { fl_get_object_position( obj, &x, &y ); fl_set_object_position( obj, x + dx, y + dy ); } } /*************************************** * Returns the position of an object ***************************************/ void fl_get_object_position( FL_OBJECT * obj, FL_Coord * x, FL_Coord * y ) { *x = obj->x; *y = fli_inverted_y ? TRANSLATE_Y( obj, obj->form ) : obj->y; } /*************************************** * Sets the position of an object ***************************************/ void fl_set_object_position( FL_OBJECT * obj, FL_Coord x, FL_Coord y ) { int need_show = 0; double diff; if ( fli_inverted_y ) y = obj->form->h - obj->h - y; if ( obj->x == x && obj->y == y ) return; /* If the object is displayed hide it to get its background redrawn */ if ( obj->visible ) { need_show = 1; fl_hide_object( obj ); } if ( x != obj->x ) { diff = x - obj->fl1; obj->fl1 += diff; obj->fl2 += diff; obj->fr1 -= diff; obj->fr2 -= diff; obj->x = x; } if ( y != obj->y ) { diff = y - obj->ft1; obj->ft1 += diff; obj->ft2 += diff; obj->fb1 -= diff; obj->fb2 -= diff; obj->y = y; } fli_handle_object( obj, FL_MOVEORIGIN, 0, 0, 0, NULL, 0 ); if ( need_show ) fl_show_object( obj ); } /*************************************** * Returns the size of an object ***************************************/ void fl_get_object_size( FL_OBJECT * obj, FL_Coord * w, FL_Coord * h ) { *w = obj->w; *h = obj->h; } /***************************** * Sets the size of an object *****************************/ void fl_set_object_size( FL_OBJECT * obj, FL_Coord w, FL_Coord h ) { int need_show = 0; double diff; if ( obj->w == w && obj->h == h ) return; if ( obj->visible ) { need_show = 1; fl_hide_object( obj ); } if ( w != obj->w ) { diff = w - ( obj->fl2 - obj->fl1 ); if ( HAS_FIXED_HORI_ULC_POS( obj ) ) { obj->fl2 += diff; obj->fr2 -= diff; } if ( HAS_FIXED_HORI_LRC_POS( obj ) ) { obj->fl1 -= diff; obj->fr1 += diff; } else /* keep center of gravity */ { diff *= 0.5; obj->fl1 -= diff; obj->fr1 += diff; obj->fl2 += diff; obj->fr2 -= diff; } obj->x = FL_crnd( obj->fl1 ); obj->w = FL_crnd( obj->fl2 - obj->fl1 ); } if ( h != obj->h ) { diff = h - ( obj->ft2 - obj->ft1 ); if ( HAS_FIXED_VERT_ULC_POS( obj ) ) { obj->ft2 += diff; obj->fb2 -= diff; } else if ( HAS_FIXED_VERT_LRC_POS( obj ) ) { obj->ft1 -= diff; obj->fb1 += diff; } else /* keep center of gravity */ { diff *= 0.5; obj->ft1 -= diff; obj->fb1 += diff; obj->ft2 += diff; obj->fb2 -= diff; } obj->y = FL_crnd( obj->ft1 ); obj->h = FL_crnd( obj->ft2 - obj->ft1 ); } fli_handle_object( obj, FL_RESIZED, 0, 0, 0, NULL, 0 ); /* If there are child objects also inform them about the size change */ if ( obj->child ) fli_composite_has_been_resized( obj ); if ( need_show ) fl_show_object( obj ); } /*************************************** * Returns the position and size of an object ***************************************/ void fl_get_object_geometry( FL_OBJECT * obj, FL_Coord * x, FL_Coord * y, FL_Coord * w, FL_Coord * h ) { fl_get_object_position( obj, x, y ); fl_get_object_size( obj, w, h ); } /*************************************** * Sets the position and size of an object ***************************************/ void fl_set_object_geometry( FL_OBJECT * obj, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h ) { fl_set_object_size( obj, w, h ); fl_set_object_position( obj, x, y ); } /*************************************** * Computes object geometry taking also the label into account ***************************************/ void fl_get_object_bbox( FL_OBJECT * obj, FL_Coord * x, FL_Coord * y, FL_Coord * w, FL_Coord * h ) { XRectangle rect; get_object_rect( obj, &rect, 0 ); *x = rect.x; if ( ! fli_inverted_y || ! obj->form ) *y = rect.y; else *y = obj->form->h - rect.height - rect.y; *w = rect.width; *h = rect.height; } /*************************************** ***************************************/ static XRectangle * get_label_rect( const FL_OBJECT * obj, XRectangle * rect ) { int sw, sh; int xx, yy, descent; if ( ! obj->label || ! *obj->label ) { rect->x = rect->y = rect->width = rect->height = 0; return rect; } fl_get_string_dimension( obj->lstyle, obj->lsize, obj->label, strlen( obj->label ), &sw, &sh ); fl_get_char_height( obj->lstyle, obj->lsize, NULL, &descent ); /* Some objects don't use the normal way of placing their label, for these use some approximation */ if ( ( obj->objclass == FL_ROUNDBUTTON && fl_is_center_lalign( obj->align ) ) || ( obj->objclass == FL_ROUND3DBUTTON && fl_is_center_lalign( obj->align ) ) || ( obj->objclass == FL_CHECKBUTTON && fl_is_inside_lalign( obj->align ) ) ) { rect->x = obj->x; rect->y = obj->y; rect->width = FL_min( obj->w, obj->w ) + sw; rect->height = sh + descent; } else { fl_get_align_xy( obj->align, obj->x, obj->y, obj->w, obj->h, sw, sh + descent, 3, 3, &xx, &yy ); rect->x = xx - 1; rect->y = yy; rect->width = sw + 1; rect->height = sh + descent; } return rect; } /*************************************** * Returns the area covered by the object and its label via a FL_RECT ***************************************/ static void get_object_rect( const FL_OBJECT * obj, FL_RECT * rect, int extra ) { if ( obj->objclass == FL_FRAME || obj->objclass == FL_LABELFRAME || obj->objclass == FL_CANVAS || obj->objclass == FL_GLCANVAS || ( obj->objclass >= FL_USER_CLASS_START && obj->objclass <= FL_USER_CLASS_END ) ) extra += FL_abs( obj->bw ); rect->x = obj->x - extra; rect->y = obj->y - extra; rect->width = obj->w + 2 * extra + 1; rect->height = obj->h + 2 * extra + 1; /* Include the label into the box - but only for labels that are not within the object. If "inside" labels extend beyond the limits of the object things look ugly anyway and it doesn't seem to make too much sense to slow down the program for this case. */ if ( obj->label && *obj->label && OL( obj ) ) { XRectangle lr; fli_combine_rectangles( rect, get_label_rect( obj, &lr ) ); } } /*************************************** ***************************************/ void fl_set_object_automatic( FL_OBJECT * obj, int flag ) { flag = flag ? 1 : 0; if ( obj->automatic == flag ) return; obj->automatic = flag; if ( obj->form ) { if ( flag ) obj->form->num_auto_objects++; else obj->form->num_auto_objects--; } fli_recount_auto_objects( ); } /*************************************** ***************************************/ int fl_object_is_automatic( FL_OBJECT * obj ) { if ( ! obj ) { M_err( "fl_object_is_automatic", "NULL object" ); return 0; } return obj->automatic; } /*************************************** ***************************************/ static void lose_focus( FL_OBJECT * obj ) { FL_FORM *form = obj->form; if ( ! form || ! obj->focus || obj != form->focusobj ) return; if ( obj == form->focusobj ) fli_handle_object( form->focusobj, FL_UNFOCUS, 0, 0, 0, NULL, 1 ); obj->focus = 0; /* Try to find some input object to give it the focus */ obj->input = 0; form->focusobj = fli_find_first( obj->form, FLI_FIND_INPUT, 0, 0 ); obj->input = 1; if ( obj == refocus ) refocus = form->focusobj ? form->focusobj : NULL; if ( form->focusobj ) fli_handle_object( form->focusobj, FL_FOCUS, 0, 0, 0, NULL, 0 ); } /*************************************** * Part of the public interface, not used within the library. * Calls a user supplied function on all objects of a form but stops * in between of the function, when called on one of the objects, * returns 0. The function also gets called for objects that mark the * begin and end of a group! ***************************************/ void fl_for_all_objects( FL_FORM * form, int ( * fp )( FL_OBJECT *, void * ), void * v ) { FL_OBJECT *obj; if ( ! form ) { M_err( "fl_for_all_objects", "NULL form" ); return; } if ( ! fp ) { M_err( "fl_for_all_objects", "NULL callback function" ); return; } for ( obj = bg_object( form ); obj && ! fp( obj, v ); obj = obj->next ) /* empty */ ; } /*************************************** ***************************************/ void fl_set_object_helper( FL_OBJECT * obj, const char * tip ) { if ( ! obj ) { M_err( "fl_set_object_helper", "NULL object" ); return; } fli_safe_free( obj->tooltip ); obj->tooltip = ( tip && *tip ) ? fl_strdup( tip ) : NULL; } /*************************************** ***************************************/ void fl_set_object_helper_f( FL_OBJECT * obj, const char * fmt, ... ) { char *buf; EXPAND_FORMAT_STRING( buf, fmt ); fl_set_object_helper( obj, buf ); fl_free( buf ); } /*************************************** * Function for setting the conditions under which an object gets * returned (or its callback invoked). If the object has to do * additional work on setting the condition (e.g. it has child * objects that also need to be set) it has to set up its own * function that then will be called in the end. This function should * only be called once an object has been fully created! ***************************************/ int fl_set_object_return( FL_OBJECT * obj, unsigned int when ) { int old_when; if ( ! obj ) return FL_RETURN_ALWAYS; old_when = obj->how_return; /* FL_RETURN_END_CHANGED means FL_RETURN and FL_RETURN_CHANGED at the same moment, so it those two events can't be set at the same time */ if ( when & FL_RETURN_END_CHANGED ) when &= ~ ( FL_RETURN_END | FL_RETURN_CHANGED ); if ( obj->set_return ) obj->set_return( obj, when ); else obj->how_return = when; return old_when; } /*************************************** ***************************************/ void fli_notify_object( FL_OBJECT * obj, int reason ) { if ( ! obj || ( reason != FL_ATTRIB && reason != FL_RESIZED && reason != FL_MOVEORIGIN ) ) return; fli_handle_object( obj, reason, 0, 0, 0, NULL, 0 ); } /*************************************** * Sets the visibility flag for an object and all its children * without inducing a redraw. Used e.g. in browser and multi- * line input object's code to switch scrollbars on and off. ***************************************/ void fli_set_object_visibility( FL_OBJECT * obj, int vis ) { if ( obj ) /* let's be careful... */ { obj->visible = vis; for ( obj = obj->child; obj; obj = obj->nc ) fli_set_object_visibility( obj, vis ); } } /*************************************** * Mouse wheel (release) event conversion to a key press event. * Returns 1 if a conversion took place, otherwise 0. ***************************************/ int fli_mouse_wheel_to_keypress( int * ev, int * key, void * xev ) { if ( ! ( *ev == FL_RELEASE && ( *key == FL_MBUTTON4 || *key == FL_MBUTTON5 ) ) ) return 0; *ev = FL_KEYPRESS; if ( xev ) { if ( shiftkey_down( ( ( XButtonEvent * ) xev )->state ) ) { ( ( XKeyEvent * ) xev )->state = 0; *key = *key == FL_MBUTTON4 ? FLI_1LINE_UP : FLI_1LINE_DOWN; } else if ( controlkey_down( ( ( XButtonEvent * ) xev )->state ) ) { ( ( XKeyEvent * ) xev )->state = 0; *key = *key == FL_MBUTTON4 ? XK_Prior : XK_Next; } else { ( ( XKeyEvent * ) xev )->state = 0; *key = *key == FL_MBUTTON4 ? FLI_HALFPAGE_UP : FLI_HALFPAGE_DOWN; } } return 1; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/symbols.c0000644000175000017500000010352012251566745012375 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file symbols.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Predefined symbols and rotuines for adding more symbols * * Public routines: * * fl_add_symbol(const char *name, FL_DRAWPTR how, int scalable); * fl_draw_symbol(const char *name, x, y, w, h, FL_COLOR col) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include #include #include #ifdef __EMX__ #include #endif #ifndef M_PI #define M_PI 3.141592654 #endif typedef struct { FL_DRAWPTR drawit; /* how to draw it */ char * name; /* symbol name */ int scalable; /* currently unused */ } SYMBOL; static SYMBOL * symbols = NULL; /* list of symbols */ static size_t nsymbols = 0; /* number of symbols */ #define swapit( type, a, b ) \ do { type a_; \ a_ = a; \ a = b; \ b = a_; \ } while ( 0 ) #define AddPoint( p, xp, yp ) \ do { p->x = xp; \ p->y = yp; \ p++; \ } while ( 0 ) #define ShrinkBox( x, y, w, h, d ) \ do { x += d; \ y += d; \ w -= 2 * ( d ); \ h -= 2 * ( d ); \ } while ( 0 ) /*************************************** * Check if the requested symbol exsits and return it (or NULL if it can't * be found) ***************************************/ static SYMBOL * find_symbol( const char * name ) { size_t i; for ( i = 0; i < nsymbols; i++ ) if ( ! strcmp( symbols[ i ].name, name ) ) break; return i < nsymbols ? symbols + i : NULL; } /******************* PUBLIC ROUTINES ******************{**/ /*************************************** ***************************************/ int fl_add_symbol( const char * name, FL_DRAWPTR drawit, int scalable FL_UNUSED_ARG ) { SYMBOL *s; if ( ! name ) name = ""; if ( isdigit( ( unsigned char ) *name ) || *name == '@' || ! drawit ) { M_warn( "fl_add_symbol", "Invalid argument" ); return 0; } if ( ! ( s = find_symbol( name ) ) ) { if ( ( s = fl_realloc( symbols, ++nsymbols * sizeof *symbols ) ) ) symbols = s; else { M_warn( "fl_add_symbol", "Out of memory" ); return 0; } s = symbols + nsymbols - 1; s->name = fl_strdup( name ); } s->drawit = drawit; s->scalable = scalable; return 1; } /*************************************** ***************************************/ int fl_delete_symbol( const char * name ) { SYMBOL *s; size_t pos; if ( ! name ) name = ""; if ( ! ( s = find_symbol( name ) ) ) return 0; pos = s - symbols ; fli_safe_free( s->name ); if ( pos < nsymbols - 1 ) memmove( s, s + 1, ( nsymbols - pos -1 ) * sizeof *symbols ); if ( ( s = fl_realloc( symbols, --nsymbols * sizeof *symbols ) ) ) symbols = s; return 1; } /*************************************** * Draws the symbol with the given label ***************************************/ int fl_draw_symbol( const char * label, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col ) { int pos, equalscale = 0; FL_Coord dx = 0, dy = 0; int rotated = 0, delta = 0; short defr[ ] = { 0, 225, 270, 315, 180, 0, 0, 135, 90, 45 }; SYMBOL *s; int orig_x = x, orig_y = y, orig_w = w, orig_h = h; int is_clipped = 0, clip_x, clip_y, clip_w, clip_h; if ( ! label || *label != '@' ) return 0; pos = 1; /* Check for character sequences that are for increasing or decreasing the size of the symbol, maintain the aspect ratio or indicate rotation. */ while ( label[ pos ] ) { if ( label[ pos ] == '-' && isdigit( ( unsigned char ) label[ pos + 1 ] ) && label[ pos + 1 ] != '0' ) { delta += label[ ++pos ] - '0'; ++pos; } else if ( label[ pos ] == '+' && isdigit( ( unsigned char ) label[ pos + 1 ] ) && label[ pos + 1 ] != '0' ) { delta -= label[ ++pos ] - '0'; ++pos; } else if ( label[ pos ] == '#' ) { equalscale = 1; ++pos; } else if ( isdigit( ( unsigned char ) label[ pos ] ) ) { if ( label[ pos ] == '0' ) { char *eptr; rotated = strtol( label + ++pos, &eptr, 10 ); pos = label - eptr; while ( rotated >= 360 ) rotated %= 360; while ( rotated < 0 ) rotated = 360 - ( -rotated % 360 ); } else rotated = defr[ label[ pos++ ] - '0' ]; } else break; } /* Check if the reminder of the string is a valid symbol */ if ( ! ( s = find_symbol( label + pos ) ) ) { M_err( "fl_draw_symbol", "Bad symbol: \"%s\"", label ); return 0; } if ( equalscale ) { dx = w > h ? ( w - h ) / 2 : 0; dy = w > h ? 0 : ( h - w ) / 2; w = h = FL_min( w, h ); } if ( delta ) ShrinkBox( x, y, w, h, delta ); if ( w <= 0 || h <= 0 ) return 1; /* For rotated of 90 or 180 degrees switch w and h and the bounding box */ if ( rotated == 90 || rotated == 270 ) { x += ( w - h ) / 2; y += ( h - w ) / 2; swapit( FL_Coord, w, h ); } if ( fl_is_clipped( 0 ) ) { is_clipped = 1; fl_get_clipping( 0, &clip_x, &clip_y, &clip_w, &clip_h ); fli_set_additional_clipping( orig_x, orig_y, orig_w, orig_h ); } else fl_set_clipping( orig_x, orig_y, orig_w, orig_h ); s->drawit( x + dx, y + dy, w, h, rotated, col ); if ( is_clipped ) fl_set_clipping( clip_x, clip_y, clip_w, clip_h ); else fl_unset_clipping( ); return 1; } /*********** END of PUBLIC ROTUINES ***********}**/ /*************************************** ***************************************/ static void rotate_it( FL_Coord xc, FL_Coord yc, FL_POINT xpnts[ ], int i, int a ) { FL_POINT *xp = xpnts, *xps = xpnts + i; if ( a == 0 || a == 360 ) return; if ( a == 180 ) for ( ; xp < xps; xp++ ) xp->x = 2 * xc - xp->x; else if ( a == 90 ) for ( ; xp < xps; xp++ ) { int tmp = xp->x; xp->x = xc + xp->y - yc; xp->y = yc - tmp + xc; } else if ( a == 270 ) for ( ; xp < xps; xp++ ) { int tmp = xp->x; xp->x = xc + xp->y - yc; xp->y = yc + tmp - xc; } #define FACT 0.707106781187 /* sin45 */ else if ( a == 45 ) for ( ; xp < xps; xp++ ) { double tmpx = xp->x - xc; double tmpy = xp->y - yc; xp->x = FL_nint( ( tmpx + tmpy ) * FACT + xc ); xp->y = FL_nint( ( - tmpx + tmpy ) * FACT + yc ); } else if ( a == 135 ) for ( ; xp < xps; xp++ ) { double tmpx = xp->x - xc; double tmpy = xp->y - yc; xp->x = FL_nint( ( - tmpx + tmpy ) * FACT + xc ); xp->y = FL_nint( ( - tmpx - tmpy ) * FACT + yc ); } else if ( a == 225 ) for ( ; xp < xps; xp++ ) { double tmpx = xp->x - xc; double tmpy = xp->y - yc; xp->x = FL_nint( ( - tmpx - tmpy ) * FACT + xc ); xp->y = FL_nint( ( tmpx - tmpy ) * FACT + yc ); } else if ( a == 315 ) for ( ; xp < xps; xp++ ) { double tmpx = xp->x - xc; double tmpy = xp->y - yc; xp->x = FL_nint( ( tmpx - tmpy ) * FACT + xc ); xp->y = FL_nint( ( tmpx + tmpy ) * FACT + yc ); } else { double sinfact = sin( a * M_PI / 180.0 ); double cosfact = cos( a * M_PI / 180.0 ); for ( ; xp < xps; xp++ ) { double tmpx = xp->x - xc; double tmpy = xp->y - yc; xp->x = FL_nint( xc + tmpx * cosfact + tmpy * sinfact ); xp->y = FL_nint( yc - tmpx * sinfact + tmpy * cosfact ); } } } /******************** THE DEFAULT SYMBOLS ****************************/ /*************************************** ***************************************/ static void draw_returnarrow( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle FL_UNUSED_ARG, FL_COLOR col ) { double wm = w * 0.5, hm = h * 0.5; int xc = FL_nint( x + wm ), yc = FL_nint( y + hm ); FL_POINT xpoint[ 8 ], *xp; xp = xpoint; AddPoint( xp, xc - 0.8 * wm, yc ); AddPoint( xp, xc - 0.1 * wm, yc - 0.6 * hm ); AddPoint( xp, xc - 0.1 * wm, yc + 0.6 * hm ); fl_polyf( xpoint, 3, col ); /* trailing line */ xp = xpoint + 4; AddPoint( xp, xc - 0.1 * wm, yc ); AddPoint( xp, xc + 0.8 * wm, yc ); AddPoint( xp, xc + 0.8 * wm, yc - 0.7 * hm ); fl_lines( xpoint + 4, 3, col ); fl_polyl( xpoint, 3, FL_BLACK ); } /*************************************** * Thin arrow --> ***************************************/ static void draw_long_arrow_right( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle, FL_COLOR col ) { int xc, yc, dx, dy; FL_POINT xpoint[ 5 ], *xp; int d = 3 + ( w + h ) * 0.03; xc = x + w / 2; yc = y + h / 2; ShrinkBox( x, y, w, h, d ); dx = 0.35 * w; dy = 0.08 * h; if ( dy < 1 ) dy = 1; xp = xpoint; AddPoint( xp, xc + dx, yc - dy ); AddPoint( xp, x + w - 1, yc ); AddPoint( xp, xc + dx, yc + dy ); rotate_it( xc, yc, xpoint, 3, angle ); fl_polyf( xpoint, 3, col ); fl_polyl( xpoint, 3, FL_BLACK ); xp = xpoint; AddPoint( xp, x, yc ); AddPoint( xp, xc + dx, yc ); AddPoint( xp, xc + dx, yc + 2 ); AddPoint( xp, x, yc + 2 ); rotate_it( xc, yc, xpoint, 4, angle ); fl_polyf( xpoint, 4, FL_BLACK ); } /*************************************** * An arrow -> ***************************************/ static void draw_arrow_right( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle, FL_COLOR col ) { double wm = ( w - 4 ) * 0.5, hm = ( h - 4 ) * 0.5; int xc = x + w / 2, yc = y + h / 2; FL_POINT xpoint[ 8 ], *xp; double pl = 0.8, ps = 0.4; int pshm = ps * hm + 0.1, plwm = pl * wm + 0.1, plhm = pl * hm + 0.1; xp = xpoint; AddPoint( xp, xc - plwm, yc + pshm ); AddPoint( xp, xc - plwm, yc - pshm ); AddPoint( xp, xc, yc - pshm ); AddPoint( xp, xc, yc - plhm ); AddPoint( xp, xc + plwm, yc ); AddPoint( xp, xc, yc + plhm ); AddPoint( xp, xc, yc + pshm ); rotate_it( xc, yc, xpoint, 7, angle ); fl_polyf( xpoint, 7, col ); fl_polyl( xpoint, 7, FL_BLACK ); } /*************************************** * Arrow head > ***************************************/ static void draw_arrow_tip_right( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle, FL_COLOR col ) { int xc = x + w / 2, yc = y + h / 2; FL_POINT xpoint[ 4 ], *xp; double wm = ( w - 4 ) * 0.5, hm = ( h - 4 ) * 0.5; double pl = 0.8, ps = 0.3; int pswm = ps * wm + 0.1, plhm = pl * hm + 0.1; xp = xpoint; AddPoint( xp, xc - pswm, yc - plhm ); AddPoint( xp, xc + 0.5 * wm, yc ); AddPoint( xp, xc - pswm, yc + plhm ); rotate_it( xc, yc, xpoint, 3, angle ); fl_polyf( xpoint, 3, col ); fl_polyl( xpoint, 3, FL_BLACK ); } /*************************************** * Double arrow head >> ***************************************/ static void draw_arrow_double_tip_right( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle, FL_COLOR col ) { int xc = x + w / 2 - 1, yc = y + h / 2; FL_POINT xpoint[ 9 ], *xp; double wm = ( w - 4 ) * 0.5, hm = ( h - 4 ) * 0.5; double pl = 0.7, ps = 0.15; int pswm = ps * wm + 0.1, plhm = pl * hm + 0.1; xp = xpoint; AddPoint( xp, xc + pswm, yc - plhm ); AddPoint( xp, xc + 0.82 * wm, yc ); AddPoint( xp, xc + pswm, yc + plhm ); rotate_it( xc, yc, xpoint, 3, angle ); pswm = 0.55 * wm + 0.1; xp = xpoint + 5; AddPoint( xp, xc - pswm, yc - plhm ); AddPoint( xp, xc + 0.12 * wm, yc ); AddPoint( xp, xc - pswm, yc + plhm ); rotate_it( xc, yc, xpoint + 5, 3, angle ); fl_polyf( xpoint, 3, col ); fl_polyf( xpoint + 5, 3, col ); fl_polyl( xpoint, 3, FL_BLACK ); fl_polyl( xpoint + 5, 3, FL_BLACK ); } /*************************************** ***************************************/ static void draw_arrow_left( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle, FL_COLOR col ) { if ( ( angle += 180 ) > 360 ) angle -= 360; draw_arrow_right( x, y, w, h, angle, col ); } /*************************************** ***************************************/ static void draw_arrow_tip_left( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle, FL_COLOR col ) { if ( ( angle += 180 ) > 360 ) angle -= 360; draw_arrow_tip_right( x, y, w, h, angle, col ); } /*************************************** ***************************************/ static void draw_arrow_double_tip_left( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle, FL_COLOR col ) { if ( ( angle += 180 ) > 360 ) angle -= 360; draw_arrow_double_tip_right( x, y, w, h, angle, col ); } /*************************************** ***************************************/ static void draw_circle( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle FL_UNUSED_ARG, FL_COLOR col ) { FL_Coord xo = x + w / 2, yo = y + h / 2; int rr, s = 3 + 0.04 * ( w + h ); ShrinkBox( x, y, w, h, s ); if ( ( rr = 0.5 * FL_min( w, h ) ) <= 0 ) rr = 1; fl_circf( xo, yo, rr, col ); fl_circ( xo, yo, rr, FL_BLACK ); } /*************************************** ***************************************/ static void draw_square( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle FL_UNUSED_ARG, FL_COLOR col ) { int s = ( 0.09 * w ) + 3; ShrinkBox( x, y, w, h, s ); if ( w <= 1 ) w = 2; if ( h <= 1 ) h = 2; fl_rectbound( x, y, w - 1, h - 1, col ); } /*************************************** ***************************************/ static void draw_plus( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle, FL_COLOR col ) { int wm = ( w - 4 ) * 0.5, hm = ( h - 4 ) * 0.5; int xc = x + 2 + wm, yc = y + 2 + hm; int plw = FL_nint( 0.8 * wm ), psh = FL_nint( 0.15 * hm ); int psw = FL_nint( 0.15 * wm ), plh = FL_nint( 0.8 * hm ); FL_POINT xpoint[ 13 ], *xp; xp = xpoint; AddPoint( xp, xc - plw, yc + psh ); AddPoint( xp, xc - plw, yc - psh ); AddPoint( xp, xc - psw, yc - psh ); AddPoint( xp, xc - psw, yc - plh ); AddPoint( xp, xc + psw, yc - plh ); AddPoint( xp, xc + psw, yc - psh ); AddPoint( xp, xc + plw, yc - psh ); AddPoint( xp, xc + plw, yc + psh ); AddPoint( xp, xc + psw, yc + psh ); AddPoint( xp, xc + psw, yc + plh ); AddPoint( xp, xc - psw, yc + plh ); AddPoint( xp, xc - psw, yc + psh ); rotate_it( xc, yc, xpoint, 12, angle ); fl_polyf( xpoint, 12, col ); fl_polyl( xpoint, 12, FL_BLACK ); } /*************************************** ***************************************/ static void draw_menu( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle FL_UNUSED_ARG, FL_COLOR col ) { FL_Coord wm = ( w - 8 ) * 0.5, hm = ( h - 8 ) * 0.5; int xc = x + w / 2, yc = y + h / 2; int dx = FL_nint( 0.6 * wm ), cur_x, cur_y; int shadow = FL_max( 2, 0.1 * FL_min( w, h ) ), t = FL_min( 2, 0.3 * hm ); cur_x = xc - dx; fl_rectbound( cur_x, yc - hm + 1, 2 * dx, t, col ); cur_y = yc - hm + t + t; fl_rectf( cur_x + shadow, cur_y + shadow, 2 * dx, 1.6 * hm, FL_RIGHT_BCOL ); fl_rectbound( cur_x, cur_y, 2 * dx, 1.6 * hm, col ); } /*************************************** ***************************************/ static void draw_line( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle, FL_COLOR col ) { FL_POINT xpoint[ 3 ], *xp; FL_Coord xc = x + w / 2, yc = y + h / 2; ShrinkBox( x, y, w, h, 3 ); xp = xpoint; AddPoint( xp, x, yc ); AddPoint( xp, x + w - 2, yc ); rotate_it( xc, yc, xpoint, 2, angle ); fl_line( xpoint[ 0 ].x, xpoint[ 0 ].y, xpoint[ 1 ].x, xpoint[ 1 ].y, col ); } /*************************************** ***************************************/ static void draw_ripplelines( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle, FL_COLOR col FL_UNUSED_ARG ) { int ym = y + ( h + 1 ) / 2, xm = x + ( w + 1 ) / 2; int xs, ys; xs = xm - 5; ys = ym - 5; if ( angle == 0 || angle == 180 ) { int i; for ( i = 0; i < 3; i++ ) { int mw = 3; fl_line( x + mw, ys, x + w - 2 - mw, ys, FL_LEFT_BCOL ); ys += 1; fl_line( x + mw, ys, x + w - 2 - mw, ys, FL_RIGHT_BCOL ); ys += 3; } } else if ( angle == 90 || angle == 270 ) { int e, i; y += ( h - w ) / 2; swapit( FL_Coord, w, h ); e = h < 15; for ( i = 0; i < 3; i++ ) { int mw = 3; fl_line( xs, y + mw - e, xs, y + h - 2 - mw + e, FL_LEFT_BCOL ); xs += 1; fl_line( xs, y + mw - e, xs, y + h - 2 - mw + e, FL_RIGHT_BCOL ); xs += 3; } } else fprintf( stderr, "RippleLine: unsupported angle %d\n", angle ); } /*************************************** * Draw a line that appears down ***************************************/ static void draw_dnline( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle, FL_COLOR col FL_UNUSED_ARG ) { FL_POINT xpnt[ 3 ], *xp; FL_Coord yc = y + h / 2; ShrinkBox( x, y, w, h, 3 ); xp = xpnt; AddPoint( xp, x, yc ); AddPoint( xp, x + w - 2, yc ); rotate_it( x + w / 2, yc, xpnt, 2, angle ); fl_line( xpnt[ 0 ].x, xpnt[ 0 ].y, xpnt[ 1 ].x, xpnt[ 1 ].y, FL_RIGHT_BCOL ); xp = xpnt; AddPoint( xp, x, yc + 1 ); AddPoint( xp, x + w - 1, yc + 1 ); rotate_it( x + w / 2, yc, xpnt, 2, angle ); fl_line( xpnt[ 0 ].x, xpnt[ 0 ].y, xpnt[ 1 ].x, xpnt[ 1 ].y, FL_LEFT_BCOL ); } /*************************************** ***************************************/ static void draw_upline( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle, FL_COLOR col FL_UNUSED_ARG ) { FL_POINT xpnt[ 3 ], *xp; FL_Coord yc = y + h / 2; ShrinkBox( x, y, w, h, 3 ); xp = xpnt; AddPoint( xp, x, yc ); AddPoint( xp, x + w - 2, yc ); rotate_it( x + w / 2, yc, xpnt, 2, angle ); fl_line( xpnt[ 0 ].x, xpnt[ 0 ].y, xpnt[ 1 ].x, xpnt[ 1 ].y, FL_LEFT_BCOL ); xp = xpnt; AddPoint( xp, x, yc + 1 ); AddPoint( xp, x + w - 1, yc + 1 ); rotate_it( x + w / 2, yc, xpnt, 2, angle ); fl_line( xpnt[ 0 ].x, xpnt[ 0 ].y, xpnt[ 1 ].x, xpnt[ 1 ].y, FL_RIGHT_BCOL ); } /*************************************** ***************************************/ static void draw_uparrow( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int a, FL_COLOR col FL_UNUSED_ARG ) { FL_Coord xc = x + ( w + 1 ) / 2, dx; FL_Coord yc = y + ( h + 1 ) / 2, dy; int d = 3 + ( w + h ) * 0.06; ShrinkBox( x, y, w, h, d ); if ( a == 90 ) { /* undo driver's transformation */ swapit( FL_Coord, w, h ); dx = w / 2; dy = h / 2; fl_line( xc, yc - dy, xc - dx, yc + dy, FL_LEFT_BCOL ); fl_line( xc, yc - dy, xc + dx, yc + dy, FL_RIGHT_BCOL ); fl_line( xc - dx, yc + dy, xc + dx, yc + dy, FL_BOTTOM_BCOL ); } else if ( a == 270 ) { swapit( FL_Coord, w, h ); dx = w / 2; dy = h / 2; fl_line( xc - dx, yc - dy, xc + dx, yc - dy, FL_TOP_BCOL ); fl_line( xc + dx, yc - dy, xc , yc + dy, FL_RIGHT_BCOL ); fl_line( xc, yc + dy, xc - dx, yc - dy, FL_LEFT_BCOL ); } else if ( a == 180 ) { dy = h / 2; dx = w / 2; fl_line( xc - dx, yc, xc + dx, yc - dy, FL_LEFT_BCOL ); fl_line( xc + dx, yc - dy, xc + dx, yc + dy, FL_RIGHT_BCOL ); fl_line( xc + dx, yc + dy, xc - dx, yc, FL_BOTTOM_BCOL ); } else { dx = w / 2; dy = h / 2; fl_line( xc - dx, yc - dy, xc + dx, yc, FL_TOP_BCOL ); fl_line( xc - dx, yc + dy, xc + dx, yc, FL_RIGHT_BCOL ); fl_line( xc - dx, yc - dy, xc - dx, yc + dy, FL_LEFT_BCOL ); } } /*************************************** ***************************************/ static void draw_dnarrow( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int a, FL_COLOR col FL_UNUSED_ARG ) { FL_Coord xc = x + ( w + 1 ) / 2, dx; FL_Coord yc = y + ( h + 1 ) / 2, dy; int d = 3 + ( w + h ) * 0.06; ShrinkBox( x, y, w, h, d ); if ( a == 90 ) { /* undo driver's transformation */ swapit( FL_Coord, w, h ); dx = w / 2; dy = h / 2; fl_line( xc, yc - dy, xc - dx, yc + dy, FL_RIGHT_BCOL ); fl_line( xc, yc - dy, xc + dx, yc + dy, FL_LEFT_BCOL ); fl_line( xc - dx, yc + dy, xc + dx, yc + dy, FL_TOP_BCOL ); } else if ( a == 270 ) { swapit( FL_Coord, w, h ); dx = w / 2; dy = h / 2; fl_line( xc - dx, yc - dy, xc + dx, yc - dy, FL_BOTTOM_BCOL ); fl_line( xc + dx, yc - dy, xc, yc + dy, FL_LEFT_BCOL ); fl_line( xc, yc + dy, xc - dx, yc - dy, FL_RIGHT_BCOL ); } else if ( a == 180 ) { dy = h / 2; dx = w / 2; fl_line( xc - dx, yc, xc + dx, yc - dy, FL_RIGHT_BCOL ); fl_line( xc + dx, yc - dy, xc + dx, yc + dy, FL_LEFT_BCOL ); fl_line( xc + dx, yc + dy, xc - dx, yc, FL_BOTTOM_BCOL ); } else { dx = w / 2; dy = h / 2; fl_line( xc - dx, yc - dy, xc - dx, yc + dy, FL_RIGHT_BCOL ); fl_line( xc - dx, yc - dy, xc + dx, yc, FL_RIGHT_BCOL ); fl_line( xc - dx, yc + dy, xc + dx, yc, FL_TOP_BCOL ); } } /*************************************** * Double arrow <-->. Partition the space into 1/4 1/2 1/4 ***************************************/ static void draw_double_arrow( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle, FL_COLOR col ) { int xc = x + w / 2, yc = y + h / 2; double wm = ( w - 4 ) * 0.5, hm = ( h - 4 ) * 0.5; int dx1 = 0.5 * wm + 0.2, dx2 = 0.9 * wm + 0.2; int dy1 = 0.3 * hm + 0.2, dy2 = 0.7 * hm + 0.2; FL_POINT xpoint[ 11 ], *xp; xp = xpoint; AddPoint( xp, xc - dx1, yc - dy1 ); AddPoint( xp, xc + dx1, yc - dy1 ); AddPoint( xp, xc + dx1, yc - dy2 ); AddPoint( xp, xc + dx2, yc ); AddPoint( xp, xc + dx1, yc + dy2 ); AddPoint( xp, xc + dx1, yc + dy1 ); AddPoint( xp, xc - dx1, yc + dy1 ); AddPoint( xp, xc - dx1, yc + dy2 ); AddPoint( xp, xc - dx2, yc ); AddPoint( xp, xc - dx1, yc - dy2 ); rotate_it( xc, yc, xpoint, 10, angle ); fl_polyf( xpoint, 10, col ); fl_polyl( xpoint, 10, FL_BLACK ); } /*************************************** * Arrow with a bar ->| ***************************************/ static void draw_arrow_bar_right( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle, FL_COLOR col ) { double wm = ( w - 6 ) * 0.5, hm = ( h - 6 ) * 0.5; int xc = x + w / 2, yc = y + h / 2; FL_POINT xpoint[ 8 ], *xp; double pl = 0.8, ps = 0.4; int pshm = ps * hm + 0.1, plwm = pl * wm + 0.1, plhm = pl * hm + 0.1; xp = xpoint; xc--; AddPoint( xp, xc - plwm, yc + pshm ); AddPoint( xp, xc - plwm, yc - pshm ); AddPoint( xp, xc, yc - pshm ); AddPoint( xp, xc, yc - plhm ); AddPoint( xp, xc + plwm, yc ); AddPoint( xp, xc, yc + plhm ); AddPoint( xp, xc, yc + pshm ); rotate_it( xc, yc, xpoint, 7, angle ); fl_polyf( xpoint, 7, col ); fl_polyl( xpoint, 7, FL_BLACK ); xp = xpoint; xc++; AddPoint( xp, xc + plwm + 1, yc + plhm ); AddPoint( xp, xc + plwm + 1, yc - plhm ); AddPoint( xp, xc + ( 0.9 * plwm ), yc - plhm ); AddPoint( xp, xc + ( 0.9 * plwm ), yc + plhm ); rotate_it( xc, yc, xpoint, 4, angle ); fl_polyf( xpoint, 4, col ); fl_polyl( xpoint, 4, FL_BLACK ); } /*************************************** * Same as arrow_bar_right ->|, but reversed ***************************************/ static void draw_arrow_bar_left( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle, FL_COLOR col ) { if ( ( angle += 180 ) >= 360 ) angle -= 360; draw_arrow_bar_right( x, y, w, h, angle, col ); } /*************************************** * An arrow head with a bar, >| ***************************************/ static void draw_arrow_tip_bar_right( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle, FL_COLOR col ) { int xc = x + w / 2, yc = y + h / 2; FL_POINT xpoint[ 5 ], *xp; double wm = ( w - 6 ) * 0.5, hm = ( h - 6 ) * 0.5; double pl = 0.8, ps = 0.45; int pswm = ps * wm + 0.1, plhm = pl * hm + 0.1; xp = xpoint; AddPoint( xp, xc - pswm, yc - plhm ); AddPoint( xp, xc + pswm, yc ); AddPoint( xp, xc - pswm, yc + plhm ); rotate_it( xc, yc, xpoint, 3, angle ); fl_polyf( xpoint, 3, col ); fl_polyl( xpoint, 3, FL_BLACK ); xp = xpoint; AddPoint( xp, xc + pswm + 2, yc + plhm ); AddPoint( xp, xc + pswm + 2, yc - plhm ); AddPoint( xp, xc + 0.9 * pswm, yc - plhm ); AddPoint( xp, xc + 0.9 * pswm, yc + plhm ); rotate_it( xc, yc, xpoint, 4, angle ); fl_polyf( xpoint, 4, col ); fl_polyl( xpoint, 4, FL_BLACK ); } /*************************************** * Same as arrow_tip_bar_right >|, but reversed, i.e. |< ***************************************/ static void draw_arrow_tip_bar_left( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle, FL_COLOR col ) { if ( ( angle += 180 ) >= 360 ) angle -= 360; draw_arrow_tip_bar_right( x, y, w, h, angle, col ); } /*************************************** ***************************************/ static void draw_bar_arrow_tip_right( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle, FL_COLOR col ) { int xc = x + ( w - 1 ) / 2, yc = y + ( h - 1 ) / 2; int dx, dy, dbar, mar, xl; int d = 2 + ( w + h ) * 0.07; FL_POINT point[ 5 ], *p; ShrinkBox( x, y, w, h, d ); dx = w / 2; dy = h / 2; dbar = dx * 0.4; mar = 0.2 * dx; xl = xc - dx + 1.1 * mar; p = point; AddPoint( p, xl, yc - dy ); AddPoint( p, xl + dbar, yc - dy ); AddPoint( p, xl + dbar, yc + dy ); AddPoint( p, xl, yc + dy ); rotate_it( xc, yc, point, 4, angle ); fl_polyf( point, 4, col ); fl_polyl( point, 4, FL_RIGHT_BCOL ); p = point; AddPoint( p, xc - mar, yc - dy ); AddPoint( p, xc - mar + dx, yc ); AddPoint( p, xc - mar, yc + dy ); rotate_it( xc, yc, point, 3, angle ); fl_polyf( point, 3, col ); fl_polyl( point, 3, FL_RIGHT_BCOL ); } /*************************************** ***************************************/ static void draw_bar_arrow_tip_left( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int angle, FL_COLOR col ) { if ( ( angle += 180 ) >= 360 ) angle -= 360; draw_bar_arrow_tip_right( x, y, w, h, angle, col ); } /*************************************** ***************************************/ void fli_init_symbols( void ) { if ( symbols ) return; fl_add_symbol( "", draw_arrow_right, 1 ); fl_add_symbol( "->", draw_arrow_right, 1 ); fl_add_symbol( ">", draw_arrow_tip_right, 1 ); fl_add_symbol( ">>", draw_arrow_double_tip_right, 1 ); fl_add_symbol( "<-", draw_arrow_left, 1 ); fl_add_symbol( "<", draw_arrow_tip_left, 1 ); fl_add_symbol( "<<", draw_arrow_double_tip_left, 1 ); fl_add_symbol( "returnarrow", draw_returnarrow, 1 ); fl_add_symbol( "circle", draw_circle, 1 ); fl_add_symbol( "square", draw_square, 1 ); fl_add_symbol( "plus", draw_plus, 1 ); fl_add_symbol( "menu", draw_menu, 1 ); fl_add_symbol( "line", draw_line, 1 ); fl_add_symbol( "=", draw_ripplelines, 1 ); fl_add_symbol( "DnLine", draw_dnline, 1 ); fl_add_symbol( "UpLine", draw_upline, 1 ); fl_add_symbol( "UpArrow", draw_uparrow, 1 ); fl_add_symbol( "DnArrow", draw_dnarrow, 1 ); fl_add_symbol( "-->", draw_long_arrow_right, 1 ); fl_add_symbol( "<->", draw_double_arrow, 1 ); fl_add_symbol( "->|", draw_arrow_bar_right, 1 ); fl_add_symbol( "|<-", draw_arrow_bar_left, 1 ); fl_add_symbol( ">|", draw_arrow_tip_bar_right, 1 ); fl_add_symbol( "|<", draw_arrow_tip_bar_left, 1 ); fl_add_symbol( "|>", draw_bar_arrow_tip_right, 1 ); fl_add_symbol( "<|", draw_bar_arrow_tip_left, 1 ); /* aliases */ fl_add_symbol( "arrow", draw_long_arrow_right, 1 ); fl_add_symbol( "RippleLines", draw_ripplelines, 1 ); fl_add_symbol( "+", draw_plus, 1 ); } /*************************************** ***************************************/ void fli_release_symbols( void ) { while ( nsymbols > 0 ) fl_delete_symbol( symbols[ nsymbols - 1 ].name ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/forms.c0000664000175000017500000017665012353623325012042 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file forms.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Main event dispatcher. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" #include "flinternal.h" #include "private/flvasprintf.h" #define PointToPixel( a ) FL_crnd( ( a ) * fl_dpi / 72.0 ) #define MMToPixel( a ) FL_crnd( ( a ) * fl_dpi / 25.4 ) #define CMMToPixel( a ) FL_crnd( ( a ) * fl_dpi / 2540.0 ) #define CPointToPixel( a ) FL_crnd( ( a ) * fl_dpi / 7200.0 ) static FL_FORM * create_new_form( FL_Coord, FL_Coord ); static void force_visible( FL_FORM * ); static void set_form_property( FL_FORM *, unsigned int ); static void get_decoration_sizes_from_wm( Atom , FL_FORM *, int *, int *, int *, int * ); static void get_decorations_sizes_from_parent( FL_FORM *, int *, int *, int *, int * ); static FL_FORM * fli_mainform; static int nomainform; static int reopened_group = 0; FL_FORM * fli_fast_free_object = NULL; /* exported to objects.c */ static int has_initial; /*************************************** * Returns the index of a form in the list of visible forms * (or -1 if the form isn't in this list) ***************************************/ int fli_get_visible_forms_index( FL_FORM * form ) { int i; for ( i = 0; i < fli_int.formnumb; i++ ) if ( fli_int.forms[ i ] == form ) return i; return -1; } /*************************************** * Returns the index of a form in the list of hidden forms * (or -1 if the form isn't in this list) ***************************************/ static int get_hidden_forms_index( FL_FORM * form ) { int i; for ( i = fli_int.formnumb; i < fli_int.formnumb + fli_int.hidden_formnumb; i++ ) if ( fli_int.forms[ i ] == form ) return i; return -1; } /*************************************** * Extend the list of forms by one element and appends the * new forms address (listing it as invisible) ***************************************/ static void add_form_to_hidden_list( FL_FORM * form ) { fli_int.forms = realloc( fli_int.forms, ( fli_int.formnumb + fli_int.hidden_formnumb + 1 ) * sizeof *fli_int.forms ); fli_int.forms[ fli_int.formnumb + fli_int.hidden_formnumb++ ] = form; } /*************************************** * Moves a form from the list of hidden to the list of visible forms ***************************************/ static int move_form_to_visible_list( FL_FORM * form ) { int i; /* Find the index of the hidden form */ if ( fli_int.hidden_formnumb == 0 || ( i = get_hidden_forms_index( form ) ) < 0 ) { M_err( "move_form_to_visble_list", "Form not in hidden list" ); return -1; } /* If it's not at the very start of the hidden list exchange it with the one at the start */ if ( i != fli_int.formnumb ) { fli_int.forms[ i ] = fli_int.forms[ fli_int.formnumb ]; fli_int.forms[ fli_int.formnumb ] = form; } fli_int.hidden_formnumb--; if ( form->num_auto_objects > 0 ) fli_int.auto_count++; return ++fli_int.formnumb; } /*************************************** * Moves a form from the list of visible to the list of hidden forms ***************************************/ static int move_form_to_hidden_list( FL_FORM * form ) { int i; /* Find the index of the form to be moved to the hidden list */ if ( fli_int.formnumb == 0 || ( i = fli_get_visible_forms_index( form ) ) < 0 ) { M_err( "move_form_to_hidden_list", "Form not in visible list" ); return -1; } /* Unless the form is the last in the visible list exchange it with the form at the end of the visible list */ if ( i != --fli_int.formnumb ) { fli_int.forms[ i ] = fli_int.forms[ fli_int.formnumb ]; fli_int.forms[ fli_int.formnumb ] = form; } fli_int.hidden_formnumb++; if ( form->num_auto_objects > 0 ) { if ( fli_int.auto_count == 0 ) M_err( "move_form_to_hidden_list", "Bad auto count" ); else fli_int.auto_count--; } return fli_int.formnumb; } /*************************************** * Removes a form from the list of hidden forms, * shortening the list in the process ***************************************/ int remove_form_from_hidden_list( FL_FORM * form ) { int i; /* Find the index of the form to be removed completely from the hidden list */ if ( fli_int.hidden_formnumb == 0 || ( i = get_hidden_forms_index( form ) ) < 0 ) { M_err( "remove_form_from_hidden_list", "Form not in hidden list" ); return -1; } /* If it's not the form at the end of the hidden list exchange it with the one at the end */ if ( i != fli_int.formnumb + --fli_int.hidden_formnumb ) fli_int.forms[ i ] = fli_int.forms[ fli_int.formnumb + fli_int.hidden_formnumb ]; /* Shorten the list of visible and hidden forms by one element */ fli_int.forms = fl_realloc( fli_int.forms, ( fli_int.formnumb + fli_int.hidden_formnumb ) * sizeof *fli_int.forms ); return fli_int.formnumb; } /*************************************** * Returns the (visible) form that's shown in 'win' ***************************************/ FL_FORM * fl_win_to_form( Window win ) { int i; if ( win == None ) return NULL; for ( i = 0; i < fli_int.formnumb; i++ ) if ( fli_int.forms[ i ]->window == win ) return fli_int.forms[ i ]; return NULL; } /*************************************** * Creates a new, empty form ***************************************/ static FL_FORM * create_new_form( FL_Coord w, FL_Coord h ) { FL_FORM *form; form = fl_calloc( 1, sizeof *form ); /* Convert non-pixel unit into pixles */ switch ( fli_cntl.coordUnit ) { case FL_COORD_PIXEL : break; case FL_COORD_MM : w = MMToPixel( w ); h = MMToPixel( h ); break; case FL_COORD_POINT : w = PointToPixel( w ); h = PointToPixel( h ); break; case FL_COORD_centiPOINT : w = CPointToPixel( w ); h = CPointToPixel( h ); break; case FL_COORD_centiMM : w = CMMToPixel( w ); h = CMMToPixel( h ); break; default : M_err( "create_new_form", "Unknown unit: %d, using pixel", fli_cntl.coordUnit ); fli_cntl.coordUnit = FL_COORD_PIXEL; } /* Initialize pointers and non-zero defaults */ form->w_hr = form->w = w; form->h_hr = form->h = h; form->handle_dec_x = 0; form->handle_dec_y = 0; form->num_auto_objects = 0; form->deactivated = 1; form->form_callback = NULL; form->compress_mask = ExposureMask | ButtonMotionMask | PointerMotionMask; form->key_callback = NULL; form->push_callback = NULL; form->crossing_callback = NULL; form->focusobj = NULL; form->first = NULL; form->last = NULL; form->hotx = form->hoty = -1; form->use_pixmap = fli_cntl.doubleBuffer; form->label = NULL; form->flpixmap = NULL; form->u_vdata = NULL; form->close_callback = NULL; form->close_data = NULL; form->icon_pixmap = form->icon_mask = None; form->in_redraw = 0; form->needs_full_redraw = 1; return form; } /*************************************** * Starts a form definition ***************************************/ FL_FORM * fl_bgn_form( int type, FL_Coord w, FL_Coord h ) { if ( ! fli_no_connection && ! flx->display ) { M_err( "fl_bgn_form", "Missing or failed call of fl_initialize()" ); exit( 1 ); } /* Check that we're not already in a form definition - the error is a serious one and can't be fixed easily as it might be due to a bad recursion */ if ( fl_current_form ) { M_err( "fl_bgn_form", "You forgot to call fl_end_form" ); exit( 1 ); } /* Create a new form */ fl_current_form = create_new_form( w, h ); /* Add it to the list of still hidden forms */ add_form_to_hidden_list( fl_current_form ); /* Each form has an empty box, covering the whole form as its first object */ fl_add_box( type, 0, 0, w, h, "" ); return fl_current_form; } /*************************************** * Ends a form definition ***************************************/ void fl_end_form( void ) { FL_FORM * f = fl_current_form; if ( ! fl_current_form ) { M_err( "fl_end_form", "No current form" ); return; } if ( fli_current_group ) { M_err( "fl_end_form", "You forgot to call fl_end_group." ); fl_end_group( ); } fl_current_form = NULL; /* Now is the proper time for calculating the overlaps of objects */ fli_recalc_intersections( f ); if ( f->visible && ! f->frozen ) fl_redraw_form( f ); } /*************************************** * Reopens a form for adding further objects ***************************************/ FL_FORM * fl_addto_form( FL_FORM * form ) { if ( ! form ) { M_err( "fl_addto_form", "NULL form" ); return NULL; } /* We can't open a form for adding objects when another form has already been opened for the same purpose */ if ( fl_current_form && fl_current_form != form ) { M_err( "fl_addto_form", "You forgot to call fl_end_form" ); return NULL; } if ( fl_current_form ) M_warn( "fl_addto_form", "Form was never closed." ); return fl_current_form = form; } /*************************************** * Starts a group definition by adding an object of type FL_BEGIN_GROUP ***************************************/ FL_OBJECT * fl_bgn_group( void ) { static int id = 1; if ( ! fl_current_form ) { M_err( "fl_bgn_group", "NULL form" ); return NULL; } if ( fli_current_group ) { M_err( "fl_bgn_group", "You forgot to call fl_end_group." ); fl_end_group( ); } fli_current_group = fl_make_object( FL_BEGIN_GROUP, 0, 0, 10, 10, 0, "", NULL ); fli_current_group->group_id = id++; /* Temporarily set the object class to something invalid since fl_add_object() will not add objects of class FL_BEGIN_GROUP */ fli_current_group->objclass = FL_INVALID_CLASS; fl_add_object( fl_current_form, fli_current_group ); fli_current_group->objclass = FL_BEGIN_GROUP; return fli_current_group; } /*************************************** * Ends a group definition by adding an object of type FL_END_GROUP ***************************************/ FL_OBJECT * fli_end_group( void ) { FL_OBJECT *obj; int id; if ( ! fl_current_form ) { M_err( "fl_end_group", "NULL form" ); return NULL; } if ( ! fli_current_group ) { M_err( "fl_end_group", "NULL group." ); return NULL; } obj = fli_current_group; id = obj->group_id; fli_current_group = NULL; if ( ! reopened_group ) { obj = fl_make_object( FL_END_GROUP, 0, 0, 0, 0, 0, "", NULL ); obj->group_id = id; /* Temporarily set the object class to something invalid since fl_add_object() will not add objects of class FL_END_GROUP */ obj->objclass = FL_INVALID_CLASS; fl_add_object( fl_current_form, obj ); obj->objclass = FL_END_GROUP; } if ( reopened_group == 2 ) fl_end_form( ); reopened_group = 0; return obj; } /*************************************** * Necessary since the public interface function for ending a group * doesn't have a return value ***************************************/ void fl_end_group( void ) { fli_end_group( ); } /*************************************** * "Freezes" all (shown) forms ***************************************/ void fl_freeze_all_forms( void ) { int i; for ( i = 0; i < fli_int.formnumb; i++ ) fl_freeze_form( fli_int.forms[ i ] ); } /*************************************** * "Unfreezes" all (shown) forms ***************************************/ void fl_unfreeze_all_forms( void ) { int i; for ( i = 0; i < fli_int.formnumb; i++ ) fl_unfreeze_form( fli_int.forms[ i ] ); } /*************************************** * Corrects the shape of the form based on the shape of its window ***************************************/ static void reshape_form( FL_FORM * form ) { FL_Coord w, h, dummy; int top, right, bottom, left; if ( ( ! form->handle_dec_x && ! form->handle_dec_y ) || form->wm_border == FL_NOBORDER ) { fl_get_wingeometry( form->window, &form->x, &form->y, &w, &h ); fl_set_form_size( form, w, h ); return; } fl_get_decoration_sizes( form, &top, &right, &bottom, &left ); if ( form->handle_dec_x && ! form->handle_dec_y ) { fl_get_wingeometry( form->window, &dummy, &form->y, &w, &h ); form->x -= left; } else if ( ! form->handle_dec_x && form->handle_dec_y ) { fl_get_wingeometry( form->window, &form->x, &dummy, &w, &h ); form->y -= bottom; } else { fl_get_wingeometry( form->window, &dummy, &dummy, &w, &h ); form->x -= left; form->y -= bottom; } XMoveWindow( flx->display, form->window, form->x, form->y ); fl_set_form_size( form, w, h ); } /*************************************** * Scale a form with the given scaling factors and take care of object * gravity. This one differs from fl_scale_form() in that we don't * reshape the window in any way. Most useful as a follow up to a * ConfigureNotify event ***************************************/ void fli_scale_form( FL_FORM * form, double xsc, double ysc ) { FL_OBJECT *obj; double neww = form->w_hr * xsc, newh = form->h_hr * ysc; if ( FL_abs( neww - form->w ) < 1 && FL_abs( newh - form->h ) < 1 ) return; form->w_hr = neww; form->h_hr = newh; form->w = FL_crnd( neww ); form->h = FL_crnd( newh ); if ( form->hotx >= 0 || form->hoty >= 0 ) { form->hotx = form->hotx * xsc; form->hoty = form->hoty * ysc; } /* Need to handle different resizing request */ for ( obj = form->first; obj; obj = obj->next ) { double oldw = obj->fl2 - obj->fl1; double oldh = obj->ft2 - obj->ft1; /* Special case to keep the center of gravity of objects that have no gravity set and aren't to be resized */ if ( obj->resize == FL_RESIZE_NONE && obj->segravity == FL_NoGravity && obj->nwgravity == FL_NoGravity ) { obj->fl1 += ( xsc - 1 ) * ( obj->fl1 + 0.5 * oldw ); obj->ft1 += ( ysc - 1 ) * ( obj->ft1 + 0.5 * oldh ); obj->fr1 = neww - obj->fl1; obj->fb1 = newh - obj->ft1; obj->fl2 = obj->fl1 + oldw; obj->ft2 = obj->ft1 + oldh; obj->fr2 = neww - obj->fl2; obj->fb2 = newh - obj->ft2; } else { /* In all other cases we recalculate the position of the upper left hand and the lower right hand corner of the object relative to all the borders of the form enclosing it, taking gravity and resizing setting into account. The results sometimes can be unexpected but hopefully are logically correct;-) */ if ( ULC_POS_LEFT_FIXED( obj ) ) obj->fr1 = neww - obj->fl1; else if ( ULC_POS_RIGHT_FIXED( obj ) ) obj->fl1 = neww - obj->fr1; if ( LRC_POS_LEFT_FIXED( obj ) ) obj->fr2 = neww - obj->fl2; else if ( LRC_POS_RIGHT_FIXED( obj ) ) obj->fl2 = neww - obj->fr2; if ( ! HAS_FIXED_HORI_ULC_POS( obj ) ) { if ( HAS_FIXED_HORI_LRC_POS( obj ) ) { if ( obj->resize & FL_RESIZE_X ) obj->fl1 = obj->fl2 - xsc * oldw; else obj->fl1 = obj->fl2 - oldw; } else obj->fl1 *= xsc; obj->fr1 = neww - obj->fl1; } if ( ! HAS_FIXED_HORI_LRC_POS( obj ) ) { if ( obj->resize & FL_RESIZE_X ) obj->fl2 = obj->fl1 + xsc * oldw; else obj->fl2 = obj->fl1 + oldw; obj->fr2 = neww - obj->fl2; } if ( ULC_POS_TOP_FIXED( obj ) ) obj->fb1 = newh - obj->ft1; else if ( ULC_POS_BOTTOM_FIXED( obj ) ) obj->ft1 = newh - obj->fb1; if ( LRC_POS_TOP_FIXED( obj ) ) obj->fb2 = newh - obj->ft2; else if ( LRC_POS_BOTTOM_FIXED( obj ) ) obj->ft2 = newh - obj->fb2; if ( ! HAS_FIXED_VERT_ULC_POS( obj ) ) { if ( HAS_FIXED_VERT_LRC_POS( obj ) ) { if ( obj->resize & FL_RESIZE_Y ) obj->ft1 = obj->ft2 - ysc * oldh; else obj->ft1 = obj->ft2 - oldh; } else obj->ft1 *= ysc; obj->fb1 = newh - obj->ft1; } if ( ! HAS_FIXED_VERT_LRC_POS( obj ) ) { if ( obj->resize & FL_RESIZE_Y ) obj->ft2 = obj->ft1 + ysc * oldh; else obj->ft2 = obj->ft1 + oldh; obj->fb2 = newh - obj->ft2; } } obj->x = FL_crnd( obj->fl1 ); obj->y = FL_crnd( obj->ft1 ); obj->w = FL_crnd( obj->fl2 - obj->fl1 ); obj->h = FL_crnd( obj->ft2 - obj->ft1 ); } /* Only notify objects now - parent objects might have to adjust sizes and positions of child objects and when objects get the resize notice immediately after resizing above then the parent object gets it first, sets a different size for the child, which then is overwritten */ for ( obj = form->first; obj; obj = obj->next ) fli_handle_object( obj, FL_RESIZED, 0, 0, 0, NULL, 0 ); fli_recalc_intersections( form ); } /*************************************** * Externally visible routine to scale a form. Needs to reshape the window. ***************************************/ void fl_scale_form( FL_FORM * form, double xsc, double ysc ) { if ( ! form ) { M_err( "fl_scale_form", "NULL form" ); return; } if ( FL_crnd( form->w_hr * xsc ) == form->w && FL_crnd( form->h_hr * ysc ) == form->h ) return; fli_scale_form( form, xsc, ysc ); /* Resize the window */ if ( form->visible == FL_VISIBLE ) fl_winresize( form->window, form->w, form->h ); } /*************************************** * Sets lower limits for the width and height of a form ***************************************/ void fl_set_form_minsize( FL_FORM * form, FL_Coord w, FL_Coord h ) { if ( ! form ) { M_err( "fl_set_form_minsize", "Null form" ); return; } fl_winminsize( form->window, w, h ); } /*************************************** * Sets upper limits for the width and height of a form ***************************************/ void fl_set_form_maxsize( FL_FORM * form, FL_Coord w, FL_Coord h ) { if ( ! form ) { M_err( "fl_set_form_maxsize", "NULL form" ); return; } fl_winmaxsize( form->window, w, h ); } /*************************************** * Switches double buffering for forms on or off (with double buffering * on we draw first to a pixmap for the form before copying that to the * forms window - can reduces flickering) ***************************************/ void fl_set_form_dblbuffer( FL_FORM * form, int yesno ) { if ( ! form ) { M_err( "fl_set_form_dblbuffer", "NULL form" ); return; } if ( form->use_pixmap == yesno ) return; /* If the form is currently frozen the redraw on unfreeze will only draw those objects that have been changed and thus have their 'redraw' flag set. But when switching double buffering on there's no pixmap yet that already contains the non-modified objects. Thus in this case we must make sure all objects of the form get redrawn. */ if ( yesno && form->frozen ) form->needs_full_redraw = 1; form->use_pixmap = yesno; } /*************************************** * Sets the size of a form ***************************************/ void fl_set_form_size( FL_FORM * form, FL_Coord w, FL_Coord h ) { if ( ! form ) { M_err( "fl_set_form_size", "NULL form" ); return; } if ( w != form->w || h != form->h ) fl_scale_form( form, w / form->w_hr, h / form->h_hr ); } /*************************************** * Sets the position of a form ***************************************/ void fl_set_form_position( FL_FORM * form, FL_Coord x, FL_Coord y ) { FL_Coord oldx, oldy; if ( ! form ) { M_err( "fl_set_form_position", "NULL form" ); return; } oldx = form->x; oldy = form->y; /* Negative values for x or y are interpreted as meaning that the position is that of the right or bottom side of the form relative to the right or bottom side to the screen. May have to be corrected for the right or bottom border decoration widths. */ if ( x >= 0 ) { form->x = x; form->handle_dec_x = 0; } else { form->x = fl_scrw - form->w + x; form->handle_dec_x = 1; } if ( y >= 0 ) { form->y = y; form->handle_dec_y = 0; } else { form->y = fl_scrh - form->h + y; form->handle_dec_y = 1; } /* If the form is already shown move it */ if ( form->visible == FL_VISIBLE ) { int bottom = 0, left = 0, dummy; if ( ( form->handle_dec_x || form->handle_dec_y ) && form->wm_border != FL_NOBORDER ) { fl_get_decoration_sizes( form, &dummy, &dummy, &bottom, &left ); if ( form->handle_dec_x ) form->x -= left; if ( form->handle_dec_y ) form->y -= bottom; } form->handle_dec_x = form->handle_dec_y = 0; if ( oldx != form->x || oldy != form->y ) XMoveWindow( flx->display, form->window, form->x, form->y ); } } /*************************************** * Sets the background color of the form - a bit of a hack since it * actually uses the first or second object of the form... ***************************************/ void fl_set_form_background_color( FL_FORM * form, FL_COLOR color ) { if ( ! form ) { M_err( "fl_set_forms_background_color", "NULL form" ); return; } /* If the empty box that all forms get as their first object on creation does not exist anymore we can't set a background color */ if ( ! form->first ) { M_err( "fl_set_forms_background_color", "Form has no background" ); return; } /* If there's no other object except the empty box or the first object isn't an empty box anymore set the color for this first object, otherwise for the next object. */ if ( ! form->first->next || form->first->boxtype != FL_NO_BOX ) fl_set_object_color( form->first, color, form->first->col2 ); else fl_set_object_color( form->first->next, color, form->first->next->col2 ); } /*************************************** * Returns the background color used for the form ***************************************/ FL_COLOR fl_get_form_background_color( FL_FORM * form ) { if ( ! form ) { M_err( "fl_get_forms_background_color", "NULL form" ); return FL_COL1; } /* If the empty box that all forms get as their first object on creation does not exist anymore we can't set a background color */ if ( ! form->first ) { M_err( "fl_get_forms_background_color", "Form has no background" ); return FL_COL1; } if ( form->first->boxtype != FL_NO_BOX || ! form->first->next ) return form->first->col1; else return form->first->next->col1; } /*************************************** * Sets the position of the hotspot of a form ***************************************/ void fl_set_form_hotspot( FL_FORM * form, FL_Coord x, FL_Coord y ) { if ( ! form ) { M_err( "fl_set_form_hotspot", "NULL form" ); return; } form->hotx = x; form->hoty = y; } /*************************************** * Sets the position of the hotspot of a form * to the center of one of its objects ***************************************/ void fl_set_form_hotobject( FL_FORM * form, FL_OBJECT * obj ) { if ( ! form ) { M_err( "fl_set_form_hotobject", "NULL form" ); return; } if ( ! obj ) { M_err( "fl_set_form_hotobject", "NULL object" ); return; } if ( obj->form != form ) { M_err( "fl_set_form_hotobject", "Object not part of form" ); return; } fl_set_form_hotspot( form, obj->x + obj->w / 2, obj->y + obj->h / 2 ); } /*************************************** * Try to make sure a form is completely visible on the screen ***************************************/ static void force_visible( FL_FORM * form ) { if ( form->x > fl_scrw - form->w ) form->x = fl_scrw - form->w; if ( form->x < 0 ) form->x = 0; if ( form->y > fl_scrh - form->h ) form->y = fl_scrh - form->h; if ( form->y < 0 ) form->y = 0; } /*************************************** * Sets the name (label) of the form. If the form * is shown it's also the form's window title. ***************************************/ void fl_set_form_title( FL_FORM * form, const char * name ) { if ( ! form ) { M_err( "fl_set_form_title", "NULL form" ); return; } if ( form->label != name ) { if ( form->label ) fl_free( form->label ); form->label = fl_strdup( name ? name : "" ); } if ( form->window ) fl_wintitle( form->window, form->label ); } /*************************************** * Sets the name (label) of the form using a format string ***************************************/ void fl_set_form_title_f( FL_FORM * form, const char * fmt, ... ) { char *buf; EXPAND_FORMAT_STRING( buf, fmt ); fl_set_form_title( form, buf ); fl_free( buf ); } /*************************************** * Creates the window for a form (but doesn't show it yet, use * fl_show_form_window() for that), returns the window handle ***************************************/ Window fl_prepare_form_window( FL_FORM * form, int place, int border, const char * name ) { long screenw, screenh, dont_fix_size = 0; FL_Coord mx, my; if ( border == 0 ) border = FL_FULLBORDER; if ( fl_current_form ) { M_err( "fl_prepare_form_window", "You forgot to call fl_end_form() %s", name ? name : "" ); fl_current_form = NULL; } if ( ! form ) { M_err( "fl_prepare_form", "NULL form" ); return None; } if ( form->visible != FL_INVISIBLE ) return form->window; /* Try to move the form from the part of the list for hidden forms to that at the start for visible forms */ move_form_to_visible_list( form ); if ( form->label != name ) { if ( form->label ) fl_free( form->label ); form->label = fl_strdup( name ? name : "" ); } if ( border == FL_NOBORDER ) fli_int.unmanaged_count++; form->wm_border = border; form->deactivated = 0; screenw = fl_scrw; screenh = fl_scrh; fl_get_mouse( &mx, &my, &fli_int.keymask ); if ( ( dont_fix_size = place & FL_FREE_SIZE ) ) place &= ~ FL_FREE_SIZE; if ( place == FL_PLACE_SIZE ) fl_pref_winsize( form->w, form->h ); else if ( place == FL_PLACE_ASPECT ) fl_winaspect( 0, form->w, form->h ); else if ( place == FL_PLACE_POSITION ) { fl_pref_winposition( form->x, form->y ); fl_initial_winsize( form->w, form->h ); } else if ( place != FL_PLACE_FREE ) { FL_COORD nmx, nmy; switch ( place ) { case FL_PLACE_CENTER: case FL_PLACE_FREE_CENTER: form->x = ( screenw - form->w ) / 2; form->y = ( screenh - form->h ) / 2; break; case FL_PLACE_MOUSE: form->x = mx - form->w / 2; form->y = my - form->h / 2; break; case FL_PLACE_FULLSCREEN: form->x = 0; form->y = 0; fl_set_form_size( form, screenw, screenh ); break; case FL_PLACE_HOTSPOT: if ( form->hotx < 0 || form->hoty < 0 ) /* not set */ { form->hotx = form->w / 2; form->hoty = form->h / 2; } form->x = mx - form->hotx; form->y = my - form->hoty; force_visible( form ); nmx = form->x + form->hotx; nmy = form->y + form->hoty; if ( nmx != mx || nmy != my ) fl_set_mouse( nmx, nmy ); break; case FL_PLACE_GEOMETRY : if ( form->x < 0 ) { form->x = screenw - form->w + form->x; form->handle_dec_x = 1; } if ( form->y < 0 ) { form->y = screenh - form->h + form->y; form->handle_dec_y = 1; } break; } /* Final check. Make sure form is visible */ if ( place != FL_PLACE_GEOMETRY ) force_visible( form ); if ( dont_fix_size && place != FL_PLACE_GEOMETRY ) fl_initial_wingeometry( form->x, form->y, form->w, form->h ); else fl_pref_wingeometry( form->x, form->y, form->w, form->h ); } else if ( place == FL_PLACE_FREE ) { fl_initial_winsize( form->w, form->h ); if ( has_initial ) fl_initial_wingeometry( form->x, form->y, form->w, form->h ); } else { M_err( "fl_prepare_form_window", "Unknown requests: %d", place ); fl_initial_wingeometry( form->x, form->y, form->w, form->h ); } /* Window managers typically do not allow dragging transient windows */ if ( border != FL_FULLBORDER ) { if ( place == FL_PLACE_ASPECT || place == FL_PLACE_FREE ) { form->x = mx - form->w / 2; form->y = my - form->h / 2; force_visible( form ); fl_initial_winposition( form->x, form->y ); } if ( border == FL_NOBORDER ) fl_noborder( ); else fl_transient( ); } if ( place == FL_PLACE_ICONIC ) fl_initial_winstate( IconicState ); if ( form->icon_pixmap ) fl_winicon( 0, form->icon_pixmap, form->icon_mask ); has_initial = 0; fli_init_colormap( fl_vmode ); form->window = fli_create_window( fl_root, fli_colormap( fl_vmode ), name ); fl_winicontitle( form->window, name ); if ( border == FL_FULLBORDER || form->prop & FLI_COMMAND_PROP ) set_form_property( form, FLI_COMMAND_PROP ); return form->window; } /*************************************** ***************************************/ Window fl_prepare_form_window_f( FL_FORM * form, int place, int border, const char * fmt, ... ) { Window w; char *buf; EXPAND_FORMAT_STRING( buf, fmt ); w = fl_prepare_form_window( form, place, border, buf ); fl_free( buf ); return w; } /*************************************** * Maps (displays) a form's window created with fl_prepare_form_window() ***************************************/ Window fl_show_form_window( FL_FORM * form ) { FL_OBJECT *obj; if ( ! form ) { M_err( "fl_show_form_window", "NULL form" ); return None; } if ( form->window == None || form->visible != FL_INVISIBLE ) return form->window; fl_winshow( form->window ); form->visible = FL_VISIBLE; reshape_form( form ); fl_redraw_form( form ); /* TODO: somehow formbrowser objects get drawn incorrectly the first time round so, for the time being, we redraw it once again... */ for ( obj = form->first; obj; obj = obj->next ) if ( obj->objclass == FL_FORMBROWSER ) fl_redraw_object( obj ); /* Check if there's an object we can make the object that has the focus, it must be an input object and be active and visible */ if ( ! form->focusobj ) for ( obj = form->first; obj; obj = obj->next ) if ( obj->input && obj->active && obj->visible ) { fl_set_focus_object( form, obj ); break; } return form->window; } /*************************************** * Makes a new form visible by creating a window for it * and mapping it. Returns the form's window handle. ***************************************/ Window fl_show_form( FL_FORM * form, int place, int border, const char * name ) { if ( ! form ) { M_err( "fl_show_form", "NULL form" ); return None; } fl_prepare_form_window( form, place, border, name ); form->in_redraw = 0; return fl_show_form_window( form ); } /*************************************** ***************************************/ Window fl_show_form_f( FL_FORM * form, int place, int border, const char * fmt, ... ) { Window w; char *buf; EXPAND_FORMAT_STRING( buf, fmt ); w = fl_show_form( form, place, border, buf ); fl_free( buf ); return w; } /*************************************** * Hides a particular form by unmapping and destroying its window ***************************************/ static void close_form_window( Window win ) { XEvent xev; XUnmapWindow( flx->display, win ); XDestroyWindow( flx->display, win ); XSync( flx->display, 0 ); while ( XCheckWindowEvent( flx->display, win, AllEventsMask, &xev ) ) fli_xevent_name( "Eaten", &xev ); /* Give subwindows a chance to handle destroy event promptly, take care the window of the form doesn't exist anymore! */ while ( XCheckTypedEvent( flx->display, DestroyNotify, &xev ) ) { FL_FORM *form; if ( ( form = fli_find_event_form( &xev ) ) ) { form->window = None; fl_hide_form( form ); } else fl_XPutBackEvent( &xev ); } } /*************************************** ***************************************/ static FL_FORM * property_set( unsigned int prop ) { int i; for ( i = 0; i < fli_int.formnumb; i++ ) if ( fli_int.forms[ i ]->prop & prop && fli_int.forms[ i ]->prop & FLI_PROP_SET ) return fli_int.forms[ i ]; return NULL; } /*************************************** ***************************************/ static void set_form_property( FL_FORM * form, unsigned int prop ) { if ( ! form ) { M_err( "set_form_property", "NULL form" ); return; } if ( property_set( prop ) ) return; if ( ! ( prop & FLI_COMMAND_PROP ) ) { M_err( "set_form_property", "Unknown form property request %u", prop ); return; } if ( form->window ) { fli_set_winproperty( form->window, FLI_COMMAND_PROP ); form->prop |= FLI_PROP_SET; } form->prop |= FLI_COMMAND_PROP; fli_mainform = form; } /*************************************** ***************************************/ void fl_hide_form( FL_FORM * form ) { Window owin; FL_OBJECT *o; if ( ! form ) { M_err( "fl_hide_form", "NULL form" ); return; } if ( fli_get_visible_forms_index( form ) < 0 ) { M_err( "fl_hide_form", "Hiding unknown form" ); return; } if ( form->visible == FL_BEING_HIDDEN ) { M_err( "fl_hide_form", "Recursive call?" ); return; } form->visible = FL_BEING_HIDDEN; fli_set_form_window( form ); /* Checking mouseobj->form is necessary as it might be deleted from a form */ if ( fli_int.mouseobj && fli_int.mouseobj->form == form ) { fli_handle_object( fli_int.mouseobj, FL_LEAVE, 0, 0, 0, NULL, 1 ); fli_int.mouseobj = NULL; } if ( fli_int.pushobj && fli_int.pushobj->form == form ) { fli_handle_object( fli_int.pushobj, FL_RELEASE, 0, 0, 0, NULL, 1 ); fli_int.pushobj = NULL; } if ( form->focusobj ) { fli_handle_object( form->focusobj, FL_UNFOCUS, 0, 0, 0, NULL, 0 ); form->focusobj = NULL; } /* Get canvas objects to unmap their windows (but only for those that aren't childs, those will be dealt with by their parents) */ for ( o = form->first; o; o = o->next ) if ( ( o->objclass == FL_CANVAS || o->objclass == FL_GLCANVAS ) && ! o->parent ) fli_unmap_canvas_window( o ); #ifdef DELAYED_ACTION fli_object_qflush( form ); #endif /* Free backing store pixmap but keep the pointer */ fli_free_flpixmap( form->flpixmap ); if ( fli_int.mouseform && fli_int.mouseform->window == form->window ) fli_int.mouseform = NULL; form->deactivated = 1; form->visible = FL_INVISIBLE; owin = form->window; form->window = None; fli_hide_tooltip( ); /* If the forms window is None it already has been closed */ if ( owin ) close_form_window( owin ); if ( flx->win == owin ) flx->win = None; /* Move the form from the part of the list for visible forms to the part of hidden forms at the end of the array */ move_form_to_hidden_list( form ); if ( form->wm_border == FL_NOBORDER ) { fli_int.unmanaged_count--; if ( fli_int.unmanaged_count < 0 ) { M_err( "fl_hide_form", "Bad unmanaged count" ); fli_int.unmanaged_count = 0; } } /* Need to re-establish command property */ if ( fli_int.formnumb && form->prop & FLI_COMMAND_PROP ) set_form_property( *fli_int.forms, FLI_COMMAND_PROP ); if ( form == fli_int.keyform ) fli_int.keyform = NULL; } /*************************************** * Frees the memory used by a form, together with all its objects. ***************************************/ void fl_free_form( FL_FORM * form ) { /* Check whether ok to free */ if ( ! form ) { M_err( "fl_free_form", "NULL form" ); return; } if ( form->visible == FL_VISIBLE ) { M_warn( "fl_free_form", "Freeing visible form" ); fl_hide_form( form ); } if ( get_hidden_forms_index( form ) < 0 ) { M_err( "fl_free_form", "Freeing unknown form" ); return; } /* Free all objects of the form */ fli_fast_free_object = form; while ( form->first ) fl_free_object( form->first ); fli_fast_free_object = NULL; if ( form->flpixmap ) { fli_free_flpixmap( form->flpixmap ); fl_free( form->flpixmap ); } if ( form->label ) { fl_free( form->label ); form->label = NULL; } if ( form == fli_mainform ) fli_mainform = NULL; /* Free the form and remove it from the list of existing forms */ fl_free( form ); remove_form_from_hidden_list( form ); } /*************************************** * Returns if a form is active ***************************************/ int fl_form_is_activated( FL_FORM * form ) { if ( ! form ) { M_err( "fl_form_is_activated", "NULL form" ); return 0; } return form->deactivated == 0; } /*************************************** * Activates a form (form only becomes activated if this function has * been called as many times as fl_deactive_form()). ***************************************/ void fl_activate_form( FL_FORM * form ) { if ( ! form ) { M_err( "fl_activate_form", "NULL form" ); return; } if ( form->deactivated ) { form->deactivated--; if ( ! form->deactivated && form->activate_callback ) form->activate_callback( form, form->activate_data ); } if ( form->child ) fl_activate_form( form->child ); } /*************************************** * Deactivates a form (re-activation requires as many calls of * fl_activate_form() as there were calls of fl_deactivate_form()). ***************************************/ void fl_deactivate_form( FL_FORM * form ) { if ( ! form ) { M_err( "fl_deactivate_form", "NULL form" ); return; } if ( ! form->deactivated && fli_int.mouseobj && fli_int.mouseobj->form == form ) fli_handle_object( fli_int.mouseobj, FL_LEAVE, 0, 0, 0, NULL, 1 ); if ( ! form->deactivated && form->deactivate_callback ) form->deactivate_callback( form, form->deactivate_data ); form->deactivated++; if ( form->child ) fl_deactivate_form( form->child ); } /*************************************** * Installs handler to be called on (final) re-activation of the form ***************************************/ FL_FORM_ATACTIVATE fl_set_form_atactivate( FL_FORM * form, FL_FORM_ATACTIVATE cb, void * data ) { FL_FORM_ATACTIVATE old = NULL; if ( ! form ) { M_err( "fl_set_form_atactivate", "NULL form" ); return NULL; } old = form->activate_callback; form->activate_callback = cb; form->activate_data = data; return old; } /*************************************** * Installs handler to be called on (first) deactivation of the form ***************************************/ FL_FORM_ATDEACTIVATE fl_set_form_atdeactivate( FL_FORM * form, FL_FORM_ATDEACTIVATE cb, void * data ) { FL_FORM_ATDEACTIVATE old = NULL; if ( ! form ) { M_err( "fl_set_form_atdeactivate", "NULL form" ); return NULL; } old = form->deactivate_callback; form->deactivate_callback = cb; form->deactivate_data = data; return old; } /*************************************** * Activates all forms ***************************************/ void fl_activate_all_forms( void ) { int i; for ( i = 0; i < fli_int.formnumb; i++ ) fl_activate_form( fli_int.forms[ i ] ); } /*************************************** * Deactivates all forms ***************************************/ void fl_deactivate_all_forms( void ) { int i; for ( i = 0; i < fli_int.formnumb; i++ ) fl_deactivate_form( fli_int.forms[ i ] ); } /*************************************** * Installs handler to be called on close of the form ***************************************/ FL_FORM_ATCLOSE fl_set_form_atclose( FL_FORM * form, FL_FORM_ATCLOSE fmclose, void * data ) { FL_FORM_ATCLOSE old; if ( ! form ) { M_err( "fl_set_form_atclose", "NULL form" ); return NULL; } old = form->close_callback; form->close_callback = fmclose; form->close_data = data; return old; } /*************************************** * Installs handler to be called on end of application by the user * using some window manager method to close a window ***************************************/ FL_FORM_ATCLOSE fl_set_atclose( FL_FORM_ATCLOSE fmclose, void * data ) { FL_FORM_ATCLOSE old = fli_context->atclose; fli_context->atclose = fmclose; fli_context->close_data = data; return old; } /*************************************** ***************************************/ void fl_set_form_geometry( FL_FORM * form, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h ) { fl_set_form_position( form, x, y ); fl_set_form_size( form, w, h ); /* This alters the windowing defaults */ fl_initial_wingeometry( form->x, form->y, form->w, form->h ); has_initial = 1; } /*************************************** * Register pre-emptive event handlers ***************************************/ FL_RAW_CALLBACK fl_register_raw_callback( FL_FORM * form, unsigned long mask, FL_RAW_CALLBACK rcb ) { FL_RAW_CALLBACK old_rcb = NULL; int valid = 0; if ( ! form ) { M_err( "fl_register_raw_callback", "Null form" ); return NULL; } if ( ( mask & FL_ALL_EVENT ) == FL_ALL_EVENT ) { old_rcb = form->all_callback; form->evmask = mask; form->all_callback = rcb; return old_rcb; } if ( mask & ( KeyPressMask | KeyReleaseMask ) ) { form->evmask |= mask & ( KeyPressMask | KeyReleaseMask ); old_rcb = form->key_callback; form->key_callback = rcb; valid = 1; } if ( mask & ( ButtonPressMask | ButtonReleaseMask ) ) { form->evmask |= mask & ( ButtonPressMask | ButtonReleaseMask ); old_rcb = form->push_callback; form->push_callback = rcb; valid = 1; } if ( mask & ( EnterWindowMask | LeaveWindowMask ) ) { form->evmask |= mask & ( EnterWindowMask | LeaveWindowMask ); old_rcb = form->crossing_callback; form->crossing_callback = rcb; valid = 1; } if ( mask & ( ButtonMotionMask | PointerMotionMask ) ) { form->evmask |= mask & ( ButtonMotionMask | PointerMotionMask ); old_rcb = form->motion_callback; form->motion_callback = rcb; valid = 1; } if ( ! valid ) /* unsupported mask */ M_err( "fl_register_raw_callback", "Unsupported mask 0x%x", mask ); return old_rcb; } /*************************************** ***************************************/ void fl_set_form_event_cmask( FL_FORM * form, unsigned long cmask ) { if ( form ) form->compress_mask = cmask; } /*************************************** ***************************************/ unsigned long fl_get_form_event_cmask( FL_FORM * form ) { return form ? form->compress_mask : 0UL; } /*************************************** * Sets the callback routine for the form ***************************************/ void fl_set_form_callback( FL_FORM * form, FL_FORMCALLBACKPTR callback, void * d ) { if ( ! form ) { M_err( "fl_set_form_callback", "NULL form" ); return; } form->form_callback = callback; form->form_cb_data = d; } /*************************************** ***************************************/ void fl_set_form_icon( FL_FORM * form, Pixmap p, Pixmap m ) { if ( ! form ) return; form->icon_pixmap = p; form->icon_mask = m; if ( form->window ) fl_winicon( form->window, p, m ); } /*************************************** ***************************************/ void fl_set_app_mainform( FL_FORM * form ) { fli_mainform = form; set_form_property( form, FLI_COMMAND_PROP ); } /*************************************** ***************************************/ FL_FORM * fl_get_app_mainform( void ) { return nomainform ? NULL : fli_mainform; } /*************************************** ***************************************/ void fl_set_app_nomainform( int flag ) { nomainform = flag; } /*************************************** * Does a rescale of a form without taking into * account object gravity or resize settings ***************************************/ static void simple_form_rescale( FL_FORM * form, double scale ) { FL_OBJECT *obj; form->w_hr *= scale; form->h_hr *= scale; form->w = FL_crnd( form->w_hr ); form->h = FL_crnd( form->h_hr ); for ( obj = form->first; obj; obj = obj->next ) if ( obj->objclass != FL_BEGIN_GROUP && obj->objclass != FL_END_GROUP ) fli_scale_object( obj, scale, scale ); fli_recalc_intersections( form ); fl_redraw_form( form ); } /*************************************** * Checks if the label of an object fits into it (after x- and * y-margin have been added). If not, all objects and the form * are enlarged by the necessary factor (but never by more than * a factor of 1.5). ***************************************/ void fl_fit_object_label( FL_OBJECT * obj, FL_Coord xmargin, FL_Coord ymargin ) { int sw, sh, osize, bw; double factor, xfactor, yfactor; if ( fli_no_connection ) return; if ( fl_is_outside_lalign( obj->align ) || obj->type == FL_BEGIN_GROUP || obj->type == FL_END_GROUP || obj->parent || ! obj->label || ! *obj->label || *obj->label == '@' ) return; fl_get_string_dimension( obj->lstyle, obj->lsize, obj->label, strlen( obj->label ), &sw, &sh ); bw = ( obj->boxtype == FL_UP_BOX || obj->boxtype == FL_DOWN_BOX || obj->boxtype == FL_EMBOSSED_BOX ) ? FL_abs( obj->bw ) : 1; if ( obj->boxtype == FL_EMBOSSED_BOX ) bw += bw > 2 ? bw - 2 : 1; if ( obj->objclass == FL_BUTTON && ( obj->type == FL_RETURN_BUTTON || obj->type == FL_MENU_BUTTON ) ) sw += FL_min( 0.6 * obj->h, 0.6 * obj->w ) - 1; if ( obj->objclass == FL_BUTTON && obj->type == FL_LIGHTBUTTON ) sw += FL_LIGHTBUTTON_MINSIZE + 1; if ( sw <= obj->w - 2 * ( bw + xmargin ) && sh <= obj->h - 2 * ( bw + ymargin ) ) return; if ( ( osize = obj->w - 2 * ( bw + xmargin ) ) <= 0 ) osize = 1; xfactor = ( double ) sw / osize; if ( ( osize = obj->h - 2 * ( bw + ymargin ) ) <= 0 ) osize = 1; yfactor = ( double ) sh / osize; factor = FL_max( xfactor, yfactor ); factor = FL_clamp( factor, 1.0, 1.5 ); /* Scale all objects without taking care of gravity etc. */ if ( factor > 1.0 ) simple_form_rescale( obj->form, factor ); } /*************************************** ***************************************/ void fli_recount_auto_objects( void ) { int i; for ( fli_int.auto_count = i = 0; i < fli_int.formnumb; i++ ) if ( fli_int.forms[ i ]->num_auto_objects > 0 ) fli_int.auto_count++; } /*************************************** * Reopens a group to allow addition of further objects ***************************************/ FL_OBJECT * fl_addto_group( FL_OBJECT * group ) { if ( ! group ) { M_err( "fl_addto_group", "NULL group." ); return NULL; } if ( group->objclass != FL_BEGIN_GROUP ) { M_err( "fl_addto_group", "Parameter is not a group object." ); return NULL; } if ( fl_current_form && fl_current_form != group->form ) { M_err( "fl_addto_group", "Can't switch to a group on a different form" ); return NULL; } if ( fli_current_group && fli_current_group != group ) { M_err( "fl_addto_group", "You forgot to call fl_end_group" ); return NULL; } if ( fli_current_group ) M_warn( "fl_addto_group", "Group was never closed" ); reopened_group = fl_current_form ? 1 : 2; fl_current_form = group->form; return fli_current_group = group; } /*************************************** * Returns if a form is visible ***************************************/ int fl_form_is_visible( FL_FORM * form ) { if ( ! form ) { M_warn( "fl_form_is_visible", "NULL form" ); return FL_INVISIBLE; } return form->window ? form->visible : FL_INVISIBLE; } /*************************************** * Similar to fit_object_label(), but will do it for all objects and * has a smaller maximum magnification factor (1.25 instead of 1.5). * Mainly intended for compensation for font size variations. ***************************************/ double fl_adjust_form_size( FL_FORM * form ) { FL_OBJECT * obj; double xfactor, yfactor, max_factor, factor; int sw, sh, osize, bw; if ( fli_no_connection ) return 1.0; max_factor = factor = 1.0; for ( obj = form->first; obj; obj = obj->next ) { if ( fl_is_outside_lalign( obj->align ) || obj->type == FL_BEGIN_GROUP || obj->type == FL_END_GROUP || obj->parent || ! obj->label || ! *obj->label || *obj->label == '@' ) continue; fl_get_string_dimension( obj->lstyle, obj->lsize, obj->label, strlen( obj->label ), &sw, &sh ); bw = ( obj->boxtype == FL_UP_BOX || obj->boxtype == FL_DOWN_BOX || obj->boxtype == FL_EMBOSSED_BOX ) ? FL_abs( obj->bw ) : 1; if ( obj->boxtype == FL_EMBOSSED_BOX ) bw += bw > 2 ? bw - 2 : 1; if ( obj->objclass == FL_BUTTON && ( obj->type == FL_RETURN_BUTTON || obj->type == FL_MENU_BUTTON ) ) sw += FL_min( 0.6 * obj->h, 0.6 * obj->w ) - 1; if ( obj->objclass == FL_BUTTON && obj->type == FL_LIGHTBUTTON ) sw += FL_LIGHTBUTTON_MINSIZE + 1; if ( sw <= obj->w - 2 * ( bw + 1 ) && sh <= obj->h - 2 * ( bw + 1 )) continue; if ( ( osize = obj->w - 2 * ( bw + 1 ) ) <= 0 ) osize = 1; xfactor = ( double ) sw / osize; if ( ( osize = obj->h - 2 * ( bw + 1 ) ) <= 0 ) osize = 1; yfactor = ( double ) sh / osize; if ( ( factor = FL_max( xfactor, yfactor ) ) > max_factor ) max_factor = factor; } /* Don't scale down and don't scale up by more than a factor of 1.25 */ max_factor = FL_clamp( max_factor, 1.0, 1.25 ); /* Scale all objects without taking care of gravity etc. */ if ( max_factor > 1.0 ) simple_form_rescale( form, max_factor ); return max_factor; } /*************************************** ***************************************/ void fl_raise_form( FL_FORM * form ) { if ( form && form->window ) XRaiseWindow( fl_display, form->window ); else M_err( "fl_raise_form", "NULL form or form window not shown" ); } /*************************************** ***************************************/ void fl_lower_form( FL_FORM * form ) { if ( form && form->window ) XLowerWindow( fl_display, form->window ); else M_err( "fl_lower_form", "NULL form or forn window not shown" ); } /*************************************** * Returns the sizes of the "decorations" the window manager puts around * a forms window. Returns 0 on success and 1 if the form isn't visible * or it's a form embedded into another form. * This tries to use the "_NET_FRAME_EXTENTS" atom which resonably recent * window managers in principle should set. For those window managers that * don't have that atom we try it with the old trick of searching up for * the enclosing parent window and using the geometry of this window (but * note: this doesn't work with window managers that don't reparent the * windows they manage, and we can't recognize that). ***************************************/ int fl_get_decoration_sizes( FL_FORM * form, int * top, int * right, int * bottom, int * left ) { Atom a; if ( ! form || ! form->window || form->visible != FL_VISIBLE || form->parent ) return 1; /* If the window manager knows about the '_NET_FRAME_EXTENTS' atom ask for the settings for the forms window, otherwise try by looking for the size of the enclosing parent window */ if ( ( a = XInternAtom( fl_get_display( ), "_NET_FRAME_EXTENTS", True ) ) != None ) get_decoration_sizes_from_wm( a, form, top, right, bottom, left ); else get_decorations_sizes_from_parent( form, top, right, bottom, left ); return 0; } /*************************************** * Gets the decorations sizes via the _NET_FRAME_EXTENTS atom. ***************************************/ static void get_decoration_sizes_from_wm( Atom a, FL_FORM * form, int * top, int * right, int * bottom, int * left ) { Atom actual_type; int actual_format; unsigned long nitems; unsigned long bytes_after; static unsigned char *prop; XGetWindowProperty( fl_get_display( ), form->window, a, 0, 4, False, XA_CARDINAL, &actual_type, &actual_format, &nitems, &bytes_after, &prop ); /* If no properties are returne the window probably has no decorations */ if ( actual_type == XA_CARDINAL && actual_format == 32 && nitems == 4 ) { *top = ( ( long * ) prop )[ 2 ]; *right = ( ( long * ) prop )[ 1 ]; *bottom = ( ( long * ) prop )[ 3 ]; *left = ( ( long * ) prop )[ 0 ]; } else *top = *right =*bottom = *left = 0; } /*************************************** * Tries to get the size of the decorations of a form the traditional * way, asuming that the form window is the child of a parent window * that encloses also the decoration windows (assuming that the window * manager reparents the windows it manages, otherwise we'll report * back zero sized decorations without any chance of figuring out that * this is wrong;-( ***************************************/ static void get_decorations_sizes_from_parent( FL_FORM * form, int * top, int * right, int * bottom, int * left ) { Window cur_win = form->window; Window root; Window parent; Window *childs = NULL; XWindowAttributes win_attr; XWindowAttributes frame_attr; Window wdummy; unsigned int udummy; /* Get the coordinates and size of the form's window */ XGetWindowAttributes( fl_get_display( ), cur_win, &win_attr ); /* Try to get its parent window */ XQueryTree( fl_get_display( ), cur_win, &root, &parent, &childs, &udummy ); /* Childs aren't used, get rid of them */ if ( childs ) { XFree( childs ); childs = NULL; } /* If there's no parent or the parent window is the root window we've got to assume that there are no decorations */ if ( ! parent || parent == root ) { *top = *right =*bottom = *left = 0; return; } /* Now translate the form window's coordiates (that are relative to its parent) to that relative to the root window and then find the top-most parent that isn't the root window itself */ XTranslateCoordinates( fl_get_display( ), parent, root, win_attr.x, win_attr.y, &win_attr.x, &win_attr.y, &wdummy ); while ( parent && parent != root ) { cur_win = parent; XQueryTree( fl_get_display( ), cur_win, &root, &parent, &childs, &udummy ); if ( childs ) { XFree( childs ); childs = NULL; } } /* Get the cordinates and sizes of the top-most window... */ XGetWindowAttributes( fl_get_display( ), cur_win, &frame_attr ); /* ...and finally calculate the decoration sizes */ *top = win_attr.y - frame_attr.y; *left = win_attr.x - frame_attr.x; *bottom = frame_attr.height - win_attr.height - *top; *right = frame_attr.width - win_attr.width - *left; } /*************************************** * Returns if a form window is in iconified state ***************************************/ int fl_form_is_iconified( FL_FORM * form ) { XWindowAttributes xwa; if ( ! form ) { M_err( "fl_form_is_iconified", "NULL form" ); return 0; } if ( ! form->window || form->visible == FL_INVISIBLE ) return 0; XGetWindowAttributes( fl_get_display( ), form->window, &xwa ); return xwa.map_state != IsViewable; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/free.c0000644000175000017500000000455312251554207011622 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file free.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" /*************************************** ***************************************/ FL_OBJECT * fl_create_free( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label, FL_HANDLEPTR handle ) { FL_OBJECT *obj; obj = fl_make_object( FL_FREE, type, x, y, w, h, label, handle ); obj->boxtype = FL_FLAT_BOX; if ( type == FL_INACTIVE_FREE ) obj->active = 0; else if ( type == FL_CONTINUOUS_FREE ) obj->automatic = 1; else if ( type == FL_INPUT_FREE ) obj->input = 1; else if ( type == FL_ALL_FREE ) { obj->input = 1; obj->automatic = 1; } if ( type != FL_INACTIVE_FREE ) obj->click_timeout = FL_CLICK_TIMEOUT; return obj; } /*************************************** * Adds an object ***************************************/ FL_OBJECT * fl_add_free( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label, FL_HANDLEPTR handle) { FL_OBJECT *ob; ob = fl_create_free( type, x, y, w, h, label, handle ); fl_add_object( fl_current_form, ob ); return ob; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/spinner.c0000664000175000017500000004421012353623326012355 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/pspinner.h" #include #include #include static void set_spinner_return( FL_OBJECT *, unsigned int ); /*************************************** * This function got to be called before a redraw, at least if * the form the spinner belongs to has been resized or proper- * ties of the spinner have been changed. It calculates the * new positions and sizes of the objects the spinner widget * is made up from. ***************************************/ static void set_geom( FL_OBJECT * obj ) { FLI_SPINNER_SPEC *sp = obj->spec; FL_Coord bwh; if ( obj->w >= obj->h ) { bwh = obj->h / 2; bwh = FL_max( bwh, 1 ); obj->h = 2 * bwh; sp->input->x = obj->x; sp->input->y = obj->y; sp->input->w = obj->w - bwh - 1; sp->input->h = obj->h; sp->up->x = sp->down->x = obj->x + obj->w - bwh - 1; sp->up->y = obj->y; sp->down->y = obj->y + bwh; sp->up->w = sp->up->h = sp->down->w = sp->down->h = bwh; if ( sp->orient == 1 ) { sp->orient = 0; fl_set_object_label( sp->up, "@8>" ); fl_set_object_label( sp->down, "@2>" ); } } else { bwh = obj->w / 2; bwh = FL_max( bwh, 1 ); obj->w = 2 * bwh; sp->input->x = obj->x; sp->input->y = obj->y; sp->input->w = obj->w; sp->input->h = obj->h - bwh - 1; sp->up->y = sp->down->y = obj->y + obj->h - bwh - 1; sp->up->x = obj->x + bwh; sp->down->x = obj->x; sp->up->w = sp->up->h = sp->down->w = sp->down->h = bwh; if ( sp->orient == 0 ) { sp->orient = 1; fl_set_object_label( sp->up, "@6>" ); fl_set_object_label( sp->down, "@4>" ); } } /* Also avoid changes of the box type and check for color changes (that must be passed on to the child input object) */ obj->boxtype = FL_NO_BOX; sp->input->col1 = obj->col1; sp->input->col2 = obj->col2; } /*************************************** * There aren't many types of events a spinner object must directly * react to. If it got resized the positions and sizes of the child * objects it's made up from need to be recalculated, but that can * be deferred until it's redrawn. Drawing it works mostly auto- * matically except the redraw of the label. And on deletion only * the FLI_SPINNER_SPEC needs to be deallocated (the child objects * referenced there-in have already been deallocated before). ***************************************/ static int handle_spinner( FL_OBJECT * obj, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { FLI_SPINNER_SPEC *sp = obj->spec; switch ( event ) { case FL_ATTRIB : case FL_RESIZED : obj->align = fl_to_outside_lalign( obj->align ); sp->attrib = 1; break; case FL_DRAW : if ( sp->attrib ) { set_geom( obj ); sp->attrib = 0; } /* fall through */ case FL_DRAWLABEL : fl_draw_object_label_outside( obj ); break; case FL_FREEMEM : fli_safe_free( obj->spec ); break; } return 0; } /*************************************** * Callback for the input and button objects of the spinner, * called with 'data' set to 0 for the input object and with * 'data' being 1 or -1 for the up and down buttons ***************************************/ static void spinner_callback( FL_OBJECT * obj, long data ) { FLI_SPINNER_SPEC *sp = obj->parent->spec; const char *s_val = fl_get_input( sp->input ); int max_len = 4 + sp->prec + log10( DBL_MAX ); char *buf = NULL; /* Don't react to editing the input field unless user ended interaction */ if ( data == 0 && ! ( obj->returned & FL_RETURN_END ) ) return; obj->parent->returned = FL_RETURN_NONE; if ( obj->parent->type == FL_INT_SPINNER ) { int old_i_val = sp->i_val; if ( data == 0 ) /* spinners input object was modified */ { char *eptr; long i_val = strtol( s_val, &eptr, 10 ); /* Check for an invalid value entered */ if ( eptr == s_val || i_val > sp->i_max || i_val < sp->i_min ) { if ( ! ( obj->returned & FL_RETURN_END ) ) return; if ( i_val > sp->i_max ) sp->i_val = sp->i_max; else if ( i_val < sp->i_min ) sp->i_val = sp->i_min; } else sp->i_val = i_val; } else if ( data == 1 && obj->returned & FL_RETURN_CHANGED ) { if ( sp->i_val <= sp->i_max - sp->i_incr ) sp->i_val += sp->i_incr; else sp->i_val = sp->i_max; } else if ( data == -1 && obj->returned & FL_RETURN_CHANGED ) { if ( sp->i_val >= sp->i_min + sp->i_incr ) sp->i_val -= sp->i_incr; else sp->i_val = sp->i_min; } buf = fl_malloc( max_len ); sprintf( buf, "%d", sp->i_val ); fl_set_input( sp->input, buf ); fl_free( buf ); buf = NULL; if ( data != 0 ) { if ( sp->i_val != old_i_val ) obj->parent->returned |= FL_RETURN_CHANGED; } else if ( obj->returned & FL_RETURN_END && sp->i_val != sp->old_ival ) obj->parent->returned |= FL_RETURN_CHANGED; if ( obj->returned & FL_RETURN_END ) { obj->parent->returned |= FL_RETURN_END; sp->old_ival = sp->i_val; } } else { double old_f_val = sp->f_val; if ( data == 0 ) { char *eptr; double f_val = strtod( s_val, &eptr ); if ( eptr == s_val || f_val > sp->f_max || f_val < sp->f_min ) { if ( ! ( obj->returned & FL_RETURN_END ) ) return; if ( f_val > sp->f_max ) sp->f_val = sp->f_max; if ( f_val < sp->f_min ) sp->f_val = sp->f_min; } else sp->f_val = f_val; } else if ( data == 1 && obj->returned & FL_RETURN_CHANGED ) { if ( sp->f_val <= sp->f_max - sp->f_incr ) sp->f_val += sp->f_incr; else sp->f_val = sp->f_max; } else if ( data == -1 && obj->returned & FL_RETURN_CHANGED ) { if ( sp->f_val >= sp->f_min + sp->f_incr ) sp->f_val -= sp->f_incr; else sp->f_val = sp->f_min; } buf = malloc( max_len ); sprintf( buf, "%.*f", sp->prec, sp->f_val ); fl_set_input( sp->input, buf ); fl_free( buf ); buf = NULL; if ( data != 0 ) { if ( sp->f_val != old_f_val ) obj->parent->returned |= FL_RETURN_CHANGED; } else if ( obj->returned & FL_RETURN_END && sp->f_val != sp->old_fval ) obj->parent->returned |= FL_RETURN_CHANGED; if ( obj->returned & FL_RETURN_END ) { obj->parent->returned |= FL_RETURN_END; sp->old_fval = sp->f_val; } } } /*************************************** ***************************************/ FL_OBJECT * fl_create_spinner( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; FLI_SPINNER_SPEC *sp; int orient = ( w < h ); obj = fl_make_object( FL_SPINNER, type, x, y, w, h, label, handle_spinner ); obj->boxtype = FL_NO_BOX; obj->align = FL_ALIGN_LEFT; obj->set_return = set_spinner_return; obj->spec = sp = malloc( sizeof *sp ); sp->input = fl_create_input( type == FL_INT_SPINNER ? FL_INT_INPUT : FL_FLOAT_INPUT, 0, 0, 0, 0, NULL ); sp->up = fl_create_button( FL_TOUCH_BUTTON, 0, 0, 0, 0, orient == 0 ? "@8>" : "@6>" ); sp->down = fl_create_button( FL_TOUCH_BUTTON, 0, 0, 0, 0, orient == 0 ? "@2>" : "@4>" ); fl_set_object_callback( sp->input, spinner_callback, 0 ); fl_set_object_callback( sp->up, spinner_callback, 1 ); fl_set_object_callback( sp->down, spinner_callback, -1 ); fl_set_button_mouse_buttons( sp->up, 1 ); fl_set_button_mouse_buttons( sp->down, 1 ); fl_set_object_lcolor( sp->up, FL_BLUE ); fl_set_object_lcolor( sp->down, FL_BLUE ); obj->col1 = sp->input->col1; obj->col2 = sp->input->col2; sp->i_val = sp->old_ival = 0; sp->i_min = - 10000; sp->i_max = 10000; sp->i_incr = 1; sp->f_val = sp->old_fval = 0.0; sp->f_min = - 10000.0; sp->f_max = 10000.0; sp->f_incr = 1.0; sp->orient = orient; sp->prec = DEFAULT_SPINNER_PRECISION; sp->attrib = 1; fl_add_child( obj, sp->input ); fl_add_child( obj, sp->up ); fl_add_child( obj, sp->down ); fl_set_input( sp->input, type == FL_INT_SPINNER ? "0" : "0.0" ); /* Set default return policy for a spinner object */ fl_set_object_return( obj, FL_RETURN_CHANGED ); return obj; } /*************************************** ***************************************/ FL_OBJECT * fl_add_spinner( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj = fl_create_spinner( type, x, y, w, h, label ); fl_add_object( fl_current_form, obj ); return obj; } /*************************************** * Returns the spinner value ***************************************/ double fl_get_spinner_value( FL_OBJECT * obj ) { FLI_SPINNER_SPEC *sp = obj->spec; const char *s_val = fl_get_input( sp->input ); char *eptr; if ( obj->type == FL_INT_SPINNER ) { long i_val = strtol( s_val, &eptr, 10 ); if ( eptr == s_val || i_val > sp->i_max || i_val < sp->i_min ) i_val = sp->i_val; return sp->i_val = i_val; } else { double f_val = strtod( s_val, &eptr ); if ( ( *eptr && *eptr != 'e' && *eptr != 'E' ) || errno == ERANGE || f_val > sp->f_max || f_val < sp->f_min ) f_val = sp->f_val; if ( *eptr ) { int max_len = 4 + sp->prec + log10( DBL_MAX ); char *buf = fl_malloc( max_len ); sprintf( buf, "%.*f", sp->prec, f_val ); fl_set_input( sp->input, buf ); fl_free( buf ); } return sp->f_val = f_val; } } /*************************************** * Sets the spinner value ***************************************/ double fl_set_spinner_value( FL_OBJECT * obj, double val ) { FLI_SPINNER_SPEC *sp = obj->spec; if ( obj->type == FL_INT_SPINNER ) { sp->i_val = FL_nint( val ); if ( val > sp->i_max ) sp->i_val = sp->i_max; else if ( val < sp->i_min ) sp->i_val = sp->i_min; fl_set_input_f( sp->input, "%d", sp->i_val ); return sp->old_ival = sp->i_val; } sp->f_val = val; if ( val > sp->f_max ) sp->f_val = sp->f_max; else if ( val < sp->f_min ) sp->f_val = sp->f_min; fl_set_input_f( sp->input, "%.*f", sp->prec, sp->f_val ); return sp->old_fval = sp->f_val; } /*************************************** * Sets the lower and upper bound of the spinner value ***************************************/ void fl_set_spinner_bounds( FL_OBJECT * obj, double min, double max ) { FLI_SPINNER_SPEC *sp = obj->spec; if ( min > max ) { double tmp = min; min = max; max = tmp; } if ( obj->type == FL_INT_SPINNER ) { sp->i_min = FL_nint( min ); sp->i_max = FL_nint( max ); if ( min < INT_MIN ) sp->i_min = INT_MIN; else if ( min > INT_MAX ) sp->i_min = INT_MAX; if ( max < INT_MIN ) sp->i_max = INT_MIN; else if ( max > INT_MAX ) sp->i_max = INT_MAX; fl_get_spinner_value( obj ); fl_set_spinner_value( obj, sp->i_val ); } else { sp->f_min = min; sp->f_max = max; if ( min < - DBL_MAX ) sp->f_min = - DBL_MAX; else if ( min > DBL_MAX ) sp->f_min = DBL_MAX; if ( max < - DBL_MAX ) sp->f_max = - DBL_MAX; else if ( max > DBL_MAX ) sp->f_max = DBL_MAX; fl_get_spinner_value( obj ); fl_set_spinner_value( obj, sp->f_val ); } } /*************************************** * Returns the lower and upper limit of the spinner value ***************************************/ void fl_get_spinner_bounds( FL_OBJECT * obj, double * min, double * max ) { FLI_SPINNER_SPEC *sp = obj->spec; if ( obj->type == FL_INT_SPINNER ) { *min = sp->i_min; *max = sp->i_max; } else { *min = sp->f_min; *max = sp->f_max; } } /*************************************** * Sets the step size (increment or decrement value when the up * or down button is clicked on) for the spinner. For FL_INT_SPINNER * objects the number is rounded to the nearest integer. ***************************************/ void fl_set_spinner_step( FL_OBJECT * obj, double step ) { FLI_SPINNER_SPEC *sp = obj->spec; if ( step <= 0.0 ) return; if ( obj->type == FL_INT_SPINNER ) { int istep = FL_nint( step ); if ( istep == 0 ) istep = 1; if ( istep > sp->i_max - sp->i_min ) sp->i_incr = sp->i_max - sp->i_min; else sp->i_incr = istep; } else { if ( step > sp->f_max - sp->f_min ) sp->f_incr = sp->f_max - sp->f_min; else sp->f_incr = step; } } /*************************************** * Returns the step size (increment or decrement value when the up * or down button is clicked on) for the spinner ***************************************/ double fl_get_spinner_step( FL_OBJECT * obj ) { FLI_SPINNER_SPEC *sp = obj->spec; return obj->type == FL_INT_SPINNER ? sp->i_incr : sp->f_incr; } /*************************************** * Sets the number of digits to be shown agter the decimal point (works * on FL_FLOAT_SPINNER objects only) ***************************************/ void fl_set_spinner_precision( FL_OBJECT * obj, int prec ) { FLI_SPINNER_SPEC *sp = obj->spec; if ( obj->type == FL_INT_SPINNER || prec < 0 ) return; if ( prec > DBL_DIG ) prec = DBL_DIG; if ( prec < 0 ) prec = 0; if ( sp->prec != prec ) { sp->prec = prec; fl_set_spinner_value( obj, fl_get_spinner_value( obj ) ); } } /*************************************** * Returns the number of digits shown after the decimal point * (always returns 0 for FL_INT_SPINNER objects) ***************************************/ int fl_get_spinner_precision( FL_OBJECT * obj ) { if ( obj->type == FL_INT_SPINNER ) return 0; return ( ( FLI_SPINNER_SPEC * ) obj->spec )->prec; } /*************************************** * Returns the input sub-object ***************************************/ FL_OBJECT * fl_get_spinner_input( FL_OBJECT * obj ) { return ( ( FLI_SPINNER_SPEC * ) obj->spec )->input; } /*************************************** * Returns the button sub-object for raising the spinner value ***************************************/ FL_OBJECT * fl_get_spinner_up_button( FL_OBJECT * obj ) { return ( ( FLI_SPINNER_SPEC * ) obj->spec )->up; } /*************************************** * Returns the button sub-object for lowering the spinner value ***************************************/ FL_OBJECT * fl_get_spinner_down_button( FL_OBJECT * obj ) { return ( ( FLI_SPINNER_SPEC * ) obj->spec )->down; } /*************************************** * Sets under which conditions the object is to be returned to the * application. This function is for internal use only and to set * the return policy for a spinner fl_set_object_return() should * be used instead (which then will call this function). ***************************************/ static void set_spinner_return( FL_OBJECT * obj, unsigned int when ) { FLI_SPINNER_SPEC *sp = obj->spec; obj->how_return = when; fl_set_object_return( sp->input, FL_RETURN_ALWAYS ); fl_set_object_return( sp->up, FL_RETURN_CHANGED | FL_RETURN_END ); fl_set_object_return( sp->down, FL_RETURN_CHANGED | FL_RETURN_END ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/scrollbar.c0000664000175000017500000004155712342657405012700 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file scrollbar.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao * All rights reserved. * * Scrollbar */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/pscrollbar.h" static void get_geom( FL_OBJECT * ); static void attrib_change( FL_OBJECT * ); #define IsVThin( t ) ( t == FL_VERT_THIN_SCROLLBAR \ || t == FL_VERT_PLAIN_SCROLLBAR ) #define IsHThin( t ) ( t == FL_HOR_THIN_SCROLLBAR \ || t == FL_HOR_PLAIN_SCROLLBAR ) #define IsThin( t ) ( IsVThin( t ) || IsHThin( t ) ) /*************************************** ***************************************/ static int handle_scrollbar( FL_OBJECT * obj, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { switch ( event ) { case FL_ATTRIB : case FL_RESIZED : obj->align = fl_to_outside_lalign( obj->align ); attrib_change( obj ); get_geom( obj ); break; case FL_DRAW : if ( IsThin( obj->type ) ) fl_draw_box( obj->boxtype, obj->x, obj->y, obj->w, obj->h, obj->col1, obj->bw ); /* fall through */ case FL_DRAWLABEL : fl_draw_object_label_outside( obj ); break; case FL_FREEMEM : /* children will take care of themselves */ fl_free( obj->spec ); break; } return FL_RETURN_NONE; } #define IS_HORIZ( o ) ( ( o )->type & FL_HOR_FLAG ) /*************************************** ***************************************/ static void attrib_change( FL_OBJECT * obj ) { FLI_SCROLLBAR_SPEC *sp = obj->spec; sp->slider->col1 = obj->col1; sp->slider->col2 = obj->col2; sp->up->col1 = sp->down->col1 = obj->col1; sp->up->col2 = sp->down->col2 = obj->col2; sp->up->boxtype = sp->down->boxtype = sp->slider->boxtype = obj->boxtype; fli_notify_object( sp->slider, FL_ATTRIB ); } /*************************************** ***************************************/ static void get_geom( FL_OBJECT * obj ) { FLI_SCROLLBAR_SPEC *sp = obj->spec; FL_OBJECT *up = sp->up, *down = sp->down, *slider = sp->slider; int x = obj->x, y = obj->y, w = obj->w, h = obj->h; int absbw = FL_abs( obj->bw ); int t = obj->type; if ( IS_HORIZ( obj ) ) { down->x = x; up->x = x + w - h; up->y = down->y = y; down->h = up->h = h; down->w = up->w = FL_min( w, h ); slider->x = x + h; slider->y = y; slider->h = h; if ( ( slider->w = w - 2 * up->w ) < 0 ) { slider->w = up->w / 3; slider->x = x + up->w / 3; } } else { up->x = down->x = x; up->y = y; up->w = down->w = w; up->h = down->h = FL_min( w, h ); slider->x = x; slider->y = y + up->h; slider->w = w; if ( ( slider->h = h - 2 * up->h ) < 0 ) { slider->h = h / 3; slider->y = y + up->h / 3; } down->y = y + h - down->h; } up->bw = obj->bw; down->bw = obj->bw; slider->bw = obj->bw; if ( absbw > 2 ) absbw--; if ( obj->bw > 0 ) up->bw = down->bw = absbw; else up->bw = down->bw = -absbw; if ( IsThin( t ) ) { absbw = IS_FLATBOX( obj->boxtype ) ? 1 : absbw; up->boxtype = down->boxtype = FL_NO_BOX; up->bw = down->bw = absbw; /* Due to slider double buffering we have to be completely clear of the scrollbar bounding box, otherwise the slider will wipe out the scrollbars bounding box */ if ( IsVThin( t ) ) { slider->x += absbw + 1; slider->w -= 2 * absbw + 2; slider->y -= absbw + ( absbw > 1 ); slider->h += 2 * absbw + ( absbw > 1 ); } else { slider->y += absbw + 1; slider->h -= 2 * absbw + 2; slider->x -= absbw + ( absbw > 1 ); slider->w += 2 * absbw + ( absbw > 1 ); } } fli_notify_object( slider, FL_RESIZED ); } /*************************************** * Callback for the slider in the scrollbar ***************************************/ static void slider_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { FLI_SCROLLBAR_SPEC *sp = obj->parent->spec; if ( obj->returned & FL_RETURN_END ) obj->parent->returned |= FL_RETURN_END; if ( obj->parent->how_return & FL_RETURN_END_CHANGED && obj->returned & FL_RETURN_END ) { double nval = fl_get_slider_value( obj ); if ( nval != sp->old_val ) obj->parent->returned |= FL_RETURN_CHANGED; sp->old_val = nval; } else if ( obj->returned & FL_RETURN_CHANGED ) obj->parent->returned |= FL_RETURN_CHANGED; } /*************************************** * Callback for the buttons of the scrollbar ***************************************/ static void button_cb( FL_OBJECT * obj, long data ) { FLI_SCROLLBAR_SPEC *sp = obj->parent->spec; double ival = fl_get_slider_value( sp->slider ), nval = ival, slmax, slmin; /* Update the slider and get the new value */ if ( obj->returned == FL_RETURN_TRIGGERED ) obj->returned = FL_RETURN_END | FL_RETURN_CHANGED; if ( obj->returned & FL_RETURN_CHANGED ) { fl_get_slider_bounds( sp->slider, &slmin, &slmax ); if ( slmax > slmin ) nval = ival + data * sp->increment; else nval = ival - data * sp->increment; fl_set_slider_value( sp->slider, nval ); nval = fl_get_slider_value( sp->slider ); } if ( obj->returned & FL_RETURN_END ) obj->parent->returned |= FL_RETURN_END; /* If we're supposed to return only on end and change check if the slider value changed since interaction started, if we have to return on everty change check if if it changed this time round */ if ( obj->parent->how_return & FL_RETURN_END_CHANGED && obj->returned & FL_RETURN_END ) { if ( nval != sp->old_val ) { obj->parent->returned |= FL_RETURN_CHANGED; sp->old_val = nval; } } else if ( ival != nval ) obj->parent->returned |= FL_RETURN_CHANGED; } /*************************************** ***************************************/ FL_OBJECT * fl_create_scrollbar( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * l ) { FLI_SCROLLBAR_SPEC *sp; FL_OBJECT *obj; obj = fl_make_object( FL_SCROLLBAR, type, x, y, w, h, l, handle_scrollbar ); obj->spec = sp = fl_calloc( 1, sizeof *sp ); obj->col1 = FL_COL1; obj->col2 = FL_COL1; obj->align = FL_SCROLLBAR_ALIGN; obj->set_return = fl_set_scrollbar_return; if ( IsThin( type ) ) obj->boxtype = FL_DOWN_BOX; else if ( type == FL_HOR_NICE_SCROLLBAR || type == FL_VERT_NICE_SCROLLBAR ) obj->boxtype = FL_FRAME_BOX; else obj->boxtype = FL_UP_BOX; if ( IS_HORIZ( obj ) ) { fl_set_object_resize( obj, FL_RESIZE_X ); sp->up = fl_create_scrollbutton( FL_TOUCH_BUTTON, 1, 1, 1, 1, "6" ); sp->down = fl_create_scrollbutton( FL_TOUCH_BUTTON, 1, 1, 1, 1, "4" ); fl_set_object_callback( sp->up, button_cb, 1 ); fl_set_object_callback( sp->down, button_cb, -1 ); fl_set_object_resize( sp->up, FL_RESIZE_NONE ); fl_set_object_resize( sp->down, FL_RESIZE_NONE ); if ( type == FL_HOR_SCROLLBAR ) sp->slider = fl_create_slider( FL_HOR_BROWSER_SLIDER2, 1, 1, 1, 1, "" ); else if ( type == FL_HOR_THIN_SCROLLBAR ) sp->slider = fl_create_slider( FL_HOR_THIN_SLIDER, 1, 1, 1, 1, "" ); else if ( type == FL_HOR_PLAIN_SCROLLBAR ) sp->slider = fl_create_slider( FL_HOR_BASIC_SLIDER, 1, 1, 1, 1, "" ); else if ( type == FL_HOR_NICE_SCROLLBAR ) sp->slider = fl_create_slider( FL_HOR_NICE_SLIDER2, 1, 1, 1, 1, "" ); fl_set_object_resize( sp->slider, FL_RESIZE_NONE ); } else { fl_set_object_resize( obj, FL_RESIZE_Y ); sp->up = fl_create_scrollbutton( FL_TOUCH_BUTTON, 1, 1, 1, 1, "8" ); sp->down = fl_create_scrollbutton( FL_TOUCH_BUTTON, 1, 1, 1, 1, "2" ); fl_set_object_callback( sp->up, button_cb, -1 ); fl_set_object_callback( sp->down, button_cb, 1 ); fl_set_object_resize( sp->up, FL_RESIZE_NONE ); fl_set_object_resize( sp->down, FL_RESIZE_NONE ); if ( type == FL_VERT_SCROLLBAR ) sp->slider = fl_create_slider( FL_VERT_BROWSER_SLIDER2, 1, 1, 1, 1, "" ); else if ( type == FL_VERT_THIN_SCROLLBAR ) sp->slider = fl_create_slider( FL_VERT_THIN_SLIDER, 1, 1, 1, 1, "" ); else if ( type == FL_VERT_PLAIN_SCROLLBAR ) sp->slider = fl_create_slider( FL_VERT_BASIC_SLIDER, 1, 1, 1, 1, "" ); else if ( type == FL_VERT_NICE_SCROLLBAR ) sp->slider = fl_create_slider( FL_VERT_NICE_SLIDER2, 1, 1, 1, 1, "" ); else M_err( "fl_create_scrollbar", "Unknown type %d", type ); fl_set_object_resize( sp->slider, FL_RESIZE_NONE ); } sp->increment = 0.02; fl_set_slider_increment( sp->slider, 5 * sp->increment, sp->increment ); fl_set_object_callback( sp->slider, slider_cb, 0 ); fl_set_slider_bounds( sp->slider, 0.0, 1.0 ); sp->old_val = fl_get_slider_value( sp->slider ); fl_add_child( obj, sp->slider ); fl_add_child( obj, sp->down ); fl_add_child( obj, sp->up ); /* In older versions scrollbars and browsers didn't return to the application on e.g. fl_do_forms() but still a callback associated with the object got called. To emulate the old behaviour we have to set the return policy to default to FL_RETURN_NONE and only change that to FL_RETURN_CHANGED when a callback is installed (which is done in fl_set_object_callback()) */ #if ! USE_BWC_BS_HACK fl_set_object_return( obj, FL_RETURN_CHANGED ); #else fl_set_object_return( obj, FL_RETURN_NONE ); #endif return obj; } /* * User routines */ #define ISSCROLLBAR( o ) ( ( o ) && ( o )->objclass == FL_SCROLLBAR ) /*************************************** ***************************************/ FL_OBJECT * fl_add_scrollbar( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * l ) { FL_OBJECT *obj = fl_create_scrollbar( type, x, y, w, h, l ); attrib_change( obj ); get_geom( obj ); fl_add_object( fl_current_form, obj ); return obj; } /*************************************** ***************************************/ double fl_get_scrollbar_value( FL_OBJECT * obj ) { FLI_SCROLLBAR_SPEC *sp = obj->spec; if ( ! ISSCROLLBAR( obj ) ) { M_err( "fl_get_scrollbar_value", "%s not a scrollbar", obj ? obj->label : "Object" ); return - HUGE_VAL; } return fl_get_slider_value( sp->slider ); } /*************************************** ***************************************/ void fl_set_scrollbar_value( FL_OBJECT * obj, double val ) { FLI_SCROLLBAR_SPEC *sp = obj->spec; if ( ! ISSCROLLBAR( obj ) ) { M_err( "fl_set_scrollbar_value", "%s not a scrollbar", obj ? obj->label : "Object" ); return; } sp->old_val = val; fl_set_slider_value( sp->slider, val ); } /*************************************** * Sets the size of the knob of the scrollbar * (the function name is a bit of misnomer) ***************************************/ void fl_set_scrollbar_size( FL_OBJECT * obj, double val ) { FLI_SCROLLBAR_SPEC *sp = obj->spec; fl_set_slider_size( sp->slider, val ); get_geom( obj ); } /*************************************** * Sets the size of the knob of the scrollbar * (the function name is a bit of misnomer) ***************************************/ double fl_get_scrollbar_size( FL_OBJECT * obj ) { return fl_get_slider_size( ( ( FLI_SCROLLBAR_SPEC * ) obj->spec )->slider ); } /*************************************** ***************************************/ void fl_set_scrollbar_increment( FL_OBJECT * obj, double l, double r ) { FLI_SCROLLBAR_SPEC *sp = obj->spec; fl_set_slider_increment( sp->slider, l, r ); sp->increment = r; } /*************************************** ***************************************/ void fl_get_scrollbar_increment( FL_OBJECT * obj, double * a, double * b ) { FLI_SCROLLBAR_SPEC *sp = obj->spec; fl_get_slider_increment( sp->slider, a, b ); } /*************************************** ***************************************/ void fl_set_scrollbar_bounds( FL_OBJECT * obj, double b1, double b2 ) { FLI_SCROLLBAR_SPEC *sp = obj->spec; if ( ! ISSCROLLBAR( obj ) ) { M_err( "fl_set_scrollbar_bounds", "%s not a scrollbar", obj ? obj->label : "Object" ); return; } fl_set_slider_bounds( sp->slider, b1, b2 ); } /*************************************** ***************************************/ void fl_get_scrollbar_bounds( FL_OBJECT * obj, double * b1, double * b2 ) { FLI_SCROLLBAR_SPEC *sp = obj->spec; fl_get_slider_bounds( sp->slider, b1, b2 ); } /*************************************** * Sets under which conditions the object is to be returned to the * application. This function should be regarded as for internal use * only and fl_set_object_return() should be used instead (which then * will call this function). ***************************************/ void fl_set_scrollbar_return( FL_OBJECT * obj, unsigned int when ) { FLI_SCROLLBAR_SPEC *sp = obj->spec; if ( when & FL_RETURN_END_CHANGED ) when &= ~ ( FL_RETURN_NONE | FL_RETURN_CHANGED ); obj->how_return = when; fl_set_object_return( sp->slider, FL_RETURN_ALWAYS ); fl_set_object_return( sp->up, FL_RETURN_ALWAYS ); fl_set_object_return( sp->down, FL_RETURN_ALWAYS ); /* We may need the value of the slider at this moment in the callback function... */ sp->old_val = fl_get_slider_value( sp->slider ); } /*************************************** ***************************************/ void fl_set_scrollbar_step( FL_OBJECT * obj, double step ) { FLI_SCROLLBAR_SPEC *sp = obj->spec; fl_set_slider_step( sp->slider, step ); } /*************************************** ***************************************/ int fl_get_scrollbar_repeat( FL_OBJECT * obj ) { return fl_get_slider_repeat( ( ( FLI_SCROLLBAR_SPEC * ) obj->spec )->slider ); } /*************************************** ***************************************/ void fl_set_scrollbar_repeat( FL_OBJECT * obj, int millisec ) { fl_set_slider_repeat( ( ( FLI_SCROLLBAR_SPEC * ) obj->spec )->slider, millisec ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/local.h0000644000175000017500000000413011665175640011777 00000000000000/* * * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file local.h * * This file is part of the XForms library package. * Copyright (c) 1996-1998 T.C. Zhao and Mark Overmars * All rights reserved. * * Some machine specific stuff. */ #ifndef FL_LOCAL_H #define FL_LOCAL_H #ifndef _WIN32 #include #endif #ifndef HAVE_STRCASECMP extern int strcasecmp( const char *, const char * ); #endif #if defined Lynx #define NEED_GETCWD #endif #if defined __VMS #define NEED_GETCWD #if __VMS_VER < 70000000 struct timezone { int tz_minuteswest; /* minutes west of Greenwich */ int tz_dsttime; /* type of dst correction */ }; extern int gettimeofday( struct timeval * tv, struct timezone * tz ); #endif /* ___VMS_VER */ #endif /* __VMS */ /********* End of Configurable stuff ***********/ #ifndef FL_PATH_MAX #ifdef PATH_MAX #define FL_PATH_MAX PATH_MAX #else #define FL_PATH_MAX 1024 #endif #endif /* FL_PATH_MAX */ #ifndef FL_FLEN #define FL_FLEN 256 #endif /* There are two ways to handle motion events, one is to constantly * query the server for mouse position, and the other is to use * motion events. The first way obviously is slow and expensive * if runs across network. The latter however suffers with stepping * events. */ /*#define NO_MSG_INFO */ #endif /* ifndef local.h } */ /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/sysdep.c0000644000175000017500000001303512251553761012207 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file sysdep.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * X independent but system (SysV, BSD) or OS dependent utilities. * * listdir.c contains another part of the system dependent stuff, * namely the directory structure of the system. * * check out local.h, which defines some flags that might affect * this file */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include #include #include #include #ifndef FL_WIN32 #include #include #include #else #include #include #endif #include "local.h" /*********************************************************** * fl_whoami() returns the username **********************************************************/ #ifndef FL_WIN32 const char * fl_whoami( void ) { #ifndef __VMS struct passwd *passwd = getpwuid( getuid( ) ); const char *name = passwd ? passwd->pw_name : "Unknown"; endpwent( ); #else const char *name = getenv( "USER" ); #endif return name ? name : "unknown"; } #else /* WIN/NT platform */ const char * fl_whoami( void ) { static char buf[ 32 ]; int len = 32; return GetUserName( buf, &len ) ? buf : "unknown"; } #endif /*************************************************** * fl_now() returns today's (local) date in ASCII format ***************************************************/ const char * fl_now( void ) { time_t t = time( 0 ); static char buf[ 64 ]; fli_sstrcpy( buf, asctime( localtime( &t ) ), sizeof buf ); if ( buf[ strlen( buf ) - 1 ] == '\n' ) buf[ strlen( buf ) - 1 ] = '\0'; return buf; } /***************************************************************** * fl_msleep() is similar to sleep(), but with milli-second argument ******************************************************************/ #ifdef __VMS #include int fl_msleep( unsigned long msec ) { float wait_time = 1.0e-3 * msec; ( void ) lib$wait( &wait_time ); return 0; } #else /*************************************** * Yielding the processor for msec milli-seconds ***************************************/ int fl_msleep( unsigned long msec ) { #ifdef __EMX__ _sleep2( msec ); /* more accurate than select/sleep in OS2 */ return 0; #else #ifdef FL_WIN32 _sleep( msec ); return 0; #else #ifdef HAVE_NANOSLEEP struct timespec timeout; timeout.tv_nsec = 1000000 * ( msec % 1000 ); timeout.tv_sec = msec / 1000; return nanosleep( &timeout, NULL ); #else #ifdef HAVE_USLEEP return usleep( msec * 1000 ); #else /* seems everybody has select these days */ struct timeval timeout; timeout.tv_usec = 1000 * ( msec % 1000 ); timeout.tv_sec = msec / 1000; return select( 0, NULL, NULL, NULL, &timeout ); #endif #endif #endif #endif } #endif /* VMS */ /******* End of fl_msleep() ***************************/ #if defined __VMS && __VMS_VER < 70000000 /*************************************** * Thanks to David Mathog (mathog@seqaxp.bio.caltech.edu) for * stealing it from the X11KIT distribution * * gettimeofday(2) - Returns the current time * * NOTE: The timezone portion is useless on VMS. * Even on UNIX, it is only provided for backwards * compatibilty and is not guaranteed to be correct. ***************************************/ #include int gettimeofday( struct timeval * tv, struct timezone * tz ) { timeb_t tmp_time; ftime( &tmp_time ); if ( tv != NULL ) { tv->tv_sec = tmp_time.time; tv->tv_usec = tmp_time.millitm * 1000; } if ( tz != NULL ) { tz->tz_minuteswest = tmp_time.timezone; tz->tz_dsttime = tmp_time.dstflag; } return 0; } /*** End gettimeofday() ***/ #endif /* defined __VMS && __VMS_VER < 70000000 */ /************************************************************* * Return the system time since a fixed point in time (On unix * systems, this point is typically 01/01/70). * Most useful for elapsed time. ************************************************************/ void fl_gettime( long * sec, long * usec ) { #ifndef FL_WIN32 static struct timeval tp; #ifdef opennt static unsigned long tzp; #else static struct timezone tzp; #endif gettimeofday( &tp, &tzp ); *sec = tp.tv_sec; *usec = tp.tv_usec; #else struct _timeb _gtodtmp; _ftime( &_gtodtmp ); *sec = _gtodtmp.time; *usec = _gtodtmp.millitm * 1000; #endif } /*************************************** ***************************************/ long fli_getpid( void ) { return getpid( ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/flresource.c0000664000175000017500000012214312353623325013051 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file flresource.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao * All rights reserved. * * Handle XResources. Only rudimetry support is implemented. However, * using this minimum implementation, more powerful and application * specific resources can be developed easily. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/flsnprintf.h" #include #include #include #if 0 #include #endif #ifdef FL_WIN32 #include #endif FLI_WM_STUFF fli_wmstuff; /* also used in win.c */ static XrmDatabase fldatabase; /* final merged database */ static XrmDatabase cmddb; /* command line database */ static char *fl_app_name, *fl_app_class, *fl_ori_app_name; static void fli_init_resources( void ); static void fli_set_debug_level( int ); /* Command line options */ static XrmOptionDescRec copt[ ] = { { "-fldebug", "*fldebug", XrmoptionSepArg, ( caddr_t ) "0" }, { "-flversion", "*flversion", XrmoptionNoArg, ( caddr_t ) "1" }, { "-flhelp", "*flhelp", XrmoptionNoArg, ( caddr_t ) "1" }, { "-name", ".name", XrmoptionSepArg, ( caddr_t ) 0 }, { "-display", ".display", XrmoptionSepArg, ( caddr_t ) 0 }, { "-sync", "*sync", XrmoptionNoArg, ( caddr_t ) "1" }, { "-depth", "*depth", XrmoptionSepArg, ( caddr_t ) 0 }, { "-visual", "*visual", XrmoptionSepArg, ( caddr_t ) 0 }, { "-private", "*privateColormap", XrmoptionNoArg, ( caddr_t ) "1" }, { "-shared", "*sharedColormap", XrmoptionNoArg, ( caddr_t ) "1" }, { "-standard", "*standardColormap", XrmoptionNoArg, ( caddr_t ) "1" }, { "-stdcmap", "*standardColormap", XrmoptionNoArg, ( caddr_t ) "1" }, { "-double", "*doubleBuffer", XrmoptionNoArg, ( caddr_t ) "1" }, { "-bw", "*borderWidth", XrmoptionSepArg, ( caddr_t ) 0 }, { "-vid", "*visualID", XrmoptionSepArg, ( caddr_t ) 0 }, #ifdef DO_GAMMA_CORRECTION { "-rgamma", "*rgamma", XrmoptionSepArg, ( caddr_t ) 0 }, { "-bgamma", "*bgamma", XrmoptionSepArg, ( caddr_t ) 0 }, { "-ggamma", "*ggamma", XrmoptionSepArg, ( caddr_t ) 0 }, #endif { "-bs", "*backingStore", XrmoptionNoArg, ( caddr_t ) "0" } }; #define Ncopt ( sizeof copt / sizeof *copt ) /* Other resources */ #define PV( a ) &( fli_cntl.a ) #define PS( a ) ( fli_cntl.a ) #define NS( a ) #a /* xform and XForm will be generated on the fly */ typedef char Bop[ 8 ]; /* Boolean default */ typedef char Iop[ 8 ]; /* Integer default */ static Bop OpPrivateMap, OpSharedMap, OpStandardMap, OpDouble; static Bop OpSync, OpULW = "1"; static Iop OpDebug, OpDepth, OpULT = "-1"; static char OpBS[ 12 ] = "1"; /* whenmapped */ static char OpSafe[ 12 ]; static char OpSCBT[ 16 ] = "thin"; static char OpBLsize[ 20 ] = NS( FL_DEFAULT_SIZE ); static char OpMLsize[ 20 ] = NS( FL_DEFAULT_SIZE ); static char OpBrFsize[ 20 ] = NS( FL_DEFAULT_SIZE ); static char OpChFsize[ 20 ] = NS( FL_DEFAULT_SIZE ); static char OpSLsize[ 20 ] = NS( FL_DEFAULT_SIZE ); static char OpLLsize[ 20 ] = NS( FL_DEFAULT_SIZE ); static char OpILsize[ 20 ] = NS( FL_DEFAULT_SIZE ); static char OpIBW[ 20 ] = NS( FL_BOUND_WIDTH ); static char OpPsize[ 20 ] = NS( FL_DEFAULT_SIZE ); static char OpVisualID[ 20 ] = "0"; #ifdef DO_GAMMA_CORRECTION static char OpRgamma[ 12 ] = "1"; static char OpGgamma[ 12 ] = "1"; static char OpBgamma[ 12 ] = "1"; #endif static char OpCoordUnit[ 32 ]; static FLI_VN_PAIR vn_coordunit[ ] = { { FL_COORD_PIXEL, "pixel" }, { FL_COORD_MM, "mm" }, { FL_COORD_POINT, "point" }, { FL_COORD_centiPOINT, "centipoint" }, { FL_COORD_centiPOINT, "cp" }, { FL_COORD_centiMM, "centimm" }, { FL_COORD_centiMM, "cmm" }, { -1, "Invalid" }, { -1, NULL } }; #define SetR( name, rclass, type, deft, buflen ) \ { #name, rclass, type, &fli_cntl.name, deft, buflen } static FL_resource internal_resources[ ] = { SetR( debug, "Debug", FL_INT, OpDebug, 0 ), SetR( sync, "Sync", FL_BOOL, OpSync, 0 ), #ifdef DO_GAMMA_CORRECTION SetR( rgamma, "Gamma", FL_FLOAT, OpRgamma, 0 ), SetR( ggamma, "Gamma", FL_FLOAT, OpGgamma, 0 ), SetR( bgamma, "Gamma", FL_FLOAT, OpBgamma, 0 ), #endif SetR( depth, "Depth", FL_INT, OpDepth, 0 ), { "visual", "Visual", FL_STRING, PS( vname ), PS( vname ), 20 }, { "scrollbarType", "ScrollbarType", FL_STRING, OpSCBT, OpSCBT, 16 }, SetR( doubleBuffer, "DoubleBuffer", FL_BOOL, OpDouble, 0 ), SetR( ulThickness, "ULThickness", FL_INT, OpULT, 0 ), SetR( privateColormap, "PrivateColormap", FL_BOOL, OpPrivateMap, 0 ), SetR( sharedColormap, "SharedColormap", FL_BOOL, OpSharedMap, 0 ), SetR( standardColormap, "StandardColormap", FL_BOOL, OpStandardMap, 0 ), SetR( buttonFontSize, "FontSize", FL_INT, OpBLsize, 0 ), SetR( menuFontSize, "FontSize", FL_INT, OpMLsize, 0 ), SetR( choiceFontSize, "FontSize", FL_INT, OpChFsize, 0 ), SetR( browserFontSize, "FontSize", FL_INT, OpBrFsize, 0 ), SetR( labelFontSize, "FontSize", FL_INT, OpLLsize, 0 ), SetR( sliderLabelSize, "FontSize", FL_INT, OpSLsize, 0 ), SetR( inputLabelSize, "FontSize", FL_INT, OpILsize, 0 ), SetR( pupFontSize, "PupFontSize", FL_INT, OpPsize, 0 ), SetR( borderWidth, "BorderWidth", FL_INT, OpIBW, 0 ), SetR( ulPropWidth, "ULWidth", FL_BOOL, OpULW, 0 ), SetR( backingStore, "BackingStore", FL_INT, OpBS, 0 ), SetR( safe, "Safe", FL_INT, OpSafe, 0 ), { "coordUnit", "CoordUnit", FL_STRING, OpCoordUnit, OpCoordUnit, 32 }, { "visualID", "VisualID", FL_LONG, &fli_requested_vid, OpVisualID, 0 } }; #define Niopt ( sizeof internal_resources / sizeof *internal_resources ) /* Program can set its own default, overriding XForms default */ #define SetMember( a ) fli_cntl.a = cntl->a /*************************************** ***************************************/ void fl_set_defaults( unsigned long mask, FL_IOPT * cntl ) { if ( mask & FL_PDPrivateMap ) { SetMember( privateColormap ); sprintf( OpPrivateMap, "%d", cntl->privateColormap != 0 ); } if ( mask & FL_PDSharedMap ) { SetMember( sharedColormap ); sprintf( OpSharedMap, "%d", cntl->sharedColormap != 0 ); } if ( mask & FL_PDStandardMap ) { SetMember( standardColormap ); sprintf( OpStandardMap, "%d", cntl->standardColormap != 0 ); } if ( mask & FL_PDDouble ) { SetMember( doubleBuffer ); sprintf( OpDouble, "%d", cntl->doubleBuffer != 0 ); } if ( mask & FL_PDDepth ) { SetMember( depth ); sprintf( OpDepth, "%d", cntl->depth ); } if ( mask & FL_PDVisual ) { SetMember( vclass ); strcpy( fli_cntl.vname, fli_vclass_name( cntl->vclass ) ); } if ( mask & FL_PDButtonFontSize ) { SetMember( buttonFontSize ); sprintf( OpBLsize, "%d", cntl->buttonFontSize ); } if ( mask & FL_PDBrowserFontSize ) { SetMember( browserFontSize ); sprintf( OpBrFsize, "%d", cntl->browserFontSize ); } if ( mask & FL_PDMenuFontSize ) { SetMember( menuFontSize ); sprintf( OpMLsize, "%d", cntl->menuFontSize ); } if ( mask & FL_PDChoiceFontSize ) { SetMember( choiceFontSize ); sprintf( OpChFsize, "%d", cntl->choiceFontSize ); } if ( mask & FL_PDSliderFontSize ) { SetMember( sliderFontSize ); sprintf( OpSLsize, "%d", cntl->sliderFontSize ); } if ( mask & FL_PDInputFontSize ) { SetMember( inputFontSize ); sprintf( OpILsize, "%d", cntl->inputFontSize ); } if ( mask & FL_PDLabelFontSize ) { SetMember( labelFontSize ); sprintf( OpLLsize, "%d", cntl->labelFontSize ); } if ( mask & FL_PDBorderWidth ) fl_set_border_width( cntl->borderWidth ); if ( mask & FL_PDScrollbarType ) fl_set_scrollbar_type( cntl->scrollbarType ); if ( mask & FL_PDPupFontSize ) { SetMember( pupFontSize ); sprintf( OpPsize, "%d", cntl->pupFontSize ); } if ( mask & FL_PDSafe ) { SetMember( safe ); sprintf( OpSafe, "%d", cntl->safe ); } if ( mask & FL_PDBS ) { SetMember( backingStore ); sprintf( OpBS, "%d", cntl->backingStore ); } if ( mask & FL_PDCoordUnit ) fl_set_coordunit( cntl->coordUnit ); if ( mask & FL_PDDebug ) fli_set_debug_level( cntl->debug ); } /*************************************** * Convenience functions ***************************************/ void fl_set_coordunit( int u ) { const char * cu = fli_get_vn_name( vn_coordunit, u ); if ( cu == NULL ) { M_err( "fl_set_coordunit", "Invald coord unit, defaulting to \"pixel\"" ); u = FL_COORD_PIXEL; cu = "pixel"; } fli_cntl.coordUnit = u; strcpy( OpCoordUnit, cu ); } /*************************************** ***************************************/ void fl_set_border_width( int bw ) { fli_cntl.borderWidth = bw; sprintf( OpIBW, "%d", bw ); } /*************************************** ***************************************/ void fl_set_scrollbar_type( int t ) { fli_cntl.scrollbarType = t; if ( t == FL_NORMAL_SCROLLBAR ) strcpy( OpSCBT, "normal" ); else if ( t == FL_NICE_SCROLLBAR ) strcpy( OpSCBT, "nice" ); else if ( t == FL_PLAIN_SCROLLBAR ) strcpy( OpSCBT, "plain" ); else strcpy( OpSCBT, "thin" ); } /*************************************** ***************************************/ void fl_set_visualID( long id ) { fli_requested_vid = id; sprintf( OpVisualID, "0x%lx", id ); } /*************************************** ***************************************/ int fl_get_border_width( void ) { return fli_cntl.borderWidth; } /*************************************** ***************************************/ int fl_get_coordunit( void ) { return fli_cntl.coordUnit; } /*************************************** ***************************************/ static void fli_set_debug_level( int l ) { fli_cntl.debug = l; sprintf( OpDebug, "%d", fli_cntl.debug ); fli_set_msg_threshold( fli_cntl.debug ); } /*************************************** * Handle XAPPLRESDIR (colon seperated directories) specification. * Ignore the %T %N stuff ***************************************/ static void handle_applresdir( const char * rstr, const char * appclass ) { char *tok; char rbuf[ 512 ], buf[ 512 ]; XrmDatabase fdb = 0; strcpy( rbuf, rstr ); for ( tok = strtok( rbuf, ":" ); tok; tok = strtok( 0, ":" ) ) { fli_snprintf( buf, sizeof buf,"%s/%s", tok,appclass ); M_info( "handle_applresdir", "Trying XAPPLRESDIR: %s", buf ); if ( ( fdb = XrmGetFileDatabase( buf ) ) ) { XrmMergeDatabases( fdb, &fldatabase ); M_warn( "handle_applresdir", "XAPPLRESDIR %s loaded", buf ); } } } /*************************************** * Routine to merge all resource databases, excluding the commandline, * which is done in fl_initialize. ***************************************/ static void init_resource_database( const char *appclass ) { char buf[ FL_PATH_MAX + 127 ], * rstr; XrmDatabase fdb = 0; if ( ! fl_display ) { M_err( "init_resource_database", "fl_initialize is not called" ); return; } if ( fldatabase ) return; XrmInitialize( ); #ifdef __VMS /* For the VMS version try to load the resources from, in this order, DECW$SYSTEM_DEFAULTS:appclass.DAT DECW$USER_DEFAULTS:appclass.DAT DECW$USER_DEFAULTS:DECW$XDEFAULTS.DAT The window resource manager for this display */ fli_snprintf( buf, sizeof buf, "DECW$SYSTEM_DEFAULTS:%s.DAT", appclass ); M_info( "init_resource_database", "Trying Sys_default: %s", buf ); if ( ( fdb = XrmGetFileDatabase( buf ) ) ) { XrmMergeDatabases( fdb, &fldatabase ); M_warn( "init_resource_database", "System default %s loaded", buf ); } fli_snprintf( buf, sizeof buf, "DECW$USER_DEFAULTS:%s.DAT", appclass ); M_info( "init_resource_database", "Trying User_default: %s", buf ); if ( ( fdb = XrmGetFileDatabase( buf ) ) ) { XrmMergeDatabases( fdb, &fldatabase ); M_warn( "init_resource_database", "System default %s loaded", buf ); } fli_snprintf( buf, sizeof buf, "DECW$USER_DEFAULTS:DECW$XDEFAULTS.DAT" ); M_info( "init_resource_database", "Trying Sys_default: %s", buf ); if ( ( fdb = XrmGetFileDatabase( buf ) ) ) { XrmMergeDatabases( fdb, &fldatabase ); M_warn( "init_resource_database", "System default %s loaded", buf ); } M_info( "init_resource_database", "Trying RESOURCE_MANAGER" ); if ( ( rstr = XResourceManagerString( fl_display ) ) ) { if ( ( fdb = XrmGetStringDatabase( rstr ) ) ) { XrmMergeDatabases( fdb, &fldatabase ); M_warn( "init_resource_database", "RESOURCE_MANAGER loaded" ); } } #else /* !VMS */ fli_snprintf( buf, sizeof buf, "/usr/lib/X11/app-defaults/%s", appclass ); M_info( "init_resource_database", "Trying Sys_default: %s", buf ); if ( ( fdb = XrmGetFileDatabase( buf ) ) ) { XrmMergeDatabases( fdb, &fldatabase ); M_warn( "init_resource_database", "System default %s loaded", buf ); } /* try XAPPLRESDIR */ M_info( "init_resource_database", "Trying XAPPLRESDIR" ); if ( ( rstr = getenv( "XAPPLRESDIR" ) ) ) handle_applresdir( rstr, appclass ); /* try server defined resources */ M_info( "init_resource_database", "Trying RESOURCE_MANAGER" ); if ( ( rstr = XResourceManagerString( fl_display ) ) ) { if ( ( fdb = XrmGetStringDatabase( rstr ) ) ) { XrmMergeDatabases( fdb, &fldatabase ); M_warn( "init_resource_database", "RESOURCE_MANAGER loaded" ); } } else { /* Try ~/.Xdefaults */ if ( ( rstr = getenv( "HOME" ) ) ) { fli_snprintf( buf, sizeof buf,"%s/.Xdefaults", rstr ); M_info( "init_resource_database", "Trying %s", buf ); if ( ( fdb = XrmGetFileDatabase( buf ) ) ) { XrmMergeDatabases( fdb, &fldatabase ); M_warn( "init_resource_database", "%s loaded", buf ); } } } /* Load file XENVIRONMENT */ M_info( "init_resource_database", "Trying environment variable XEVIRONMENT" ); if ( ( rstr = getenv( "XENVIRONMENT" ) ) ) { if ( ( fdb = XrmGetFileDatabase( rstr ) ) ) { XrmMergeDatabases( fdb, &fldatabase ); M_warn( "init_resource_database", "%s loaded", rstr ); } } else { /* ~/.Xdefaults- */ M_info( "init_resource_database", "Trying ~/.Xdefaults-" ); if ( ( rstr = getenv( "HOME" ) ) ) { int l; fli_snprintf( buf, sizeof buf,"%s/.Xdefaults", rstr ); l = strlen( strcat( buf, "-" ) ); gethostname( buf + l, sizeof buf - l ); M_info( "init_resource_database", "Trying %s", buf ); if ( ( fdb = XrmGetFileDatabase( buf ) ) ) { XrmMergeDatabases( fdb, &fldatabase ); M_warn( "init_resource_database", "%s loaded", buf ); } } } #endif /* VMS */ errno = 0; if ( ! fldatabase ) { M_warn( "init_resource_database", "Can't find any resource databases!" ); return; } } /*************************************** ***************************************/ static int is_true( const char * s ) { return strncmp( s, "True", 4 ) == 0 || strncmp( s, "true", 4 ) == 0 || strncmp( s, "Yes", 3 ) == 0 || strncmp( s, "yes", 3 ) == 0 || strncmp( s, "On", 2 ) == 0 || strncmp( s, "on", 2 ) == 0 || *s == '1'; } /*************************************** * The resource routine of the lowest level. Only adds the application * name. * * Return the string representation of the resource value ***************************************/ const char * fl_get_resource( const char * rname, /* resource name */ const char * cname, /* class name */ FL_RTYPE dtype, /* data type */ const char * defval, /* default */ void * val, /* variable */ int size ) /* buffer size if string */ { XrmValue entry = { 0, NULL }; char * type = NULL; char res_name[ 256 ] = "", res_class[ 256 ] = ""; if ( ! ( rname && * rname ) && ! ( cname && *cname ) ) return NULL; if ( rname && *rname ) fli_snprintf( res_name, sizeof res_name, "%s.%s", fl_app_name, rname ); else fli_snprintf( res_class, sizeof res_class, "%s.%s", fl_app_class, cname ); /* Just checking the return value of XrmGetResource() doesn't seem to work (as it should, unless I completely misunderstand the man page), and 'entry' seems to return the same data as on a previous call (despite the initialization!), but 'type' seems to get set to NULL in cases of failure to find the requested resource in the database. So in that case we try to use the default value. JTT */ if ( ! XrmGetResource( fldatabase, res_name, res_class, &type, &entry ) || ! type || strcmp( type, "String" ) || ! entry.addr ) { M_warn( "fl_get_resource", "%s (%s): not found", res_name, res_class ); entry.addr = ( XPointer ) defval; } else M_info( "fl_get_resource", "%s (%s): %s", res_name, res_class, entry.addr ); if ( dtype == FL_NONE || ! entry.addr ) return entry.addr; switch ( dtype ) { case FL_SHORT: * ( short * ) val = strtol( entry.addr, NULL, 10 ); break; case FL_INT: * ( int * ) val = strtol( entry.addr, NULL, 10 ); break; case FL_BOOL: * ( int * ) val = is_true( entry.addr ); break; case FL_LONG: * ( long * ) val = strtol( entry.addr, NULL, 10 ); break; case FL_FLOAT: * ( float * ) val = atof( entry.addr ); break; case FL_STRING: if ( val && val != entry.addr && size > 0 ) { strncpy( val, entry.addr, size ); ( ( char * ) val )[ size - 1 ] = '\0'; } break; default: M_err( "fl_get_resource", "Unknown type %d", dtype ); return NULL; } return entry.addr; } /*************************************** ***************************************/ void fl_set_resource( const char * str, const char * val ) { char res_name[ 256 ]; fli_snprintf( res_name, sizeof res_name, "%s.%s", fl_app_name, str ); XrmPutStringResource( &fldatabase, res_name, ( char * ) val ); } /*************************************** * internal resource initialization ***************************************/ static void fli_init_resources( void ) { char res[ 256 ], cls[ 256 ], ores[ 256 ]; char * appname = fl_app_name, * appclass = fl_app_class; char * ori_appname = fl_ori_app_name; /* internal resources need to be prefixed xform and XForm. need to generate for all names */ fli_snprintf( cls, sizeof cls, "%s.XForm", fl_app_class ); fl_app_class = cls; fli_snprintf( res, sizeof res, "%s.xform", fl_app_name ); fl_app_name = res; fli_snprintf( ores, sizeof ores, "%s.xform", fl_ori_app_name ); fl_ori_app_name = ores; fl_get_app_resources( internal_resources, Niopt ); fl_app_name = appname; fl_app_class = appclass; fl_ori_app_name = ori_appname; if ( fli_cntl.sync ) { XSynchronize( fl_display, 1 ); M_err( "fli_init_resources", "**** Synchronous Mode ********" ); fli_set_debug_level( 4 ); } } static int fli_argc; static char ** fli_argv; /*************************************** ***************************************/ static void dup_argv( char ** argv, int n ) { int i; if ( ! argv ) return; if ( ! fli_argv ) fli_argv = fl_malloc( ( n + 1 ) * sizeof *fli_argv ); for ( i = 0; i < n; i++ ) fli_argv[ i ] = fl_strdup( argv[ i ] ); fli_argv[ i ] = NULL; } /*************************************** ***************************************/ char ** fl_get_cmdline_args( int * n ) { *n = fli_argc; return fli_argv; } /*************************************** ***************************************/ void fli_free_cmdline_args( void ) { size_t i; if ( ! fli_argv ) return; for ( i = 0; fli_argv[ i ]; i++ ) fli_safe_free( fli_argv[ i ] ); fli_safe_free( fli_argv ); } /*************************************** * find the command name from arg[0] and return a copy of it ***************************************/ static char * get_command_name( const char * arg0 ) { char *p; char *s = fl_strdup( arg0 ); char *cmd_name = s; #ifdef __VMS /* vms command disk:[path]command.exe */ if ( ( p = strrchr( s, ']' ) ) ) cmd_name = p + 1; #else #ifdef FL_WIN32 _splitpath( arg0, NULL, NULL, cmd_name, NULL ); #else if ( ( p = strrchr( s, '/' ) ) ) cmd_name = p + 1; #endif #endif /* Remove the extension and the period */ if ( ( p = strrchr( cmd_name, '.' ) ) ) *p = '\0'; /* Prevent a valgrind warning about a possible memory leak. */ if ( s != cmd_name ) { cmd_name = fl_strdup( cmd_name ); fl_free( s ); } return cmd_name; } /* * Global Routines to do the initialization and resource management * */ #define DumpD( a ) fprintf( stderr,"\t%s:%d\n", #a, fli_cntl.a ) #define DumpS( a ) fprintf( stderr,"\t%s:%s\n", #a, fli_cntl.a ) #define DumpF( a ) fprintf( stderr,"\t%s:%.3f\n", #a, fli_cntl.a ) static Window fli_GetVRoot( Display *, int ); /*************************************** * initialize context ***************************************/ void fli_init_context( void ) { if ( fli_context ) return; if ( ! ( fli_context = fl_calloc( 1, sizeof *fli_context ) ) ) { M_err( "fli_init_context", "Running out of memory" ); exit( 1 ); } fli_context->io_rec = NULL; fli_context->idle_rec = NULL; fli_context->atclose = NULL; fli_context->signal_rec = NULL; fli_context->idle_delta = FLI_TIMER_RES; fli_context->hscb = FL_HOR_THIN_SCROLLBAR; fli_context->vscb = FL_VERT_THIN_SCROLLBAR; fli_context->navigate_mask = ShiftMask; /* to navigate input field */ fli_context->xim = NULL; fli_context->xic = NULL; } /*************************************** ***************************************/ void fli_set_input_navigate( unsigned int mask ) { fli_init_context( ); if ( mask == ShiftMask || mask == Mod1Mask || mask == ControlMask ) fli_context->navigate_mask = mask; } /*************************************** ***************************************/ Display * fl_initialize( int * na, char * arg[ ], const char * appclass, FL_CMD_OPT * appopt, int nappopt ) { char disp_name[ 256 ], disp_cls[ 256 ], buf[ 256 ]; XrmValue xval; char *type; float xdpi, ydpi; if ( fl_display ) { M_warn( "fl_initialize", "XForms: already initialized" ); return fl_display; } /* Be paranoid */ if ( ! na || ! *na ) { M_err( "fl_initialize", "XForms: argc == 0 or argv == NULL detected\n" ); exit( 1 ); } fli_internal_init( ); XrmInitialize( ); /* Save a copy of the command line for later WM hints */ fli_argc = *na; dup_argv( arg, *na ); /* Get appname and class, but without any leading paths */ fl_ori_app_name = fl_app_name = get_command_name( arg[ 0 ] ); fl_app_class = fl_strdup( ( appclass && *appclass ) ? appclass : fl_app_name ); /* Make class name upper case if non supplied */ if ( ! appclass || ! *appclass ) { fl_app_class[ 0 ] = toupper( fl_app_class[ 0 ] ); if ( fl_app_class[ 0 ] == 'X' ) fl_app_class[ 1 ] = toupper( fl_app_class[ 1 ] ); } /* Do form internal resouces first */ XrmParseCommand( &cmddb, copt, Ncopt, fl_app_name, na, arg ); /* if there are still more left and appopt is not zero */ if ( appopt && na && *na ) XrmParseCommand( &cmddb, appopt, nappopt, ( char * ) fl_ori_app_name, na, arg ); /* Check version request */ fli_snprintf( disp_name, sizeof disp_name, "%s.fl_version", fl_app_name ); fli_snprintf( disp_cls, sizeof disp_cls, "%s.flversion", fl_app_name ); if ( XrmGetResource( cmddb, disp_name, disp_cls, &type, &xval ) ) fli_print_version( 0 ); /* Get the display name first before doing anything */ fli_snprintf( disp_name, sizeof disp_name, "%s.display", fl_ori_app_name ); fli_snprintf( disp_cls , sizeof disp_cls , "%s.Display", fl_app_class ); *buf = '\0'; if ( XrmGetResource( cmddb, disp_name, disp_cls, &type, &xval ) ) { strncpy( buf, xval.addr, sizeof buf ); buf[ sizeof buf - 1 ] = '\0'; } /* Open display and quit on failure */ if ( ! ( fl_display = XOpenDisplay( buf ) ) ) { /* if no display is set, there is no guarantee that buf is long enough to contain the DISPLAY setting */ M_err( "fl_initialize", "%s: Can't open display %s", fli_argv[ 0 ], XDisplayName( buf[ 0 ] ? buf : 0 ) ); return 0; } flx->display = fl_display; flx->screen = fl_screen; /* Get debug level settings since all error reporting will be controled by it */ fli_snprintf( disp_name, sizeof disp_name, "%s.fldebug", fl_app_name ); fli_snprintf( disp_cls , sizeof disp_cls , "%s.flDebug", fl_app_class ); if ( XrmGetResource( cmddb, disp_name, disp_cls, &type, &xval ) ) fli_set_debug_level( atoi( xval.addr ) ); /* print help */ fli_snprintf( disp_name, sizeof disp_name, "%s.flhelp", fl_app_name ); fli_snprintf( disp_cls , sizeof disp_cls , "%s.flhelp", fl_app_class ); if ( XrmGetResource( cmddb, disp_name, disp_cls, &type, &xval ) ) { size_t i = 0; while ( i < Ncopt ) { if ( i == 0 ) fprintf( stderr, "%s: ", fli_argv[ 0 ] ); else fprintf( stderr, "%*s ", ( int ) strlen( fli_argv[ 0 ] ), "" ); fprintf( stderr, " %s", copt[ i ].option ); if ( copt[ i ].argKind == XrmoptionSepArg ) fprintf( stderr, " \t[arg]" ); fprintf( stderr, "\n" ); i++; } exit(1); } /* Check if -name is present */ fli_snprintf( disp_name, sizeof disp_name, "%s.name", fl_app_name ); fli_snprintf( disp_cls, sizeof disp_cls , "%s.Name", fl_app_class ); M_warn( "fl_initialize", "Trying display %s", disp_name ); if ( XrmGetResource( cmddb, disp_name, disp_cls, &type, &xval ) ) { fl_app_name = fl_strdup( xval.addr ); M_warn( "fl_initialize", "Changed AppName from %s to %s", fl_ori_app_name, fl_app_name ); } /* Merge other resource database */ init_resource_database( fl_app_class ); /* Override any options in the database with the command line opt */ XrmMergeDatabases( cmddb, &fldatabase ); /* Load FL resources */ fli_init_resources( ); fli_cntl.vclass = fli_vclass_val( fli_cntl.vname ); fli_cntl.coordUnit = fli_get_vn_value( vn_coordunit, OpCoordUnit ); if ( fli_cntl.coordUnit == -1 ) fli_cntl.coordUnit = FL_COORD_PIXEL; #if FL_DEBUG >= ML_WARN if ( fli_cntl.debug ) { fprintf( stderr, "Options Set\n" ); DumpD( debug ); fprintf( stderr, "\tVisual:%s (%d)\n", fli_cntl.vclass >= 0 ? fli_vclass_name( fli_cntl.vclass ) : "To be set", fli_cntl.vclass ); DumpD( depth ); DumpD( privateColormap ); DumpD( sharedColormap ); DumpD( standardColormap ); DumpD( doubleBuffer ); DumpD( ulPropWidth ); DumpD( ulThickness ); DumpD( scrollbarType ); DumpD( backingStore ); fprintf( stderr, "\t%s:%s\n", "coordUnit", fli_get_vn_name( vn_coordunit, fli_cntl.coordUnit ) ); fprintf( stderr, "\t%s: 0x%lx\n", "VisualId", fli_requested_vid ); #ifdef DO_GAMMA_CORRECTION DumpF( rgamma ); DumpF( ggamma ); DumpF( bgamma ); #endif } #endif #ifdef DO_GAMMA_CORRECTION fl_set_gamma( fli_cntl.rgamma, fli_cntl.ggamma, fli_cntl.bgamma ); #endif fli_set_ul_property( fli_cntl.ulPropWidth, fli_cntl.ulThickness ); fli_cntl.vclass = fli_vclass_val( fli_cntl.vname ); /* Get the current keyboard state */ { XKeyboardState xks; XGetKeyboardControl( fl_display, &xks ); fli_keybdcontrol.auto_repeat_mode = xks.global_auto_repeat; fli_keybdmask = KBAutoRepeatMode; } /* Other initializations */ fl_screen = flx->screen = DefaultScreen( fl_display ); fl_root = RootWindow( fl_display, fl_screen ); fl_vroot = fli_GetVRoot( fl_display, fl_screen ); fli_wmstuff.pos_request = USPosition; if ( fl_root != fl_vroot ) { M_warn( "fl_initialize", "fl_root = %lu fl_vroot = %lu", fl_root, fl_vroot ); /* tvtwm requires this to position a window relative to the current desktop */ fli_wmstuff.pos_request = PPosition; } fl_scrh = DisplayHeight( fl_display, fl_screen ); fl_scrw = DisplayWidth( fl_display, fl_screen ); xdpi = fl_scrw * 25.4 / DisplayWidthMM( fl_display, fl_screen ); ydpi = fl_scrh * 25.4 / DisplayHeightMM( fl_display, fl_screen ); if ( xdpi / ydpi > 1.05 || ydpi / xdpi < 0.95 ) M_warn( "fl_initialize", "NonSquarePixel %.1f %.1f", xdpi, ydpi ); fl_dpi = ( xdpi + ydpi ) / 2; fl_dpi = FL_nint( fl_dpi * 10.0 + 0.5 ) * 0.1; M_info( "fl_initialize", "screen DPI = %f", fl_dpi ); fl_vmode = fli_initialize_program_visual( ); fli_init_colormap( fl_vmode ); fli_init_font( ); fli_init_context( ); #ifdef XlibSpecificationRelease if ( XSupportsLocale( ) ) { XSetLocaleModifiers( "" ); /* Use the same input method throughout xforms */ fli_context->xim = XOpenIM( fl_display, NULL, NULL, NULL ); /* Also use the same input context */ if ( fli_context->xim ) { int style = XIMPreeditNothing | XIMStatusNothing; fli_context->xic = XCreateIC( fli_context->xim, XNInputStyle, style, ( char * ) NULL ); /* Clean-up on failure */ if ( ! fli_context->xic ) { M_err( "fl_initialize", "Could not create an input context" ); XCloseIM( fli_context->xim ); } } else M_err( "fl_initialize", "Could not create an input method" ); } #endif fli_default_xswa( ); fli_init_stipples( ); /* If using non-default visual or private colormap, need a window with correct visual/colormap and depth */ fl_state[ fl_vmode ].trailblazer = fl_root; if ( fli_visual( fl_vmode ) != DefaultVisual( fl_display, fl_screen ) || fl_state[ fl_vmode ].pcm ) { fl_state[ fl_vmode ].trailblazer = fli_create_window( fl_root, fli_colormap( fl_vmode ), "trailblazer" ); } if ( strcmp( OpSCBT, "plain" ) == 0 ) { fli_context->hscb = FL_HOR_PLAIN_SCROLLBAR; fli_context->vscb = FL_VERT_PLAIN_SCROLLBAR; } else if ( strcmp( OpSCBT, "normal" ) == 0 ) { fli_context->hscb = FL_HOR_SCROLLBAR; fli_context->vscb = FL_VERT_SCROLLBAR; } else if ( ! strcmp( OpSCBT, "thin" ) ) { fli_context->hscb = FL_HOR_THIN_SCROLLBAR; fli_context->vscb = FL_VERT_THIN_SCROLLBAR; } else if ( ! strcmp( OpSCBT, "nice" ) ) { fli_context->hscb = FL_HOR_NICE_SCROLLBAR; fli_context->vscb = FL_VERT_NICE_SCROLLBAR; } fli_context->max_request_size = XMaxRequestSize( fl_display ); if ( fli_context->max_request_size < 4096 ) { M_err( "fl_initialize", "Something is wrong with max_request_size: %ld", fli_context->max_request_size ); fli_context->max_request_size = 4096; } #if XlibSpecificationRelease >= 6 fli_context->ext_request_size = XExtendedMaxRequestSize( fl_display ); #else fli_context->ext_request_size = 0; #endif if ( ! fli_context->ext_request_size ) fli_context->ext_request_size = fli_context->max_request_size; fli_context->max_request_size -= 8; fli_context->ext_request_size -= 8; fli_context->tooltip_time = 600; fl_add_io_callback( ConnectionNumber( fl_display ), FL_READ, NULL, NULL ); /* Has to be here, otherwise fl_add_symbol won't be able to replace the built-in */ fli_init_symbols( ); /* Hang the database on the display so application can get it */ XrmSetDatabase( fl_display, fldatabase ); /* Initialize popup system */ fli_popup_init( ); return fl_display; } /*************************************** * Cleanup everything. At the moment, only need to restore the keyboard * settings and deallocate memory used for the object and event queue etc. ***************************************/ void fl_finish( void ) { /* Make sure the connection is alive */ if ( ! flx->display ) return; XChangeKeyboardControl( flx->display, fli_keybdmask, &fli_keybdcontrol ); fli_remove_all_signal_callbacks( ); fli_remove_all_timeouts( ); /* Get rid of all forms, first hide all of them */ while ( fli_int.formnumb > 0 ) fl_hide_form( fli_int.forms[ 0 ] ); /* Now also delete them (to deallocate memory) - problem is that the tooltip form may only be deleted as the very last one since the objects that have a tooltip (and that get deleted in the process of deleting the form they belong to) still try to access the tooltip form */ while ( fli_int.hidden_formnumb > 0 ) { if ( fli_int.hidden_formnumb > 1 && fli_is_tooltip_form( fli_int.forms[ 0 ] ) ) fl_free_form( fli_int.forms[ 1 ] ); else fl_free_form( fli_int.forms[ 0 ] ); } /* Delete the object and event queue */ fli_obj_queue_delete( ); fli_event_queue_delete( ); /* Free memory allocated in xtext.c */ fli_free_xtext_workmem( ); /* Release memory used for symbols */ fli_release_symbols( ); /* Release memory allocated in goodies */ fli_goodies_cleanup( ); /* Release memory allocated for file selectors */ fli_free_fselectors( ); /* Release memory used by the popup system */ fli_popup_finish( ); /* Release memory used for the copy of the command line arguments */ fli_free_cmdline_args( ); /* Release memory used for cursors */ fli_free_cursors( ); /* Free memory used for colormaps */ fli_free_colormap( fl_vmode ); /* Get rid of memory for input methods */ #ifdef XlibSpecificationRelease if ( fli_context && XSupportsLocale( ) && fli_context->xim ) { if ( fli_context->xic ) XDestroyIC( fli_context->xic ); XCloseIM( fli_context->xim ); } #endif if ( fli_context ) while ( fli_context->io_rec ) fl_remove_io_callback( fli_context->io_rec->source, fli_context->io_rec->mask, fli_context->io_rec->callback ); fli_safe_free( fli_context ); /* Close the display */ XCloseDisplay( flx->display ); flx->display = fl_display = None; } /*************************************** * Find out about virtual root. Taken from XFaq ***************************************/ #include static int xerror_handler( Display * d FL_UNUSED_ARG, XErrorEvent * xev ) { return xev->error_code; } static Window fli_GetVRoot( Display * dpy, int scr ) { Window rootReturn; Window parentReturn; Window *children; unsigned int numChildren; Window root = RootWindow( dpy, scr ); Atom __SWM_VROOT = None; unsigned int i; int ( * oldhandler )( Display *, XErrorEvent * ); __SWM_VROOT = XInternAtom( dpy, "__SWM_VROOT", False ); XQueryTree( dpy, root, &rootReturn, &parentReturn, &children, &numChildren ); /* For some reasons XQueryTree sometimes seems to return an invalid window in the list of children (perhaps the window vanishes between the call of XQueryTree() and the subsequent call of XGetWindowProperty()?). To avoid a program using XForms aborting with a strange X error message on start-up, we catch these errors with a temporary error handler (which gets reset before leaving the function). */ oldhandler = XSetErrorHandler( xerror_handler ); for ( i = 0; i < numChildren; i++ ) { Atom actual_type; int actual_format; unsigned long nitems, bytesafter; Window *newRoot = NULL; /* Kludge here: the ( void * ) bit in ( unsigned char ** ) ( void * ) &newRoot is there to avoid a spurious GCC warning JTT */ children[ i ] = 0; if ( XGetWindowProperty( dpy, children[ i ], __SWM_VROOT, 0, 1, False, XA_WINDOW, &actual_type, &actual_format, &nitems, &bytesafter, ( unsigned char ** ) ( void * ) &newRoot ) == Success && newRoot ) { root = *newRoot; break; } } XSetErrorHandler( oldhandler ); XFree( ( char * ) children ); return root; } /*************************************** * For Application programs ***************************************/ static void fli_get_app_resource( FL_resource * appresource, int n ) { FL_resource *flr = appresource, *flrs = flr + n; for ( ; flr < flrs; flr++ ) if ( flr->type == FL_STRING && flr->nbytes == 0 ) M_err( "fl_get_app_resources", "%s: buflen == 0", flr->res_name ); else fl_get_resource( flr->res_name, flr->res_class, flr->type, flr->defval, flr->var, flr->nbytes ); } /*************************************** ***************************************/ void fl_get_app_resources( FL_resource * appresource, int n ) { char *tmp = fl_app_name; fl_app_name = fl_ori_app_name; fli_get_app_resource( appresource, n ); if ( fl_app_name != tmp ) { fl_app_name = tmp; fli_get_app_resource( appresource, n ); } } /*************************************** ***************************************/ void fl_flip_yorigin( void ) { if ( ! fl_display ) fli_inverted_y = 1; else M_err( "fl_flip_yorigin", "Only supported before fl_initialize" ); } /*************************************** ***************************************/ void fli_set_app_name( const char * n, const char * c ) { if ( n ) fl_app_name = fl_strdup( n ); if ( c ) fl_app_class = fl_strdup( c ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/goodie_alert.c0000644000175000017500000001410312253204545013325 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file goodie_alert.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/flvasprintf.h" /****************** Alert dialog ********************{**/ typedef struct { FL_FORM * form; FL_OBJECT * str; FL_OBJECT * but; FL_OBJECT * title; } FD_alert; static FD_alert *fd_alert; /*************************************** ***************************************/ static FD_alert * create_alert( const char * title, const char * msg ) { FD_alert *fdui = fl_calloc( 1, sizeof *fdui ); int oldy = fli_inverted_y; int oldu = fl_get_coordunit( ); int style, size; int w_tit = 0, h_tit = 0, w_msg = 0, h_msg = 0, w_but = 0, h_but; int box_w, box_h, but_w; char but_text[ 256 ] = "Dismiss"; fli_inverted_y = 0; fl_set_coordunit( FL_COORD_PIXEL ); fli_get_goodies_font( &style, &size ); if ( title ) fl_get_string_dimension( FL_BOLD_STYLE, FL_NORMAL_SIZE, title, strlen( title ), &w_tit, &h_tit ); if ( msg ) fl_get_string_dimension( style, size, msg, strlen( msg ), &w_msg, &h_msg ); fl_get_resource( FLAlertDismissLabel, NULL, FL_STRING, NULL, but_text, 256 ); fl_get_string_dimension( style, size, but_text, strlen( but_text ), &w_but, &h_but ); but_w = FL_max( 90, w_but + 20 ); box_w = FL_max( 400, FL_max( FL_max( w_tit, w_msg ), but_w ) + 80 ); box_h = FL_max( h_tit + 20, 30 ) + 5 + h_msg + 30 + h_but + 20; fdui->form = fl_bgn_form( FL_FLAT_BOX, box_w, box_h ); fl_set_form_title( fdui->form, "Alert" ); fli_get_goodie_title( fdui->form, FLAlertTitle ); fdui->title = fl_add_box( FL_FLAT_BOX, 60, 10, box_w - 80, h_tit, title ? title : "" ); fl_set_object_lstyle( fdui->title, FL_BOLD_STYLE ); fl_set_object_lsize( fdui->title, FL_NORMAL_SIZE ); fli_add_warn_icon( 8, h_tit + 20 - 15, 35, 35 ); fl_add_box( FL_FLAT_BOX, 50, h_tit + 20, box_w - 60, 5, "@DnLine" ); fdui->str = fl_add_text( FL_FLAT_BOX, 60, h_tit + 35, box_w - 80, h_msg + 10, msg ? msg : "" ); fl_set_object_lalign( fdui->str, FL_ALIGN_CENTER ); fl_set_object_lstyle( fdui->str, style ); fl_set_object_lsize( fdui->str, size ); fdui->but = fl_add_button( FL_RETURN_BUTTON, ( box_w - but_w ) / 2, box_h - h_but - 20, but_w, h_but + 10, but_text ); fl_set_object_lstyle( fdui->but, style ); fl_set_object_lsize( fdui->but, size ); fl_set_form_hotobject( fdui->form, fdui->but ); fl_end_form( ); fl_register_raw_callback( fdui->form, FL_ALL_EVENT, fli_goodies_preemptive ); fl_set_form_atclose( fdui->form, fl_goodies_atclose, fdui->but ); fdui->form->fdui = fdui; fli_inverted_y = oldy; fl_set_coordunit( oldu ); return fdui; } /*************************************** ***************************************/ static void show_it( const char * title, const char * msg, int c ) { if ( fd_alert ) { fl_hide_form( fd_alert->form ); fl_free_form( fd_alert->form ); fd_alert = NULL; } fl_deactivate_all_forms( ); fd_alert = create_alert( title, msg ); fl_show_form( fd_alert->form, c ? FL_PLACE_CENTER : FL_PLACE_HOTSPOT, FL_TRANSIENT, fd_alert->form->label ); fl_update_display( 1 ); while ( fl_do_only_forms( ) != fd_alert->but ) /* empty */ ; fl_hide_form( fd_alert->form ); fl_free_form( fd_alert->form ); fli_safe_free( fd_alert ); fl_activate_all_forms( ); } /*************************************** * Show a simple message with an alert icon and a dismiss button ***************************************/ void fl_show_alert( const char * title, const char * str1, const char * str2, int c ) { char *buf; buf = fl_malloc( ( str1 ? strlen( str1 ) : 0 ) + 1 + ( str2 ? strlen( str2 ) : 0 ) + 1 ); sprintf( buf, "%s\n%s", str1 ? str1 : "", str2 ? str2 : "" ); show_it( title, buf, c ); fl_free( buf ); } /*************************************** ***************************************/ void fl_show_alert_f( int c, const char * fmt, ... ) { char *buf, *p; EXPAND_FORMAT_STRING( buf, fmt ); if ( buf ) { p = strchr( buf, '\f' ); if ( p ) *p++ = '\0'; fl_show_alert( buf, p, NULL, c ); fl_free( buf ); } } /*************************************** ***************************************/ void fl_hide_alert( void ) { if ( fd_alert && fd_alert->form->visible ) fl_trigger_object( fd_alert->but ); else M_warn( "fl_hide_alert", "No alert box is shown" ); } /*************************************** ***************************************/ void fli_alert_cleanup( void ) { fli_safe_free( fd_alert ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/goodie_yesno.c0000644000175000017500000001237712251554160013365 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file goodie_yesno.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include /************* Ask yes/no question **********************{****/ typedef struct { FL_FORM * form; FL_OBJECT * str; FL_OBJECT * yes; FL_OBJECT * no; } FD_yesno; /*************************************** ***************************************/ static FD_yesno * create_yesno( void ) { FD_yesno *fdui = malloc( sizeof *fdui ); int oldy = fli_inverted_y; int oldu = fl_get_coordunit( ); fli_inverted_y = 0; fl_set_coordunit( FL_COORD_PIXEL ); fdui->form = fl_bgn_form( FL_FLAT_BOX, 460, 130 ); fl_set_form_title( fdui->form, "Question" ); fdui->str = fl_add_box( FL_FLAT_BOX, 20, 15, 420, 65, "" ); fdui->yes = fl_add_button( FL_NORMAL_BUTTON, 85, 90, 80, 27, "Yes" ); fl_set_button_shortcut( fdui->yes, "Yy", 1 ); fdui->no = fl_add_button( FL_NORMAL_BUTTON, 295, 90, 80, 27, "No" ); fl_set_button_shortcut( fdui->no, "Nn", 1 ); fli_add_q_icon( 10, 20, 33, 33 ); fl_end_form( ); fl_register_raw_callback( fdui->form, FL_ALL_EVENT, fli_goodies_preemptive ); fl_set_form_atclose( fdui->form, fl_goodies_atclose, fdui->no ); if ( fli_cntl.buttonFontSize != FL_DEFAULT_SIZE ) fl_fit_object_label( fdui->no, 22, 2 ); fli_inverted_y = oldy; fl_set_coordunit( oldu ); return fdui; } static FD_yesno *fd_yesno = NULL; static int default_ans; /*************************************** * Shows a question with two buttons, yes and no ***************************************/ int fl_show_question( const char * str, int ans ) { FL_OBJECT *retobj; char shortcut[ 4 ]; int k = 0; if ( fd_yesno ) { fl_hide_form( fd_yesno->form ); fl_free_form( fd_yesno->form ); fl_free( fd_yesno ); } else fl_deactivate_all_forms( ); fd_yesno = create_yesno( ); default_ans = ans; fli_parse_goodies_label( fd_yesno->yes, FLQuestionYesLabel ); fli_parse_goodies_label( fd_yesno->no, FLQuestionNoLabel ); /* We don't set a shortcut if the first letter of the "yes" label is identical to all letters in the "no" label */ while ( fd_yesno->no->label[ k ] && tolower( ( int ) fd_yesno->yes->label[ 0 ] ) == tolower( ( int ) fd_yesno->yes->label[ k ] ) ) k++; if ( fd_yesno->no->label[ k ] ) { shortcut[ 0 ] = fd_yesno->yes->label[ 0 ]; shortcut[ 1 ] = tolower( ( int ) fd_yesno->yes->label[ 0 ] ); shortcut[ 2 ] = toupper( ( int ) fd_yesno->yes->label[ 0 ] ); shortcut[ 3 ] = '\0'; fl_set_button_shortcut( fd_yesno->yes, shortcut, 1 ); shortcut[ 0 ] = fd_yesno->no->label[ k ]; shortcut[ 1 ] = toupper( ( int ) fd_yesno->no->label[ k ] ); shortcut[ 2 ] = tolower( ( int ) fd_yesno->no->label[ k ] ); fl_set_button_shortcut( fd_yesno->no, shortcut, 1 ); } fli_get_goodie_title( fd_yesno->form, FLQuestionTitle ); fli_handle_goodie_font( fd_yesno->yes, fd_yesno->str ); fli_handle_goodie_font( fd_yesno->no, NULL ); fl_set_object_label( fd_yesno->str, str ); if ( ans == 1 ) fl_set_form_hotobject( fd_yesno->form, fd_yesno->yes ); else if ( ans == 0 ) fl_set_form_hotobject( fd_yesno->form, fd_yesno->no ); else fl_set_form_hotspot( fd_yesno->form, -1, -1 ); fl_show_form( fd_yesno->form, FL_PLACE_HOTSPOT, FL_TRANSIENT, fd_yesno->form->label ); fl_update_display( 0 ); while ( ( retobj = fl_do_only_forms( ) ) != fd_yesno->yes && retobj != fd_yesno->no ) /* empty */; k = retobj == fd_yesno->yes; fl_hide_form( fd_yesno->form ); fl_free_form( fd_yesno->form ); fli_safe_free( fd_yesno ); fl_activate_all_forms( ); return k; } /*************************************** ***************************************/ void fl_hide_question( void ) { if ( fd_yesno ) fl_trigger_object( default_ans == 1 ? fd_yesno->yes : fd_yesno->no ); else M_warn( "fl_hide_question", "No question box is shown" ); } /*************************************** ***************************************/ void fli_question_cleanup( void ) { fli_safe_free( fd_yesno ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/nmenu.c0000664000175000017500000005102712353623325012024 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/pnmenu.h" static int handle_nmenu( FL_OBJECT *, int, FL_Coord, FL_Coord, int , void * ); static void draw_menu( FL_OBJECT * ); #define IS_TOUCH_NMENU( o ) \ ( ( o )->type == FL_NORMAL_TOUCH_NMENU \ || ( o )->type == FL_BUTTON_TOUCH_NMENU ) #define IS_BUTTON_NMENU( o ) \ ( ( o )->type == FL_BUTTON_NMENU \ || ( o )->type == FL_BUTTON_TOUCH_NMENU ) /*************************************** * Create a nmenu object ***************************************/ FL_OBJECT * fl_create_nmenu( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; FLI_NMENU_SPEC *sp; obj = fl_make_object( FL_NMENU, type, x, y, w, h, label, handle_nmenu ); obj->boxtype = FL_FLAT_BOX; obj->col1 = FL_COL1; obj->col2 = IS_BUTTON_NMENU( obj ) ? FL_MCOL : FL_BOTTOM_BCOL; obj->lcol = FL_LCOL; obj->lstyle = FL_NORMAL_STYLE; obj->align = FL_ALIGN_CENTER; sp = obj->spec = fl_malloc( sizeof *sp ); sp->popup = NULL; sp->sel = NULL; sp->hl_color = IS_BUTTON_NMENU( obj ) ? FL_LCOL : FL_WHITE; fl_set_object_return( obj, FL_RETURN_END_CHANGED ); return obj; } /*************************************** * Add a nmenu object ***************************************/ FL_OBJECT * fl_add_nmenu( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; obj = fl_create_nmenu( type, x, y, w, h, label ); fl_add_object( fl_current_form, obj ); /* Popup can only be created after the object has been added to its form, otherwise we don't know which window is its parent window... */ ( ( FLI_NMENU_SPEC * ) obj->spec )->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_add_nmenu" ); return obj; } /*************************************** * Remove all items from nmenu objects popup ***************************************/ int fl_clear_nmenu( FL_OBJECT * obj ) { FLI_NMENU_SPEC *sp; if ( obj == NULL ) { M_err( "fl_clear_nmenu_popup", "NULL object" ); return -1; } sp = obj->spec; /* Remove all existing entries and reset the popups internal counter */ if ( sp->popup != NULL ) { while ( sp->popup->entries != NULL ) fl_popup_entry_delete( sp->popup->entries ); fli_popup_reset_counter( sp->popup ); } else sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_clear_nmenu" ); sp->sel = NULL; fl_redraw_object( obj ); return 0; } /*************************************** * Add (append) item(s) to the nmenu object ***************************************/ FL_POPUP_ENTRY * fl_add_nmenu_items( FL_OBJECT * obj, const char * items, ... ) { FLI_NMENU_SPEC *sp; FL_POPUP_ENTRY *new_entries; va_list ap; if ( obj == NULL ) { M_err( "fl_add_nmenu_items", "NULL object" ); return NULL; } sp = obj->spec; if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_add_nmenu_items" ); /* Create and append the new entries to the popup */ va_start( ap, items ); new_entries = fli_popup_add_entries( sp->popup, items, ap, "fl_add_nmenu_items", 0 ); va_end( ap ); return new_entries; } /*************************************** * Insert item(s) into the nmenu object after an already existing item ***************************************/ FL_POPUP_ENTRY * fl_insert_nmenu_items( FL_OBJECT * obj, FL_POPUP_ENTRY * after, const char * items, ... ) { FLI_NMENU_SPEC *sp; FL_POPUP_ENTRY *new_entries; va_list ap; if ( obj == NULL ) { M_err( "fl_add_nmenu_items", "NULL object" ); return NULL; } sp = obj->spec; if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_insert_nmenu_items" ); if ( after != NULL && fli_check_popup_entry_exists( after ) != 0 ) { M_err( "fl_add_nmenu_items", "Item to insert after doesn't exist" ); return NULL; } va_start( ap, items ); new_entries = fli_popup_insert_entries( sp->popup, after, items, ap, "fl_insert_nmenu_items", 0 ); va_end( ap ); return new_entries; } /*************************************** * Replace an item by new item(s) ***************************************/ FL_POPUP_ENTRY * fl_replace_nmenu_item( FL_OBJECT * obj, FL_POPUP_ENTRY * old_item, const char * items, ... ) { FLI_NMENU_SPEC *sp; FL_POPUP_ENTRY *new_entries; va_list ap; if ( obj == NULL ) { M_err( "fl_replace_nmenu_items", "NULL object" ); return NULL; } if ( ! items || ! *items ) { M_err( "fl_replace_nmenu_item", "Items string NULL or empty" ); return NULL; } sp = obj->spec; if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_replace_nmenu_items" ); /* Test if the item we're supposed to replace exists */ if ( fli_check_popup_entry_exists( old_item ) ) { M_err( "fl_replace_nmenu_item", "Item to replace doesn't exist" ); return NULL; } /* Add the new item(s) after the one to replaced */ va_start( ap, items ); new_entries = fli_popup_insert_entries( sp->popup, old_item, items, ap, "fl_replace_nmenu_item", 0 ); va_end( ap ); /* If the insert worked out ok delete the old item (and check if we have to set a new displayed item) */ if ( new_entries != NULL ) { if ( sp->sel != NULL && sp->sel->entry == old_item ) sp->sel = NULL; fl_popup_entry_delete( old_item ); } return new_entries; } /*************************************** * Delete an item of a nmenu object ***************************************/ int fl_delete_nmenu_item( FL_OBJECT * obj, FL_POPUP_ENTRY * item ) { FLI_NMENU_SPEC *sp; if ( obj == NULL ) { M_err( "fl_delete_nmenu_item", "NULL object" ); return -1; } sp = obj->spec; if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_delete_nmenu_items" ); if ( fli_check_popup_entry_exists( item ) != 0 ) { M_err( "fl_delete_nmenu_item", "Item doesnt exist" ); return -1; } /* Delete the entry */ fl_popup_entry_delete( item ); if ( item == sp->sel->entry ) sp->sel = NULL; return 0; } /*************************************** * (Re)polulate a nmenu objects popup via an array of FL_POPUP_ITEM structures ***************************************/ FL_POPUP_ENTRY * fl_set_nmenu_items( FL_OBJECT * obj, FL_POPUP_ITEM * items ) { FLI_NMENU_SPEC *sp; if ( obj == NULL ) { M_err( "fl_set_nmenu_items", "NULL object" ); return NULL; } sp = obj->spec; /* If no popup exists yet create it, otherwise remove all entries */ if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_set_nmenu_items" ); else { while ( sp->popup->entries != NULL ) fl_popup_entry_delete( sp->popup->entries ); fli_popup_reset_counter( sp->popup ); } sp->sel = NULL; return fli_popup_insert_items( sp->popup, NULL, items, "fl_set_nmenu_items" ); } /*************************************** * Add (append) item(s) to the nmenu object from a list of FL_POPUP_ITEM * structures ***************************************/ FL_POPUP_ENTRY * fl_add_nmenu_items2( FL_OBJECT * obj, FL_POPUP_ITEM * items ) { FLI_NMENU_SPEC *sp; FL_POPUP_ENTRY *after; FL_POPUP_ENTRY *new_entries; if ( obj == NULL ) { M_err( "fl_add_nmenu_items2", "NULL object" ); return NULL; } if ( ! items || ! items->text ) { M_err( "fl_add_nmenu_items2", "Items list NULL or empty" ); return NULL; } sp = obj->spec; if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_add_nmenu_items2" ); /* Determine the last existing entry in the nmenu's popup */ after = sp->popup->entries; while ( after != NULL && after->next != NULL ) after = after->next; /* Create and append the new entries to the popup */ new_entries = fli_popup_insert_items( sp->popup, after, items, "fl_add_nmenu_items2" ); return new_entries; } /*************************************** * Insert item(s) into the nmenu object from a list of FL_POPUP_ITEM * structures after an already existing item ***************************************/ FL_POPUP_ENTRY * fl_insert_nmenu_items2( FL_OBJECT * obj, FL_POPUP_ENTRY * after, FL_POPUP_ITEM * items ) { FLI_NMENU_SPEC *sp; FL_POPUP_ENTRY *new_entries; if ( obj == NULL ) { M_err( "fl_add_nmenu_items2", "NULL object" ); return NULL; } if ( ! items || ! items->text ) { M_err( "fl_insert_nmenu_items2", "Items list NULL or empty" ); return NULL; } sp = obj->spec; if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_insert_nmenu_items2" ); if ( after != NULL && fli_check_popup_entry_exists( after ) != 0 ) { M_err( "fl_add_nmenu_items2", "Item to insert after doesn't exist" ); return NULL; } new_entries = fli_popup_insert_items( sp->popup, after, items, "fl_insert_nmenu_items2" ); return new_entries; } /*************************************** * Replace an item by new item(s) from a list of FL_POPUP_ITEM structures ***************************************/ FL_POPUP_ENTRY * fl_replace_nmenu_items2( FL_OBJECT * obj, FL_POPUP_ENTRY * old_item, FL_POPUP_ITEM * items ) { FLI_NMENU_SPEC *sp; FL_POPUP_ENTRY *new_entries; if ( obj == NULL ) { M_err( "fl_replace_nmenu_items2", "NULL object" ); return NULL; } if ( ! items || ! items->text ) { M_err( "fl_replace_nmenu_items2", "Items list NULL or empty" ); return NULL; } sp = obj->spec; if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_replace_nmenu_items2" ); /* Test if the item we're supposed to replace exists */ if ( fli_check_popup_entry_exists( old_item ) ) { M_err( "fl_replace_nmenu_item2", "Item to replace doesn't exist" ); return NULL; } /* Add the new item(s) after the one to replaced */ new_entries = fli_popup_insert_items( sp->popup, old_item, items, "fl_replace_nmenu_item2" ); /* If the insert worked out ok delete the old item (and check if we have to set a new displayed item) */ if ( new_entries != NULL ) { if ( sp->sel != NULL && sp->sel->entry == old_item ) sp->sel = NULL; fl_popup_entry_delete( old_item ); } return new_entries; } /*************************************** * Returns the popup of a nmenu object ***************************************/ FL_POPUP * fl_get_nmenu_popup( FL_OBJECT * obj ) { FLI_NMENU_SPEC *sp; if ( obj == NULL ) { M_err( "fl_get_nmenu_popup", "NULL object" ); return NULL; } sp = obj->spec; if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_get_nmenu_popup" ); return sp->popup; } /*************************************** * Set a (new) popup for a nmenu object ***************************************/ int fl_set_nmenu_popup( FL_OBJECT * obj, FL_POPUP * popup ) { FLI_NMENU_SPEC *sp; FL_POPUP *old_popup; /* We need a valid object */ if ( obj == NULL ) { M_err( "fl_set_nmenu_popup", "NULL object" ); return -1; } sp = obj->spec; /* The popup must exist */ if ( fli_check_popup_exists( popup ) ) { M_err( "fl_set_nmenu_popup", "Popup doesn't exist" ); return -1; } /* The popup can't be a sub-popup */ if ( popup->parent != NULL ) { M_err( "fl_set_nmenu_popup", "Popup is a sub-popup" ); return -1; } /* Delete a popup already associated with the nmenu object */ old_popup = ( ( FLI_NMENU_SPEC * ) obj->spec )->popup; if ( old_popup != NULL ) fl_popup_delete( old_popup ); /* Set the new popup as the nmenu objects popup and redraw */ sp->popup = popup; sp->sel = NULL; fl_redraw_object( obj ); return 1; } /*************************************** * Sets how the popup of the object behaves ***************************************/ int fl_set_nmenu_policy( FL_OBJECT * obj, int policy ) { FLI_NMENU_SPEC *sp; int old_policy; if ( obj == NULL ) { M_err( "fl_set_nmenu_policy", "NULL object" ); return INT_MIN; } if ( policy < FL_POPUP_NORMAL_SELECT || policy > FL_POPUP_DRAG_SELECT ) { M_err( "fl_set_nmenu_policy", "Invalid policy argument" ); return -1; } sp = obj->spec; if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_set_select_policy" ); old_policy = fl_popup_get_policy( sp->popup ); fl_popup_set_policy( sp->popup, policy ); return old_policy; } /*************************************** * Return last selected item ***************************************/ FL_POPUP_RETURN * fl_get_nmenu_item( FL_OBJECT * obj ) { if ( obj == NULL ) { M_err( "fl_get_nmenu_item", "NULL object" ); return NULL; } return ( ( FLI_NMENU_SPEC * ) obj->spec )->sel; } /*************************************** ***************************************/ FL_POPUP_ENTRY * fl_get_nmenu_item_by_value( FL_OBJECT * obj, long int val ) { FLI_NMENU_SPEC *sp; if ( obj == NULL ) { M_err( "fl_get_nmenu_item_by_value", "NULL object" ); return NULL; } sp = obj->spec; if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_get_nmenu_item_by_value" ); return fl_popup_entry_get_by_value( sp->popup, val ); } /*************************************** ***************************************/ FL_POPUP_ENTRY * fl_get_nmenu_item_by_label( FL_OBJECT * obj, const char * label ) { FLI_NMENU_SPEC *sp; if ( obj == NULL ) { M_err( "fl_get_nmenu_item_by_label", "NULL object" ); return NULL; } sp = obj->spec; if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_get_nmenu_item_by_label" ); return fl_popup_entry_get_by_label( sp->popup, label ); } /*************************************** ***************************************/ FL_POPUP_ENTRY * fl_get_nmenu_item_by_text( FL_OBJECT * obj, const char * text ) { FLI_NMENU_SPEC *sp; if ( obj == NULL ) { M_err( "fl_get_nmenu_item_by_text", "NULL object" ); return NULL; } sp = obj->spec; if ( sp->popup == NULL ) sp->popup = fli_popup_add( FL_ObjWin( obj ), NULL, "fl_get_nmenu_item_by_text" ); return fl_popup_entry_get_by_text( sp->popup, text ); } /*************************************** ***************************************/ FL_COLOR fl_set_nmenu_hl_text_color(FL_OBJECT * obj, FL_COLOR color ) { FLI_NMENU_SPEC *sp; FL_COLOR old_color; if ( obj == NULL ) { M_err( "fl_set_nmenu_hl_text_color", "NULL object" ); return FL_MAX_COLORS; } if ( color >= FL_MAX_COLORS ) { M_err( "fl_set_nmenu_hl_text_color", "Invalid color argument" ); return FL_MAX_COLORS; } sp = obj->spec; old_color = sp->hl_color; sp->hl_color = color; fl_redraw_object( obj ); return old_color; } /*************************************** * Central routine for interaction with nmenu object ***************************************/ static int handle_nmenu( FL_OBJECT * obj, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { FLI_NMENU_SPEC *sp = obj->spec; unsigned int w, h; int ret = FL_RETURN_NONE; switch ( event ) { case FL_DRAW : draw_menu( obj ); break; case FL_ENTER : if ( ! IS_TOUCH_NMENU( obj ) ) break; /* fall through */ case FL_SHORTCUT : case FL_PUSH : if ( ! sp->popup || ! sp->popup->entries ) break; obj->pushed = 1; fl_redraw_object( obj ); fl_popup_get_size( sp->popup, &w, &h ); if ( obj->form->y + obj->y + obj->h + h < ( unsigned int ) fl_scrh ) fl_popup_set_position( sp->popup, obj->form->x + obj->x, obj->form->y + obj->y + obj->h ); else fl_popup_set_position( sp->popup, obj->form->x + obj->x, obj->form->y + obj->y - h ); sp->sel = fl_popup_do( sp->popup ); obj->pushed = 0; fl_redraw_object( obj ); if ( sp->sel != NULL ) ret |= FL_RETURN_CHANGED | FL_RETURN_END; break; case FL_FREEMEM : if ( sp && sp->popup ) fl_popup_delete( sp->popup ); fli_safe_free( obj->spec ); break; } return ret; } /*************************************** ***************************************/ static void draw_menu( FL_OBJECT * obj ) { if ( ! obj->pushed ) { fl_draw_box( obj->boxtype, obj->x, obj->y, obj->w, obj->h, obj->col1, obj->bw ); obj->align = fl_to_outside_lalign( obj->align ); fl_draw_text( obj->align, obj->x, obj->y, obj->w, obj->h, obj->lcol, obj->lstyle, obj->lsize, obj->label ); } else { FLI_NMENU_SPEC *sp = obj->spec; fl_draw_box( ( IS_BUTTON_NMENU( obj ) && obj->boxtype == FL_FLAT_BOX ) ? FL_UP_BOX : obj->boxtype, obj->x, obj->y, obj->w, obj->h, obj->col2, obj->bw ); obj->align = fl_to_inside_lalign( obj->align ); fl_draw_text( obj->align, obj->x, obj->y, obj->w, obj->h, sp->hl_color, obj->lstyle, obj->lsize, obj->label ); } } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/input.c0000664000175000017500000023515212353623325012044 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file input.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * XForms Class FL_INPUT * handle normal user inputs and exchange data with other * applications via the X Selection machnism. * * Data structure is grossly wrong and very inefficient. * Need to complete overhaul this someday. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include #include #include #include #include "private/pinput.h" #include "private/flvasprintf.h" enum { COMPLETE = 0, PARTIAL = 1, VSLIDER = 2, HSLIDER = 4 }; static void correct_topline( FLI_INPUT_SPEC *, int * ); static void redraw_scrollbar( FL_OBJECT * ); static int make_line_visible( FL_OBJECT * obj, int ypos ); static int make_char_visible( FL_OBJECT * obj, int xpos ); static void copy_attributes( FL_OBJECT * dest, const FL_OBJECT * src ); static int date_validator( FL_OBJECT *, const char *, const char *, int ); static int int_validator( FL_OBJECT *, const char *, const char *, int ); static int float_validator( FL_OBJECT *, const char *, const char *, int ); static int xytopos( FLI_INPUT_SPEC * sp, int xpos, int ypos ); enum { NORMAL_SELECT, WORD_SELECT, LINE_SELECT }; static int Input_Mode = FL_NORMAL_INPUT_MODE; /*************************************** ***************************************/ static void get_margin( int btype, int bw, FL_Coord * xm, FL_Coord * ym ) { if ( btype == FL_FLAT_BOX || btype == FL_NO_BOX || btype == FL_FRAME_BOX || btype == FL_EMBOSSED_BOX ) { *xm = bw + 1; *ym = 0.7 * bw + 1; } else { *xm = 2 * bw + ( bw == 1 ); *ym = bw + 1 + ( bw == 1 ); } } /*************************************** * Checks the size of scrollbars and input field. No drawing is allowed ***************************************/ static void check_scrollbar_size( FL_OBJECT * obj ) { FLI_INPUT_SPEC *sp = obj->spec; FL_Coord xmargin, ymargin; int bw = FL_abs( obj->bw ); int delta; int h_on = sp->h_on, v_on = sp->v_on; int max_pixels = sp->max_pixels; /* The test for sp->vscroll and sp->hscroll being set is only for fdesign which might change the object type of a normal input to a multiline input without creating them */ if ( sp->input->type != FL_MULTILINE_INPUT || ! ( sp->vscroll && sp->hscroll ) ) return; /* Compute the real input box size */ sp->input->x = sp->dummy->x; sp->input->y = sp->dummy->y; get_margin( sp->input->boxtype, bw, &xmargin, &ymargin ); sp->charh = fl_get_char_height( sp->input->lstyle, sp->input->lsize, 0, 0 ); /* See how many lines would fit in */ sp->screenlines = ( sp->dummy->h - 2.0 * ymargin ) / sp->charh + 0.001; sp->v_on = sp->v_pref == FL_ON || ( sp->screenlines && sp->screenlines < sp->lines && sp->v_pref != FL_OFF ); if ( sp->v_on ) { sp->vw = sp->vw_def; sp->vscroll->x = sp->input->x + sp->dummy->w - sp->vw; sp->vscroll->y = sp->input->y; sp->vscroll->w = sp->vw; fli_set_object_visibility( sp->vscroll, FL_VISIBLE ); } else { sp->vw = 0; fli_set_object_visibility( sp->vscroll, FL_INVISIBLE ); } sp->input->w = sp->dummy->w - sp->vw; sp->h_on = sp->h_pref == FL_ON || ( max_pixels > sp->w && sp->h_pref != FL_OFF ); if ( sp->h_on ) { sp->h_on = 1; sp->hh = sp->hh_def; sp->hscroll->x = sp->input->x; sp->hscroll->y = sp->input->y + sp->dummy->h - sp->hh; sp->hscroll->h = sp->hh; fli_set_object_visibility( sp->hscroll, FL_VISIBLE ); if ( ( delta = max_pixels - sp->w ) > 0 ) { sp->hsize = ( double ) sp->w / max_pixels; sp->hval = ( double ) sp->xoffset / delta; sp->hinc1 = 8.0 * sp->charh / delta; sp->hinc2 = ( sp->charh - 2.0 ) / delta; } else sp->hsize = 1.0; } else { sp->hh = 0; fli_set_object_visibility( sp->hscroll, FL_INVISIBLE ); } sp->input->h = sp->dummy->h - sp->hh; sp->h = sp->input->h - 2 * ymargin; sp->screenlines = ( double ) sp->h / sp->charh + 0.001; if ( ! sp->v_on && sp->screenlines < sp->lines && sp->h_pref != FL_OFF ) { sp->v_on = 1; sp->vw = sp->vw_def; sp->vscroll->x = sp->input->x + sp->dummy->w - sp->vw; sp->vscroll->y = sp->input->y; sp->vscroll->visible = 1; sp->input->w = sp->dummy->w - sp->vw; } if ( sp->v_on && ( delta = sp->lines - sp->screenlines ) > 0 ) { sp->vval = ( sp->topline - 1.0 ) / delta; sp->vsize = ( double ) sp->screenlines / sp->lines; sp->vinc1 = ( sp->screenlines - 0.99 ) / delta; sp->vinc2 = 1.01 / delta; } else sp->vsize = 1.0; sp->hscroll->w = sp->input->w; fli_notify_object( sp->hscroll, FL_RESIZED ); sp->vscroll->h = sp->input->h; fli_notify_object( sp->vscroll, FL_RESIZED ); sp->w = sp->input->w - 2 * xmargin; if ( h_on != sp->h_on || v_on != sp->v_on ) { sp->attrib = 1; sp->dead_area = ! ( sp->h_on ^ sp->v_on ); } } /*************************************** ***************************************/ static void draw_input( FL_OBJECT * obj ) { FLI_INPUT_SPEC *sp = obj->spec; FL_COLOR col; FL_COLOR curscol = fli_dithered( fl_vmode ) ? FL_BLACK : sp->curscol; FL_Coord xmargin, ymargin; int bw = FL_abs( obj->bw ); int cx, cy; int max_pixels, max_pixels_line; static char *saved; get_margin( obj->boxtype, bw, &xmargin, &ymargin ); sp->w = sp->input->w - 2 * xmargin; sp->h = sp->input->h - 2 * ymargin; col = obj->focus ? obj->col2 : obj->col1; if ( sp->drawtype == COMPLETE ) { fl_draw_box( obj->boxtype, sp->input->x, sp->input->y, sp->input->w, sp->input->h, col, obj->bw ); fl_draw_object_label_outside( obj ); } if ( obj->type == FL_SECRET_INPUT ) { saved = sp->str; sp->str = fl_strdup( sp->str ); memset( sp->str, sp->field_char, strlen( saved ) ); } cx = sp->input->x + xmargin; cy = sp->input->y + ymargin; fl_set_text_clipping( cx, cy, sp->w, sp->h ); fl_set_clipping( cx, cy, sp->w, sp->h ); max_pixels = fli_draw_string( obj->type == FL_MULTILINE_INPUT ? FL_ALIGN_LEFT_TOP : FL_ALIGN_LEFT, cx - sp->xoffset, /* Bounding box */ cy - sp->yoffset, sp->w + sp->xoffset, sp->h + sp->yoffset, -1, /* Clipping is already set */ col, sp->textcol, curscol, obj->lstyle, obj->lsize, ( sp->cursor_visible && obj->focus && sp->beginrange >= sp->endrange ) ? sp->position : -1, sp->beginrange, sp->endrange, sp->str, sp->drawtype != COMPLETE, sp->topline, sp->topline + sp->screenlines, 0 ); max_pixels_line = fli_get_max_pixels_line( ) + 1; sp->charh = fl_get_char_height( obj->lstyle, obj->lsize, 0, 0 ); if ( max_pixels > sp->max_pixels || ( sp->max_pixels_line >= sp->topline && sp->max_pixels_line <= sp->topline + sp->screenlines ) ) { sp->max_pixels = max_pixels; sp->max_pixels_line = max_pixels_line; } fl_unset_clipping( ); fl_unset_text_clipping( ); if ( obj->type == FL_SECRET_INPUT ) { fli_safe_free( sp->str ); sp->str = saved; } sp->drawtype = COMPLETE; } #define DELIM( c ) ( c == ' ' || c == ',' || c == '.' || c == '\n' ) /*************************************** * Figures out selection region of mouse, returns whether anything changed ***************************************/ static int handle_select( FL_Coord mx, FL_Coord my, FL_OBJECT * obj, int movement, int mode ) { FLI_INPUT_SPEC *sp = obj->spec; int thepos, n, dummy; int oldpos = sp->position, oldbeg = sp->beginrange, oldend = sp->endrange; int bw = FL_abs( obj->bw ); FL_Coord xmargin, ymargin; if ( obj->type == FL_HIDDEN_INPUT ) return 0; /* Compute the mouse position in the string */ get_margin( obj->boxtype, bw, &xmargin, &ymargin ); thepos = fli_get_pos_in_string( obj->type == FL_MULTILINE_INPUT ? FL_ALIGN_LEFT_TOP : FL_ALIGN_LEFT, sp->input->x + xmargin - sp->xoffset, sp->input->y + ymargin - sp->yoffset, sp->w + sp->xoffset, sp->h + sp->yoffset, obj->lstyle, obj->lsize, mx, my, sp->str, &sp->xpos, &sp->ypos, &dummy ); if ( mode == WORD_SELECT ) { #if defined USE_CLASSIC_EDITKEYS if ( sp->str[ thepos ] == ' ' ) return 0; for ( n = thepos; sp->str[ n ] && ! DELIM( sp->str[ n ] ); n++ ) /* empty */ ; sp->endrange = n; for ( n = thepos; n >= 0 && ! DELIM( sp->str[ n ] ); n-- ) /* empty */ ; sp->beginrange = n + 1; #else if ( ! isalnum( ( unsigned char ) sp->str[ thepos ] ) && sp->str[ thepos ] != '_' ) { for ( n = thepos; sp->str[ n ] && ! isalnum( ( unsigned char ) sp->str[ n ] ) && sp->str[ n ] != '_' && sp->str[ n ] != '\n'; n++ ) /* empty */ ; sp->endrange = n; for ( n = thepos; n && ! isalnum( ( unsigned char ) sp->str[ n ] ) && sp->str[ n ] != '_' && sp->str[ n ] != '\n'; n-- ) /* empty */ ; if ( n > 0 ) ++n; sp->beginrange = n; } else { for ( n = thepos; sp->str[ n ] && ( isalnum( ( unsigned char ) sp->str[ n ] ) || sp->str[ n ] == '_' ); n++ ) /* empty */ ; sp->endrange = n; for ( n = thepos; n && ( isalnum( ( unsigned char ) sp->str[ n ] ) || sp->str[ n ] == '_' ); n-- ) /* empty */ ; if ( n > 0 ) ++n; sp->beginrange = n; } #endif } else if ( mode == LINE_SELECT ) { for ( n = thepos; sp->str[ n ] && sp->str[ n ] != '\n'; n++ ) /* empty */ ; sp->endrange = n; for ( n = thepos; n >= 0 && sp->str[ n ] != '\n'; n-- ) /* empty */ ; sp->beginrange = n + 1; } else { /* Adapt the range */ if ( movement ) { fl_freeze_form( obj->form ); make_line_visible( obj, sp->ypos ); make_char_visible( obj, sp->xpos ); fl_unfreeze_form( obj->form ); if ( thepos < sp->position ) { sp->endrange = sp->position; sp->beginrange = thepos; } else { sp->beginrange = sp->position; sp->endrange = thepos; } } else { sp->position = sp->beginrange = thepos; sp->endrange = -1; } } if ( sp->beginrange == sp->endrange ) sp->endrange = -1; if ( sp->beginrange < 0 ) sp->beginrange = 0; return oldpos != sp->position || oldbeg != sp->beginrange || oldend != sp->endrange; } /*************************************** * This is not XCUTBUFFER. It is generated by ^K and can be * recalled by ^Y ***************************************/ #define MAXCBLEN 512 static char cutbuf[ MAXCBLEN ]; /*************************************** * Delete a single char. dir =1 for next, dir -1 for prev ***************************************/ static void delete_char( FLI_INPUT_SPEC * sp, int dir, int slen ) { int i = sp->position - ( dir < 0 ); if ( sp->str[ i ] == '\n' ) { sp->lines--; sp->ypos -= dir < 0; } memmove( sp->str + i, sp->str + i + 1, slen - i ); sp->position -= dir < 0; } /*************************************** * Removes a piece of the string ***************************************/ static void delete_piece( FL_OBJECT * obj, int start, int end ) { FLI_INPUT_SPEC *sp = obj->spec; memmove( sp->str + start, sp->str + end + 1, strlen( sp->str + end ) ); sp->position = start; /* This can be expensive TODO */ sp->lines = fl_get_input_numberoflines( obj ); fl_get_input_cursorpos( obj, &sp->xpos, &sp->ypos ); } #define get_substring_width( o, b, e ) \ fl_get_string_width( ( o )->lstyle, ( o )->lsize, \ ( ( FLI_INPUT_SPEC * ) ( o )->spec )->str + ( b ), \ ( e ) - ( b ) ) #define IsRegular( k ) ( ( k ) == '\n' \ || ( key >= 32 && key <= 255 && key != 127 ) ) /*************************************** * Editing command. Need 4 bytes. Byte1 for normal ASCII, byte2 for * special keysyms, such as PageUP etc. Byte 3 is used by Latin3 etc. * Byte 4 will be used to indicate modifiers. ***************************************/ static FL_EditKeymap kmap; static int paste_it( FL_OBJECT *, const unsigned char *, int ); static void set_default_keymap( int ); #define set_to_eol( p ) while ( ( p ) < slen && sp->str[ p ] != '\n' ) ( p )++ /*************************************** * Cursor moved. No editing. ***************************************/ static void handle_movement( FL_OBJECT * obj, int key, int slen, int startpos, int kmask ) { FLI_INPUT_SPEC *sp = obj->spec; int ready, width, i, oldwidth, tt; if ( IsHome( key ) ) { fl_set_input_topline( obj, 1 ); sp->position = 0; sp->ypos = 1; } else if ( IsPageDown( key ) ) fl_set_input_topline( obj, sp->topline + sp->screenlines ); else if ( IsHalfPageDown( key ) ) fl_set_input_topline( obj, sp->topline + sp->screenlines / 2 ); else if ( Is1LineDown( key ) ) fl_set_input_topline( obj, sp->topline + 1 ); else if ( IsPageUp( key ) ) fl_set_input_topline( obj, sp->topline - sp->screenlines ); else if ( IsHalfPageUp( key ) ) fl_set_input_topline( obj, sp->topline - sp->screenlines / 2 ); else if ( Is1LineUp( key ) ) fl_set_input_topline( obj, sp->topline - 1 ); else if ( key == '\t' || key == '\f' ) /* empty */ ; else if ( IsEnd( key ) ) { fl_set_input_topline( obj, sp->lines ); sp->position = slen; fl_get_input_cursorpos( obj, &sp->xpos, &sp->ypos ); } else if ( IsLeft( key ) ) /* Left key */ { if ( shiftkey_down( kmask ) ) sp->position = startpos; else if ( sp->position > 0 ) sp->position--; if ( sp->str[ sp->position ] == '\n' ) { sp->ypos--; /* Compute starting position of current line */ startpos = sp->position; while ( startpos > 0 && sp->str[ startpos - 1 ] != '\n' ) startpos--; } } else if ( IsRight( key ) || key == kmap.moveto_eol ) { if ( shiftkey_down( kmask ) || key == kmap.moveto_eol ) set_to_eol( sp->position ); else if ( sp->position < slen ) { if ( sp->str[ sp->position ] == '\n' ) { sp->ypos++; startpos = sp->position + 1; } sp->position++; } } else if ( IsUp( key ) ) /* Up key */ { if ( startpos != 0 ) { width = get_substring_width( obj, startpos, sp->position ); i = startpos - 1; while ( i > 0 && sp->str[ i - 1 ] != '\n' ) i--; oldwidth = 0.0; sp->position = i; ready = sp->str[ sp->position ] == '\n'; while ( ! ready ) { tt = get_substring_width( obj, i, sp->position + 1 ); ready = 0.5 * ( oldwidth + tt ) >= width; oldwidth = tt; if ( ! ready ) sp->position++; if ( sp->str[ sp->position ] == '\n' ) ready = 1; } if ( --sp->ypos < 1 ) sp->ypos = 1; } } else if ( IsDown( key ) ) /* Down key */ { width = get_substring_width( obj, startpos, sp->position ); i = sp->position + 1; while ( i < slen && sp->str[ i - 1 ] != '\n' ) i++; if ( i < slen ) { oldwidth = 0.0; sp->position = i; ready = sp->position == slen || sp->str[ sp->position ] == '\n'; while ( ! ready ) { tt = get_substring_width( obj, i, sp->position + 1 ); ready = 0.5 * ( oldwidth + tt ) >= width; oldwidth = tt; if ( ! ready ) sp->position++; if ( sp->position == slen || sp->str[ sp->position ] == '\n' ) ready = 1; } } else sp->position = slen; if ( ++sp->ypos > sp->lines ) sp->ypos = sp->lines; } else if ( key == kmap.moveto_bol ) sp->position = startpos; else if ( key == kmap.moveto_prev_word ) { #if defined USE_CLASSIC_EDITKEYS if ( sp->position > 0 ) sp->position--; while ( sp->position > 0 && ( sp->str[ sp->position ] == ' ' || sp->str[ sp->position ] == '\n' ) ) { if ( sp->str[ sp->position ] == '\n' ) sp->ypos--; sp->position--; } while ( sp->position > 0 && sp->str[ sp->position ] != ' ' && sp->str[ sp->position ] != '\n' ) sp->position--; #else if ( sp->position > 0 ) sp->position--; if ( ! isalnum( ( unsigned char ) sp->str[ sp->position ] ) && sp->str[ sp->position ] != '_' ) while ( sp->position > 0 && ! ( isalnum( ( unsigned char ) sp->str[ sp->position ] ) || sp->str[ sp->position ] == '_' ) ) --sp->position; else while ( sp->position > 0 && ( isalnum( ( unsigned char ) sp->str[ sp->position ] ) || sp->str[ sp->position ] == '_' ) ) --sp->position; #endif if ( sp->position > 0 ) sp->position++; } else if ( key == kmap.moveto_next_word ) { i = sp->position; #if defined USE_CLASSIC_EDITKEYS while ( i < slen && ( sp->str[ i ] == ' ' || sp->str[ i ] == '\n' ) ) { if ( sp->str[ i ] == '\n' ) sp->ypos++; i++; } while ( i < slen && sp->str[ i ] != ' ' && sp->str[ i ] != '\n' ) i++; #else if ( ! isalnum( ( unsigned char ) sp->str[ i ] ) && sp->str[ i ] != '_' ) while ( i < slen && ! isalnum( ( unsigned char ) sp->str[ i ] ) && sp->str[ i ] != '_' ) ++i; else while ( i < slen && ( isalnum( ( unsigned char ) sp->str[ i ] ) || sp->str[ i ] == '_' ) ) ++i; #endif sp->position = i; } } /*************************************** * Editing ***************************************/ static int handle_edit( FL_OBJECT * obj, int key, int slen ) { FLI_INPUT_SPEC *sp = obj->spec; int ret = FL_RETURN_CHANGED, i; if ( key == kmap.del_prev_char || key == kmap.backspace ) { if ( sp->endrange >= 0 ) delete_piece( obj, sp->beginrange, sp->endrange - 1 ); else if ( sp->position > 0 ) delete_char( sp, -1, slen ); else ret = FL_RETURN_NONE; } else if ( key == kmap.del_next_char ) { if ( sp->endrange >= 0 ) delete_piece( obj, sp->beginrange, sp->endrange - 1 ); else if ( sp->position < slen ) delete_char( sp, 1, slen ); else ret = FL_RETURN_NONE; } else if ( key == kmap.del_next_word ) { if ( obj->type == FL_SECRET_INPUT || ( i = sp->position ) == slen ) ret = FL_RETURN_NONE; else { #if defined USE_CLASSIC_EDITKEYS while ( i < slen && ( sp->str[ i ] == ' ' || sp->str[ i ] == '\n' ) ) i++; while ( i < slen && sp->str[ i ] != ' ' && sp->str[ i ] != '\n' ) i++; #else /* If the first character is neiter a letter nor a digit nor an underscore delete it and all other characters of the same kind. Otherwise delete all charaters that are letters. digit or underscores. This is the same behaviour as in e.g. Qt. */ if ( ! isalnum( ( unsigned char ) sp->str[ i ] ) && sp->str[ i ] != '_' ) while ( i < slen && ! isalnum( ( unsigned char ) sp->str[ i ] ) && sp->str[ i ] != '_' ) i++; else while ( i < slen && ( isalnum( ( unsigned char ) sp->str[ i ] ) || sp->str[ i ] == '_' ) ) i++; #endif if ( i - sp->position > 1 ) fli_sstrcpy( cutbuf, sp->str + sp->position, FL_min( i - sp->position + 1, MAXCBLEN ) ); delete_piece( obj, sp->position, i - 1 ); } } else if ( key == kmap.del_prev_word ) { int j = sp->position; if ( obj->type == FL_SECRET_INPUT || j == 0 ) ret = FL_RETURN_NONE; else { #if defined USE_CLASSIC_EDITKEYS sp->position--; while ( sp->position > 0 && ( sp->str[ sp->position ] == ' ' || sp->str[ sp->position ] == '\n' ) ) sp->position--; while ( sp->position > 0 && sp->str[ sp->position ] != ' ' && sp->str[ sp->position ] != '\n' ) sp->position--; #else --sp->position; if ( ! isalnum( ( unsigned char ) sp->str[ sp->position ] ) && sp->str[ sp->position ] != '_' ) while ( sp->position > 0 && ! isalnum( ( unsigned char ) sp->str[ sp->position ] ) && sp->str[ sp->position ] != '_' ) --sp->position; else while ( sp->position > 0 && ( isalnum( ( unsigned char ) sp->str[ sp->position ] ) || sp->str[ sp->position ] == '_' ) ) --sp->position; if ( sp->position ) ++sp->position; #endif if ( sp->position != j ) { if ( j - sp->position > 1 ) fli_sstrcpy( cutbuf, sp->str + sp->position, FL_min( j - sp->position + 1, MAXCBLEN ) ); delete_piece( obj, sp->position, j - 1 ); } else ret = FL_RETURN_NONE; } } else if ( key == kmap.clear_field ) { if ( slen > 0 ) { if ( slen > 1 ) fli_sstrcpy( cutbuf, sp->str, FL_min( slen, MAXCBLEN ) ); delete_piece( obj, 0, slen - 1 ); } else ret = FL_RETURN_NONE; } else if ( key == kmap.del_to_eol ) { if ( slen > sp->position ) { if ( sp->str[ sp->position ] != '\n' ) for ( i = sp->position; i < slen && sp->str[ i ] != '\n'; i++ ) /* empty */ ; else i = sp->position + 1; /* Save buffer */ if ( i - sp->position > 1 ) fli_sstrcpy( cutbuf, sp->str + sp->position, FL_min( i - sp->position + 1, MAXCBLEN ) ); delete_piece( obj, sp->position, i - 1 ); } else ret = FL_RETURN_NONE; } #if ! defined USE_CLASSIC_EDITKEYS else if ( key == kmap.del_to_bol ) { int j = sp->position; if ( j == 0 ) ret = FL_RETURN_NONE; else { if ( sp->str[ --sp->position ] != '\n' ) { while ( sp->position > 0 && sp->str[ --sp->position ] != '\n' ) /* empty */; if ( sp->str[ sp->position ] == '\n' ) ++sp->position; } if ( j - sp->position > 1 ) fli_sstrcpy( cutbuf, sp->str + sp->position, FL_min( j - sp->position + 1, MAXCBLEN ) ); delete_piece( obj, sp->position, j - 1 ); } } #endif else if ( key == kmap.paste ) paste_it( obj, ( unsigned char * ) cutbuf, strlen( cutbuf ) ); else if ( key == kmap.transpose && sp->position > 0 ) { char t; if ( sp->position < slen && sp->str[ sp->position ] != '\n' ) { t = sp->str[ sp->position - 1 ]; sp->str[ sp->position - 1 ] = sp->str[ sp->position ]; sp->str[ sp->position ] = t; sp->position++; } else { t = sp->str[ sp->position - 2 ]; sp->str[ sp->position - 2 ] = sp->str[ sp->position - 1 ]; sp->str[ sp->position - 1 ] = t; } } return ret; } /*************************************** * Handles a key press, returns whether something has changed ***************************************/ static int handle_normal_key( FL_OBJECT * obj, int key, int slen ) { FLI_INPUT_SPEC *sp = obj->spec; char *tmpbuf = NULL; int tmppos = 0; int ret = FL_RETURN_CHANGED; /* Check that there's still room for a new character */ if ( sp->maxchars > 0 && slen >= sp->maxchars && ( Input_Mode == FL_NORMAL_INPUT_MODE || slen == sp->position ) ) { fl_ringbell( 0 ); return FL_RETURN_NONE; } if ( sp->validate ) { tmpbuf = fl_strdup( sp->str ); tmppos = sp->position; } /* If a range is marked remove it, it's replaced by the new character */ if ( sp->endrange >= 0 ) { delete_piece( obj, sp->beginrange, sp->endrange - 1 ); slen = strlen( sp->str ); } /* Merge the new character */ if ( Input_Mode == FL_DOS_INPUT_MODE && sp->maxchars > 0 && slen == sp->maxchars ) { memmove( sp->str + sp->position + 1, sp->str + sp->position, slen - sp->position ); sp->str[ sp->maxchars ] = '\0'; } else memmove( sp->str + sp->position + 1, sp->str + sp->position, slen - sp->position + 1 ); sp->str[ sp->position++ ] = key; if ( key == '\n' ) { sp->lines++; sp->ypos++; } if ( sp->validate ) { int ok = sp->validate( obj, tmpbuf, sp->str, key ); if ( ( ok & ~ FL_RINGBELL ) != FL_VALID ) { ret = FL_RETURN_NONE; strcpy( sp->str, tmpbuf ); sp->position = tmppos; if ( key == '\n' ) { sp->lines--; sp->ypos--; } } if ( ok & FL_RINGBELL ) fl_ringbell( 0 ); fl_free( tmpbuf ); } return ret; } /*************************************** * Handles a key press, returns whether the content of the input field * was changed ***************************************/ static int handle_key( FL_OBJECT * obj, int key, unsigned int kmask ) { int ret = FL_RETURN_NONE; FLI_INPUT_SPEC *sp = obj->spec; int slen; /* length of the string */ int oldy = sp->ypos; int oldl = sp->lines; int oldx = sp->xoffset; int oldmax = sp->max_pixels; /* Increase the size of the buffer for the text if it's full */ slen = strlen( sp->str ); if ( sp->size == slen + 1 ) { sp->size += 8; sp->str = fl_realloc( sp->str, sp->size ); } /* Silently translate carriage return to line feed */ if ( obj->type == FL_MULTILINE_INPUT && key == '\r' ) key = '\n'; #if defined USE_CLASSIC_EDITKEYS if ( controlkey_down( kmask ) && key > 255 ) key |= FL_CONTROL_MASK; #else if ( controlkey_down( kmask ) ) key |= FL_CONTROL_MASK; #endif if ( metakey_down( kmask ) ) key |= FL_ALT_MASK; if ( shiftkey_down( kmask ) ) { if ( key == XK_Up ) key = XK_Home; else if ( key == XK_Down ) key = XK_End; } /* Translate all move keys to cursor keys so we can distinguish edit/move keys more easily */ if ( key == kmap.moveto_next_line ) key = XK_Down; else if ( key == kmap.moveto_prev_line ) key = XK_Up; else if ( key == kmap.moveto_prev_char ) key = XK_Left; else if ( key == kmap.moveto_next_char ) key = XK_Right; else if ( key == kmap.moveto_bof ) key = XK_Home; else if ( key == kmap.moveto_eof ) key = XK_End; else if ( key == kmap.moveto_next_page ) key = XK_PageDn; else if ( key == kmap.moveto_prev_page ) key = XK_PageUp; if ( IsRegular( key ) ) /* Normal keys and new line */ ret = handle_normal_key( obj, key, slen ); else if ( IsCursorKey( key ) || key == kmap.moveto_eol || key == kmap.moveto_bol || key == kmap.moveto_prev_word || key == kmap.moveto_next_word || Is1LineUp( key ) || Is1LineDown( key ) || IsHalfPageUp( key ) || IsHalfPageDown( key ) ) { int startpos = 0; if ( obj->type == FL_MULTILINE_INPUT ) { startpos = sp->position; while ( startpos > 0 && sp->str[ startpos - 1 ] != '\n' ) startpos--; } handle_movement( obj, key, slen, startpos, kmask ); if ( sp->endrange != -1 ) { make_line_visible( obj, sp->ypos ); make_char_visible( obj, sp->xpos ); } } else ret = handle_edit( obj, key, slen ); sp->endrange = -1; if ( ret != FL_RETURN_NONE ) { int junk; fl_get_string_dimension( obj->lstyle, obj->lsize, sp->str, strlen( sp->str ), &sp->max_pixels, &junk ); } if ( sp->noscroll ) { sp->xoffset = sp->yoffset = 0; sp->topline = sp->ypos = 1; oldmax = sp->max_pixels; } else { int startpos = 0; int width; if ( obj->type == FL_MULTILINE_INPUT ) { startpos = sp->position; while ( startpos > 0 && sp->str[ startpos - 1 ] != '\n' ) startpos--; } width = fl_get_string_width( obj->lstyle, obj->lsize, sp->str + startpos, sp->position - startpos ); if ( width < sp->w - 4 ) sp->xoffset = 0; else { if ( width - oldx > sp->w - 4 ) sp->xoffset = width - sp->w + 4; else { int cw = fl_get_char_width( obj->lstyle, obj->lsize ); if ( width - oldx < cw ) sp->xoffset = width - cw; else sp->xoffset = oldx; } } } fl_freeze_form( obj->form ); if ( oldl != sp->lines || oldy != sp->ypos || oldx != sp->xoffset || oldmax != sp->max_pixels ) { check_scrollbar_size( obj ); make_line_visible( obj, sp->ypos ); redraw_scrollbar( obj ); } fl_redraw_object( sp->input ); fl_unfreeze_form( obj->form ); return ret; } /*************************************** * Given nb bytes of stuff, paste it into the input field. ***************************************/ static int paste_it( FL_OBJECT * obj, const unsigned char * thebytes, int nb ) { int ret = FL_RETURN_NONE; while ( nb-- ) ret |= handle_key( obj, *thebytes++, 0 ); return ret; } /*************************************** * Callback for handling selection. It might be called only after * handling the input object is done and in that case we have to * insert the object into the onject queue manually... ***************************************/ /* handle X cut & paste ******************************* */ static int selection_hack = 0; static int gotit_cb( FL_OBJECT * obj, long type FL_UNUSED_ARG, const void * buf, long nb ) { FLI_INPUT_SPEC *sp = obj->spec; sp->changed |= paste_it( obj, ( unsigned char * ) buf, nb ); fl_update_display( 0 ); if ( selection_hack && sp->changed ) { selection_hack = sp->changed = 0; obj->returned = FL_RETURN_CHANGED; fli_object_qenter( obj, FL_PASTE ); } return 0; } /*************************************** * Paste request is handled here. If we do not own the selection, * this will result in an SelectionNotify event that gets handled * by handle_clipboard_event(). And in that case we can't report * the object to have changed back to the application since all * that will happen some time later. Thus we set 'selection_hack' * to indicate to the getit_cb() function to artificially enter * the object into the object queue. ***************************************/ static int do_XPaste( FL_OBJECT * obj ) { int ret = fl_request_clipboard( obj, XA_STRING, gotit_cb ); if ( ret == -1 && obj->how_return == FL_RETURN_CHANGED ) selection_hack = 1; return ret > 0 ? FL_RETURN_CHANGED : FL_RETURN_NONE; } /*************************************** ***************************************/ static int lose_selection( FL_OBJECT * obj, long type FL_UNUSED_ARG ) { FLI_INPUT_SPEC *sp = obj->spec; sp->beginrange = sp->endrange = -1; if ( ! obj->focus ) sp->position = -1; else if ( sp->position < 0 ) sp->position = sp->str ? strlen( sp->str ) : 0; fl_redraw_object( sp->input ); fl_update_display( 0 ); return 0; } /*************************************** ***************************************/ static void do_XCut( FL_OBJECT * obj, int beginrange, int endrange ) { FLI_INPUT_SPEC *sp = obj->spec; char *buff; int nc = endrange - beginrange + 1; if ( nc <= 0 ) return; buff = fl_malloc( nc + 1 ); strncpy( buff, sp->str + beginrange, nc ); buff[ nc ] = '\0'; fl_stuff_clipboard( obj, XA_STRING, buff, nc, lose_selection ); fl_free( buff ); } /*************************************** * Handles an event ***************************************/ static int handle_input( FL_OBJECT * obj, int event, FL_Coord mx, FL_Coord my, int key, void * ev ) { FLI_INPUT_SPEC *sp = obj->spec; static int motion, lx = INT_MAX, ly = INT_MAX, paste; int ret = FL_RETURN_NONE, val, state = 0; /* Convert scroll wheel events to up or down arrow key events */ if ( event == FL_KEYPRESS ) state = ( ( XKeyEvent * ) ev )->state; if ( event == FL_PUSH ) { if ( key == FL_MBUTTON4 ) { event = FL_KEYPRESS; key = XK_Up; } else if ( key == FL_MBUTTON5 ) { event = FL_KEYPRESS; key = XK_Down; } } switch ( event ) { case FL_ATTRIB : obj->align = fl_to_outside_lalign( obj->align ); break; case FL_RESIZED : check_scrollbar_size( obj ); break; case FL_DRAW: /* We always force label outside */ if ( sp->input->type != FL_MULTILINE_INPUT ) { if ( sp->dummy != obj ) /* this can only happen with fdesign */ sp->dummy = sp->input = obj; } sp->dummy->align = fl_to_outside_lalign( sp->dummy->align ); copy_attributes( sp->input, sp->dummy ); if ( sp->input->type != FL_HIDDEN_INPUT ) draw_input( sp->input ); /* fall through */ case FL_DRAWLABEL: if ( sp->input->type != FL_MULTILINE_INPUT ) fl_draw_object_label_outside( sp->input ); else fl_draw_text_beside( sp->dummy->align, sp->input->x, sp->input->y, sp->input->w + sp->vw, sp->input->h + sp->hh, sp->input->lcol, sp->input->lstyle, sp->input->lsize, sp->dummy->label ); break; case FL_FOCUS: if ( obj->type == FL_MULTILINE_INPUT ) { if ( sp->dummy->focus ) break; sp->dummy->focus = 1; } // Put the cursor back into the position where it was (except // for DOS mode where it's always positioned at the start) if ( sp->str && Input_Mode != FL_DOS_INPUT_MODE ) { if ( sp->position < 0 ) sp->position = - sp->position - 1; if ( sp->position > ( int ) strlen( sp->str ) ) sp->position = strlen( sp->str ); } else sp->position = 0; sp->changed = 0; fl_redraw_object( sp->input ); break; case FL_UNFOCUS: if ( obj->type == FL_MULTILINE_INPUT ) sp->dummy->focus = 0; if ( sp->position >= 0 ) sp->position = - sp->position - 1; sp->endrange = -1; fl_redraw_object( sp->input ); /* If the event is set to NULL don't validate or report any changes - the call came from either closing the form or from the user changing the focus with the fl_set_focus_object() function - never use the event, it may be invalid */ if ( ev ) ret = ( sp->changed ? FL_RETURN_CHANGED : FL_RETURN_NONE ) | FL_RETURN_END; break; case FL_UPDATE: if ( ! obj->focus ) break; motion = ( mx != lx || my != ly ) && ! paste; if ( motion && handle_select( mx, my, obj, 1, NORMAL_SELECT ) ) fl_redraw_object( sp->input ); break; case FL_PUSH: paste = 0; lx = mx; ly = my; if ( key == FL_MBUTTON2 && ( sp->changed = do_XPaste( obj ) ) ) { if ( obj->how_return == FL_RETURN_CHANGED ) sp->changed = 0; ret = FL_RETURN_CHANGED; paste = 1; } else if ( handle_select( mx, my, obj, 0, NORMAL_SELECT ) ) fl_redraw_object( sp->input ); break; case FL_RELEASE: if ( key == FL_MBUTTON4 || key == FL_MBUTTON5 ) break; if ( key == FL_MBUTTON1 && motion ) do_XCut( obj, sp->beginrange, sp->endrange - 1 ); motion = 0; break; case FL_DBLCLICK: case FL_TRPLCLICK: if ( key == FL_MBUTTON4 || key == FL_MBUTTON5 ) break; if ( handle_select( mx, my, obj, 0, event == FL_DBLCLICK ? WORD_SELECT : LINE_SELECT ) ) { fl_redraw_object( sp->input ); do_XCut( obj, sp->beginrange, sp->endrange ); } break; case FL_KEYPRESS : if ( ( ret = handle_key( obj, key, state ) ) ) { sp->changed = 1; if ( obj->how_return == FL_RETURN_CHANGED ) sp->changed = 0; } break; case FL_FREEMEM: fli_safe_free( ( ( FLI_INPUT_SPEC * ) obj->spec )->str ); fli_safe_free( obj->spec ); return ret; } if ( ret && sp && sp->validate && event == FL_UNFOCUS && ( val = sp->validate( obj, sp->str, sp->str, 0 ) ) != FL_VALID ) { ret = FL_RETURN_NONE; if ( val & FL_RINGBELL ) { fl_ringbell( 0 ); fl_reset_focus_object( obj ); } } /* In some places the x- and y-coordinates (column and row) of the cursor aren't set consistently, so repair it here... */ if ( obj->spec ) fl_get_input_cursorpos( obj, &sp->xpos, &sp->ypos ); return ret; } /*************************************** * Callback for the vertical scrollbar of multi-line input objects ***************************************/ static void vsl_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { FLI_INPUT_SPEC *sp = obj->parent->spec; double val = fl_get_scrollbar_value( obj ); int top = FL_nint( val * ( sp->lines - sp->screenlines ) ) + 1; sp->endrange = -1; /* switch off selection */ sp->drawtype = VSLIDER; fl_set_input_topline( sp->input, top ); } /*************************************** * Callback for the horizontal scrollbar of multi-line input objects ***************************************/ static void hsl_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { FLI_INPUT_SPEC *sp = obj->parent->spec; double val = fl_get_scrollbar_value( obj ); int xoff = val * ( sp->max_pixels - sp->w ) + 0.1; sp->drawtype = HSLIDER; fl_set_input_xoffset( sp->input, xoff ); } /*************************************** * Pre- and post- handlers ***************************************/ static int input_pre( FL_OBJECT * obj, int ev, FL_Coord mx, FL_Coord my, int key, void * xev ) { FL_OBJECT *ext = obj->parent; return ( ext && ext->prehandle ) ? ext->prehandle( ext, ev, mx, my, key, xev ) : 0; } /*************************************** ***************************************/ static int input_post( FL_OBJECT * obj, int ev, FL_Coord mx, FL_Coord my, int key, void * xev ) { FL_OBJECT *ext = obj->parent; return ( ext && ext->posthandle ) ? ext->posthandle( ext, ev, mx, my, key, xev ) : 0; } /*************************************** ***************************************/ static void input_cb( FL_OBJECT * obj, long data FL_UNUSED_ARG ) { obj->parent->returned = obj->returned; } /*************************************** * Creates an input object ***************************************/ FL_OBJECT * fl_create_input( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; FLI_INPUT_SPEC *sp; set_default_keymap( 0 ); obj = fl_make_object( FL_INPUT, type, x, y, w, h, label, handle_input ); obj->boxtype = FL_INPUT_BOXTYPE; obj->col1 = FL_INPUT_COL1; obj->col2 = FL_INPUT_COL2; obj->align = FL_INPUT_ALIGN; obj->lcol = FL_INPUT_LCOL; obj->lsize = fli_cntl.inputFontSize ? fli_cntl.inputFontSize : FL_DEFAULT_SIZE; obj->set_return = fl_set_input_return; fl_set_object_prehandler( obj, input_pre ); fl_set_object_posthandler( obj, input_post ); obj->wantkey = obj->type == FL_MULTILINE_INPUT ? FL_KEY_ALL : FL_KEY_NORMAL; obj->want_update = 1; obj->input = 1; obj->click_timeout = FL_CLICK_TIMEOUT; obj->spec = sp = fl_calloc( 1, sizeof *sp ); sp->textcol = FL_INPUT_TCOL; sp->curscol = FL_INPUT_CCOL; sp->position = -1; sp->endrange = -1; sp->size = 8; sp->lines = sp->ypos = 1; sp->str = fl_malloc( sp->size ); *sp->str = '\0'; sp->cursor_visible = 1; switch ( obj->type ) { case FL_DATE_INPUT : sp->maxchars = 10; break; case FL_SECRET_INPUT : sp->maxchars = 16; break; default : sp->maxchars = 0; } sp->dummy = obj; sp->input = obj; sp->field_char = ' '; if ( obj->type == FL_INT_INPUT ) sp->validate = int_validator; else if ( obj->type == FL_FLOAT_INPUT ) sp->validate = float_validator; else if ( obj->type == FL_DATE_INPUT ) { fl_set_input_format( obj, FL_INPUT_MMDD, '/' ); sp->validate = date_validator; } obj->how_return = FL_RETURN_END_CHANGED; fl_set_object_dblbuffer( obj, type != FL_HIDDEN_INPUT ); return obj; } /*************************************** ***************************************/ static int fake_handle( FL_OBJECT * obj, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { FLI_INPUT_SPEC *sp = obj->spec; switch ( event ) { case FL_ATTRIB: if ( sp->dummy != obj ) /* this can only happen with fdesign */ sp->dummy = obj; copy_attributes( sp->input, sp->dummy ); /* fall through */ case FL_DRAW: case FL_DRAWLABEL: check_scrollbar_size( obj ); break; } return 0; } /*************************************** * Adds an input object ***************************************/ FL_OBJECT * fl_add_input( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; FLI_INPUT_SPEC *sp; int oldu = fl_get_coordunit( ); obj = fl_create_input( type, x, y, w, h, label ); sp = obj->spec; fl_set_coordunit( FL_COORD_PIXEL ); x = obj->x; y = obj->y; w = obj->w; h = obj->h; if ( obj->type == FL_MULTILINE_INPUT ) { fl_set_object_label( obj, NULL ); sp->dummy = fl_create_box( FL_NO_BOX, x, y, w, h, label ); sp->dummy->objclass = FL_INPUT; sp->dummy->type = FL_MULTILINE_INPUT; copy_attributes( sp->dummy, obj ); sp->dummy->handle = fake_handle; sp->dummy->spec = sp; sp->dummy->set_return = fl_set_input_return; fl_add_child( sp->dummy, obj ); sp->hh_def = sp->vw_def = fli_get_default_scrollbarsize( obj ); sp->h_pref = sp->v_pref = FL_AUTO; sp->vscroll = fl_create_scrollbar( fli_context->vscb, x + w - sp->vw_def, y, sp->vw_def, h, NULL ); fl_set_scrollbar_value( sp->vscroll, 0.0 ); fl_set_object_callback( sp->vscroll, vsl_cb, 0 ); fl_set_object_resize( sp->vscroll, FL_RESIZE_NONE ); fl_add_child( sp->dummy, sp->vscroll ); sp->hscroll = fl_create_scrollbar( fli_context->hscb, x, y + h - sp->hh_def, w, sp->hh_def, NULL ); fl_set_scrollbar_value( sp->hscroll, 0.0 ); fl_set_object_callback( sp->hscroll, hsl_cb, 0 ); fl_set_object_resize( sp->hscroll, FL_RESIZE_NONE ); fl_add_child( sp->dummy, sp->hscroll ); fl_set_object_callback( sp->input, input_cb, 0 ); fl_set_object_return( sp->dummy, FL_RETURN_END_CHANGED ); } fl_add_object( fl_current_form, sp->dummy ); fl_set_coordunit( oldu ); /* Set default return policy for the new object */ fl_set_object_return( obj, FL_RETURN_END_CHANGED ); return sp->dummy; } /*************************************** * Sets the input string. Only printable character and, for multi-line * inputs new-lines are accepted. ***************************************/ #define IS_VALID_INPUT_CHAR( c ) \ isprint( ( unsigned char ) ( c ) ) \ || ( obj->type == FL_MULTILINE_INPUT && ( c ) == '\n' ) void fl_set_input( FL_OBJECT * obj, const char * str ) { FLI_INPUT_SPEC *sp = obj->spec; int len; char *p; const char *q; if ( ! str ) str = ""; for ( len = 0, q = str; *q; ++q ) if ( IS_VALID_INPUT_CHAR( *q ) ) ++len; if ( sp->size < len + 1 ) { sp->size = len + 9; sp->str = fl_realloc( sp->str, sp->size ); } for ( p = sp->str, q = str; *q; ++q ) if ( IS_VALID_INPUT_CHAR( *q ) ) *p++ = *q; *p = '\0'; /* Set position of cursor in string to the end (if object doesn't has focus must be negative of length of strig minus one) */ if ( sp->position >= 0 ) sp->position = len; else sp->position = - len - 1; sp->endrange = -1; sp->lines = fl_get_input_numberoflines( obj ); fl_get_input_cursorpos( obj, &sp->xpos, &sp->ypos ); /* Get max string width - it's possible that fl_set_input() is used before the form is show, draw_object is a no-op, thus we end up with a wrong string size */ fl_get_string_dimension( obj->lstyle, obj->lsize, sp->str, len, &sp->max_pixels, &len ); if ( obj->form ) fl_freeze_form( obj->form ); check_scrollbar_size( obj ); make_line_visible( obj, sp->ypos ); fl_redraw_object( sp->input ); sp->xoffset = 0; check_scrollbar_size( obj ); if ( sp->v_on || sp->h_on ) redraw_scrollbar( obj ); if ( obj->form ) fl_unfreeze_form( obj->form ); } /*************************************** * Sets the input string using a format string and an appropriate number * of (unspecified) arguments ***************************************/ void fl_set_input_f( FL_OBJECT * obj, const char * fmt, ... ) { char *buf; EXPAND_FORMAT_STRING( buf, fmt ); fl_set_input( obj, buf ); fl_free( buf ); } /*************************************** * Sets the color of the input string ***************************************/ void fl_set_input_color( FL_OBJECT * obj, FL_COLOR textcol, FL_COLOR curscol ) { FLI_INPUT_SPEC *sp = obj->spec; sp->textcol = textcol; sp->curscol = curscol; fl_redraw_object( sp->input ); } /*************************************** * Returns the color of the input string ***************************************/ void fl_get_input_color( FL_OBJECT * obj, FL_COLOR * textcol, FL_COLOR * curscol ) { FLI_INPUT_SPEC *sp = obj->spec; *textcol = sp->textcol; *curscol = sp->curscol; } /*************************************** ***************************************/ int fl_set_input_fieldchar( FL_OBJECT * obj, int fchar ) { FLI_INPUT_SPEC *sp = obj->spec; int ochar = sp->field_char; if ( obj->objclass != FL_INPUT ) { M_err( "fl_set_input_fieldchar", "%s isn't an input object", obj ? obj->label : "null" ); return 0; } sp->field_char = fchar; return ochar; } /*************************************** * Returns a pointer to the text string ***************************************/ const char * fl_get_input( FL_OBJECT * obj ) { return ( ( FLI_INPUT_SPEC * ) obj->spec )->str; } /*************************************** * Sets under which conditions the object is to be returned to the * application. This function should be regarded as for internal use * only and fl_set_object_return() should be used instead (which then * will call this function). ***************************************/ void fl_set_input_return( FL_OBJECT * obj, unsigned int when ) { FLI_INPUT_SPEC *sp = obj->spec; if ( when & FL_RETURN_END_CHANGED ) when &= ~ ( FL_RETURN_END | FL_RETURN_CHANGED ); obj->how_return = sp->input->how_return = when; fl_set_object_return( sp->vscroll, FL_RETURN_CHANGED ); fl_set_object_return( sp->hscroll, FL_RETURN_CHANGED ); } /*************************************** ***************************************/ void fl_set_input_scroll( FL_OBJECT * obj, int yes ) { ( ( FLI_INPUT_SPEC * ) obj->spec )->noscroll = ! yes; } /*************************************** * Makes a part of an input string selected or deselected ***************************************/ void fl_set_input_selected_range( FL_OBJECT * obj, int begin, int end ) { FLI_INPUT_SPEC *sp = obj->spec; int len; if ( obj->type == FL_HIDDEN_INPUT ) return; len = strlen( sp->str ); if ( begin < 0 ) sp->beginrange = 0; else if ( begin > len ) sp->beginrange = len; else sp->beginrange = begin; if ( end < 0 ) sp->endrange = -1; else if ( end > len ) sp->endrange = len; else sp->endrange = end; /* move cursor to the head */ sp->position = sp->beginrange; fl_redraw_object( sp->input ); } /*************************************** ***************************************/ const char * fl_get_input_selected_range( FL_OBJECT * obj, int * begin, int * end ) { FLI_INPUT_SPEC *sp = obj->spec; static char *selbuf; static int nselbuf; int n; n = sp->endrange - sp->beginrange; if ( n < 1 ) { if ( begin ) *begin = -1; if ( end ) *end = -1; return NULL; } if ( begin ) *begin = sp->beginrange; if ( end ) *end = sp->endrange; if ( n != nselbuf ) { selbuf = fl_realloc( selbuf, n + 1 ); nselbuf = n; } fli_sstrcpy( selbuf, sp->str + sp->beginrange, n ); return selbuf; } /*************************************** * Selects the current input programmatically without moving * the cursor ***************************************/ void fl_set_input_selected( FL_OBJECT * obj, int yes ) { FLI_INPUT_SPEC *sp = obj->spec; if ( obj->type == FL_HIDDEN_INPUT ) return; if ( yes ) { sp->position = sp->endrange = strlen( sp->str ); sp->beginrange = 0; } else sp->endrange = -1; fl_redraw_object( sp->input ); } /*************************************** * Given an (x,y) location returns the string position in chars ***************************************/ static int xytopos( FLI_INPUT_SPEC * sp, int xpos, int ypos ) { int newp = 0; char *s = sp->str, *se = s + strlen( s ); if ( ypos < 1 ) ypos = 1; else if ( ypos > sp->lines ) ypos = sp->lines; if ( xpos < 0 ) xpos = 0; sp->ypos = 1; while ( sp->ypos < ypos && ( s = strchr( s, '\n' ) ) ) { sp->ypos++; s++; newp = s - sp->str; } s = sp->str + newp; for ( sp->xpos = 0; sp->xpos < xpos && s < se; sp->xpos++, newp++ ) if ( *++s == '\n' ) break; return sp->position = newp; } /*************************************** * Move cursor within the input field, cursor position is measured in chars ***************************************/ void fl_set_input_cursorpos( FL_OBJECT * obj, int xpos, int ypos ) { FLI_INPUT_SPEC *sp = obj->spec; int oldp = sp->position; if ( obj->type == FL_HIDDEN_INPUT ) return; if ( oldp != xytopos( sp, xpos, ypos ) ) { fl_freeze_form( obj->form ); make_line_visible( obj, sp->ypos ); make_char_visible( obj, sp->xpos ); fl_redraw_object( obj ); fl_unfreeze_form( obj->form ); } } /*************************************** ***************************************/ int fl_get_input_cursorpos( FL_OBJECT * obj, int * x, int * y ) { FLI_INPUT_SPEC *sp = obj->spec; char *s = sp->str; int cnt = 0; if ( ! obj->focus ) return sp->position = *x = -1; *y = 1; *x = 0; for ( ; s && *s && cnt < sp->position; s++, cnt++ ) if ( *s == '\n' ) { *y += 1; *x = 0; } else *x += 1; return sp->position; } /*************************************** * Reverts to the default keymap for edit keys ***************************************/ void fl_set_default_editkeymap( void ) { set_default_keymap( 1 ); } #define Ctrl( c ) \ ( ( tolower( ( unsigned char ) c ) - 'a' + 1 ) | FL_CONTROL_MASK ) #define Meta( c ) ( tolower( ( unsigned char ) c ) | FL_ALT_MASK ) /*************************************** ***************************************/ static void set_default_keymap( int force ) { static int initialized = 0; if ( ! force && initialized ) return; initialized = 1; /* Emacs defaults */ kmap.moveto_next_char = Ctrl( 'f' ); kmap.moveto_prev_char = Ctrl( 'b' ); kmap.moveto_prev_word = Meta( 'b' ); kmap.moveto_next_word = Meta( 'f' ); kmap.moveto_bol = Ctrl( 'a' ); kmap.moveto_eol = Ctrl( 'e' ); kmap.moveto_next_line = Ctrl( 'n' ); kmap.moveto_prev_line = Ctrl( 'p' ); kmap.moveto_bof = Meta( '<' ); kmap.moveto_eof = Meta( '>' ); kmap.del_next_char = Ctrl( 'd' ); kmap.del_prev_char = Ctrl( 'h' ); kmap.del_next_word = Meta( 'd' ); kmap.del_prev_word = Meta( '\b' ); kmap.del_to_eol = Ctrl( 'k' ); kmap.del_to_bol = Meta( 'k' ); kmap.backspace = '\b'; kmap.transpose = Ctrl( 't' ); kmap.paste = Ctrl( 'y' ); kmap.clear_field = Ctrl( 'u' ); } /*************************************** ***************************************/ void fl_set_input_maxchars( FL_OBJECT * obj, int maxchars ) { ( ( FLI_INPUT_SPEC * ) obj->spec )->maxchars = maxchars; } /*************************************** ***************************************/ FL_INPUT_VALIDATOR fl_set_input_filter( FL_OBJECT * obj, FL_INPUT_VALIDATOR validate ) { FLI_INPUT_SPEC *sp = obj->spec; FL_INPUT_VALIDATOR old = sp->validate; sp->validate = validate; return old; } /*************************************** ***************************************/ void fl_set_input_format( FL_OBJECT * obj, int fmt, int sep ) { FLI_INPUT_SPEC *sp = obj->spec; if ( ! isprint( ( unsigned char ) sep ) || isdigit( ( unsigned char ) sep ) ) sep = '/'; sp->attrib1 = fmt; sp->attrib2 = sep; } /*************************************** ***************************************/ void fl_get_input_format( FL_OBJECT * obj, int * fmt, int * sep ) { FLI_INPUT_SPEC *sp = obj->spec; *fmt = sp->attrib1; *sep = sp->attrib2; } /*************************************** ***************************************/ int fl_validate_input( FL_OBJECT *obj ) { FLI_INPUT_SPEC *sp = obj->spec; return ( ! sp->validate || sp->validate( obj, sp->str, sp->str, 0 ) == FL_VALID ) ? FL_VALID : FL_INVALID; } /*************************************** * Validator for date ***************************************/ #define IS_LEAP_YEAR( y ) \ ( ( y ) % 4 == 0 && ( ( y ) % 100 != 0 || ( y ) % 400 == 0 ) ) static int date_validator( FL_OBJECT * obj, const char * oldstr FL_UNUSED_ARG, const char * newstr, int newc ) { char *val, *s, sepsep[ 3 ]; char ssep[ 2 ] = ""; int i, len, ival[ ] = { 1, 1, 1 }; int fmt, sep; int invalid = FL_RINGBELL | FL_INVALID; int m, d; /* Consider empty valid */ if ( ( len = strlen( newstr ) ) == 0 ) return FL_VALID; fl_get_input_format( obj, &fmt, &sep ); *ssep = sep; strcat( strcpy( sepsep, ssep ), ssep ); /* Allow only separator or digit, but no separator at the very start or two separators in a row */ if ( ( newc != sep && newc != '\0' && ! isdigit( ( unsigned char ) newc ) ) || *newstr == sep || strstr( newstr, sepsep ) ) return invalid; s = fl_strdup( newstr ); /* Split up the date string at the separators and convert to ints and check that there aren't more than 2 digits for day and month and 4 for the year */ for ( i = 0, val = strtok( s, ssep ); i < 3 && val; val = strtok( NULL, ssep ) ) { if ( ( i < 2 && strlen( val ) > 2 ) || ( i == 2 && strlen( val ) > 4 ) ) return invalid; ival[ i++ ] = atoi( val ); if ( i <= 2 && strlen( val ) == 2 && ival[ i - 1 ] == 0 ) return invalid; } fl_free( s ); /* Allow one or more '0' at the start of the day pr month (but not as the only digit, i.e. when the new character is the separator) */ if ( newc == sep && ( ( i == 1 && ival[ 0 ] == 0 ) || ( i == 2 && ival[ 1 ] == 0 ) ) ) return invalid; /* Don't allow another separator when we already got 3 items */ if ( i == 3 && newstr[ len - 1 ] == sep ) return invalid; /* Always require 3 items when the user tries to leave the field and make sure that day or month aren't 0 */ if ( newc == '\0' && ( i != 3 || ival[ 0 ] == 0 || ival[ 1 ] == 0 ) ) return invalid; m = fmt == FL_INPUT_MMDD ? 0 : 1; d = ! m; /* Basic check for upper limits of day and month */ if ( ival[ m ] > 12 || ival[ d ] > 31 ) return invalid; /* More precise check for days in month */ if ( ( ival[ d ] > 30 && ( ival[ m ] % 2 ) == 0 && ival[ m ] < 8 ) || ( ival[ d ] > 30 && ( ival[ m ] % 2 ) != 0 && ival[ m ] > 8 ) ) return invalid; /* Take care: check for leap year can only be done when leaving */ if ( ival[ m ] == 2 && ( ival[ d ] > 29 || ( i == 3 && newc == 0 && ival[ d ] > 28 && ! IS_LEAP_YEAR( ival[ 2 ] ) ) ) ) return invalid; return FL_VALID; } /*************************************** * Validator for integer fields ***************************************/ static int int_validator( FL_OBJECT * obj FL_UNUSED_ARG, const char * oldstr FL_UNUSED_ARG, const char * str, int newc ) { char *eptr = NULL; long dummy; /* The empty string is considered to be valid */ if ( ! *str ) return FL_VALID; /* If there was a new character and all we got is a '+' or '-' this is ok */ if ( ! str[ 1 ] && ( newc == '+' || newc == '-' ) ) return FL_VALID; dummy = strtol( str, &eptr, 10 ); if ( ( ( dummy == LONG_MAX || dummy == LONG_MIN ) && errno == ERANGE ) || *eptr ) return FL_INVALID | FL_RINGBELL; return FL_VALID; } /*************************************** * Validator for floating point fields ***************************************/ static int float_validator( FL_OBJECT * obj FL_UNUSED_ARG, const char * oldstr FL_UNUSED_ARG, const char * str, int newc ) { char *eptr = NULL; size_t len; double dummy; /* The empty string is considered valid */ if ( ! *str ) return FL_VALID; /* Try strtod() an the string*/ dummy = strtod( str, &eptr ); /* If it reports no problem were done */ if ( ! ( ( dummy == HUGE_VAL || dummy == -HUGE_VAL ) && errno == ERANGE ) && ! *eptr ) return FL_VALID; /* Otherwise, if there's no new character the input must be invalid */ if ( ! newc ) return FL_INVALID | FL_RINGBELL; /* Now we handle cases that strtod() flagged as bad but which we need to accept while editing is still underway. If there's only a single char it should be a dot or a sign */ len = strlen( str ); if ( len == 1 ) return ( newc == '+' || newc == '-' || newc == '.' ) ? FL_VALID : FL_INVALID | FL_RINGBELL; /* If there are two characters accept a sequence of a sign and a decimal point or a number followed by 'e' or 'E' */ if ( len == 2 ) return ( ! strcmp( str, "+." ) || ! strcmp( str, "-." ) || *eptr == 'e' || *eptr == 'E' ) ? FL_VALID : ( FL_INVALID | FL_RINGBELL ); /* Accept an 'e' or 'E' in the last position, or, if it's in the second last position, when it's followed by a sign - but only if it's the first 'e' or 'E' in the string */ if ( ( *eptr == 'e' || *eptr == 'E' ) && strchr( str, *eptr ) == eptr && ( eptr == str + len - 1 || ( eptr == str + len - 2 && ( eptr[ 1 ] == '+' || eptr[ 1 ] == '-' ) ) ) ) return FL_VALID; return FL_INVALID | FL_RINGBELL; } /*************************************** ***************************************/ void fl_set_input_xoffset( FL_OBJECT * obj, int xoff ) { FLI_INPUT_SPEC *sp = obj->spec; if ( sp->xoffset != xoff ) { sp->xoffset = xoff; if ( sp->drawtype != HSLIDER ) { check_scrollbar_size( obj ); redraw_scrollbar( obj ); } sp->drawtype = COMPLETE; fl_redraw_object( sp->input ); } } /*************************************** ***************************************/ int fl_get_input_xoffset( FL_OBJECT * obj ) { return ( ( FLI_INPUT_SPEC * ) obj->spec )->xoffset; } /*************************************** * Corrects, if necessary, the value of 'top' (the topmost line to be * shown in a FL_MULTILINE_INPUT object, count is starting at 1) so * that the value is at least 1 and, if there are less lines below * 'top' then fit into the input field, adjusts 'top' that the * complete field is used (i.e. there are no empty lines at the end). ***************************************/ static void correct_topline( FLI_INPUT_SPEC * sp, int * top ) { if ( sp->lines > sp->screenlines ) { if ( sp->lines < *top + sp->screenlines - 1 ) *top = sp->lines - sp->screenlines + 1; if ( *top < 1 ) *top = 1; } else *top = 1; } /*************************************** ***************************************/ int fl_get_input_numberoflines( FL_OBJECT * obj ) { FLI_INPUT_SPEC *sp = obj->spec; int count; const char *s = sp->str; if ( ! s ) return sp->lines = 0; for ( count = 1; *s; s++ ) if ( *s == '\n' ) count++; return sp->lines = count; } /*************************************** * Makes the requested line 'top' (starting at 1) the topmost line * shown in a FL_MULTILINE_INPUT object. ***************************************/ void fl_set_input_topline( FL_OBJECT * obj, int top ) { FLI_INPUT_SPEC *sp = obj->spec; if ( sp->input->type != FL_MULTILINE_INPUT ) return; correct_topline( sp, &top ); if ( sp->topline == top ) return; /* Make sure the cursor remains in a visible line */ if ( sp->ypos < top || sp->ypos >= top + sp->screenlines ) { if ( sp->ypos < top ) xytopos( sp, sp->xpos, top ); else xytopos( sp, sp->xpos, top + sp->screenlines - 1 ); make_char_visible( obj, sp->xpos ); } sp->topline = top; if ( sp->drawtype != VSLIDER ) { check_scrollbar_size( obj ); redraw_scrollbar( obj ); } sp->drawtype = COMPLETE; sp->yoffset = ( sp->topline - 1 ) * sp->charh; fl_redraw_object( sp->input ); } /*************************************** * Line number 'n' is numbered from 1. ***************************************/ static int make_line_visible( FL_OBJECT * obj, int ypos ) { FLI_INPUT_SPEC *sp = obj->spec; int oldtop = sp->topline; if ( obj->type != FL_MULTILINE_INPUT ) return 0; if ( ypos < sp->topline ) fl_set_input_topline( obj, ypos ); else if ( ypos > sp->topline + sp->screenlines - 1 ) fl_set_input_topline( obj, ypos - sp->screenlines + 1 ); else if ( sp->lines < sp->screenlines ) fl_set_input_topline( obj, 1 ); return oldtop != sp->topline; } /*************************************** ***************************************/ static int make_char_visible( FL_OBJECT * obj, int xpos ) { FLI_INPUT_SPEC *sp = obj->spec; int start_of_line = sp->position; int oldxoffset = sp->xoffset; int tmp; if ( xpos < 0 ) return 0; while ( start_of_line > 0 && sp->str[ start_of_line - 1 ] != '\n' ) start_of_line--; tmp = get_substring_width( obj, start_of_line, start_of_line + xpos ); if ( tmp < sp->xoffset ) sp->xoffset = tmp; else if ( tmp - sp->xoffset > sp->w ) sp->xoffset = tmp - sp->w; if ( sp->xoffset != oldxoffset ) { check_scrollbar_size( obj ); redraw_scrollbar( obj ); fl_redraw_object( sp->input ); return 1; } return 0; } /*************************************** ***************************************/ void fl_set_input_vscrollbar( FL_OBJECT * obj, int pref ) { FLI_INPUT_SPEC *sp = obj->spec; if ( sp->v_pref != pref ) { sp->v_pref = pref; check_scrollbar_size( obj ); redraw_scrollbar( obj ); fl_redraw_object( sp->input ); } } /*************************************** ***************************************/ void fl_set_input_hscrollbar( FL_OBJECT * obj, int pref ) { FLI_INPUT_SPEC *sp = obj->spec; if ( sp->h_pref != pref ) { sp->h_pref = pref; check_scrollbar_size( obj ); redraw_scrollbar( obj ); fl_redraw_object( sp->input ); } } /*************************************** ***************************************/ void fl_set_input_scrollbarsize( FL_OBJECT * obj, int hh, int vw ) { FLI_INPUT_SPEC *sp = obj->spec; if ( sp->hh_def != hh || sp->vw_def != vw ) { sp->hh_def = hh; sp->vw_def = vw; check_scrollbar_size( obj ); redraw_scrollbar( obj ); fl_redraw_object( sp->input ); } } /*************************************** ***************************************/ void fl_get_input_scrollbarsize( FL_OBJECT * obj, int * hh, int * vw ) { FLI_INPUT_SPEC *sp = obj->spec; *hh = sp->hh_def; *vw = sp->vw_def; } /*************************************** ***************************************/ int fl_get_input_topline( FL_OBJECT * obj ) { FLI_INPUT_SPEC *sp = obj->spec; if ( sp->input->type != FL_MULTILINE_INPUT ) return 1; return sp->topline; } /*************************************** ***************************************/ int fl_get_input_screenlines( FL_OBJECT * obj ) { return ( ( FLI_INPUT_SPEC * ) obj->spec )->screenlines; } #define SetKey( m ) if ( keymap->m ) kmap.m = keymap->m /*************************************** ***************************************/ void fl_set_input_editkeymap( const FL_EditKeymap * keymap ) { /* If keymap is Null force default */ if ( ! keymap ) { set_default_keymap( 1 ); return; } set_default_keymap( 0 ); SetKey( del_prev_char ); SetKey( del_next_char ); SetKey( del_prev_word ); SetKey( del_next_word ); SetKey( moveto_prev_char ); SetKey( moveto_next_char ); SetKey( moveto_prev_word ); SetKey( moveto_next_word ); SetKey( moveto_prev_line ); SetKey( moveto_next_line ); SetKey( moveto_bof ); SetKey( moveto_eof ); SetKey( moveto_bol ); SetKey( moveto_eol ); SetKey( backspace ); SetKey( clear_field ); SetKey( paste ); SetKey( transpose ); SetKey( del_to_eos ); SetKey( del_to_eol ); SetKey( del_to_bol ); } /*************************************** ***************************************/ void fl_get_input_editkeymap( FL_EditKeymap * keymap ) { /* Don't do anything if we got a NULL pointer */ if ( ! keymap ) return; /* Make sure the keymap is set up */ set_default_keymap( 0 ); /* Copy the current keymap to the user supplied buffer */ memcpy( keymap, &kmap, sizeof kmap ); } /*************************************** ***************************************/ static void copy_attributes( FL_OBJECT * dest, const FL_OBJECT * src ) { if ( src == dest ) return; dest->col1 = src->col1; dest->col2 = src->col2; dest->align = src->align; dest->boxtype = src->boxtype; dest->lcol = src->lcol; dest->lstyle = src->lstyle; dest->lsize = src->lsize; } /*************************************** ***************************************/ static void redraw_scrollbar( FL_OBJECT * obj ) { FLI_INPUT_SPEC *sp = obj->spec; fl_freeze_form( obj->form ); if ( sp->v_on ) { fl_set_scrollbar_size( sp->vscroll, sp->vsize ); fl_set_scrollbar_value( sp->vscroll, sp->vval ); if ( sp->vsize != 1.0 ) fl_set_scrollbar_increment( sp->vscroll, sp->vinc1, sp->vinc2 ); fl_redraw_object( sp->vscroll ); } if ( sp->h_on ) { fl_set_scrollbar_size( sp->hscroll, sp->hsize ); fl_set_scrollbar_value( sp->hscroll, sp->hval ); if ( sp->hsize != 1.0 ) fl_set_scrollbar_increment( sp->hscroll, sp->hinc1, sp->hinc2 ); fl_redraw_object( sp->hscroll ); } if ( sp->attrib ) { fl_redraw_object( sp->input ); sp->attrib = 0; } if ( sp->dead_area && FL_ObjWin( obj ) ) { sp->dead_area = 0; fl_winset( FL_ObjWin( obj ) ); fl_draw_box( FL_FLAT_BOX, sp->dummy->x + sp->dummy->w - sp->vw, sp->dummy->y + sp->dummy->h - sp->hh, sp->vw, sp->hh, sp->hscroll->col1, 1 ); } fl_unfreeze_form( obj->form ); } /*************************************** ***************************************/ void fl_set_input_cursor_visible( FL_OBJECT * obj, int visible ) { FLI_INPUT_SPEC *sp = obj->spec; if ( sp->cursor_visible != visible ) { sp->cursor_visible = visible; fl_redraw_object( obj ); } } /*************************************** ***************************************/ int fl_input_changed( FL_OBJECT * obj ) { return ( ( FLI_INPUT_SPEC * ) obj->spec )->changed; } /*************************************** ***************************************/ int fl_set_input_mode( int mode ) { int old_mode = Input_Mode; Input_Mode = mode == FL_DOS_INPUT_MODE ? FL_DOS_INPUT_MODE : FL_NORMAL_INPUT_MODE; return old_mode; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/read2lsbf.c0000644000175000017500000000265012251554067012545 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file read2lsbf.c * * Copyright(c) 1993,1994 by T.C. Zhao * All rights reserved. * * Read 2bytes LSB first */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" #include "flinternal.h" #include "ulib.h" /*************************************** ***************************************/ int fli_fget2LSBF( FILE * fp ) { int ret = getc( fp ); return ( ret | getc( fp ) << 8 ); } /*************************************** ***************************************/ int fli_fput2LSBF( int code, FILE * fp ) { putc( code & 0xff, fp ); return putc( ( code >> 8 ) & 0xff, fp ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/clock.c0000664000175000017500000002262512353623325011777 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file clock.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include #include #ifndef M_PI #define M_PI 3.14159265359 #endif typedef struct { time_t sec; long offset; int nstep; int am_pm; /* 12hr clock */ } SPEC; static double hourhand[ 4 ][ 2 ] = { { -0.6, 0.0 }, { 0.0, -1.6 }, { 0.6, 0.0 }, { 0.0, 7.0 } }; static double minhand[ 4 ][ 2 ] = { { -0.6, 0.0 }, { 0.0, -1.6 }, { 0.6, 0.0 }, { 0.0, 11.6 } }; static double sechand[ 4 ][ 2 ] = { { -0.3, 0.0 }, { 0.0, -2.0 }, { 0.3, 0.0 }, { 0.0, 11.6 } }; #define ROTxy( xx, yy, x, y, a ) \ do \ { \ double s = sin( a ); \ double c = cos( a ); \ xx = FL_crnd( xc + ( ( x ) - xc ) * c + ( ( y ) - yc ) * s ); \ yy = FL_crnd( yc - ( ( x ) - xc ) * s + ( ( y ) - yc ) * c ); \ } while ( 0 ) /*************************************** ***************************************/ static void draw_hand( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, double a[ ][ 2 ], double ra, FL_COLOR fc, FL_COLOR bc ) { int i; double ccp[ 4 ][ 2 ]; double xc = x + 0.5 * w, yc = y + 0.5 * h; FL_POINT xp[ 5 ]; /* Needs one extra point! */ for ( i = 0; i < 4; i++ ) { ccp[ i ][ 0 ] = xc + a[ i ][ 0 ] * w / 28.0; ccp[ i ][ 1 ] = yc + a[ i ][ 1 ] * h / 28.0; ROTxy( xp[ i ].x, xp[ i ].y, ccp[ i ][ 0 ], ccp[ i ][ 1 ], ra ); } fl_polyf( xp, 4, fc ); fl_polyl( xp, 4, bc ); } static int hours, minutes, seconds; static int updating; /*************************************** ***************************************/ static void show_hands( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR fcolor, FL_COLOR bcolor ) { double ra; double fact = - M_PI / 180.0; ra = fact * ( 180 + 30 * hours + 0.5 * minutes ); draw_hand( x, y, w, h, hourhand, ra, fcolor, bcolor ); ra = fact * ( 180 + 6 * minutes + seconds / 10 ); draw_hand( x, y, w, h, minhand, ra, fcolor, bcolor ); ra = fact * ( 180 + 6 * seconds ); draw_hand( x, y, w, h, sechand, ra, fcolor, bcolor ); } /*************************************** ***************************************/ static void draw_clock( int type FL_UNUSED_ARG, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col1 FL_UNUSED_ARG, FL_COLOR col2 ) { double xc = x + 0.5 * w, yc = y + 0.5 * h; int i; double ra; FL_POINT xp[ 5 ]; /* need one extra for closing of polygon! */ double f1, f2, f3; w -= 4; h -= 4; /* Draw hour ticks */ f2 = 0.40 * h; f3 = 0.44 * h; for ( ra = 0.0, i = 0; i < 12; i++, ra += M_PI / 6 ) { f1 = ( ( i % 3 ) ? 0.01 : 0.02 ) * w; ROTxy( xp[ 0 ].x, xp[ 0 ].y, xc - f1, yc + f2, ra ); ROTxy( xp[ 1 ].x, xp[ 1 ].y, xc + f1, yc + f2, ra ); ROTxy( xp[ 2 ].x, xp[ 2 ].y, xc + f1, yc + f3, ra ); ROTxy( xp[ 3 ].x, xp[ 3 ].y, xc - f1, yc + f3, ra ); fl_polyf( xp, 4, FL_LEFT_BCOL ); } show_hands( x + 2 + 0.02 * w, y + 2 + 0.02 * h, w, h, FL_RIGHT_BCOL, FL_RIGHT_BCOL ); show_hands( x, y, w, h, col2, FL_LEFT_BCOL ); } /*************************************** ***************************************/ static void draw_digitalclock( FL_OBJECT * ob ) { char buf[ 12 ]; SPEC *sp = ob->spec; if ( sp->am_pm ) sprintf( buf, "%d:%02d:%02d %s", hours > 12 ? hours - 12 : hours, minutes, seconds, hours > 12 ? "pm" : "am" ); else sprintf( buf, "%d:%02d:%02d", hours, minutes, seconds ); fl_draw_text( FL_ALIGN_CENTER, ob->x, ob->y, ob->w, ob->h, ob->col2, ob->lstyle, ob->lsize, buf ); } /*************************************** ***************************************/ static int handle_clock( FL_OBJECT * ob, int event, FL_Coord x FL_UNUSED_ARG, FL_Coord y FL_UNUSED_ARG, int k FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { time_t ticks; struct tm *timeofday; SPEC *sp = ob->spec; switch ( event ) { case FL_ATTRIB : if ( ob->align & ~ FL_ALIGN_INSIDE ) ob->align = fl_to_outside_lalign( ob->align ); break; case FL_DRAW : fl_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); if ( ob->type == FL_DIGITAL_CLOCK ) draw_digitalclock( ob ); else draw_clock( ob->type, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->col2 ); /* fall through */ case FL_DRAWLABEL : if ( ! updating ) fl_draw_text_beside( ob->align & ~ FL_ALIGN_INSIDE, ob->x, ob->y, ob->w, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); updating = 0; break; case FL_STEP: /* Clock has a resolution of about 1 sec. FL_STEP is sent about every 0.05 sec. If there are more than 10 clocks, we might run into trouble */ if ( ++sp->nstep & 1 ) break; sp->nstep = 0; ticks = time( 0 ) + sp->offset; if ( ticks != sp->sec ) { updating = 1; sp->sec = ticks; timeofday = localtime( &ticks ); seconds = timeofday->tm_sec; hours = timeofday->tm_hour; minutes = timeofday->tm_min; fl_redraw_object( ob ); } break; case FL_FREEMEM: fl_free( ob->spec ); break; } return FL_RETURN_NONE; } /*************************************** ***************************************/ FL_OBJECT * fl_create_clock( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * s ) { FL_OBJECT *obj; SPEC *sp; obj = fl_make_object( FL_CLOCK, type, x, y, w, h, s, handle_clock ); obj->boxtype = FL_CLOCK_BOXTYPE; obj->col1 = FL_CLOCK_COL1; obj->col2 = FL_CLOCK_COL2; obj->lcol = FL_CLOCK_LCOL; obj->align = FL_CLOCK_ALIGN; obj->automatic = obj->active = 1; obj->spec = sp = fl_calloc( 1, sizeof *sp ); return obj; } /*************************************** ***************************************/ FL_OBJECT * fl_add_clock( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * s ) { FL_OBJECT *ob = fl_create_clock( type, x, y, w, h, s ); fl_add_object( fl_current_form, ob ); fl_set_object_dblbuffer( ob, 1 ); return ob; } /*************************************** ***************************************/ long fl_set_clock_adjustment( FL_OBJECT * ob, long offset ) { SPEC *sp = ob->spec; long old = sp->offset; sp->offset = offset; return old; } /*************************************** ***************************************/ void fl_get_clock( FL_OBJECT * ob, int * h, int * m, int * s ) { SPEC *sp = ob->spec; time_t ticks; struct tm *tm; ticks = time( 0 ) + sp->offset; tm = localtime( &ticks ); *h = tm->tm_hour; *m = tm->tm_min; *s = tm->tm_sec; } /*************************************** ***************************************/ void fl_set_clock_ampm( FL_OBJECT * ob, int am_pm ) { SPEC *sp = ob->spec; if ( sp->am_pm != am_pm ) { sp->am_pm = am_pm; fl_redraw_object( ob ); } } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/goodie_msg.c0000644000175000017500000001306412251554170013011 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file goodie_msg.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/flvasprintf.h" /*************** Three line messages *******************{*****/ typedef struct { FL_FORM * form; FL_OBJECT * str; FL_OBJECT * but; } FD_msg; /*************************************** ***************************************/ static FD_msg * create_msg( const char * str ) { FD_msg *fdui = fl_calloc( 1, sizeof *fdui ); int oldy = fli_inverted_y; int oldu = fl_get_coordunit( ); int style, size; int w_msg, h_msg, w_but, h_but; int box_w, box_h, but_w; char but_text[ 256 ] = "Ok"; fli_inverted_y = 0; fl_set_coordunit( FL_COORD_PIXEL ); fli_get_goodies_font( &style, &size ); /* Get size of box that fits the message. The message will have 20 px around spacing it (and the box a minimum width of 400 px) */ fl_get_string_dimension( style, size, str, strlen( str ), &w_msg, &h_msg ); box_w = FL_max( 400, w_msg + 40 ); box_h = h_msg + 40; /* Get the text for the button (default is "Ok") and the size needed for it. The button should have at least 20 px space to the left and right and 10 px inner horizontal margins (and a minimum width of 90 px). Vertical inner margins are 5 px and the button should have 10 px spacing to the lower border of the box. */ fl_get_resource( FLOKLabel, NULL, FL_STRING, NULL, but_text, 256 ); fl_get_string_dimension( style, size, but_text, strlen( but_text ), &w_but, &h_but ); but_w = FL_max( 90, w_but + 20 ); box_w = FL_max( box_w, but_w + 40 ); box_h += h_but + 20; fdui->form = fl_bgn_form( FL_FLAT_BOX, box_w, box_h ); fdui->str = fl_add_box( FL_FLAT_BOX, ( box_w - w_msg ) / 2, 20, w_msg, h_msg, str ); fl_set_object_lstyle( fdui->str, style ); fl_set_object_lsize( fdui->str, size ); fdui->but = fl_add_button( FL_RETURN_BUTTON, ( box_w - but_w ) / 2, box_h - h_but - 20, but_w, h_but + 10, "Ok" ); fl_set_form_hotobject( fdui->form, fdui->but ); fl_set_object_lstyle( fdui->but, style ); fl_set_object_lsize( fdui->but, size ); fl_end_form( ); fl_register_raw_callback( fdui->form, FL_ALL_EVENT, fli_goodies_preemptive ); fl_set_form_atclose( fdui->form, fl_goodies_atclose, fdui->but ); fli_inverted_y = oldy; fl_set_coordunit( oldu ); return fdui; } static FD_msg *fd_msg = NULL; /*************************************** ***************************************/ void fl_show_messages( const char *str ) { if ( ! str || ! * str ) { M_warn( "fl_show_messages", "NULL or empty string" ); return; } if ( fd_msg ) { fl_hide_form( fd_msg->form ); fl_free_form( fd_msg->form ); fli_safe_free( fd_msg ); } else fl_deactivate_all_forms( ); fd_msg = create_msg( str ); fl_show_form( fd_msg->form, FL_PLACE_HOTSPOT, FL_TRANSIENT, "Message" ); fl_update_display( 1 ); while ( fl_do_only_forms( ) != fd_msg->but ) /* empty */ ; fl_hide_form( fd_msg->form ); fl_free_form( fd_msg->form ); fli_safe_free( fd_msg ); fl_activate_all_forms( ); } /*************************************** ***************************************/ void fl_show_messages_f( const char * fmt, ... ) { char *buf; EXPAND_FORMAT_STRING( buf, fmt ); fl_show_messages( buf ); fl_free( buf ); } /*************************************** ***************************************/ void fl_show_message( const char * s1, const char * s2, const char * s3 ) { char *buf; size_t len; len = ( s1 ? strlen( s1 ) : 0 ) + 1 + ( s2 ? strlen( s2 ) : 0 ) + 1 + ( s3 ? strlen( s3 ) : 0 ) + 1; if ( len == 3 ) { M_warn( "fl_show_message", "Only NULL or empty strings" ); return; } buf = fl_malloc( len ); fli_snprintf( buf, len, "%s\n%s\n%s", s1 ? s1 : "", s2 ? s2 : "", s3 ? s3 : "" ); fl_show_messages( buf ); fl_free( buf ); } /*************************************** ***************************************/ void fl_hide_message( void ) { if ( fd_msg ) fl_trigger_object( fd_msg->but ); else M_warn( "fl_hide_message", "No message box is shown" ); } /*************************************** ***************************************/ void fli_msg_cleanup( void ) { fli_safe_free( fd_msg ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/chart.c0000664000175000017500000006110212353623325011776 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file chart.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * All chart objects. Absolutely needs prototypes for all * drawing functions. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "include/forms.h" #include "flinternal.h" #ifndef M_PI #define M_PI 3.14159265359 #endif #define ARCINC ( M_PI / 1800 ) #define MAX_CHART_LABEL_LEN 16 /* Object specific information */ typedef struct { float val; /* Value of the entry */ FL_COLOR col; /* Color of the entry */ FL_COLOR lcol; /* Label color of the entry */ char str[ MAX_CHART_LABEL_LEN ]; /* Label of the entry */ } ENTRY; typedef struct { float min, /* the boundaries */ max; int numb; /* number of entries */ int maxnumb; /* maximal number of entries to display */ int autosize; /* whether the x-axis should be scaled */ int lstyle, /* item label font style & size */ lsize; int x, /* drawing area */ y, w, h; FL_COLOR lcol; /* default label color */ ENTRY * entries; /* the entries */ int no_baseline; } FLI_CHART_SPEC; /*************************************** * Draws a bar chart. x,y,w,h is the bounding box, entries the array of * numb entries and min and max the boundaries. ***************************************/ static void draw_barchart( FL_OBJECT * ob, float min, float max ) { FLI_CHART_SPEC *sp = ob->spec; int x = sp->x, y = sp->y, w = sp->w, h = sp->h; int numb = sp->numb; int i, j, n; float bwidth; /* Width of a bar */ FL_Coord zeroh; /* Height of zero value */ FL_Coord val, xx, dx; float incr, /* Increment per unit value */ xfuzzy; float lh = fl_get_char_height( sp->lstyle, sp->lsize, &i, &j ); ENTRY *e, *es, *entries = sp->entries; int lbox; float fx; incr = h / ( max - min ); zeroh = y + h + min * incr; if ( -min * incr < lh ) { incr = ( h - lh ) / max; zeroh = y + h - lh; } bwidth = ( double ) w / ( sp->autosize ? numb : sp->maxnumb ); /* base line */ if( ! sp->no_baseline ) fl_line( x, zeroh + 0.5, x + w, zeroh + 0.5, ob->col2 ); if ( min == 0.0 && max == 0.0 ) return; /* Nothing else to draw */ /* Draw the bars */ n = 1; if ( ( xfuzzy = bwidth - ( FL_Coord ) bwidth ) != 0.0 ) n = 1.0 / xfuzzy + 2; for ( e = entries, xx = x, i = 0, es = e + numb; e < es; e++, i++ ) { dx = bwidth + ( i % n ) * xfuzzy; if ( e->val != 0.0 ) { val = e->val * incr; fl_rectbound( xx, zeroh - val, dx, val, e->col ); } xx += dx; } /* Draw the labels */ lbox = 0.8 * bwidth; for ( e = entries, es = e + numb, fx = x; e < es; fx += bwidth, e++ ) fl_draw_text_beside( FL_ALIGN_BOTTOM, fx + 0.5 * ( bwidth - lbox ), zeroh - lbox, lbox, lbox, e->lcol, sp->lstyle, sp->lsize, e->str ); } /*************************************** * Draws a horizontal bar chart. x,y,w,h is the bounding box, entries the * array of numb entries and min and max the boundaries. ***************************************/ static void draw_horbarchart( FL_OBJECT * ob, float min, float max ) { FLI_CHART_SPEC *sp = ob->spec; int x = sp->x, y = sp->y, w = sp->w, h = sp->h; int numb = sp->numb; float bwidth; /* Width of a bar */ float incr; /* Increment per unit value */ FL_Coord lw, /* Label width & Position of zero value */ zeroh, dy, yy; int i, l, n; float yfuzzy; char *s; ENTRY *e, *entries = sp->entries; int lbox; /* Compute maximal label width */ for ( lw = 0, i = 0; i < numb; i++ ) { s = entries[ i ].str; l = fl_get_string_width( sp->lstyle, sp->lsize, s, strlen( s ) ); if ( l > lw ) lw = l; } if ( lw > 0.0 ) lw = lw + 4.0; incr = ( float ) w / ( max - min ); zeroh = x - min * incr + 0.1; if ( -min * incr < lw ) { zeroh = x + lw; incr = ( w - lw ) / max; } bwidth = ( float ) h / ( sp->autosize ? numb : sp->maxnumb ); /* Draw base line */ if ( ! sp->no_baseline ) fl_line( zeroh + 0.5, y, zeroh + 0.5, y + h, ob->col2 ); if ( min == 0.0 && max == 0.0 ) return; /* Nothing else to draw */ /* Draw the bars. Need to take care of round-off errors */ yy = y; dy = bwidth; n = 2; if ( ( yfuzzy = bwidth - dy ) != 0 ) n = 1.0 / yfuzzy + 2; for ( e = entries + numb - 1, i = 0; i < numb; i++, e-- ) { dy = bwidth + ( i % n ) * yfuzzy; if ( e->val != 0.0 ) fl_rectbound( zeroh, yy, e->val * incr, dy, e->col ); yy += dy; } /* Draw the labels */ lbox = 0.8 * bwidth; for ( e = entries + numb - 1, i = 0; i < numb; i++, e-- ) fl_draw_text_beside( FL_ALIGN_LEFT, zeroh, y + i * bwidth + 0.5 * ( bwidth - lbox ), lbox, lbox, e->lcol, sp->lstyle, sp->lsize, e->str ); } /*************************************** * Draws a line chart ***************************************/ static void draw_linechart( FL_OBJECT * ob, float min, float max ) { FLI_CHART_SPEC *sp = ob->spec; int type = ob->type; int x = sp->x, y = sp->y, w = sp->w, h = sp->h; int i, numb = sp->numb; float ttt; float bwidth; /* distance between points */ float zeroh; /* Height of zero value */ float incr; /* Increment per unit value */ float lh = fl_get_char_height( sp->lstyle, sp->lsize, 0, 0 ); ENTRY *e, *es, *entries = sp->entries; float xx, /* tmp vars */ val1, val2, val3; int lbox; incr = ( h - 2 * lh ) / ( max - min ); zeroh = ( y + h ) - ( lh - min * incr ); bwidth = ( float ) w / ( sp->autosize ? numb : sp->maxnumb ); /* Draw the values */ for ( i = 0; i < numb; i++ ) { val3 = entries[ i ].val * incr; if ( type == FL_SPIKE_CHART ) { val1 = ( i + 0.5 ) * bwidth; fli_reset_vertex( ); fl_color( entries[ i ].col ); fli_add_float_vertex( x + val1, zeroh ); fli_add_float_vertex( x + val1, zeroh - val3 ); fli_endline( ); } else if ( type == FL_LINE_CHART && i != 0 ) { e = entries + i - 1; fli_reset_vertex( ); fl_color( e->col ); fli_add_float_vertex( x + ( i - 0.5 ) * bwidth, zeroh - e->val * incr ); fli_add_float_vertex( x + ( i + 0.5 ) * bwidth, zeroh - val3 ); fli_endline( ); } else if ( type == FL_FILLED_CHART && i != 0 ) { e = entries + i - 1; val1 = ( i - 0.5 ) * bwidth; val2 = ( i + 0.5 ) * bwidth; fli_reset_vertex( ); fl_color( e->col ); fli_add_float_vertex( x + val1, zeroh ); fli_add_float_vertex( x + val1, zeroh - e->val * incr ); if ( ( e->val > 0.0 && entries[ i ].val < 0.0 ) || ( e->val < 0.0 && entries[ i ].val > 0.0 ) ) { ttt = e->val / ( e->val - entries[ i ].val ); fli_add_float_vertex( x + ( i - 0.5 + ttt ) * bwidth, zeroh ); fli_add_float_vertex( x + ( i - 0.5 + ttt ) * bwidth, zeroh ); } fli_add_float_vertex( x + val2, zeroh - val3 ); fli_add_float_vertex( x + val2, zeroh ); fli_endpolygon( ); fli_reset_vertex( ); fl_color( FL_BLACK ); fli_add_float_vertex( x + val1, zeroh - e->val * incr ); fli_add_float_vertex( x + val2, zeroh - val3 ); fli_endline( ); } } /* Draw base line */ if ( ! sp->no_baseline ) fl_line( x, zeroh + 0.5, x + w, zeroh + 0.5, ob->col2 ); /* Draw the labels */ lbox = 0.8 * bwidth; xx = x + 0.5 * ( bwidth - lbox ); for ( e = entries, es = e + numb; e < es; e++, xx += bwidth ) { if ( e->val < 0.0 ) fl_draw_text_beside( FL_ALIGN_TOP, xx, zeroh - e->val * incr + 12, lbox, lbox, e->lcol, sp->lstyle, sp->lsize, e->str ); else fl_draw_text_beside( FL_ALIGN_BOTTOM, xx, zeroh - e->val * incr - 12 - lbox, lbox, lbox, e->lcol, sp->lstyle, sp->lsize, e->str ); } } /*************************************** * Draws a pie chart. x,y,w,h is the bounding box, entries the array of * numb entries ***************************************/ static void draw_piechart( FL_OBJECT * ob, int special ) { FLI_CHART_SPEC *sp = ob->spec; int x = sp->x, y = sp->y, w = sp->w, h = sp->h; int i, numb = sp->numb; float xc, /* center and radius */ yc, rad; float tot; /* sum of values */ float incr; /* increment in angle */ float curang; /* current angle we are drawing */ float xl, /* label position */ yl; float txc, /* temporary center */ tyc; float lh = fl_get_char_height( sp->lstyle, sp->lsize, 0, 0 ); int lbox; ENTRY *e, *entries = sp->entries; /* compute center and radius */ xc = x + w / 2; yc = y + h / 2; rad = h / 2 - lh; if ( special ) { yc += 0.1 * rad; rad = 0.9 * rad; } /* compute sum of values */ for ( tot = 0.0f, i = 0; i < numb; i++ ) if ( entries[ i ].val > 0.0 ) tot += entries[ i ].val; if ( tot == 0.0 ) return; incr = 3600.0 / tot; /* Draw the pie */ curang = 0.0; for ( e = entries, i = 0; i < numb; i++, e++ ) if ( e->val > 0.0 ) { float tt = incr * e->val; txc = xc; tyc = yc; /* Correct for special pies */ if ( special && i == 0 ) { txc += 0.2 * rad * cos( ARCINC * ( curang + tt * 0.5 ) ); tyc -= 0.2 * rad * sin( ARCINC * ( curang + tt * 0.5 ) ); } tt += curang; fl_arcf( txc, tyc, rad, curang, tt, e->col ); fl_arc( txc, tyc, rad, curang, tt, FL_BLACK ); fli_reset_vertex( ); fli_add_float_vertex( txc, tyc ); fli_add_float_vertex( txc + rad * cos( ARCINC * curang ), tyc - rad * sin( ARCINC * curang ) ); fli_endline( ); curang += 0.5 * incr * e->val; lbox = 16; /* draw the label */ xl = txc + 1.1 * rad * cos( ARCINC * curang ); yl = tyc - 1.1 * rad * sin( ARCINC * curang ); if ( xl < txc ) fl_draw_text_beside( FL_ALIGN_LEFT, xl, yl - 0.5 * lbox, lbox, lbox, e->lcol, sp->lstyle, sp->lsize, e->str ); else fl_draw_text_beside( FL_ALIGN_RIGHT, xl - lbox, yl - 0.5 * lbox, lbox, lbox, e->lcol, sp->lstyle, sp->lsize, e->str ); curang += 0.5 * incr * e->val; fli_reset_vertex( ); fli_add_float_vertex( txc, tyc ); fli_add_float_vertex( txc + rad * cos( ARCINC * curang ), tyc - rad * sin( ARCINC * curang ) ); fli_endline( ); } } /*************************************** * Draws a chart object ***************************************/ static void draw_chart( FL_OBJECT * ob ) { FLI_CHART_SPEC *sp = ob->spec; FL_Coord absbw = FL_abs( ob->bw ); float min = sp->min, max = sp->max; int i; /* Find bounding box */ sp->x = ob->x + 3 + 2 * absbw; sp->y = ob->y + 3 + 2 * absbw; sp->w = ob->w - 6 - 4 * absbw; sp->h = ob->h - 6 - 4 * absbw; /* Find bounds */ if ( min == max ) { min = max = sp->numb ? sp->entries[ 0 ].val : 0.0; for ( i = 0; i < sp->numb; i++ ) { if ( sp->entries[ i ].val < min ) min = sp->entries[ i ].val; if ( sp->entries[ i ].val > max ) max = sp->entries[ i ].val; } } /* min can equal to max if only one entry */ if ( min == max ) { min -= 1.0; max += 1.0; } /* Do the drawing */ fl_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); if ( sp->numb == 0 ) { fl_draw_text_beside( ob->align, ob->x, ob->y, ob->w, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); return; } fl_set_clipping( sp->x - 1, sp->y - 1, sp->w + 2, sp->h + 2 ); switch ( ob->type ) { case FL_BAR_CHART: draw_barchart( ob, min, max ); break; case FL_HORBAR_CHART: draw_horbarchart( ob, min, max ); break; case FL_PIE_CHART: draw_piechart( ob, 0 ); break; case FL_SPECIALPIE_CHART: draw_piechart( ob, 1 ); break; default: draw_linechart( ob, min, max ); break; } fl_unset_clipping( ); } /*************************************** * Handles an event, returns whether value has changed ***************************************/ static int handle_chart( FL_OBJECT * ob, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { #if FL_DEBUG >= ML_DEBUG M_info( "handle_chart", fli_event_name( event ) ); #endif switch ( event ) { case FL_DRAW: draw_chart( ob ); /* fall through */ case FL_DRAWLABEL: fl_draw_object_label( ob ); break; case FL_FREEMEM: if ( ( ( FLI_CHART_SPEC * ) ob->spec )->entries ) fl_free( ( ( FLI_CHART_SPEC * ) ob->spec )->entries ); fl_free( ob->spec ); break; } return FL_RETURN_NONE; } /*************************************** * creates a chart object ***************************************/ FL_OBJECT * fl_create_chart( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; FLI_CHART_SPEC *sp; int i; obj = fl_make_object( FL_CHART, type, x, y, w, h, label, handle_chart ); obj->boxtype = FL_CHART_BOXTYPE; obj->col1 = FL_CHART_COL1; obj->col2 = FL_BLACK; obj->align = FL_CHART_ALIGN; obj->lcol = FL_CHART_LCOL; obj->active = 0; sp = obj->spec = fl_calloc( 1, sizeof *sp ); sp->maxnumb = 512; sp->entries = fl_calloc( sp->maxnumb + 1, sizeof *sp->entries ); for ( i = 0; i <= sp->maxnumb; i++ ) sp->entries[ i ].val = 0.0; sp->autosize = 1; sp->min = sp->max = 0.0; sp->lsize = FL_TINY_SIZE; sp->lstyle = FL_NORMAL_STYLE; sp->lcol = FL_BLACK; return obj; } /*************************************** * Adds a chart object ***************************************/ FL_OBJECT * fl_add_chart( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj = fl_create_chart( type, x, y, w, h, label ); fl_add_object( fl_current_form, obj ); return obj; } /*************************************** ***************************************/ void fl_set_chart_lsize( FL_OBJECT * ob, int lsize ) { FLI_CHART_SPEC *sp = ob->spec; if ( sp->lsize != lsize ) { sp->lsize = lsize; fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_set_chart_lstyle( FL_OBJECT * ob, int lstyle ) { FLI_CHART_SPEC *sp = ob->spec; if ( sp->lstyle != lstyle ) { sp->lstyle = lstyle; fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_set_chart_lcolor( FL_OBJECT * ob, FL_COLOR lcol ) { FLI_CHART_SPEC *sp = ob->spec; if ( sp->lcol != lcol ) sp->lcol = lcol; } /*************************************** * Clears the contents of a chart ***************************************/ void fl_clear_chart( FL_OBJECT * ob ) { ( ( FLI_CHART_SPEC * ) ob->spec )->numb = 0; fl_redraw_object( ob ); } /*************************************** * Add an item to the chart. ***************************************/ void fl_add_chart_value( FL_OBJECT * ob, double val, const char * str, FL_COLOR col ) { FLI_CHART_SPEC *sp = ob->spec; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_CHART ) ) { M_err( "fl_add_chart_value", "%s not a chart", ob ? ob->label : "" ); return; } #endif /* Shift entries if required */ if ( sp->numb == sp->maxnumb ) { int i; for ( i = 0; i < sp->numb - 1; i++ ) sp->entries[ i ] = sp->entries[ i + 1 ]; sp->numb--; } /* Fill in the new entry */ sp->entries[ sp->numb ].val = val; sp->entries[ sp->numb ].col = col; sp->entries[ sp->numb ].lcol = sp->lcol; if ( str ) fli_sstrcpy( sp->entries[sp->numb ].str, str, MAX_CHART_LABEL_LEN ); else *sp->entries[sp->numb ].str = '\0'; sp->numb++; fl_redraw_object( ob ); } /*************************************** * Inserts an item before indx to the chart. ***************************************/ void fl_insert_chart_value( FL_OBJECT * ob, int indx, double val, const char * str, FL_COLOR col ) { FLI_CHART_SPEC *sp = ob->spec; int i; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_CHART ) ) { M_err( "fl_insert_chart_value", "%s not a chart", ob ? ob->label : "" ); return; } #endif if ( indx < 1 || indx > sp->numb + 1 ) return; /* Shift entries */ for ( i = sp->numb; i >= indx; i-- ) sp->entries[ i ] = sp->entries[ i - 1 ]; if ( sp->numb < sp->maxnumb ) sp->numb++; /* Fill in the new entry */ sp->entries[ indx - 1 ].val = val; sp->entries[ indx - 1 ].col = col; if ( str != NULL ) fli_sstrcpy( sp->entries[ indx - 1 ].str, str, MAX_CHART_LABEL_LEN ); else *sp->entries[ indx - 1 ].str = '\0'; fl_redraw_object( ob ); } /*************************************** * Replaces an item in the chart. ***************************************/ void fl_replace_chart_value( FL_OBJECT * ob, int indx, double val, const char * str, FL_COLOR col ) { FLI_CHART_SPEC *sp = ob->spec; if ( indx < 1 || indx > sp->numb ) return; sp->entries[ indx - 1 ].val = val; sp->entries[ indx - 1 ].col = col; if ( str ) fli_sstrcpy( sp->entries[ indx - 1 ].str, str, MAX_CHART_LABEL_LEN ); else *sp->entries[ indx - 1 ].str = '\0'; fl_redraw_object( ob ); } /*************************************** * Sets the boundaries in the value for the object ***************************************/ void fl_set_chart_bounds( FL_OBJECT * ob, double min, double max ) { FLI_CHART_SPEC *sp; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_CHART ) ) { M_err( "fl_set_chart_bounds", "%s not a chart", ob ? ob->label : "" ); return; } #endif sp = ob->spec; if ( sp->min != min || sp->max != max ) { sp->min = min; sp->max = max; fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_get_chart_bounds( FL_OBJECT * ob, double * min, double * max ) { FLI_CHART_SPEC *sp = ob->spec; *min = sp->min; *max = sp->max; } /*************************************** * Sets the maximal number of values displayed in the chart ***************************************/ void fl_set_chart_maxnumb( FL_OBJECT * ob, int maxnumb ) { FLI_CHART_SPEC *sp = ob->spec; int i, curmax; /* Fill in the new number */ if ( maxnumb < 0 ) { M_err( "fl_set_chart_maxnum", "Invalid maxnumb value" ); return; } if ( maxnumb == sp->maxnumb ) return; curmax = sp->maxnumb; if ( maxnumb > FL_CHART_MAX ) sp->maxnumb = FL_CHART_MAX; else sp->maxnumb = maxnumb; if ( sp->maxnumb > curmax ) { sp->entries = fl_realloc( sp->entries, ( sp->maxnumb + 1 ) * sizeof *sp->entries ); for ( i = curmax; i <= sp->maxnumb; i++ ) sp->entries[ i ].val = 0.0; } if ( ! sp->entries ) { sp->maxnumb = curmax; sp->entries = fl_calloc( curmax + 1, sizeof *sp->entries ); for ( i = 0; i <= curmax; i++ ) sp->entries[ i ].val = 0.0; return; } /* Shift entries if required */ if ( sp->numb > sp->maxnumb ) { for ( i = 0; i < maxnumb; i++ ) sp->entries[ i ] = sp->entries[ i + sp->numb - maxnumb ]; sp->numb = sp->maxnumb; fl_redraw_object( ob ); } } /*************************************** * Sets whether the chart should autosize along the x-axis ***************************************/ void fl_set_chart_autosize( FL_OBJECT * ob, int autosize ) { if ( ( ( FLI_CHART_SPEC * ) ob->spec )->autosize != autosize ) { ( ( FLI_CHART_SPEC * ) ob->spec )->autosize = autosize; fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_set_chart_baseline( FL_OBJECT * ob, int iYesNo ) { if ( ( ( FLI_CHART_SPEC * ) ob->spec )->no_baseline != !iYesNo ) { ( ( FLI_CHART_SPEC * ) ob->spec )->no_baseline = !iYesNo; fl_redraw_object( ob ); } } /*************************************** ***************************************/ #if 0 void fl_get_chart_area( FL_OBJECT * ob, int * x, int * y, int * w, int * h ) { FLI_CHART_SPEC *sp = ob->spec; *x = sp->x; *y = sp->y; *w = sp->w; *h = sp->h; } #endif /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/xforms.man0000644000175000017500000000715612235024225012544 00000000000000.\" .\" Man page for XFORMS. .\" Use the following command to generate viewable man page .\" .\" tbl xforms.5 | {nt}roff -man .\" .\" ul | more -fsk to view .\" .\" .TH XFORMS 5 "November 2013" "Version 1.2.0" "Forms Library" .SH NAME xforms \- A GUI Toolkit for X Window Systems .\" .\" setup .de Cr .ie n (c) .el \(co .. .SH SYNOPSIS .B Forms Library for X (xforms) is a GUI toolkit and builder for the X Window Systems and runs on all major UNIX platforms as well as OpenVMS and OS2. .B Forms Library is too complex to be described in the "man" page format. Ask your system administrator for the location of the HTML, PDF or PostScript document or follow the links on the .BR "Forms Library" 's home page for an online version of the documentation. .SH DESCRIPTION .B Forms Library is a graphical user interface toolkit based on Xlib for X Window Systems. It comes with a rich set of objects such as buttons, browsers, sliders and menus integrated into an elegant event/object callback execution model that allows fast and easy construction of X applications. In addition, the library has support for image read and write, format conversion and simple image processing. The library consists of a flexible set of C-routines that can be used in C and C++ programs (As of this writing, perl, ada95, pascal, scheme and Fortran bindings to the .B Forms Library are in beta.) The library is efficient and portable and runs on all major Unix platforms, including Sun, SGI, HP, DEC Alpha/OSF, IBM RS6000, Convex, Cray, Linux, FreeBSD, NetBSD, SCO, Unixware, OpenBSD , BSDi, DecSystem(mips)/Ultrix and others. Non-unix platforms include OpenVMS, OS/2, and Window/NT. Bundled with the library is also a Form designer, .I fdesign, which can be used to build interaction forms in a WYSIWYG (what you see is what you get) way and to generate the corresponding C (or any of the binding languages) code for you. 50+ demos in source code are distributed with the library. .SH OPTIONS All programs written using the .B Forms Library recognize the following command line options .TP 6 .BI \-display " host:dpy" specifies the server to connect to. .TP .BI \-bw " borderwidth" specifies the border width to use for built-in objects. .TP .B \-flversion prints the xforms version information. .TP .BI \-visual " visualName" requests a visual by name such as TrueColor etc. By default the .B Forms Library always selects the visual that has the most depth. .TP .BI \-depth " depth" requests a specific depth. .TP .BI \-fldebug " level" generates some info about the state of the .B XForms. where .I level is an integer between 1-5 and controls the amount of information to output. Depending on the options used when the .B Forms Library was built, a level more than 3 might not be available. .TP .B \-sync runs the application in synchronous mode with debug level set to 4. .TP .B \-private requests a private colormap for the application. .TP .B \-shared requests a shared colormap even if the application needs more colors than available. For those colors that can't be allocated in the shared colormap, substitutions are made so the closest matching color is used. .TP .B \-stdcmap requests a standard colormap. .TP .B \-name " newname" specifies the application name under which resources are to be obtained, rather than the default executable file name. .B .SH SEE ALSO fdesign(1L), fd2ps(1L) .SH AUTHOR Copyright .Cr 1996-2002 T.C. Zhao, Mark Overmars and Steve Lamont .br Since 2002: GNU Lesser General Public License .br Maintainers: Jean-Marc Lasgouttes, Angus Leeming, Jens Thoms Toerring .SH HOME PAGE http://xforms-toolkit.org .br http://savannah.nongnu.org/projects/xforms/ xforms-1.2.4/lib/bitmap.c0000664000175000017500000003055612353623325012162 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file bitmap.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * FL_BITMAP & FL_BITMAPBUTTON class. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" /*************************************** ***************************************/ static void free_bitmap( FL_BUTTON_STRUCT * p ) { if ( p->pixmap ) XFreePixmap( flx->display, p->pixmap ); p->pixmap = None; } /******************************************************************** * static bitmap ******************************************************************{*/ static void drawit( Window win, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_Coord src_x, FL_Coord src_y, FL_COLOR fcol, FL_COLOR bcol, Pixmap bitmap ) { FL_Coord clip_x, clip_y, clip_w, clip_h; /* Get the currently set clipping */ if ( fl_get_clipping( 1, &clip_x, &clip_y, &clip_w, &clip_h ) ) { if ( w <= 0 || h <= 0 ) return; /* If the bitmap is not within the clipping region nothing is to be drawn */ if ( x + w < clip_x || x > clip_x + clip_w || y + h < clip_y || y > clip_y + clip_h ) return; /* If the bitmap isn't completely within the clipping region recalculate what to draw */ if ( x <= clip_x || x + w >= clip_x + clip_w || y <= clip_y || y + h >= clip_y + clip_h ) { if ( x < clip_x ) { src_x += clip_x - x; w -= clip_x - x; x = clip_x; } if ( x + w > clip_x + clip_w ) w = clip_x + clip_w - x; if ( y < clip_y ) { src_y += clip_y - y; h -= clip_y - y; y = clip_y; } if ( y + h > clip_y + clip_h ) h = clip_y + clip_h - y; } } fl_color( fcol ); fl_bk_color( bcol ); XCopyPlane( flx->display, bitmap, win, flx->gc, src_x, src_y, w, h, x, y, 1 ); } /*************************************** ***************************************/ static void draw_bitmap( FL_OBJECT * obj ) { FL_BUTTON_STRUCT *sp = obj->spec; FL_Coord xx, /* position of bitmap */ yy; /* Draw the box */ fl_draw_box( obj->boxtype, obj->x, obj->y, obj->w, obj->h, obj->col1, obj->bw ); /* Do nothing for empty data */ if ( sp->bits_w == 0 || ! sp->pixmap ) return; /* Calculate position so the bitmap is centered */ xx = obj->x + ( obj->w - sp->bits_w ) / 2; yy = obj->y + ( obj->h - sp->bits_h ) / 2; drawit( FL_ObjWin( obj ), xx, yy, sp->bits_w, sp->bits_h, 0, 0, obj->lcol, obj->col1, sp->pixmap ); } /*************************************** * Handles an event, returns whether value has changed. ***************************************/ static int handle_bitmap( FL_OBJECT * obj, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { switch ( event ) { case FL_DRAW : draw_bitmap( obj ); /* fall through */ case FL_DRAWLABEL : fl_draw_object_label( obj ); break; case FL_FREEMEM : free_bitmap( obj->spec ); fl_free( obj->spec ); break; } return FL_RETURN_NONE; } /*************************************** * Creates an object ***************************************/ FL_OBJECT * fl_create_bitmap( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; FL_BUTTON_STRUCT *sp; obj = fl_make_object( FL_BITMAP, type, x, y, w, h, label, handle_bitmap ); obj->boxtype = FL_BITMAP_BOXTYPE; obj->col1 = FL_BITMAP_COL1; obj->col2 = FL_BITMAP_COL2; obj->lcol = FL_BITMAP_LCOL; obj->align = FL_BITMAP_ALIGN; obj->active = type != FL_NORMAL_BITMAP; sp = obj->spec = fl_calloc( 1, sizeof *sp ); sp->pixmap = sp->mask = sp->focus_pixmap = sp->focus_mask = None; sp->cspecv = NULL; sp->filename = sp->focus_filename = NULL; return obj; } /*************************************** * Adds an object ***************************************/ FL_OBJECT * fl_add_bitmap( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj = fl_create_bitmap( type, x, y, w, h, label ); fl_add_object( fl_current_form, obj ); return obj; } /*************************************** * Fills the bitmap with a bitmap. ***************************************/ void fl_set_bitmap_data( FL_OBJECT * obj, int w, int h, unsigned char * data ) { FL_BUTTON_STRUCT *sp; Pixmap p; if ( obj == NULL || obj->objclass != FL_BITMAP ) return; /* Only occurs with fdesign -convert */ if ( ! flx->display ) return; sp = obj->spec; p = XCreateBitmapFromData( flx->display, FL_ObjWin( obj ) ? FL_ObjWin( obj ) : fl_root, ( char * ) data, w, h ); if ( p == None ) { M_err( "fl_set_bitmap_data", "Can't create bitmap" ); return; } sp->bits_w = w; sp->bits_h = h; sp->pixmap = p; fl_redraw_object( obj ); } /*************************************** ***************************************/ Pixmap fl_read_bitmapfile( Window win, const char * file, unsigned int * w, unsigned int * h, int * hotx, int * hoty ) { Pixmap p = None; int status; status = XReadBitmapFile( flx->display, win, ( char * ) file, w, h, &p, hotx, hoty ); if ( status != BitmapSuccess ) M_err( "fl_read_bitmapfile", "%s: %s", file, status == BitmapFileInvalid ? "Invalid file" : "Can't read" ); return p; } /*************************************** ***************************************/ void fl_set_bitmap_file( FL_OBJECT * obj, const char * fname ) { unsigned int w, h; int xhot, yhot; Pixmap p; if ( ! flx->display ) return; if ( ! obj || ( obj->objclass != FL_BITMAP && obj->objclass != FL_BITMAPBUTTON ) ) { M_err( "fl_set_bitmap_file", "object %s not bitmap or bitmap button", ( obj && obj->label ) ? obj->label : "null" ); return; } p = fl_read_bitmapfile( FL_ObjWin( obj ) ? FL_ObjWin( obj ) : fl_root, fname, &w, &h, &xhot, &yhot ); if ( p != None ) { FL_BUTTON_STRUCT *sp = obj->spec; free_bitmap( sp ); sp->pixmap = p; sp->bits_w = w; sp->bits_h = h; } fl_redraw_object( obj ); } /***** End of static BITMAP ************************/ /******************************************************************* * BITMAP buttons ****************************************************************{*/ /*************************************** ***************************************/ static void draw_bitmapbutton( FL_OBJECT * obj ) { FL_BUTTON_STRUCT *sp = obj->spec; fli_draw_button( obj ); if ( sp->pixmap != None && sp->bits_w > 0 && sp->bits_h > 0 ) { int dest_x, dest_y, dest_w, dest_h, src_x, src_y; FL_COLOR col; /* Make sure the bitmap gets clipped to the maximum size fitting into the button */ if ( obj->w - 2 * FL_abs( obj->bw ) > ( int ) sp->bits_w ) { dest_x = obj->x + ( obj->w - sp->bits_w ) / 2; dest_w = sp->bits_w; src_x = 0; } else { dest_x = obj->x + FL_abs( obj->bw ); dest_w = obj->w - 2 * FL_abs( obj->bw ); src_x = ( sp->bits_w - dest_w ) / 2; } if ( obj->h - 2 * FL_abs( obj->bw ) > ( int ) sp->bits_h ) { dest_y = obj->y + ( obj->h - sp->bits_h ) / 2; dest_h = sp->bits_h; src_y = 0; } else { dest_y = obj->y + FL_abs( obj->bw ); dest_h = obj->h - 2 * FL_abs( obj->bw ); src_y = ( sp->bits_h - dest_h ) / 2; } col = sp->val ? obj->col2 : obj->col1; if ( obj->belowmouse && col == FL_BUTTON_COL1 ) col = FL_BUTTON_MCOL1; if ( obj->belowmouse && col == FL_BUTTON_COL2 ) col = FL_BUTTON_MCOL2; drawit( FL_ObjWin( obj ), dest_x, dest_y, dest_w, dest_h, src_x, src_y, obj->lcol, col, sp->pixmap ); } fl_draw_object_label( obj ); } /*************************************** ***************************************/ FL_OBJECT * fl_create_bitmapbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; fl_add_button_class( FL_BITMAPBUTTON, draw_bitmapbutton, 0 ); obj = fl_create_generic_button( FL_BITMAPBUTTON, type, x, y, w, h, label ); obj->boxtype = FL_BITMAPBUTTON_BOXTYPE; obj->col1 = FL_BITMAPBUTTON_COL1; obj->col2 = FL_BITMAPBUTTON_COL2; obj->align = FL_BITMAPBUTTON_ALIGN; obj->lcol = FL_BITMAP_LCOL; return obj; } /*************************************** ***************************************/ FL_OBJECT * fl_add_bitmapbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj = fl_create_bitmapbutton( type, x, y, w, h, label ); fl_add_object( fl_current_form, obj ); return obj; } /*************************************** ***************************************/ void fl_set_bitmapbutton_data( FL_OBJECT * obj, int w, int h, unsigned char * bits ) { FL_BUTTON_STRUCT *sp; Window win; if ( ! obj || obj->objclass != FL_BITMAPBUTTON ) return; win = FL_ObjWin( obj ) ? FL_ObjWin( obj ) : fl_root; sp = obj->spec; free_bitmap( sp ); sp->bits_w = w; sp->bits_h = h; sp->pixmap = XCreateBitmapFromData( flx->display, win, ( char * ) bits, sp->bits_w, sp->bits_h ); fl_redraw_object( obj ); } /*************************************** ***************************************/ Pixmap fl_create_from_bitmapdata( Window win, const char * data, int width, int height ) { return XCreateBitmapFromData( fl_display, win, data, width, height ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/child.c0000644000175000017500000002100712251554321011752 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file child.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" /*************************************** ***************************************/ void fl_add_child( FL_OBJECT * parent, FL_OBJECT * child ) { FL_OBJECT *t; /* If the child is already linked to a form that is not the one of the parent unlink it from that form and then add it to the parents form (if the parent already belongs to one) */ if ( child->form && child->form != parent->form ) fl_delete_object( child ); if ( ! child->form && parent->form ) fl_add_object( parent->form, child ); /* Now set up the parent-child relationship */ child->parent = parent; /* Child gets same gravity and resize attributes as the parent */ child->nwgravity = parent->nwgravity; child->segravity = parent->segravity; child->resize = parent->resize; /* Append the new child to the linked list of objects that are children of the parent */ if ( parent->child == NULL ) parent->child = child; else { for ( t = parent->child; t->nc; t = t->nc ) /* empty */ ; t->nc = child; } /* If the child itself has children set their gravity and resizing behaviour to that of the parent */ if ( ! child->child ) { parent = child; for ( child = child->child; child; child = child->nc ) { fli_set_composite_gravity( child, parent->nwgravity, parent->segravity ); fli_set_composite_resize( child, parent->resize ); } } } /*************************************** * Adds all children of an object to its form ***************************************/ void fli_add_composite( FL_OBJECT * obj ) { FL_FORM *form = obj->form; FL_OBJECT *tmp; for ( tmp = obj->child; tmp; tmp = tmp->nc ) { tmp->parent = obj; fl_add_object( form, tmp ); } } /*************************************** * Inserts all children of a object before the object 'before' ***************************************/ void fli_insert_composite( FL_OBJECT * obj, FL_OBJECT * before ) { FL_OBJECT *tmp; for ( tmp = obj->child; tmp; tmp = tmp->nc ) { tmp->parent = obj; fli_insert_object( tmp, before ); } } /*************************************** * Unlinks all children of an object from its form ***************************************/ void fli_delete_composite( FL_OBJECT * obj ) { for ( obj = obj->child; obj; obj = obj->nc ) if ( obj->form ) fl_delete_object( obj ); } /*************************************** * Irrevocably deletes all children of an object ***************************************/ void fli_free_composite( FL_OBJECT * obj ) { FL_OBJECT *next, *parent = obj; for ( obj = obj->child; obj; obj = next ) { next = obj->nc; fl_free_object( obj ) ; } parent->child = NULL; } /*************************************** ***************************************/ void fli_show_composite( FL_OBJECT * obj ) { for ( obj = obj->child; obj; obj = obj->nc ) fli_show_object( obj ); } /*************************************** ***************************************/ void fli_hide_composite( FL_OBJECT * obj, Region * reg ) { for ( obj = obj->child; obj; obj = obj->nc ) { if ( obj->child ) fli_hide_composite( obj, reg ); fli_hide_and_get_region( obj, reg ); } } /*************************************** ***************************************/ void fli_activate_composite( FL_OBJECT * ob ) { for ( ob = ob->child; ob; ob = ob->nc ) { if ( ob->child ) fli_activate_composite( ob ); ob->active = 1; } } /*************************************** ***************************************/ void fli_deactivate_composite( FL_OBJECT * ob ) { for ( ob = ob->child; ob; ob = ob->nc ) { if ( ob->child ) fli_deactivate_composite( ob ); ob->active = 0; } } /*************************************** ***************************************/ void fli_set_composite_resize( FL_OBJECT * obj, unsigned int resize ) { for ( obj = obj->child; obj; obj = obj->nc ) { if ( obj->child ) fli_set_composite_resize( obj, resize ); obj->resize = resize; } } /*************************************** * Sets the gravity property for the children of an object * (and their children in turn) ***************************************/ void fli_set_composite_gravity( FL_OBJECT * obj, unsigned int nw, unsigned int se ) { for ( obj = obj->child; obj; obj = obj->nc ) { if ( obj->child ) fli_set_composite_gravity( obj, nw, se ); obj->nwgravity = nw; obj->segravity = se; } } /*************************************** ***************************************/ void fli_composite_has_been_resized( FL_OBJECT * obj ) { for ( obj = obj->child; obj; obj = obj->nc ) { if ( obj->child ) fli_composite_has_been_resized( obj ); fli_handle_object( obj, FL_RESIZED, 0, 0, 0, NULL, 0 ); } } /*************************************** * Inserts a composite object into a form after object 'after' ***************************************/ void fli_insert_composite_after( FL_OBJECT * obj, FL_OBJECT * after ) { FL_OBJECT *next, *tmp, *prev; FL_FORM *form; if ( ! obj || ! after ) { M_err( "fli_insert_composite_after", "Bad argument" ); return; } if ( ! ( form = after->form ) ) { M_err( "fli_insert_composite_after", "Null form" ); return; } obj->form = form; next = after->next; after->next = obj; obj->prev = after; obj->next = obj->child; obj->next->prev = obj; prev = obj; for ( tmp = obj->child; tmp->nc; prev = tmp, tmp = tmp->nc ) { tmp->parent = obj; tmp->form = form; tmp->next = tmp->nc; tmp->prev = prev; } tmp->next = next; tmp->prev = prev; tmp->form = form; if ( form->last == after ) form->last = tmp; } /*************************************** ***************************************/ FL_OBJECT * fl_get_object_component( FL_OBJECT * composite, int objclass, int type, int numb ) { FL_OBJECT *tmp; int n; for ( n = 0, tmp = composite->child; tmp; tmp = tmp->nc ) if ( tmp->objclass == objclass && ( tmp->type == type || type < 0 ) ) { if ( ++n >= numb ) return tmp; } M_err( "fl_get_object_component", "Requested object not found" ); return NULL; } /*************************************** * copy the parent attributes. gravity stuff is taken care of by * fl_add_child() ***************************************/ void fli_inherit_attributes( FL_OBJECT * parent, FL_OBJECT * child ) { child->bw = parent->bw; child->lcol = parent->lcol; child->col1 = parent->col1; child->lsize = parent->lsize; child->lstyle = parent->lstyle; if ( ! child->child ) return; parent = child; for ( child = child->child; child; child = child->nc ) fli_inherit_attributes( parent, child ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/colsel.c0000644000175000017500000001110712251554301012146 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file colsel.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Select a color */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" typedef struct { FL_FORM * colorform; FL_OBJECT * col[ 64 ]; FL_OBJECT * next, * prev, * cancel; FL_OBJECT * cindex; } COLSEL; static COLSEL colsel; static COLSEL *cs = &colsel; /*************************************** ***************************************/ static void create_colorform( void ) { int i, j; if ( cs->colorform ) return; cs->colorform = fl_bgn_form( FL_UP_BOX, 240, 220 ); for ( i = 0; i < 8; i++ ) for ( j = 0; j < 8; j++ ) { cs->col[ 8 * i + j ] = fl_add_button( FL_NORMAL_BUTTON, 40 + j * 20, 10 + i * 20, 20, 20, "" ); fl_set_object_boxtype( cs->col[ 8 * i + j ], FL_BORDER_BOX ); fl_set_object_lcolor( cs->col[ 8 * i + j ], 7 ); } cs->prev = fl_add_button( FL_NORMAL_BUTTON, 10, 10, 30, 160, "@4" ); cs->next = fl_add_button( FL_NORMAL_BUTTON, 200, 10, 30, 160, "@6" ); cs->cancel = fl_add_button( FL_NORMAL_BUTTON, 80, 180, 140, 30, "Cancel" ); cs->cindex = fl_add_text( FL_NORMAL_TEXT, 5, 180, 70, 30, "Cancel" ); fl_set_object_lsize( cs->cindex,FL_TINY_SIZE ); fl_end_form( ); } extern int flrectboundcolor; /*************************************** * initializes the colors ***************************************/ static void init_colors( int cc, int thecol ) { int i; const char *cn; fl_freeze_form( cs->colorform ); for ( i = 0; i < 64; i++ ) { fl_set_object_color( cs->col[ i ], cc + i, cc + i ); fl_set_object_label( cs->col[ i ], "" ); if ( thecol == cc + i ) fl_set_object_label( cs->col[ i ], "@9plus" ); } cn = fli_query_colorname( thecol ); fl_set_object_label( cs->cindex, cn + ( cn[ 0 ] == 'F' ? 3 : 0 ) ); fl_unfreeze_form( cs->colorform ); } /*************************************** ***************************************/ static int atclose( FL_FORM * form, void * ev FL_UNUSED_ARG ) { fl_trigger_object( form->u_vdata ); return FL_IGNORE; } /*************************************** * Shows a colormap color selector from which the user can select a color. ***************************************/ int fl_show_colormap( int oldcol ) { FL_OBJECT *ob; int i, cc, ready = 0, thecol; int s = flrectboundcolor; flrectboundcolor = FL_BOTTOM_BCOL; if ( oldcol == FL_NoColor ) oldcol = FL_COL1; cc = 64 * ( oldcol / 64 ); thecol = oldcol; create_colorform( ); cs->colorform->u_vdata = cs->cancel; fl_set_form_atclose( cs->colorform, atclose, 0 ); init_colors( cc, thecol ); fl_set_object_color( cs->cancel, thecol, thecol ); fl_deactivate_all_forms( ); fl_show_form( cs->colorform, FL_PLACE_ASPECT, FL_TRANSIENT, "Colormap" ); while ( ! ready ) { ob = fl_do_only_forms( ); if ( ob == cs->prev && cc >= 64 ) { cc -= 64; init_colors( cc, thecol ); } else if ( ob == cs->next && cc + 64 < FL_MAX_COLS ) { cc += 64; init_colors( cc, thecol ); } else if ( ob == cs->cancel ) ready = 1; else for ( i = 0; i < 64; i++ ) if ( ob == cs->col[ i ] ) { ready = 1; thecol = cc + i; } } fl_hide_form( cs->colorform ); fl_activate_all_forms( ); flrectboundcolor = s; return thecol; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/xtext.c0000664000175000017500000010236412353623326012060 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file xtext.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * All text routines. There are rooms for speed ups. For one, font * switching can be reduced somewhat. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include #include static int UL_thickness = -1; static int UL_propwidth = 1; /* 1 for proportional, 0 for constant */ static void do_underline( FL_Coord, FL_Coord, const char *, int ); static void do_underline_all( FL_Coord, FL_Coord, const char *, int, unsigned long *, unsigned long * ); #define NUM_LINES_INCREMENT 64 static struct LINE_INFO { char * str; int len; int index; int underline_index; int x; int y; } * lines = NULL; static int nlines; static int max_pixelline = 0; /*************************************** ***************************************/ static int extend_workmem( int nl ) { lines = fl_realloc( lines, nl * sizeof *lines ); return nlines = nl; } /*************************************** ***************************************/ void fli_free_xtext_workmem( void ) { fli_safe_free( lines ); nlines = 0; } /*************************************** * Returns the index of the widest line drawn in a previous * call of fli_draw_string() (only used by input.c) ***************************************/ int fli_get_max_pixels_line( void ) { return max_pixelline; } /* type fitting both XDrawString() and XDrawImageString() */ typedef int ( * DrawString )( Display * display, Drawable d, GC gc, int x, int y, const char * string, int length ); /*************************************** * Major text drawing routine. It draws text (possibly consisting of several * lines) into the box specified via the coordinates and using the given * alignment relative to that box. Also a cursor is drawn. For lines that * contain a special character indicating underlining this is also handled. * Finally, parts of the text can be shown as selected. * * Arguments: * align Alignment of the text relative to the box * x, ym w, h postion and size of box * clip 0 = no clipping is to be used at all * 1 = clipping is to be done by this function * -1 = clipping is done but already has been set externally * backcol color to be used for selected text * forecol color for (unselected) text * curscol color for cursor * style text font style * size text font size * curspos index into string where cursor is to be drawn (if negative or * non-zero and there's no text no cursor is drawn) * selstart index into string where selection starts * selend index into string where selection ends (to get selection this * must be larger than 'selstart') * istr pointer to the text to be drawn * img if non-zero also draw background (use XDrawImageString() * instead of XDrawString() to draw the text) * topline first line of the text to be actually shown (counting starts * at 1) * endline last line to be shown (if less than 1 or too large is replaced * by the number of lines in the text) * bkcol background color (used when 'img' is true) * * Returns the width (in pixel) of the widest line of the text drawn. ***************************************/ int fli_draw_string( int align, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int clip, FL_COLOR backcol, FL_COLOR forecol, FL_COLOR curscol, int style, int size, int curspos, int selstart, int selend, const char * istr, int img, int topline, int endline, FL_COLOR bkcol ) { int i; int lnumb = 0; /* number of lines in string */ int max_pixels = 0; int horalign, vertalign; char * str = NULL, * p = NULL; DrawString drawIt = img ? XDrawImageString : XDrawString; /* Check if anything has to be drawn at all - do nothing if we either have no window or the cursor is to be drawn somewhere else than in the very first position and there's no string to output. It would be tempting to also bail out if the height 'h' is 0 or even negative but there are some code paths were this actually may happen and we wouldn't output a string even though it is needed (I know, it's a bloody mess but fixing it right now would probably take a few weeks and even might break existing code...) */ if ( flx->win == None || ( curspos > 0 && ! ( istr && *istr ) ) ) return 0; /* We operate only on a copy of the input string */ if ( istr && *istr ) p = str = fl_strdup( istr ); /* Split the string into lines, store the index where each of them begins in the original string as well as the length */ while ( p ) { /* Make sure we have enough memory */ if ( lnumb >= nlines ) extend_workmem( nlines + NUM_LINES_INCREMENT ); /* Get pointer to the start of the line and it's index in the complete string */ lines[ lnumb ].str = p; lines[ lnumb ].index = p - str; /* where line begins in str */ /* Try to find the next new line and replace the '\n' with '\0' */ if ( ( p = strchr( p, '\n' ) ) ) *p++ = '\0'; /* Calculate the length of the string */ lines[ lnumb ].len = p ? ( p - lines[ lnumb ].str - 1 ) : ( int ) strlen( lines[ lnumb ].str ); ++lnumb; } /* Correct values for the top and end line to be shown (they are given starting at 1) */ if ( --topline < 0 || topline >= lnumb ) topline = 0; if ( --endline >= lnumb || endline < 0 ) endline = lnumb; /* Calculate coordinates of all lines (for y the baseline position), for that make sure the correct font is set up */ fl_set_font( style, size ); fli_get_hv_align( align, &horalign, &vertalign ); for ( i = topline; i < endline; i++ ) { struct LINE_INFO *line = lines + i; int width; /* Check for the special character which indicates underlining (all the line if it's in the very first position, otherwise just after the character to underline), remove it from the string but remember were it was and correct the selection positions if necessary (i.e. if they are in the line after the character to be underlined). Same for the cursor position if it's in the line. */ if ( ( p = strchr( line->str, *fl_ul_magic_char ) ) ) { line->underline_index = p - line->str; if ( selstart < line->index + line->len && selstart > line->index + line->underline_index ) --selstart; if ( selend < line->index + line->len && selend > line->index + line->underline_index ) --selend; if ( curspos >= line->index + line->underline_index && selstart < line->index + line->len ) --curspos; memmove( p, p + 1, line->len-- - line->underline_index ); } else line->underline_index = -1; /* Determine the width (in pixel) of the line) */ width = XTextWidth( flx->fs, line->str, line->len ); if ( width > max_pixels ) { max_pixels = width; max_pixelline = i; } /* Calculate the x- and y- positon of where to print the text */ switch ( horalign ) { case FL_ALIGN_LEFT : line->x = x; break; case FL_ALIGN_CENTER : line->x = x + 0.5 * ( w - width ); break; case FL_ALIGN_RIGHT : line->x = x + w - width; break; default : M_err( "fli_draw_string", "This is impossible" ); return 0; } switch ( vertalign ) { case FL_ALIGN_TOP : line->y = y + i * flx->fheight + flx->fasc; break; case FL_ALIGN_CENTER : line->y = y + 0.5 * h + ( i - 0.5 * lnumb ) * flx->fheight + flx->fasc; break; case FL_ALIGN_BOTTOM : line->y = y + h - 1 + ( i - lnumb ) * flx->fheight + flx->fasc; break; default : M_err( "fli_draw_string", "This is impossible" ); return 0; } } /* Set clipping if we got asked to */ if ( clip > 0 ) fl_set_text_clipping( x, y, w, h ); /* Set foreground and background color for text */ fli_textcolor( forecol ); fli_bk_textcolor( bkcol ); /* Draw all the lines requested */ for ( i = topline; i < endline; i++ ) { struct LINE_INFO *line = lines + i; FL_COLOR underline_col = forecol; int xsel = 0, /* start position of selected text */ wsel = 0; /* and its length (in pixel) */ /* Skip lines that can't be visile due to clipping */ if ( clip != 0 ) { if ( line->y + flx->fdesc < y ) continue; if ( line->y - flx->fasc >= y + h ) break; } /* Draw the text */ drawIt( flx->display, flx->win, flx->textgc, line->x, line->y, line->str, line->len ); /* Draw selection area if required - for this we need to draw the selection background and then redraw the text in this region (in the clor that was used for the background before). Of course all this only needs to be done if the selection started before or in this line and didn't end before it. */ if ( selstart < selend && selstart <= line->index + line->len && selend > line->index ) { int start, /* start index of selected text */ end, /* end index */ len; /* its length (in chars) */ /* The selection may have started before the line we're just dealing with and may end after it. Find the start and end position in this line */ if ( selstart <= line->index ) start = 0; else start = selstart - line->index; if ( selend >= line->index + line->len ) end = line->len; else end = selend - line->index; len = end - start; /* Get the start position and width (in pixels) of the selected region (the -1 in the calculation of wsel is a fudge factor to make it look a bit better) */ xsel = line->x + XTextWidth( flx->fs, line->str, start ); wsel = XTextWidth( flx->fs, line->str + start, len ) - 1; if ( xsel + wsel > x + w ) wsel = x + w - xsel; /* Draw in the selection color */ fl_rectf( xsel, line->y - flx->fasc, wsel, flx->fheight, forecol ); fli_textcolor( backcol ); drawIt( flx->display, flx->win, flx->textgc, xsel, line->y, line->str + start, len ); fli_textcolor( forecol ); if ( line->underline_index > 0 ) underline_col = backcol; } /* Next do underlining */ if ( line->underline_index > 0 ) { fl_color( underline_col ); do_underline( line->x, line->y, line->str, line->underline_index - 1 ); } else if ( line->underline_index == 0 ) { unsigned long offset, thickness; fl_color( forecol ); do_underline_all( line->x, line->y, line->str, line->len, &offset, &thickness ); /* If wsel is larger than 0 some part of the underlined string is selected and then we need to draw underine of the part of the string that is selected in the color used for drawing that part of the string. */ if ( wsel > 0 && thickness > 0 ) { fl_color( underline_col ); XFillRectangle( flx->display, flx->win, flx->gc, xsel, line->y + offset, wsel, thickness); } } /* Finally, we also may have to draw a cursor */ if ( curspos >= line->index && curspos <= line->index + line->len ) { int tt = XTextWidth( flx->fs, line->str, curspos - line->index ); fl_rectf( line->x + tt, line->y - flx->fasc, 2, flx->fheight, curscol ); } } /* One possiblity remains: there's no text but the cursor is to be set at the very first position */ if ( curspos == 0 && lnumb == 0 && w >= 2 ) { int xc, yc; if ( horalign == FL_ALIGN_LEFT ) xc = x; else if ( horalign == FL_ALIGN_CENTER ) xc = x + 0.5 * w - 1; else xc = x + w - 2; if ( vertalign == FL_ALIGN_BOTTOM ) yc = y + h - 1 - flx->fasc; else if ( vertalign == FL_ALIGN_CENTER ) yc = y + 0.5 * ( h - flx->fheight ); else yc = y; fl_rectf( xc, yc, 2, flx->fheight, curscol ); } /* Free our copy of the string */ fli_safe_free( str ); /* Reset clipping if required */ if ( clip > 0 ) fl_unset_text_clipping( ); return max_pixels; } /*************************************** * Function returns the index of the character in the label of the object * the mouse is over or -1 if it's not over the label. Note that the function * has some limitations: it can only be used on labels inside of the object * and the label string may not contain underline characters (and the label * can't be a symbol) - if you try to use it on labels that don't satisfy * these requirements -1 is returned. ***************************************/ int fl_get_label_char_at_mouse( FL_OBJECT * obj ) { int x, y, xp, yp, pos, outside; unsigned int dummy; if ( ! obj || ! obj->form || ! fl_is_inside_lalign( obj->align ) || ! obj->label || ! *obj->label || strchr( obj->label, *fl_ul_magic_char ) || ( obj->label[ 0 ] == '@' && obj->label[ 1 ] != '@' ) ) return -1; if ( fl_get_form_mouse( obj->form, &x, &y, &dummy ) != obj->form->window || x < obj->x || x >= obj->x + obj->w || y < obj->y || y >= obj->y + obj->h ) return -1; x += 2; pos = fli_get_pos_in_string( obj->align, obj->x, obj->y, obj->w, obj->h, obj->lstyle, obj->lsize, x, y, obj->label, &xp, &yp, &outside ) - 1; if ( outside ) return -1; return pos; } /*************************************** * Routine returns the index of the character the mouse is on in a string * via the return value and the line number and character position in the * line via 'yp' and 'xp' (note: they count starting at 1, 0 indicates the * mouse is to the left of the start of the line) * The function expects a string that doesn't contain mon-printable characters * (except '\n' for starts a new lines) * This function is supposed to work on text drawn using fli_draw_string() * using the same relevant arguments (alignment, box, font style and size * and string) as passed to this function. * * Arguments: * align: alignment of the text in the box * x, y, w, h: box the text is to be found in * style: font style used when drawing the text * size: font size used when drawing the text * xpos: x-position of the mouse * ypos: y-position of the mouse * str: pointer to the text itself * xp: pointer for returning the index in the line where the mouse is * (tarts at 1 with 0 meaning before the start of the string) * yp: pointer for returning the line number (starting at 1) * outside: set if the mouse wasn't directly within the string ***************************************/ int fli_get_pos_in_string( int align, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, int style, int size, FL_Coord xpos, FL_Coord ypos, const char * str, int * xp, int * yp, int * outside ) { int lnumb = 0; /* number of lines */ int horalign, vertalign; struct LINE_INFO * line; int width; /* string width of that line... */ int xstart; /* start x-coordinate of this line */ int toppos; /* y-coord of the top line */ const char *p = str; int xlen; int fheight; int dummy; /* Give the user some slack in hitting the mark - he might try to place the cursor between two characters and accidentally has the mouse a bit too far to the right. */ xpos -= 2; *outside = 0; /* Nothing to be done if there's no string */ if ( ! str || ! *str ) return 0; /* No need to actually set the font (we're not drawing anything), all required is its height */ fheight = fl_get_char_height( style, size, &dummy, &dummy ); /* Find all the lines starts etc. in the string */ while ( p ) { if ( lnumb + 1 >= nlines ) extend_workmem( nlines + NUM_LINES_INCREMENT ); lines[ lnumb ].str = ( char * ) p; lines[ lnumb++ ].index = p - str; if ( ( p = strchr( p, '\n' ) ) ) ++p; } /* Find the line in which the mouse is */ fli_get_hv_align( align, &horalign, &vertalign ); switch ( vertalign ) { case FL_ALIGN_TOP : toppos = y; break; case FL_ALIGN_CENTER : toppos = y + 0.5 * ( h - lnumb * fheight ); break; case FL_ALIGN_BOTTOM : toppos = y + h - 1 - fheight; break; default : M_err( "fli_get_pos_in_string", "This is impossible" ); return 0; } *yp = ( ypos - toppos ) / fheight; if ( *yp < 0 ) { *outside = 1; *yp = 0; } else if ( *yp >= lnumb ) { *outside = 1; *yp = lnumb - 1; } line = lines + *yp; if ( *yp == lnumb - 1 ) line->len = strlen( line->str ); else line->len = lines[ *yp + 1 ].str - line->str - 1; /* Calculate width and start x-coordinate of the line */ width = XTextWidth( flx->fs, line->str, line->len ); switch ( horalign ) { case FL_ALIGN_LEFT : xstart = x; break; case FL_ALIGN_CENTER : xstart = x + 0.5 * ( w - width ); break; case FL_ALIGN_RIGHT : xstart = x + w - width; break; default : M_err( "fli_get_pos_in_string", "This is impossible" ); return 0; } xpos -= xstart; /* If the mouse is before or behind the string things are simple.... */ if ( xpos <= 0 ) { *xp = 0; *yp += 1; *outside = 1; return line->index; } else if ( xpos >= width ) { *xp = line->len; *yp += 1; *outside = 1; return line->index + line->len; } /* ...otherwise take a guess at the offset in the string where the mouse is, assuming all chars have the same width */ *xp = ( double ) ( xpos * line->len ) / width; xlen = XTextWidth( flx->fs, line->str, ++*xp ); /* If we don't have hit it directly search to the left or right */ if ( xlen > xpos ) { do { *xp -= 1; xlen = XTextWidth( flx->fs, line->str, *xp ); } while ( *xp > 0 && xlen > xpos ); *xp += 1; } else if ( xlen < xpos ) do { *xp += 1; xlen = XTextWidth( flx->fs, line->str, *xp ); } while ( *xp < lines->len && xlen < xpos ); *yp += 1; return line->index + *xp; } /*** Miscellaneous text drawing routines ***/ /*************************************** * Draw text with cursor and, if 'bk' is set, also the background * (but with no highlighting) ***************************************/ static void fli_draw_text_cursor( int align, /* alignment in box */ FL_Coord x, /* box geometry */ FL_Coord y, FL_Coord w, FL_Coord h, const char * str, /* string to draw */ int style, /* font style and size */ int size, FL_COLOR c, /* color for text */ FL_COLOR bc, /* background color */ FL_COLOR cc, /* color for cursor */ int bk, /* draws background when set */ int pos ) /* index of cursor position */ { fli_draw_string( align, x, y, w, h, 0, FL_NOCOLOR, c, cc, style, size, pos, 0, -1, str, bk, 0, 0, bc ); } /*************************************** * Draws a (multi-line) text with a cursor (no background, no highlighting) ***************************************/ void fl_draw_text_cursor( int align, /* alignment in box */ FL_Coord x, /* box geometry */ FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR c, /* text color */ int style, /* font style and size */ int size, const char * str, /* the text to draw */ FL_COLOR cc, /* cursor color */ int pos ) /* cursor position */ { fli_draw_text_cursor( align, x, y, w, h, str, style, size, c, FL_NOCOLOR, cc, 0, pos ); } /*************************************** ***************************************/ #define D( x, y, c ) \ fli_draw_text_cursor( align, x, y, w, h, str, \ style,size, c, bc, 0, bk, -1 ) void fli_draw_text_inside( int align, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * str, int style, int size, FL_COLOR c, FL_COLOR bc, int bk ) { int special = 0; int xoff, yoff; int sw = w, sh = h, sx = x, sy = y; if ( ! str || ! *str ) return; if ( str[ 0 ] == '@' && str[ 1 ] != '@' ) { if ( w < 5 && h < 5 ) { sw = sh = 6 + 1.1 * size; sx -= sw / 2; sy -= sh / 2; } if ( fl_draw_symbol( str, sx, sy, sw, sh, c ) ) return; else str++; } else if ( str[ 0 ] == '@' && str[ 1 ] == '@' ) str++; xoff = 5; yoff = 4; x += xoff; w -= 2 * xoff; y += yoff; h -= 2 * yoff; if ( special_style( style ) ) { special = ( style / FL_SHADOW_STYLE ) * FL_SHADOW_STYLE; style %= FL_SHADOW_STYLE; } /* Take care of special effects stuff */ if ( special == FL_SHADOW_STYLE ) D( x + 2, y + 2, FL_BOTTOM_BCOL ); else if ( special == FL_ENGRAVED_STYLE ) { D( x - 1, y, FL_RIGHT_BCOL ); D( x, y - 1, FL_RIGHT_BCOL ); D( x - 1, y - 1, FL_RIGHT_BCOL ); D( x + 1, y, FL_TOP_BCOL ); D( x, y + 1, FL_TOP_BCOL ); D( x + 1, y + 1, FL_TOP_BCOL ); } else if ( special == FL_EMBOSSED_STYLE ) { D( x - 1, y, FL_TOP_BCOL ); D( x, y - 1, FL_TOP_BCOL ); D( x - 1, y - 1, FL_TOP_BCOL ); D( x + 1, y, FL_RIGHT_BCOL ); D( x, y + 1, FL_RIGHT_BCOL ); D( x + 1, y + 1, FL_RIGHT_BCOL ); } fli_draw_text_cursor( align, x, y, w, h, str, style, size, c, bc, FL_NOCOLOR, special ? 0 : bk, -1 ); } /*************************************** * Draws a text inside a box. ***************************************/ void fl_draw_text( int align, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR c, int style, int size, const char * str ) { fli_draw_text_inside( align, x, y, w, h, str, style, size, c, 0, 0 ); } /*************************************** ***************************************/ void fl_draw_text_beside( int align, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR c, int style, int size, const char * str ) { int newa, newx, newy, dx = 0, dy = 0; if ( ! str || ! *str || w <= 0 || h <= 0 ) return; if ( fl_is_inside_lalign( align ) && ! fl_is_center_lalign( align ) ) M_warn( "drw_text_beside", "align request is inside" ); if ( align & FL_ALIGN_LEFT ) { if ( align & FL_ALIGN_BOTTOM || align & FL_ALIGN_TOP ) dx = - 4; else dx = 1; } else if ( align & FL_ALIGN_RIGHT ) { if ( align & FL_ALIGN_BOTTOM || align & FL_ALIGN_TOP ) dx = 4; else dx = - 1; } if ( align & FL_ALIGN_BOTTOM ) dy = - 2; else if ( align & FL_ALIGN_TOP ) dy = 2; x += dx; y += dy; fli_get_outside_align( align, x, y, w, h, &newa, &newx, &newy ); fl_draw_text( newa, newx, newy, w, h, c, style, size, str ); } /*************************************** * Do underlined text, single character only * if underline width to be proportional or fixed width ***************************************/ void fli_set_ul_property( int prop, int thickness ) { UL_propwidth = prop; if ( thickness > 0 ) UL_thickness = thickness; } #define DESC( c ) ( c == 'g' || c == 'j' || c == 'q' || c == 'y' || c == 'p' ) #define NARROW( c ) ( c == 'i' || c == 'j' || c == 'l' || c == 'f' || c == '1' ) /*************************************** ***************************************/ XRectangle * fli_get_underline_rect( XFontStruct * fs, FL_Coord x, FL_Coord y, const char * cstr, int n ) { static XRectangle xr; int ul_width, ul_rwidth, xoff; unsigned long ul_pos, ul_thickness = 0; char *str = ( char * ) cstr; int ch = *( str + n ); int pre; /* stuff in front of the string, such as ^H */ if ( UL_thickness < 0 ) XGetFontProperty( flx->fs, XA_UNDERLINE_THICKNESS, &ul_thickness ); else ul_thickness = UL_thickness; if ( ul_thickness == 0 || ul_thickness > 100 ) ul_thickness = strstr( fli_curfnt, "bold" ) ? 2 : 1; if ( ! XGetFontProperty( fs, XA_UNDERLINE_POSITION, &ul_pos ) ) ul_pos = DESC( ch ) ? ( 1 + flx->fdesc ) : 1; /* If the character is narrow, use the width of g otherwise use the width of D. Of course, if UL_width == proportional, this really does not matter */ ul_width = XTextWidth( fs, NARROW( ch ) ? "h" : "D", 1 ); ul_rwidth = XTextWidth( fs, str + n, 1 ); pre = str[ 0 ] == *fl_ul_magic_char; xoff = fli_get_string_widthTABfs( fs, str + pre, n - pre ); /* Try to center the underline on the correct character */ if ( UL_propwidth ) x = x + xoff; else x = x + xoff + ( ul_rwidth - ul_width ) / 2; xr.x = x; xr.y = y + ul_pos; xr.width = UL_propwidth ? ul_rwidth : ul_width; xr.height = ul_thickness; return &xr; } /*************************************** ***************************************/ static void do_underline( FL_Coord x, FL_Coord y, const char * cstr, int n ) { XRectangle *xr = fli_get_underline_rect( flx->fs, x, y, cstr, n ); if ( flx->win == None || xr->width <= 0 || xr->height <= 0 ) return; XFillRectangle( flx->display, flx->win, flx->gc, xr->x, xr->y, xr->width, xr->height ); } #define has_desc( s ) ( strchr( s, 'g' ) \ || strchr( s, 'j' ) \ || strchr( s, 'q' ) \ || strchr( s, 'y' ) \ || strchr( s, 'p' ) ) /*************************************** * Underline whole string ***************************************/ static void do_underline_all( FL_Coord x, FL_Coord y, const char * str, int n, unsigned long * ul_pos, unsigned long * ul_thickness ) { int ul_width; if ( flx->win == None ) return; if ( UL_thickness < 0 ) XGetFontProperty( flx->fs, XA_UNDERLINE_THICKNESS, ul_thickness ); else *ul_thickness = UL_thickness; if ( *ul_thickness == 0 || *ul_thickness > 100 ) *ul_thickness = strstr( fli_curfnt, "bold" ) ? 2 : 1; if ( ! XGetFontProperty( flx->fs, XA_UNDERLINE_POSITION, ul_pos ) ) *ul_pos = has_desc( str ) ? ( 1 + flx->fdesc ) : 1; ul_width = XTextWidth( flx->fs, str, n ); /* Draw it */ if ( ul_width > 0 && *ul_thickness > 0 ) XFillRectangle( flx->display, flx->win, flx->gc, x, y + *ul_pos, ul_width, *ul_thickness ); } /*************************************** * Draw a single line string possibly with embedded tabs ***************************************/ int fli_draw_stringTAB( Window win, GC gc, int x, int y, int style, int size, const char * s, int len, int img ) { int w, tab; const char *p, *q; XFontStruct *fs = fl_get_font_struct( style, size ); DrawString drawIt = img ? XDrawImageString : XDrawString; if ( win == 0 ) return 0; tab = fli_get_tabpixels( fs ); XSetFont( flx->display, gc, fs->fid ); for ( w = 0, q = s; *q && ( p = strchr( q, '\t' ) ) && p - s < len; q = p + 1 ) { drawIt( flx->display, win, gc, x + w, y, ( char * ) q, p - q ); w += XTextWidth( fs, q, p - q ); w = ( w / tab + 1 ) * tab; } drawIt( flx->display, win, gc, x + w, y, ( char * ) q, s - q + len ); return 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/tbox.c0000664000175000017500000020151612353623326011657 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/pbrowser.h" #include #include #include #include #define TOP_MARGIN 1 #define RIGHT_MARGIN 2 #define BOTTOM_MARGIN 1 #define LEFT_MARGIN 3 /* must be at least 1 for selection box */ static int handle_tbox( FL_OBJECT *, int, FL_Coord, FL_Coord, int, void * ); static GC create_gc( FL_OBJECT *, int, int, FL_COLOR, int, int, int, int ); /*************************************** * Creates a new textbox object ***************************************/ FL_OBJECT * fli_create_tbox( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; FLI_TBOX_SPEC *sp; obj = fl_make_object( FL_TBOX, type, x, y, w, h, label, handle_tbox ); obj->boxtype = FLI_TBOX_BOXTYPE; obj->lcol = FLI_TBOX_LCOL; obj->col1 = FLI_TBOX_COL1; obj->col2 = FLI_TBOX_COL2; obj->align = FLI_TBOX_ALIGN; obj->wantkey = FL_KEY_SPECIAL; obj->want_update = 0; obj->spec = sp = fl_malloc( sizeof *sp ); sp->x = 0; sp->y = 0; sp->w = 0; sp->h = 0; sp->attrib = 1; sp->no_redraw = 0; sp->lines = NULL; sp->num_lines = 0; sp->callback = NULL; sp->xoffset = 0; sp->yoffset = 0; sp->max_width = 0; sp->max_height = 0; sp->def_size = fli_cntl.browserFontSize ? fli_cntl.browserFontSize : FLI_TBOX_FONTSIZE; sp->def_style = FL_NORMAL_STYLE; sp->def_align = FL_ALIGN_LEFT; sp->def_height = 0; sp->defaultGC = None; sp->backgroundGC = None; sp->selectGC = None; sp->nonselectGC = None; sp->bw_selectGC = None; sp->specialkey = '@'; sp->select_line = -1; sp->deselect_line = -1; sp->react_to_vert = sp->react_to_hori = 1; /* Per default the object never gets returned, user must change that */ fl_set_object_return( obj, FL_RETURN_NONE ); return obj; } /*************************************** * Deletes a line from the textbox ***************************************/ void fli_tbox_delete_line( FL_OBJECT * obj, int line ) { FLI_TBOX_SPEC *sp = obj->spec; int recalc_max_width = 0; int i; /* If line number is invalid do nothing */ if ( line < 0 || line >= sp->num_lines ) return; if ( sp->select_line == line ) sp->select_line = -1; else if ( sp->select_line > line ) sp->select_line--; if ( sp->deselect_line == line ) sp->deselect_line = -1; else if ( sp->deselect_line > line ) sp->deselect_line--; /* Check if recalculation of maximum line length is necessary */ if ( sp->max_width == sp->lines[ line ]->w ) recalc_max_width = 1; /* Set vertical position of following lines */ for ( i = line + 1; i < sp->num_lines; i++ ) sp->lines[ i ]->y -= sp->lines[ line ]->h; sp->max_height -= sp->lines[ line ]->h; /* Get rid of special GC for the line */ if ( sp->lines[ line ]->specialGC ) { XFreeGC( flx->display, sp->lines[ line ]->specialGC ); sp->lines[ line ]->specialGC = None; } /* Deallocate memory for the text of the line to delete */ fli_safe_free( sp->lines[ line ]->fulltext ); /* Get rid of memory for the structure */ fl_free( sp->lines[ line ] ); /* Move pointers to following line structures one up */ if ( --sp->num_lines != line ) memmove( sp->lines + line, sp->lines + line + 1, ( sp->num_lines - line ) * sizeof *sp->lines ); /* Reduce memory for array of structure pointers */ sp->lines = fl_realloc( sp->lines, sp->num_lines * sizeof *sp->lines ); /* If necessary find remaining longest line */ if ( recalc_max_width ) { sp->max_width = 0; for ( i = 0; i < sp->num_lines; i++ ) sp->max_width = FL_max( sp->max_width, sp->lines[ i ]->w ); /* Correct x offset if necessary */ if ( sp->max_width <= sp->w ) sp->xoffset = 0; else if ( sp->xoffset > sp->max_width - sp->w ) sp->xoffset = sp->max_width - sp->w; } /* Check that offset is still reasonable */ if ( sp->num_lines == 0 ) sp->yoffset = 0; else if ( sp->lines[ sp->num_lines - 1 ]->y + sp->lines[ sp->num_lines - 1 ]->h < sp->yoffset + sp->h ) { int old_no_redraw = sp->no_redraw; sp->no_redraw = 1; fli_tbox_set_bottomline( obj, sp->num_lines - 1 ); sp->no_redraw = old_no_redraw; } if ( ! sp->no_redraw ) fl_redraw_object( obj ); } /*************************************** * Inserts one or more lines, separated by * linefeed characters, into the textbox ***************************************/ void fli_tbox_insert_lines( FL_OBJECT * obj, int line, const char * new_text ) { char *text = fl_strdup( new_text ); char *p = text; char *del; while ( 1 ) { ; if ( ( del = strchr( p, '\n' ) ) ) *del = '\0'; fli_tbox_insert_line( obj, line++, p ); if ( del ) p = del + 1; else break; } fl_free( text ); } /*************************************** * Inserts a single line into the textbox ***************************************/ void fli_tbox_insert_line( FL_OBJECT * obj, int line, const char * new_text ) { FLI_TBOX_SPEC *sp = obj->spec; char *text; char *p; int done = 0; char *e; int is_bold = 0; int is_italic = 0; TBOX_LINE *tl; int i; /* Catch invalid 'line' or 'new_text' argument */ if ( line < 0 || ! new_text ) return; /* If 'line' is too large correct that by appending to the end */ if ( line >= sp->num_lines ) line = sp->num_lines; /* Make sure the lines marked as selected and deselected remain unchanged */ if ( sp->select_line >= line ) sp->select_line++; if ( sp->deselect_line >= line ) sp->deselect_line++; /* Make a copy of the text of the line */ p = text = strdup( new_text ); /* Get memory for one more line */ sp->lines = fl_realloc( sp->lines, ++sp->num_lines * sizeof *sp->lines ); /* If necessary move all following lines one down */ if ( line < sp->num_lines - 1 ) memmove( sp->lines + line + 1, sp->lines + line, ( sp->num_lines - line - 1 ) * sizeof *sp->lines ); sp->lines[ line ] = tl = fl_malloc( sizeof **sp->lines ); /* Set up defaults for the line */ tl->fulltext = NULL; tl->text = NULL; tl->len = 0; tl->selected = 0; tl->selectable = 1; tl->is_separator = 0; tl->is_underlined = 0; tl->x = 0; tl->w = 0; tl->h = sp->def_size; tl->size = sp->def_size; tl->style = sp->def_style; tl->align = sp->def_align; tl->color = obj->lcol; tl->is_special = 0; tl->specialGC = None; tl->incomp_esc = 0; /* Check for flags at the start of the line. When we're done 'p' will points to the start of the string to be shown in the textbox. */ while ( *p && *p == sp->specialkey && ! done ) { if ( p[ 1 ] == sp->specialkey ) { p += 1; break; } switch ( p [ 1 ] ) { case '\0' : tl->incomp_esc = 1; done = 1; break; case 'h' : tl->size = FL_HUGE_SIZE; p += 2; break; case 'l' : tl->size = FL_LARGE_SIZE; p += 2; break; case 'm' : tl->size = FL_MEDIUM_SIZE; p += 2; break; case 's' : tl->size = FL_SMALL_SIZE; p += 2; break;; case 'L' : tl->size += 6; p += 2; break; case 'M' : tl->size += 4; p += 2; break; case 'S' : tl->size -= 2; p += 2; break; case 'b' : tl->style |= FL_BOLD_STYLE; is_bold = 1; p += 2; break; case 'i' : tl->style |= FL_ITALIC_STYLE; is_italic = 1; p += 2; break; case 'n' : tl->style = FL_NORMAL_STYLE; if ( is_bold ) tl->style |= FL_BOLD_STYLE; if ( is_italic ) tl->style |= FL_ITALIC_STYLE; p += 2; break; case 'f' : tl->style = FL_FIXED_STYLE; if ( is_bold ) tl->style |= FL_BOLD_STYLE; if ( is_italic ) tl->style |= FL_ITALIC_STYLE; p += 2; break; case 't' : tl->style = FL_TIMES_STYLE; if ( is_bold ) tl->style |= FL_BOLD_STYLE; if ( is_italic ) tl->style |= FL_ITALIC_STYLE; p += 2; break; case 'c' : tl->align = FL_ALIGN_CENTER; p += 2; break; case 'r' : tl->align = FL_ALIGN_RIGHT; p += 2; break; case '_' : tl->is_underlined = 1; p += 2; break; case '-' : sp->lines[ line ]->is_separator = 1; sp->lines[ line ]->selectable = 0; done = 1; break; case 'N' : sp->lines[ line ]->selectable = 0; tl->color = FL_INACTIVE; p += 2; break; case 'C' : tl->color = strtol( p + 2, &e, 10 ); if ( e == p + 2 ) { if ( p[ 2 ] == '\0' ) tl->incomp_esc = 1; else M_err( "fli_tbox_insert_line", "missing color" ); p += 1; break; } if ( tl->color >= FL_MAX_COLS ) { M_err( "fli_tbox_insert_line", "bad color %ld", tl->color ); tl->color = obj->lcol; } p = e; break; case ' ' : p += 2; break; default : M_err( "fli_tbox_insert_line", "bad flag %c", p[ 1 ] ); p += 1; done = 1; break; } } tl->fulltext = text; if ( ! tl->is_separator ) tl->text = p; else tl->text = tl->fulltext + strlen( tl->fulltext ); tl->len = strlen( tl->text ); /* Figure out width and height of string */ if ( ! tl->is_separator && *tl->text ) { tl->w = fl_get_string_widthTAB( tl->style, tl->size, tl->text, tl->len ); tl->h = fl_get_string_height( tl->style, tl->size, tl->len ? tl->text : " " , tl->len | 1, &tl->asc, &tl->desc ); } else { tl->w = 0; tl->h = fl_get_string_height( tl->style, tl->size, "X", 1, &tl->asc, &tl->desc ); } /* If the new line is longer than all others we need to recalculate the horizontal position of all lines that aren't left aligned */ if ( tl->w > sp->max_width ) { sp->max_width = tl->w; for ( i = 0; i < sp->num_lines; i++ ) if ( fl_is_center_lalign( sp->lines[ i ]->align ) ) sp->lines[ i ]->x = ( sp->max_width - sp->lines[ i ]->w ) / 2; else if ( fl_to_outside_lalign( sp->lines[ i ]->align ) == FL_ALIGN_RIGHT ) sp->lines[ i ]->x = sp->max_width - sp->lines[ i ]->w; } else { if ( fl_is_center_lalign( tl->align ) ) tl->x = ( sp->max_width - tl->w ) / 2; else if ( fl_to_outside_lalign( tl->align ) == FL_ALIGN_RIGHT ) tl->x = sp->max_width - tl->w; } /* Calculate the vertical position of the line, shifting that of lines that may come afterwards */ if ( sp->num_lines == 1 ) tl->y = 0; else if ( line == sp->num_lines - 1 ) tl->y = sp->lines[ line - 1 ]->y + sp->lines[ line - 1 ]->h; else { tl->y = sp->lines[ line + 1 ]->y; for ( i = line + 1; i < sp->num_lines; i++ ) sp->lines[ i ]->y += tl->h; } sp->max_height += tl->h; /* Set flag if the line isn't to be drawn in default style, size and color. We don't create a GC yet since this might be called before the textbox is visible! */ if ( tl->style != sp->def_style || tl->size != sp->def_size || ( tl->color != obj->lcol && tl->selectable ) ) tl->is_special = 1; if ( ! sp->no_redraw ) fl_redraw_object( obj ); } /*************************************** * Appends a line to the end of the textbox ***************************************/ void fli_tbox_add_line( FL_OBJECT * obj, const char * text, int show ) { FLI_TBOX_SPEC *sp = obj->spec; fli_tbox_insert_lines( obj, sp->num_lines, text ); /* Make last line visible if asked for */ if ( show && sp->num_lines ) { TBOX_LINE *tl = sp->lines[ sp->num_lines - 1 ]; if ( tl->y + tl->h - sp->yoffset >= sp->h ) fli_tbox_set_bottomline( obj, sp->num_lines - 1 ); } } /************************************** * Appends characters to the last line * in the textbox **************************************/ void fli_tbox_add_chars( FL_OBJECT * obj, const char * add ) { FLI_TBOX_SPEC *sp = obj->spec; TBOX_LINE *tl; int new_len; char *old_fulltext; char * old_text; char *new_text; char *del; /* If there's nothing to add return */ if ( ! add || ! *add ) return; /* If there aren't any lines yet it's equivalent to inserting a new one */ if ( sp->num_lines == 0 ) { fli_tbox_insert_lines( obj, sp->num_lines, add ); return; } tl = sp->lines[ sp->num_lines - 1 ]; /* If there's no text or the line has an incomplete escape sequence that possibly could become completed due to the new text assemble the text of the line from the old text and the new text, delete te old line and then draw a new one in its place. Another question is how to deal with situations where, by a previous call with e.g. "@C3", a color was selected and in the next call the string to be added starts with a digit, let's say '7'. One possibility would be to re-evaluate the combined string to mean "@C37", setting a different color. But since in older versions this didn't happen (and some users may rely on this), it is assumed that this isn't the users intention and to avoid the two digits to become collated and interpreted as the number of a different color "@ " is inserted in between the digits, with "@ " treated as a separator between digits (the intended use of "@ " is to allow lines like "@C3@ 2. Chapter", i. e. having a color specification, followed by printable text that starts with a digit). */ if ( tl->len == 0 || tl->incomp_esc ) { int old_no_redraw = sp->no_redraw; size_t old_len = strlen( tl->fulltext ); size_t len = strlen( add ) + 1; int insert = tl->len == 0 && old_len > 0 && isdigit( tl->fulltext[ old_len - 1 ] ) && isdigit( *add ) ? 2 : 0; new_text = fl_malloc( old_len + len + insert ); if ( old_len ) { memcpy( new_text, tl->fulltext, old_len ); if ( insert ) memcpy( new_text + old_len, "@ ", 2 ); } memcpy( new_text + old_len + insert, add, len ); sp->no_redraw = 1; fli_tbox_delete_line( obj, sp->num_lines - 1 ); fli_tbox_insert_lines( obj, sp->num_lines, new_text ); sp->no_redraw = old_no_redraw; fl_free( new_text ); return; } /* Append everything to the last line up to a linefeed */ if ( ( del = strchr( add, '\n' ) ) ) { new_text = fl_malloc( del - add + 1 ); memcpy( new_text, add, del - add ); new_text[ del - add ] = '\0'; } else new_text = ( char * ) add; /* Make up the new text of the line from the old and the new text */ new_len = strlen( tl->fulltext ) + strlen( new_text ) + 1; old_text = tl->text; old_fulltext = tl->fulltext; tl->fulltext = fl_malloc( new_len + 1 ); strcpy( tl->fulltext, old_fulltext ); strcat( tl->fulltext, new_text ); tl->text = tl->fulltext + ( old_text - old_fulltext ); tl->len = strlen( tl->text ); //new_len; fli_safe_free( old_fulltext ); /* Text of a separator line never gets shown */ if ( tl->is_separator ) return; /* Figure out the new length of the line */ if ( *tl->text ) tl->w = fl_get_string_widthTAB( tl->style, tl->size, tl->text, tl->len ); /* If line is now longer than all others we need to recalculate the horizontal position of all lines that aren't left aligned */ if ( tl->w > sp->max_width ) { int i; sp->max_width = tl->w; for ( i = 0; i < sp->num_lines; i++ ) if ( fl_is_center_lalign( sp->lines[ i ]->align ) ) sp->lines[ i ]->x = ( sp->max_width - sp->lines[ i ]->w ) / 2; else if ( fl_to_outside_lalign( sp->lines[ i ]->align ) == FL_ALIGN_RIGHT ) sp->lines[ i ]->x = sp->max_width - sp->lines[ i ]->w; } else { if ( fl_is_center_lalign( tl->align ) ) tl->x = ( sp->max_width - tl->w ) / 2; else if ( fl_to_outside_lalign( tl->align ) == FL_ALIGN_RIGHT ) tl->x = sp->max_width - tl->w; } /* If there was no newline in the string to be appended we're done, otherwise the remaining stuff has to be added as new lines */ if ( ! del ) { TBOX_LINE *tl = sp->lines[ sp->num_lines - 1 ]; if ( tl->y + tl->h - sp->yoffset >= sp->h ) fli_tbox_set_bottomline( obj, sp->num_lines - 1 ); } else { fl_free( new_text ); fli_tbox_add_line( obj, del + 1, 1 ); } } /********************************* * Replaces a line in the textbox *********************************/ void fli_tbox_replace_line( FL_OBJECT * obj, int line, const char * text ) { FLI_TBOX_SPEC *sp = obj->spec; int old_select_line = sp->select_line; int old_no_redraw = sp->no_redraw; if ( line < 0 || line >= sp->num_lines || ! text ) return; sp->no_redraw = 1; fli_tbox_delete_line( obj, line ); sp->no_redraw = old_no_redraw; fli_tbox_insert_line( obj, line, text ); if ( line == old_select_line && sp->lines[ line ]->selectable ) fli_tbox_select_line( obj, line ); } /************************************* * Removes all lines from the textbox *************************************/ void fli_tbox_clear( FL_OBJECT * obj ) { FLI_TBOX_SPEC *sp = obj->spec; int i; sp->select_line = sp->deselect_line = -1; if ( sp->num_lines == 0 ) return; for ( i = 0; i < sp->num_lines; i++ ) { if ( sp->lines[ i ]->specialGC ) { XFreeGC( flx->display, sp->lines[ i ]->specialGC ); sp->lines[ i ]->specialGC = None; } fli_safe_free( sp->lines[ i ]->fulltext ); fli_safe_free( sp->lines[ i ] ); } fli_safe_free( sp->lines ); sp->num_lines = 0; sp->max_width = 0; sp->max_height = 0; sp->xoffset = 0; sp->yoffset = 0; if ( ! sp->no_redraw ) fl_redraw_object( obj ); } /*********************************************** * Loads all lines from a file into the textbox ***********************************************/ int fli_tbox_load( FL_OBJECT * obj, const char * filename ) { FLI_TBOX_SPEC *sp = obj->spec; FILE *fp; char *text; char *del; /* Load the file */ if ( ! filename || ! *filename ) return 0; if ( ! ( fp = fopen( filename, "r" ) ) ) return 0; while ( ( text = fli_read_line( fp ) ) && *text ) { int old_no_redraw = sp->no_redraw; /* Get rid of linefeed at end of line */ if ( ( del = strrchr( text, '\n' ) ) ) *del = '\0'; sp->no_redraw = 1; fli_tbox_insert_line( obj, sp->num_lines, text ); sp->no_redraw = old_no_redraw; fl_free( text ); } fli_safe_free( text ); fclose( fp ); if ( ! sp->no_redraw ) fl_redraw_object( obj ); return 1; } /************************************ * Returns the text of a line in the * textbox (including flags) ************************************/ const char * fli_tbox_get_line( FL_OBJECT * obj, int line ) { FLI_TBOX_SPEC *sp = obj->spec; if ( line < 0 || line >= sp->num_lines ) return NULL; return sp->lines[ line ]->fulltext; } /************************************* * Sets a new font size for all lines * drawn with default settings *************************************/ void fli_tbox_set_fontsize( FL_OBJECT * obj, int size ) { FLI_TBOX_SPEC *sp = obj->spec; double old_xrel; double old_yrel; int old_no_redraw = sp->no_redraw; int i; if ( size < FL_TINY_SIZE || size > FL_HUGE_SIZE ) return; sp->def_size = size; sp->attrib = 1; if ( sp->num_lines == 0 ) return; old_xrel = fli_tbox_get_rel_xoffset( obj ); old_yrel = fli_tbox_get_rel_yoffset( obj ); /* Calculate width and height for all lines */ for ( i = 0; i < sp->num_lines; i++ ) { TBOX_LINE *tl = sp->lines[ i ]; if ( tl->is_special ) continue; tl->size = size; /* Figure out width and height of string */ if ( ! tl->is_separator && *tl->text ) { tl->w = fl_get_string_widthTAB( tl->style, tl->size, tl->text, tl->len ); tl->h = fl_get_string_height( tl->style, tl->size, tl->len ? tl->text : " ", tl->len | 1, &tl->asc, &tl->desc ); } else { tl->w = 0; tl->h = fl_get_string_height( tl->style, tl->size, "X", 1, &tl->asc, &tl->desc ); } } /* Calculate vertical positions of all lines and maximum width */ sp->max_width = sp->lines[ 0 ]->w; for ( i = 1; i < sp->num_lines; i++ ) { sp->lines[ i ]->y = sp->lines[ i - 1 ]->y + sp->lines[ i - 1 ]->h; sp->max_width = FL_max( sp->max_width, sp->lines[ i ]->w ); } /* Determine new height of all the text */ sp->max_height = sp->lines[ sp->num_lines - 1 ]->y + sp->lines[ sp->num_lines - 1 ]->h; sp->no_redraw = 1; fli_tbox_set_rel_xoffset( obj, old_xrel ); fli_tbox_set_rel_yoffset( obj, old_yrel ); sp->no_redraw = old_no_redraw; } /************************************** * Sets a new font style for all lines * drawn with default settings **************************************/ void fli_tbox_set_fontstyle( FL_OBJECT * obj, int style ) { FLI_TBOX_SPEC *sp = obj->spec; double old_xrel; double old_yrel; int old_no_redraw = sp->no_redraw; int i; if ( style < FL_NORMAL_STYLE || style > FL_TIMESBOLDITALIC_STYLE ) return; sp->def_style = style; sp->attrib = 1; if ( sp->num_lines == 0 ) return; old_xrel = fli_tbox_get_rel_xoffset( obj ); old_yrel = fli_tbox_get_rel_yoffset( obj ); /* Calculate width and height for all lines */ for ( i = 0; i < sp->num_lines; i++ ) { TBOX_LINE *tl = sp->lines[ i ]; if ( tl->is_special ) continue; tl->style = style; /* Figure out width and height of string */ if ( ! tl->is_separator && *tl->text ) { tl->w = fl_get_string_widthTAB( tl->style, tl->size, tl->text, tl->len ); tl->h = fl_get_string_height( tl->style, tl->size, tl->len ? tl->text : " ", tl->len | 1, &tl->asc, &tl->desc ); } else { tl->w = 0; tl->h = fl_get_string_height( tl->style, tl->size, "X", 1, &tl->asc, &tl->desc ); } } /* Calculate vertical positions of all lines and the width of the longest line */ sp->max_width = sp->lines[ 0 ]->w; for ( i = 1; i < sp->num_lines; i++ ) { sp->lines[ i ]->y = sp->lines[ i - 1 ]->y + sp->lines[ i - 1 ]->h; sp->max_width = FL_max( sp->max_width, sp->lines[ i ]->w ); } /* Determine new height of total text */ sp->max_height = sp->lines[ sp->num_lines - 1 ]->y + sp->lines[ sp->num_lines - 1 ]->h; sp->attrib = 1; sp->no_redraw = 1; fli_tbox_set_rel_xoffset( obj, old_xrel ); fli_tbox_set_rel_yoffset( obj, old_yrel ); sp->no_redraw = old_no_redraw; } /************************************* * Sets the x-offset in pixels of the * text displayed in the textbox *************************************/ int fli_tbox_set_xoffset( FL_OBJECT * obj, int pixel ) { FLI_TBOX_SPEC *sp = obj->spec; if ( sp->max_width <= sp->w || pixel < 0 ) pixel = 0; if ( pixel > sp->max_width - sp->w ) pixel = FL_max( 0, sp->max_width - sp->w ); sp->xoffset = pixel; if ( ! sp->no_redraw ) fl_redraw_object( obj ); return pixel; } /*************************************** * Sets the x-offset of the text displayed in the textbox as a * number between 0 (starts of lines are shown) and 1 (end of * longest line is shown) ***************************************/ double fli_tbox_set_rel_xoffset( FL_OBJECT * obj, double offset ) { FLI_TBOX_SPEC *sp = obj->spec; if ( sp->max_width <= sp->w || offset < 0.0 ) offset = 0.0; if ( offset > 1.0 ) offset = 1.0; sp->xoffset = FL_nint( offset * FL_max( 0, sp->max_width - sp->w ) ); if ( ! sp->no_redraw ) fl_redraw_object( obj ); return fli_tbox_get_rel_xoffset( obj ); } /*************************************** * Sets the y-offset in pixels of the text displayed in the textbox ***************************************/ int fli_tbox_set_yoffset( FL_OBJECT * obj, int pixel ) { FLI_TBOX_SPEC *sp = obj->spec; if ( sp->max_height <= sp->h || pixel < 0 ) pixel = 0; if ( pixel > sp->max_height - sp->h ) pixel = FL_max( 0, sp->max_height - sp->h ); sp->yoffset = pixel; if ( ! sp->no_redraw ) fl_redraw_object( obj ); return pixel; } /*************************************** * Sets the y-offset of the text displayed in the textbox as a * number between 0 (show start of text) and 1 (show end of text) ***************************************/ double fli_tbox_set_rel_yoffset( FL_OBJECT * obj, double offset ) { FLI_TBOX_SPEC *sp = obj->spec; if ( sp->max_height <= sp->h || offset < 0.0 ) offset = 0.0; if ( offset > 1.0 ) offset = 1.0; sp->yoffset = FL_nint( offset * FL_max( 0, sp->max_height - sp->h ) ); if ( ! sp->no_redraw ) fl_redraw_object( obj ); return fli_tbox_get_rel_yoffset( obj ); } /*************************************** * Returns the x-offset in pixels of the text displayed in the textbox ***************************************/ int fli_tbox_get_xoffset( FL_OBJECT * obj ) { return ( ( FLI_TBOX_SPEC * ) obj->spec )->xoffset; } /*************************************** * Returns the x-offset of the text displayed in the textbox * as a number between 0 (starts of lines are shown) and 1 * (end of longest line is shown) ***************************************/ double fli_tbox_get_rel_xoffset( FL_OBJECT * obj ) { FLI_TBOX_SPEC *sp = obj->spec; if ( sp->max_width <= sp->w ) return 0.0; return ( double ) sp->xoffset / ( sp->max_width - sp->w ); } /*************************************** * Returns the y-offset in pixels of the text displayed in the textbox ***************************************/ int fli_tbox_get_yoffset( FL_OBJECT * obj ) { return ( ( FLI_TBOX_SPEC * ) obj->spec )->yoffset; } /*************************************** * Returns the y-offset of the text displayed in the textbox * as a number between 0 (start of text is shown) and 1 (end * of text is shown) ***************************************/ double fli_tbox_get_rel_yoffset( FL_OBJECT * obj ) { FLI_TBOX_SPEC *sp = obj->spec; if ( sp->max_height <= sp->h ) return 0.0; return ( double ) sp->yoffset / ( sp->max_height - sp->h ); } /*************************************** * Returns the y-offset in pixel for a line * (or -1 if the line doesn't exist). ***************************************/ int fli_tbox_get_line_yoffset( FL_OBJECT * obj, int line ) { FLI_TBOX_SPEC *sp = obj->spec; if ( line < 0 || line >= sp->num_lines ) return -1; return sp->lines[ line ]->y; } /*************************************** * Makes a line the one shown at the top (as far as possible) ***************************************/ void fli_tbox_set_topline( FL_OBJECT * obj, int line ) { FLI_TBOX_SPEC *sp = obj->spec; if ( ! sp->num_lines ) return; if ( line < 0 ) line = 0; else if ( line >= sp->num_lines ) line = sp->num_lines - 1; fli_tbox_set_yoffset( obj, sp->lines[ line ]->y ); } /*************************************** * Makes a line the lowest shown line (as far as possible) ***************************************/ void fli_tbox_set_bottomline( FL_OBJECT * obj, int line ) { FLI_TBOX_SPEC *sp = obj->spec; if ( ! sp->num_lines ) return; if ( line < 0 ) line = 0; else if ( line >= sp->num_lines ) line = sp->num_lines - 1; fli_tbox_set_yoffset( obj, sp->lines[ line ]->y + sp->lines[ line ]->h - sp->h ); } /*************************************** * Shifts the content to make the indexed line show up in the center * of the browser (as far as possible) ***************************************/ void fli_tbox_set_centerline( FL_OBJECT * obj, int line ) { FLI_TBOX_SPEC *sp = obj->spec; if ( ! sp->num_lines ) return; if ( line < 0 ) line = 0; else if ( line >= sp->num_lines ) line = sp->num_lines - 1; fli_tbox_set_yoffset( obj, sp->lines[ line ]->y + ( sp->lines[ line ]->h - sp->h ) / 2 ); } /*************************************** * Removes all selections in the browser ***************************************/ void fli_tbox_deselect( FL_OBJECT * obj ) { FLI_TBOX_SPEC *sp = obj->spec; int i; for ( i = 0; i < sp->num_lines; i++ ) sp->lines[ i ]->selected = 0; sp->select_line = -1; sp->deselect_line = -1; if ( ! sp->no_redraw ) fl_redraw_object( obj ); } /*************************************** * Deselects a line in the browser ***************************************/ void fli_tbox_deselect_line( FL_OBJECT * obj, int line ) { FLI_TBOX_SPEC *sp = obj->spec; if ( line < 0 || line >= sp->num_lines || ! sp->lines[ line ]->selected ) return; sp->lines[ line ]->selected = 0; /* Don't mark as deselected for FL_SELECT_BROWSER since otherwise it would be impossible for the user to retrieve the selection */ if ( obj->type != FL_SELECT_BROWSER ) { sp->deselect_line = line; sp->select_line = -1; } if ( ! sp->no_redraw ) fl_redraw_object( obj ); } /*************************************** * Selects a line in the browser (if necessary deselecting another line) ***************************************/ void fli_tbox_select_line( FL_OBJECT * obj, int line ) { FLI_TBOX_SPEC *sp = obj->spec; if ( line < 0 || line >= sp->num_lines || sp->lines[ line ]->selected || ! sp->lines[ line ]->selectable ) return; if ( sp->select_line != -1 && obj->type != FL_MULTI_BROWSER ) sp->lines[ sp->select_line ]->selected = 0; sp->lines[ line ]->selected = 1; sp->select_line = line; sp->deselect_line = -1; if ( ! sp->no_redraw ) fl_redraw_object( obj ); } /*************************************** * Returns if a line in the browser is selected ***************************************/ int fli_tbox_is_line_selected( FL_OBJECT * obj, int line ) { FLI_TBOX_SPEC *sp = obj->spec; return line >= 0 && line < sp->num_lines && sp->lines[ line ]->selected; } /*************************************** * Sets if a line is selectable or not ***************************************/ void fli_tbox_make_line_selectable( FL_OBJECT * obj, int line, int state ) { FLI_TBOX_SPEC *sp = obj->spec; TBOX_LINE *tl; if ( line < 0 || line >= sp->num_lines || sp->lines[ line ]->is_separator || obj->type == FL_NORMAL_BROWSER ) return; tl = sp->lines[ line ]; state = state ? 1 : 0; if ( ! state ) { if ( line == sp->select_line ) sp->select_line = -1; if ( line == sp->deselect_line ) sp->deselect_line = -1; } if ( tl->selectable != state ) { tl->selectable = state; if ( tl->is_special ) { if ( tl->specialGC ) { XFreeGC( flx->display, tl->specialGC ); sp->lines[ line ]->specialGC = None; } if ( FL_ObjWin( obj ) ) tl->specialGC = create_gc( obj, tl->style, tl->size, state ? obj->lcol : FL_INACTIVE, sp->x, sp->y, sp->w, sp->h ); } } if ( ! sp->no_redraw ) fl_redraw_object( obj ); } /*************************************** * Returns the last selected or deselected line (or 0 if there's none). * Please note: this function returns the index of the selected line * incremented by one and the negative of the index of the deselected * line decremented by 1. ***************************************/ int fli_tbox_get_selection( FL_OBJECT *obj ) { FLI_TBOX_SPEC *sp = obj->spec; if ( sp->select_line >= 0 ) return sp->select_line + 1; else if ( sp->deselect_line >= 0 ) return - sp->deselect_line - 1; else return 0; } /*************************************** * Installs a handler for double and triple clicks ***************************************/ void fli_tbox_set_dblclick_callback( FL_OBJECT * obj, FL_CALLBACKPTR cb, long data ) { FLI_TBOX_SPEC *sp = obj->spec; sp->callback = cb; sp->callback_data = data; fl_set_object_dblclick( obj, cb ? FL_CLICK_TIMEOUT : 0 ); } /*************************************** * Creates a GC with the required settings ***************************************/ static GC create_gc( FL_OBJECT * obj, int style, int size, FL_COLOR color, int clip_x, int clip_y, int clip_w, int clip_h ) { GC gc; XGCValues xgcv; unsigned long gcvm; if ( fli_cntl.safe ) xgcv.graphics_exposures = 1; else { Screen *scr = ScreenOfDisplay( flx->display, fl_screen ); xgcv.graphics_exposures = ! DoesBackingStore( scr ) || ! fli_cntl.backingStore; } gcvm = GCGraphicsExposures | GCForeground; xgcv.foreground = fl_get_flcolor( color ); gc = XCreateGC( flx->display, FL_ObjWin( obj ), gcvm, &xgcv ); if ( size > 0 && style >= 0 ) { XFontStruct *xfs = fl_get_fntstruct( style, size ); XSetFont( flx->display, gc, xfs->fid ); } fl_set_gc_clipping( gc, obj->x + clip_x, obj->y + clip_y, clip_w, clip_h ); return gc; } /*************************************** ***************************************/ void fli_tbox_recalc_area( FL_OBJECT * obj ) { FLI_TBOX_SPEC *sp = obj->spec; int dummy; sp->x = FL_abs( obj->bw ) + LEFT_MARGIN; sp->y = FL_abs( obj->bw ) + TOP_MARGIN; sp->w = obj->w - 2 * FL_abs( obj->bw ) - LEFT_MARGIN - RIGHT_MARGIN; sp->h = obj->h - 2 * FL_abs( obj->bw ) - TOP_MARGIN - BOTTOM_MARGIN; /* This is necessary because different box types don't have all the same inside size - but it will look still wrong with anything but up and down boxes... */ if ( obj->boxtype == FL_UP_BOX ) { sp->x++; sp->y++; sp->w -= 2; sp->h -= 2; } /* Calculate height of line with default font */ sp->def_height = fl_get_string_height( sp->def_style, sp->def_size, "X", 1, &dummy, &dummy ); } /*************************************** * Function called whenever the size or some other visual attribute * was changed before redrawing the object ***************************************/ static void fli_tbox_prepare_drawing( FL_OBJECT * obj ) { FLI_TBOX_SPEC *sp = obj->spec; int i; double old_xrel = fli_tbox_get_rel_xoffset( obj ); double old_yrel = fli_tbox_get_rel_yoffset( obj ); int old_no_redraw = sp->no_redraw; fli_tbox_recalc_area( obj ); /* Recalculate horizontal positions of all lines */ for ( i = 0; i < sp->num_lines; i++ ) if ( fl_is_center_lalign( sp->lines[ i ]->align ) ) sp->lines[ i ]->x = ( sp->max_width - sp->lines[ i ]->w ) / 2; else if ( fl_to_outside_lalign( sp->lines[ i ]->align ) == FL_ALIGN_RIGHT ) sp->lines[ i ]->x = sp->max_width - sp->lines[ i ]->w; /* We might get called before the textbox is shown and then the window is still unknown and GCs can't be created */ if ( ! FL_ObjWin( obj ) ) return; /* Create default GC for text drawing */ if ( sp->defaultGC ) XFreeGC( flx->display, sp->defaultGC ); sp->defaultGC = create_gc( obj, sp->def_style, sp->def_size, obj->lcol, sp->x, sp->y, sp->w, sp->h ); /* Create background GC for redraw deselected lines */ if ( sp->backgroundGC ) XFreeGC( flx->display, sp->backgroundGC ); sp->backgroundGC = create_gc( obj, -1, 0, obj->col1, sp->x - ( LEFT_MARGIN > 0 ), sp->y, sp->w + ( LEFT_MARGIN > 0 ), sp->h ); /* Create select GC for marking selected lines */ if ( sp->selectGC ) XFreeGC( flx->display, sp->selectGC ); sp->selectGC = create_gc( obj, -1, 0, fli_dithered( fl_vmode ) ? FL_BLACK : obj->col2, sp->x - ( LEFT_MARGIN > 0 ), sp->y, sp->w + ( LEFT_MARGIN > 0 ), sp->h ); /* Create GC for text of non-selectable lines */ if ( sp->nonselectGC ) XFreeGC( flx->display, sp->nonselectGC ); sp->nonselectGC = create_gc( obj, sp->def_style, sp->def_size, FL_INACTIVE, sp->x, sp->y, sp->w, sp->h ); /* Special GC for text of selected lines in B&W */ if ( fli_dithered( fl_vmode ) ) { if ( sp->bw_selectGC ) XFreeGC( flx->display, sp->bw_selectGC ); sp->bw_selectGC = create_gc( obj, sp->def_style, sp->def_size, FL_WHITE, sp->x - ( LEFT_MARGIN > 0 ), sp->y, sp->w + ( LEFT_MARGIN > 0 ), sp->h ); } /* Lines with non-default fonts or colors have their own GCs */ for ( i = 0; i < sp->num_lines; i++ ) { TBOX_LINE *tl = sp->lines[ i ]; if ( ! tl->is_special ) continue; if ( tl->specialGC ) { XFreeGC( flx->display, tl->specialGC ); tl->specialGC = None; } tl->specialGC = create_gc( obj, tl->style, tl->size, tl->color, sp->x, sp->y, sp->w, sp->h ); } sp->no_redraw = 1; fli_tbox_set_rel_xoffset( obj, old_xrel ); fli_tbox_set_rel_yoffset( obj, old_yrel ); sp->no_redraw = old_no_redraw; } /*************************************** * Frees all resources needed for the FLI_TBOX_SPEC structure ***************************************/ static void free_tbox_spec( FL_OBJECT * obj ) { FLI_TBOX_SPEC *sp = obj->spec; int i; for ( i = 0; i < sp->num_lines; i++ ) { if ( sp->lines[ i ]->specialGC ) XFreeGC( flx->display, sp->lines[ i ]->specialGC ); fli_safe_free( sp->lines[ i ]->fulltext ); fli_safe_free( sp->lines[ i ] ); } fli_safe_free( sp->lines ); if ( sp->defaultGC ) XFreeGC( flx->display, sp->defaultGC ); if ( sp->backgroundGC ) XFreeGC( flx->display, sp->backgroundGC ); if ( sp->selectGC ) XFreeGC( flx->display, sp->selectGC ); if ( sp->nonselectGC ) XFreeGC( flx->display, sp->nonselectGC ); if ( sp->bw_selectGC ) XFreeGC( flx->display, sp->bw_selectGC ); fli_safe_free( obj->spec ); } /*************************************** * Draws the complete textbox ***************************************/ static void draw_tbox( FL_OBJECT * obj ) { FLI_TBOX_SPEC *sp = obj->spec; int i; fl_draw_box( obj->boxtype, obj->x, obj->y, obj->w, obj->h, obj->col1, obj->bw ); XFillRectangle( flx->display, FL_ObjWin( obj ), sp->backgroundGC, obj->x + sp->x - ( LEFT_MARGIN > 0 ), obj->y + sp->y + sp->w - sp->yoffset, sp->w + ( LEFT_MARGIN > 0 ), sp->h ); if ( sp->num_lines == 0 ) return; fl_set_clipping( obj->x, obj->y, obj->w, obj->h ); for ( i = 0; i < sp->num_lines; i++ ) { TBOX_LINE *tl; GC activeGC = sp->defaultGC; tl = sp->lines[ i ]; if ( tl->y + tl->h < sp->yoffset ) /* if line is above tbox */ continue; if ( tl->y >= sp->h + sp->yoffset ) /* if line is below tbox */ break; /* Separator lines obviously need to be treated differently from normal text */ if ( tl->is_separator ) { /* The extra horizontal pixels here are due to the function called subtracting them! */ fl_draw_text( 0, obj->x + sp->x - 3, obj->y + sp->y - sp->yoffset + tl->y + tl->h / 2, sp->w + 6, 1, FL_COL1, FL_NORMAL_STYLE, sp->def_size, "@DnLine" ); continue; } /* Draw background of line in selection color if necessary*/ if ( tl->selected ) XFillRectangle( flx->display, FL_ObjWin( obj ), sp->selectGC, obj->x + sp->x - ( LEFT_MARGIN > 0 ), obj->y + sp->y + tl->y - sp->yoffset, sp->w + ( LEFT_MARGIN > 0 ), tl->h ); /* If there's no text or the text isn't visible within the textbox nothing needs to be drawn */ if ( ! *tl->text || tl->x - sp->xoffset >= sp->w || tl->x + tl->w - sp->xoffset < 0 ) continue; /* If the line needs a different font or color than the default use a special GC just for that line */ if ( ! tl->selectable ) activeGC = sp->nonselectGC; if ( tl->is_special ) { if ( ! tl->specialGC ) tl->specialGC = create_gc( obj, tl->style, tl->size, tl->selectable ? tl->color : FL_INACTIVE, sp->x, sp->y, sp->w, sp->h ); activeGC = tl->specialGC; } /* Set up GC for selected lines in B&W each time round - a bit slow, but I guess there are hardly any machines left with a B&W display */ if ( fli_dithered( fl_vmode ) && tl->selected ) { XFontStruct *xfs = fl_get_fntstruct( tl->style, tl->size ); XSetFont( flx->display, sp->bw_selectGC, xfs->fid ); XSetForeground( flx->display, sp->bw_selectGC, fl_get_flcolor( FL_WHITE ) ); activeGC = sp->bw_selectGC; } /* Now draw the line, underlined if necessary */ if ( tl->is_underlined ) fl_diagline( obj->x + sp->x - sp->xoffset + tl->x, obj->y + sp->y - sp->yoffset + tl->y + tl->h - 1, FL_min( sp->w + sp->xoffset - tl->x, tl->w ), 1, ( fli_dithered( fl_vmode ) && tl->selected ) ? FL_WHITE : tl->color ); fli_draw_stringTAB( FL_ObjWin( obj ), activeGC, obj->x + sp->x - sp->xoffset + tl->x, obj->y + sp->y - sp->yoffset + tl->y + tl->asc, tl->style, tl->size, tl->text, tl->len, 0 ); } fl_unset_clipping( ); } /*************************************** * Tries to find the index of the next selectable line following * 'line', returns the total number of lines if none can be found. ***************************************/ static int find_next_selectable( FL_OBJECT * obj, int line ) { FLI_TBOX_SPEC *sp = obj->spec; if ( line < -1 || line >= sp->num_lines ) line = -1; while ( ++line < sp->num_lines ) if ( sp->lines[ line ]->selectable ) break; return line < sp->num_lines ? line : -1; } /*************************************** * Tries to find the index of the next selectable line * before 'line', returns -1 if none can be found. ***************************************/ static int find_previous_selectable( FL_OBJECT * obj, int line ) { FLI_TBOX_SPEC *sp = obj->spec; if ( line < 0 || line > sp->num_lines ) line = sp->num_lines; while ( --line >= 0 ) if ( sp->lines[ line ]->selectable ) break; return line; } /*************************************** * Returns the total number of lines in the browser ***************************************/ int fli_tbox_get_num_lines( FL_OBJECT * obj ) { FLI_TBOX_SPEC *sp = obj->spec; return sp->num_lines; } /*************************************** * Returns the index of the first line that is completete shown on the * screen or -1 if there are no lines ***************************************/ int fli_tbox_get_topline( FL_OBJECT * obj ) { FLI_TBOX_SPEC *sp = obj->spec; int i; if ( ! sp->num_lines ) return -1; /* If the box was never shown assume that the very first line will be the one that's going to be in topmost position */ if ( ! sp->def_height ) return 0; i = FL_min( sp->yoffset / sp->def_height, sp->num_lines - 1 ); if ( sp->lines[ i ]->y < sp->yoffset ) { while ( ++i < sp->num_lines && sp->lines[ i ]->y < sp->yoffset ) /* empty */ ; if ( i == sp->num_lines || sp->lines[ i ]->y > sp->yoffset + sp->h ) i--; } else if ( sp->lines[ i ]->y > sp->yoffset ) { while ( i-- > 0 && sp->lines[ i ]->y > sp->yoffset ) /* empty */ ; if ( i < 0 || sp->lines[ i ]->y < sp->yoffset ) i++; } return i < sp->num_lines ? i : -1; } /*************************************** * Returns the index of the last line that is completete shown on the * screen or -1 if there are no lines ***************************************/ int fli_tbox_get_bottomline( FL_OBJECT * obj ) { FLI_TBOX_SPEC *sp = obj->spec; int i = sp->num_lines; while ( --i >= 0 && sp->lines[ i ]->y > sp->yoffset && sp->lines[ i ]->y + sp->lines[ i ]->h > sp->yoffset + sp->h ) /* empty */ ; return i; } /*************************************** * Deals with keyboard input (and indirectly with mouse wheel "clicks") ***************************************/ static int handle_keyboard( FL_OBJECT * obj, int key ) { FLI_TBOX_SPEC *sp = obj->spec; int old_select_line = sp->select_line; int old_yoffset = sp->yoffset; int old_xoffset = sp->xoffset; int ret = FL_RETURN_NONE; /* Don't react to keyboard events while deactivated, the browser also doesn't react to the mouse, so anything else woild seen to be inconsistent */ if ( ! obj->active ) return ret; if ( IsHome( key ) && sp->react_to_vert ) fli_tbox_set_rel_yoffset( obj, 0.0 ); else if ( IsEnd( key ) && sp->react_to_vert ) fli_tbox_set_rel_yoffset( obj, 1.0 ); else if ( IsPageUp( key ) && sp->react_to_vert ) fli_tbox_set_yoffset( obj, sp->yoffset - sp->h ); else if ( IsHalfPageUp( key ) && sp->react_to_vert ) fli_tbox_set_yoffset( obj, sp->yoffset - sp->h / 2 ); else if ( Is1LineUp( key ) && sp->react_to_vert ) fli_tbox_set_yoffset( obj, sp->yoffset - sp->def_height ); else if ( ( IsPageDown( key ) || key == ' ' ) && sp->react_to_vert ) fli_tbox_set_yoffset( obj, sp->yoffset + sp->h ); else if ( IsHalfPageDown( key ) && sp->react_to_vert ) fli_tbox_set_yoffset( obj, sp->yoffset + sp->h / 2 ); else if ( Is1LineDown( key ) && sp->react_to_vert ) fli_tbox_set_yoffset( obj, sp->yoffset + sp->def_height ); else if ( IsLeft( key ) && sp->react_to_hori ) fli_tbox_set_xoffset( obj, sp->xoffset - 3 ); else if ( IsRight( key ) && sp->react_to_hori ) fli_tbox_set_xoffset( obj, sp->xoffset + 3 ); else if ( IsUp( key ) ) { if ( sp->react_to_vert && ( obj->type == FL_NORMAL_BROWSER || obj->type == FL_SELECT_BROWSER || obj->type == FL_MULTI_BROWSER ) ) { int topline = fli_tbox_get_topline( obj ); if ( --topline >= 0 ) fli_tbox_set_yoffset( obj, sp->lines[ topline ]->y ); } else if ( obj->type == FL_HOLD_BROWSER || obj->type == FL_DESELECTABLE_HOLD_BROWSER ) { TBOX_LINE *tl; int line = find_previous_selectable( obj, sp->select_line ); if ( line >= 0 ) { tl = sp->lines[ line ]; if ( sp->react_to_vert || ( tl->y + tl->h >= sp->yoffset && tl->y < sp->h + sp->yoffset ) ) { fli_tbox_select_line( obj, line ); tl = sp->lines[ sp->select_line ]; /* Bring the selection into view if necessary */ if ( tl->y < sp->yoffset ) fli_tbox_set_topline( obj, sp->select_line ); else if ( tl->y + tl->h - sp->yoffset >= sp->h ) fli_tbox_set_bottomline( obj, sp->select_line ); } } } } else if ( IsDown( key ) ) { if ( sp->react_to_vert && ( obj->type == FL_NORMAL_BROWSER || obj->type == FL_SELECT_BROWSER || obj->type == FL_MULTI_BROWSER ) ) { int topline = fli_tbox_get_topline( obj ); if ( topline >= 0 && topline < sp->num_lines - 1 ) { if ( sp->lines[ topline ]->y - sp->yoffset == 0 ) topline++; fli_tbox_set_yoffset( obj, sp->lines[ topline ]->y ); } else fli_tbox_set_yoffset( obj, sp->max_height ); } else if ( obj->type == FL_HOLD_BROWSER || obj->type == FL_DESELECTABLE_HOLD_BROWSER ) { TBOX_LINE *tl; int line = find_next_selectable( obj, sp->select_line ); if ( line >= 0 ) { tl = sp->lines[ line ]; if ( sp->react_to_vert || ( tl->y + tl->h >= sp->yoffset && tl->y < sp->h + sp->yoffset ) ) { fli_tbox_select_line( obj, line ); tl = sp->lines[ sp->select_line ]; /* Bring the selection into view if necessary */ if ( tl->y + tl->h < sp->yoffset ) fli_tbox_set_topline( obj, sp->select_line ); else if ( tl->y + tl->h - sp->yoffset >= sp->h ) fli_tbox_set_bottomline( obj, sp->select_line ); } } } } if ( old_select_line != sp->select_line ) ret |= FL_RETURN_SELECTION; if ( old_yoffset != sp->yoffset || old_xoffset != sp->xoffset ) ret |= FL_RETURN_CHANGED | FL_RETURN_END; return ret; } /*************************************** * Tries to find the index of the line under the mouse, * returns -1 if there's none ***************************************/ static int find_mouse_line( FL_OBJECT * obj, FL_Coord my ) { FLI_TBOX_SPEC *sp = obj->spec; int line; if ( my < obj->y + sp->y || my > obj->y + sp->y + sp->h ) return -1; my += sp->yoffset - sp->y - obj->y; line = FL_min( sp->num_lines - 1, obj->y / ( ( double ) sp->max_height / sp->num_lines ) ); if ( sp->lines[ line ]->y > my ) while ( line-- > 0 && sp->lines[ line ]->y > my ) /* empty */ ; else while ( sp->lines[ line ]->y + sp->lines[ line ]->h < my && ++line < sp->num_lines ) /* empty */ ; if ( line < 0 || line >= sp->num_lines ) return -1; return line; } /*************************************** * Sets if the textbox reacts to keys that change the vertical * position (used by browser when vertical scrollbar is switched * on or off) ***************************************/ void fli_tbox_react_to_vert( FL_OBJECT * obj, int state ) { FLI_TBOX_SPEC *sp = obj->spec; sp->react_to_vert = state ? 1 : 0; } /*************************************** * Sets if the textbox reacts to keys that change the horizontal * position (used by browser when horizontal scrollbar is switched * on or off) ***************************************/ void fli_tbox_react_to_hori( FL_OBJECT * obj, int state ) { FLI_TBOX_SPEC *sp = obj->spec; sp->react_to_hori = state ? 1 : 0; } /*************************************** * Handles a mouse event, returns whether a selection change has occured ***************************************/ #define DESELECT 0 #define SELECT 1 static int handle_mouse( FL_OBJECT * obj, FL_Coord my, int ev ) { FLI_TBOX_SPEC *sp = obj->spec; int line; int ret = FL_RETURN_NONE; static int mode; static int last_multi = -1; /* Check whether there are any lines at all */ if ( sp->num_lines == 0 ) return ret; /* Figure out the index of the line the mouse is on. If the mouse is below or above the text area scroll up or down */ if ( ev == FL_UPDATE && sp->react_to_vert && ( my < obj->y + sp->y || my > obj->y + sp->y + sp-> h ) ) { if ( my < obj->y + sp->y ) { line = fli_tbox_get_topline( obj ); if ( line > 0 ) { fli_tbox_set_topline( obj, --line ); ret |= FL_RETURN_CHANGED; } } else { line = fli_tbox_get_bottomline( obj ); if ( line > 0 && line < sp->num_lines - 1 ) { fli_tbox_set_bottomline( obj, ++line ); ret |= FL_RETURN_CHANGED; } } } else if ( obj->type != FL_NORMAL_BROWSER ) line = find_mouse_line( obj, my ); /* A normal textbox doesn't react to the mouse in any other ways */ if ( obj->type == FL_NORMAL_BROWSER ) return ret; else if ( obj->type == FL_SELECT_BROWSER || obj->type == FL_HOLD_BROWSER || obj->type == FL_DESELECTABLE_HOLD_BROWSER ) { /* For FL_SELECT_BROWSER browsers the selection is undone when the mouse is released */ if ( ev == FL_RELEASE && obj->type == FL_SELECT_BROWSER ) { if ( sp->select_line >= 0 ) fli_tbox_deselect_line( obj, sp->select_line ); return ret; } if ( line < 0 || ! sp->lines[ line ]->selectable ) return ret; if ( ev == FL_PUSH ) { #if 0 /* still under discussion with Serge Bromow */ if ( line != sp->select_line ) { fli_tbox_select_line( obj, line ); ret |= FL_RETURN_SELECTION; } else if ( line == sp->select_line && obj->type == FL_DESELECTABLE_HOLD_BROWSER ) { fli_tbox_deselect_line( obj, line ); ret |= FL_RETURN_DESELECTION; } #endif if ( line == sp->select_line && obj->type == FL_DESELECTABLE_HOLD_BROWSER ) { fli_tbox_deselect_line( obj, line ); ret |= FL_RETURN_DESELECTION; } else { fli_tbox_select_line( obj, line ); ret |= FL_RETURN_SELECTION; } } return ret; } else /* FL_MULTI_BROWSER */ { if ( line < 0 ) return ret; if ( ev == FL_PUSH ) { if ( ! sp->lines[ line ]->selectable ) return ret; mode = sp->lines[ line ]->selected ? DESELECT : SELECT; if ( mode == SELECT ) { fli_tbox_select_line( obj, line ); last_multi = line; ret |= FL_RETURN_SELECTION; } else { fli_tbox_deselect_line( obj, line ); last_multi = line; ret |= FL_RETURN_DESELECTION; } } else { /* Mouse may have been moved that fast that one or more lines got skipped */ if ( last_multi != -1 && FL_abs( line - last_multi ) > 1 ) { int incr = line - last_multi > 1 ? 1 : -1; while ( ( last_multi += incr ) != line ) if ( sp->lines[ last_multi ]->selectable ) { if ( mode == SELECT && ! sp->lines[ last_multi ]->selected ) { fli_tbox_select_line( obj, last_multi ); ret |= FL_RETURN_SELECTION; } else if ( mode == DESELECT && sp->lines[ last_multi ]->selected ) { fli_tbox_deselect_line( obj, last_multi ); ret |= FL_RETURN_DESELECTION; } } } if ( sp->lines[ line ]->selectable ) { if ( mode == SELECT && ! sp->lines[ line ]->selected ) { fli_tbox_select_line( obj, line ); last_multi = line; ret |= FL_RETURN_SELECTION; } else if ( mode == DESELECT && sp->lines[ line ]->selected ) { fli_tbox_deselect_line( obj, line ); ret |= FL_RETURN_DESELECTION; last_multi = line; } } if ( ev == FL_RELEASE ) last_multi = -1; } } return ret; } /*************************************** * Called for events concerning the textbox ***************************************/ static int handle_tbox( FL_OBJECT * obj, int ev, FL_Coord mx FL_UNUSED_ARG, FL_Coord my, int key, void * xev ) { FLI_TBOX_SPEC *sp = obj->spec; int ret = FL_RETURN_NONE; static int old_yoffset = -1; if ( obj->type == FL_NORMAL_BROWSER && key == FL_MBUTTON1 && sp->select_line >= 0 ) fli_tbox_deselect_line( obj, sp->select_line ); /* Convert mouse wheel events to keypress events */ if ( ev == FL_RELEASE && ( key == FL_MBUTTON4 || key == FL_MBUTTON5 ) && ! obj->want_update && ! fli_mouse_wheel_to_keypress( &ev, &key, xev ) ) return ret; switch ( ev ) { case FL_ATTRIB : case FL_RESIZED : sp->attrib = 1; break; case FL_DRAW : if ( sp->attrib ) { fli_tbox_prepare_drawing( obj ); sp->attrib = 0; } draw_tbox( obj ); break; case FL_DBLCLICK : case FL_TRPLCLICK : if ( sp->callback ) sp->callback( obj, sp->callback_data ); break; case FL_KEYPRESS : ret = handle_keyboard( obj, key ); break; case FL_PUSH : if ( key != FL_MBUTTON1 ) break; obj->want_update = 1; /* so we can follow mouse movements */ old_yoffset = sp->yoffset; ret = handle_mouse( obj, my, ev ); break; case FL_UPDATE : ret = handle_mouse( obj, my, ev ); break; case FL_RELEASE : if ( key != FL_MBUTTON1 ) break; ret = handle_mouse( obj, my, ev ) | FL_RETURN_END; if ( sp->yoffset != old_yoffset ) ret |= FL_RETURN_CHANGED; obj->want_update = 0; break; case FL_FREEMEM : free_tbox_spec( obj ); break; } return ret; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/flvisual.c0000664000175000017500000002421312353623325012524 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file flvisual.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * XForm will by default use the visual that has the most depth */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #ifdef XlibSpecificationRelease #define XlibVersion ( XlibSpecificationRelease == 5 ) ? "R5": \ ( ( XlibSpecificationRelease == 6 ) ? "R6" : "Post-R6" ) #else #define XlibVersion "Pre-R5" #endif /******************* Local variables ************************/ static int max_server_depth; /******************************************************************** * Setup the most appropriate visual for FORMS ****************************************************************{***/ /*************************************** * Get the conversion factors from RGB->pixel in TrueColor and * DirectColor ***************************************/ static void RGBmode_init( int v ) { FL_State *s = fl_state + v; fli_xvisual2flstate( s, s->xvinfo ); #if FL_DEBUG >= ML_WARN M_info( "RGBmode_init", "%s: bits_per_rgb = %d", fli_vclass_name( v ), s->rgb_bits ); M_info( "RGBmode_init", "RS = %d GS = %d BS = %d", s->rshift, s->gshift, s->bshift ); M_info( "RGBmode_init", "RB = %d GB = %d BB = %d", s->rbits, s->gbits, s->bbits ); #endif } /*************************************** * User has the option to select visual class/depth independently via * fl_set_defaults() or through resource/command lines. The request is * stored in fli_cntl. This routine just checks if the request itself * is valid or not. It is possible both visual and depth are valid * but the combination is not. So need to follow this routine * with XMatchVisual(). ***************************************/ static void check_user_preference( int * vmode, int * depth ) { int reqv = -1, reqd = 0; reqv = fli_cntl.vclass; reqd = fli_cntl.depth; #if FL_DEBUG >= ML_WARN M_warn( "check_user_preference", "UserRequest: %s %d", reqv >= 0 ? fli_vclass_name( reqv ) : "None", reqd > 0 ? reqd : 0 ); #endif /* Need to check special value FL_DefaultVisual */ if ( reqv == FL_DefaultVisual ) { reqd = DefaultDepth( fl_display, fl_screen ); reqv = DefaultVisual( fl_display, fl_screen )->class; } /* Here make a guess if incomplete request is made */ if ( reqv >= 0 && reqd == 0 ) reqd = fli_depth( reqv ); /* If only depth is requested, select a visual */ if ( reqd > 0 && reqv < 0 ) reqv = reqd > 12 ? TrueColor : PseudoColor; if ( reqv >= 0 && reqd >= FL_MINDEPTH ) { *vmode = reqv; *depth = reqd; } } /*************************************** * Find best visual among each visual class and store all info * in fl_state structure ***************************************/ #define setmode( m, n ) ( fli_depth( m ) >= n && fl_mode_capable( m, n ) ) static int select_best_visual( void ) { static XVisualInfo *xv; static XVisualInfo *bestv[ 6 ]; static XVisualInfo xvt; /* fl_state uses it */ int xvn, i, j, depth; static int bvmode = -1; /* initial default if no user prefernce */ /* Have already done it */ if ( xv ) return bvmode; /* Request for a list of all supported visuals on fl_screen */ xvt.screen = fl_screen; if ( ! ( xv = XGetVisualInfo( fl_display, VisualScreenMask, &xvt, &xvn ) ) ) { M_err( "select_best_visual", " Can't get VisualInfo!" ); exit( 1 ); } /* Choose the visual that has the most colors among each class. */ for ( i = 0; i < xvn; i++ ) { depth = xv[ i ].depth; j = xv[ i ].class; /* Simply use visuals returned by GetVisualInfo and make sure xv is NOT freed */ if ( ! bestv[ j ] || depth > bestv[ j ]->depth ) { FL_State *fs = fl_state + j; bestv[ j ] = xv + i; fs->xvinfo = bestv[ j ]; fs->depth = bestv[ j ]->depth; fs->vclass = bestv[ j ]->class; fs->rgb_bits = bestv[ j ]->bits_per_rgb; if ( depth > max_server_depth ) max_server_depth = fs->depth; } } #if FL_DEBUG >= ML_DEBUG if ( fli_cntl.debug ) { M_warn( "select_best_visual", "XlibVersion: %s", XlibVersion ); M_info( "select_best_visual", "DPI = %d", fl_dpi ); M_warn( "select_best_visual", "No. of Visuals: %d", xvn ); for ( j = 0; j < 6; j++ ) if ( bestv[ j ] ) fprintf( stderr, "Best %11s: Id = 0x%lx Depth = %2u RGBbits = %d\n", fli_vclass_name( fli_class( j ) ), bestv[ j ]->visualid, bestv[ j ]->depth, bestv[ j ]->bits_per_rgb ); } #endif /* Demand FL_MINDEPTH bits. Since V0.63, FL_MINDEPTH is 1, so this this check is basically a no-op unless something is wrong. */ if ( max_server_depth < FL_MINDEPTH ) { M_err( "select_best_visual", "MaxServerDepth = %d. XForms requires at least %d. Sorry", max_server_depth, FL_MINDEPTH ); exit( 1 ); } /* If depth is smaller than 10, RGBmode offers no advantage over PseudoColor in that PseudoColors offers better flexibility */ if ( setmode( TrueColor, 12 ) ) bvmode = TrueColor; else if ( setmode( DirectColor, 12 ) ) bvmode = DirectColor; else if ( setmode( PseudoColor, FL_MINDEPTH ) ) bvmode = PseudoColor; else if ( setmode( StaticColor, FL_MINDEPTH ) ) bvmode = StaticColor; else if ( setmode( GrayScale, FL_MINDEPTH ) ) bvmode = GrayScale; else if ( setmode( StaticGray, FL_MINDEPTH ) ) bvmode = StaticGray; else if ( xvn ) /* have to take what we have */ bvmode = xv[ 0 ].class; else { M_err( "select_best_visual", "Can't find an appropriate visual" ); exit( 1 ); } return bvmode; } /*************************************** * After this routine, program should have selected a workable * visual/depth combination ***************************************/ int fli_initialize_program_visual( void ) { int vmode, depth; static XVisualInfo xvt; static int visual_initialized; static int program_vclass; if ( visual_initialized ) return program_vclass; vmode = select_best_visual( ); #if FL_DEBUG >= ML_WARN M_warn( "fli_initialize_program_visual", "Initial visual: %s (ID = 0x%lx) depth = %d", fli_vclass_name( vmode ), fli_visual( vmode )->visualid, fli_depth( vmode ) ); #endif /* Check program default, settable by user fl_vmode */ if ( fl_vmode >= 0 ) vmode = fl_vmode; depth = fli_depth( vmode ); M_warn( "fli_initialize_program_visual", "ProgramDefault: %s %d", fli_vclass_name( vmode ), depth); /* Give user a chance to select a visual */ check_user_preference( &vmode, &depth ); M_warn( "fli_initialize_program_visual", "UserPreference: %s %d", fli_vclass_name( vmode ), depth ); /* If requested a visualID directly, honor it here */ if ( fli_requested_vid > 0 ) { XVisualInfo xv, *retxv; int nv; M_warn( "fli_initialize_program_visual", "UserRequestedVID: 0x%lx", fli_requested_vid ); xv.visualid = fli_requested_vid; if ( ( retxv = XGetVisualInfo( fl_display, VisualIDMask, &xv, &nv ) ) ) { FL_State *fs = fl_state + retxv->class; vmode = retxv->class; fs->xvinfo = retxv; fs->depth = retxv->depth; fs->vclass = retxv->class; fs->rgb_bits = retxv->bits_per_rgb; } else { M_err( "fli_initialize_program_visual", "Can't find visualID 0x%lx", fli_requested_vid ); fli_requested_vid = 0; } } /* Make sure the stuff flies. */ if ( ! fli_requested_vid ) { if ( XMatchVisualInfo( fl_display, fl_screen, depth, vmode, &xvt ) ) { FL_State *fs = fl_state + xvt.class; vmode = xvt.class; fs->xvinfo = &xvt; fs->depth = xvt.depth; fs->vclass = xvt.class; fs->rgb_bits = xvt.bits_per_rgb; } else { /* Bogus request. Revert to the best visual we have found */ M_err( "fli_initialize_program_visual", "Bogus request: %s with depth = %d", fli_vclass_name( vmode ), depth ); vmode = select_best_visual( ); } } program_vclass = vmode; #if FL_DEBUG >= ML_WARN M_warn( "fli_initialize_program_visual", "SelectedVisual: %s (ID = 0x%lx) depth = %d", fli_vclass_name( vmode ), fli_visual( vmode )->visualid, fli_depth( vmode ) ); #endif /* If RGB Visual is supported, need to find out the masks and shifts stuff to be used in RGB -> pixel mapping */ if ( fli_depth( TrueColor ) ) RGBmode_init( TrueColor ); if ( fli_depth( DirectColor ) ) RGBmode_init( DirectColor ); visual_initialized = 1; return program_vclass; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/display.c0000644000175000017500000000412612251554251012341 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file display.c * * We need this so files that reference fl_display don't * have to in pull other files. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include Display *fl_display; /*************************************** * given a mask for RGB, find the shifts and number of bits ***************************************/ void fli_rgbmask_to_shifts( unsigned long mask, unsigned int * shift, unsigned int * bits ) { unsigned int val; if ( mask == 0 ) { *shift = *bits = 0; return; } *shift = 0; while ( ! ( ( 1 << *shift ) & mask ) ) ( *shift )++; val = mask >> *shift; *bits = 0; while ( ( 1 << *bits ) & val ) ( *bits )++; } /*************************************** ***************************************/ void fli_xvisual2flstate( FL_State * s, XVisualInfo * xvinfo ) { s->rgb_bits = xvinfo->bits_per_rgb; s->rmask = xvinfo->red_mask; s->gmask = xvinfo->green_mask; s->bmask = xvinfo->blue_mask; fli_rgbmask_to_shifts( s->rmask, &s->rshift, &s->rbits ); fli_rgbmask_to_shifts( s->gmask, &s->gshift, &s->gbits ); fli_rgbmask_to_shifts( s->bmask, &s->bshift, &s->bbits ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/round3d.c0000664000175000017500000001013712353623325012255 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file round3d.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" #include "flinternal.h" /*************************************** * Draws a round button ***************************************/ static void draw_round3dbutton( FL_OBJECT * ob ) { int c1; FL_Coord xx, yy, rr, bw = FL_abs( ob->bw ); FL_BUTTON_STRUCT *sp = ob->spec; if ( ob->boxtype == FL_NO_BOX && ( sp->event == FL_ENTER || sp->event == FL_LEAVE ) ) return; c1 = ob->belowmouse ? FL_ROUND3DBUTTON_MCOL : FL_ROUND3DBUTTON_TOPCOL; fl_draw_box(ob->boxtype, ob->x, ob->y, ob->w, ob->h, c1, ob->bw); rr = 0.3 * FL_min( ob->w, ob->h ) + 0.5; xx = ob->x + rr + 4.1; yy = ob->y + 0.5 * ob->h; if ( rr < bw / 2 ) rr = bw / 2 + 1; #if 1 fl_draw_box( FL_OVAL3D_DOWNBOX, xx - rr, yy - rr, 2 * rr, 2 * rr, ob->col1, ob->bw ); #else olw = fl_get_linewidth( ); fl_linewidth( bw ); fl_arc( xx, yy, rr - bw / 2, 450, 2250, FL_BOTTOM_BCOL ); fl_arc( xx, yy, rr - bw / 2, 0, 450, FL_TOP_BCOL ); fl_arc( xx, yy, rr - bw / 2, 2250, 3600, FL_TOP_BCOL ); fl_linewidth( olw ); if ( fli_dithered( fl_vmode ) ) fl_arc( xx, yy, rr - bw / 2, 0, 3600, FL_BLACK ); #endif if ( sp->val ) fl_circf( xx, yy, ( int ) FL_max( 1, 0.85 * rr - 1.0 - 0.5 * bw ), ob->col2 ); if ( fl_is_center_lalign( ob->align ) ) fl_draw_text( FL_ALIGN_LEFT, xx + rr + 1, ob->y, 0, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); else fl_draw_text_beside( ob->align, ob->x, ob->y, ob->w, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); if ( ob->type == FL_RETURN_BUTTON ) fl_draw_text( 0, ob->x + ob->w - 0.8 * ob->h, ob->y + 0.2 * ob->h, 0.6 * ob->h, 0.6 * ob->h, ob->lcol, 0, 0, "@returnarrow" ); } /*************************************** * creates an object ***************************************/ FL_OBJECT * fl_create_round3dbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob; fl_add_button_class( FL_ROUND3DBUTTON, draw_round3dbutton, 0 ); ob = fl_create_generic_button( FL_ROUND3DBUTTON, type, x, y, w, h, label ); ob->boxtype = FL_ROUND3DBUTTON_BOXTYPE; ob->col1 = FL_ROUND3DBUTTON_COL1; ob->col2 = FL_ROUND3DBUTTON_COL2; ob->align = FL_ROUND3DBUTTON_ALIGN; ob->lcol = FL_ROUND3DBUTTON_LCOL; return ob; } /*************************************** * Adds an object ***************************************/ FL_OBJECT * fl_add_round3dbutton( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob = fl_create_round3dbutton( type, x, y, w, h, label ); fl_add_object( fl_current_form, ob ); return ob; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/timeout.c0000664000175000017500000001115412251553736012372 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file timeout.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Check timeout */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include #include #include #include #include long msec0 = 0; /*************************************** ***************************************/ int fl_add_timeout( long msec, FL_TIMEOUT_CALLBACK callback, void * data ) { FLI_TIMEOUT_REC *rec; static int id = 1; rec = fl_malloc( sizeof *rec ); fl_gettime( &rec->start_sec, &rec->start_usec ); rec->id = id; rec->ms_to_wait = FL_max( msec, 0 ); rec->callback = callback; rec->data = data; rec->prev = NULL; /* Make it the start of the (doubly) linked list */ rec->next = fli_context->timeout_rec; if ( fli_context->timeout_rec ) fli_context->timeout_rec->prev = rec; fli_context->timeout_rec = rec; /* Deal with wrap around of IDs- rather unlikely to happen but if it does it's not a 100% safe way to do it, we can only bet on the chance that the timeouts with the re-used numbers have expired a long time ago... */ if ( id++ <= 0 ) id = 1; return rec->id; } /*************************************** * Internal function for remving a timeout - remove * it from the (doubly) linked list and free memory ***************************************/ static void remove_timeout( FLI_TIMEOUT_REC * rec ) { if ( rec == fli_context->timeout_rec ) { fli_context->timeout_rec = rec->next; if ( rec->next ) fli_context->timeout_rec->prev = NULL; } else { rec->prev->next = rec->next; if ( rec->next ) rec->next->prev = rec->prev; } fl_free( rec ); } /*************************************** * Public function for removing a timeout ***************************************/ void fl_remove_timeout( int id ) { FLI_TIMEOUT_REC *rec = fli_context->timeout_rec; while ( rec && rec->id != id ) rec = rec->next; if ( rec ) remove_timeout( rec ); else M_err( "fl_remove_timeout", "ID %d not found", id ); } /*************************************** * Function that periodically gets called to deal with expired * timeouts, invoking their handlers and removing them. Via the * argument the time until the next timeout expires gets returned * (if this is earlier than the original value). ***************************************/ void fli_handle_timeouts( long * msec ) { FLI_TIMEOUT_REC *rec, *next; long sec = 0, usec, elapsed, diff; if ( ! fli_context->timeout_rec ) return; fl_gettime( &sec, &usec ); /* Loop over all candidates, dealing with those that expired and removing them, while also keeping looking for the time the next one is going to expire */ for ( rec = fli_context->timeout_rec; rec; rec = next ) { next = rec->next; elapsed = 1000 * ( sec - rec->start_sec ) + ( usec - rec->start_usec ) / 1000; diff = rec->ms_to_wait - elapsed; if ( diff <= 0 ) { if ( rec->callback ) { rec->callback( rec->id, rec->data ); fl_gettime( &sec, &usec ); } remove_timeout( rec ); } else *msec = FL_min( *msec, diff ); } } /*************************************** ***************************************/ void fli_remove_all_timeouts( void ) { while ( fli_context->timeout_rec ) fl_remove_timeout( fli_context->timeout_rec->id ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/choice.c0000664000175000017500000006175012353623325012140 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file choice.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * FL_CHOICE class */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/pchoice.h" #include "private/flvasprintf.h" #include #include #define NO_TITLE_MASK 1 #define ALIGN_BOTTOM_MASK 2 /*************************************** ***************************************/ static void free_choice( FLI_CHOICE_SPEC * sp ) { int i; for ( i = 1; i <= FL_CHOICE_MAXITEMS; i++ ) { if ( sp->items[ i ] ) fli_safe_free( sp->items[ i ] ); if ( sp->shortcut[ i ] ) fli_safe_free( sp->shortcut[ i ] ); } } /*************************************** * Draws a choice object ***************************************/ static void draw_choice( FL_OBJECT * ob ) { FL_COLOR c1; FLI_CHOICE_SPEC *sp = ob->spec; int absbw = FL_abs(ob->bw); int off1 = 0, off2 = 0; c1 = ob->belowmouse ? FL_CHOICE_MCOL : ob->col1; fl_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, c1, ob->bw ); if ( ob->type == FL_NORMAL_CHOICE2 ) { int dh = FL_max( 6 + ( ob->bw > 0 ), ob->h * 0.1 ); int dw = FL_max( 0.11 * ob->w, 13 ); int dbh = FL_max( absbw - 1, 1 ); int align = fl_to_outside_lalign( sp->align ); fl_draw_box( FL_UP_BOX, ob->x + ob->w - dw - absbw - 2, ob->y + ( ob->h - dh ) / 2, dw, dh, ob->col1, - dbh ); off1 = fl_is_center_lalign( align ) ? ( dw / 2 ) : 0; off2 = align == FL_ALIGN_RIGHT ? dw : 0; } fl_draw_text_beside( ob->align, ob->x, ob->y, ob->w, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); /* String can conceivably contain "type flags". need to get rid of them on the fly */ if ( sp->val > 0 && sp->val <= sp->numitems ) { char *str = fl_strdup( sp->items[ sp->val ] ), *cc = strchr( str, '%' ); if ( cc ) { if ( cc[ 1 ] == '%' ) cc[ 1 ] = '\0'; else cc[ 0 ] = '\0'; } fl_set_text_clipping( ob->x + absbw, ob->y, ob->w - 2 * absbw, ob->h ); fl_draw_text( sp->align, ob->x - off1, ob->y, ob->w - off2, ob->h, ob->col2, sp->fontstyle, sp->fontsize, str + ( str && ( *str == '\010' ) ) ); fl_unset_text_clipping( ); fl_free( str ); } } /*************************************** ***************************************/ static void draw_droplist_choice( FL_OBJECT * ob ) { FL_COLOR c1; FLI_CHOICE_SPEC *sp = ob->spec; FL_Coord dw = ob->h, dx = ob->w - dw, bw; c1 = sp->below ? FL_CHOICE_MCOL : ob->col1; bw = ob->bw; if ( bw > 0 ) bw -= ob->bw > 1; /* Arrows */ fl_draw_box( sp->pushed ? FL_DOWN_BOX : FL_UP_BOX, ob->x + dx, ob->y, dw, ob->h, c1, bw ); if ( sp->no_title & ALIGN_BOTTOM_MASK ) fl_draw_text( FL_ALIGN_CENTER, ob->x + dx + 2, ob->y + 2, dw - 4, ob->h - 4, FL_BLACK, 0, 0, "@#8->" ); else fl_draw_text( FL_ALIGN_CENTER, ob->x + dx + 2, ob->y + 2, dw - 4, ob->h - 4, FL_BLACK, 0, 0, "@#2->" ); /* Choice box */ fl_draw_box( ob->boxtype, ob->x, ob->y, dx, ob->h, ob->col1, ob->bw ); fl_draw_text_beside( ob->align, ob->x, ob->y, dx, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); /* String can conceivably contain "type flags", need to get rid of them on the fly */ if ( sp->val > 0 && sp->val <= sp->numitems ) { char *str = fl_strdup( sp->items[ sp->val ] ), *cc = strchr( str, '%' ); if ( cc ) { if ( cc[ 1 ] == '%') cc[ 1 ] = '\0'; else cc[ 0 ] = '\0'; } fl_set_text_clipping( ob->x + FL_abs( ob->bw ), ob->y, ob->w - 2 * FL_abs( ob->bw ), ob->h ); fl_draw_text( sp->align, ob->x, ob->y, dx, ob->h, ob->col2, sp->fontstyle, sp->fontsize, str + ( str && ( *str == '\010' ) ) ); fl_unset_text_clipping( ); fl_free( str ); } } /*************************************** * Due to grayout, need to find out which one is valid ***************************************/ static int set_next_entry( FLI_CHOICE_SPEC * sp, int dir ) { int target = 0; int min = 1, max = sp->numitems; if ( sp->numitems == 0 ) return -1; while ( sp->mode[ min ] & FL_PUP_GREY && min < max ) min++; while ( sp->mode[ max ] & FL_PUP_GREY && max > min ) max--; if ( min == max ) return -1; if ( dir > 0 ) { target = sp->val + 1; if ( target > max ) target = min; } else if ( dir < 0 ) { target = sp->val - 1; if ( target < min ) target = max; } for ( ; target >= min && target <= max; target += dir ) if ( ! ( sp->mode[ target ] & FL_PUP_GREY ) ) return sp->val = target; M_err( "set_next_entry", "No valid entries" ); return -1; } /*************************************** ***************************************/ static int do_pup( FL_OBJECT * ob ) { int popup_id; FLI_CHOICE_SPEC *sp = ob->spec; int i, val; popup_id = fl_newpup( FL_ObjWin( ob ) ); /* Fake a title */ if ( ob->label && ob->label[ 0 ] && ob->type != FL_DROPLIST_CHOICE && ! ( sp->no_title & NO_TITLE_MASK ) ) { char *t = fl_malloc( strlen( ob->label ) + 3 ); strcpy( t, ob->label ); strcat( t, "%t" ); fl_addtopup( popup_id, t ); fl_free( t ); } for ( i = 1; i <= sp->numitems; i++ ) { fl_addtopup( popup_id, sp->items[ i ] ); if ( sp->modechange[ i ] || sp->mode[ i ] != FL_PUP_NONE ) { fl_setpup( popup_id, i, sp->mode[ i ] ); sp->modechange[ i ] = 0; } fl_setpup_shortcut( popup_id, i, sp->shortcut[ i ] ); } fl_setpup_shadow( popup_id, ob->type != FL_DROPLIST_CHOICE ); fl_setpup_selection( popup_id, sp->val ); fl_setpup_softedge( popup_id, ob->bw < 0 ); if ( sp->no_title & ALIGN_BOTTOM_MASK ) fl_setpup_align_bottom( ); val = fl_dopup( popup_id ); if ( val > 0 ) { sp->mode[ val ] = fl_getpup_mode( popup_id, i ); sp->modechange[ val ] = 1; sp->val = val; } fl_freepup( popup_id ); return val; } #define Within( x, y, w, h ) ( mx >= ( x ) \ && mx <= ( ( x ) + ( w ) ) \ && my >= ( y ) \ && my <= ( ( y ) + ( h ) ) ) /*************************************** * Handles an event, returns whether value has changed. ***************************************/ static int handle_choice( FL_OBJECT * ob, int event, FL_Coord mx, FL_Coord my, int key, void * ev FL_UNUSED_ARG ) { FLI_CHOICE_SPEC *sp = ob->spec; int val; int ret = FL_RETURN_NONE; #if FL_DEBUG >= ML_DEBUG M_info2( "handle_choice", fli_event_name( event ) ); #endif switch ( event ) { case FL_ATTRIB : /* always force outside alignment */ ob->align = fl_to_outside_lalign( ob->align ); break; case FL_DRAW: if ( ob->type == FL_DROPLIST_CHOICE ) draw_droplist_choice( ob ); else draw_choice( ob ); break; case FL_DRAWLABEL: fl_draw_text_beside( ob->align, ob->x, ob->y, ob->w, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); break; case FL_PUSH: if ( key == FL_MBUTTON2 || key == FL_MBUTTON3 ) { sp->counter = 0; val = set_next_entry( sp, key == FL_MBUTTON3 ? 1 : -1 ); sp->pushed = 0; fl_redraw_object( ob ); if ( val > 0 ) ret |= FL_RETURN_CHANGED; break; } if ( key != FL_MBUTTON1 || sp->numitems == 0 ) break; if ( ob->type != FL_DROPLIST_CHOICE ) { if ( do_pup( ob ) > 0 ) ret |= FL_RETURN_CHANGED; break; } /* Droplist choices only become active when the mouse button has been released */ if ( Within( ob->x + ob->w - ob->h, ob->y, ob->h, ob->h ) ) { sp->pushed = 1; draw_droplist_choice( ob ); } break; case FL_UPDATE: if ( ( key == FL_MBUTTON2 || key == FL_MBUTTON3 ) && ++sp->counter % 15 == 0 ) { sp->counter = 0; val = set_next_entry( sp, key == FL_MBUTTON3 ? 1 : -1 ); sp->pushed = 0; fl_redraw_object( ob ); if ( val > 0 ) ret |= FL_RETURN_CHANGED; } break; case FL_MOTION: if ( sp->numitems == 0 || ob->type != FL_DROPLIST_CHOICE ) break; if ( Within( ob->x + ob->w - ob->h, ob->y, ob->h, ob->h ) ) { if ( ! sp->below ) { sp->below = 1; draw_droplist_choice( ob ); } } else if ( sp->below ) { sp->below = 0; draw_droplist_choice( ob ); } break; case FL_RELEASE: if ( sp->numitems == 0 ) break; if ( key == FL_MBUTTON4 || key == FL_MBUTTON5 ) { val = set_next_entry( sp, key == FL_MBUTTON5 ? 1 : -1 ); sp->pushed = 0; fl_redraw_object( ob ); if ( val > 0 ) ret |= FL_RETURN_CHANGED | FL_RETURN_END; break; } if ( ob->type != FL_DROPLIST_CHOICE || ! sp->pushed ) break; if ( ! Within( ob->x + ob->w - ob->h, ob->y, ob->h, ob->h ) ) { sp->pushed = 0; fl_redraw_object( ob ); break; } if ( sp->no_title & ALIGN_BOTTOM_MASK ) fl_setpup_position( - ( ob->form->x + ob->x + ob->w ), ob->form->y + ob->y - FL_PUP_PADH ); else fl_setpup_position( - ( ob->form->x + ob->x + ob->w ), ob->form->y + ob->y + ob->h + FL_PUP_PADH ); sp->pushed = 0; if ( do_pup( ob ) > 0 ) ret |= FL_RETURN_CHANGED | FL_RETURN_END; break; case FL_LEAVE: sp->below = 0; fl_redraw_object( ob ); break; case FL_ENTER: if ( sp->numitems == 0 ) break; if ( ( ob->type == FL_DROPLIST_CHOICE && Within( ob->x + ob->w - ob->h, ob->y, ob->h, ob->h ) ) || ob->type != FL_DROPLIST_CHOICE ) { sp->below = 1; fl_redraw_object( ob ); } break; case FL_SHORTCUT: if ( sp->numitems == 0 ) break; fl_setpup_position( ob->form->x + ob->x + 10, ob->form->y + ob->y + ob->h / 2 ); val = do_pup( ob ); fl_redraw_object( ob ); if ( val > 0 ) ret |= FL_RETURN_CHANGED | FL_RETURN_END; break; case FL_FREEMEM: free_choice( ob->spec ); fl_free( ob->spec ); break; } return ret; } /*************************************** * Creates an object ***************************************/ FL_OBJECT * fl_create_choice( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; int i; FLI_CHOICE_SPEC *sp; obj = fl_make_object( FL_CHOICE, type, x, y, w, h, label, handle_choice ); obj->boxtype = type == FL_NORMAL_CHOICE2 ? FL_UP_BOX : FL_CHOICE_BOXTYPE; obj->col1 = FL_CHOICE_COL1; obj->col2 = FL_CHOICE_COL2; obj->lcol = FL_CHOICE_LCOL; obj->align = FL_CHOICE_ALIGN; obj->want_update = 1; obj->spec = sp = fl_calloc( 1, sizeof *sp ); sp->fontsize = fli_cntl.choiceFontSize ? fli_cntl.choiceFontSize : FL_DEFAULT_SIZE; sp->fontstyle = FL_NORMAL_STYLE; sp->align = FL_ALIGN_CENTER; for ( i = 0; i <= FL_CHOICE_MAXITEMS; i++ ) { sp->items[ i ] = NULL; sp->shortcut[ i ] = NULL; } fl_set_object_return( obj, FL_RETURN_CHANGED ); return obj; } /*************************************** * Adds an object ***************************************/ FL_OBJECT * fl_add_choice( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * l ) { FL_OBJECT *ob; ob = fl_create_choice( type, x, y, w, h, l ); fl_add_object( fl_current_form, ob ); return ob; } /*************************************** * Clears the choice object ***************************************/ void fl_clear_choice( FL_OBJECT * ob ) { FLI_CHOICE_SPEC *sp = ob->spec; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_CHOICE ) ) { M_err( "fl_clear_choice", "%s is not choice class", ob ? ob->label : "" ); return; } #endif free_choice( sp ); sp->val = 0; sp->numitems = 0; fl_redraw_object( ob ); } /*************************************** * Add a single choice item ***************************************/ static void addto_choice( FL_OBJECT * ob, const char * str ) { FLI_CHOICE_SPEC *sp = ob->spec; if ( sp->numitems >= FL_CHOICE_MAXITEMS ) return; sp->items[ ++sp->numitems ] = fl_strdup( str ); sp->shortcut[ sp->numitems ] = fl_strdup( "" ); sp->mode[ sp->numitems ] = FL_PUP_NONE; sp->modechange[ sp->numitems ] = 0; if ( sp->val == 0 ) { sp->val = 1; fl_redraw_object( ob ); } } /*************************************** * User interface routine. ***************************************/ int fl_addto_choice( FL_OBJECT * ob, const char * str ) { FLI_CHOICE_SPEC *sp = ob->spec; char *t, *c; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_CHOICE ) ) { M_err( "fl_addto_choice", "%s is not choice class", ob ? ob->label : "" ); return 0; } #endif if ( sp->numitems >= FL_CHOICE_MAXITEMS ) return sp->numitems; /* Split up string at '|' chars and create an entry for each part */ t = fl_strdup( str ); for ( c = strtok( t, "|" ); c && sp->numitems < FL_CHOICE_MAXITEMS; c = strtok( NULL, "|" ) ) addto_choice( ob, c ); if ( t ) fl_free( t ); return sp->numitems; } /*************************************** ***************************************/ int fl_addto_choice_f( FL_OBJECT * ob, const char * fmt, ... ) { int n; char *buf; EXPAND_FORMAT_STRING( buf, fmt ); n = fl_addto_choice( ob, buf ); fl_free( buf ); return n; } /*************************************** * Replaces a line to the choice item. ***************************************/ void fl_replace_choice( FL_OBJECT * ob, int numb, const char * str ) { FLI_CHOICE_SPEC *sp = ob->spec; if ( numb < 1 || numb > sp->numitems ) return; if ( sp->items[ numb ] ) fl_free( sp->items[ numb ] ); sp->items[ numb ] = fl_strdup( str ); if ( sp->val == numb ) fl_redraw_object( ob ); } /*************************************** ***************************************/ void fl_replace_choice_f( FL_OBJECT * ob, int numb, const char * fmt, ... ) { char *buf; EXPAND_FORMAT_STRING( buf, fmt ); fl_replace_choice( ob, numb, buf ); fl_free( buf ); } /*************************************** * Removes a line from the choice item. ***************************************/ void fl_delete_choice( FL_OBJECT * ob, int numb ) { int i; FLI_CHOICE_SPEC *sp = ob->spec; if ( numb < 1 || numb > sp->numitems ) return; if ( sp->items[ numb ] ) fl_free( sp->items[ numb ] ); if ( sp->shortcut[ numb ] ) fl_free( sp->shortcut[ numb ] ); for ( i = numb; i < sp->numitems; i++ ) { sp->items[ i ] = sp->items[ i + 1 ]; sp->shortcut[ i ] = sp->shortcut[ i + 1 ]; } sp->items[ sp->numitems ] = NULL; sp->shortcut[ sp->numitems ] = NULL; sp->numitems--; if ( sp->val == numb ) { if ( sp->val > sp->numitems ) sp->val = sp->numitems; fl_redraw_object( ob ); } else if ( sp->val > numb ) sp->val--; } /*************************************** * Sets the number of the choice. ***************************************/ void fl_set_choice( FL_OBJECT * ob, int choice ) { FLI_CHOICE_SPEC *sp = ob->spec; if ( choice < 1 || choice > sp->numitems || sp->mode[ choice ] & FL_PUP_GREY ) sp->val = 0; else sp->val = choice; fl_redraw_object( ob ); } /*************************************** * Similar to set_choice, except we use txt ***************************************/ void fl_set_choice_text( FL_OBJECT * ob, const char * txt ) { FLI_CHOICE_SPEC *sp; int i; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_CHOICE ) ) { M_err( "fl_set_choice_text", "%s not choice class", ob ? ob->label : "" ); return; } #endif sp = ob->spec; for ( i = 1; i <= sp->numitems; i++ ) if ( strcmp( txt, sp->items[ i ] ) == 0 ) { fl_set_choice( ob, i ); return; } M_err( "fl_set_choice_text", "%s not found", txt ); } /*************************************** ***************************************/ void fl_set_choice_text_f( FL_OBJECT * ob, const char * fmt, ... ) { char *buf; EXPAND_FORMAT_STRING( buf, fmt ); fl_set_choice_text( ob, buf ); fl_free( buf ); } /*************************************** ***************************************/ int fl_get_choice_item_mode( FL_OBJECT * ob, int item ) { FLI_CHOICE_SPEC *sp = ob->spec; if ( item < 1 || item > sp->numitems ) { M_err( "fl_get_choice_item_mode", "Bad item index %d", item ); return -1; } return sp->mode[ item ]; } /*************************************** * Set the mode of an item in a choice object ***************************************/ void fl_set_choice_item_mode( FL_OBJECT * ob, int item, unsigned int mode ) { FLI_CHOICE_SPEC *sp = ob->spec; if ( item < 1 || item > sp->numitems ) { M_err( "fl_set_choice_item_mode", "Bad item index %d", item ); return; } sp->mode[ item ] = mode; sp->modechange[ item ] = 1; } /*************************************** ***************************************/ void fl_set_choice_item_shortcut( FL_OBJECT * ob, int item, const char * sc ) { FLI_CHOICE_SPEC *sp = ob->spec; if ( item < 1 || item > sp->numitems ) { M_err( "fl_set_choice_item_shortcut", "Bad item index %d", item ); return; } if ( sp->shortcut[ item ] ) fl_free( sp->shortcut[ item ] ); sp->shortcut[ item ] = fl_strdup( sc ? sc : "" ); } /*************************************** * Returns the number of the choice. ***************************************/ int fl_get_choice( FL_OBJECT * ob ) { #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_CHOICE ) ) { M_err( "fl_get_choice", "%s is not choice class", ob ? ob->label : "" ); return 0; } #endif return ( ( FLI_CHOICE_SPEC * ) ob->spec )->val; } /*************************************** ***************************************/ int fl_get_choice_maxitems( FL_OBJECT * ob ) { return ( ( FLI_CHOICE_SPEC * ) ob->spec )->numitems; } /*************************************** * Returns the text of the choice. ***************************************/ const char * fl_get_choice_text( FL_OBJECT * ob ) { FLI_CHOICE_SPEC *sp = ob->spec; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_CHOICE ) ) { M_err( "fl_get_choice_text", "%s is not choice class", ob ? ob->label : "" ); return 0; } #endif if ( sp->val == 0 ) return NULL; return sp->items[ sp->val ]; } /*************************************** ***************************************/ const char * fl_get_choice_item_text( FL_OBJECT * ob, int n ) { FLI_CHOICE_SPEC *sp = ob->spec; if ( n < 1 || n > sp->numitems ) return NULL; return sp->items[ n ]; } /*************************************** * Sets the font size inside the choice. ***************************************/ void fl_set_choice_fontsize( FL_OBJECT * ob, int size ) { FLI_CHOICE_SPEC *sp = ob->spec; if ( sp->fontsize != size ) { sp->fontsize = size; fl_redraw_object( ob ); } } /*************************************** * Sets the font style inside the choice. ***************************************/ void fl_set_choice_fontstyle( FL_OBJECT * ob, int style ) { FLI_CHOICE_SPEC *sp = ob->spec; if ( sp->fontstyle != style ) { sp->fontstyle = style; fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_set_choice_align( FL_OBJECT * ob, int align ) { FLI_CHOICE_SPEC *sp = ob->spec; if ( sp->align != align ) { sp->align = align; fl_redraw_object( ob ); } } /*************************************** ***************************************/ int fl_set_choice_entries(FL_OBJECT * ob, FL_PUP_ENTRY * ent ) { int i, k; fl_clear_choice( ob ); for ( k = 0; ent && ent->text; ent++, k++ ) { i = fl_addto_choice( ob, ent->text ); if ( ent->mode == FL_PUP_GRAY ) fl_set_choice_item_mode( ob, i, ent->mode ); if ( ent->shortcut && *ent->shortcut ) fl_set_choice_item_shortcut( ob, i, ent->shortcut ); } return k; } /*************************************** ***************************************/ int fl_set_choice_notitle( FL_OBJECT * ob, int n ) { FLI_CHOICE_SPEC *sp = ob->spec; int old = sp->no_title & NO_TITLE_MASK ? 1 : 0; if ( n ) sp->no_title |= NO_TITLE_MASK; else sp->no_title &= ~ NO_TITLE_MASK; return old; } /*************************************** ***************************************/ int fl_set_choice_align_bottom( FL_OBJECT * ob, int n ) { FLI_CHOICE_SPEC *sp = ob->spec; int old = sp->no_title & ALIGN_BOTTOM_MASK ? 1 : 0; if ( n ) sp->no_title |= ALIGN_BOTTOM_MASK; else sp->no_title &= ~ ALIGN_BOTTOM_MASK; return old; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/goodie_input.c0000644000175000017500000001154112251554173013363 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file goodie_input.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include typedef struct { FL_FORM * form; FL_OBJECT * input; FL_OBJECT * cancel; FL_OBJECT * clear; FL_OBJECT * ok; } FD_input; /*************************************** * Callback for "Clear" button ***************************************/ static void clear_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { fl_set_input( ( ( FD_input * ) ob->form->fdui )->input, "" ); } /*************************************** ***************************************/ static FD_input * create_form_input( const char *str1, const char *defstr ) { FL_OBJECT *obj; FD_input *fdui = fl_calloc( 1, sizeof *fdui ); int oldy = fli_inverted_y; int oldu = fl_get_coordunit( ); fli_inverted_y = 0; fl_set_coordunit( FL_COORD_PIXEL ); fdui->form = fl_bgn_form( FL_FLAT_BOX, 410, 120 ); fl_set_form_title( fdui->form, "Input" ); fl_add_frame( FL_ENGRAVED_FRAME, 8, 9, 394, 67, "" ); fdui->input = obj = fl_add_input( FL_NORMAL_INPUT, 20, 33, 370, 30, str1 ); fl_set_object_lalign( obj, FL_ALIGN_LEFT_TOP ); fl_set_input( obj, defstr ); fdui->cancel = obj = fl_add_button( FL_NORMAL_BUTTON, 30, 85, 80, 26, "Cancel" ); fli_parse_goodies_label( obj, FLInputCancelLabel ); fl_set_button_shortcut( obj, "^[", 1 ); fdui->clear = obj = fl_add_button( FL_NORMAL_BUTTON, 300, 85, 80, 26, "Clear" ); fli_parse_goodies_label( obj, FLInputClearLabel ); fl_set_object_callback( obj, clear_cb, 0 ); fdui->ok = obj = fl_add_button( FL_RETURN_BUTTON, 165, 85, 80, 26, "Ok" ); fli_parse_goodies_label( obj, FLOKLabel ); fl_end_form( ); fl_adjust_form_size( fdui->form ); fdui->form->fdui = fdui; fl_set_form_hotobject( fdui->form, fdui->ok ); fl_set_form_atclose( fdui->form, fl_goodies_atclose, fdui->ok ); fl_register_raw_callback( fdui->form, FL_ALL_EVENT, fli_goodies_preemptive ); fli_handle_goodie_font( fdui->ok, fdui->input ); fli_handle_goodie_font( fdui->cancel, fdui->clear ); fli_get_goodie_title( fdui->form, FLInputTitle ); fli_inverted_y = oldy; fl_set_coordunit( oldu ); return fdui; } static FD_input *fd_input = NULL; static char *ret_str = NULL; /*************************************** * Asks the user for textual input ***************************************/ const char * fl_show_input( const char *str1, const char *defstr ) { FL_OBJECT *retobj; if ( fd_input ) { fl_hide_form( fd_input->form ); fl_free_form( fd_input->form ); fli_safe_free( fd_input ); } else fl_deactivate_all_forms( ); fli_safe_free( ret_str ); fd_input = create_form_input( str1, defstr ); fl_show_form( fd_input->form, FL_PLACE_HOTSPOT, FL_TRANSIENT, fd_input->form->label ); fl_update_display( 0 ); /* Grab keyboard focus */ fl_winfocus( fd_input->form->window ); while ( ( retobj = fl_do_only_forms( ) ) != fd_input->ok && retobj != fd_input->cancel ) /* empty */ ; if ( retobj == fd_input->ok ) ret_str = fl_strdup( fl_get_input( fd_input->input ) ); fl_hide_form( fd_input->form ); fl_free_form( fd_input->form ); fli_safe_free( fd_input ); fl_activate_all_forms( ); return ret_str; } /*************************************** ***************************************/ void fl_hide_input( void ) { if ( fd_input ) fl_trigger_object( fd_input->cancel ); else M_warn( "fl_hide_input", "No input box is shown" ); } /*************************************** ***************************************/ void fli_input_cleanup( void ) { fli_safe_free( fd_input ); fli_safe_free( ret_str ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/counter.c0000664000175000017500000004624012353623325012362 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file counter.c *. * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Counter class */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/pcounter.h" #include #include #include /* Give each component a name. parts are numbered 01 4 23, i.e. OB0 is the button for reducing the counter value in large steps, OB1 the one for reducing the value in small steps, OB2 the one for increasing the value in small steps, OB3 the one for increasing the value in large steps and finally OB4 the field with the counters value. */ enum { NONE, OB0 = 1, OB1 = 2, OB2 = 4, OB3 = 8, OB4 = 16, ALL = 31 }; /*************************************** * Draws a counter ***************************************/ static void draw_counter( FL_OBJECT * ob ) { char str[ 64 ]; int i, btype[ 5 ]; FLI_COUNTER_SPEC *sp = ob->spec; /* Compute boxtypes if pushed */ for ( i = 0; i < 5; i++ ) if ( ob->pushed && FL_IS_UPBOX( ob->boxtype ) && ( sp->mouseobj & ( 1 << i ) ) ) btype[i] = FL_TO_DOWNBOX( ob->boxtype ); else btype[ i ] = ob->boxtype; if ( btype[ 4 ] == FL_UP_BOX ) btype[ 4 ] = FL_DOWN_BOX; /* Compute sizes. Must not leave any gaps otherwise double buffering will not work correctly */ if ( ob->type == FL_NORMAL_COUNTER ) { /* Button is numbered 01 4 23 */ sp->ww[ 0 ] = sp->ww[ 1 ] = sp->ww[ 2 ] = sp->ww[ 3 ] = FL_min( 0.18 * ob->w, ob->h ); sp->ww[ 4 ] = ob->w - 4 * sp->ww[ 0 ]; /* must calculate this way */ sp->xx[ 0 ] = ob->x; sp->xx[ 1 ] = sp->xx[ 0 ] + sp->ww[ 0 ]; sp->xx[ 4 ] = sp->xx[ 1 ] + sp->ww[ 1 ]; sp->xx[ 2 ] = sp->xx[ 4 ] + sp->ww[ 4 ]; sp->xx[ 3 ] = sp->xx[ 2 ] + sp->ww[ 2 ]; } else { /* 1 4 2 */ sp->ww[ 1 ] = sp->ww[ 2 ] = FL_min( 0.20 * ob->w, ob->h ); sp->ww[ 4 ] = ob->w - 2 * sp->ww[ 1 ]; sp->xx[ 1 ] = ob->x; sp->xx[ 4 ] = ob->x + sp->ww[ 1 ]; sp->xx[ 2 ] = sp->xx[ 4 ] + sp->ww[ 4 ]; } if ( sp->filter ) strcpy( str, sp->filter( ob, sp->val, sp->prec ) ); else sprintf( str, "%.*f", sp->prec, sp->val ); /* Only draw the parts that need to be drawn */ if ( ob->type == FL_NORMAL_COUNTER && sp->draw_type & OB0 ) { fl_draw_box( btype[ 0 ], sp->xx[ 0 ], ob->y, sp->ww[ 0 ], ob->h, ob->col1, ob->bw ); fl_draw_text( FL_ALIGN_CENTER, sp->xx[ 0 ], ob->y, sp->ww[ 0 ], ob->h, ob->col2, 0, 0, "@#<<" ); } if ( sp->draw_type & OB1 ) { fl_draw_box( btype[ 1 ], sp->xx[ 1 ], ob->y, sp->ww[ 1 ], ob->h, ob->col1, ob->bw ); fl_draw_text( FL_ALIGN_CENTER, sp->xx[ 1 ], ob->y, sp->ww[ 1 ], ob->h, ob->col2, 0, 0, "@#<" ); } if ( sp->draw_type & OB4 ) { fl_draw_box( btype[ 4 ], sp->xx[ 4 ], ob->y, sp->ww[ 4 ], ob->h, ob->col1, ob->bw ); fl_set_text_clipping( sp->xx[ 4 ], ob->y, sp->ww[ 4 ], ob->h ); fl_draw_text( FL_ALIGN_CENTER, sp->xx[ 4 ], ob->y, sp->ww[ 4 ], ob->h, ob->lcol, ob->lstyle, ob->lsize, str ); fl_unset_text_clipping( ); } if ( sp->draw_type & OB2 ) { fl_draw_box( btype[ 2 ], sp->xx[ 2 ], ob->y, sp->ww[ 2 ], ob->h, ob->col1, ob->bw ); fl_draw_text( FL_ALIGN_CENTER, sp->xx[ 2 ], ob->y, sp->ww[ 2 ], ob->h, ob->col2, 0, 0, "@#>" ); } if ( ob->type == FL_NORMAL_COUNTER && sp->draw_type & OB3 ) { fl_draw_box( btype[ 3 ], sp->xx[ 3 ], ob->y, sp->ww[ 3 ], ob->h, ob->col1, ob->bw ); fl_draw_text( FL_ALIGN_CENTER, sp->xx[ 3 ], ob->y, sp->ww[ 3 ], ob->h, ob->col2, 0, 0, "@#>>" ); } if ( sp->draw_type == ALL ) fl_draw_object_label_outside( ob ); sp->draw_type = ALL; } /*************************************** * Buttons are numbered as 01 4 23 ***************************************/ static void calc_mouse_obj( FL_OBJECT * ob, FL_Coord mx, FL_Coord my ) { FLI_COUNTER_SPEC *sp = ob->spec; sp->mouseobj = NONE; if ( my < ob->y || my > ob->y + ob->h || mx < ob->x ) return; /* 01 4 23 */ if ( ob->type == FL_NORMAL_COUNTER ) { if ( mx < ob->x + sp->ww[ 0 ] ) sp->mouseobj = OB0; else if ( mx < sp->ww[ 1 ] + sp->xx[ 1 ] ) sp->mouseobj = OB1; else if ( mx < sp->ww[ 4 ] + sp->xx[ 4 ] ) sp->mouseobj = OB4; else if ( mx < sp->ww[ 2 ] + sp->xx[ 2 ] ) sp->mouseobj = OB2; else if ( mx < sp->ww[ 3 ] + sp->xx[ 3 ] ) sp->mouseobj = OB3; } else { /* 1 4 2 */ if ( mx < ob->x + sp->ww[ 1 ] ) sp->mouseobj = OB1; else if ( mx < sp->xx[ 4 ] + sp->ww[ 4 ] ) sp->mouseobj = OB4; else if ( mx < sp->xx[ 2 ] + sp->ww[ 2 ] ) sp->mouseobj = OB2; } } /*************************************** ***************************************/ int fl_get_counter_repeat( FL_OBJECT * ob ) { return ( ( FLI_COUNTER_SPEC * ) ob->spec )->repeat_ms; } /*************************************** ***************************************/ void fl_set_counter_repeat( FL_OBJECT * ob, int millisec ) { if ( millisec <= 0 ) { M_warn( "fl_set_counter_repeat", "Invalid argument, disregarded" ); return; } ( ( FLI_COUNTER_SPEC * ) ob->spec )->repeat_ms = millisec; } /*************************************** ***************************************/ int fl_get_counter_min_repeat( FL_OBJECT * ob ) { return ( ( FLI_COUNTER_SPEC * ) ob->spec )->min_repeat_ms; } /*************************************** ***************************************/ void fl_set_counter_min_repeat( FL_OBJECT * ob, int millisec ) { if ( millisec <= 0 ) { M_warn( "fl_set_counter_min_repeat", "Invalid argument, disregarded" ); return; } ( ( FLI_COUNTER_SPEC * ) ob->spec )->min_repeat_ms = millisec; } /*************************************** ***************************************/ int fl_get_counter_speedjump( FL_OBJECT * ob ) { return ( ( FLI_COUNTER_SPEC * ) ob->spec )->do_speedjump; } /*************************************** ***************************************/ void fl_set_counter_speedjump( FL_OBJECT * ob, int yes_no ) { ( ( FLI_COUNTER_SPEC * ) ob->spec )->do_speedjump = yes_no != 0; } /*************************************** ***************************************/ static void timeoutCB( int val FL_UNUSED_ARG, void * data ) { ( ( FLI_COUNTER_SPEC * ) data )->timeout_id = -1; } /*************************************** * Show which button is active by highlighting the button ***************************************/ static void show_focus_obj( FL_OBJECT * ob, FL_Coord mx, FL_Coord my ) { FLI_COUNTER_SPEC *sp = ob->spec; unsigned int oldobj = sp->mouseobj; calc_mouse_obj( ob, mx, my ); /* If same object, do nothing */ if ( sp->mouseobj == oldobj ) return; if ( sp->mouseobj && sp->mouseobj != OB4 && sp->mouseobj != oldobj ) { FL_COLOR old = ob->col1; sp->draw_type = sp->mouseobj; ob->col1 = FL_MCOL; fl_redraw_object( ob ); sp->draw_type = oldobj; ob->col1 = old; fl_redraw_object( ob ); } else if ( ( sp->mouseobj == NONE || sp->mouseobj == OB4 ) && oldobj ) { sp->draw_type = oldobj; fl_redraw_object( ob ); } } /*************************************** * Handles mouse related events ***************************************/ static int handle_mouse( FL_OBJECT * ob, int event, FL_Coord mx, FL_Coord my ) { FLI_COUNTER_SPEC *sp = ob->spec; int ret = FL_RETURN_NONE; switch ( event ) { /* On mouse push store the old value of the counter, set up the time values for speeding up updates while the mouse is pressed down, check where the mouse is and, if it's on one of the buttons, we're going to change the counters value. Reset the value for the timeout just to make sure */ case FL_PUSH : sp->start_val = sp->val; sp->cur_repeat_ms = sp->repeat_ms; calc_mouse_obj( ob, mx, my ); if ( sp->mouseobj != NONE ) ret |= FL_RETURN_CHANGED; sp->timeout_id = -1; break; /* On release stop the update timer (if it's still running), set flag that indicates we're on a button and return end of inter- action */ case FL_RELEASE : if ( sp->timeout_id != -1 ) { fl_remove_timeout( sp->timeout_id ); sp->timeout_id = -1; } sp->mouseobj = NONE; fl_redraw_object( ob ); ret |= FL_RETURN_END; break; /* During an update (and if we're on a button) and the timer has expired a change of the counters value is in order */ case FL_UPDATE : if ( sp->mouseobj != NONE && sp->timeout_id == -1 ) ret |= FL_RETURN_CHANGED; break; } /* Handle changes of the counter value */ if ( ret == FL_RETURN_CHANGED ) { double oval = sp->val; /* (Re)start the timer */ sp->timeout_id = fl_add_timeout( sp->cur_repeat_ms, timeoutCB, sp ); /* If 'speedjump' hasn't been switched on and we didn't reach the final speed reduce the timeout value by a third of the remaining difference (the extra substraction of 2 makes sure we can reach it in all circumstances) */ if ( ! sp->do_speedjump && sp->cur_repeat_ms > sp->min_repeat_ms ) { sp->cur_repeat_ms -= ( sp->cur_repeat_ms - sp->min_repeat_ms ) / 3 + 2; sp->cur_repeat_ms = FL_max( sp->cur_repeat_ms, sp->min_repeat_ms ); } /* If 'speedjump' has been switched on but initial and final speed aren't identical it means that we have a long delay at the start and then short timeouts afterwards */ if ( sp->do_speedjump && sp->cur_repeat_ms > sp->min_repeat_ms ) sp->cur_repeat_ms = sp->min_repeat_ms; /* Change the counters value according to which button we're on */ if ( sp->mouseobj == OB0 ) sp->val -= sp->lstep; if ( sp->mouseobj == OB1 ) sp->val -= sp->sstep; if ( sp->mouseobj == OB2 ) sp->val += sp->sstep; if ( sp->mouseobj == OB3 ) sp->val += sp->lstep; sp->val = fli_clamp( sp->val, sp->min, sp->max ); /* Redraw the central field with the new value */ if ( sp->val != oval ) { sp->draw_type = sp->mouseobj | OB4; fl_redraw_object( ob ); } } return ret; } /*************************************** * Handles an event ***************************************/ static int handle_counter( FL_OBJECT * ob, int event, FL_Coord mx, FL_Coord my, int key FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { FLI_COUNTER_SPEC *sp = ob->spec; int ret = FL_RETURN_NONE; switch ( event ) { case FL_ATTRIB : ob->align = fl_to_outside_lalign( ob->align ); break; case FL_DRAW: draw_counter( ob ); break; case FL_DRAWLABEL: fl_draw_object_label_outside( ob ); break; case FL_PUSH: case FL_UPDATE: if ( key != FL_MBUTTON1 ) break; if ( ( ret |= handle_mouse( ob, event, mx, my ) ) && ! ( ob->how_return & FL_RETURN_END_CHANGED ) ) sp->start_val = sp->val; break; case FL_RELEASE: if ( key != FL_MBUTTON1 ) break; ret |= handle_mouse( ob, event, mx, my ); show_focus_obj( ob, mx, my ); if ( sp->start_val != sp->val ) ret |= FL_RETURN_CHANGED; break; case FL_MOTION: case FL_ENTER: case FL_LEAVE: show_focus_obj( ob, mx, my ); break; case FL_FREEMEM: fl_free( ob->spec ); break; } return ret; } /*************************************** * Creates an object ***************************************/ FL_OBJECT * fl_create_counter( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob; FLI_COUNTER_SPEC *sp; ob = fl_make_object( FL_COUNTER, type, x, y, w, h, label, handle_counter ); ob->boxtype = FL_COUNTER_BOXTYPE; ob->col1 = FL_COUNTER_COL1; ob->col2 = FL_COUNTER_COL2; ob->align = FL_COUNTER_ALIGN; ob->lcol = FL_COUNTER_LCOL; ob->want_motion = 1; ob->want_update = 1; // ob->bw = FL_COUNTER_BW; sp = ob->spec = fl_calloc( 1, sizeof *sp ); sp->min = -1000000.0; sp->max = 1000000.0; sp->sstep = 0.1; sp->lstep = 1.0; sp->val = 0.0; sp->prec = 1; sp->mouseobj = NONE; sp->draw_type = ALL; sp->filter = NULL; sp->min_repeat_ms = 50; sp->repeat_ms = 600; sp->do_speedjump = 0; sp->timeout_id = -1; /* Set default return policy for the object */ fl_set_object_return( ob, FL_RETURN_CHANGED ); return ob; } /*************************************** * Adds an object ***************************************/ FL_OBJECT * fl_add_counter( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob = fl_create_counter( type, x, y, w, h, label ); fl_add_object( fl_current_form, ob ); return ob; } /*************************************** ***************************************/ void fl_set_counter_value( FL_OBJECT * ob, double val ) { FLI_COUNTER_SPEC *sp = ob->spec; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_COUNTER ) ) { M_err( "fl_set_counter_value", "%s not a counter", ob ? ob->label : "" ); return; } #endif val = fli_clamp( val, sp->min, sp->max ); if ( sp->val != val ) { sp->val = sp->start_val = val; sp->draw_type = ( ob->visible && ob->form->visible ) ? OB4 : ALL; fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_get_counter_bounds( FL_OBJECT * ob, double * min, double * max ) { FLI_COUNTER_SPEC *sp = ob->spec; *min = sp->min; *max = sp->max; } /*************************************** ***************************************/ void fl_set_counter_bounds( FL_OBJECT * ob, double min, double max ) { FLI_COUNTER_SPEC *sp = ob->spec; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_COUNTER ) ) { M_err( "fl_set_counter_bounds", "%s not a counter", ob ? ob->label : "" ); return; } #endif if ( sp->min != min || sp->max != max ) { sp->min = min; sp->max = max; sp->val = fli_clamp( sp->val, sp->min, sp->max ); fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_set_counter_step( FL_OBJECT * ob, double s, double l ) { FLI_COUNTER_SPEC *sp = ob->spec; if ( sp->sstep != s || sp->lstep != l ) { sp->sstep = s; sp->lstep = l; fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_get_counter_step( FL_OBJECT * ob, double * s, double * l ) { FLI_COUNTER_SPEC *sp = ob->spec; *s = sp->sstep; *l = sp->lstep; } /*************************************** ***************************************/ void fl_set_counter_precision( FL_OBJECT * ob, int prec ) { FLI_COUNTER_SPEC *sp = ob->spec; if ( prec < 0 ) prec = 0; if ( prec > DBL_DIG ) prec = DBL_DIG; if ( sp->prec != prec ) { sp->prec = prec; fl_redraw_object( ob ); } } /*************************************** ***************************************/ int fl_get_counter_precision( FL_OBJECT * ob ) { return ( ( FLI_COUNTER_SPEC * ) ob->spec )->prec; } /*************************************** ***************************************/ double fl_get_counter_value( FL_OBJECT * ob ) { #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_COUNTER ) ) { M_err( "fl_get_counter_value", "%s not a counter", ob ? ob->label : "" ); return 0; } #endif return ( ( FLI_COUNTER_SPEC * ) ob->spec )->val; } /*************************************** * Sets under which conditions the object is to be returned to the * application. This function should be regarded as deprecated and * fl_set_object_return() should be used instead. ***************************************/ void fl_set_counter_return( FL_OBJECT * obj, unsigned int when ) { fl_set_object_return( obj, when ); } /*************************************** ***************************************/ void fl_set_counter_filter( FL_OBJECT * ob, FL_VAL_FILTER filter ) { ( ( FLI_COUNTER_SPEC * ) ob->spec )->filter = filter; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/global.c0000644000175000017500000000536612344062243012141 00000000000000/* * * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file global.c * * This file is part of the XForms library package. * Copyright (c) 1996-1998 T.C. Zhao and Mark Overmars * All rights reserved. * * All gloabl varialbes used in XForms. It is important to start all * variables with fl/FL or fli/FLI to avoid name space pollution. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" Window fl_root, fl_vroot; int fl_screen; /* memory routines */ void * ( * fl_calloc )( size_t, size_t ) = calloc; void * ( * fl_malloc )( size_t ) = malloc; void * ( * fl_realloc )( void *, size_t ) = realloc; void ( * fl_free )( void * ) = free; FL_State fl_state[ 6 ]; int fl_vmode = -1; int fl_scrh, fl_scrw; char *fl_ul_magic_char = "\b"; XKeyboardControl fli_keybdcontrol; unsigned long fli_keybdmask = ( 1L << 8 ) - 1; double fl_dpi = 96.0; int fli_inverted_y; long fli_requested_vid; FLI_INTERNAL fli_int = { NULL, /* forms */ 0, /* formnumb */ 0, /* hidden_formnumb */ 0, /* auto)count */ 0, /* unmanaged_count */ 0, /* mousex */ 0, /* mousey */ 0, /* keymask */ UINT_MAX, /* query_age */ NULL, /* mouseform */ NULL, /* keyform */ NULL, /* pushobj */ NULL /* mouseobj */ }; FL_IOPT fli_cntl; FLI_CONTEXT *fli_context; char fli_curfnt[ 127 ]; FL_FORM *fl_current_form; FL_OBJECT *fli_current_group; int fli_no_connection = 0; /* Set only when fdesign is run with the '-convert' option */ FLI_WIN *fli_app_win; FL_OBJECT *FL_EVENT = ( FL_OBJECT * ) - 1L; /* The special event object */ FLI_TARGET *flx; /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/box.c0000664000175000017500000000603712353623325011473 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file box.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" /*************************************** ***************************************/ static int handle_box( FL_OBJECT * obj, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { switch ( event ) { case FL_DRAW: fl_draw_box( obj->boxtype, obj->x, obj->y, obj->w, obj->h, obj->col1, obj->bw ); /* fall through */ case FL_DRAWLABEL: if ( fl_is_inside_lalign( obj->align ) ) fl_set_text_clipping( obj->x + obj->bw, obj->y + obj->bw, obj->w - 2 * obj->bw, obj->h - 2 * obj->bw ); fl_draw_object_label( obj ); if ( fl_is_inside_lalign( obj->align ) ) fl_unset_text_clipping( ); break; } return FL_RETURN_NONE; } /*************************************** ***************************************/ FL_OBJECT * fl_create_box( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj; obj = fl_make_object( FL_BOX, type, x, y, w, h, label, handle_box ); obj->boxtype = type; obj->col1 = FL_COL1; obj->col2 = FL_COL1; obj->lcol = FL_LCOL; obj->align = FL_ALIGN_CENTER; obj->active = 0; if ( type == FL_NO_BOX || type == FL_FLAT_BOX ) obj->bw = 0; return obj; } /*************************************** ***************************************/ FL_OBJECT * fl_add_box( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label) { FL_OBJECT *obj = fl_create_box( type, x, y, w, h, label ); fl_add_object( fl_current_form, obj ); return obj; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/popup.c0000664000175000017500000035541512353623325012055 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/flvasprintf.h" #include /*************************************** * Local global variables ***************************************/ /* Head of linked list of popups */ static FL_POPUP *popups = NULL; /* Default policy (i.e. does popup get closed when the user releases the mouse button when not on an active entry or not?) */ static int popup_policy; /* Default font styles and sizes for title and entries */ static int popup_entry_font_style; static int popup_title_font_style; static int popup_entry_font_size; static int popup_title_font_size; /* Default color of popup */ static FL_COLOR popup_bg_color; /* Default color of entry the mouse is over (unless disabled) */ static FL_COLOR popup_on_color; /* Default color of title text */ static FL_COLOR popup_title_color; /* Default color of normal entrys text */ static FL_COLOR popup_text_color; /* Default color of entrys text when mouse is on the entry (unless disabled) */ static FL_COLOR popup_text_on_color; /* Default color of disabled entrys text */ static FL_COLOR popup_text_off_color; /* Default color of button for radio entries */ static FL_COLOR popup_radio_color; /* Default popup border width */ static int popup_bw; /* Default cursor type to be used */ static int popup_cursor; /*************************************** * Local functions * ***************************************/ static FL_POPUP_ENTRY *parse_entries( FL_POPUP *, char *, va_list, const char *, int ); static FL_POPUP_ENTRY * failed_add( FL_POPUP_ENTRY * ); static int check_sub( FL_POPUP_ENTRY * ); static void radio_check( FL_POPUP_ENTRY * ); static void convert_shortcut( const char *, FL_POPUP_ENTRY * ); static void recalc_popup( FL_POPUP * ); static void title_dimensions( FL_POPUP *, unsigned int *, unsigned int * ); static void entry_text_dimensions( FL_POPUP_ENTRY *, unsigned int *, unsigned int * ); static void draw_popup( FL_POPUP * ); static void draw_title( FL_POPUP * ); static void draw_entry( FL_POPUP_ENTRY * ); static void calculate_window_position( FL_POPUP * ); static void create_popup_window( FL_POPUP * ); static void grab( FL_POPUP * ); static void close_popup( FL_POPUP *, int ); static FL_POPUP_RETURN * popup_interaction( FL_POPUP * ); static int is_on_popups( FL_POPUP * pooup, int x, int y ); static FL_POPUP_RETURN * handle_selection( FL_POPUP_ENTRY * ); static FL_POPUP * handle_motion( FL_POPUP *, int, int ); static void motion_shift_window( FL_POPUP *, int *, int * ); static FL_POPUP * handle_key( FL_POPUP *, XKeyEvent *, FL_POPUP_ENTRY ** ); static void key_shift_window( FL_POPUP *, FL_POPUP_ENTRY * ); static FL_POPUP * open_subpopup( FL_POPUP_ENTRY * ); static FL_POPUP_ENTRY * handle_shortcut( FL_POPUP *, long, unsigned int ); static void enter_leave( FL_POPUP_ENTRY *, int ); static FL_POPUP * find_popup( int, int ); static FL_POPUP_ENTRY * find_entry( FL_POPUP *, int, int ); static void setup_subpopups( FL_POPUP * ); static char * cleanup_string( char * ); static void set_need_recalc( FL_POPUP * ); /*************************************** * #defines ***************************************/ /* Inner padding is used within the title box of popups only */ #define INNER_PADDING_LEFT 3 #define INNER_PADDING_RIGHT 3 #define INNER_PADDING_TOP 3 #define INNER_PADDING_BOTTOM 3 /* Spacing around title and entries of a popup */ #define OUTER_PADDING_LEFT 3 #define OUTER_PADDING_RIGHT 3 #define OUTER_PADDING_TOP 0 #define OUTER_PADDING_BOTTOM 0 /* Vert. spacing between symbols (box, hook, triangle) and text in an entry */ #define SYMBOL_PADDING 0 /* Height of the box for separation line in popup, must be at least 3 */ #define LINE_HEIGHT 4 /* Extra offsets added by fl_draw_text() that need to be taken into account (see variables 'xoff' and 'yoff' of 'fli_draw_text_inside()' in xtext.c) */ #define STR_OFFSET_X 5 #define STR_OFFSET_Y 4 /* Amount window is shifted in horizontal direction if the popup doesn't fit on the screen in that direction and delay (in usec) between shifts (in both directions) when the user is pushing the mouse at the screen borders */ #define WINDOW_SHIFT ( fl_scrw / 10 ) #define WINDOW_SHIFT_DELAY 100000 /* Macro for testing if a popup entry can be made "active" (i.e. if it gets highlighted when under the mouse) */ #define IS_ACTIVATABLE( e ) \ ( ( e )->type != FL_POPUP_LINE \ && ! ( ( e ) ->state & ( FL_POPUP_HIDDEN | FL_POPUP_DISABLED ) ) ) /*************************************** * Create a new popup ***************************************/ FL_POPUP * fl_popup_add( Window win, const char * title ) { return fli_popup_add( win, title, "fl_popup_add" ); } /*************************************** * Internal function to create a new popup ***************************************/ FL_POPUP * fli_popup_add( Window win, const char * title, const char * caller ) { FL_POPUP *p; /* Try to get memory for the popup itself and the optional title string */ if ( ( p = fl_malloc( sizeof *p ) ) == NULL ) { M_err( caller, "Running out of memory" ); return NULL; } if ( ! title || ! *title ) p->title = NULL; else if ( ( p->title = fl_strdup( title ) ) == NULL ) { fl_free( p ); M_err( caller, "Running out of memory" ); return NULL; } /* Link the new popup into the list of popups */ p->next = NULL; if ( popups == NULL ) { popups = p; p->prev = NULL; } else { p->prev = popups; while ( p->prev->next != NULL ) p->prev = p->prev->next; p->prev->next = p; } p->parent = NULL; p->top_parent = p; /* points at itself except for sub-popups */ p->win = None; p->parent_win = win != None ? win : fl_root; p->cursor = fli_get_cursor_byname( popup_cursor ); p->entries = NULL; p->callback = NULL; p->use_req_pos = 0; p->need_recalc = 1; p->min_width = 0; p->has_subs = 0; p->has_boxes = 0; p->counter = 0; p->policy = popup_policy; fl_popup_set_title_font( p, popup_title_font_style, popup_title_font_size ); fl_popup_entry_set_font( p, popup_entry_font_style, popup_entry_font_size ); p->bw = popup_bw; p->on_color = popup_on_color; p->bg_color = popup_bg_color; p->title_color = popup_title_color; p->text_color = popup_text_color; p->text_on_color = popup_text_on_color; p->text_off_color = popup_text_off_color; p->radio_color = popup_radio_color; return p; } /*************************************** * Add (append) entries to a popup ***************************************/ FL_POPUP_ENTRY * fl_popup_add_entries( FL_POPUP * popup, const char * entries, ... ) { FL_POPUP_ENTRY *new_entries; va_list ap; va_start( ap, entries ); new_entries = fli_popup_add_entries( popup, entries, ap, "fl_popup_add_entries", 0 ); va_end( ap ); return new_entries; } /*************************************** * Internal function to add entries ***************************************/ FL_POPUP_ENTRY * fli_popup_add_entries( FL_POPUP * popup, const char * entries, va_list ap, const char * caller, int simple ) { FL_POPUP_ENTRY *new_entries, *e; char *str; /* Calling this function with no string for the entries doesn't make sense */ if ( entries == NULL ) { M_err( caller, "NULL entries argument" ); return NULL; } /* Check if the popup we're supposed to add to does exist at all */ if ( fli_check_popup_exists( popup ) ) { M_err( caller, "Popup does not exist" ); return NULL; } /* Now analyze the string with the information about the entries */ if ( ( str = fl_strdup( entries ) ) == NULL ) { M_err( caller, "Running out of memory" ); return NULL; } new_entries = parse_entries( popup, str, ap, caller, simple ); fl_free( str ); /* A return value of NULL says something went wrong (warning was altready output) */ if ( new_entries == NULL ) return NULL; /* Now all left to do is append the list of new entries to the list of already existing ones (if there are any) */ if ( popup->entries == NULL ) popup->entries = new_entries; else { for ( e = popup->entries; e->next != NULL; e = e->next ) /* empty */ ; e->next = new_entries; new_entries->prev = e; } /* Make sure all sub-popus are set up correctly */ setup_subpopups( popup ); /* Set flag that indicates that the dimension of the popup have to be recalculated */ set_need_recalc( popup ); /* Return a pointer to the first of the newly added entries */ return new_entries; } /*************************************** * Insert new entries after an entry (use NULL for inserting at the start) ***************************************/ FL_POPUP_ENTRY * fl_popup_insert_entries( FL_POPUP * popup, FL_POPUP_ENTRY * after, const char * entries, ... ) { FL_POPUP_ENTRY *new_entries; va_list ap; va_start( ap, entries ); new_entries = fli_popup_insert_entries( popup, after, entries, ap, "fl_popup_insert_entries", 0 ); va_end( ap ); return new_entries; } /*************************************** * Internal function to insert new entries after an entry ***************************************/ FL_POPUP_ENTRY * fli_popup_insert_entries( FL_POPUP * popup, FL_POPUP_ENTRY * after, const char * entries, va_list ap, const char * caller, int simple) { FL_POPUP_ENTRY *new_entries, *new_last, *e; char *str; if ( after != NULL ) { for ( e = popup->entries; e != NULL; e = e->next ) if ( e == after ) break; if ( e == NULL ) { M_err( caller, "Invalid 'after' argument" ); return NULL; } } /* Calling this function with no string for the entries doesn't make sense */ if ( entries == NULL ) { M_err( caller, "NULL entries argument" ); return NULL; } /* Check if the popup we're supposed to add to does exist at all */ if ( fli_check_popup_exists( popup ) ) { M_err( caller, "Popup does not exist" ); return NULL; } /* Now analyze the string with the information about the entries */ if ( ( str = fl_strdup( entries ) ) == NULL ) { M_err( caller, "Running out of memory" ); return NULL; } new_entries = parse_entries( popup, str, ap, "fl_popup_insert_entries", simple ); fl_free( str ); /* A return value of NULL says something went wrong (warning was already output) */ if ( new_entries == NULL ) return NULL; /* Now all left to do is insert the list of new entries into the list of already existing ones. 'after' being NULL means at the start of the list. */ for ( new_last = new_entries; new_last->next != NULL; new_last = new_last->next ) /* empty */ ; if ( after == NULL ) { if ( popup->entries != NULL ) { new_last->next = popup->entries; popup->entries->prev = new_last; } popup->entries = new_entries; } else { if ( after->next ) after->next->prev = new_last; new_last->next = after->next; new_entries->prev = after; after->next = new_entries; } /* Make sure all sub-popus are set up correctly */ setup_subpopups( popup ); /* Set flag that indicates that the dimension of the popup have to be recalculated */ set_need_recalc( popup ); /* Return a pointer to the first of the newly added entries */ return new_entries; } /*************************************** * Internal function for inserting entries into a popup after entry * 'after' (NULL stands for "insert at start") from a list of FL_POPUP_ITEM * structures - they are converted into a string that then gets passed * with the required additional arguments to fl_popup_insert_entries() ***************************************/ FL_POPUP_ENTRY * fli_popup_insert_items( FL_POPUP * popup, FL_POPUP_ENTRY * after, FL_POPUP_ITEM * entries, const char * caller) { FL_POPUP_ITEM *e; const char *c; char *txt; size_t cnt; static long val = 0; int level = 0; int need_line = 0; int is_sub = 0; FL_POPUP_ENTRY *entry = NULL; int first = 1; /* Return if the array of items is NULL */ if ( entries == NULL ) return NULL; /* Check if the popup we're supposed to add to does exist at all */ if ( fli_check_popup_exists( popup ) ) { M_err( caller, "Popup does not exist" ); return NULL; } /* If 'after' isn't NULL (indicating that we have to insert at the start) check that this popup entry exists */ if ( after != NULL ) { for ( entry = popup->entries; entry != NULL; entry = entry->next ) if ( entry == after ) break; if ( entry == NULL ) { M_err( caller, "Invalid 'after' argument" ); return NULL; } } /* Iterate over all items, inserting each individually */ for ( e = entries; e->text != NULL; e++ ) { /* Check that the type is ok */ if ( e->type != FL_POPUP_NORMAL && e->type != FL_POPUP_TOGGLE && e->type != FL_POPUP_RADIO ) { M_err( caller, "Invalid entry type" ); return NULL; } c = e->text; /* Check for '/' and '_' at the very start of the text */ if ( c[ 0 ] == '_' || ( c[ 0 ] == '/' && c[ 1 ] == '_' ) ) need_line = 1; if ( c[ 0 ] == '/' || ( c[ 0 ] == '_' && c[ 1 ] == '/' ) ) { if ( e->type != FL_POPUP_NORMAL ) { M_err( caller, "Entry can't be for a sub-popup " "and toggle or radio entry at the same time" ); return NULL; } is_sub = 1; } if ( ( *c == '/' && *++c == '_' ) || ( *c == '_' && *++c == '/' ) ) c++; /* Count the number of '%' in the string (without a directly following 'S') since all of them need to be escaped */ cnt = 0; for ( txt = strchr( c, '%' ); txt != NULL; txt = strchr( ++txt, '%' ) ) if ( txt[ 1 ] != 'S' ) cnt++; /* Get enough memory for the string to pass to fl_popup_insert_entries() */ if ( ( txt = fl_malloc( strlen( c ) + cnt + 13 ) ) == NULL ) { M_err( caller, "Running out of memory" ); return NULL; } /* Copy the original text, doubling all '%'s (except those in front of 'S') */ for ( cnt = 0; *c != '\0'; c++, cnt++ ) { txt[ cnt ] = *c; if ( c[ 0 ] == '%' && c[ 1 ] != 'S' ) txt[ ++cnt ] = '%'; } /* Add special sequences passed in every case */ memcpy( txt + cnt, "%x%f%s", 6 ); cnt += 6; /* Optionally add those for for disabling or hiding the entry */ if ( e->state & FL_POPUP_DISABLED ) { memcpy( txt + cnt, "%d", 2 ); cnt += 2; } if ( e->state & FL_POPUP_HIDDEN ) { memcpy( txt + cnt, "%h", 2 ); cnt += 2; } txt[ cnt ] = '\0'; /* Now we can start creating the entry. To make sure that the value assigned to the entry is correct even when sub-popus are to be created we need to know the level of recursion */ level++; if ( need_line ) { if ( ( after = fl_popup_insert_entries( popup, after, "%l" ) ) == NULL ) { if ( --level == 0 ) val = 0; return NULL; } need_line = 0; } if ( e->type == FL_POPUP_NORMAL && ! is_sub ) { if ( ( after = fl_popup_insert_entries( popup, after, txt, val++, e->callback, e->shortcut ) ) == NULL ) { fl_free( txt ); if ( --level == 0 ) val = 0; return NULL; } } else if ( e->type == FL_POPUP_TOGGLE ) { strcat( txt, e->state & FL_POPUP_CHECKED ? "%T" : "%t" ); if ( ( after = fl_popup_insert_entries( popup, after, txt, val++, e->callback, e->shortcut ) ) == NULL ) { fl_free( txt ); if ( --level == 0 ) val = 0; return NULL; } } else if ( e->type == FL_POPUP_RADIO ) { strcat( txt, e->state & FL_POPUP_CHECKED ? "%R" : "%r" ); if ( ( after = fl_popup_insert_entries( popup, after, txt, val++, e->callback, e->shortcut, INT_MIN ) ) == NULL ) { fl_free( txt ); if ( --level == 0 ) val = 0; return NULL; } } else if ( is_sub ) { FL_POPUP *sub; long pval = val++; strcat( txt, "%m" ); if ( ( sub = fl_popup_create( popup->win, NULL, e + 1 ) ) == NULL || ( after = fl_popup_insert_entries( popup, after,txt, pval, e->callback, e->shortcut, sub ) ) == NULL ) { fl_free( txt ); if ( ! fli_check_popup_exists( sub ) ) fl_popup_delete( sub ); if ( --level == 0 ) val = 0; return NULL; } } fl_free( txt ); /* Set the entries text member to exactly what the user gave us */ fli_safe_free( after->text ); if ( ( after->text = fl_strdup( e->text ) ) == NULL ) { fl_popup_delete( popup ); if ( --level == 0 ) val = 0; return NULL; } /* If this was a sub-popup entry skip items that were for the sub- or sub-sub-popus etc. */ if ( is_sub ) { cnt = 1; while ( cnt > 0 ) { e++; if ( e->text == NULL ) cnt--; else if ( e->text[ 0 ] == '/' || ( e->text[ 0 ] == '_' && e->text[ 1 ] == '/' ) ) cnt++; } is_sub = 0; } if ( first ) { entry = after; first = 0; } } val++; if ( --level == 0 ) val = 0; return entry; } /*************************************** * Create a popup and populate it from a list of FL_POPUP_ITEM structures ***************************************/ FL_POPUP * fl_popup_create( Window win, const char * title, FL_POPUP_ITEM * entries ) { FL_POPUP *popup; if ( ( popup = fl_popup_add( win, title ) ) == NULL ) return NULL; if ( fli_popup_insert_items( popup, NULL, entries, "fl_popup_create" ) == NULL ) { fl_popup_delete( popup ); return NULL; } return popup; } /*************************************** * Appends entries to a popup from a list of FL_POPUP_ITEM structures ***************************************/ FL_POPUP_ENTRY * fl_popup_add_items( FL_POPUP * popup, FL_POPUP_ITEM * entries ) { FL_POPUP_ENTRY *after; /* Return if the array of items is NULL */ if ( entries == NULL ) return NULL; /* Check if the popup we're supposed to add to does exist at all */ if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_add_items", "Popup does not exist" ); return NULL; } /* Determine the last existing entry in the popup */ after = popup->entries; while ( after != NULL && after->next != NULL ) after = after->next; return fli_popup_insert_items( popup, after, entries, "fl_popup_add_items" ); } /*************************************** * Insert entries into a popup from a list of FL_POPUP_ITEM structures * after an entry ***************************************/ FL_POPUP_ENTRY * fl_popup_insert_items( FL_POPUP * popup, FL_POPUP_ENTRY * after, FL_POPUP_ITEM * entries ) { return fli_popup_insert_items( popup, after, entries, "fl_popup_insert_items" ); } /*************************************** * Removes a popup, returns 0 on success and -1 on failure. ***************************************/ int fl_popup_delete( FL_POPUP * popup ) { /* Check if the popup we're asked to delete does exist */ if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_delete", "Popup does not exist" ); return -1; } /* Don't delete a popup that's currently shown */ if ( popup->win != None ) { M_err( "fl_popup_delete", "Can't free popup that is still shown" ); return -1; } /* Remove all entries (including sub-popups refered to there) */ while ( popup->entries ) fl_popup_entry_delete( popup->entries ); /* Get rid of the title string (if it exists) */ fli_safe_free( popup->title ); /* Finally unlink it from the list */ if ( popup->prev != NULL ) popup->prev->next = popup->next; else popups = popup->next; if ( popup->next != NULL ) popup->next->prev = popup->prev; fl_free( popup ); return 0; } /*************************************** * Delete a single popup entry (if it's a sub-popup entry also delete * the popup it refers to) ***************************************/ int fl_popup_entry_delete( FL_POPUP_ENTRY * entry ) { if ( entry == NULL ) { M_err( "fl_popup_entry_delete", "Invalid argument" ); return -1; } /* We don't remove entries that are shown at the moment */ if ( entry->popup->win != None ) { M_err( "fl_popup_entry_delete", "Can't free entry of a popup that is " "shown" ); return -1; } /* Remove the entry from the entry list of the popup it belongs to */ if ( entry->prev == NULL ) entry->popup->entries = entry->next; else entry->prev->next = entry->next; if ( entry->next != NULL ) entry->next->prev = entry->prev; entry->popup->need_recalc = 1; /* Free all remaining memory used by entry */ fli_safe_free( entry->text ); fli_safe_free( entry->label ); fli_safe_free( entry->accel ); fli_safe_free( entry->shortcut ); /* For entries that refer to sub-popups delete the sub-popup */ if ( entry->type == FL_POPUP_SUB ) fl_popup_delete( entry->sub ); return 0; } /*************************************** * Do interaction with a popup ***************************************/ FL_POPUP_RETURN * fl_popup_do( FL_POPUP * popup ) { /* Check that the popup exists */ if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_do", "Invalid popup" ); return NULL; } /* We don't interact directly with sub-popups */ if ( popup->parent != NULL ) { M_err( "fl_popup_do", "Can't do direct interaction with sub-popup" ); return NULL; } draw_popup( popup ); return popup_interaction( popup ); } /*************************************** * Set position where the popup is supposed to appear (if * never called the popup appears at the mouse position) ***************************************/ void fl_popup_set_position( FL_POPUP * popup, int x, int y ) { if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_set_position", "Invalid popup" ); return; } popup->use_req_pos = 1; popup->req_x = x; popup->req_y = y; } /*************************************** * Returns the policy set for a popup or the default policy if called * with a NULL pointer ***************************************/ int fl_popup_get_policy( FL_POPUP * popup ) { if ( popup == NULL ) return popup_policy; if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_get_title_font", "Invalid popup" ); return -1; } return popup->top_parent->policy; } /*************************************** * Set policy of handling the popup (i.e. does it get closed when the * user releases the mouse button outside an active entry or not?) ***************************************/ int fl_popup_set_policy( FL_POPUP * popup, int policy ) { int old_policy; if ( policy < FL_POPUP_NORMAL_SELECT || policy > FL_POPUP_DRAG_SELECT ) { M_err( "fl_popup_set_policy", "Invalid policy argument" ); return -1; } if ( popup == NULL ) { old_policy = popup_policy; popup_policy = policy; return old_policy; } if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_set_policy", "Invalid popup" ); return -1; } old_policy = popup->policy; popup->policy = policy; return old_policy; } /*************************************** * Set new text for an entry. Returns 0 on succes and -1 on failure. ***************************************/ int fl_popup_entry_set_text( FL_POPUP_ENTRY * entry, const char * text ) { char *t, *label, *accel, sc_str[ 2 ]; int ret = -1; long *old_sc; if ( fli_check_popup_entry_exists( entry ) ) { M_err( "fl_popup_entry_set_text", "Invalid entry argument" ); return -1; } /* If the new text is NULL (not very useful;-) we're already done */ if ( text == NULL ) { M_err( "fl_popup_entry_set_text", "Invalid text argument" ); return -1; } /* Get rid of the old text, label and accelerator strings */ fli_safe_free( entry->text ); fli_safe_free( entry->label ); fli_safe_free( entry->accel ); /* Make two copies of the text, the first one for storing in the entry, the second one for creating the label the accelerator string */ if ( ( t = fl_strdup( text ) ) == NULL ) goto REPLACE_DONE; if ( ( entry->text = fl_strdup( text ) ) == NULL ) goto REPLACE_DONE; /* Split up the text at the first '%S' */ label = t; if ( ( accel = strstr( t, "%S" ) ) != NULL ) { *accel = '\0'; accel += 2; } /* Remove all backspace characters and replace tabs by spaces in both the label and the accelerator string */ cleanup_string( label ); cleanup_string( accel ); /* Finally set up the label and accel members of the structure */ if ( ! *label ) entry->label = NULL; else if ( ( entry->label = fl_strdup( label ) ) == NULL ) goto REPLACE_DONE; if ( ! accel || ! *accel ) entry->accel = NULL; else if ( ( entry->accel = fl_strdup( accel ) ) == NULL ) goto REPLACE_DONE; ret = 0; REPLACE_DONE: fli_safe_free( t ); if ( ret == -1 ) { fli_safe_free( entry->text ); fli_safe_free( entry->label ); fli_safe_free( entry->accel ); M_err( "fl_popup_entry_set_text", "Running out of memory" ); } for ( old_sc = entry->shortcut; *old_sc != 0; old_sc++ ) if ( ( *old_sc & ~ ( FL_CONTROL_MASK | FL_ALT_MASK ) ) > 0 && ( *old_sc & ~ ( FL_CONTROL_MASK | FL_ALT_MASK ) ) <= 0xFF ) { sc_str[ 0 ] = *old_sc & ~ ( FL_CONTROL_MASK | FL_ALT_MASK ); sc_str[ 1 ] = '\0'; convert_shortcut( sc_str, entry ); break; } entry->popup->need_recalc = 1; return 0; } /*************************************** * Set new shortcuts for an entry ***************************************/ void fl_popup_entry_set_shortcut( FL_POPUP_ENTRY * entry, const char * sc ) { if ( fli_check_popup_entry_exists( entry ) ) { M_err( "fl_popup_entry_set_shortcut", "Invalid entry argument" ); return; } fli_safe_free( entry->shortcut ); if ( sc == NULL ) entry->ulpos = -1; else convert_shortcut( sc, entry ); } /*************************************** * Set callback function for a popup ***************************************/ FL_POPUP_CB fl_popup_set_callback( FL_POPUP * popup, FL_POPUP_CB callback ) { FL_POPUP_CB old_cb; if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_set_callback", "Invalid popup" ); return NULL; } old_cb = popup->callback; popup->callback = callback; return old_cb; } /*************************************** * Set a new title for a popup ***************************************/ const char * fl_popup_get_title( FL_POPUP * popup ) { if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_set_title", "Invalid popup" ); return NULL; } return popup->title; } /*************************************** * Set a new title for a popup ***************************************/ FL_POPUP * fl_popup_set_title( FL_POPUP * popup, const char * title ) { if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_set_title", "Invalid popup" ); return NULL; } fli_safe_free( popup->title ); if ( title && *title ) { popup->title = fl_strdup( title ); if ( popup->title == NULL ) { M_err( "fl_popup_set_title", "Running out of memory" ); return NULL; } } popup->need_recalc = 1; return popup; } /*************************************** * Set a new title for a popup ***************************************/ FL_POPUP * fl_popup_set_title_f( FL_POPUP * popup, const char * fmt, ... ) { char *buf; FL_POPUP *p; EXPAND_FORMAT_STRING( buf, fmt ); p = fl_popup_set_title( popup, buf ); fl_free( buf ); return p; } /*************************************** * Return title font for a popup ***************************************/ void fl_popup_get_title_font( FL_POPUP * popup, int * style, int * size ) { if ( popup == NULL ) { if ( style != NULL ) *style = popup_title_font_style; if ( size != NULL ) *size = popup_title_font_size; return; } if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_get_title_font", "Invalid popup" ); return; } if ( style != NULL ) *style = popup->top_parent->title_font_style; if ( size != NULL ) *size = popup->top_parent->title_font_size ; } /*************************************** * Set title font for a popup (or change the default if called with NULL) ***************************************/ void fl_popup_set_title_font( FL_POPUP * popup, int style, int size ) { if ( popup == NULL ) { popup_title_font_style = style; popup_title_font_size = size; return; } if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_set_title_font", "Invalid popup" ); return; } popup->title_font_style = style; popup->title_font_size = size; if ( popup->parent == NULL ) set_need_recalc( popup ); } /*************************************** * Return entry font for a popup ***************************************/ void fl_popup_entry_get_font( FL_POPUP * popup, int * style, int * size ) { if ( popup == NULL ) { if ( style != NULL ) *style = popup_entry_font_style; if ( size != NULL ) *size = popup_entry_font_size; return; } if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_entry_get_font", "Invalid popup" ); return; } if ( style != NULL ) *style = popup->top_parent->entry_font_style; if ( size != NULL ) *size = popup->top_parent->entry_font_size ; } /*************************************** * Set entry font for a popup (or change the default if called with NULL) ***************************************/ void fl_popup_entry_set_font( FL_POPUP * popup, int style, int size ) { if ( popup == NULL ) { popup_entry_font_style = style; popup_entry_font_size = size; return; } if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_entry_set_font", "Invalid popup" ); return; } popup->entry_font_style = style; popup->entry_font_size = size; if ( popup->parent == NULL ) set_need_recalc( popup ); } /*************************************** * Return the border width of a popup (or the default border width if * called with NULL or an invalid argument) ***************************************/ int fl_popup_get_bw( FL_POPUP * popup ) { if ( popup == NULL ) return popup_bw; if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_get_bw", "Invalid argument" ); return popup_bw; } return popup->top_parent->bw; } /*************************************** * Sets the border width of a popup or the default border width (if called * with NULL) ***************************************/ int fl_popup_set_bw( FL_POPUP * popup, int bw ) { int old_bw; /* Clamp border width to a reasonable range */ if ( bw == 0 || FL_abs( bw ) > FL_MAX_BW ) { bw = bw == 0 ? -1 : ( bw > 0 ? FL_MAX_BW : - FL_MAX_BW ); M_warn( "fl_popup_set_bw", "Adjusting invalid border width to %d", bw ); } if ( popup == NULL ) { old_bw = popup_bw; popup_bw = bw; return old_bw; } if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_set_bw", "Invalid popup argument" ); return INT_MIN; } old_bw = bw; popup->bw = bw; if ( popup->parent == NULL ) set_need_recalc( popup ); return old_bw; } /*************************************** * Get one of the colors of the popup (NULL or invalid popup returns the * default settings) ***************************************/ FL_COLOR fl_popup_get_color( FL_POPUP * popup, int color_type ) { /* Check if the popup exists */ if ( popup != NULL && fli_check_popup_exists( popup ) ) { M_err( "fl_popup_get_color", "Invalid popup argument" ); popup = NULL; } /* For sub-popups always return the color of the controlling popup */ if ( popup != NULL ) popup = popup->top_parent; switch ( color_type ) { case FL_POPUP_BACKGROUND_COLOR : return popup ? popup->bg_color : popup_bg_color; case FL_POPUP_HIGHLIGHT_COLOR : return popup ? popup->on_color : popup_on_color; case FL_POPUP_TITLE_COLOR : return popup ? popup->title_color : popup_title_color; case FL_POPUP_TEXT_COLOR : return popup ? popup->text_color : popup_text_color; case FL_POPUP_HIGHLIGHT_TEXT_COLOR : return popup ? popup->text_on_color : popup_text_on_color; case FL_POPUP_DISABLED_TEXT_COLOR : return popup ? popup->text_off_color : popup_text_off_color; case FL_POPUP_RADIO_COLOR : return popup ? popup->radio_color : popup_radio_color; } M_err( "fl_popup_get_color", "Invalid color type argument" ); return FL_BLACK; } /*************************************** * Set one of the colors of the popup (NULL sets the default) ***************************************/ FL_COLOR fl_popup_set_color( FL_POPUP * popup, int color_type, FL_COLOR color ) { FL_COLOR old_color; /* Check if the popup exists */ if ( popup != NULL && fli_check_popup_exists( popup ) ) { M_err( "fl_popup_set_color", "Invalid popup argument" ); return FL_MAX_COLORS; } if ( color >= FL_MAX_COLORS ) { M_err( "fl_popup_set_color", "Invalid color argument" ); return FL_MAX_COLORS; } switch ( color_type ) { case FL_POPUP_BACKGROUND_COLOR : if ( popup != NULL ) { old_color = popup->bg_color; popup->bg_color = color; } else { old_color = popup_bg_color; popup_bg_color = color; } break; case FL_POPUP_HIGHLIGHT_COLOR : if ( popup != NULL ) { old_color = popup->on_color; popup->on_color = color; } else { old_color = popup_on_color; popup_on_color = color; } break; case FL_POPUP_TITLE_COLOR : if ( popup != NULL ) { old_color = popup->title_color; popup->title_color = color; } else { old_color = popup_title_color; popup_title_color = color; } break; case FL_POPUP_TEXT_COLOR : if ( popup != NULL ) { old_color = popup->text_color; popup->text_color = color; } else { old_color = popup_text_color; popup_text_color = color; } break; case FL_POPUP_HIGHLIGHT_TEXT_COLOR : if ( popup != NULL ) { old_color = popup->text_on_color; popup->text_on_color = color; } else { old_color = popup_text_on_color; popup_text_on_color = color; } break; case FL_POPUP_DISABLED_TEXT_COLOR : if ( popup != NULL ) { old_color = popup->text_off_color; popup->text_off_color = color; } else { old_color = popup_text_off_color; popup_text_off_color = color; } break; case FL_POPUP_RADIO_COLOR : if ( popup != NULL ) { old_color = popup->radio_color; popup->radio_color = color; } else { old_color = popup_radio_color; popup_radio_color = color; } break; default : M_err( "fl_popup_set_color", "Invalid color type argument" ); return FL_MAX_COLORS; } return old_color; } /*************************************** * Sets the cursor of a popup (or change the * default cursor if called with NULL) ***************************************/ void fl_popup_set_cursor( FL_POPUP * popup, int cursor ) { if ( popup == NULL ) { popup_cursor = fli_get_cursor_byname( cursor ); return; } if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_set_cursor", "Invalid popup argument" ); return; } popup->cursor = fli_get_cursor_byname( cursor ); if ( popup->win ) XDefineCursor( flx->display, popup->win, popup->cursor ); } /*************************************** * Set selection callback function for a popup entry ***************************************/ FL_POPUP_CB fl_popup_entry_set_callback( FL_POPUP_ENTRY * entry, FL_POPUP_CB callback ) { FL_POPUP_CB old_cb; if ( fli_check_popup_entry_exists( entry ) ) { M_err( "fl_popup_entry_set_enter_callback", "Invalid entry argument" ); return NULL; } old_cb = entry->callback; entry->callback = callback; return old_cb; } /*************************************** * Set enter callback function for a popup entry ***************************************/ FL_POPUP_CB fl_popup_entry_set_enter_callback( FL_POPUP_ENTRY * entry, FL_POPUP_CB callback ) { FL_POPUP_CB old_cb; if ( fli_check_popup_entry_exists( entry ) ) { M_err( "fl_popup_entry_set_enter_callback", "Invalid entry argument" ); return NULL; } old_cb = entry->enter_callback; entry->enter_callback = callback; return old_cb; } /*************************************** * Set leave callback function for a popup entry ***************************************/ FL_POPUP_CB fl_popup_entry_set_leave_callback( FL_POPUP_ENTRY * entry, FL_POPUP_CB callback ) { FL_POPUP_CB old_cb; if ( fli_check_popup_entry_exists( entry ) ) { M_err( "fl_popup_entry_set_leave_callback", "Invalid entry argument" ); return NULL; } old_cb = entry->leave_callback; entry->leave_callback = callback; return old_cb; } /*************************************** * Get state (disabled, hidden, checked) of a popup entry ***************************************/ unsigned int fl_popup_entry_get_state( FL_POPUP_ENTRY * entry ) { if ( fli_check_popup_entry_exists( entry ) ) { M_err( "fl_popup_entry_get_state", "Invalid entry argument" ); return UINT_MAX; } return entry->state; } /*************************************** * Set state (disabled, hidden, checked) of a popup entry ***************************************/ unsigned int fl_popup_entry_set_state( FL_POPUP_ENTRY * entry, unsigned int state ) { unsigned int old_state; if ( fli_check_popup_entry_exists( entry ) ) { M_err( "fl_popup_entry_set_state", "Invalid entry argument" ); return UINT_MAX; } /* Nothing to be done if new and old state are identical */ if ( entry->state == state ) return state; old_state = entry->state; entry->state = state; /* If the entry gets disabled or hidden we may have to switch off it's "activated" state - don't call leave callback in this case */ if ( entry->state & ( FL_POPUP_DISABLED | FL_POPUP_HIDDEN ) ) entry->is_act = 0; /* If a radio entry gets checked uncheck all radio other entries belonging to the same group in the popup */ if ( entry->type == FL_POPUP_RADIO && state & FL_POPUP_CHECKED ) { FL_POPUP_ENTRY *e; for ( e = entry->popup->entries; e != NULL; e = e->next ) if ( e->type == FL_POPUP_RADIO && entry->group == e->group && entry != e ) e->state &= ~ FL_POPUP_CHECKED; } /* If the entry was hidden or made visible again the dimensions of the popup need to be recalculated */ if ( ( old_state & FL_POPUP_HIDDEN ) ^ ( state & FL_POPUP_HIDDEN ) ) entry->popup->need_recalc = 1; /* If the popup the entry belongs to is visible redraw the popup */ if ( entry->popup->win != None ) draw_popup( entry->popup ); return old_state; } /*************************************** * Clear certain bits of an entries state ***************************************/ unsigned int fl_popup_entry_clear_state( FL_POPUP_ENTRY * entry, unsigned int what ) { unsigned int old_state; size_t i; unsigned int flags[ ] = { FL_POPUP_DISABLED, FL_POPUP_HIDDEN, FL_POPUP_CHECKED }; if ( fli_check_popup_entry_exists( entry ) ) { M_err( "fl_popup_entry_clear_state", "Invalid entry argument" ); return UINT_MAX; } old_state = entry->state; for ( i = 0; i < sizeof flags / sizeof *flags; i++ ) if ( what & flags[ i ] ) fl_popup_entry_set_state( entry, entry->state & ~ flags[ i ] ); return old_state; } /*************************************** * Set certain bits of an entrys state ***************************************/ unsigned int fl_popup_entry_raise_state( FL_POPUP_ENTRY * entry, unsigned int what ) { unsigned int old_state; size_t i; unsigned int flags[ ] = { FL_POPUP_DISABLED, FL_POPUP_HIDDEN, FL_POPUP_CHECKED }; if ( fli_check_popup_entry_exists( entry ) ) { M_err( "fl_popup_entry_raise_state", "Invalid entry argument" ); return UINT_MAX; } old_state = entry->state; for ( i = 0; i < sizeof flags / sizeof *flags; i++ ) if ( what & flags[ i ] ) fl_popup_entry_set_state( entry, entry->state | flags[ i ] ); return old_state; } /*************************************** * Toggle certain bits of an entries state ***************************************/ unsigned int fl_popup_entry_toggle_state( FL_POPUP_ENTRY * entry, unsigned int what ) { unsigned int old_state; size_t i; unsigned int flags[ ] = { FL_POPUP_DISABLED, FL_POPUP_HIDDEN, FL_POPUP_CHECKED }; if ( fli_check_popup_entry_exists( entry ) ) { M_err( "fl_popup_entry_toggle_state", "Invalid entry argument" ); return UINT_MAX; } old_state = entry->state; for ( i = 0; i < sizeof flags / sizeof *flags; i++ ) if ( what & flags[ i ] ) fl_popup_entry_set_state( entry, entry->state ^ flags[ i ] ); return old_state; } /*************************************** * Set the value associated with an entry ***************************************/ long fl_popup_entry_set_value( FL_POPUP_ENTRY * entry, long value ) { long old_val; if ( fli_check_popup_entry_exists( entry ) ) { M_err( "fl_popup_entry_set_value", "Invalid entry argument" ); return INT_MIN; } old_val = entry->val; entry->val = value; return old_val; } /*************************************** * Set the user data pointer associated with an entry ***************************************/ void * fl_popup_entry_set_user_data( FL_POPUP_ENTRY * entry, void * user_data ) { void *old_user_data; if ( fli_check_popup_entry_exists( entry ) ) { M_err( "fl_popup_entry_set_user_data", "Invalid entry argument" ); return NULL; } old_user_data = entry->user_data; entry->user_data = user_data; return old_user_data; } /*************************************** * Returns the group a radio entry belongs to. * Returns group number on success and INT_MAX on failure. ***************************************/ int fl_popup_entry_get_group( FL_POPUP_ENTRY * entry ) { if ( fli_check_popup_entry_exists( entry ) ) { M_err( "fl_popup_entry_get_group", "Invalid entry argument" ); return INT_MAX; } return entry->group; } /*************************************** * Set a new group a radio entry * Returns old group number on success and INT_MAX on failure. ***************************************/ int fl_popup_entry_set_group( FL_POPUP_ENTRY * entry, int group ) { int old_group; FL_POPUP_ENTRY *e; if ( fli_check_popup_entry_exists( entry ) ) { M_err( "fl_popup_entry_set_group", "Invalid entry argument" ); return INT_MAX; } old_group = entry->group; if ( entry->type != FL_POPUP_RADIO ) { entry->group = group; return old_group; } if ( old_group == group ) return entry->group; for ( e = entry; e != NULL; e = e->next ) if ( e->type == FL_POPUP_RADIO && e->group == group && e->state & FL_POPUP_CHECKED ) entry->state &= ~ FL_POPUP_CHECKED; entry->group = group; return old_group; } /*************************************** * Returns the sub-popup for a sub-popup entry. * Returns the sub-popups address on success and NULL on failure. ***************************************/ FL_POPUP * fl_popup_entry_get_subpopup( FL_POPUP_ENTRY * entry ) { if ( fli_check_popup_entry_exists( entry ) ) { M_err( "fl_popup_entry_get_subpopup", "Invalid entry argument" ); return NULL; } if ( entry->type != FL_POPUP_SUB ) { M_err( "fl_popup_entry_get_subpopup", "Entry isn't a subpopup entry" ); return NULL; } return entry->sub; } /*************************************** * Set a new sub-popup for an entry, requires that this a sub-popup entry. * Returns the new sub-popups address on success and NULL on failure. ***************************************/ FL_POPUP * fl_popup_entry_set_subpopup( FL_POPUP_ENTRY * entry, FL_POPUP * subpopup ) { FL_POPUP *old_sub; if ( fli_check_popup_entry_exists( entry ) ) { M_err( "fl_popup_entry_set_subpopup", "Invalid entry argument" ); return NULL; } if ( entry->type != FL_POPUP_SUB ) { M_err( "fl_popup_entry_set_subpopup", "Entry isn't a subpopup entry" ); return NULL; } if ( entry->sub == subpopup ) return entry->sub; if ( entry->sub->win != None || subpopup->win != None ) { M_err( "fl_popup_entry_set_subpopup", "Can't change sub-popup while " "entries sub-popup is shown."); return NULL; } old_sub = entry->sub; entry->sub = subpopup; if ( check_sub( entry ) ) { entry->sub = old_sub; M_err( "fl_popup_entry_set_subpopup", "Invalid sub-popup argument" ); return NULL; } fl_popup_delete( entry->sub ); return entry->sub = subpopup; } /*************************************** * Find a popup entry by its position in the popup, starting at 1. * (Line entries aren't counted, but hidden entries are.) ***************************************/ FL_POPUP_ENTRY * fl_popup_entry_get_by_position( FL_POPUP * popup, int position ) { FL_POPUP_ENTRY *e; int i = 0; if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_entry_get_by_position", "Invalid popup argument" ); return NULL; } for ( e = popup->entries; e != NULL; e = e->next ) { if ( e->type == FL_POPUP_LINE ) continue; if ( i++ == position ) return e; } return NULL; } /*************************************** * Find a popup entry by its value ***************************************/ FL_POPUP_ENTRY * fl_popup_entry_get_by_value( FL_POPUP * popup, long val ) { FL_POPUP_ENTRY *e, *r; if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_entry_get_by_value", "Invalid popup argument" ); return NULL; } for ( e = popup->entries; e != NULL; e = e->next ) { if ( e->type == FL_POPUP_LINE ) continue; if ( e->val == val ) return e; if ( e->type == FL_POPUP_SUB && ( r = fl_popup_entry_get_by_value( e->sub, val ) ) ) return r; } return NULL; } /*************************************** * Find a popup entry by its user data ***************************************/ FL_POPUP_ENTRY * fl_popup_entry_get_by_user_data( FL_POPUP * popup, void * user_data ) { FL_POPUP_ENTRY *e, *r; if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_entry_get_by_value", "Invalid popup argument" ); return NULL; } for ( e = popup->entries; e != NULL; e = e->next ) { if ( e->type == FL_POPUP_LINE ) continue; if ( e->user_data == user_data ) return e; if ( e->type == FL_POPUP_SUB && ( r = fl_popup_entry_get_by_user_data( e->sub, user_data ) ) ) return r; } return NULL; } /*************************************** * Find a popup entry by its text ***************************************/ FL_POPUP_ENTRY * fl_popup_entry_get_by_text( FL_POPUP * popup, const char * text ) { FL_POPUP_ENTRY *e, *r; if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_entry_get_by_text", "Invalid popup argument" ); return NULL; } for ( e = popup->entries; e != NULL; e = e->next ) { if ( e->type == FL_POPUP_LINE ) continue; if ( ! strcmp( e->text, text ) ) return e; if ( e->type == FL_POPUP_SUB && ( r = fl_popup_entry_get_by_text( e->sub, text ) ) ) return r; } return NULL; } /*************************************** * Find a popup entry by its text ***************************************/ FL_POPUP_ENTRY * fl_popup_entry_get_by_text_f( FL_POPUP * popup, const char * fmt, ... ) { FL_POPUP_ENTRY *e; char *buf; EXPAND_FORMAT_STRING( buf, fmt ); e = fl_popup_entry_get_by_text( popup, buf ); fl_free( buf ); return e; } /*************************************** * Find a popup entry by its label ***************************************/ FL_POPUP_ENTRY * fl_popup_entry_get_by_label( FL_POPUP * popup, const char * label ) { FL_POPUP_ENTRY *e, *r; if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_entry_get_by_label", "Invalid popup argument" ); return NULL; } for ( e = popup->entries; e != NULL; e = e->next ) { if ( e->type == FL_POPUP_LINE || e->label == NULL ) continue; if ( ! strcmp( e->label, label ) ) return e; if ( e->type == FL_POPUP_SUB && ( r = fl_popup_entry_get_by_label( e->sub, label ) ) ) return r; } return NULL; } /*************************************** * Find a popup entry by its label ***************************************/ FL_POPUP_ENTRY * fl_popup_entry_get_by_label_f( FL_POPUP * popup, const char * fmt, ... ) { FL_POPUP_ENTRY *e; char *buf; EXPAND_FORMAT_STRING( buf, fmt ); e = fl_popup_entry_get_by_label( popup, buf ); fl_free( buf ); return e; } /*************************************** * Get size of a popup, returns 0 on success and -1 on error ***************************************/ int fl_popup_get_size( FL_POPUP * popup, unsigned int * w, unsigned int * h ) { if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_get_size", "Invalid popup argument" ); return -1; } if ( popup->need_recalc ) recalc_popup( popup ); *w = popup->w; *h = popup->h; return 0; } /*************************************** * Get minimum width of a popup ***************************************/ int fl_popup_get_min_width( FL_POPUP * popup ) { if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_get_size", "Invalid popup argument" ); return -1; } if ( popup->need_recalc ) recalc_popup( popup ); return popup->min_width; } /*************************************** * Set minimum width of a popup ***************************************/ int fl_popup_set_min_width( FL_POPUP * popup, int min_width ) { int old_min_width; if ( fli_check_popup_exists( popup ) ) { M_err( "fl_popup_get_size", "Invalid popup argument" ); return -1; } old_min_width = popup->min_width; if ( min_width < 0 ) min_width = 0; popup->min_width = min_width; popup->need_recalc = 1; return old_min_width; } /*************************************** * Set up a linked list of entries for a popup according to a string * and optional arguments. The resulting list then can be merged into * an already existing list of entries of the popup. The 'simple' * argument, when set, says that the new entry can't be a sub-entry, * a toggle, line or radio entry. ***************************************/ static FL_POPUP_ENTRY * parse_entries( FL_POPUP * popup, char * str, va_list ap, const char * caller, int simple ) { FL_POPUP_ENTRY *entry, *entry_first = NULL; char *c, *s, *sc = NULL, *acc = NULL; /* Split the string at '|' and create a new entry for each part */ for ( c = strtok( str, "|" ); c != NULL; c = strtok( NULL, "|" ) ) { /* Allocate a new entry and append it to the list of new entries */ if ( ( entry = fl_malloc( sizeof *entry ) ) == NULL ) { M_err( caller, "Running out of memory" ); return failed_add( entry_first ); } if ( entry_first == NULL ) { entry_first = entry; entry->prev = NULL; } else { FL_POPUP_ENTRY *e; for ( e = entry_first; e->next != NULL; e = e->next ) /* empty */; e->next = entry; entry->prev = e; } entry->next = NULL; entry->label = NULL; entry->accel = NULL; /* The text field is exactly what the user gave us */ if ( ( entry->text = fl_strdup( c ) ) == NULL ) { M_err( caller, "Running out of memory" ); return failed_add( entry_first ); } /* Set some default values */ entry->user_data = NULL; entry->val = popup->counter++; entry->is_act = 0; entry->type = FL_POPUP_NORMAL; entry->state = 0; entry->shortcut = NULL; entry->ulpos = -1; entry->callback = NULL; entry->enter_callback = NULL; entry->leave_callback = NULL; entry->sub = NULL; entry->popup = popup; /* Now analyze the string for the entry */ s = c; while ( ( s = strchr( s, '%' ) ) != NULL ) { switch ( s[ 1 ] ) { case '%' : memmove( s, s + 1, strlen( s ) ); s++; break; case 'x' : /* set a value */ entry->val = va_arg( ap, long ); memmove( s, s + 2, strlen( s + 1 ) ); break; case 'u' : /* set pointer to user data */ entry->user_data = va_arg( ap, void * ); memmove( s, s + 2, strlen( s + 1 ) ); break; case 'f' : /* set callback function */ entry->callback = va_arg( ap, FL_POPUP_CB ); memmove( s, s + 2, strlen( s + 1 ) ); break; case 'E' : /* set enter callback function */ entry->enter_callback = va_arg( ap, FL_POPUP_CB ); memmove( s, s + 2, strlen( s + 1 ) ); break; case 'L' : /* set leave callback function */ entry->leave_callback = va_arg( ap, FL_POPUP_CB ); memmove( s, s + 2, strlen( s + 1 ) ); break; case 'm' : /* set a submenu */ if ( entry->type != FL_POPUP_NORMAL ) { M_err( caller, "Entry can't be submenu and something " "else" ); return failed_add( entry_first ); } entry->sub = va_arg( ap, FL_POPUP * ); if ( ! simple ) { if ( check_sub( entry ) ) { M_err( caller, "Invalid submenu popup" ); return failed_add( entry_first ); } entry->type = FL_POPUP_SUB; entry->sub->parent = popup; } else entry->sub = NULL; memmove( s, s + 2, strlen( s + 1 ) ); break; case 'l' : /* set up entry as a line entry */ if ( entry->type != FL_POPUP_NORMAL ) { M_err( caller, "Entry can't be a line marker and " "something else" ); return failed_add( entry_first ); } entry->type = FL_POPUP_LINE; memmove( s, s + 2, strlen( s + 1 ) ); break; case 'T' : /* set up as toggle entry */ case 't' : if ( entry->type != FL_POPUP_NORMAL ) { M_err( caller, "Entry can't be a toggle entry and " "something else" ); return failed_add( entry_first ); } if ( ! simple ) { entry->type = FL_POPUP_TOGGLE; if ( s[ 1 ] == 'T' ) entry->state |= FL_POPUP_CHECKED; } memmove( s, s + 2, strlen( s + 1 ) ); break; case 'R' : /* set up as radio entry */ case 'r' : /* set up as radio entry */ if ( entry->type != FL_POPUP_NORMAL ) { M_err( caller, "Entry can't be radio entry and " "something else" ); return failed_add( entry_first ); } entry->group = va_arg( ap, int ); if ( ! simple ) { entry->type = FL_POPUP_RADIO; if ( s[ 1 ] == 'R' ) entry->state |= FL_POPUP_CHECKED; } memmove( s, s + 2, strlen( s + 1 ) ); break; case 'd' : /* mark entry as disabled */ entry->state |= FL_POPUP_DISABLED; memmove( s, s + 2, strlen( s + 1 ) ); break; case 'h' : /* mark entry as hidden */ entry->state |= FL_POPUP_HIDDEN; memmove( s, s + 2, strlen( s + 1 ) ); break; case 's' : /* set a shortcut */ sc = va_arg( ap, char * ); memmove( s, s + 2, strlen( s + 1 ) ); break; case 'S' : if ( acc != NULL ) { M_err( caller, "'%%S' sequence found more than once in " "entry definition" ); return failed_add( entry_first ); } *s++ = '\0'; acc = ++s; break; default : M_err( caller, "Invalid flag '%%%c'", s[ 1 ] ); return failed_add( entry_first ); } } /* If we're asked to create simple popup (for a FL_SELECT object) remove the entry again if it's a line entry */ if ( simple && entry->type == FL_POPUP_LINE ) { if ( entry->prev != NULL ) entry->prev->next = NULL; else entry_first = NULL; fl_free( entry ); popup->counter--; continue; } /* Now all flags should be removed from text string, so we can set the entries label and accelerator key text after also removing backspace characters and replacing tabs by spaces. */ cleanup_string ( c ); if ( ! *c ) entry->label = NULL; else if ( ( entry->label = fl_strdup( c ) ) == NULL ) { M_err( caller, "Running out of memory" ); return failed_add( entry_first ); } acc = cleanup_string( acc ); if ( ! acc || ! *acc ) entry->accel = NULL; else if ( ( entry->accel = fl_strdup( acc ) ) == NULL ) { M_err( caller, "Running out of memory" ); return failed_add( entry_first ); } acc = NULL; /* Having the text we can set up the shortcuts */ if ( sc ) { convert_shortcut( sc, entry ); sc = NULL; } } /* Make sure the settings for radio entries are consistent, i.e. only a single one of a group (taking both the already existing as well as the new ones into account) is set (the last created wins) */ for ( entry = entry_first; entry != NULL; entry = entry->next ) if ( entry->type == FL_POPUP_RADIO && entry->state * FL_POPUP_CHECKED ) radio_check( entry ); /* List is complete and the caller can link it into its list */ return entry_first; } /*************************************** * Called when adding popup entries fails due to whatever reasons * to get rid of all already created ones ***************************************/ static FL_POPUP_ENTRY * failed_add( FL_POPUP_ENTRY * first ) { FL_POPUP_ENTRY *e; while ( first ) { e = first->next; fl_popup_entry_delete( first ); first = e; } return NULL; } /*************************************** * Checks if a popup is suitable for use as a sub-popup ***************************************/ static int check_sub( FL_POPUP_ENTRY * entry ) { /* Sub-popup can't be NULL */ if ( entry->sub == NULL ) return 1; /* Check if the sub-popup exists */ if ( fli_check_popup_exists( entry->sub ) ) return 1; /* The sub-popup can't be the entries popup itself */ if ( entry->popup == entry->sub ) return 1; /* The sub-popup can not already be a sub-popup for some other entry */ if ( entry->sub->parent ) return 1; return 0; } /*************************************** * Go through all entries of a popup and resets the checked state of * all other entries belonging to the same group before the one we * were called with. ***************************************/ static void radio_check( FL_POPUP_ENTRY * entry ) { FL_POPUP_ENTRY *e; /* First reset (if necessary) the old ones */ for ( e = entry->popup->entries; e != NULL; e = e->next ) if ( e->type == FL_POPUP_RADIO && e != entry && entry->group == e->group ) e->state &= ~ FL_POPUP_CHECKED; /* Also reset all the new ones (except the one we were called for) */ for ( e = entry->prev; e != NULL; e = e->prev ) if ( e->type == FL_POPUP_RADIO && e != entry && entry->group == e->group ) e->state &= ~ FL_POPUP_CHECKED; } /*************************************** * Makes a shortcut out of an entries text and determines where to underline ***************************************/ static void convert_shortcut( const char * shortcut, FL_POPUP_ENTRY * entry ) { long sc[ MAX_SHORTCUTS + 1 ]; int cnt; if ( entry->label && *entry->label && ( ! entry->accel || ! *entry->accel ) ) entry->ulpos = fli_get_underline_pos( entry->label, shortcut ) - 1; else entry->ulpos = -1; cnt = fli_convert_shortcut( shortcut, sc ); fli_safe_free( entry->shortcut ); entry->shortcut = fl_malloc( ( cnt + 1 ) * sizeof *entry->shortcut ); memcpy( entry->shortcut, sc, ( cnt + 1 ) * sizeof *entry->shortcut ); } /*************************************** * Recalculate the dimensions of a popup and the positions of the entries ***************************************/ static void recalc_popup( FL_POPUP * popup ) { FL_POPUP_ENTRY *e; int offset = FL_abs( popup->top_parent->bw ) + ( popup->top_parent->bw > 0 ? 1 : 0 ); unsigned int cur_w = 0, cur_h = offset, w, h; title_dimensions( popup, &w, &h ); if ( w > 0 ) { /* Note: title box should always have a bit of spacing to the top of the window */ popup->title_box_x = offset + OUTER_PADDING_LEFT; popup->title_box_y = offset + FL_max( OUTER_PADDING_TOP, 3 ); cur_w = w + INNER_PADDING_LEFT + INNER_PADDING_RIGHT; popup->title_box_h = h + INNER_PADDING_TOP + INNER_PADDING_BOTTOM; cur_h += popup->title_box_h + FL_max( OUTER_PADDING_TOP, 3 ) + OUTER_PADDING_BOTTOM + 2; } popup->has_subs = 0; popup->has_boxes = 0; for ( e = popup->entries; e != NULL; e = e->next ) { if ( e->state & FL_POPUP_HIDDEN ) continue; e->box_x = offset + OUTER_PADDING_LEFT; e->box_y = cur_h; entry_text_dimensions( e, &w, &h ); cur_w = FL_max( cur_w, w ); cur_h += e->box_h = h + OUTER_PADDING_TOP + OUTER_PADDING_BOTTOM; if ( e->type == FL_POPUP_TOGGLE || e->type == FL_POPUP_RADIO ) popup->has_boxes = 1; else if ( e->type == FL_POPUP_SUB ) popup->has_subs = 1; } if ( popup->has_boxes ) cur_w += popup->top_parent->entry_font_size + SYMBOL_PADDING; if ( popup->has_subs ) cur_w += SYMBOL_PADDING + popup->top_parent->entry_font_size; popup->w = cur_w + 2 * offset + OUTER_PADDING_LEFT + OUTER_PADDING_RIGHT; popup->h = cur_h + offset + 1; popup->w = FL_max( popup->w, ( unsigned int ) popup->min_width ); popup->title_box_w = popup->w - 2 * offset - OUTER_PADDING_LEFT - OUTER_PADDING_RIGHT; popup->need_recalc = 0; } /*************************************** * Calculate the dimensions of the title ***************************************/ static void title_dimensions( FL_POPUP * popup, unsigned int * w, unsigned int * h ) { FL_POPUP *ptp = popup->top_parent; char *s, *c; int dummy; if ( popup->title == NULL ) { *w = *h = 0; return; } s = c = fl_strdup( popup->title ); /* Now calculate the dimensions of the string */ *w = 0; *h = 0; for ( c = strtok( s, "\n" ); c != NULL; c = strtok( NULL, "\n" ) ) { *w = FL_max( *w, ( unsigned int ) fl_get_string_width( ptp->title_font_style, ptp->title_font_size, c, strlen( c ) ) ); *h += fl_get_string_height( ptp->title_font_style, ptp->title_font_size, c, strlen( c ), &dummy, &dummy ); } fl_free( s ); /* Add offsets the string drawing function will add */ *w += 2 * STR_OFFSET_X; *h += 2 * STR_OFFSET_Y; } /*************************************** * Calculate the (minimum) dimensions of an entry ***************************************/ static void entry_text_dimensions( FL_POPUP_ENTRY * entry, unsigned int * w, unsigned int * h ) { FL_POPUP *ptp = entry->popup->top_parent; char *s, *c; int ulpos = entry->ulpos; XRectangle *xr; int asc; int dummy; *w = *h = 0; if ( entry->type == FL_POPUP_LINE ) { *h = LINE_HEIGHT; return; } /* Determine length and height of label string */ if ( entry->label && *entry->label ) { s = c = fl_strdup( entry->label ); /* Calculate the dimensions of the label (always use the font of the top-most parent) */ for ( c = strtok( s, "\n" ); c != NULL; c = strtok( NULL, "\n" ) ) { unsigned int old_h = *h; *w = FL_max( *w, ( unsigned int ) fl_get_string_width( ptp->entry_font_style, ptp->entry_font_size, c, strlen( c ) ) ); *h += fl_get_string_height( ptp->entry_font_style, ptp->entry_font_size, c, strlen( c ), &asc, &dummy ); if ( c == s ) entry->sl_h = *h; /* Not very nice hack to get the underline position */ if ( ulpos >= 0 ) { if ( ulpos < ( int ) strlen( c ) ) { xr = fli_get_underline_rect( fl_get_font_struct( ptp->entry_font_style, ptp->entry_font_size ), 0, asc, c, ulpos ); entry->ul_x = xr->x + STR_OFFSET_X; entry->ul_y = old_h + xr->y + STR_OFFSET_Y; entry->ul_w = xr->width; entry->ul_h = xr->height; } ulpos -= strlen( c ) + 1; } } fli_safe_free( s ); } /* Repeat this for the accelerator key text (minimum spacing between this and the label is 1.5 times the font size) */ if ( entry->accel && *entry->accel ) { unsigned int aw = 0, ah = 0; *w += 1.5 * ptp->entry_font_size; s = c = fl_strdup( entry->accel ); for ( c = strtok( s, "\n" ); c != NULL; c = strtok( NULL, "\n" ) ) { aw = FL_max( aw, ( unsigned int ) fl_get_string_width( ptp->entry_font_style, ptp->entry_font_size, c, strlen( c ) ) ); ah += fl_get_string_height( ptp->entry_font_style, ptp->entry_font_size, c, strlen( c ), &dummy, &dummy ); } fli_safe_free( s ); *w += aw; *h = FL_max( *h, ah ); } *w += 2 * STR_OFFSET_X; *h += 2 * STR_OFFSET_Y; } /*************************************** * Draw a popup ***************************************/ static void draw_popup( FL_POPUP * popup ) { FL_POPUP_ENTRY *e; /* If necessary recalculate the size of the popup window and, if it's already shown, resize it */ if ( popup->need_recalc ) { unsigned int old_w = popup->w, old_h = popup->h; recalc_popup( popup ); if ( popup->win != None && ( popup->w != old_w || popup->h != old_h ) ) XResizeWindow( flx->display, popup->win, popup->w, popup->h ); } /* If necessary create and map the popup window, otherwise just draw it (no drawing needed when the window gets opened, we will receive an Expose event that will induce the drawing) */ if ( popup->win == None ) create_popup_window( popup ); else { /* Draw the popup box */ fl_draw_box( FL_UP_BOX, 0, 0, popup->w, popup->h, popup->bg_color, popup->top_parent->bw ); /* Draw the title and all entries */ draw_title( popup ); for ( e = popup->entries; e != NULL; e = e->next ) draw_entry( e ); } } /*************************************** * Draws the title of a popup ***************************************/ static void draw_title( FL_POPUP * popup ) { FL_POPUP *ptp = popup->top_parent; if ( popup->title == NULL ) return; /* Draw a box with a frame around the title */ fl_draw_box( FL_FRAME_BOX, popup->title_box_x - 1, popup->title_box_y - 1, popup->title_box_w + 2, popup->title_box_h + 2, ptp->bg_color, 1 ); fl_draw_text( FL_ALIGN_CENTER, popup->title_box_x, popup->title_box_y, popup->title_box_w, popup->title_box_h, ptp->title_color, ptp->title_font_style, ptp->title_font_size, popup->title ); } /*************************************** * Draws an entry of a popup ***************************************/ static void draw_entry( FL_POPUP_ENTRY * entry ) { FL_POPUP *p = entry->popup, *ptp = p->top_parent; FL_COLOR color; int offset = FL_abs( ptp->bw ) + ( ptp->bw > 0 ? 1 : 0 ); int x; unsigned int w; /* Hidden entries need no further work */ if ( entry->state & FL_POPUP_HIDDEN ) return; /* Calculate the width of the box we're going to be drawning in */ x = entry->box_x; w = entry->box_w = p->w - 2 * offset - OUTER_PADDING_LEFT - OUTER_PADDING_RIGHT; /* For entries that just stand for separating lines draw that line and be done with it */ if ( entry->type == FL_POPUP_LINE ) { fl_draw_box( FL_DOWN_BOX, x, entry->box_y + OUTER_PADDING_TOP + 1, w, LINE_HEIGHT - 1, ptp->bg_color, 1 ); return; } /* Draw the background of the entry */ fl_rectangle( 1, offset, entry->box_y, p->w - 2 * offset - 1, entry->box_h, entry->is_act ? ptp->on_color : ptp->bg_color ); /* Find out what color the text is to be drawn in */ if ( entry->state & FL_POPUP_DISABLED ) color = ptp->text_off_color; else color = entry->is_act ? ptp->text_on_color : ptp->text_color; /* If there are radio/toggle entries extra space at the start is needed. For checked toggle items a check mark is drawn there and for radio items a circle */ if ( p->has_boxes ) { if ( entry->type == FL_POPUP_RADIO ) fl_draw_box( FL_ROUNDED3D_DOWNBOX, x + 0.2 * entry->sl_h, entry->box_y + 0.25 * entry->sl_h + STR_OFFSET_Y, 0.5 * entry->sl_h, 0.5 * entry->sl_h, entry->state & FL_POPUP_CHECKED ? ptp->radio_color : ptp->bg_color, 1 ); else if ( entry->state & FL_POPUP_CHECKED ) { FL_POINT xp[ 3 ]; xp[ 0 ].x = x + 0.25 * entry->sl_h; xp[ 0 ].y = entry->box_y + 0.5 * entry->sl_h + STR_OFFSET_Y; xp[ 1 ].x = xp[ 0 ].x + 0.2 * entry->sl_h; xp[ 1 ].y = xp[ 0 ].y + 0.25 * entry->sl_h; xp[ 2 ].x = xp[ 1 ].x + 0.2 * entry->sl_h; xp[ 2 ].y = xp[ 1 ].y - 0.5 * entry->sl_h; fl_lines( xp, 3, color ); xp[ 2 ].x += 1; fl_lines( xp + 1, 2, color ); } w -= ptp->entry_font_size + SYMBOL_PADDING; x += ptp->entry_font_size + SYMBOL_PADDING;; } /* If there are sub-popups we need some extra space at the end of the entries and for sub-popups entries a triangle at the end */ if ( p->has_subs ) { if ( entry->type == FL_POPUP_SUB ) { FL_POINT xp[ 4 ]; xp[ 0 ].x = x + w - 0.125 * entry->sl_h; xp[ 0 ].y = entry->box_y + 0.5 * entry->box_h; xp[ 1 ].x = xp[ 0 ].x - 0.35355 * entry->sl_h; xp[ 1 ].y = xp[ 0 ].y - 0.25 * entry->sl_h; xp[ 2 ].x = xp[ 1 ].x; xp[ 2 ].y = xp[ 1 ].y + 0.5 * entry->sl_h; fl_polygon( 1, xp, 3, color ); } w -= ptp->entry_font_size + SYMBOL_PADDING; } /* Finally it's time to draw the label and accelerator. Underlining is not done via the "normal" functions since they are too much of a mess...*/ if ( entry->label && *entry->label ) { fl_draw_text( FL_ALIGN_LEFT_TOP, x, entry->box_y, w, entry->box_h, color, ptp->entry_font_style, ptp->entry_font_size, entry->label ); if ( entry->ulpos >= 0 ) fl_rectangle( 1, x + entry->ul_x, entry->box_y + entry->ul_y , entry->ul_w, entry->ul_h, color ); } if ( entry->accel && *entry->accel ) fl_draw_text( FL_ALIGN_RIGHT_TOP, x, entry->box_y, w, entry->box_h, color, ptp->entry_font_style, ptp->entry_font_size, entry->accel ); } /*************************************** * Figure out where to draw a popup window ***************************************/ static void calculate_window_position( FL_POPUP * popup ) { FL_POPUP_ENTRY *e; int x, y; unsigned int dummy; /* If no position has been requested use the mouse position, otherwise the requested coordinates. Negatve positions mean relative to right edge or botton of the screen. */ fl_get_mouse( &x, &y, &dummy ); if ( ! popup->use_req_pos ) { popup->x = x + 1; popup->y = y + 1; } else { if ( popup->req_x >= 0 ) popup->x = popup->req_x; else popup->x = - popup->req_x - popup->w; if ( popup->req_y >= 0 ) popup->y = popup->req_y; else popup->y = - popup->req_y - popup->h; } /* Try to make sure the popup is fully on the screen (for sub-popups display to the left of the parent popup if necessary) */ if ( popup->y + ( int ) popup->h > fl_scrh && ! popup->use_req_pos ) popup->y = popup->y - ( int ) popup->h - 1; if ( popup->y + ( int ) popup->h > fl_scrh ) popup->y = FL_max( fl_scrh - ( int ) popup->h, 0 ); if ( popup->y < 0 ) popup->y = 0; if ( popup->x + ( int ) popup->w > fl_scrw ) { if ( popup->parent != NULL ) popup->x = FL_max( popup->parent->x - ( int ) popup->w, 0 ); else popup->x = FL_max( fl_scrw - ( int ) popup->w, 0 ); } if ( ( e = find_entry( popup, x - popup->x, y - popup->y ) ) != NULL && ! ( e->state & FL_POPUP_DISABLED ) ) enter_leave( e, 1 ); } /*************************************** * Create the popup's window ***************************************/ static void create_popup_window( FL_POPUP * popup ) { XSetWindowAttributes xswa; unsigned long vmask; /* Figure out where to open the window */ calculate_window_position( popup ); /* Create a new window */ popup->event_mask = ExposureMask | ButtonPressMask | ButtonReleaseMask | OwnerGrabButtonMask | PointerMotionMask | PointerMotionHintMask | KeyPressMask; xswa.event_mask = popup->event_mask; xswa.save_under = True; xswa.backing_store = WhenMapped; xswa.override_redirect = True; xswa.cursor = popup->cursor; xswa.border_pixel = 0; xswa.colormap = fli_colormap( fl_vmode ); xswa.do_not_propagate_mask = ButtonPress | ButtonRelease | KeyPress; vmask = CWEventMask | CWSaveUnder | CWBackingStore | CWCursor | CWBorderPixel | CWColormap | CWDontPropagate | CWOverrideRedirect; popup->win = XCreateWindow( flx->display, fl_root, popup->x, popup->y, popup->w, popup->h, 0, fli_depth( fl_vmode ), InputOutput, fli_visual( fl_vmode ), vmask, &xswa ); XSetTransientForHint( flx->display, popup->win, fl_root ); if ( popup->title ) XStoreName( flx->display, popup->win, popup->title ); /* Special hack for B&W */ if ( fli_dithered( fl_vmode ) ) { XGCValues xgcv; GC gc; xgcv.stipple = FLI_INACTIVE_PATTERN; vmask = GCForeground | GCFont | GCStipple; xgcv.foreground = fl_get_flcolor( popup->text_off_color ); gc = XCreateGC( flx->display, popup->win, vmask, &xgcv ); XSetFillStyle( flx->display, gc, FillStippled ); } XSetWMColormapWindows( flx->display, fl_root, &popup->win, 1 ); XMapRaised( flx->display, popup->win ); fl_winset( popup->win ); grab( popup ); } /*************************************** * Grabs both the pointer and the keyboard ***************************************/ static void grab( FL_POPUP * popup ) { unsigned int evmask = popup->event_mask; /* Set the window we're using */ fl_winset( popup->win ); /* Get rid of all non-pointer events in event_mask */ evmask &= ~ ( ExposureMask | KeyPressMask ); XSync( flx->display, False ); XChangeActivePointerGrab( flx->display, evmask, popup->cursor, CurrentTime ); /* Do pointer and keyboard grab */ if ( XGrabPointer( flx->display, popup->win, False, evmask, GrabModeAsync, GrabModeAsync, None, popup->cursor, CurrentTime ) != GrabSuccess ) M_err( "grab", "Can't grab pointer" ); else if ( XGrabKeyboard( flx->display, popup->win, False, GrabModeAsync, GrabModeAsync, CurrentTime ) != GrabSuccess ) { M_err( "grab", "Can't grab keyboard" ); XUngrabPointer( flx->display, CurrentTime ); } } /*************************************** * Close a popup window ***************************************/ static void close_popup( FL_POPUP * popup, int do_callback ) { FL_POPUP_ENTRY *e; XEvent ev; /* Change grab to parent popup window (if there's one), delete popup window and drop all events for it. Sync before waiting for events to make sure all events are already in the event queue. */ if ( popup->parent ) grab( popup->parent ); XDestroyWindow( flx->display, popup->win ); XSync( flx->display, False ); while ( XCheckWindowEvent( flx->display, popup->win, AllEventsMask, &ev ) ) /* empty */ ; popup->win = None; /* We have to redraw forms or popups that received a Expose event due to the closing of a sub-popup (at least if the Xserver did not save the content under the popups window). Not needed for top-level popups since there the normal event loop takes care of this. */ if ( popup->parent != NULL && ! DoesSaveUnders( ScreenOfDisplay( flx->display, fl_screen ) ) ) { FL_FORM *form; FL_POPUP *p; while ( XCheckMaskEvent( flx->display, ExposureMask, &ev ) != False ) if ( ( form = fl_win_to_form( ( ( XAnyEvent * ) &ev )->window ) ) != NULL ) { fl_winset( form->window ); fl_redraw_form( form ); } else for ( p = popups; p != NULL; p = p->next ) if ( ( ( XAnyEvent * ) &ev )->window == p->win ) { fl_winset( p->win ); draw_popup( p ); } fl_winset( popup->parent->win ); } /* Run the leave callback for an active entry if we're asked to */ for ( e = popup->entries; e != NULL; e = e->next ) if ( e->is_act ) { if ( do_callback ) enter_leave( e, 0 ); else e->is_act = 0; break; } } /*************************************** * Do all the interaction with the popup, also dealing with other * background tasks (taking over from the main event loop in forms.c * while the popup is shown) ***************************************/ static FL_POPUP_RETURN * popup_interaction( FL_POPUP * popup ) { FL_POPUP *p; FL_POPUP_ENTRY *e = NULL; XEvent ev; int timer_cnt = 0; ev.xmotion.time = 0; /* for fli_handle_idling() */ while ( 1 ) { long msec = fli_context->idle_delta; if ( fli_context->timeout_rec ) fli_handle_timeouts( &msec ); /* Check for new event for the popup window, if there's none deal with idle tasks */ if ( ! XCheckWindowEvent( flx->display, popup->win, popup->event_mask, &ev ) ) { if ( timer_cnt++ % 10 == 0 ) { timer_cnt = 0; fli_handle_idling( &ev, msec, 1 ); fl_winset( popup->win ); } continue; } timer_cnt = 0; fli_int.query_age++; switch ( ev.type ) { case Expose : draw_popup( popup ); break; case MotionNotify : fli_int.mousex = ev.xmotion.x; fli_int.mousey = ev.xmotion.y; fli_int.keymask = ev.xmotion.state; fli_int.query_age = 0; fli_compress_event( &ev, PointerMotionMask ); popup = handle_motion( popup, ev.xmotion.x, ev.xmotion.y ); break; case ButtonRelease : case ButtonPress : fli_int.mousex = ev.xbutton.x; fli_int.mousey = ev.xbutton.y; fli_int.keymask = ev.xbutton.state; fli_int.query_age = 0; /* Don't react to mouse wheel buttons */ if ( ev.xbutton.button == Button4 || ev.xbutton.button == Button5 ) break; /* Try to find "active" entry */ e = find_entry( popup, ev.xmotion.x, ev.xmotion.y ); /* Implement policy: in normal select mode don't react to button release except when on a selectable item. React to button press only when outside of popup(s). */ if ( popup->top_parent->policy == FL_POPUP_NORMAL_SELECT && ev.type == ButtonRelease && ( e == NULL || e->state & FL_POPUP_DISABLED ) ) break; if ( ev.type == ButtonPress && is_on_popups( popup, ev.xmotion.x, ev.xmotion.y ) ) break; /* Close all popups, invoking the leave callbacks if no selection was made */ for ( p = popup; p != NULL; p = p->parent ) close_popup( p, e == NULL ); return handle_selection( e ); case KeyPress : fli_int.mousex = ev.xkey.x; fli_int.mousey = ev.xkey.y; fli_int.keymask = ev.xkey.state; fli_int.query_age = 0; if ( ( p = handle_key( popup, ( XKeyEvent * ) &ev, &e ) ) ) popup = p; else return handle_selection( e ); } } return NULL; } /*************************************** * Returns if the mouse is within a popup window ***************************************/ static int is_on_popups( FL_POPUP * popup, int x, int y ) { do { if ( x >= 0 && x < ( int ) popup->w && y >= 0 && y < ( int ) popup->h ) return 1; if ( popup->parent == NULL ) break;; x += popup->x - popup->parent->x; y += popup->y - popup->parent->y; } while ( ( popup = popup->parent ) != NULL ); return 0; } /*************************************** * Deals with everything to be done once a selection has been made ***************************************/ static FL_POPUP_RETURN * handle_selection( FL_POPUP_ENTRY * entry ) { FL_POPUP *p; int cb_result = 1; /* If there wasn't a selection or the selected entry is disabled report "failure" */ if ( entry == NULL || entry->state & FL_POPUP_DISABLED ) return NULL; /* Toggle entries must change state */ if ( entry->type == FL_POPUP_TOGGLE ) { if ( entry->state & FL_POPUP_CHECKED ) entry->state &= ~ FL_POPUP_CHECKED; else entry->state |= FL_POPUP_CHECKED; } /* For a radio entry that wasn't already set the other radio entries for the same group must be unset before the selected one becomes set */ if ( entry->type == FL_POPUP_RADIO && ! ( entry->state & FL_POPUP_CHECKED ) ) { FL_POPUP_ENTRY *e; for ( e = entry->popup->entries; e != NULL; e = e->next ) if ( e->type == FL_POPUP_RADIO && e->group == entry->group ) e->state &= ~ FL_POPUP_CHECKED; entry->state |= FL_POPUP_CHECKED; } /* Set up the structure to be returned and call the entries callback function */ fli_set_popup_return( entry ); if ( entry->callback ) cb_result = entry->callback( &entry->popup->top_parent->ret ); /* Call all popup callback functions (if the selected entry is in a sub-popup call that of the sub-popup first, then that of the parent, grand-parent etc.). Interrupt chain of callbacks if one of them returns FL_IGNORE. */ for ( p = entry->popup; p && cb_result != FL_IGNORE; p = p->parent ) if ( p->callback ) { entry->popup->top_parent->ret.popup = p; cb_result = p->callback( &entry->popup->top_parent->ret ); } return ( cb_result != FL_IGNORE && entry->popup ) ? &entry->popup->top_parent->ret : NULL; } /*************************************** * Deal with motion of the mouse * Note: the coordinates received are relative to the current popup. ***************************************/ static FL_POPUP * handle_motion( FL_POPUP * popup, int x, int y ) { FL_POPUP_ENTRY *e, *ce; /* First deal with the situation where the mouse isn't on the popup */ if ( x < 0 || x >= ( int ) popup->w || y < 0 || y >= ( int ) popup->h ) { FL_POPUP *p; /* If there was an active entry make it inactive and call its leave callback */ for ( e = popup->entries; e != NULL; e = e->next ) if ( e->is_act ) { enter_leave( e, 0 ); break; } /* Check if we're on a different popup and return if we aren't. Coordinates must be transformed to relative to the root window. */ if ( ( p = find_popup( x + popup->x, y + popup->y ) ) == NULL ) return popup; /* Otherwise first check if we need to shift the window - coordinates must now be relative to the new popups window and might be changed by the routine */ x += popup->x - p->x; y += popup->y - p->y; motion_shift_window( p, &x, &y ); /* Also check if we're on the entry for the sub-entry we were on before. In that case nothing needs to be done yet. Take care: find_entry() needs to be called with the coordinates transformed to those relative to the other popup. */ e = find_entry( p, x, y ); if ( e != NULL && e->type == FL_POPUP_SUB && e->sub == popup ) return popup; /* Otherwise close the current sub-popup, invoking the leave callback for an activate entry */ close_popup( popup, 1 ); /* We might not have ended up on the parent popup but a parent of the parent, in which case also the parent popup must be closed. Note that the coordinates must again be transformed so that they are now relative to that of the parents window. */ return handle_motion( popup->parent, x + p->x - popup->parent->x, y + p->y - popup->parent->y ); } /* Check if we need to shift the window */ motion_shift_window( popup, &x, &y ); /* Test if the mouse is on a new entry*/ ce = find_entry( popup, x, y ); /* If we're still on the same entry as we were on the last call do nothing (except for the case that we're on a entry for a sub-popup, in that case we've got onto it via the keyboard and the sub-popup isn't open yet) */ if ( ce != NULL && ce->is_act ) return ce->type == FL_POPUP_SUB ? open_subpopup( ce ) : popup; /* Redraw former active entry as inactive and call its leave callback*/ for ( e = popup->entries; e != NULL; e = e->next ) if ( e->is_act ) { enter_leave( e, 0 ); break; } /* If we are on a new, non-disabled entry mark it as active and call its enter callback. If the new entry is a sub-entry open the corresponding sub-popup (per default at the same height as the entry and to the right of it.*/ if ( ce != NULL && ! ( ce->state & FL_POPUP_DISABLED ) ) { enter_leave( ce, 1 ); if ( ce->type == FL_POPUP_SUB ) return open_subpopup( ce ); } return popup; } /*************************************** * Shift popup window if it doesn't fit completely on the screen and the * user is trying to move the mouse in the direction of the non-visible * parts of the popups window. ***************************************/ static void motion_shift_window( FL_POPUP * popup, int * x, int * y ) { FL_POPUP_ENTRY *e; static long sec = 0, usec = 0; long now_sec, now_usec; int xr = *x + popup->x, /* coordinates relative to root window */ yr = *y + popup->y; int old_x_pos, old_y_pos; /* First check if parts of the popup window are off-screen and the user is tryng to move the mouse out of the screen into a direction where non-visible parts are. If not we're done. */ if ( ( xr > 0 || popup->x >= 0 ) && ( xr < fl_scrw - 1 || popup->x + ( int ) popup->w <= fl_scrw ) && ( yr > 0 || popup->y >= 0 ) && ( yr < fl_scrh - 1 || popup->y + ( int ) popup->h <= fl_scrh ) ) return; /* Check if the minimum time delay since last shift is over */ fl_gettime( &now_sec, &now_usec ); if ( 1000000 * ( now_sec - sec ) + now_usec - usec < WINDOW_SHIFT_DELAY ) return; /* Shift window left/right by a fixed amout of pixels*/ old_x_pos = popup->x; if ( xr == fl_scrw - 1 && popup->x + ( int ) popup->w > fl_scrw ) popup->x = FL_max( popup->x - WINDOW_SHIFT, fl_scrw - ( int ) popup->w ); else if ( xr == 0 && popup->x < 0 ) popup->x = FL_min( popup->x + WINDOW_SHIFT, 0 ); *x -= popup->x - old_x_pos; /* Shift window up/down by one entry*/ old_y_pos = popup->y; if ( yr == fl_scrh - 1 && popup->y + ( int ) popup->h > fl_scrh) { /* Find first entry that extends below the bottom of the screen and set the windows y-position so that it is shown completely */ for ( e = popup->entries; e != NULL; e = e->next ) if ( e->type != FL_POPUP_LINE && ! ( e->state & FL_POPUP_HIDDEN ) && e->box_y + ( int ) e->box_h - 1 > *y ) break; if ( e != NULL ) popup->y = fl_scrh - e->box_y - ( int ) e->box_h; } else if ( yr == 0 && popup->y < 0 ) { /* Find first entry that's at least one pixel below the upper screen border */ for ( e = popup->entries; e != NULL; e = e->next ) if ( ! ( e->state & FL_POPUP_HIDDEN ) && e->box_y >= *y ) break; /* Go to the one before that which isn't a line or hidden and make it the one at the very top of the screen */ if ( e != NULL ) do e = e->prev; while ( e != NULL && ( e->type == FL_POPUP_LINE || e->state & FL_POPUP_HIDDEN ) ); if ( e == NULL ) popup->y = 0; else popup->y = - e->box_y; } *y -= popup->y - old_y_pos; /* Move the window to the new position */ if ( popup->x != old_x_pos || popup->y != old_y_pos ) { XMoveWindow( flx->display, popup->win, popup->x, popup->y ); sec = now_sec; usec = now_usec; } } /*************************************** * Handle keyboard input. If NULL gets returned either a selection was * made (in that case 'entry' points to the selected entry) or dealing * with the popup is to be stopped. If non-NULL is returned it's the * popup we now have to deal with. ***************************************/ static FL_POPUP * handle_key( FL_POPUP * popup, XKeyEvent * ev, FL_POPUP_ENTRY ** entry ) { KeySym keysym = NoSymbol; char buf[ 16 ]; FL_POPUP_ENTRY *e, *ce; XLookupString( ev, buf, sizeof buf, &keysym, 0 ); /* Start of with checking for shortcut keys, they may have overridden some of the keys normally used */ if ( ( e = handle_shortcut( popup, keysym, ev->state ) ) != NULL ) { /* Special handling for sub-popup entries: shortcut key doesn't result in a selection but in the corresponding sub-popup being opened (if it isn't already shown) */ if ( e->type == FL_POPUP_SUB ) { if ( e->sub->win != None ) return popup; for ( ce = popup->entries; ce != NULL; ce = ce->next ) if ( ce->is_act ) { if ( ce != e ) enter_leave( ce, 0 ); break; } if ( ce != e ) enter_leave( e, 1 ); return open_subpopup( e ); } /* Close all popups. Leave callbacks are not invoked since a selection was made */ while ( popup ) { close_popup( popup, 0 ); popup = popup->parent; } *entry = e; return NULL; } /* and close the current popup, invoking leave callback */ if ( keysym == XK_Escape || keysym == XK_Cancel ) { close_popup( popup, 1 ); return popup->parent; } /* Try to find the "active" entry (there may not exist one) */ for ( ce = popup->entries; ce != NULL; ce = ce->next ) if ( ce->is_act ) break; /* does nothing (returning the original popup) if there isn't an active entry. If we're on a sub-entry open the sup-popup. Otherwise return indicating that the active entry was selected after closing all popups. */ if ( keysym == XK_Return ) { if ( ce == NULL ) return popup; /* If we're on a sun-popup entry open the corresponding sub-pupop */ if ( ce->type == FL_POPUP_SUB ) return open_subpopup( ce ); /* Otherwise we got a selection, so close all popups, invoke no leave callbacks (since selection was made) and return the selected entry */ while ( popup ) { close_popup( popup, 0 ); popup = popup->parent; } *entry = ce; return NULL; } /* The key only does something when we're on a sub-entry. In this case the sub-popup is opened and the top-most usable entry is activated. */ if ( IsRight( keysym ) ) { if ( ce == NULL || ce->type != FL_POPUP_SUB ) return popup; for ( e = ce->sub->entries; e != NULL; e = e->next ) if ( IS_ACTIVATABLE( e ) ) break; if ( e != NULL ) enter_leave( e, 1 ); return open_subpopup( ce ); } /* The key only has a meaning if we're in a sub-popup. In this case the sub-popup gets closed (leave callbacks get invoked). */ if ( IsLeft( keysym ) ) { if ( popup->parent == NULL ) return popup; close_popup( popup, 1 ); return popup->parent; } /* The key moves down to the next "activatable" entry (with wrap-around). If no entry was active yet the first in the popup is activated. */ if ( IsDown( keysym ) ) { e = NULL; if ( ce != NULL ) for ( e = ce->next; e != NULL; e = e->next ) if ( IS_ACTIVATABLE( e ) ) break; if ( e == NULL ) for ( e = popup->entries; e != ce; e = e->next ) if ( IS_ACTIVATABLE( e ) ) break; if ( e != NULL ) key_shift_window( popup, e ); if ( e != ce ) { if ( ce != NULL ) enter_leave( ce, 0 ); enter_leave( e, 1 ); } return popup; } /* The key moves up to the previous "activatable" entry (with wrap-around). If no entry was active yet the last in the popup is activated. */ if ( IsUp( keysym ) ) { FL_POPUP_ENTRY * ei; for ( e = NULL, ei = popup->entries; ei != ce; ei = ei->next ) if ( IS_ACTIVATABLE( ei ) ) e = ei; if ( e == NULL && ce != NULL ) for ( ei = ce->next; ei != NULL; ei = ei->next ) if ( IS_ACTIVATABLE( ei ) ) e = ei; if ( ce != NULL && e != NULL ) { key_shift_window( popup, e ); enter_leave( ce, 0 ); } if ( e != NULL ) enter_leave( e, 1 ); return popup; } /* The key moves to the last "activatable" in the popup */ if ( IsEnd( keysym ) ) { FL_POPUP_ENTRY *ei; for ( e = NULL, ei = ce != NULL ? ce->next : popup->entries; ei != NULL; ei = ei->next ) if ( IS_ACTIVATABLE( ei ) ) e = ei; if ( ce != NULL && e != NULL ) enter_leave( ce, 0 ); if ( e != NULL ) { key_shift_window( popup, e ); enter_leave( e, 1 ); } return popup; } /* The key moves to the first "activatable" in the popup */ if ( IsHome( keysym ) ) { for ( e = popup->entries; e != ce; e = e->next ) if ( IS_ACTIVATABLE( e ) ) break; if ( ce != NULL && e != ce ) enter_leave( ce, 0 ); if ( e != ce ) { key_shift_window( popup, e ); enter_leave( e, 1 ); } return popup; } /* All other keys do nothing, returning the original popup indicates that */ return popup; } /*************************************** * Shift popup window if it doesn't fit completely on the screen and the * user pressed a key that takes us to a non-visible entry of the window. ***************************************/ static void key_shift_window( FL_POPUP * popup, FL_POPUP_ENTRY * entry ) { /* Test if the window is only partially visible on the window (in vertical direction) and the entry we're supposed to go to isn't in the visible part of the window. If not we're done.*/ if ( ( popup->y >= 0 && popup->y + ( int ) popup->h < fl_scrh ) || ( popup->y + entry->box_y >= 0 && popup->y + entry->box_y + ( int ) entry->box_h < fl_scrh ) ) return; /* Shift window up/down */ if ( popup->y + entry->box_y < 0 ) popup->y = - entry->box_y + 1; else popup->y = fl_scrh - entry->box_y - ( int ) entry->box_h - 1; XMoveWindow( flx->display, popup->win, popup->x, popup->y ); } /*************************************** * Open a sub-popup ***************************************/ static FL_POPUP * open_subpopup( FL_POPUP_ENTRY * entry ) { FL_POPUP *popup = entry->popup; int offset = FL_abs( popup->top_parent->bw ) + ( popup->top_parent->bw > 0 ? 1 : 0 ) + OUTER_PADDING_TOP; /* Set the position of the new sub-popup. Normally show it to the right of the parent popup, but if this is a sub-popup of a sub-popup and the parent sub-pupop is to the left of its parent (because there wasn't enough room on the right side) position it also to the left. Vertically put it at the same height as the entry its opened up from. But the function for opening the window for the sub-popup may overrule these settings if there isn't enough room on the screen. */ if ( popup->parent == NULL || popup->x > popup->parent->x ) fl_popup_set_position( entry->sub, popup->x + popup->w, popup->y + entry->box_y - offset ); else { if ( entry->sub->need_recalc ) recalc_popup( entry->sub ); fl_popup_set_position( entry->sub, popup->x - entry->sub->w, popup->y + entry->box_y - offset ); } draw_popup( entry->sub ); return entry->sub; } /*************************************** * Check popup entries for a shortcut identical to a pressed key ***************************************/ static FL_POPUP_ENTRY * handle_shortcut( FL_POPUP * popup, long keysym, unsigned int keymask ) { FL_POPUP_ENTRY *e; long *sc; if ( controlkey_down( keymask ) && keysym >= 'a' && keysym <= 'z' ) keysym = toupper( keysym ); keysym += ( controlkey_down( keymask ) ? FL_CONTROL_MASK : 0 ) + ( metakey_down( keymask ) ? FL_ALT_MASK : 0 ); /* Look at the shortcuts for all of the entries of the current popup, then those of the parent etc. */ while ( popup != NULL ) { for ( e = popup->entries; e != NULL; e = e->next ) if ( IS_ACTIVATABLE( e ) && e->shortcut != NULL ) for ( sc = e->shortcut; *sc != 0; sc++ ) if ( *sc == keysym ) return e; popup = popup->parent; } return NULL; } /*************************************** * Handle entering (act = 1) or leaving (act = 0) of an entry ***************************************/ static void enter_leave( FL_POPUP_ENTRY * entry, int act ) { /* Mark entry as entered or left */ entry->is_act = act; /* Redraw the entry (at least while popup is shown) */ if ( entry->popup->win != None ) draw_entry( entry ); /* If a callback for the situation exists invoke it */ if ( ( act && entry->enter_callback == NULL ) || ( ! act && entry->leave_callback == NULL ) ) return; fli_set_popup_return( entry ); if ( act ) entry->enter_callback( &entry->popup->top_parent->ret ); else entry->leave_callback( &entry->popup->top_parent->ret ); } /*************************************** * Try to find a (shown) popup from its position (coordinates must be * relative to the root window) ***************************************/ static FL_POPUP * find_popup( int x, int y ) { FL_POPUP *p; for ( p = popups; p != NULL; p = p->next ) { if ( p->win == None ) continue; if ( x >= p->x && x < p->x + ( int ) p->w && y >= p->y && y < p->y + ( int ) p->h ) return p; } return NULL; } /*************************************** * Try to find an entry in a popup from its position (coordinates must be * relative to the popup's window) ***************************************/ static FL_POPUP_ENTRY * find_entry( FL_POPUP * popup, int x, int y ) { FL_POPUP_ENTRY *e; for ( e = popup->entries; e != NULL; e = e->next ) { if ( e->type == FL_POPUP_LINE || e->state & FL_POPUP_HIDDEN ) continue; if ( x >= 0 && x < ( int ) popup->w && y >= e->box_y && y < e->box_y + ( int ) e->box_h ) return e; } return NULL; } /*************************************** * Makes sure the top-parent pointers in sub-popups are set correctly ***************************************/ static void setup_subpopups( FL_POPUP * popup ) { FL_POPUP *p; FL_POPUP_ENTRY *e; /* The top-parent of sub-popups must be set to the top-most popup since it gets all its drawing properties etc. from that one. In normal popups the top_parent entry just points back to the popup itself. */ if ( ( p = popup->parent ) != NULL ) { while ( p->parent != NULL ) p = p->parent; popup->top_parent = p; } else popup->top_parent = popup; for ( e = popup->entries; e != NULL; e = e->next ) if ( e->type == FL_POPUP_SUB ) setup_subpopups( e->sub ); } /*************************************** * Removes all backspace characters from a string * and replaces all tabs by spaces. ***************************************/ static char * cleanup_string( char *s ) { char *c; if ( ! s || ! *s ) return s; /* Remove all backspace charscters */ c = s; while ( ( c = strchr( c, '\b' ) ) ) memmove( c, c + 1, strlen( c ) ); /* Replace tabs by single blanks */ c = s; while ( ( c = strchr( c, '\t' ) ) ) *c++ = ' '; return s; } /*************************************** * Set need_recalc flag for a popup and all its sub-popups ***************************************/ static void set_need_recalc( FL_POPUP * popup ) { FL_POPUP_ENTRY *e; popup->need_recalc = 1; for ( e = popup->entries; e != NULL; e = e->next ) if ( e->type == FL_POPUP_SUB ) set_need_recalc( e->sub ); } /*************************************** * Function called by fl_initialize() to set up defaults ***************************************/ void fli_popup_init( void ) { fli_popup_finish( ); /* just to make sure... */ popup_entry_font_style = FL_NORMAL_STYLE; popup_title_font_style = FL_EMBOSSED_STYLE; #ifdef __sgi popup_entry_font_size = FL_SMALL_SIZE, popup_title_font_size = FL_SMALL_SIZE; #else popup_entry_font_size = FL_NORMAL_SIZE; popup_title_font_size = FL_NORMAL_SIZE; #endif popup_bg_color = FL_MCOL; popup_on_color = FL_BOTTOM_BCOL; popup_title_color = FL_BLACK; popup_text_color = FL_BLACK; popup_text_on_color = FL_WHITE; popup_text_off_color = FL_INACTIVE_COL; popup_radio_color = FL_BLUE; popup_bw = ( fli_cntl.borderWidth && FL_abs( fli_cntl.borderWidth ) <= FL_MAX_BW ) ? fli_cntl.borderWidth : FL_BOUND_WIDTH; popup_cursor = XC_sb_right_arrow; popup_policy = FL_POPUP_NORMAL_SELECT; } /*************************************** * Function called by fl_finish() to release all memory used by popups. ***************************************/ void fli_popup_finish( void ) { FL_POPUP *p; /* Delete all top-level popups, sub-popus get taken care of automatically */ while ( popups ) for ( p = popups; p != NULL; p = p->next ) if ( p->parent == NULL ) { fl_popup_delete( p ); break; } } /*************************************** * Checks if a popup exists, returns 0 if it does, 1 otherwise. ***************************************/ int fli_check_popup_exists( FL_POPUP * popup ) { FL_POPUP *p; for ( p = popups; p != NULL; p = p->next ) if ( popup == p ) return 0; return 1; } /*************************************** * Checks if an entry exists, returns 0 if it does, 1 otherwise. ***************************************/ int fli_check_popup_entry_exists( FL_POPUP_ENTRY * entry ) { FL_POPUP_ENTRY *e; if ( entry == NULL ) return 1; if ( fli_check_popup_exists( entry->popup ) ) return 1; for ( e = entry->popup->entries; e != NULL; e = e->next ) if ( entry == e ) return 0; return 1; } /*************************************** * Set up the return structure of a popup for a certain entry ***************************************/ FL_POPUP_RETURN * fli_set_popup_return( FL_POPUP_ENTRY * entry ) { entry->popup->top_parent->ret.text = entry->text; entry->popup->top_parent->ret.label = entry->label; entry->popup->top_parent->ret.accel = entry->accel; entry->popup->top_parent->ret.val = entry->val; entry->popup->top_parent->ret.user_data = entry->user_data; entry->popup->top_parent->ret.entry = entry; entry->popup->top_parent->ret.popup = entry->popup; return &entry->popup->top_parent->ret; } /*************************************** * Reset the popups counter to 0 ***************************************/ void fli_popup_reset_counter( FL_POPUP *popup ) { popup->counter = 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/slider.c0000664000175000017500000007661612353623326012200 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file slider.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/pslider.h" #include #include #define IS_NORMAL( o ) ( ( o )->type == FL_HOR_SLIDER \ || ( o )->type == FL_VERT_SLIDER ) #define IS_NICE( o ) ( ( o )->type == FL_VERT_NICE_SLIDER \ || ( o )->type == FL_VERT_NICE_SLIDER2 \ || ( o )->type == FL_HOR_NICE_SLIDER \ || ( o )->type == FL_HOR_NICE_SLIDER2 ) enum { COMPLETE = 0, FOCUS = 1, SLIDER_MOTION = 2, SLIDER_JUMP = 4 }; #define VAL_BOXW FL_max( 35, 0.18 * ob->w ) /* reporting boxsize */ #define VAL_BOXH 25 /* vertical RBW */ /*************************************** ***************************************/ static void compute_bounds( FL_OBJECT * ob ) { FLI_SLIDER_SPEC *sp = ob->spec; sp->x = 0; sp->y = 0; sp->w = ob->w; sp->h = ob->h; if ( ob->objclass == FL_VALSLIDER ) { if ( IS_VSLIDER( ob ) ) { sp->y += VAL_BOXH; sp->h -= VAL_BOXH; } else if ( IS_HSLIDER( ob ) ) { sp->x += VAL_BOXW; sp->w -= VAL_BOXW; } } } /*************************************** ***************************************/ static void draw_motion( FL_OBJECT * ob ) { FLI_SLIDER_SPEC *sp = ob->spec; XRectangle xrec[ 2 ]; int abbw = FL_abs( ob->bw ); FL_COLOR col; if ( ob->type != FL_VERT_BROWSER_SLIDER2 && ob->type != FL_HOR_BROWSER_SLIDER2 && ob->type != FL_VERT_THIN_SLIDER && ob->type != FL_HOR_THIN_SLIDER ) { FLI_SCROLLBAR_KNOB knob; fli_calc_slider_size( ob, &knob ); if ( IS_HSLIDER( ob ) ) { xrec[ 0 ].x = ob->x + sp->x; xrec[ 0 ].y = ob->y + sp->y; xrec[ 0 ].width = knob.x + 1; xrec[ 0 ].height = sp->h; xrec[ 1 ].x = xrec[ 0 ].x + knob.x + knob.w - 1; xrec[ 1 ].y = xrec[ 0 ].y; xrec[ 1 ].width = sp->w - knob.x - knob.w + 1; xrec[ 1 ].height = sp->h; } else { xrec[ 0 ].x = ob->x + sp->x; xrec[ 0 ].y = ob->y + sp->y; xrec[ 0 ].width = sp->w; xrec[ 0 ].height = knob.y + 1; xrec[ 1 ].x = xrec[ 0 ].x; xrec[ 1 ].y = xrec[ 0 ].y + knob.y + knob.h - 1; xrec[ 1 ].width = sp->w; xrec[ 1 ].height = sp->h - knob.y - knob.h + 1; } XSetClipRectangles( flx->display, flx->gc, 0, 0, xrec, 2, Unsorted ); fl_draw_box( FL_FLAT_BOX, ob->x + sp->x + abbw, ob->y + sp->y + abbw, sp->w - 2 * abbw, sp->h - 2 * abbw, ob->col1, 0 ); } else if ( ob->type == FL_HOR_THIN_SLIDER || ob->type == FL_VERT_THIN_SLIDER || ob->type == FL_HOR_BASIC_SLIDER || ob->type == FL_VERT_BASIC_SLIDER ) fl_draw_box( FL_FLAT_BOX, ob->x + sp->x, ob->y + sp->y, sp->w, sp->h, ob->col1, 1 ); else if ( ob->type == FL_HOR_BROWSER_SLIDER2 || ob->type == FL_VERT_BROWSER_SLIDER2 ) fl_draw_box( ob->boxtype, ob->x + sp->x, ob->y + sp->y, sp->w, sp->h, ob->col1, ob->bw > 0 ? 1 : -1 ); else fl_draw_box( FL_UP_BOX, ob->x + sp->x, ob->y + sp->y, sp->w, sp->h, ob->col1, ob->bw > 0 ? 1 : -1 ); fl_unset_clipping( ); col = ( IS_SCROLLBAR( ob ) && sp->mouse == FLI_SLIDER_KNOB ) ? FL_MCOL : ob->col2; fli_draw_slider( ob, ob->col1, col, NULL, FLI_SLIDER_KNOB ); } /*************************************** * Draws a slider ***************************************/ static void draw_slider( FL_OBJECT * ob ) { FLI_SLIDER_SPEC *sp = ob->spec; char valstr[ 64 ]; FL_Coord bx = ob->x, /* value box */ by = ob->y, bw = ob->w, bh = ob->h; /* Draw the value box */ if ( ob->objclass == FL_VALSLIDER ) { if ( IS_VSLIDER( ob ) ) bh = VAL_BOXH; else bw = VAL_BOXW; if ( sp->filter ) strcpy( valstr, sp->filter( ob, sp->val, sp->prec ) ); else sprintf( valstr, "%.*f", sp->prec, sp->val ); fl_draw_box( ob->boxtype, bx, by, bw, bh, ob->col1, ob->bw ); fl_draw_text_beside( FL_ALIGN_CENTER, bx, by, bw, bh, ob->lcol, ob->lstyle, ob->lsize, valstr ); } if ( ( sp->draw_type == SLIDER_MOTION || sp->draw_type == SLIDER_JUMP ) && ( IS_SCROLLBAR( ob ) || IS_NORMAL( ob ) || IS_NICE( ob ) ) ) { draw_motion( ob ); return; } /* Draw the slider */ if ( fl_is_center_lalign( ob->align ) ) { fli_draw_slider( ob, ob->col1, ob->col2, IS_FILL( ob ) ? NULL : ob->label, FLI_SLIDER_ALL & ~sp->mouse ); /* Added 10/21/00 TCZ: need this to get the inside label right otherwise fli_draw_slider() draws the lable centered on the xfilled part!*/ if ( IS_FILL( ob ) ) fl_draw_object_label( ob ); } else { fli_draw_slider( ob, ob->col1, ob->col2, "", FLI_SLIDER_ALL & ~sp->mouse ); if ( fl_is_inside_lalign( ob->align ) ) fl_draw_object_label( ob ); else fl_draw_object_label_outside( ob ); } if ( sp->mouse != FLI_SLIDER_NONE ) fli_draw_slider( ob, ob->col1, sp->mouse ? FL_MCOL : ob->col2, "", sp->mouse ); } /*************************************** * Checks if mouse is not on the knob of the slider. returns -1 if * the mouse is above or to the left of the knob, +1 if it's below * or to the right of the knob and 0 if it's on the knob. ***************************************/ static int is_off_knob( FL_OBJECT * obj, FL_Coord mx, FL_Coord my ) { FLI_SCROLLBAR_KNOB knob; FLI_SLIDER_SPEC *sp = obj->spec; fli_calc_slider_size( obj, &knob ); if ( IS_VSLIDER( obj ) ) { if ( IS_FILL( obj ) ) sp->mw = 0; else sp->mh = knob.h; if ( my < knob.y ) return -1; if ( my >= knob.y + knob.h ) return 1; sp->offy = knob.y + knob.h / 2 - my; if ( IS_FILL( obj ) ) sp->offy = 0; } else { if ( IS_FILL( obj ) ) sp->mw = 0; else sp->mw = knob.w; if ( mx < knob.x ) return -1; if ( mx >= knob.x + knob.w ) return 1; sp->offx = knob.x + knob.w / 2 - mx; if ( IS_FILL( obj ) ) sp->offx = 0; } return 0; } /*************************************** * Get the slider value for the current mouse position ***************************************/ static double get_newvalue( FL_OBJECT * ob, FL_Coord mx, FL_Coord my ) { FLI_SLIDER_SPEC *sp = ob->spec; double newval = 0.0; int absbw = FL_abs( ob->bw ); if ( IS_HSLIDER( ob ) ) { double dmx = mx + sp->offx; if ( dmx < 0.5 * sp->mw + absbw ) newval = sp->min; else if ( dmx > sp->w - 0.5 * sp->mw - absbw ) newval = sp->max; else newval = sp->min + ( sp->max - sp->min ) * ( dmx - 0.5 * sp->mw - absbw ) / ( sp->w - sp->mw - 2 * absbw ); } else { double dmy = my + sp->offy; if ( dmy < 0.5 * sp->mh + absbw ) newval = sp->min; else if ( dmy > sp->h - 0.5 * sp->mh - absbw ) newval = sp->max; else newval = sp->min + ( sp->max - sp->min ) * ( dmy - 0.5 * sp->mh - absbw ) / ( sp->h - sp->mh - 2 * absbw ); } return newval; } /*************************************** ***************************************/ static void scrollbar_timeout( int val FL_UNUSED_ARG, void * data ) { ( ( FLI_SLIDER_SPEC * ) data )->timeout_id = -1; } /*************************************** ***************************************/ static void handle_enter( FL_OBJECT * obj, FL_Coord mx, FL_Coord my ) { FLI_SLIDER_SPEC *sp = obj->spec; /* When a scrollbar is entered we want to keep track of the mouse movements in order to be able to highlight the knob when the mouse is on top of it ('sp->mouse' keeps track of that). */ if ( IS_SCROLLBAR( obj ) ) { obj->want_motion = 1; sp->mouse_off_knob = is_off_knob( obj, mx, my ); if ( ! sp->mouse_off_knob ) { sp->mouse = FLI_SLIDER_KNOB; fl_redraw_object( obj ); } } } /*************************************** ***************************************/ static void handle_leave( FL_OBJECT * obj ) { FLI_SLIDER_SPEC *sp = obj->spec; /* When the mouse leaves a scrollbar we no longer need reports about mouse movements and may have to un-highlight the knob */ if ( IS_SCROLLBAR( obj ) ) { obj->want_motion = 0; if ( sp->mouse == FLI_SLIDER_KNOB ) { sp->mouse = FLI_SLIDER_NONE; fl_redraw_object( obj ); } } } /*************************************** * Handle a mouse position change ***************************************/ static int handle_mouse( FL_OBJECT * obj, FL_Coord mx, FL_Coord my, int key ) { FLI_SLIDER_SPEC *sp = obj->spec; double newval; if ( sp->mouse_off_knob ) { if ( sp->timeout_id == -1 ) { if ( key == FL_MBUTTON1 ) newval = sp->val + sp->mouse_off_knob * sp->ldelta; else if ( key == FL_MBUTTON2 || key == FL_MBUTTON3 ) newval = sp->val + sp->mouse_off_knob * sp->rdelta; else return FL_RETURN_NONE; } else return FL_RETURN_NONE; } else if ( sp->react_to[ key - 1 ] ) newval = get_newvalue( obj, mx, my ); else return FL_RETURN_NONE; newval = fli_valuator_round_and_clamp( obj, newval ); if ( sp->val == newval ) return FL_RETURN_NONE; /* When we're doing jumps in a scrollbar (re)start the timer, wait a bit longer the first time round to allow the user to release the mouse button before jumping starts */ if ( sp->mouse_off_knob ) { sp->timeout_id = fl_add_timeout( ( obj->want_update ? 1 : 2 ) * sp->repeat_ms, scrollbar_timeout, sp ); obj->want_update = 1; } sp->val = newval; sp->draw_type = sp->mouse_off_knob ? SLIDER_JUMP : SLIDER_MOTION; fl_redraw_object( obj ); sp->val = newval; return FL_RETURN_CHANGED; } /*************************************** ***************************************/ static int handle_motion( FL_OBJECT * obj, FL_Coord mx, FL_Coord my, int key, void * ev ) { FLI_SLIDER_SPEC *sp = obj->spec; int ret; /* If this is a motion while in "jump mode" for a scrollbar do nothing */ if ( IS_SCROLLBAR( obj ) && sp->mouse_off_knob && key ) return FL_RETURN_NONE; /* If we get here without the left mouse button being pressed we're monitoring the mouse movements to change hightlighting of the knob of a scrollbar */ if ( IS_SCROLLBAR( obj ) && key != FL_MBUTTON1 ) { int old_state = sp->mouse_off_knob; sp->mouse_off_knob = is_off_knob( obj, mx, my ); if ( old_state != sp->mouse_off_knob ) { sp->mouse = sp->mouse_off_knob ? FLI_SLIDER_NONE : FLI_SLIDER_KNOB; fl_redraw_object( obj ); } return FL_RETURN_NONE; } /* For non-scrollbar objects we're going to update the sliders position - if a shift key is pressed we here fake a smaller mouse movement */ if ( ! IS_SCROLLBAR( obj ) && sp->react_to[ key - 1 ] ) { if ( shiftkey_down( ( ( XEvent * ) ev )->xmotion.state ) ) { if ( ! sp->was_shift ) { sp->old_mx = mx; sp->old_my = my; sp->was_shift = 1; } if ( IS_HSLIDER( obj ) ) mx = sp->old_mx + ( mx - sp->old_mx ) * FL_SLIDER_FINE; else my = sp->old_my + ( my - sp->old_my ) * FL_SLIDER_FINE; } else sp->was_shift = 0; } if ( ( ret = handle_mouse( obj, mx, my, key ) ) && ! ( obj->how_return & FL_RETURN_END_CHANGED ) ) sp->start_val = sp->val; return ret; } /*************************************** ***************************************/ static int handle_push( FL_OBJECT * obj, FL_Coord mx, FL_Coord my, int key, void * ev ) { FLI_SLIDER_SPEC *sp = obj->spec; int ret; if ( key < FL_MBUTTON1 || key > FL_MBUTTON3 ) return FL_RETURN_NONE; sp->start_val = sp->val; sp->timeout_id = -1; sp->offx = sp->offy = 0; /* For value sliders we do not want the slider to jump to one of the extreme positions just because the user clicked on the number field - they may just be trying if it's possible to edit the number... */ if ( obj->objclass == FL_VALSLIDER && ( ( IS_HSLIDER( obj ) && mx < 0 ) || ( IS_VSLIDER( obj ) && my < 0 ) ) ) return FL_RETURN_NONE; /* Check where the mouse button was clicked */ sp->mouse_off_knob = is_off_knob( obj, mx, my ); /* If the object is a scrollbar and the mouse is on its knob nothing happens yet and we're just going to wait for mouse movements. If it's not on the knob we will set an artifical timer events to make the knob jump. For non-scrollbars we're going to jump the slider so the mouse will be on top of the "knob" and will stay there (and we will get updates about mouse movements via FL_MOTION events). */ if ( IS_SCROLLBAR( obj ) ) { if ( ! sp->mouse_off_knob ) return FL_RETURN_NONE; } else sp->mouse_off_knob = 0; /* If we got here the slider position got to be changed, for scrollbars by a jump, for normal sliders by moving the slider to the current mouse postion. We then need to record the position for faked slowing down of the mouse */ ret = handle_mouse( obj, mx, my, key ); /* If a shift key is pressed record the current mouse position */ if ( shiftkey_down( ( ( XEvent * ) ev )->xbutton.state ) ) { sp->old_mx = mx; sp->old_my = my; sp->was_shift = 1; } else sp->was_shift = 0; if ( ret && ! ( obj->how_return & FL_RETURN_END_CHANGED ) ) sp->start_val = sp->val; return ret; } /*************************************** ***************************************/ static int handle_update( FL_OBJECT * obj, FL_Coord mx, FL_Coord my, int key ) { FLI_SLIDER_SPEC *sp = obj->spec; int ret; if ( ( ret = handle_mouse( obj, mx, my, key ) ) && ! ( obj->how_return & FL_RETURN_END_CHANGED ) ) sp->start_val = sp->val; return ret; } /*************************************** ***************************************/ static int handle_scroll( FL_OBJECT * obj, int key, int key_state ) { FLI_SLIDER_SPEC *sp = obj->spec; double newval; if ( key == FL_MBUTTON4 ) newval = sp->val - ( shiftkey_down( key_state ) ? sp->rdelta : sp->ldelta / 2 ); else if ( key == FL_MBUTTON5 ) newval = sp->val + ( shiftkey_down( key_state ) ? sp->rdelta : sp->ldelta / 2 ); else return FL_RETURN_NONE; newval = fli_valuator_round_and_clamp( obj, newval ); if ( sp->val == newval ) return FL_RETURN_NONE; sp->val = newval; sp->draw_type = SLIDER_JUMP; fl_redraw_object( obj ); return FL_RETURN_CHANGED | FL_RETURN_END; } /*************************************** ***************************************/ static int handle_release( FL_OBJECT * obj, FL_Coord mx, FL_Coord my, int key, void * ev ) { FLI_SLIDER_SPEC *sp = obj->spec; int ret = FL_RETURN_NONE; int old_state = sp->mouse_off_knob; obj->want_update = 0; if ( sp->timeout_id != -1 ) { fl_remove_timeout( sp->timeout_id ); sp->timeout_id = -1; } /* Scrollwheel only is used with scrollbars */ if ( ! IS_SCROLLBAR( obj ) && ( key == FL_MBUTTON4 || key == FL_MBUTTON5 ) ) return FL_RETURN_NONE; /* Take care, 'ev' might be NULL - on hiding the buttons form a fake FL_RELEASE event gets send */ if ( ev && ( ret = handle_scroll( obj, key, ( ( XEvent * ) ev )->xbutton.state ) ) ) return ret; if ( ( sp->mouse_off_knob = is_off_knob( obj, mx, my ) ) != old_state ) { sp->mouse = sp->mouse_off_knob ? FLI_SLIDER_NONE : FLI_SLIDER_KNOB; fl_redraw_object( obj ); } ret = FL_RETURN_END; if ( sp->start_val != sp->val ) ret |= FL_RETURN_CHANGED; return ret; } /*************************************** * Handles an event for a slider ***************************************/ static int handle_slider( FL_OBJECT * ob, int event, FL_Coord mx, FL_Coord my, int key, void * ev ) { FLI_SLIDER_SPEC *sp = ob->spec; int ret = FL_RETURN_NONE; mx -= ob->x + sp->x; my -= ob->y + sp->y; switch ( event ) { case FL_ATTRIB : case FL_RESIZED : if ( ! ( ob->type & FL_VERT_PROGRESS_BAR ) ) { ob->align = fl_to_outside_lalign( ob->align ); if ( fl_is_center_lalign( ob->align ) ) ob->align = FL_SLIDER_ALIGN; } compute_bounds( ob ); break; case FL_DRAW : sp->draw_type = COMPLETE; draw_slider( ob ); break; case FL_DRAWLABEL : if ( fl_is_inside_lalign( ob->align ) ) fl_draw_object_label( ob ); else fl_draw_object_label_outside( ob ); break; case FL_FREEMEM : fli_safe_free( ob->spec ); break; case FL_ENTER : if ( ! ( ob->type & FL_VERT_PROGRESS_BAR ) ) handle_enter( ob, mx, my ); break; case FL_LEAVE : if ( ! ( ob->type & FL_VERT_PROGRESS_BAR ) ) handle_leave( ob ); break; case FL_PUSH : if ( ! ( ob->type & FL_VERT_PROGRESS_BAR ) ) ret |= handle_push( ob, mx, my, key, ev ); break; case FL_MOTION : if ( ! ( ob->type & FL_VERT_PROGRESS_BAR ) ) ret |= handle_motion( ob, mx, my, key, ev ); break; case FL_UPDATE : if ( ! ( ob->type & FL_VERT_PROGRESS_BAR ) ) ret |= handle_update( ob, mx, my, key ); break; case FL_RELEASE : if ( ! ( ob->type & FL_VERT_PROGRESS_BAR ) ) ret |= handle_release( ob, mx, my, key, ev ); break; } return ret; } /*************************************** * Creates a slider object ***************************************/ static FL_OBJECT * create_slider( int objclass, int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob; FLI_SLIDER_SPEC *sp; int i; ob = fl_make_object( objclass, type, x, y, w, h, label, handle_slider ); ob->boxtype = FL_SLIDER_BOXTYPE; ob->col1 = FL_SLIDER_COL1; ob->col2 = FL_SLIDER_COL2; ob->align = FL_SLIDER_ALIGN; ob->lcol = FL_SLIDER_LCOL; ob->lsize = FL_TINY_SIZE; ob->spec = sp = fl_calloc( 1, sizeof *sp ); sp->min = 0.0; sp->max = 1.0; sp->val = sp->start_val = 0.5; sp->filter = NULL; sp->slsize = FL_SLIDER_WIDTH; sp->prec = 2; sp->repeat_ms = 100; sp->timeout_id = -1; sp->mouse_off_knob = 0; sp->was_shift = 0; sp->cross_over = 0; sp->old_mx = sp->old_my = 0; if ( IS_SCROLLBAR( ob ) ) sp->slsize *= 1.5; sp->ldelta = 0.1; sp->rdelta = 0.05; fl_set_object_dblbuffer( ob, 1 ); /* Per default a slider reacts to the left mouse button only */ sp->react_to[ 0 ] = 1; for ( i = 1; i < 3; i++ ) sp->react_to[ i ] = 0; return ob; } /*************************************** * Adds a slider object ***************************************/ static FL_OBJECT * add_slider( int objclass, int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *obj = create_slider( objclass, type, x, y, w, h, label ); /* Set the default return policy for the object */ fl_set_object_return( obj, FL_RETURN_CHANGED ); fl_add_object( fl_current_form, obj ); compute_bounds( obj ); return obj; } /*************************************** ***************************************/ FL_OBJECT * fl_create_slider( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { return create_slider( FL_SLIDER, type, x, y, w, h, label ); } /*************************************** ***************************************/ FL_OBJECT * fl_add_slider( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { return add_slider( FL_SLIDER, type, x, y, w, h, label ); } /*************************************** ***************************************/ FL_OBJECT * fl_create_valslider( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { return create_slider( FL_VALSLIDER, type, x, y, w, h, label ); } /*************************************** ***************************************/ FL_OBJECT * fl_add_valslider( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { return add_slider( FL_VALSLIDER, type, x, y, w, h, label ); } /*************************************** ***************************************/ void fl_set_slider_value( FL_OBJECT * ob, double val ) { FLI_SLIDER_SPEC *sp; double smin, smax; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_SLIDER ) && ! IsValidClass( ob, FL_VALSLIDER ) ) { M_err( "fl_set_slider_value", "%s is not a slider", ob ? ob->label : "" ); return; } #endif sp = ob->spec; smin = FL_min( sp->min, sp->max ); smax = FL_max( sp->min, sp->max ); val = FL_clamp( val, smin, smax ); if ( sp->val != val ) { sp->val = sp->start_val = val; fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_set_slider_bounds( FL_OBJECT * ob, double min, double max ) { FLI_SLIDER_SPEC *sp; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_SLIDER ) && ! IsValidClass( ob, FL_VALSLIDER ) ) { M_err( "fl_set_slider_bounds", "%s is not a slider", ob ? ob->label : "" ); return; } #endif sp = ob->spec; if ( sp->min == min && sp->max == max ) return; sp->min = min; sp->max = max; if ( sp->val < sp->min && sp->val < sp->max ) sp->val = FL_min( sp->min, sp->max ); if ( sp->val > sp->min && sp->val > sp->max ) sp->val = FL_max( sp->min, sp->max ); fl_redraw_object( ob ); } /*************************************** * Returns value of the slider ***************************************/ double fl_get_slider_value( FL_OBJECT * ob ) { #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_SLIDER ) && ! IsValidClass( ob, FL_VALSLIDER ) ) { M_err( "fl_get_slider_value", "%s is not a slider", ob ? ob->label : "" ); return 0; } #endif return ( ( FLI_SLIDER_SPEC * ) ob->spec )->val; } /*************************************** * Returns the slider bounds ***************************************/ void fl_get_slider_bounds( FL_OBJECT * ob, double * min, double * max ) { *min = ( ( FLI_SLIDER_SPEC * ) ob->spec )->min; *max = ( ( FLI_SLIDER_SPEC * ) ob->spec )->max; } /*************************************** * Sets under which conditions the object is to be returned to the * application. This function should be regarded as deprecated and * fl_set_object_return() should be used instead. ***************************************/ void fl_set_slider_return( FL_OBJECT * obj, unsigned int when ) { if ( when & FL_RETURN_END_CHANGED ) when &= ~ ( FL_RETURN_NONE | FL_RETURN_CHANGED ); fl_set_object_return( obj, when ); } /*************************************** * Sets the step size to which values are rounded ***************************************/ void fl_set_slider_step( FL_OBJECT * ob, double value ) { ( ( FLI_SLIDER_SPEC * ) ob->spec )->step = value; } /*************************************** * Set slider increments for clicks with left and middle mouse button ***************************************/ void fl_set_slider_increment( FL_OBJECT * ob, double l, double r ) { ( ( FLI_SLIDER_SPEC * ) ob->spec )->ldelta = l; ( ( FLI_SLIDER_SPEC * ) ob->spec )->rdelta = r; } /*************************************** ***************************************/ void fl_get_slider_increment( FL_OBJECT * ob, double * l, double * r ) { *l = ( ( FLI_SLIDER_SPEC * ) ob->spec )->ldelta; *r = ( ( FLI_SLIDER_SPEC * ) ob->spec )->rdelta; } /*************************************** * Sets the portion of the slider box covered by the slider ***************************************/ void fl_set_slider_size( FL_OBJECT * ob, double size ) { FLI_SLIDER_SPEC *sp = ob->spec; double dim; int min_knob = IS_SCROLLBAR( ob ) ? MINKNOB_SB : MINKNOB_SL; if ( size <= 0.0 ) size = 0.0; else if (size >= 1.0) size = 1.0; /* Impose minimum knob size */ dim = IS_VSLIDER( ob ) ? ob->h : ob->w; dim -= 2 * FL_abs( ob->bw ); if ( dim * size < min_knob && dim > 0.0 ) size = min_knob / dim; if ( size != sp->slsize ) { sp->slsize = size; fl_redraw_object( ob ); } } /*************************************** * Sets the portion of the slider box covered by the slider ***************************************/ double fl_get_slider_size( FL_OBJECT * obj ) { return ( ( FLI_SLIDER_SPEC * ) obj->spec )->slsize; } /*************************************** * Only for value sliders. ***************************************/ void fl_set_slider_precision( FL_OBJECT * ob, int prec ) { FLI_SLIDER_SPEC *sp = ob->spec; if ( prec > FL_SLIDER_MAX_PREC ) prec = FL_SLIDER_MAX_PREC; else if ( prec < 0 ) prec = 0; if ( sp->prec != prec ) { sp->prec = prec; fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_set_slider_filter( FL_OBJECT * ob, FL_VAL_FILTER filter ) { ( ( FLI_SLIDER_SPEC * ) ob->spec )->filter = filter; } /*************************************** * This function makes only sense for scrollbars and should't be * used for simple sliders (for which it doesn't do anything). ***************************************/ int fl_get_slider_repeat( FL_OBJECT * ob ) { return ( ( FLI_SLIDER_SPEC * ) ob->spec )->repeat_ms; } /*************************************** * This function makes only sense for scrollbars and should't be * used for simple sliders (for which it doesn't do anything). ***************************************/ void fl_set_slider_repeat( FL_OBJECT * ob, int millisec ) { if ( millisec > 0 ) ( ( FLI_SLIDER_SPEC * ) ob->spec )->repeat_ms = millisec; } /*************************************** * Function allows to set up to which mouse * buttons the slider object will react. ***************************************/ void fl_set_slider_mouse_buttons( FL_OBJECT * obj, unsigned int mouse_buttons ) { FLI_SLIDER_SPEC *sp = obj->spec; unsigned int i; for ( i = 0; i < 3; i++, mouse_buttons >>= 1 ) sp->react_to[ i ] = mouse_buttons & 1; } /*************************************** * Function returns a value via 'mouse_buttons', indicating * which mouse buttons the slider object will react to. ***************************************/ void fl_get_slider_mouse_buttons( FL_OBJECT * obj, unsigned int * mouse_buttons ) { FLI_SLIDER_SPEC *sp; int i; unsigned int k; if ( ! obj ) { M_err( "fl_get_slider_mouse_buttons", "NULL object" ); return; } if ( ! mouse_buttons ) return; sp = obj->spec; *mouse_buttons = 0; for ( i = 0, k = 1; i < 3; i++, k <<= 1 ) *mouse_buttons |= sp->react_to[ i ] ? k : 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/xpopup.c0000664000175000017500000017152412353623326012243 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file xpopup.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao * All rights reserved. * * Implementation of pop-up menus in Xlib. Not quite fit the * model of forms library, but it is needed to make other things * work. * * These functionalities should be someday rewritten using * forms construct rather than Xlib. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/flvasprintf.h" #include #include #include #include #define FL_MAXPUP 32 /* default maximum pups */ #define PADH FL_PUP_PADH /* space between items */ #define PADW 8 /* space on each side */ #define PADTITLE 14 /* extran space for title */ #define CHECKW 6 /* check box size */ #define M_TITLE 1 #define M_ERR 2 /**************************************************************** * pop up menu structure and some defaults ****************************************************************/ #define NSC 8 /* max hotkeys */ typedef struct { char * str; /* label */ FL_PUP_CB icb; /* callback */ long * shortcut; /* shortcut keys */ int subm; /* sub menu */ unsigned int mode; /* various attributes */ int ret; /* %x stuff */ short ulpos; /* hotkeys in label */ short radio; /* radio entry. 0 mean no radio */ short len; } MenuItem; typedef struct { int used; char * title; /* Menu title */ Window win; /* menu window */ Cursor cursor; /* cursor for the pup */ GC gc_active; /* GC for main text */ GC gc_inactive; /* GC for inactive text */ MenuItem * item[ FL_MAXPUPI + 1 ]; FL_PUP_CB menu_cb; /* callback routine */ FL_PUP_ENTERCB enter_cb; /* enter callback routine */ void * enter_data; FL_PUP_ENTERCB leave_cb; /* leave callback routine */ void * leave_data; unsigned long event_mask; int x, /* origin relative to root */ y; unsigned int w, /* total dimension */ h; short titleh; short nitems; /* no. of item in menu */ short title_width; /* title width */ short maxw; short bw; short lpad; short rpad; short padh; short cellh; short isEntry; /* true if menu is setup via entry struct */ int par_y; FL_FORM * form; } PopUP; static void grab_both( PopUP * ); static void reset_radio( PopUP *, MenuItem * ); /* Resources that control the fontsize and other things */ static int pup_font_style = FL_NORMAL_STYLE; static int pup_title_font_style = FL_NORMAL_STYLE; #ifdef __sgi static int pup_font_size = FL_SMALL_SIZE, pup_title_font_size = FL_SMALL_SIZE; #else static int pup_font_size = FL_NORMAL_SIZE, pup_title_font_size = FL_NORMAL_SIZE; #endif static FL_COLOR pup_color = FL_COL1; static FL_COLOR pup_text_color = FL_BLACK; static FL_COLOR pup_checked_color = FL_BLUE; static int pup_level = 0; static int fl_maxpup = FL_MAXPUP; static int pup_bw = -1; static int pup_bw_is_set = 0; static PopUP *menu_rec = NULL; static XFontStruct *pup_font_struct = NULL; /* popup main text font */ static int pup_ascent = 0, /* font properties */ pup_desc = 0; static XFontStruct *pup_title_font_struct = NULL; /* popup title text font */ static int pup_title_ascent = 0, pup_title_desc = 0; static Cursor pup_defcursor = 0; static int pup_subreturn; static int pup_using_keys = 0; static int pup_internal_showpup_call = 0; /************ data struct maintanance ******************{**/ /*************************************** ***************************************/ static void init_pupfont( void ) { XCharStruct chs; int junk; if ( ! pup_title_font_struct ) { pup_title_font_struct = fl_get_fntstruct( pup_title_font_style, pup_title_font_size ); XTextExtents( pup_title_font_struct, "qjQb", 4, &junk, &pup_title_ascent, &pup_title_desc, &chs ); } if ( ! pup_font_struct ) { pup_font_struct = fl_get_fntstruct( pup_font_style, pup_font_size ); XTextExtents( pup_font_struct, "qjQb", 4, &junk, &pup_ascent, &pup_desc, &chs ); } } /*************************************** * Initialize a particular menu ***************************************/ static void init_pup( PopUP * m ) { m->menu_cb = NULL; m->enter_cb = m->leave_cb = NULL; m->w = m->h = m->maxw = 0; m->nitems = 0; m->title_width = 0; m->win = None; m->gc_active = m->gc_inactive = None; m->bw = pup_bw; m->title = NULL; m->item[ 0 ] = NULL; m->padh = PADH; if ( ! pup_defcursor ) pup_defcursor = fli_get_cursor_byname( XC_sb_right_arrow ); m->cursor = pup_defcursor; m->lpad = m->rpad = PADW; init_pupfont( ); m->cellh = pup_ascent + pup_desc + 2 * m->padh; m->isEntry = 0; m->form = NULL; } /*************************************** ***************************************/ static int find_empty_index( Window win ) { PopUP *p; for ( p = menu_rec; p < menu_rec + fl_maxpup; p++ ) if ( ! p->used ) { init_pup( p ); p->used = 1; p->form = win != None ? fl_win_to_form( win ) : NULL; return p - menu_rec; } M_err( "find_empty_index", "Too many popups (maximum is %d)", fl_maxpup ); return -1; } static void convert_shortcut( const char *, const char *, MenuItem *, int ); static void wait_for_close( Window ); /*************************************** ***************************************/ static void reset_max_width( PopUP * m ) { int i; MenuItem **item = m->item; char *t, *b; if ( ! m->used || m->nitems <= 0 ) return; m->maxw = 0; for ( i = 0; i < m->nitems; i++ ) { b = t = fl_strdup( item[ i ]->str ); while ( ( b = strchr( b, '\b' ) ) ) memmove( b, b + 1, strlen( b ) ); m->maxw = FL_max( m->maxw, fl_get_string_widthTAB( pup_font_style, pup_font_size, t, strlen( t ) ) ); fl_free( t ); } if ( m->title && *m->title ) { b = t = fl_strdup( m->title ); while ( ( b = strchr( b, '\b' ) ) ) memmove( b, b + 1, strlen( b ) ); m->title_width = XTextWidth( pup_title_font_struct, t, strlen( t ) ); fl_free( t ); } else m->title_width = 0; m->cellh = pup_ascent + pup_desc + 2 * m->padh; } /*************************************** * Parse the menu entries ***************************************/ #define MV( d, s ) memmove( ( d ), ( s ), strlen( s ) + 1 ) static int parse_entry( int n, const char * str, va_list ap ) { PopUP *m = menu_rec + n; MenuItem *item; char *s, *c, *p, *e, *sc = NULL; unsigned int flags = 0; long num; if ( n < 0 || n >= fl_maxpup || ! menu_rec[ n ].used || ! str ) return -1; s = fl_strdup( str ); for ( c = strtok( s, "|" ); c && m->nitems < FL_MAXPUPI; c = strtok( NULL, "|" ) ) { flags = 0; m->item[ m->nitems ] = item = fl_malloc( sizeof *item ); item->str = NULL; item->icb = NULL; item->shortcut = NULL; item->subm = -1; item->mode = 0; item->ret = m->nitems + 1; item->ulpos = -1; item->radio = 0; item->len = 0; p = c; while ( ( p = strchr( p, '%' ) ) && ! ( flags & M_ERR ) ) { switch ( p[ 1 ] ) { case '%' : MV( p, p + 1 ); p = p + 1; break; case 't' : flags |= M_TITLE; MV( p, p + 2 ); break; case 'f' : item->icb = va_arg( ap, FL_PUP_CB ); MV( p, p + 2 ); break; case 'F' : m->menu_cb = va_arg( ap, FL_PUP_CB ); MV( p, p + 2 ); break; case 'm' : item->subm = va_arg( ap, int ); MV( p, p + 2 ); break; case 'l' : MV( p, p + 2 ); MV( c + 1, c ); *c = '\010'; p = p + 1; break; case 'i' : case 'd' : item->mode |= FL_PUP_GREY; MV( p, p + 2 ); break; case 'x' : num = strtol( p + 2, &e, 10 ); if ( e == p + 2 ) { flags |= M_ERR; M_err( "parse_entry", "Missing number after %%x" ); break; } if ( num <= 0 ) { flags |= M_ERR; M_err( "parse_entry", "Invalid zero or negative " "number after %%x" ); break; } item->ret = num; while ( isspace( ( unsigned char ) *e ) ) e++; MV( p, e ); break; case 'B' : item->mode |= FL_PUP_CHECK; /* fall through */ case 'b' : item->mode |= FL_PUP_BOX; MV( p, p + 2 ); break; case 'R' : item->mode |= FL_PUP_CHECK; /* fall through */ case 'r' : item->mode |= FL_PUP_BOX; num = strtol( p + 2, &e, 10 ); if ( num <= 0 ) { flags |= M_ERR; M_err( "parse_entry", "Zero or negative group number" ); break; } if ( e == p + 2 ) { flags |= M_ERR; M_err( "parse_entry", "Missing number after %%%c", p + 1 ); break; } item->radio = num; while ( isspace( ( unsigned char ) *e ) ) e++; /* If the item is to be in on state all other items belonging to the same group must be in off state */ if ( p[ 1 ] == 'R' ) { int k; for ( k = m->nitems - 1; k >= 0; k-- ) if ( m->item[ k ]->radio == item->radio ) m->item[ k ]->mode &= ~ FL_PUP_CHECK; } MV( p, e ); break; case 'h' : case 's' : sc = va_arg( ap, char * ); MV( p, p + 2 ); break; default : flags |= M_ERR; M_err( "parse_entry", "Unknown sequence %%%c", p[ 1 ] ); break; } } if ( flags & M_ERR ) { fl_free( item ); m->item[ m->nitems ] = NULL; break; } if ( sc ) { M_info( "parse_entry", "shortcut = %s for %s", sc, c ); convert_shortcut( sc, c, item, NSC ); } if ( item->mode & FL_PUP_BOX ) m->lpad = PADW + CHECKW + 2; if ( item->subm >= 0 ) m->rpad = PADW + 16; if ( flags & M_TITLE ) { char *t, *b; m->title = fl_strdup( c ); b = t = fl_strdup( c ); while ( ( b = strchr( b, '\b' ) ) ) memmove( b, b + 1, strlen( b ) ); m->title_width = XTextWidth( pup_title_font_struct, t, strlen( t ) ); fl_free( t ); fl_free( item ); m->item[ m->nitems ] = NULL; } else { char *t, *b; item->str = fl_strdup( c ); item->len = strlen( item->str ); b = t = fl_strdup( item->str ); while ( ( b = strchr( b, '\b' ) ) ) memmove( b, b + 1, strlen( b ) ); m->maxw = FL_max( m->maxw, fl_get_string_widthTAB( pup_font_style, pup_font_size, t, strlen( t ) ) ); fl_free( t ); m->nitems++; } } if ( c ) M_err( "parse_entry", "Too many menu items, max is %d", FL_MAXPUPI ); fl_free( s ); return ( flags & M_ERR ) ? -1 : 0; } /*************************************** ***************************************/ static void close_pupwin( PopUP * pup ) { if ( pup->win ) { XDestroyWindow( flx->display, pup->win ); wait_for_close( pup->win ); pup->win = None; } } /*************************************** * initialize the menu system. Must be called first. Made defpup/newpup * etc. auto call fli_init_pup (instead of letting fl_initialize to call * it) and we save about ~25k in exe size for app not using pups ***************************************/ void fli_init_pup( void ) { PopUP *mr; size_t i; if ( menu_rec ) return; menu_rec = fl_calloc( fl_maxpup, sizeof *menu_rec ); for ( mr = menu_rec; mr < menu_rec + fl_maxpup; mr++ ) { mr->used = 0; mr->title = NULL; mr->win = None; mr->cursor = None; mr->gc_active = mr->gc_inactive = None; mr->menu_cb = NULL; mr->enter_cb = mr->leave_cb = NULL; mr->enter_data = mr->leave_data = NULL; for ( i = 0; i <= FL_MAXPUPI; i++ ) mr->item[ i ] = NULL; } fl_setpup_default_fontsize( fli_cntl.pupFontSize ? fli_cntl.pupFontSize : -2 ); } /*************************************** ***************************************/ int fl_setpup_default_fontsize( int size ) { int i; int old_pup_font_size = pup_font_size; if ( size <= 0 ) return old_pup_font_size; fli_init_pup( ); pup_font_size = size; pup_title_font_size = size; pup_font_struct = pup_title_font_struct = NULL; if ( ! flx->display ) return old_pup_font_size; init_pupfont( ); for ( i = 0; i < fl_maxpup; i++ ) { reset_max_width( menu_rec + i ); close_pupwin( menu_rec + i ); } return old_pup_font_size; } /*************************************** ***************************************/ int fl_setpup_default_fontstyle( int style ) { int i; int old_pup_font_style = pup_font_style; if ( ! flx->display ) return old_pup_font_style; if ( style < 0 ) return pup_font_style; fli_init_pup( ); pup_font_style = style; pup_title_font_style = style; pup_font_struct = pup_title_font_struct = NULL; init_pupfont( ); for ( i = 0; i < fl_maxpup; i++ ) reset_max_width( menu_rec + i ); return old_pup_font_style; } /*************************************** ***************************************/ void fl_setpup_default_color( FL_COLOR fg, FL_COLOR bg ) { pup_color = fg; pup_text_color = bg; } /*************************************** ***************************************/ void fl_setpup_default_pup_checked_color( FL_COLOR col ) { pup_checked_color = col; } /******************************************************************** * Public routines ****************************************************************{***/ /*************************************** * Allocate a new PopUP ID ***************************************/ int fl_newpup( Window win ) { fli_init_pup( ); if ( pup_level ) { M_warn( "fl_newpup", "Inconsistent pup_level %d", pup_level ); pup_level = 0; } if ( ! pup_bw_is_set ) { pup_bw = fli_cntl.borderWidth ? fli_cntl.borderWidth : -2; pup_bw_is_set = 1; } return find_empty_index( win == None ? fl_root : win ); } /*************************************** * Add pop-up entries ***************************************/ int fl_addtopup( int n, const char * str, ... ) { va_list ap; int ret; if ( n < 0 || n >= fl_maxpup || ! menu_rec[ n ].used ) return -1; va_start( ap, str ); ret = parse_entry( n, str, ap ); va_end( ap ); return ret == 0 ? n : -1; } /*************************************** * Allocate PopUP ID and optionally set all entries ***************************************/ int fl_defpup( Window win, const char * str, ... ) { int n; int ret; va_list ap; if ( ( n = fl_newpup( win ) ) < 0 ) return -1; if ( str == 0 ) return n; va_start( ap, str ); ret = parse_entry( n, str, ap ); va_end( ap ); return ret == 0 ? n : -1; } /*************************************** * Check to see if the requested value exists in popup m ***************************************/ static MenuItem * ind_is_valid( PopUP * m, int ind ) { MenuItem **is = m->item, **ise, *item = NULL; for ( ise = is + m->nitems; is < ise && !item; is++ ) { if ( ( *is )->ret == ind ) item = *is; else if ( ( *is )->subm >= 0 ) item = ind_is_valid( menu_rec + ( *is )->subm, ind ); } return item; } /*************************************** ***************************************/ static MenuItem * requested_item_is_valid( const char * where, int nm, int ni ) { if ( nm < 0 || nm >= fl_maxpup || ! menu_rec[ nm ].used ) { M_err( where, "Bad popup index %d", nm ); return NULL; } return ind_is_valid( menu_rec + nm, ni ); } /*************************************** * Change attributes of a popup item ***************************************/ int fl_setpup_mode( int nm, int ni, unsigned int mode ) { MenuItem *item; if ( ! ( item = requested_item_is_valid( "fl_setpup_mode", nm, ni ) ) ) return -1; if ( ( item->mode = mode ) & FL_PUP_CHECK ) item->mode |= FL_PUP_BOX; if ( item->mode & FL_PUP_RADIO ) { item->mode |= FL_PUP_BOX; if ( ! item->radio ) item->radio = -1; } if ( item->mode & FL_PUP_BOX ) menu_rec[ nm ].lpad = PADW + CHECKW + 2; return 0; } #define AltMask FL_ALT_MASK /*************************************** ***************************************/ static void convert_shortcut( const char * sc, const char * str, MenuItem * item, int n FL_UNUSED_ARG ) { if ( ! item->shortcut ) item->shortcut = fl_calloc( 1, NSC * sizeof *item->shortcut ); item->ulpos = fli_get_underline_pos( str, sc ) - 1; fli_convert_shortcut( sc, item->shortcut ); if ( sc[ 0 ] == '&' ) M_info( "convert_shortcut", "sc = %s keysym = %ld\n", sc, item->shortcut[ 0 ] ); } static void draw_popup( PopUP * ); static void draw_item( PopUP *, int, int ); /*************************************** ***************************************/ static void wait_for_close( Window win ) { long emask = AllEventsMask; XEvent xev; /* Drop all events for the window. We need to do sync before to be sure all events are already in the event queue */ XSync( flx->display, False ); while ( XCheckWindowEvent( flx->display, win, emask, &xev ) ) /* empty */ ; } /**************************************************************** * Global routine of doing pop-ups. Never returns unless user * does something with the pointer. For "hanging" pop-ups, a * pointer & focus grab will be activated and released upon returning. * Since requested item might be inactive, search for next active * item if current one is not ****************************************************************/ static int get_valid_entry( PopUP * m, int target, int dir ) { if ( target < 1 ) target = dir < 0 ? m->nitems : 1; if ( target > m->nitems ) target = dir < 0 ? m->nitems : 1; for ( ; target > 0 && target <= m->nitems; target += dir ) if ( ! ( m->item[ target - 1 ]->mode & FL_PUP_GREY ) ) return target; /* wrap */ if ( target < 1 ) target = dir < 0 ? m->nitems : 1; if ( target > m->nitems ) target = dir < 0 ? m->nitems : 1; for ( ; target > 0 && target <= m->nitems; target += dir ) if ( ! ( m->item[ target - 1 ]->mode & FL_PUP_GREY ) ) return target; M_err( "get_valid_entry", "No valid entries among total of %d", m->nitems ); return 0; } #define alt_down ( metakey_down( keymask ) != 0 ) /*************************************** ***************************************/ static int handle_shortcut( PopUP * m, KeySym keysym, unsigned int keymask ) { MenuItem **mi = m->item; int i, j; int sc, alt; for ( i = 0; i < m->nitems; i++ ) { if ( ! ( mi[ i ]->mode & FL_PUP_GREY ) && mi[ i ]->shortcut ) for ( j = 0; j < NSC && mi[ i ]->shortcut[ j ]; j++ ) { sc = mi[ i ]->shortcut[ j ]; alt = ( sc & AltMask ) == AltMask; sc &= ~ AltMask; if ( sc == ( int ) keysym && ! ( alt ^ alt_down ) ) return i + 1; } } return 0; } /*************************************** ***************************************/ static int handle_submenu( PopUP * m, MenuItem * item, int * val ) { if ( ! ( item->mode & ( FL_PUP_GREY | FL_INACTIVE ) ) && item->subm >= 0 ) { /* Set up the position for the new window (it should appear so that it's top line is flush with the line of the parent menu it was started from). Please note: the new window has to overlap the parent window at least in a single point - otherwise drawing artefacts often appear! */ fl_setpup_position( m->x + m->w - 3, m->y + m->cellh * ( *val - 1 ) + ( ( m->title && *m->title ) ? m->titleh - m->padh : 0 ) ); /* Draw and deal with the submenu */ if ( ( pup_subreturn = *val = fl_dopup( item->subm ) ) <= 0 ) grab_both( m ); else return 1; } return 0; } /*************************************** * Keyboard handling. Also checks shortcut ***************************************/ static int pup_keyboard( XKeyEvent * xev, PopUP * m, int * val ) { KeySym keysym = NoSymbol; char buf[ 16 ]; int oldval = *val; XLookupString( xev, buf, sizeof buf, &keysym, 0 ); if ( IsHome( keysym ) ) { draw_item( m, *val, FL_FLAT_BOX ); *val = get_valid_entry( m, 1, -1 ); draw_item( m, *val, FL_UP_BOX ); } else if ( IsEnd( keysym ) ) { draw_item( m, *val, FL_FLAT_BOX ); *val = get_valid_entry( m, m->nitems, 1 ); draw_item( m, *val, FL_UP_BOX ); } else if ( IsUp( keysym ) ) { draw_item( m, *val, FL_FLAT_BOX ); *val = get_valid_entry( m, *val - 1, -1 ); draw_item( m, *val, FL_UP_BOX ); } else if ( IsDown( keysym ) ) { draw_item( m, *val, FL_FLAT_BOX ); *val = get_valid_entry( m, *val + 1, 1 ); draw_item( m, *val, FL_UP_BOX ); } else if ( IsRight( keysym ) ) { if ( *val > 0 && *val <= m->nitems && m->item[ *val - 1 ]->subm ) { oldval = *val; if ( handle_submenu( m, m->item[ *val - 1 ], val ) ) keysym = XK_Return; else *val = oldval; } } else if ( IsLeft( keysym ) ) { *val = -1; keysym = XK_Escape; } else if ( keysym == XK_Escape || keysym == XK_Cancel ) { draw_item( m, *val, FL_FLAT_BOX ); *val = -1; } else if ( keysym == XK_Return ) { if ( *val > 0 && *val <= m->nitems && m->item[ *val - 1 ]->subm ) handle_submenu( m, m->item[ *val - 1 ], val ); } else { int i; if ( ( i = handle_shortcut( m, keysym, xev->state ) ) ) { *val = i; handle_submenu( m, m->item[ *val - 1 ], val ); keysym = XK_Return; } else pup_using_keys = 0; } if ( oldval != *val && ( m->enter_cb || m->leave_cb ) ) { if ( oldval > 0 && oldval <= m->nitems && m->leave_cb ) m->leave_cb( m->item[ oldval - 1 ]->ret, m->leave_data ); if ( *val > 0 && *val <= m->nitems && m->enter_cb ) m->enter_cb( m->item[ *val - 1 ]->ret, m->enter_data ); } return keysym == XK_Escape || keysym == XK_Return || keysym == XK_Cancel; } /*************************************** * Mouse moved - val is set to the item number (not value) upon return ***************************************/ static MenuItem * handle_motion( PopUP * m, int mx, int my, int * val ) { int cval = -1; MenuItem *item = NULL; static MenuItem *lastitem = NULL; static PopUP *lastm = NULL; if ( mx >= 0 && mx <= ( int ) m->w && my >= 0 && my <= ( int ) m->h - ( FL_abs( m->bw ) > 2 ) - ( m->padh > 1 ) ) { cval = m->nitems - ( m->h - ( FL_abs( m->bw ) > 2 ) - ( m->padh > 1 ) - my ) / m->cellh; if ( cval > 0 ) item = m->item[ cval - 1 ]; } if ( cval != *val || m != lastm ) { draw_item( m, *val, FL_FLAT_BOX ); draw_item( m, cval, FL_UP_BOX ); *val = cval; } if ( item && item->mode & FL_PUP_GREY ) item = NULL; if ( lastitem && item != lastitem && m->leave_cb ) m->leave_cb( lastitem->ret, m->leave_data ); if ( item && item != lastitem && m->enter_cb ) m->enter_cb( item->ret, m->enter_data ); lastitem = item; lastm = m; return item; } /*************************************** * Interaction routine. If mouse is released on the title bar, * consider its a "hanging" pop-up request else return ***************************************/ static int pup_interact( PopUP * m ) { XEvent ev; int val = 0, done = 0, timer_cnt = 0; MenuItem *item; m->event_mask |= KeyPressMask; ev.xmotion.time = 0; /* If the new popup was opened due to a key press mark the first active entry as currently selected */ if ( pup_using_keys ) { int i; for ( i = 1; i < m->nitems; i++ ) { if ( m->item[ i - 1 ]->mode & FL_PUP_GREY ) continue; draw_item( m, i, FL_UP_BOX ); val = i; break; } } while ( ! done ) { long msec = fli_context->idle_delta; if ( fli_context->timeout_rec ) fli_handle_timeouts( &msec ); if ( ! XCheckWindowEvent( flx->display, m->win, m->event_mask, &ev ) ) { /* If the mouse button was released or pressed not within the popup's window we're through with the popup */ if ( XCheckTypedEvent( flx->display, ButtonPress, &ev ) || XCheckTypedEvent( flx->display, ButtonRelease, &ev ) ) { val = -1; break; } if ( timer_cnt++ % 10 == 0 ) { timer_cnt = 0; fli_handle_idling( &ev, msec, 1 ); fl_winset( m->win ); } continue; } timer_cnt = 0; fli_int.query_age++; switch ( ev.type ) { case Expose: draw_popup( m ); XSync( flx->display, 0 ); break; case MotionNotify: fli_compress_event( &ev, ButtonMotionMask ); /* fall through */ case ButtonPress: /* taking adv. of xbutton.x == xcrossing.x */ fli_int.mousex = ev.xmotion.x; fli_int.mousey = ev.xmotion.y; fli_int.keymask = ev.xmotion.state; fli_int.query_age = 0; pup_using_keys = 0; item = handle_motion( m, ev.xbutton.x, ev.xbutton.y, &val ); if ( item && item->subm >= 0 && ev.xbutton.x >= 0 ) { unsigned int keymask; int old_val = val; done = handle_submenu( m, item, &val ); fl_get_win_mouse( m->win, &ev.xbutton.x, &ev.xbutton.y, &keymask ); if ( ! ( done = keymask ? done : 1 ) ) draw_item( m, old_val, FL_FLAT_BOX ); } else if ( pup_level > 1 && val < 0 ) done = ev.xbutton.x < 0 && ( ev.xbutton.y <= m->par_y || ev.xbutton.y > m->par_y + m->cellh ); break; case ButtonRelease: fli_int.mousex = ev.xbutton.x; fli_int.mousey = ev.xbutton.y; fli_int.keymask = ev.xbutton.state; fli_int.query_age = 0; item = handle_motion( m, ev.xbutton.x, ev.xbutton.y, &val ); if ( item && item->subm >= 0 && val != -1 ) done = handle_submenu( m, item, &val ); else done = val != 0; break; case KeyPress: fli_int.mousex = ev.xkey.x; fli_int.mousey = ev.xkey.y; fli_int.keymask = ev.xkey.state; fli_int.query_age = 0; pup_using_keys = 1; done = pup_keyboard( ( XKeyEvent * ) &ev, m, &val ); break; case UnmapNotify: /* must be by external routine */ done = 1; val = -1; break; } } return val; } /*************************************** ***************************************/ static void grab_both( PopUP * m ) { unsigned int evmask = m->event_mask; /* Set the window we're using */ fl_winset( m->win ); /* Get rid of all non-pointer events in event_mask */ evmask &= ~ ( ExposureMask | KeyPressMask ); XSync( flx->display, 0 ); fl_msleep( 30 ); XChangeActivePointerGrab( flx->display, evmask, m->cursor, CurrentTime ); /* Do pointer and keyboard grab */ if ( XGrabPointer( flx->display, m->win, False, evmask, GrabModeAsync, GrabModeAsync, None, m->cursor, CurrentTime ) != GrabSuccess ) M_err( "grab_both", "Can't grab pointer" ); if ( XGrabKeyboard( flx->display, m->win, False, GrabModeAsync, GrabModeAsync, CurrentTime ) != GrabSuccess ) { M_err( "grab_both", "Can't grab keyboard" ); XUngrabPointer( flx->display, CurrentTime ); } } /*************************************** * Main routine for creating, doing interaction and removing a popup window ***************************************/ int fl_dopup( int n ) { PopUP *m = menu_rec + n; int val = 0; MenuItem *item = 0; XEvent xev; if ( n < 0 || n >= fl_maxpup || ! menu_rec[ n ].used ) { M_err( "fl_dopup", "bad pupID: %d\n", n ); return -1; } if ( pup_level == 0 ) fli_context->pup_id = n; pup_subreturn = -1; pup_level++; pup_internal_showpup_call = 1; fl_showpup( n ); /* If one opens a touch menu and is fast enough to move the mouse out of the window before the grab is active an extra EnterNotify event comes in that results in the touch menu getting opened again after closing it, so delete all such events for the form the touch menu belongs to. */ if ( m->form && m->form->window ) while ( XCheckWindowEvent( flx->display, m->form->window, EnterWindowMask, &xev ) ) /* empty */ ; /* pup_interact() returns the item number */ val = pup_interact( m ); if ( m->win ) { XUnmapWindow( flx->display, m->win ); wait_for_close( m->win ); } else M_err( "fl_dopup", "Window already closed" ); /* The following is necessary because 'save_under' may not be supported. Both the forms under the closed popup window and higher level popup window may require a redraw if the had become (partially) hidden. */ if ( pup_level > 1 && ! DoesSaveUnders( ScreenOfDisplay( flx->display, fl_screen ) ) ) { FL_FORM *form; while ( XCheckMaskEvent( flx->display, ExposureMask, &xev ) != False ) if ( ( form = fl_win_to_form( ( ( XAnyEvent * ) &xev )->window ) ) != NULL ) { fl_winset( form->window ); fl_redraw_form( form ); } else { int i; for ( i = 0; i < fl_maxpup; i++ ) if ( menu_rec[ i ].win == ( ( XAnyEvent * ) &xev )->window ) { fl_winset( menu_rec[ i ].win ); draw_popup( menu_rec + i ); } } } if ( pup_level > 1 ) { /* Need to remove all MotionNotify otherwise wrong coord */ while ( XCheckMaskEvent( flx->display, ButtonMotionMask, &xev ) ) /* empty */ ; } /* Handle callback if any */ pup_level--; if ( val > 0 && val <= m->nitems && ( pup_subreturn < 0 || ( pup_subreturn > 0 && pup_level > 0 ) ) ) { item = m->item[ val - 1 ]; /* If we ended up on a disabled item or one that points to a submenu return -1 to indicate nothing got selected */ if ( item->mode & FL_PUP_GREY || item->subm >= 0 ) { fli_context->pup_id = -1; return -1; } if ( item->radio ) reset_radio( m, item ); else if ( item->mode & FL_PUP_CHECK ) { item->mode &= ~ FL_PUP_CHECK; item->mode |= FL_PUP_BOX; } else if ( item->mode & FL_PUP_BOX ) item->mode |= FL_PUP_CHECK; val = item->ret; if ( item->icb ) val = item->icb( val ); if ( val > 0 && m->menu_cb ) val = m->menu_cb( val ); } if ( pup_level <= 0 ) fli_context->pup_id = -1; if ( pup_subreturn > 0 ) val = pup_subreturn; return val; } /*************************************** ***************************************/ void fl_freepup( int n ) { PopUP *p = menu_rec + n; int i; if ( n < 0 || n >= fl_maxpup || ! menu_rec[ n ].used ) return; if ( ! p->used ) { M_warn( "freepup", "freeing an unallocated/free'ed popup %d\n", n ); return; } for ( i = 0; i < p->nitems; i++ ) { if ( p->item[ i ] ) { if ( p->item[ i ]->subm >= 0 && p->isEntry ) fl_freepup( p->item[ i ]->subm ); fli_safe_free( p->item[ i ]->str ); fli_safe_free( p->item[ i ]->shortcut ); } fli_safe_free( p->item[ i ] ); } p->used = 0; if ( p->gc_active != None ) XFreeGC( flx->display, p->gc_active ); if ( p->gc_inactive != None ) XFreeGC( flx->display, p->gc_inactive ); fli_safe_free( p->title ); close_pupwin( p ); } /* * Some convenience functions */ /*************************************** ***************************************/ void fl_setpup_shortcut( int nm, int ni, const char * sc ) { MenuItem *item; if ( sc && ( item = requested_item_is_valid( "pupshortcut", nm, ni ) ) ) convert_shortcut( sc, item->str, item, NSC ); } /*************************************** * ***************************************/ FL_PUP_CB fl_setpup_menucb( int nm, FL_PUP_CB cb ) { PopUP *m; FL_PUP_CB oldcb; if ( nm < 0 || nm >= fl_maxpup || ! menu_rec[ nm ].used ) return NULL; m = menu_rec + nm; oldcb = m->menu_cb; m->menu_cb = cb; return oldcb; } /*************************************** ***************************************/ FL_PUP_ENTERCB fl_setpup_entercb( int nm, FL_PUP_ENTERCB cb, void * data ) { FL_PUP_ENTERCB oldcb; PopUP *m; int n, subm; if ( nm < 0 || nm >= fl_maxpup || ! menu_rec[ nm ].used ) return NULL; m = menu_rec + nm; oldcb = m->enter_cb; m->enter_cb = cb; m->enter_data = data; for ( n = 0; n < m->nitems; n++ ) if ( ( subm = m->item[ n ]->subm ) >= 0 && ! menu_rec[ subm ].enter_cb ) fl_setpup_entercb( subm, cb, data ); return oldcb; } /*************************************** ***************************************/ FL_PUP_LEAVECB fl_setpup_leavecb( int nm, FL_PUP_LEAVECB cb, void * data ) { FL_PUP_LEAVECB oldcb; PopUP *m; int n, subm; if ( nm < 0 || nm >= fl_maxpup || ! menu_rec[ nm ].used ) return NULL; m = menu_rec + nm; oldcb = m->leave_cb; m->leave_cb = cb; m->leave_data = data; for ( n = 0; n < m->nitems; n++ ) if ( ( subm = m->item[ n ]->subm ) >= 0 && ! menu_rec[ subm ].enter_cb ) fl_setpup_leavecb( subm, cb, data ); return oldcb; } /*************************************** ***************************************/ FL_PUP_CB fl_setpup_itemcb( int nm, int ni, FL_PUP_CB cb ) { MenuItem *item; FL_PUP_CB oldcb = NULL; if ( ( item = requested_item_is_valid( "fl_setpup_itemcb", nm, ni ) ) ) { oldcb = item->icb; item->icb = cb; } return oldcb; } /*************************************** ***************************************/ void fl_setpup_title( int nm, const char * title ) { PopUP *m = menu_rec + nm; char *t, *b; if ( nm < 0 || nm >= fl_maxpup || ! menu_rec[ nm ].used || ! title ) return; fli_safe_free( m->title ); m->title = fl_strdup( title ? title : "" ); b = t = fl_strdup( title ? title : "" ); while ( ( b = strchr( b, '\b' ) ) ) memmove( b, b + 1, strlen( b ) ); m->title_width = XTextWidth( pup_title_font_struct, t, strlen( t ) ); fl_free( t ); } /*************************************** ***************************************/ void fl_setpup_title_f( int nm, const char * fmt, ... ) { char *buf; EXPAND_FORMAT_STRING( buf, fmt ); fl_setpup_title( nm, buf ); fl_free( buf ); } /*************************************** ***************************************/ Cursor fl_setpup_cursor( int nm, int cursor ) { PopUP *m; Cursor old; if ( nm < 0 || nm >= fl_maxpup || ! menu_rec[ nm ].used ) return None; m = menu_rec + nm; old = m->cursor; m->cursor = cursor ? fli_get_cursor_byname( cursor ) : pup_defcursor; return old; } /*************************************** ***************************************/ Cursor fl_setpup_default_cursor( int cursor ) { Cursor old_defcursor = pup_defcursor; pup_defcursor = fli_get_cursor_byname( cursor ); return old_defcursor; } /*************************************** ***************************************/ void fl_setpup_pad( int n, int padw, int padh ) { PopUP *m; if ( n < 0 || n >= fl_maxpup || ! menu_rec[ n ].used ) return; m = menu_rec + n; m->padh = padh; m->rpad = m->lpad = padw; m->cellh = pup_ascent + pup_desc + 2 * m->padh; } /*************************************** ***************************************/ static void recurse( PopUP * m, void ( * set )( int, int ), int val ) { int i; for ( i = 0; i < m->nitems; i++ ) if ( m->item[ i ]->subm ) set( m->item[ i ]->subm, val ); } /*************************************** ***************************************/ void fl_setpup_shadow( int n, int y FL_UNUSED_ARG ) { if ( n < 0 || n >= fl_maxpup || ! menu_rec[ n ].used ) return; } /*************************************** ***************************************/ void fl_setpup_bw( int n, int bw ) { PopUP *m = menu_rec + n; int i; if ( n < 0 || n >= fl_maxpup || ! menu_rec[ n ].used ) return; m->bw = bw; for ( i = 0; i < m->nitems; i++ ) if ( m->item[ i ]->subm ) fl_setpup_bw( m->item[ i ]->subm, bw ); } /*************************************** ***************************************/ void fl_setpup_softedge( int n, int y ) { PopUP *m; if ( n < 0 || n >= fl_maxpup || ! menu_rec[ n ].used ) return; m = menu_rec + n; m->bw = y ? - FL_abs( m->bw ) : FL_abs( m->bw ); recurse( m, fl_setpup_softedge, y ); } /*************************************** ***************************************/ static void reset_radio( PopUP * m, MenuItem * item ) { MenuItem **ii; for ( ii = m->item; ii < m->item + m->nitems; ii++ ) if ( ( *ii )->radio == item->radio ) ( *ii )->mode &= ~ FL_PUP_CHECK; item->mode |= FL_PUP_CHECK; } /*************************************** ***************************************/ void fl_setpup_selection( int nm, int ni ) { MenuItem *item; if ( ( item = requested_item_is_valid( "fl_setpup_selection", nm, ni ) ) && item->radio ) reset_radio( menu_rec + nm, item ); } /*************************************** ***************************************/ void fl_setpup_submenu( int m, int i, int subm ) { MenuItem *item; if ( ( item = requested_item_is_valid( "fl_setpup_submenu", m, i ) ) ) { menu_rec[ m ].rpad = PADW + 16; item->subm = subm; } } /**** End of PUBLIC routines for pop-ups *******************}*/ /**** ALL drawing routines */ /*************************************** * draw item. Index starts from 1 ***************************************/ static void draw_item( PopUP * m, int i, int style ) { int j = i - 1; int bw = FL_abs( m->bw ); int x = bw, w = m->w - 2 * bw, y = m->titleh + m->cellh * j, h = m->cellh; char *str; MenuItem *item; GC gc; if ( j < 0 || j >= m->nitems ) return; item = m->item[ j ]; gc = ( item->mode & FL_PUP_GREY ) ? m->gc_inactive : m->gc_active; str = item->str; if ( ! ( item->mode & FL_PUP_GREY ) ) fl_draw_box( style, x + 1, y, w - 2, h - 1, pup_color, m->bw == -1 ? -1 : -2 ); if ( item->mode & FL_PUP_BOX && ! ( item->mode & FL_PUP_CHECK ) ) { int w = CHECKW + ( item->radio ? 0 : 2 ); int bbw = item->radio ? -2 : -1; ( item->radio ? fli_draw_checkbox : fl_draw_box ) ( FL_UP_BOX, 2 * bw + ( m->lpad - w ) / 2, y + ( h - CHECKW ) / 2 - 2, w, w, pup_color, bbw ); } if ( item->mode & FL_PUP_CHECK ) { int w = CHECKW + ( item->radio ? 0 : 2 ); int bbw = item->radio ? -3 : -2; ( item->radio ? fli_draw_checkbox : fl_draw_box ) ( FL_DOWN_BOX, 2 * bw + ( m->lpad - w ) / 2, y + ( h - CHECKW ) / 2 - 2, w, w, fli_depth( fl_vmode ) == 1 ? FL_BLACK : pup_checked_color, bbw ); } /* show text */ j = str[ 0 ] == '\010'; fli_draw_stringTAB( m->win, gc, m->lpad + 2 * bw, y + m->padh + pup_ascent, pup_font_style, pup_font_size, str + j, strlen( str ) - j, 0 ); /* do underline */ if ( item->ulpos >= 0 ) { XRectangle *xr; xr = fli_get_underline_rect( pup_font_struct, m->lpad + 2 * bw, y + m->padh + pup_ascent, str, item->ulpos ); XFillRectangle( flx->display, m->win, gc, xr->x, xr->y, xr->width, xr->height ); } if ( j ) fl_draw_symbol( "@DnLine", 2 * bw, y + h - 2, m->w - 4 * bw, 1, FL_COL1 ); if ( item->subm >= 0 ) fl_draw_symbol( ( style == FL_UP_BOX && ! ( item->mode & FL_PUP_GREY ) ) ? "@DnArrow" : "@UpArrow", m->w - 2 * bw - 9 - m->rpad / 2, y + h / 2 - 8, 16, 16, FL_BLACK ); } /*************************************** ***************************************/ static void draw_title( Display * d, Drawable w, int x, int y, char * s ) { char *t, *b; int n; if ( ! s || ! * s ) return; b = t = fl_strdup( s ); while ( ( b = strchr( b, '\b' ) ) ) memmove( b, b + 1, strlen( b ) ); n = strlen( t ); fl_set_font( pup_title_font_style, pup_title_font_size ); fli_textcolor( pup_text_color ); XDrawString( d, w, flx->textgc, x - 1, y - 1, t, n ); XDrawString( d, w, flx->textgc, x, y - 1, t, n ); XDrawString( d, w, flx->textgc, x + 1, y - 1, t, n ); XDrawString( d, w, flx->textgc, x - 1, y, t, n ); XDrawString( d, w, flx->textgc, x + 1, y, t, n ); XDrawString( d, w, flx->textgc, x - 1, y + 1, t, n ); XDrawString( d, w, flx->textgc, x, y + 1, t, n ); XDrawString( d, w, flx->textgc, x + 1, y + 1, t, n ); fli_textcolor( FL_WHITE ); XDrawString( d, w, flx->textgc, x, y, t, n ); fl_free( t ); } /*************************************** * Instead of popping up the menu at mouse location, use externally * set position. Good for programmatical pop-ups ***************************************/ static int extpos = 0; static FL_Coord extx = 0, exty = 0; static int align_bottom = 0; /*************************************** ***************************************/ void fl_setpup_position( int x, int y ) { extpos = 1; extx = x; exty = y; } /*************************************** ***************************************/ void fl_setpup_align_bottom( void ) { align_bottom = 1; } /*************************************** ***************************************/ static void draw_popup( PopUP * m ) { int i; if ( m->title && *m->title ) m->titleh = pup_title_ascent + pup_title_desc + PADTITLE; else m->titleh = m->padh; /* make the popup box */ fl_draw_box( FL_UP_BOX, 0, 0, m->w, m->h, pup_color, m->bw ); /* title box */ if ( m->title && *m->title ) { fl_draw_box( FL_FRAME_BOX, 3, 3, m->w - 6, m->titleh - 6, pup_color, 1 ); draw_title( flx->display, m->win, ( m->w - m->title_width ) / 2, PADTITLE / 2 + pup_title_ascent, m->title ); } for ( i = 1; i <= m->nitems; i++ ) draw_item( m, i, FL_FLAT_BOX ); } /*************************************** ***************************************/ void fl_showpup( int n ) { PopUP *m = menu_rec + n; int req_y = exty; unsigned int dummy; if ( n < 0 || n >= fl_maxpup || ! menu_rec[ n ].used ) { M_err( "fl_showpup", "bad pupID: %d\n", n ); return; } /* Calculate the height of the title */ if ( m->title ) m->titleh = pup_title_ascent + pup_title_desc + PADTITLE; else m->titleh = m->padh; /* Calculate the total width and height of the popup */ m->maxw = FL_max( m->title_width, m->maxw ); m->w = m->maxw + m->rpad + m->lpad + 4 * FL_abs( m->bw ); m->h = m->nitems * m->cellh + m->titleh + 1 + ( m->padh > 1 ) + 2 * ( FL_abs( m->bw ) > 2 ); /* If no external coordinates are set open the popup at the mouse position, otherwise take care that negative coordinates specify the lower right hand corner of the popup */ if ( ! extpos ) fl_get_mouse( &m->x, &m->y, &dummy ); else { if ( extx >= 0 ) m->x = extx; else m->x = - extx - m->w; if ( exty >= 0 ) m->y = exty; else m->y = - exty - m->h; } if ( align_bottom ) m->y -= m->h; /* Try to make sure the popup is within the root window */ if ( m->x + m->w > ( unsigned int ) fl_scrw ) m->x = fl_scrw - m->w; if ( m->y + m->h > ( unsigned int ) fl_scrh ) m->y = fl_scrh - m->h; /* If the root window is too small show whatever we can */ if ( m->x < 0 ) m->x = 0; if ( m->y < 0 ) m->y = 0; /* Warp the mouse to the upper left hand corner of the popup unless external coordinates are specified */ if ( ! extpos && ( m->x != extx || m->y != exty ) ) XWarpPointer( flx->display, None, fl_root, 0, 0, 0, 0, m->x + FL_abs( m->bw ), m->y + FL_abs( m->bw ) ); /* Forget that an external position had been set so it won't get reused for another popup */ extpos = 0; align_bottom = 0; /* If the window doesn't exist yet create it, otherwise move it to the requested position and, if necessary, resize it */ if ( m->win == None) { XSetWindowAttributes xswa; unsigned long int vmask; m->event_mask = ExposureMask | ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | OwnerGrabButtonMask | PointerMotionHintMask | StructureNotifyMask /* for UnmapNotify */ | EnterWindowMask | KeyPressMask; xswa.event_mask = m->event_mask; xswa.save_under = True; xswa.backing_store = WhenMapped; xswa.override_redirect = True; xswa.cursor = m->cursor; xswa.border_pixel = 0; xswa.colormap = fli_colormap( fl_vmode ); xswa.do_not_propagate_mask = ButtonPress | ButtonRelease | KeyPress; vmask = CWEventMask | CWSaveUnder | CWBackingStore | CWCursor | CWBorderPixel | CWColormap | CWDontPropagate | CWOverrideRedirect; m->win = XCreateWindow( flx->display, fl_root, m->x, m->y, m->w, m->h, 0, fli_depth( fl_vmode ), InputOutput, fli_visual( fl_vmode ), vmask, &xswa ); XSetTransientForHint( flx->display, m->win, fl_root ); XStoreName( flx->display, m->win, m->title ); if ( ! m->gc_active && ! m->gc_inactive ) { XGCValues xgcv; xgcv.foreground = fl_get_flcolor( pup_text_color ); xgcv.font = pup_font_struct->fid; xgcv.stipple = FLI_INACTIVE_PATTERN; vmask = GCForeground | GCFont | GCStipple; /* GC for main text */ m->gc_active = XCreateGC( flx->display, m->win, vmask, &xgcv ); /* GC for inactive text */ xgcv.foreground = fl_get_flcolor( FL_INACTIVE ); m->gc_inactive = XCreateGC( flx->display, m->win, vmask, &xgcv ); /* Special hack for B&W */ if ( fli_dithered( fl_vmode ) ) XSetFillStyle( flx->display, m->gc_inactive, FillStippled ); } XSetWMColormapWindows( flx->display, fl_root, &m->win, 1 ); } else { Window r; int ax, ay; unsigned int aw, ah; XGetGeometry( flx->display, m->win, &r, &ax, &ay, &aw, &ah, &dummy, &dummy ); if ( m->x != ax || m->y != ay || m->w != aw || m->h != ah ) XMoveResizeWindow( flx->display, m->win, m->x, m->y, m->w, m->h ); } XMapRaised( flx->display, m->win ); /* The function gets either called directly from a user program or via the fl_dopup() function. In the first case we need to draw the pupup and then remove all events the creation of the window produced (after a sync so that we can be sure all events are already on the event queue). */ if ( ! pup_internal_showpup_call ) { XEvent ev; fl_winset( m->win ); XSync( flx->display, False ); while ( XCheckWindowEvent( flx->display, m->win, AllEventsMask, &ev) ) /* empty */ ; } else { m->par_y = m->padh + req_y - m->y; grab_both( m ); pup_internal_showpup_call = 0; } draw_popup( m ); } /*************************************** ***************************************/ void fl_hidepup( int n ) { if ( n >= 0 && n < fl_maxpup ) close_pupwin( menu_rec + n ); if ( n == fli_context->pup_id ) fli_context->pup_id = -1; } /*************************************** ***************************************/ unsigned int fl_getpup_mode( int nm, int ni ) { MenuItem *item; if ( ( item = requested_item_is_valid( "fl_getpup_mode", nm, ni ) ) ) return item->mode; return 0; } /*************************************** ***************************************/ const char * fl_getpup_text( int nm, int ni ) { MenuItem *item; if ( ( item = requested_item_is_valid( "fl_getpup_text", nm, ni ) ) ) return item->str; return NULL; } /*************************************** ***************************************/ void fli_replacepup_text( int nm, int ni, const char * nt ) { MenuItem *item; if ( ! nt ) nt = ""; if ( ( item = requested_item_is_valid( "fli_replacepup_text", nm, ni ) ) ) { fli_safe_free( item->str ); item->str = fl_strdup( nt ); } } /*************************************** ***************************************/ int fl_setpup_maxpup( int n ) { int i, j; if ( n < FL_MAXPUP ) return FL_MAXPUP; fli_init_pup( ); menu_rec = fl_realloc( menu_rec, n * sizeof *menu_rec ); for ( i = fl_maxpup; i < n; i++ ) { menu_rec[ i ].used = 0; menu_rec[ i ].title = NULL; menu_rec[ i ].win = None; menu_rec[ i ].cursor = None; menu_rec[ i ].gc_active = menu_rec[ i ].gc_inactive = None; for ( j = 0; j <= FL_MAXPUPI; j++ ) menu_rec[ i ].item[ j ] = NULL; menu_rec[ i ].menu_cb = NULL; menu_rec[ i ].enter_cb = menu_rec[ i ].leave_cb = NULL; menu_rec[ i ].enter_data = menu_rec[ i ].leave_data = NULL; } return fl_maxpup = n; } /*************************************** * Build the menu using low-level pup support ***************************************/ static int generate_menu( int n, const FL_PUP_ENTRY * pup, int top ) { static const FL_PUP_ENTRY *p = NULL; static PopUP *menu = NULL; static int val = 0; if ( top ) { val = 1; menu = menu_rec + n; menu->isEntry = 1; p = pup; } if ( ! p || ! p->text ) return n; for ( ; p && p->text; p++, val++ ) { int cnt = 0; char *t, *w; /* Count number of '%' */ for ( w = ( char * ) p->text; *w; w++ ) if ( *w == '%' ) cnt++; /* Get copy of the string with enough room for all further additions */ w = t = fl_malloc( strlen( p->text ) + cnt + 6 + log10( INT_MAX ) ); strcpy( t, p->text ); /* Double all '%' */ while ( *w && ( w = strchr( w, '%' ) ) ) { memmove( w + 1, w, strlen( w ) + 1 ); w += 2; } if ( *t != '/' ) /* regular entry */ { if ( *t == '_' ) *t = '\010'; sprintf( t + strlen( t ), "%%x%d", val ); fl_addtopup( n, t ); if ( p->mode ) fl_setpup_mode( n, val, p->mode ); if ( p->shortcut && *p->shortcut ) fl_setpup_shortcut( n, val, p->shortcut ); if ( p->callback ) fl_setpup_itemcb( n, val, p->callback ); } else /* start of submenu */ { int m = fl_newpup( menu->form ? menu->form->window : None ); if ( t[ 1 ] == '_' ) t[ 1 ] = '\010'; sprintf( t + strlen( t ), "%%x%d%%m", val ); fl_addtopup( n, t + 1, m ); if ( p->shortcut && *p->shortcut ) fl_setpup_shortcut( n, val, p->shortcut ); if ( p->mode & FL_PUP_GREY ) fl_setpup_mode( n, val, p->mode & FL_PUP_GREY ); val++; generate_menu( m, ++p, 0 ); menu_rec[ m ].isEntry = 1; } fl_free( t ); } return n; } /*************************************** ***************************************/ int fl_setpup_entries( int n, FL_PUP_ENTRY * entries ) { return generate_menu( n, entries, 1 ); } /*************************************** ***************************************/ int fl_getpup_items( int n ) { int m = 0; if ( n >= 0 && n < fl_maxpup && menu_rec[ n ].used ) { int k, i; k = m = menu_rec[ n ].nitems; for ( i = 0; i < k; i++ ) if ( menu_rec[ n ].item[ i ]->subm >= 0 ) m += fl_getpup_items( menu_rec[ n ].item[ i ]->subm ); } return m; } /*************************************** ***************************************/ int fl_current_pup( void ) { return fli_context->pup_id; } /*************************************** ***************************************/ int fl_setpup_default_bw( int bw ) { int ori = pup_bw; pup_bw = bw; pup_bw_is_set = 1; return ori; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/xyplot.c0000664000175000017500000030674612353623326012255 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file xyplot.c * * This file is part of the XForms library package. * Copyright (c) 1997-2002 T.C. Zhao * All rights reserved. * * Class FL_XYPLOT. Simple 2D tabulated function plot. * * Possible optimization: break update into DRAW_INSET, DRAW_POINT * etc. so an update of inset does not result in complete redraw. * * Need to re-think about the entire approach to overlay * * The whole thing needs a complete review, lots of things look fishy, * starting with memory allocation! JTT */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include #include "private/pxyplot.h" #define XMAJOR 5 #define XMINOR 2 #define YMAJOR 5 #define YMINOR 2 static float gen_tic( float, float, int, int ); static float gen_logtic( float, float, float, int ); static void convert_coord( FL_OBJECT *, FLI_XYPLOT_SPEC * ); static void find_xbounds( FLI_XYPLOT_SPEC * ); static void find_ybounds( FLI_XYPLOT_SPEC * ); static int allocate_spec( FLI_XYPLOT_SPEC *, int ); static void add_xgrid( FL_OBJECT * ); static void add_ygrid( FL_OBJECT * ); static void free_spec_dynamic_mem( FLI_XYPLOT_SPEC * ); static void w2s_draw( FL_OBJECT *, double, double, float *, float * ); static void compute_key_position( FL_OBJECT * ); static void draw_inset( FL_OBJECT * ); static void gen_xtic( FL_OBJECT * ); static void gen_ytic( FL_OBJECT * ); /* This variable is needed because screen positions of data drawn are * calculated differently when drawing directly to the screen and when * using double buffering and thus drawing to a pixmap - in the first * case the positions are calculated relative to the form while in the * second relative to the xyplot object. This must be taken into con- * sideration when comparing data positions to the mouse position while * the user clicks on or moves onto data point in an active xyplot. */ static int draw_to_pixmap = 0; /*************************************** * Free data associated with overlay ***************************************/ static void free_overlay_data( FLI_XYPLOT_SPEC * sp, int id ) { if ( sp->x && sp->y && sp->n && sp->n[ id ] ) { fli_safe_free( sp->x[ id ] ); fli_safe_free( sp->y[ id ] ); sp->n[ id ] = 0; } } /*************************************** * Free strings for alpha-tics ***************************************/ static void free_atic( char ** atic ) { size_t cnt; for ( cnt = 0; cnt < MAX_MAJOR && *atic; atic++, cnt++ ) fli_safe_free( *atic ); } /*************************************** ***************************************/ static void extend_screen_data( FLI_XYPLOT_SPEC * sp, int n ) { if ( n > sp->cur_nxp ) { sp->xp--; sp->xp = fl_realloc( sp->xp, ( n + 3 ) * sizeof *sp->xp ); sp->xp++; /* Need one extra point for fill */ sp->cur_nxp = n; sp->xpactive = fl_realloc( sp->xpactive, ( n + 3 ) * sizeof *sp->xpactive ); } } /*************************************** ***************************************/ static void free_xyplot( FL_OBJECT * ob ) { FLI_XYPLOT_SPEC *sp = ob->spec; fl_clear_xyplot( ob ); /* Working arrays */ fli_safe_free( sp->wx ); fli_safe_free( sp->wy ); fli_safe_free( sp->xpactive ); if ( sp->xpi ) fl_free( --sp->xpi ); if ( sp->xp ) fl_free( --sp->xp ); /* Various labels */ fli_safe_free( sp->xlabel ); fli_safe_free( sp->ylabel ); fli_safe_free( sp->title ); fli_safe_free( sp->text ); free_atic( sp->axtic ); free_atic( sp->aytic ); fli_safe_free( sp->xmargin1 ); fli_safe_free( sp->xmargin2 ); fli_safe_free( sp->ymargin1 ); fli_safe_free( sp->ymargin2 ); free_spec_dynamic_mem( sp ); } /*************************************** * Symbols. Center at (x,y) spanning a rectangle of (w,h) ***************************************/ static void draw_square( FL_OBJECT * ob FL_UNUSED_ARG, int Id FL_UNUSED_ARG, FL_POINT * p, int n, int w, int h ) { int w2 = w / 2, h2 = h / 2; FL_POINT *ps = p + n; if ( flx->win != None ) for ( ; p < ps; p++ ) XDrawRectangle( flx->display, flx->win, flx->gc, p->x - w2, p->y - h2, w, h ); } /*************************************** ***************************************/ static void draw_circle( FL_OBJECT * ob FL_UNUSED_ARG, int id FL_UNUSED_ARG, FL_POINT * p, int n, int w, int h ) { int w2 = w / 2, h2 = h / 2; FL_POINT *ps = p + n; if ( flx->win != None ) for ( ; p < ps; p++ ) XDrawArc( flx->display, flx->win, flx->gc, p->x - w2, p->y - h2, w, h, 0, 64 * 360 ); } /*************************************** ***************************************/ static void draw_points( FL_OBJECT * ob FL_UNUSED_ARG, int id FL_UNUSED_ARG, FL_POINT * p, int n, int w, int h ) { FL_POINT *pe = p + n; w /= 2; h /= h; if ( flx->win != None ) for ( ; p < pe; p++ ) { XSegment seg[ ] = { { p->x - w, p->y, p->x + w, p->y }, { p->x, p->y - h, p->x, p->y + h }, { p->x - w, p->y - h, p->x + w, p->y + h }, { p->x + w, p->y - h, p->x - w, p->y + h } }; XDrawSegments( flx->display, flx->win, flx->gc, seg, sizeof seg / sizeof *seg ); } } /*************************************** ***************************************/ int fli_xyplot_interpolate( FL_OBJECT * ob, int id, int n1, int n2 ) { FLI_XYPLOT_SPEC *sp = ob->spec; int newn; float *x = sp->x[ id ], *y = sp->y[ id ]; /* Need to resize screen points */ newn = 1.01 + ( x[ n2 - 1 ] - x[ n1 ] ) / sp->grid[ id ]; /* Test if the number of points exceeds the screen resolution by a large margin */ if ( newn > 5000 ) { M_err( "fli_xyplot_interpolate", "interpolating %d points exceeds screen res", newn ); return -1; } if ( newn > sp->nxpi ) { sp->xpi--; sp->xpi = fl_realloc( sp->xpi, ( newn + 3 ) * sizeof *sp->xpi ); sp->xpi++; sp->nxpi = newn; } if ( newn > sp->ninterpol ) { sp->wx = fl_realloc( sp->wx, newn * sizeof *sp->wx ); sp->wy = fl_realloc( sp->wy, newn * sizeof *sp->wy ); if ( ! sp->wx || ! sp->wy ) { if ( sp->wx ) fli_safe_free( sp->wx ); M_err( "fli_xyplot_interpolate", "Can't allocate memory for %d points", newn ); return -1; } sp->ninterpol = newn; } if ( fl_interpolate( x + n1, y + n1, n2 - n1, sp->wx, sp->wy, sp->grid[ id ], sp->interpolate[ id ] ) != newn ) { M_err( "fli_xyplot_interpolate", "An error has occured while interpolating" ); return -1; } return newn; } /* To avoid singularity or extreme scaling factors */ #define FMIN 1.0e-25 /*************************************** * This is faster than calling fl_xyplot_w2s N times. Also * we call this while drawing, that means we have to * use sp->bx, but sp->bxm as fl_xyplot_w2s uses ***************************************/ static void mapw2s( FL_OBJECT * ob, FL_POINT * p, int n1, int n2, float * x, float * y ) { FLI_XYPLOT_SPEC *sp = ob->spec; int i; if ( sp->xscale == FL_LOG ) { double lbase = 1.0 / sp->lxbase; for ( i = n1; i < n2; i++ ) { double t = log10( FL_max( x[ i ], FMIN ) ) * lbase; p[ i - n1 ].x = FL_crnd( sp->ax * t + sp->bx ); } } else for ( i = n1; i < n2; i++ ) p[ i - n1 ].x = FL_crnd( sp->ax * x[ i ] + sp->bx ); if ( sp->yscale == FL_LOG ) { double lbase = 1.0 / sp->lybase; for ( i = n1; i < n2; i++ ) { double t = log10( FL_max( y[ i ], FMIN ) ) * lbase; p[ i - n1 ].y = FL_crnd( sp->ay * t + sp->by ); } } else for ( i = n1; i < n2; i++ ) { int tmp = FL_crnd( sp->ay * y[ i ] + sp->by ); tmp = FL_max( 0, tmp ); tmp = FL_min( 30000, tmp ); p[ i - n1 ].y = tmp; } } /*************************************** * While not autoscaling some of the data might fall outside the range * to be drawn, get rid of them so actual data that get plotted are bound * by (n1, n2) ***************************************/ void fli_xyplot_compute_data_bounds( FL_OBJECT * ob, int * n1, int * n2, int id ) { FLI_XYPLOT_SPEC *sp = ob->spec; int i; float *x = sp->x[ id ]; float xmin = FL_min( sp->xmin, sp->xmax ); float xmax = FL_max( sp->xmax, sp->xmin ); /* Special case for not more than two points */ if ( sp->n[ id ] <= 2 ) { *n1 = 0; *n2 = sp->n[ id ]; return; } for ( *n1 = -1, i = 0; i < sp->n[ id ] && *n1 < 0; i++ ) if ( x[ i ] >= xmin ) *n1 = i; if ( *n1 > 0 ) *n1 -= 1; else if ( *n1 < 0 ) *n1 = 0; for ( *n2 = -1, i = sp->n[ id ]; --i >= 0 && *n2 < 0; ) if ( x[ i ] <= xmax ) *n2 = i; if ( *n2 < 0 ) *n2 = sp->n[ id ] > 1 ? sp->n[ id ] : 1; if ( *n2 < sp->n[ id ] ) *n2 += 1; if ( *n2 < sp->n[ id ] ) *n2 += 1; } /*************************************** * Draw curves of data and all overlays ***************************************/ static void draw_curve_only( FL_OBJECT * ob ) { FLI_XYPLOT_SPEC *sp = ob->spec; int i, n1, n2, noline, nplot, type, nxp, newn, cur_lw = 0; FL_XYPLOT_SYMBOL drawsymbol; FL_POINT *xp; float *x, *y; FL_COLOR col; int savelw = fl_get_linewidth( ), savels = fl_get_linestyle( ); int key_xs, key_ys; fl_set_clipping( sp->xi, sp->yi, sp->xf - sp->xi + 1, sp->yf - sp->yi + 1 ); fl_set_text_clipping( sp->xi, sp->yi, sp->xf - sp->xi + 1, sp->yf - sp->yi + 1 ); if ( sp->xgrid != FL_GRID_NONE && sp->xtic > 0 ) add_xgrid( ob ); if ( sp->ygrid != FL_GRID_NONE && sp->ytic > 0 ) add_ygrid( ob ); compute_key_position( ob ); fl_rect( sp->key_xs, sp->key_ys, sp->key_maxw, sp->key_maxh, *sp->col ); key_xs = sp->key_xs + 2; key_ys = sp->key_ys + sp->key_ascend - sp->key_descend; for ( nplot = 0; nplot <= sp->maxoverlay; nplot++ ) { if ( sp->n[ nplot ] == 0 ) continue; fl_color( col = sp->col[ nplot ] ); drawsymbol = NULL; noline = 0; /* Without autoscaling some of the data might fall outside the range desired, get rid of them so actual data that get plotted are bound by (n1, n2) */ fli_xyplot_compute_data_bounds( ob, &n1, &n2, nplot ); sp->n1 = n1; /* Convert data. If interpolate is requested do it here */ if ( sp->interpolate[ nplot ] > 1 && n2 - n1 > 3 && ( newn = fli_xyplot_interpolate( ob, nplot, n1, n2 ) ) >= 0 ) { x = sp->wx; y = sp->wy; xp = sp->xpi; mapw2s( ob, xp, 0, newn, x, y ); nxp = sp->nxpi = newn; mapw2s( ob, sp->xp, n1, n2, sp->x[ nplot ], sp->y[ nplot ] ); sp->nxp = n2 - n1; if ( ( sp->active || sp->inspect ) && sp->iactive == nplot && ! sp->update ) memcpy( sp->xpactive, sp->xp, sp->nxp * sizeof *xp ); } else { x = sp->x[ nplot ]; y = sp->y[ nplot ]; xp = sp->xp; mapw2s( ob, xp, n1, n2, x, y ); nxp = sp->nxp = n2 - n1; if ( ( sp->active || sp->inspect ) && sp->iactive == nplot && ! sp->update ) memcpy( sp->xpactive, sp->xp, sp->nxp * sizeof *xp ); } type = nplot > 0 ? sp->type[ nplot ] : ob->type; if ( cur_lw != sp->thickness[ nplot ] ) { cur_lw = sp->thickness[ nplot ]; fl_linewidth( cur_lw ); } switch ( type ) { case FL_ACTIVE_XYPLOT: drawsymbol = sp->mark_active ? draw_square : NULL; break; case FL_SQUARE_XYPLOT: drawsymbol = draw_square; break; case FL_CIRCLE_XYPLOT: drawsymbol = draw_circle; break; case FL_POINTS_XYPLOT: noline = 1; /* fall through */ case FL_LINEPOINTS_XYPLOT: drawsymbol = sp->symbol[ nplot ] ? sp->symbol[ nplot ] : draw_points; break; case FL_DOTTED_XYPLOT: fl_linestyle( FL_DOT ); break; case FL_DOTDASHED_XYPLOT: fl_linestyle( FL_DOTDASH ); break; case FL_LONGDASHED_XYPLOT: fl_linestyle( FL_LONGDASH ); break; case FL_DASHED_XYPLOT: fl_dashedlinestyle( NULL, 0 ); fl_linestyle( LineOnOffDash ); break; case FL_FILL_XYPLOT: xp[ -1 ].x = xp[ 0 ].x; /* looks ugly, better recheck ! JTT */ xp[ -1 ].y = sp->yf; xp[ nxp ].x = xp[ nxp - 1 ].x; xp[ nxp ].y = sp->yf; fl_polyf( xp - 1, nxp + 2, col ); noline = 1; break; case FL_EMPTY_XYPLOT: noline = 1; drawsymbol = NULL; break; case FL_IMPULSE_XYPLOT: noline = 1; drawsymbol = NULL; for ( i = 0; i < nxp; i++ ) fl_line( xp[ i ].x, sp->yf - 1, xp[ i ].x, xp[ i ].y, col ); break; case FL_NORMAL_XYPLOT: default: break; } if ( ! noline ) fl_lines( xp, nxp, col ); if ( drawsymbol ) drawsymbol( ob, nplot, sp->xp, sp->nxp, sp->ssize, sp->ssize ); /* Do keys */ if ( sp->key[ nplot ] ) { fl_linewidth( 0 ); if ( ! noline ) fl_line( key_xs, key_ys, key_xs + 20, key_ys, col ); if ( type == FL_IMPULSE_XYPLOT ) { fl_line( key_xs + 3, key_ys + 2, key_xs + 3, key_ys - 3, col ); fl_line( key_xs + 7, key_ys + 2, key_xs + 7, key_ys - 3, col ); fl_line( key_xs + 11, key_ys + 2, key_xs + 11, key_ys - 3, col ); fl_line( key_xs + 15, key_ys + 2, key_xs + 15, key_ys - 3, col ); } else if ( sp->type[ nplot ] == FL_FILL_XYPLOT ) fl_rectf( key_xs + 1, key_ys - 3, 19, 6, col ); if ( drawsymbol ) { FL_POINT p[ 4 ]; p[ 0 ].x = key_xs + 3; p[ 1 ].x = key_xs + 10; p[ 2 ].x = key_xs + 17; p[ 0 ].y = p[ 1 ].y = p[ 2 ].y = key_ys; drawsymbol( ob, nplot, p, 3, 4, 4 ); } fl_draw_text( FL_ALIGN_LEFT, key_xs + 20, key_ys, 0, 0, col, sp->key_lstyle, sp->key_lsize, sp->key[ nplot ] ); key_ys += sp->key_ascend + sp->key_descend * 0.9; } fl_linestyle( savels ); fl_linewidth( cur_lw = savelw ); } /* Finally we draw extra text */ draw_inset( ob ); fl_linestyle( savels ); fl_linewidth( savelw ); fl_unset_clipping( ); fl_unset_text_clipping( ); } /*************************************** ***************************************/ void fli_xyplot_nice_label( float tic, int minor, float f, char * label ) { float crit = tic * minor; if ( tic >= 1.0 && crit < 10.0 ) sprintf( label, "%.1f", f ); else if ( tic > 1.0 && crit < 1000.0 ) sprintf( label, "%.0f", f ); else if ( crit >= 0.40 && crit <= 999.0 ) sprintf( label, "%.1f", f ); else if ( crit < 0.40 && crit > 0.01 ) sprintf( label, "%.2f", f ); else sprintf( label, "%g", f ); } /*************************************** ***************************************/ static void gen_xtic( FL_OBJECT * ob ) { FLI_XYPLOT_SPEC *sp = ob->spec; float tic = sp->xtic; double x; float xmin, xmax; float mxmin, mxmax; int i; if ( tic < 0 ) return; xmin = mxmin = FL_min( sp->xscmin, sp->xscmax ); xmax = mxmax = FL_max( sp->xscmin, sp->xscmax ); if ( sp->xtic > 0.0 \ && ! *sp->axtic \ && sp->xmajor > 1 ) { mxmin = floor( xmin / tic ) * tic; mxmax = ceil( xmax / tic ) * tic; } /* Handle ticlable@location stuff */ if ( *sp->axtic ) { char *p; char *eptr; int j = 0; for ( i = 0; i < sp->xmajor; i++ ) { if ( ( p = strchr( sp->axtic[ i ], '@' ) ) ) x = strtod( p + 1, &eptr ); if ( ! p || eptr == p + 1 ) x = mxmin + ( i * tic * sp->xminor ); else if ( sp->xscale == FL_LOG ) x = log10( x ) / sp->lxbase; if ( x >= xmin && x <= xmax ) { sp->xtic_major[ i ] = FL_crnd( sp->ax * x + sp->bx ); sp->xmajor_val[ i ] = x; j++; } } sp->num_xmajor = j; sp->num_xminor = 1; return; } if ( sp->xscale != FL_LOG ) { /* Minor tics */ for ( i = 0, x = mxmin; i < MAX_TIC && x <= mxmax; x += tic ) if ( x >= xmin && x <= xmax ) sp->xtic_minor[ i++ ] = FL_crnd( sp->ax * x + sp->bx ); sp->num_xminor = i; /* Major tics */ for ( i = 0, x = mxmin; i < MAX_MAJOR && x <= mxmax; x += tic * sp->xminor ) if ( x >= xmin && x <= xmax ) { sp->xtic_major[ i ] = FL_crnd( sp->ax * x + sp->bx ); sp->xmajor_val[ i++ ] = x; } sp->num_xmajor = i; } else { if ( sp->log_minor_xtics < 0.5) { double minortic = tic / sp->xminor; /* Minor tics */ x = floor( xmin / minortic ) * minortic; while ( sp->ax * ( xmin - x ) >= 1 ) x += minortic; for ( i = 0; i < MAX_TIC && sp->ax * ( xmax - x ) >= 0; x += minortic ) sp->xtic_minor[ i++ ] = FL_crnd( sp->ax * x + sp->bx ); sp->num_xminor = i; /* Major tics */ x = floor( xmin / tic ) * tic; while ( sp->ax * ( xmin - x ) > 1 ) x += tic; for ( i = 0; i < MAX_MAJOR && sp->ax * ( xmax - x ) >= 0; x += tic ) { sp->xtic_major[ i ] = FL_crnd( sp->ax * x + sp->bx ); sp->xmajor_val[ i++ ] = x; } sp->num_xmajor = i; } else { int j; int k; double xmaj = floor( xmin / tic ) * tic; double xmaj_u, xmaj_d; double xl, step; while ( sp->ax * ( xmin - xmaj ) >= 1 ) xmaj += tic; xmaj_u = pow( sp->xbase, xmaj ); xmaj_d = pow( sp->xbase, xmaj - tic ); xl = pow( sp->xbase, xmin ); step = ( xmaj_u - xmaj_d ) / sp->xminor; x = xmaj_u - step; /* Create minor tics before first major tic */ for ( j = 0; x >= xl; x -= step ) sp->xtic_minor[ j++ ] = FL_crnd( sp->ax * log10( x) / sp->lxbase + sp->bx ); /* Create all remaining major and minor tics */ xl = pow( sp->xbase, xmax ); for ( i = 0; i < MAX_MAJOR && sp->ax * ( xmax - xmaj ) >= 0; xmaj += tic ) { sp->xtic_major[ i ] = FL_crnd( sp->ax * xmaj + sp->bx ); sp->xmajor_val[ i++ ] = xmaj; xmaj_d = pow( sp->xbase, xmaj ); xmaj_u = pow( sp->xbase, xmaj + tic ); step = ( xmaj_u - xmaj_d ) / sp->xminor; for ( k = 1, x = xmaj_d + step; j < MAX_TIC && k < sp->xminor && x <= xl; x += step, k++ ) sp->xtic_minor[ j++ ] = FL_crnd( sp->ax * log10( x ) / sp->lxbase + sp->bx ); } sp->num_xmajor = i; sp->num_xminor = j; } } } /*************************************** ***************************************/ static void gen_ytic( FL_OBJECT * ob ) { FLI_XYPLOT_SPEC *sp = ob->spec; float ymin, ymax, mymin, mymax, tic = sp->ytic; double y; int i; if ( tic < 0 ) return; mymin = ymin = FL_min( sp->yscmin, sp->yscmax ); mymax = ymax = FL_max( sp->yscmin, sp->yscmax ); if ( sp->ytic > 0.0 && ! *sp->aytic \ && sp->ymajor > 1 ) { mymin = floor( ymin / tic ) * tic; mymax = ceil( ymax / tic ) * tic; } /* Handle ticlable@location stuff */ if ( *sp->aytic ) { char *p; char *eptr; int j = 0; for ( i = 0; i < sp->ymajor; i++ ) { if ( ( p = strchr( sp->aytic[ i ], '@' ) ) ) y = strtod( p + 1, &eptr ); if ( ! p || eptr != p + 1 ) y = mymin + i * tic * sp->yminor; else if ( sp->yscale == FL_LOG ) y = log10( y ) / sp->lybase; if ( y >= ymin && y <= ymax ) { sp->ytic_major[ i ] = FL_crnd( sp->ay * y + sp->by ); sp->ymajor_val[ i ] = y; j++; } } sp->num_ymajor = j; sp->num_yminor = 1; return; } if ( sp->yscale != FL_LOG ) { for ( i = 0, y = mymin; i < MAX_MAJOR && y <= mymax; y += tic ) if ( y >= ymin && y <= ymax ) sp->ytic_minor[i++] = FL_crnd( sp->ay * y + sp->by ); sp->num_yminor = i; for ( i = 0, y = mymin; i < MAX_MINOR && y <= mymax; y += tic * sp->yminor ) { if ( y >= ymin && y <= ymax ) { sp->ytic_major[ i ] = FL_crnd( sp->ay * y + sp->by ); sp->ymajor_val[ i++ ] = y; } } sp->num_ymajor = i; } else { if ( sp->log_minor_ytics < 0.5) { double minortic = sp->ytic / sp->yminor; /* Note that sp->ay is always negative! */ y = floor( ymin / minortic ) * minortic; while ( sp->ay * ( ymin - y ) <= -1 ) y += minortic; for ( i = 0; i < MAX_TIC && sp->ay * ( ymax - y ) <= 0; y += minortic ) sp->ytic_minor[ i++ ] = FL_crnd( sp->ay * y + sp->by ); sp->num_yminor = i; y = floor( ymin / tic ) * tic; while ( y + 1.0e-5 < ymin ) y += tic; for ( i = 0; i < MAX_MAJOR && sp->ay * ( ymax - y ) <= 0; y += tic ) { sp->ytic_major[ i ] = FL_crnd( sp->ay * y + sp->by ); sp->ymajor_val[ i++ ] = y; } sp->num_ymajor = i; } else { int j; int k; double ymaj = floor( ymin / tic ) * tic; double ymaj_u, ymaj_d; double yl, step; /* Note: sp->ay is always negative */ while ( sp->ay * ( ymin - ymaj ) <= -1 ) ymaj += tic; ymaj_u = pow( sp->ybase, ymaj ); ymaj_d = pow( sp->ybase, ymaj - tic ); yl = pow( sp->ybase, ymax ); step = ( ymaj_u - ymaj_d ) / sp->yminor; y = ymaj_u - step; /* Create minor tics before first major tic */ for ( j = 0; y >= pow( sp->ybase, ymin ); y -= step ) sp->ytic_minor[ j++ ] = FL_crnd( sp->ay * log10( y ) / sp->lybase + sp->by ); /* Create all remaining major and minor tics */ for ( i = 0; i < MAX_MAJOR && sp->ay * ( ymax - ymaj ) <= 0; ymaj += tic ) { sp->ytic_major[ i ] = FL_crnd( sp->ay * ymaj + sp->by ); sp->ymajor_val[ i++ ] = ymaj; ymaj_d = pow( sp->ybase, ymaj ); ymaj_u = pow( sp->ybase, ymaj + tic ); step = ( ymaj_u - ymaj_d ) / sp->yminor; for ( k = 1, y = ymaj_d + step; j < MAX_TIC && k < sp->yminor && y <= yl; y += step, k++ ) sp->ytic_minor[ j++ ] = FL_crnd( sp->ay * log10( y ) / sp->lybase + sp->by ); } sp->num_ymajor = i; sp->num_yminor = j; } } } /*************************************** ***************************************/ static void add_xgrid( FL_OBJECT * ob ) { FLI_XYPLOT_SPEC *sp = ob->spec; int yi, yf, xr, i; int ls = fl_get_linestyle( ); yi = sp->yi + 1; yf = sp->yf - 1; fl_linestyle( sp->grid_linestyle ); for ( i = 0; sp->xgrid == FL_GRID_MINOR && i < sp->num_xminor; i++ ) { xr = sp->xtic_minor[ i ]; fl_line( xr, yi, xr, yf, ob->col2 ); } for ( i = 0; i < sp->num_xmajor; i++ ) { xr = sp->xtic_major[ i ]; fl_line( xr, yi, xr, yf, ob->col2 ); } fl_linestyle( ls ); } /*************************************** ***************************************/ static void add_ygrid( FL_OBJECT * ob ) { FLI_XYPLOT_SPEC *sp = ob->spec; int yr, i, xi, xf; int ls = fl_get_linestyle( ); xi = sp->xi + 1; xf = sp->xf - 1; fl_linestyle( sp->grid_linestyle ); for ( i = 0; sp->ygrid == FL_GRID_MINOR && i < sp->num_yminor; i++ ) { yr = sp->ytic_minor[ i ]; fl_line( xi, yr, xf, yr, ob->col2 ); } for ( i = 0; i < sp->num_ymajor; i++ ) { yr = sp->ytic_major[ i ]; fl_line( xi, yr, xf, yr, ob->col2 ); } fl_linestyle( ls ); } /*************************************** ***************************************/ static void add_xtics( FL_OBJECT * ob ) { FLI_XYPLOT_SPEC *sp = ob->spec; float tic = sp->xtic; int xr, ticl = 6, yi, yf, i; char buf[ 80 ], *label; if ( tic <= 0 ) return; yi = sp->yf + 1; yf = yi + ticl / 2; /* Minor tics */ for ( i = 0; i < sp->num_xminor; i++ ) { xr = sp->xtic_minor[ i ]; fl_line( xr, yi, xr, yf, ob->col2 ); } yi = sp->yf + 1; yf = yi + ticl; for ( i = 0; i < sp->num_xmajor; i++ ) { xr = sp->xtic_major[ i ]; fl_line( xr, yi, xr, yf, ob->col2 ); if ( ! *sp->axtic || i >= MAX_MAJOR ) fli_xyplot_nice_label( tic, sp->xminor, sp->xmajor_val[ i ], label = buf ); else { char *p; if ( sp->axtic[ i ] && ( p = strchr( sp->axtic[ i ], '@' ) ) ) label = fli_sstrcpy( buf, sp->axtic[ i ], p - sp->axtic[ i ] + 1 ); else label = sp->axtic[ i ]; } if ( label ) fl_draw_text( FL_ALIGN_TOP, xr, sp->yf + ticl - 2, 0, 0, ob->col2, sp->lstyle, sp->lsize, label ); } } /*************************************** ***************************************/ static void add_logxtics( FL_OBJECT * ob ) { FLI_XYPLOT_SPEC *sp = ob->spec; float tic = sp->xtic, xw; int xr, ticl = 6, i, yi, yf; char label[ 80 ]; if ( tic < 0 ) return; yi = sp->yf + 1; yf = yi + ticl / 2; for ( i = 0; i < sp->num_xminor; i++ ) { xr = sp->xtic_minor[ i ]; fl_line( xr, yi, xr, yf, ob->col2 ); } yi = sp->yf; yf = yi + ticl; for ( i = 0; i < sp->num_xmajor; i++ ) { xr = sp->xtic_major[ i ]; fl_line( xr, yi, xr, yf, ob->col2 ); xw = sp->xmajor_val[ i ]; if ( sp->xbase == 10.0 ) { sprintf( label, "%g", pow( sp->xbase, xw ) ); fl_draw_text( FL_ALIGN_TOP, xr, sp->yf + ticl - 2, 0, 0, ob->col2, sp->lstyle, sp->lsize, label ); } else { int len1, len2, ll; ll = sprintf( label, "%g", sp->xbase ); fl_draw_text( FL_ALIGN_TOP, xr, yf - 2, 0, 0, ob->col2, sp->lstyle, sp->lsize, label ); len1 = fl_get_string_width( sp->lstyle, sp->lsize, label, ll ); ll = sprintf( label, "%d", ( int ) ceil( xw ) ); len2 = fl_get_string_width( sp->lstyle, sp->lsize, label, ll ); fl_draw_text( FL_ALIGN_TOP, xr + len1 / 2 + 2 + len2 / 2, yf - 6, 0, 0, ob->col2, sp->lstyle, sp->lsize, label ); } } } /*************************************** ***************************************/ static void add_logytics( FL_OBJECT * ob ) { FLI_XYPLOT_SPEC *sp = ob->spec; float yw; int yr, ticl = 6, i; char label[ 80 ]; if ( sp->ytic <= 0 ) return; for ( i = 0; i < sp->num_yminor; i++ ) { yr = sp->ytic_minor[ i ]; fl_line( sp->xi, yr, sp->xi - ticl / 2, yr, ob->col2 ); } for ( i = 0; i < sp->num_ymajor; i++ ) { yr = sp->ytic_major[ i ]; fl_line( sp->xi - ticl, yr, sp->xi, yr, ob->col2 ); yw = sp->ymajor_val[ i ]; if ( sp->ybase == 10.0 ) { sprintf( label, "%g", pow( sp->ybase, yw ) ); fl_draw_text( FL_ALIGN_RIGHT, sp->xi - ticl + 2, yr, 0, 0, ob->col2, sp->lstyle, sp->lsize, label ); } else { int len, ll; ll = sprintf( label, "%d", ( int ) ceil( yw ) ); fl_draw_text( FL_ALIGN_RIGHT, sp->xi - ticl + 2, yr - 3, 0, 0, ob->col2, sp->lstyle, sp->lsize, label ); len = fl_get_string_width( sp->lstyle, sp->lsize, label, ll ); sprintf( label, "%g", sp->ybase ); fl_draw_text( FL_ALIGN_RIGHT, sp->xi - ticl + 1 - len, yr + 1, 0, 0, ob->col2, sp->lstyle, sp->lsize, label ); } } } /*************************************** ***************************************/ static void add_ytics( FL_OBJECT * ob ) { FLI_XYPLOT_SPEC *sp = ob->spec; float tic = sp->ytic; int yr, ticl = 6, i; char buf[ 80 ], *label, *p; if ( sp->ytic <= 0 ) return; for ( i = 0; i < sp->num_yminor; i++ ) { yr = sp->ytic_minor[ i ]; fl_line( sp->xi - 4, yr, sp->xi, yr, ob->col2 ); } for ( i = 0; i < sp->num_ymajor; i++ ) { yr = sp->ytic_major[ i ]; fl_line( sp->xi - ticl, yr, sp->xi, yr, ob->col2 ); if ( ! *sp->aytic ) fli_xyplot_nice_label( tic, sp->yminor, sp->ymajor_val[ i ], label = buf ); else { if ( ( p = strchr( sp->aytic[ i ], '@' ) ) ) label = fli_sstrcpy( buf, sp->aytic[ i ], p - sp->aytic[ i ] + 1 ); else label = sp->aytic[ i ]; } fl_draw_text( FL_ALIGN_RIGHT, sp->xi - ticl + 2, yr, 0, 0, ob->col2, sp->lstyle, sp->lsize, label ); } } /*************************************** ***************************************/ static void convert_coord( FL_OBJECT * ob, FLI_XYPLOT_SPEC * sp ) { float extrax1, extray1; float extrax2, extray2; char buf[ 80 ], *label, *p; int j, ticl = 6, w = 0; int fh = fl_get_string_height( sp->lstyle, sp->lsize, "1pj", 3, &j, &j ); float halfh = 0.55 * fh; /* Min. margins fixed margins */ extrax1 = extray1 = extrax2 = extray2 = FL_abs( ob->bw ) + 3.0; /* Figure out the plot region */ if ( sp->xtic > 0 ) { extray2 += ticl + fh + ( sp->xscale == FL_LOG ); if ( ! *sp->axtic ) fli_xyplot_nice_label( sp->xtic, sp->xminor, sp->xmax, label = buf ); else label = sp->axtic[ sp->xmajor - 1 ]; w = fl_get_string_width( sp->lstyle, sp->lsize, label, strlen( label ) ) / 2; extrax2 += w + ( sp->xscale == FL_LOG ) * 2; /* Don't need to compute label size if ytic is on */ if ( sp->ytic < 0 ) { if ( ! *sp->axtic ) fli_xyplot_nice_label( sp->xtic, sp->xminor, sp->xmin, label = buf ); else label = *sp->axtic; w = fl_get_string_width( sp->lstyle, sp->lsize, label, strlen( label ) ) / 2; extrax1 += w; } } sp->maxytic = 2; if ( sp->ytic > 0 ) { label = buf; if ( ! *sp->aytic ) { int tmpw = 0; if ( sp->yscale == FL_LOG ) { char *fmt = sp->ybase == 10 ? "%g-e%d" : "%g%d "; int ll = sprintf( label, fmt, sp->ybase, ( int ) sp->yscmax ); w = fl_get_string_width( sp->lstyle, sp->lsize, label, ll ); ll = sprintf( label, fmt, sp->ybase, ( int ) sp->yscmin ); tmpw = fl_get_string_width( sp->lstyle, sp->lsize, label, ll ); } else { fli_xyplot_nice_label( sp->ytic, sp->yminor, sp->yscmax, label ); w = fl_get_string_width( sp->lstyle, sp->lsize, label, strlen( label ) ); fli_xyplot_nice_label( sp->ytic, sp->yminor, sp->yscmin, label ); tmpw = fl_get_string_width( sp->lstyle, sp->lsize, label, strlen( label ) ); } w = FL_max( w, tmpw ); } else { if ( ( p = strchr( *sp->aytic, '@' ) ) ) label = fli_sstrcpy( buf, *sp->aytic, p - *sp->aytic + 1 ); else label = *sp->aytic; w = fl_get_string_width( sp->lstyle, sp->lsize, label, strlen( label ) ); } /* How much space to leave for ytics ylabels */ extrax1 += ticl + 1; extrax1 += w; sp->maxytic = extrax1; extray1 += halfh + 1; if ( sp->xtic < 0 ) extray2 += halfh + 1; } if ( *sp->ylabel ) extrax1 += 6 + fl_get_char_width( sp->lstyle, sp->lsize ); if ( *sp->xlabel ) extray2 += 2 + 1.1 * fh; if ( *sp->title ) extray1 += 1 + ( sp->ytic > 0 ? halfh : fh ); /* If margin is set use it instead of the computed margin */ if ( sp->xmargin1 ) { extrax1 = extrax2 = FL_abs( ob->bw ) + 1 + fl_get_linewidth( ); extrax1 += fl_get_string_width( sp->lstyle, sp->lsize, sp->xmargin1, strlen( sp->xmargin1 ) ) - 1; extrax2 += fl_get_string_width( sp->lstyle, sp->lsize, sp->xmargin2, strlen( sp->xmargin2 ) ) + 1; } if ( sp->ymargin1 ) { extray1 = extray2 = FL_abs( ob->bw ) + 1; extray1 += fl_get_string_width( sp->lstyle, sp->lsize, sp->ymargin1, strlen( sp->ymargin1 ) ) - 1; extray2 += fl_get_string_width( sp->lstyle, sp->lsize, sp->ymargin2, strlen( sp->ymargin2 ) ) + 1; } sp->xi = ob->x + extrax1; sp->yi = ob->y + extray1; sp->xf = ob->x + ob->w - extrax2; sp->yf = ob->y + ob->h - extray2; sp->ax = ( sp->xf - sp->xi ) / ( sp->xscmax - sp->xscmin ); sp->bx = sp->bxm = sp->xi - sp->ax * sp->xscmin; sp->ay = ( sp->yf - sp->yi ) / ( sp->yscmin - sp->yscmax ); sp->by = sp->bym = sp->yi - sp->ay * sp->yscmax; gen_xtic( ob ); gen_ytic( ob ); } /*************************************** * Draw a string with alignment given relative to a point. * Figure out the bounding box etc so symbols can be drawn ***************************************/ static void draw_text_point( int lalign, int x, int y, FL_COLOR col, int lstyle, int lsize, char * str ) { int align = fl_to_outside_lalign( lalign ); int bbox = 1.4 * lsize + 6; int xx = x, yy = y; switch ( align ) { case FL_ALIGN_CENTER : xx = x - bbox / 2; yy = y - bbox / 2; break; case FL_ALIGN_TOP : xx = x - bbox / 2; break; case FL_ALIGN_BOTTOM : xx = x - bbox / 2; yy = y - bbox; break; case FL_ALIGN_LEFT : yy = y - bbox / 2; break; case FL_ALIGN_RIGHT : xx = x - bbox; yy = y - bbox / 2; break; case FL_ALIGN_LEFT_TOP : xx = x - bbox; align = FL_ALIGN_RIGHT_TOP; break; case FL_ALIGN_RIGHT_TOP : align = FL_ALIGN_LEFT_TOP; break; case FL_ALIGN_RIGHT_BOTTOM : yy = y - bbox; align = FL_ALIGN_LEFT_BOTTOM; break; case FL_ALIGN_LEFT_BOTTOM : align = FL_ALIGN_RIGHT_BOTTOM; yy = y - bbox; xx = x - bbox; break; } fl_draw_text_beside( align, xx, yy, bbox, bbox, col, lstyle, lsize, str ); } /*************************************** ***************************************/ static void draw_inset( FL_OBJECT * ob ) { FLI_XYPLOT_SPEC *sp = ob->spec; int i; float tx, ty; for ( i = 0; i <= sp->maxoverlay; i++ ) if ( sp->text[ i ] ) { w2s_draw( ob, sp->xt[ i ], sp->yt[ i ], &tx, &ty ); draw_text_point( sp->talign[ i ], tx, ty, sp->tcol[ i ], sp->lstyle, sp->lsize, sp->text[ i ] ); } } /*************************************** ***************************************/ static void compute_key_position( FL_OBJECT * ob ) { FLI_XYPLOT_SPEC *sp = ob->spec; int w = 0, i, h, align; float fx, fy; h = fl_get_char_height( sp->key_lstyle, sp->key_lsize, &sp->key_ascend, &sp->key_descend ); /* Find the max width */ sp->key_maxw = sp->key_maxh = 0; for ( i = 0; i <= sp->maxoverlay; i++ ) if ( sp->key[ i ] && sp->n[ i ] ) { w = fl_get_string_width( sp->key_lstyle, sp->key_lsize, sp->key[ i ], strlen( sp->key[ i ] ) ); if ( w > sp->key_maxw ) sp->key_maxw = w; sp->key_maxh += h; } if ( sp->key_maxw == 0 ) return; /* Get alignment */ w2s_draw( ob, sp->key_x, sp->key_y, &fx, &fy ); sp->key_xs = fx; sp->key_ys = fy; sp->key_maxw += 32; sp->key_maxh += 1; align = sp->key_align; if ( align == FL_ALIGN_LEFT_TOP ) align = FL_ALIGN_RIGHT_TOP; else if ( align == FL_ALIGN_RIGHT_TOP ) align = FL_ALIGN_LEFT_TOP; else if ( align == FL_ALIGN_RIGHT_BOTTOM ) align = FL_ALIGN_LEFT_BOTTOM; else if ( align == FL_ALIGN_LEFT_BOTTOM ) align = FL_ALIGN_RIGHT_BOTTOM; fl_get_align_xy( align, sp->key_xs, sp->key_ys, 0, 0, sp->key_maxw, sp->key_maxh, 0, 0, &sp->key_xs, &sp->key_ys ); } /*************************************** ***************************************/ static void add_border( FLI_XYPLOT_SPEC * sp, FL_COLOR c ) { if ( sp->xtic > 0 && sp->ytic > 0 ) fl_rect( sp->xi, sp->yi, sp->xf - sp->xi, sp->yf - sp->yi, c ); else if ( sp->xtic > 0 ) fl_line( sp->xi, sp->yf, sp->xf, sp->yf, c ); else if ( sp->ytic > 0 ) fl_line( sp->xi, sp->yi, sp->xi, sp->yf, c ); } /*************************************** * (scxmin, scxmax) ultimately determines the plot area in world coord. ***************************************/ static void round_xminmax( FLI_XYPLOT_SPEC * sp ) { if ( sp->xscale != FL_LOG ) { sp->xscmin = sp->xmin; sp->xscmax = sp->xmax; } else { sp->xscmin = log10( sp->xmin ) / sp->lxbase; sp->xscmax = log10( sp->xmax ) / sp->lxbase; } } /*************************************** * Do the same with y bounds ***************************************/ static void round_yminmax( FLI_XYPLOT_SPEC * sp ) { if ( sp->yscale != FL_LOG ) { sp->yscmin = sp->ymin; sp->yscmax = sp->ymax; } else { sp->yscmin = log10( sp->ymin ) / sp->lybase; sp->yscmax = log10( sp->ymax ) / sp->lybase; } } /*************************************** ***************************************/ static void draw_xyplot( FL_OBJECT * ob ) { FLI_XYPLOT_SPEC *sp = ob->spec; FL_Coord bw = FL_abs( ob->bw ); draw_to_pixmap = ob->use_pixmap && ob->flpixmap && ob->form->window == ob->flpixmap->pixmap; fl_draw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h, ob->col1, ob->bw ); fl_draw_text_beside( ob->align, ob->x, ob->y, ob->w, ob->h, ob->lcol, ob->lstyle, ob->lsize, ob->label ); if ( *sp->n <= 0 || ! *sp->x || ! *sp->y ) return; sp->xtic = sp->ytic = -1; sp->xscmin = sp->xmin; sp->xscmax = sp->xmax; sp->yscmin = sp->ymin; sp->yscmax = sp->ymax; if ( sp->xmajor > 0 ) { if ( sp->xscale == FL_LOG ) sp->xtic = gen_logtic( sp->xmin, sp->xmax, sp->xbase, sp->xmajor ); else sp->xtic = gen_tic( sp->xmin, sp->xmax, sp->xmajor, sp->xminor ); } round_xminmax( sp ); if ( sp->ymajor > 0 ) { if ( sp->yscale == FL_LOG ) sp->ytic = gen_logtic( sp->ymin, sp->ymax, sp->ybase, sp->ymajor ); else sp->ytic = gen_tic( sp->ymin, sp->ymax, sp->ymajor, sp->yminor ); } round_yminmax( sp ); convert_coord( ob, sp ); add_border( sp, ob->col2 ); draw_curve_only( ob ); fl_set_text_clipping( ob->x + bw, ob->y + bw, ob->w - 2 * bw, ob->h - 2 * bw ); fl_set_clipping( ob->x + bw, ob->y + bw, ob->w - 2 * bw, ob->h - 2 * bw ); /* Do the tics and other things */ /* Draw the title */ if ( *sp->title ) fl_draw_text( FL_ALIGN_BOTTOM, ( sp->xi + sp->xf ) / 2, sp->yi + 1, 0, 0, ob->col2, sp->lstyle, sp->lsize, sp->title ); ( sp->xscale == FL_LOG ? add_logxtics : add_xtics )( ob ); if ( *sp->xlabel ) fl_draw_text( FL_ALIGN_BOTTOM, ( sp->xi + sp->xf ) / 2, ob->y + ob->h - bw - ( draw_to_pixmap ? ob->y : 0 ), 1, 1, ob->col2, sp->lstyle, sp->lsize, sp->xlabel ); ( sp->yscale == FL_LOG ? add_logytics : add_ytics )( ob ); if ( *sp->ylabel ) { int cw = fl_get_char_width( sp->lstyle, sp->lsize ); int ch = fl_get_char_height( sp->lstyle, sp->lsize, NULL, NULL ); int nc = strlen( sp->ylabel ); int j; char s[ 2 ] = ""; for ( j = 0; ( *s = sp->ylabel[ j ] ); j++ ) fl_draw_text( FL_ALIGN_CENTER, sp->xi - sp->maxytic - 2 - cw, ( sp->yi + sp->yf ) / 2 + ( j - 0.5 * nc ) * ch, cw, ch, ob->col2, sp->lstyle, sp->lsize, s ); } fl_unset_text_clipping( ); fl_unset_clipping( ); } /*************************************** * Find the data point the mouse falls on. Since log scale is * non-linear, can't do search in world coordinates given pixel-delta, * thus the xpactive keeps the active screen data. ***************************************/ static int find_data( FL_OBJECT * ob, int deltax, int deltay, int mx, int my, int * n ) { FLI_XYPLOT_SPEC *sp = ob->spec; int found, i, dist, mindist, done, newi; int dx = 0; /* to shut -Wall up */ int dy = 0; /* same here */ FL_POINT *p = sp->xpactive; mx -= ob->x; my -= ob->y; for ( i = found = 0; i < *sp->n && ! found; i++ ) { dx = p[ i ].x - mx; dy = p[ i ].y - my; found = FL_abs( dx ) < deltax && FL_abs( dy ) < deltay; } /* It's possible that the first point we found is not the closest. Check for the closest using a linear distance */ mindist = FL_abs( dx ) + FL_abs( dy ); newi = i; for ( done = ! found; ! done && i < *sp->n; i++ ) { dx = p[ i ].x - mx; dy = p[ i ].y - my; dist = FL_abs( dx ) + FL_abs( dy ); if ( dist < mindist ) { mindist = dist; newi = i + 1; /* need to overshoot */ } else done = 1; } /* n overshoots by 1 and we're dependent on that ! */ *n = newi + sp->n1; return found; } /*************************************** ***************************************/ static int handle_mouse( FL_OBJECT * ob, FL_Coord mx, FL_Coord my ) { FLI_XYPLOT_SPEC *sp = ob->spec; static FL_Coord lmx, lmy; int i; int deltax = sp->ssize * ( sp->inspect ? 2.5 : 1.5 ) + 1; int deltay = deltax; float fmx, fmy; float xmin = FL_min( sp->xmin, sp->xmax ), xmax = FL_max( sp->xmax, sp->xmin ); float ymin = FL_min( sp->ymin, sp->ymax ), ymax = FL_max( sp->ymax, sp->ymin ); if ( sp->n[ 0 ] == 0 || ! sp->x || ! ( sp->active || sp->inspect ) ) return FL_RETURN_NONE; if ( lmx == mx && lmy == my ) { if ( sp->inside < 0 ) fl_set_cursor( FL_ObjWin( ob ), XC_tcross ); return FL_RETURN_NONE; } lmx = mx; lmy = my; /* If the mouse hadn't been on one of the points (or it had been released, in which case sp->inside is negative) check again. Don't do anything yet except changing the way the cursor looks like if we're now on a point. */ if ( sp->inside <= 0 ) { /* find_data() always overshoots by one and we are dependent on that! */ if ( ( sp->inside = find_data( ob, deltax, deltay, mx, my, &i ) ? i : 0 ) ) { fl_set_cursor( FL_ObjWin( ob ), XC_tcross ); sp->start_x = mx; sp->start_y = my; } return FL_RETURN_NONE; } /* If we arrive here, we were on top of a point the last time round. If we're in inspect mode check if we still are, otherwise reset the cursor and don't do anything further. */ if ( sp->inspect ) { if ( ! ( sp->inside = find_data( ob, deltax, deltay, mx, my, &i ) ? i : 0 ) ) fl_reset_cursor( FL_ObjWin( ob ) ); /* If delayed action, can't keep up with motion event */ #ifndef DELAYED_ACTION return FL_RETURN_CHANGED; #else return FL_RETURN_NONE; #endif } /* Now we are sure we're not in inspect mode and are shifting around one of the points. */ fmx = ( lmx - sp->bxm - ( draw_to_pixmap ? ob->x : 0 ) ) / sp->ax; fmy = ( lmy - sp->bym - ( draw_to_pixmap ? ob->y : 0 ) ) / sp->ay; if ( sp->xscale == FL_LOG ) fmx = pow( sp->xbase, fmx ); if ( sp->yscale == FL_LOG ) fmy = pow( sp->ybase, fmy ); /* Update data and redraw. Need to enforce the bounds */ i = sp->inside - 1; if ( fmx < xmin ) fmx = xmin; else if ( fmx > xmax ) fmx = xmax; if ( fmy < ymin ) fmy = ymin; else if ( fmy > ymax ) fmy = ymax; /* Fix the end points and don't allow crossings */ if ( i == 0 || i == *sp->n - 1 ) fmx = sp->x[ 0 ][ i ]; else { /* Here we need to leave some seperation. Otherwise too much error in interpolation */ if ( fmx >= sp->x[ 0 ][ i + 1 ] ) { if ( sp->xscale == FL_LOG ) fmx = sp->x[ 0 ][ i + 1 ] - ( sp->x[ 0 ][ i + 1 ] - sp->x[ 0 ][ i ] ) / 100; else fmx = sp->x[ 0 ][ i + 1 ] - 1.0 / sp->ax; } else if ( fmx <= sp->x[ 0 ][ i - 1 ] ) { if ( sp->xscale == FL_LOG ) fmx = sp->x[ 0 ][ i - 1 ] + ( sp->x[ 0 ][ i ] - sp->x[ 0 ][ i - 1 ] ) / 100; else fmx = sp->x[ 0 ][ i - 1 ] + 1.0 / sp->ax; } } sp->x[ 0 ][ i ] = fmx; sp->y[ 0 ][ i ] = fmy; fl_redraw_object( ob ); return ob->how_return & FL_RETURN_END_CHANGED ? FL_RETURN_NONE : FL_RETURN_CHANGED; } /*************************************** ***************************************/ static int handle_xyplot( FL_OBJECT * ob, int event, FL_Coord mx, FL_Coord my, int key FL_UNUSED_ARG, void * ev FL_UNUSED_ARG ) { FLI_XYPLOT_SPEC *sp = ob->spec; int ret = FL_RETURN_NONE; sp->lsize = ob->lsize; sp->lstyle = ob->lstyle; *sp->col = ob->col2; switch ( event ) { case FL_DRAW: draw_xyplot( ob ); sp->update = 0; break; case FL_DRAWLABEL: fl_draw_object_label( ob ); break; case FL_PUSH: case FL_MOTION: if ( sp->react_to[ key - 1 ] ) ret = handle_mouse( ob, mx, my ); break; case FL_RELEASE: if ( ! sp->react_to[ key - 1 ] || ! ( sp->active || sp->inspect ) ) break; /* Mark the release by setting inside < 0 */ if ( sp->inside > 0 ) { sp->inside *= -1; ret = FL_RETURN_END; if ( sp->inspect || ( ( mx != sp->start_x || my != sp->start_y ) && ob->how_return & FL_RETURN_END_CHANGED ) ) ret |= FL_RETURN_CHANGED; } fl_reset_cursor( FL_ObjWin( ob ) ); break; case FL_FREEMEM: free_xyplot( ob ); fl_free( sp ); break; } if ( ret && sp->inside == 0 ) M_err( "handle_xyplot", "Something is wrong\n" ); return ret; } /*************************************** * Allocates (or reallocates) the dynamically allocated portions * of the DLI_XYPLOT_SPEC structure. the second argument is the * number of overlays needed. ***************************************/ static int allocate_spec( FLI_XYPLOT_SPEC * sp, int n ) { int i, oldn = sp->maxoverlay; /* If we're supposed to set the spec up for less overlays than allocated free the memory used for those that have to go. */ if ( n < sp->maxoverlay ) for ( i = n + 1; i <= sp->maxoverlay; ++i ) { free_overlay_data( sp, i ); fli_safe_free( sp->text[ i ] ); fli_safe_free( sp->key[ i ] ); } /* (Re-)allocate memory, we need one more than the number of overlays, the very first one being for the "normal" data */ sp->text = fl_realloc( sp->text, ( n + 1 ) * sizeof *sp->text ); sp->xt = fl_realloc( sp->xt, ( n + 1 ) * sizeof *sp->xt ); sp->yt = fl_realloc( sp->yt, ( n + 1 ) * sizeof *sp->yt ); sp->x = fl_realloc( sp->x, ( n + 1 ) * sizeof *sp->x ); sp->y = fl_realloc( sp->y, ( n + 1 ) * sizeof *sp->y ); sp->n = fl_realloc( sp->n, ( n + 1 ) * sizeof *sp->n ); sp->grid = fl_realloc( sp->grid, ( n + 1 ) * sizeof *sp->grid ); sp->col = fl_realloc( sp->col, ( n + 1 ) * sizeof *sp->col ); sp->tcol = fl_realloc( sp->tcol, ( n + 1 ) * sizeof *sp->tcol ); sp->type = fl_realloc( sp->type, ( n + 1 ) * sizeof *sp->type ); sp->talign = fl_realloc( sp->talign, ( n + 1 ) * sizeof *sp->talign ); sp->interpolate = fl_realloc( sp->interpolate, ( n + 1 ) * sizeof * sp->interpolate ); sp->thickness = fl_realloc( sp->thickness, ( n + 1 ) * sizeof *sp->thickness ); sp->key = fl_realloc( sp->key, ( n + 1 ) * sizeof *sp->key ); sp->symbol = fl_realloc( sp->symbol, ( n + 1 ) * sizeof *sp->symbol ); /* Initialize the newly allocated parts */ for ( i = sp->maxoverlay > 0 ? sp->maxoverlay + 1 : 0; i <= n; i++ ) { sp->text[ i ] = sp->key[ i ] = NULL; sp->x[ i ] = sp->y[ i ] = NULL; sp->n[ i ] = sp->type[ i ] = 0; sp->xt[ i ] = sp->yt[ i ] = sp->grid[ i ] = 0.0; sp->col[ i ] = sp->tcol[ i ] = 0; sp->type[ i ] = sp->n[ i ] = 0; sp->talign[ i ] = sp->interpolate[ i ] = sp->thickness[ i ] = 0; sp->symbol[ i ] = NULL; } sp->maxoverlay = n; return oldn; } /*************************************** * Free all memory that does not depend on the xy-data ***************************************/ static void free_spec_dynamic_mem( FLI_XYPLOT_SPEC * sp ) { int i; fli_safe_free( sp->xt ); fli_safe_free( sp->yt ); fli_safe_free( sp->grid ); fli_safe_free( sp->col ); fli_safe_free( sp->tcol ); fli_safe_free( sp->type ); fli_safe_free( sp->interpolate ); fli_safe_free( sp->talign ); fli_safe_free( sp->thickness ); fli_safe_free( sp->symbol ); /* The memory allocated to the elements of sp->x and sp->y should already have been freed before the call of this function! */ fli_safe_free( sp->x ); fli_safe_free( sp->y ); fli_safe_free( sp->n ); if ( sp->text ) { for ( i = 0; i <= sp->maxoverlay; i++ ) fli_safe_free( sp->text[ i ] ); fli_safe_free( sp->text ); } if ( sp->key ) { for ( i = 0; i <= sp->maxoverlay; i++ ) fli_safe_free( sp->key[ i ] ); fli_safe_free( sp->key ); } } /*************************************** ***************************************/ static void init_spec( FL_OBJECT * obj ) { FLI_XYPLOT_SPEC *sp = obj->spec; sp->text = sp->key = NULL; sp->x = sp->y = NULL; sp->xt = sp->yt = sp->grid = NULL; sp->col = sp->tcol = NULL; sp->type = sp->n = NULL; sp->talign = sp->interpolate = sp->thickness = NULL; sp->symbol = NULL; allocate_spec( sp, FL_MAX_XYPLOTOVERLAY ); sp->title = strdup( "" ); sp->xlabel = strdup( "" ); sp->ylabel = strdup( "" ); sp->xscale = sp->yscale = FL_LINEAR; sp->xbase = sp->ybase = 10.0; sp->lxbase = sp->lybase = 1.0; sp->xautoscale = sp->yautoscale = 1; sp->xmajor = XMAJOR; sp->ymajor = YMAJOR; sp->xminor = XMINOR; sp->yminor = YMINOR; sp->ssize = 4; sp->lsize = obj->lsize; sp->lstyle = obj->lstyle; sp->grid_linestyle = FL_DOT; sp->wx = NULL; sp->wy = NULL; sp->active = obj->type == FL_ACTIVE_XYPLOT; sp->key_lsize = obj->lsize; sp->key_lstyle = obj->lstyle; *sp->type = obj->type; sp->nxpi = 1; sp->xpi = fl_malloc( ( sp->nxpi + 3 ) * sizeof *sp->xpi ); sp->xpi++; sp->n1 = 0; sp->cur_nxp = 1; sp->xp = fl_malloc( ( sp->cur_nxp + 3 ) * sizeof *sp->xp ); sp->xp++; sp->xpactive = fl_malloc( ( sp->cur_nxp + 3 ) * sizeof *sp->xpactive ); sp->axtic[ 0 ] = sp->aytic[ 0 ] = NULL; sp->axtic[ MAX_MAJOR ] = sp->aytic[ MAX_MAJOR ] = NULL; sp->mark_active = 1; sp->react_to[ 0 ] = 1; } /*************************************** ***************************************/ FL_OBJECT * fl_create_xyplot( int t, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * l ) { FL_OBJECT *obj = fl_make_object( FL_XYPLOT, t, x, y, w, h, l, handle_xyplot ); obj->boxtype = FL_XYPLOT_BOXTYPE; obj->col2 = obj->lcol = FL_BLACK; obj->col1 = FL_COL1; obj->lsize = FL_TINY_SIZE; obj->align = FL_XYPLOT_ALIGN; obj->spec = fl_calloc( 1, sizeof( FLI_XYPLOT_SPEC ) ); init_spec( obj ); fl_set_object_return( obj, FL_RETURN_END_CHANGED ); return obj; } /*************************************** ***************************************/ FL_OBJECT * fl_add_xyplot( int t, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * l ) { FL_OBJECT *obj = fl_create_xyplot( t, x, y, w, h, l ); FLI_XYPLOT_SPEC *sp = obj->spec; fl_add_object( fl_current_form, obj ); /* Active_xyplot looks a little better in double buffer mode */ if ( sp->active ) fl_set_object_dblbuffer( obj, 1 ); return obj; } /*************************************** * Returns the number of points a call of fl_get_xyplot_data() will return ***************************************/ int fl_get_xyplot_data_size( FL_OBJECT * obj ) { return *( ( FLI_XYPLOT_SPEC * ) obj->spec )->n; } /*************************************** ***************************************/ void fl_get_xyplot_data( FL_OBJECT * obj, float * x, float * y, int * n ) { FLI_XYPLOT_SPEC *sp = obj->spec; *n = 0; if ( *sp->n > 0 ) { memcpy( x, sp->x[ 0 ], sp->n[ 0 ] * sizeof *x ); memcpy( y, sp->y[ 0 ], sp->n[ 0 ] * sizeof *y ); *n = *sp->n; } } /*************************************** ***************************************/ void fl_replace_xyplot_point( FL_OBJECT * ob, int i, double x, double y ) { FLI_XYPLOT_SPEC *sp = ob->spec; if ( i < 0 || i >= *sp->n ) return; if ( sp->x[ 0 ][ i ] != x || sp->y[ 0 ][ i ] != y ) { sp->x[ 0 ][ i ] = x; sp->y[ 0 ][ i ] = y; fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_replace_xyplot_point_in_overlay( FL_OBJECT * ob, int i, int id, double x, double y ) { FLI_XYPLOT_SPEC *sp = ob->spec; if ( id < 0 || id > sp->maxoverlay ) return; if ( i < 0 || i >= sp->n[ id ] ) return; if ( sp->x[ id ][ i ] != x || sp->y[ id ][ i ] != y ) { sp->x[ id ][ i ] = x; sp->y[ id ][ i ] = y; fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_get_xyplot( FL_OBJECT * ob, float * x, float * y, int * i ) { FLI_XYPLOT_SPEC *sp = ob->spec; *i = FL_abs( sp->inside ) - 1; if ( *i < 0 || *i >= *sp->n ) { *i = -1; return; } *x = sp->x[ 0 ][ *i ]; *y = sp->y[ 0 ][ *i ]; } /*************************************** ***************************************/ int fl_set_xyplot_maxoverlays( FL_OBJECT * ob, int maxover ) { return allocate_spec( ob->spec, maxover ); } /*************************************** * Sets under which conditions the object is to be returned to the * application. This function should be regarded as for internal use * only and fl_set_object_return() should be used instead (which then * will call this function). ***************************************/ void fl_set_xyplot_return( FL_OBJECT * obj, unsigned int when ) { if ( obj->type == FL_ACTIVE_XYPLOT ) obj->how_return = when ? FL_RETURN_CHANGED : FL_RETURN_END_CHANGED; else obj->how_return = FL_RETURN_NONE; } /*************************************** ***************************************/ void fl_set_xyplot_symbolsize( FL_OBJECT * ob, int n ) { ( ( FLI_XYPLOT_SPEC * ) ob->spec )->ssize = n; } /*************************************** ***************************************/ FL_XYPLOT_SYMBOL fl_set_xyplot_symbol( FL_OBJECT * ob, int id, FL_XYPLOT_SYMBOL symbol ) { FLI_XYPLOT_SPEC *sp = ob->spec; FL_XYPLOT_SYMBOL old = NULL; int i; if ( id < 0 || id > sp->maxoverlay ) { M_err( "fl_set_xyplot_symbol", "ID %d is not in range (0,%d)", id, sp->maxoverlay ); return NULL; } for ( i = 0; i <= sp->maxoverlay; i++ ) { if ( i == id || id < 0 ) { old = sp->symbol[ i ]; if ( sp->symbol[ i ] != symbol ) { sp->symbol[ i ] = symbol; fl_redraw_object( ob ); } } } return old; } /*************************************** ***************************************/ void fl_set_xyplot_inspect( FL_OBJECT * ob, int yes_no ) { FLI_XYPLOT_SPEC *sp = ob->spec; if ( sp->inspect == yes_no ) return; sp->inspect = yes_no; if ( ob->type != FL_ACTIVE_XYPLOT ) { /* Work-around, need to use doublebuffer to get inspect work right */ fl_set_object_dblbuffer( ob, sp->active || sp->inspect ); fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_set_xyplot_xtics( FL_OBJECT * ob, int major, int minor ) { FLI_XYPLOT_SPEC *sp = ob->spec; /* 0 restores the default */ if ( major < 0 ) major = minor = -1; else if ( major == 0 ) major = XMAJOR; else if ( major > MAX_MAJOR ) major = MAX_MAJOR; if ( minor < 0 ) minor = -1; else if ( minor == 0 ) minor = XMINOR; else if ( minor > MAX_MINOR ) minor = MAX_MINOR; if ( major > 0 && ( ( minor > 0 && major * minor > MAX_TIC ) || ( minor < 0 && major > MAX_TIC ) ) ) { M_err( "fl_set_xyplot_xtics", "More than maximum of %d tics would be required", MAX_TIC ); if ( minor > 0 ) minor = 2; major = 5; } if ( *sp->axtic || sp->xmajor != major || sp->xminor != minor ) { sp->xmajor = major; sp->xminor = minor; free_atic( sp->axtic ); fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_set_xyplot_ytics( FL_OBJECT * ob, int major, int minor ) { FLI_XYPLOT_SPEC *sp = ob->spec; if ( major < 0 ) major = minor = -1; else if ( major == 0 ) major = YMAJOR; else if ( major > MAX_MAJOR ) major = MAX_MAJOR; if ( minor < 0 ) minor = -1; else if ( minor == 0 ) minor = YMINOR; else if ( minor > MAX_MINOR ) minor = MAX_MINOR; if ( major > 0 && ( ( minor > 0 && major * minor > MAX_TIC ) || ( minor < 0 && major > MAX_TIC ) ) ) { M_err( "fl_set_xyplot_ytics", "More than maximum of %d tics would be required", MAX_TIC ); minor = 2; major = 5; } if ( *sp->aytic || sp->ymajor != major || sp->yminor != minor ) { sp->ymajor = major; sp->yminor = minor; free_atic( sp->aytic ); fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_set_xyplot_xgrid( FL_OBJECT * ob, int xgrid ) { FLI_XYPLOT_SPEC *sp = ob->spec; if ( sp->xgrid != xgrid ) { sp->xgrid = xgrid; fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_set_xyplot_ygrid( FL_OBJECT * ob, int ygrid ) { FLI_XYPLOT_SPEC *sp = ob->spec; if ( sp->ygrid != ygrid ) { sp->ygrid = ygrid; fl_redraw_object( ob ); } } /*************************************** ***************************************/ int fl_set_xyplot_grid_linestyle( FL_OBJECT * ob, int style ) { FLI_XYPLOT_SPEC *sp = ob->spec; int ostyle = sp->grid_linestyle; if ( sp->grid_linestyle != style ) { sp->grid_linestyle = style; fl_redraw_object( ob ); } return ostyle; } /*************************************** ***************************************/ void fl_set_xyplot_xbounds( FL_OBJECT * ob, double xmin, double xmax ) { FLI_XYPLOT_SPEC *sp = ob->spec; int do_autoscale = xmax == xmin; if ( sp->xautoscale != do_autoscale || sp->xmin != xmin || sp->xmax != xmax ) { sp->xautoscale = do_autoscale; sp->xmax = xmax; sp->xmin = xmin; find_xbounds( sp ); fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_get_xyplot_xbounds( FL_OBJECT * ob, float * xmin, float * xmax ) { FLI_XYPLOT_SPEC *sp = ob->spec; *xmin = sp->xmin; *xmax = sp->xmax; } /*************************************** ***************************************/ void fl_get_xyplot_ybounds( FL_OBJECT * ob, float * ymin, float * ymax ) { FLI_XYPLOT_SPEC *sp = ob->spec; *ymin = sp->ymin; *ymax = sp->ymax; } /*************************************** ***************************************/ void fl_set_xyplot_ybounds( FL_OBJECT * ob, double ymin, double ymax ) { FLI_XYPLOT_SPEC *sp = ob->spec; int do_autoscale = ymax == ymin; if ( sp->yautoscale != do_autoscale || sp->ymin != ymin || sp->ymax != ymax ) { sp->yautoscale = do_autoscale; sp->ymax = ymax; sp->ymin = ymin; find_ybounds( sp ); fl_redraw_object( ob ); } } /*************************************** ***************************************/ static void get_min_max( float * x, int n, float * xmin, float * xmax ) { float *xs = x + n; if ( ! x || ! n ) return; for ( *xmin = *xmax = *x++; x < xs; x++ ) { *xmin = FL_min( *xmin, *x ); *xmax = FL_max( *xmax, *x ); } } /*************************************** ***************************************/ static void find_xbounds( FLI_XYPLOT_SPEC * sp ) { if ( sp->xautoscale ) get_min_max( *sp->x, *sp->n, &sp->xmin, &sp->xmax ); if ( sp->xmax == sp->xmin ) { sp->xmin -= 1.0; sp->xmax += 1.0; } } /*************************************** ***************************************/ static void find_ybounds( FLI_XYPLOT_SPEC * sp ) { if ( sp->yautoscale ) get_min_max( *sp->y, *sp->n, &sp->ymin, &sp->ymax ); if ( sp->ymax == sp->ymin ) { sp->ymin -= 1.0; sp->ymax += 1.0; } } /*************************************** * Overloading would've been nice ... ***************************************/ void fl_set_xyplot_data_double( FL_OBJECT * ob, double * x, double * y, int n, const char * title, const char * xlabel, const char * ylabel ) { FLI_XYPLOT_SPEC *sp = ob->spec; int i; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_XYPLOT ) ) { M_err( "fl_set_xyplot_data_double", "%s not an xyplot", ob ? ob->label : "" ); return; } #endif free_overlay_data( sp, 0 ); fli_safe_free( sp->xlabel ); fli_safe_free( sp->ylabel ); fli_safe_free( sp->title ); sp->xlabel = fl_strdup( xlabel ? xlabel : "" ); sp->ylabel = fl_strdup( ylabel ? ylabel : "" ); sp->title = fl_strdup( title ? title : "" ); *sp->x = fl_malloc( n * sizeof **sp->x ); *sp->y = fl_malloc( n * sizeof **sp->y ); if ( ! *sp->x || ! *sp->y ) { if ( *sp->x ) fl_free( *sp->x ); M_err( "fl_set_xyplot_data_double", "Can't allocate memory" ); return; } extend_screen_data( sp, n ); for ( i = 0; i < n ; i++ ) { sp->x[ 0 ][ i ] = x[ i ]; sp->y[ 0 ][ i ] = y[ i ]; } *sp->n = n; find_xbounds( sp ); find_ybounds( sp ); fl_redraw_object( ob ); } /*************************************** ***************************************/ void fl_set_xyplot_data( FL_OBJECT * ob, float * x, float * y, int n, const char * title, const char * xlabel, const char * ylabel ) { FLI_XYPLOT_SPEC *sp = ob->spec; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_XYPLOT ) ) { M_err( "fl_set_xyplot_data", "%s not an xyplot", ob ? ob->label : "" ); return; } #endif free_overlay_data( sp, 0 ); fli_safe_free( sp->xlabel ); fli_safe_free( sp->ylabel ); fli_safe_free( sp->title ); sp->xlabel = fl_strdup( xlabel ? xlabel : "" ); sp->ylabel = fl_strdup( ylabel ? ylabel : "" ); sp->title = fl_strdup( title ? title : "" ); *sp->x = fl_malloc( n * sizeof **sp->x ); *sp->y = fl_malloc( n * sizeof **sp->y ); if ( ! *sp->x || ! *sp->y ) { if ( *sp->x ) fli_safe_free( *sp->x ); M_err( "fl_set_xyplot_data", "Can't allocate memory" ); return; } extend_screen_data( sp, n ); memcpy( *sp->x, x, n * sizeof **sp->x ); memcpy( *sp->y, y, n * sizeof **sp->y ); *sp->n = n; find_xbounds( sp ); find_ybounds( sp ); fl_redraw_object( ob ); } /*************************************** * Insert a point after n ***************************************/ void fl_insert_xyplot_data( FL_OBJECT * ob, int id, int n, double x, double y ) { FLI_XYPLOT_SPEC *sp = ob->spec; float *xx, *yy; if ( id < 0 || id > sp->maxoverlay ) { M_err( "fl_insert_xyplot_data", "ID %d is not in range (0,%d)", id, sp->maxoverlay ); return; } if ( n < -1 ) n = -1; else if ( n >= sp->n[ id ] ) n = sp->n[ id ] - 1; n = n + 1; sp->n[ id ] += 1; if ( n == sp->n[ id ] - 1 ) { sp->x[ id ] = fl_realloc( sp->x[ id ], sp->n[ id ] * sizeof **sp->x ); sp->y[ id ] = fl_realloc( sp->y[ id ], sp->n[ id ] * sizeof **sp->y ); sp->x[ id ][ n ] = x; sp->y[ id ][ n ] = y; } else { xx = fl_malloc( sp->n[ id ] * sizeof *xx ); yy = fl_malloc( sp->n[ id ] * sizeof *yy ); if ( n ) { memcpy( xx, sp->x[ id ], n * sizeof *xx ); memcpy( yy, sp->y[ id ], n * sizeof *yy ); } xx[ n ] = x; yy[ n ] = y; memcpy( xx + n + 1, sp->x[ id ] + n, ( sp->n[ id ] - n - 1 ) * sizeof *xx ); memcpy( yy + n + 1, sp->y[ id ] + n, ( sp->n[ id ] - n - 1 ) * sizeof *yy ); fl_free( sp->x[ id ] ); fl_free( sp->y[ id ] ); sp->x[ id ] = xx; sp->y[ id ] = yy; } extend_screen_data( sp, sp->n[ id ] ); fl_redraw_object( ob ); } /*************************************** ***************************************/ void fl_add_xyplot_overlay( FL_OBJECT * ob, int id, float * x, float * y, int n, FL_COLOR col ) { FLI_XYPLOT_SPEC *sp; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_XYPLOT ) ) { M_err( "fl_add_xyplot_overlay", "%s not XYPLOT class", ob ? ob->label : "" ); return; } #endif sp = ob->spec; if ( id < 1 || id > sp->maxoverlay ) { M_err( "fl_add_xyplot_overlay", "ID %d is not in range (1,%d)", id, sp->maxoverlay ); return; } /* Free old data */ free_overlay_data( sp, id ); /* Copy data */ sp->x[ id ] = fl_malloc( n * sizeof **sp->x ); sp->y[ id ] = fl_malloc( n * sizeof **sp->y ); memcpy( sp->x[ id ], x, n * sizeof **sp->x ); memcpy( sp->y[ id ], y, n * sizeof **sp->y ); sp->n[ id ] = n; /* Extend screen points if needed. */ extend_screen_data( sp, n ); sp->col[ id ] = col; /* Set default only for the first time */ if ( sp->type[ id ] == -1 ) sp->type[ id ] = ob->type; fl_redraw_object( ob ); } #define MAXP 1024 /* this is the initial space */ /*************************************** ***************************************/ static int load_data( const char * f, float ** x, float ** y ) { int n = 0, err = 0; FILE *fp; char buf[ 128 ]; int maxp = MAXP, ncomment = 0; if ( ! f || ! ( fp = fopen( f, "r" ) ) ) { M_err( "load_data", "Can't open datafile '%s'", f ? f : "null" ); return 0; } *x = fl_malloc( maxp * sizeof **x ); *y = fl_malloc( maxp * sizeof **y ); /* Comment chars are semicolon, hash and exclamation mark while seperators between numbers are space, comma and tab */ while ( fgets( buf, sizeof buf, fp ) ) { if ( *buf == '!' || *buf == '#' || *buf == ';' || *buf == '\n' ) { ncomment++; continue; } if ( ( err = ( sscanf( buf, "%f%*[ \t,]%f", *x + n, *y + n ) != 2 ) ) ) { M_err( "load_data", "An error occured at line %d", ++n + ncomment ); break; } if ( ++n >= maxp ) { maxp *= 2; *x = fl_realloc( *x, maxp * sizeof **x ); *y = fl_realloc( *y, maxp * sizeof **y ); } } fclose( fp ); if ( err || n == 0 ) { fl_free( *x ); fl_free( *y ); n = 0; } return n; } /*************************************** ***************************************/ int fl_add_xyplot_overlay_file( FL_OBJECT * ob, int id, const char * f, FL_COLOR c ) { float *x, *y; int n = load_data( f, &x, &y ); if ( n > 0 ) { fl_add_xyplot_overlay( ob, id, x, y, n, c ); fl_free( x ); fl_free( y ); } return n; } /*************************************** ***************************************/ void fl_set_xyplot_overlay_type( FL_OBJECT * ob, int id, int type ) { FLI_XYPLOT_SPEC *sp = ob->spec; if ( id < 0 || id > sp->maxoverlay ) { M_err( "fl_set_xyplot_overlay_type", "ID %d is not in range (0,%d)", id, sp->maxoverlay ); return; } if ( sp->type[ id ] != type ) { sp->type[ id ] = type; fl_redraw_object( ob ); } } /*************************************** ***************************************/ int fl_get_xyplot_numdata( FL_OBJECT * ob, int id ) { FLI_XYPLOT_SPEC *sp = ob->spec; if ( id < 0 || id > sp->maxoverlay ) { M_err( "fl_get_xyplot_numdata", "ID %d is not in range (0,%d)", id, sp->maxoverlay ); return -1; } return sp->n[ id ]; } /*************************************** ***************************************/ void fl_delete_xyplot_overlay( FL_OBJECT * ob, int id ) { FLI_XYPLOT_SPEC *sp = ob->spec; if ( id <= 0 || id > sp->maxoverlay ) { M_err( "fl_delete_xyplot_overlay", "ID %d is not in range (1,%d)", id, sp->maxoverlay ); return; } free_overlay_data( sp, id ); sp->type[ id ] = -1; fl_redraw_object( ob ); } /*************************************** ***************************************/ void fl_get_xyplot_overlay_data( FL_OBJECT * ob, int id, float * x, float * y, int * n ) { FLI_XYPLOT_SPEC *sp = ob->spec; if ( id < 0 || id > sp->maxoverlay ) { M_err( "fl_get_xyplot_overlay_data", "ID %d is not in range (0,%d)", id, sp->maxoverlay ); return; } if ( sp->n[ id ] ) { memcpy( x, sp->x[ id ], sp->n[ id ] * sizeof *x ); memcpy( y, sp->y[ id ], sp->n[ id ] * sizeof *y ); *n = sp->n[ id ]; } else *n = 0; } /*************************************** ***************************************/ void fl_get_xyplot_data_pointer( FL_OBJECT * ob, int id, float ** x, float ** y, int * n ) { FLI_XYPLOT_SPEC *sp = ob->spec; if ( id < 0 || id > sp->maxoverlay ) { M_err( "fl_get_xyplot_data_pointer", "ID %d is not in range (0,%d)", id, sp->maxoverlay ); return; } if ( sp->n[ id ] ) { *x = sp->x[ id ]; *y = sp->y[ id ]; *n = sp->n[ id ]; } else *n = 0; } /*************************************** ***************************************/ void fl_set_xyplot_linewidth( FL_OBJECT * ob, int id, int lw ) { FLI_XYPLOT_SPEC *sp = ob->spec; if ( id < 0 || id > sp->maxoverlay ) { M_err( "fl_set_xyplot_linewidth", "ID %d is not in range (0,%d)", id, sp->maxoverlay ); return; } if ( lw != sp->thickness[ id ] ) { sp->thickness[ id ] = lw; fl_redraw_object( ob ); } } /*************************************** ***************************************/ int fl_set_xyplot_file( FL_OBJECT * ob, const char * f, const char * title, const char * xl, const char * yl ) { float *x, *y; int n; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_XYPLOT ) ) { M_err( "fl_set_xyplot_file", "%s not an xyplot", ob ? ob->label : "" ); return 0; } #endif if ( ( n = load_data( f, &x, &y ) ) > 0 ) { fl_set_xyplot_data( ob, x, y, n, title, xl, yl ); fl_free( x ); fl_free( y ); } return n; } /*************************************** ***************************************/ void fl_add_xyplot_text( FL_OBJECT * ob, double x, double y, const char * text, int al, FL_COLOR col ) { FLI_XYPLOT_SPEC *sp; int i; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_XYPLOT ) ) { M_err( "fl_add_xyplot_text", "%s not an xyplot", ob ? ob->label : "" ); return; } #endif sp = ob->spec; /* Find an appropriate slot for this */ for ( i = 0; sp->text[ i ] && i <= sp->maxoverlay; i++ ) /* empty */ ; if ( i <= sp->maxoverlay ) { sp->text[ i ] = fl_strdup( text ); sp->xt[ i ] = x; sp->yt[ i ] = y; sp->talign[ i ] = al; sp->tcol[ i ] = col; fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_delete_xyplot_text( FL_OBJECT * ob, const char * text ) { FLI_XYPLOT_SPEC *sp; int i; #if FL_DEBUG >= ML_ERR if ( ! IsValidClass( ob, FL_XYPLOT ) ) { M_err( "fl_delete_xyplot_text", "%s not an xyplot", ob ? ob->label : "" ); return; } #endif for ( sp = ob->spec, i = 0; i <= sp->maxoverlay; i++ ) if ( sp->text[ i ] && strcmp( sp->text[ i ], text ) == 0 ) { fli_safe_free( sp->text[ i ] ); fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_set_xyplot_interpolate( FL_OBJECT * ob, int id, int deg, double grid ) { int intpl; FLI_XYPLOT_SPEC *sp = ob->spec; if ( ! ob || id < 0 || id > sp->maxoverlay ) return; if ( deg >= 2 && grid <= 0.0 ) return; intpl = deg <= 1 ? 0 : ( ( deg < 2 || deg > 7 ) ? 2 : deg ); if ( sp->interpolate[ id ] != intpl ) { sp->interpolate[ id ] = intpl; sp->grid[ id ] = grid; fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_set_xyplot_fontsize( FL_OBJECT * ob, int size ) { if ( ob->lsize != size ) { ob->lsize = size; fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_set_xyplot_fontstyle( FL_OBJECT * ob, int style ) { if ( ob->lstyle != style ) { ob->lstyle = style; fl_redraw_object( ob ); } } /*************************************** * Truncates a floating point number to a requested significant digits * (if the number of digits is 0 truncate to the nearest integer) ***************************************/ static double trunc_f( double f, int digits ) { int sign; double fac; int expon; if ( fabs( f ) < 1.e-20 ) return 0.0; if ( digits < 0 ) digits = 1; if ( ! digits ) return f >= 0 ? floor( f + 0.5 ) : ceil( f - 0.5 ); sign = f >= 0 ? 1 : -1; f *= sign; if ( f >= 1.0 ) expon = floor( log10( f ) ); else if ( f == 0.0 ) return 0.0; else expon = ceil( log10( f ) ); fac = pow( 10.0, digits - expon ); return sign * floor( fac * f + 0.5 ) / fac; } #define ADVANCE 0.1 /* shoulde not be greater than 0.25 */ #define FACTOR 1.9 /* max major expansion */ /*************************************** ***************************************/ static float gen_tic( float tmin, float tmax, int major, int minor ) { float r_range, l_range, n_range; float tic; int ipow, digit; /* Handle special case: Min, MAX and one tic */ if ( major == 1 && minor == 2 ) { tic = FL_abs( tmax - tmin ) * 0.5; return tic; } r_range = FL_abs( tmax - tmin ); l_range = log10( r_range ); ipow = l_range > 0.0 ? l_range : l_range - 1; /* Normalized range is between 0 and 10 */ n_range = pow( 10.0, l_range - ipow ); n_range += ADVANCE; if ( n_range <= major && n_range >= major * 0.5 ) tic = 1.0; else tic = n_range / major; digit = tic < 1.0f; tic = trunc_f( tic, digit ); tic /= minor; tic = trunc_f( tic, 1 ); tic *= pow( 10.0, ipow ); /* Final check */ n_range = r_range / ( tic * minor * major ); if ( n_range > FACTOR ) { ipow = n_range / FACTOR; if ( ipow >= 1 ) tic *= 2.0 * ipow; else tic *= 2.0 * n_range / FACTOR; tic = trunc_f( tic, 1 ); } return tic; } /*************************************** ***************************************/ static float gen_logtic( float tmin, float tmax, float base, int major ) { float tic, lbase = log10( base ); if ( tmin <= 0.0 || tmax <= 0.0 ) { M_err( "gen_logtic", "range bordrs must be greater than 0 for " "logscale" ); return -1; } tic = ( floor( log10( tmax ) / lbase + 0.5 ) - ceil( log10( tmin ) / lbase - 0.5 ) ) / major; if ( tic < 1.0 ) tic = 1.0; return floor( tic + 0.5 ); } /*************************************** ***************************************/ void fl_get_xyplot_xmapping( FL_OBJECT * ob, float * a, float * b ) { *a = ( ( FLI_XYPLOT_SPEC * ) ob->spec )->ax; *b = ( ( FLI_XYPLOT_SPEC * ) ob->spec )->bxm; } /*************************************** ***************************************/ void fl_get_xyplot_ymapping( FL_OBJECT * ob, float * a, float * b ) { *a = ( ( FLI_XYPLOT_SPEC * ) ob->spec )->ay; *b = ( ( FLI_XYPLOT_SPEC * ) ob->spec )->bym; } /*************************************** ***************************************/ void fl_xyplot_s2w( FL_OBJECT * ob, double sx, double sy, float * wx, float * wy ) { FLI_XYPLOT_SPEC *sp = ob->spec; *wx = ( sx - sp->bxm ) / sp->ax; *wy = ( sy - sp->bym ) / sp->ay; if ( sp->xscale == FL_LOG ) *wx = pow( sp->xbase, *wx ); if ( sp->yscale == FL_LOG ) *wy = pow( sp->ybase, *wy ); } /*************************************** * Draw means we only call this at draw time, thus * should be ax, bx, not ax, bxm ***************************************/ static void w2s_draw( FL_OBJECT * ob, double wx, double wy, float * sx, float * sy ) { FLI_XYPLOT_SPEC *sp = ob->spec; float sbx = sp->bxm, sby = sp->bym; sp->bxm = sp->bx - ob->x; sp->bym = sp->by - ob->y; fl_xyplot_w2s( ob, wx, wy, sx, sy ); if ( ! draw_to_pixmap ) { *sx += ob->x; *sy += ob->y; } sp->bxm = sbx; sp->bym = sby; } /*************************************** * Really should be ints for the screen coordinates ***************************************/ void fl_xyplot_w2s( FL_OBJECT * ob, double wx, double wy, float * sx, float * sy ) { FLI_XYPLOT_SPEC *sp = ob->spec; if ( sp->xscale == FL_LOG ) *sx = FL_crnd( log10( wx ) / sp->lxbase * sp->ax + sp->bxm ); else *sx = FL_crnd( wx * sp->ax + sp->bxm ); if ( sp->yscale == FL_LOG ) *sy = FL_crnd( log10( wy ) / sp->lybase * sp->ay + sp->bym ); else *sy = FL_crnd( wy * sp->ay + sp->bym ); } /*************************************** ***************************************/ void fl_set_xyplot_xscale( FL_OBJECT * ob, int scale, double base ) { FLI_XYPLOT_SPEC *sp = ob->spec; if ( scale == FL_LOG && ( base <= 0.0 || base == 1.0 ) ) { M_err( "fl_set_xyplot_xscale", "bad log base %g specified", base ); return; } if ( sp->xscale != scale || sp->xbase != base ) { sp->xscale = scale; if ( scale == FL_LOG ) { sp->xbase = base; sp->lxbase = log10( base ); } fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_set_xyplot_yscale( FL_OBJECT * ob, int scale, double base ) { FLI_XYPLOT_SPEC *sp = ob->spec; if ( scale == FL_LOG && ( base <= 0.0 || base == 1.0 ) ) { M_err( "fl_set_xyplot_yscale", "bad log base %g specified", base ); return; } if ( sp->yscale != scale || sp->ybase != base ) { sp->yscale = scale; if ( scale == FL_LOG ) { sp->ybase = base; sp->lybase = log10( base ); } fl_redraw_object( ob ); } } /*************************************** ***************************************/ void fl_set_xyplot_fixed_xaxis( FL_OBJECT * ob, const char * lm, const char * rm ) { FLI_XYPLOT_SPEC *sp = ob->spec; fli_safe_free( sp->xmargin1 ); fli_safe_free( sp->xmargin2 ); sp->xmargin1 = lm ? fl_strdup( lm ) : NULL; sp->xmargin2 = rm ? fl_strdup( rm ) : NULL; if ( sp->xmargin2 && ! sp->xmargin1 ) sp->xmargin1 = fl_strdup( "" ); if ( sp->xmargin1 && ! sp->xmargin2 ) sp->xmargin2 = fl_strdup( "" ); } /*************************************** ***************************************/ void fl_set_xyplot_fixed_yaxis( FL_OBJECT * ob, const char * bm, const char * tm ) { FLI_XYPLOT_SPEC *sp = ob->spec; fli_safe_free( sp->ymargin1 ); fli_safe_free( sp->ymargin1 ); sp->ymargin1 = tm ? fl_strdup( tm ) : NULL; sp->ymargin2 = bm ? fl_strdup( bm ) : NULL; if ( sp->ymargin2 && ! sp->ymargin1 ) sp->ymargin1 = fl_strdup( "" ); if ( sp->ymargin1 && ! sp->ymargin2 ) sp->ymargin2 = fl_strdup( "" ); } /*************************************** ***************************************/ void fl_set_xyplot_alphaxtics( FL_OBJECT * ob, const char * m, const char * s FL_UNUSED_ARG ) { FLI_XYPLOT_SPEC *sp = ob->spec; char *tmps, *item; int n; free_atic( sp->axtic ); tmps = fl_strdup( m ? m : "" ); for ( n = 0, item = strtok( tmps, "|" ); n < MAX_MAJOR && item; item = strtok( NULL, "|" ) ) sp->axtic[ n++ ] = fl_strdup( item ); fl_free( tmps ); sp->xmajor = n; sp->xminor = 1; fl_redraw_object( ob ); } /*************************************** ***************************************/ void fl_set_xyplot_alphaytics( FL_OBJECT * ob, const char * m, const char * s FL_UNUSED_ARG ) { FLI_XYPLOT_SPEC *sp = ob->spec; char *tmps, *item; int n; free_atic( sp->aytic ); tmps = fl_strdup( m ? m : "" ); for ( n = 0, item = strtok( tmps, "|" ); n < MAX_MAJOR && item; item = strtok( NULL, "|" ) ) sp->aytic[ n++ ] = fl_strdup( item ); fl_free( tmps ); sp->ymajor = n; sp->yminor = 1; fl_redraw_object( ob ); } /*************************************** * Free all data and inset text, alphanumerical labels and other stuff ***************************************/ void fl_clear_xyplot( FL_OBJECT * obj ) { int i; FLI_XYPLOT_SPEC *sp = obj->spec; for ( i = 0; i <= sp->maxoverlay; i++ ) { free_overlay_data( sp, i ); fli_safe_free( sp->text[ i ] ); fli_safe_free( sp->key[ i ] ); } fl_redraw_object( obj ); } /*************************************** ***************************************/ void fl_set_xyplot_key( FL_OBJECT * ob, int id, const char * key ) { FLI_XYPLOT_SPEC *sp = ob->spec; if ( id < 0 || id > sp->maxoverlay ) { M_err( "fl_set_xyplot_key", "ID %d is not in range (0,%d)", id, sp->maxoverlay ); return; } fli_safe_free( sp->key[ id ] ); if ( key && *key ) sp->key[ id ] = fl_strdup( key ); } /*************************************** ***************************************/ void fl_set_xyplot_key_position( FL_OBJECT * ob, float x, float y, int align ) { FLI_XYPLOT_SPEC *sp = ob->spec; sp->key_x = x; sp->key_y = y; sp->key_align = fl_to_outside_lalign( align ); fl_redraw_object( ob ); } /*************************************** ***************************************/ void fl_set_xyplot_keys( FL_OBJECT * ob, char ** keys, float x, float y, int align ) { int i; FLI_XYPLOT_SPEC *sp = ob->spec; for ( i = 0; i <= sp->maxoverlay && keys[ i ]; i++ ) fl_set_xyplot_key( ob, i, keys[ i ] ); fl_set_xyplot_key_position( ob, x, y, align ); } /*************************************** ***************************************/ void fl_set_xyplot_key_font( FL_OBJECT * ob, int style, int size ) { FLI_XYPLOT_SPEC *sp = ob->spec; if ( sp->key_lstyle != style || sp->key_lsize != size ) { sp->key_lstyle = style; sp->key_lsize = size; fl_redraw_object( ob ); } } /*************************************** ***************************************/ int fl_set_xyplot_mark_active( FL_OBJECT * ob, int y ) { FLI_XYPLOT_SPEC *sp = ob->spec; int old = sp->mark_active; if ( old != y ) { sp->mark_active = y; fl_redraw_object( ob ); } return old; } /*************************************** * Function that allows to determine the rectangle into which the data * of the xyplot widget get drawn (when axes are drawn this is also the * rectangle formed by those axes). The first two return arguments are * the coordinates (relative to the object) of the lower left hand corner, * while the other two are those of the upper right hand corner. ***************************************/ void fl_get_xyplot_screen_area( FL_OBJECT * obj, FL_COORD * llx, FL_COORD * lly, FL_COORD * urx, FL_COORD * ury ) { FLI_XYPLOT_SPEC *sp = obj->spec; *llx = sp->xi; *lly = sp->yf; *urx = sp->xf; *ury = sp->yi; } /*************************************** * Function that allows to determine the rectangle into which the data * of the xyplot widget get drawn (when axes are drawn this is also the * rectangle formed by those axes). The first two return arguments are * the coordinates (in "world" units) of the lower left hand corner, * while the other two are those of the upper right hand corner. ***************************************/ void fl_get_xyplot_world_area( FL_OBJECT * obj, float * llx, float * lly, float * urx, float * ury ) { FLI_XYPLOT_SPEC *sp = obj->spec; fl_xyplot_s2w( obj, sp->xi, sp->yf, llx, lly ); fl_xyplot_s2w( obj, sp->xf, sp->yi, urx, ury ); } /*************************************** ***************************************/ int fl_set_xyplot_log_minor_xtics( FL_OBJECT * obj, int yesno ) { FLI_XYPLOT_SPEC *sp = obj->spec; int old_state = sp->log_minor_xtics > 0.5; if ( old_state != yesno ) { sp->log_minor_xtics = yesno ? 1 : 0; fl_redraw_object( obj ); } return old_state; } /*************************************** ***************************************/ int fl_set_xyplot_log_minor_ytics( FL_OBJECT * obj, int yesno ) { FLI_XYPLOT_SPEC *sp = obj->spec; int old_state = sp->log_minor_ytics > 0; if ( old_state != yesno ) { sp->log_minor_ytics = yesno ? 1 : 0; fl_redraw_object( obj ); } return old_state; } /*************************************** * Function allows to set up to which mouse * buttons the xyplot object will react. ***************************************/ void fl_set_xyplot_mouse_buttons( FL_OBJECT * obj, unsigned int mouse_buttons ) { FLI_XYPLOT_SPEC *sp = obj->spec; unsigned int i; for ( i = 0; i < 3; i++, mouse_buttons >>= 1 ) sp->react_to[ i ] = mouse_buttons & 1; } /*************************************** * Function returns a value via 'mouse_buttons', indicating * which mouse buttons the xyplot object will react to. ***************************************/ void fl_get_xyplot_mouse_buttons( FL_OBJECT * obj, unsigned int * mouse_buttons ) { FLI_XYPLOT_SPEC *sp; int i; unsigned int k; if ( ! obj ) { M_err( "fl_get_xyplot_mouse_buttons", "NULL object" ); return; } if ( ! mouse_buttons ) return; sp = obj->spec; *mouse_buttons = 0; for ( i = 0, k = 1; i < 3; i++, k <<= 1 ) *mouse_buttons |= sp->react_to[ i ] ? k : 0; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/version.c0000644000175000017500000000551312251553700012360 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file version.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao * All rights reserved. * * Version info */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "include/forms.h" #include "flinternal.h" #include "private/flsnprintf.h" static const char *version = "(Compiled " __DATE__ ")\n" #ifdef FL_WIN32 "Copyright (c) 1996-2002 by T.C. Zhao, Gang Li and Mark Overmars\n" #else "Copyright (c) 1996-2002 by T.C. Zhao and Mark Overmars\n" #endif "Parts Copyright(c) 1999-2002 by T.C. Zhao and Steve Lamont\n" "GNU Lesser General Public License since 2002"; static const char *fli_fix_level = FL_FIXLEVEL; /*************************************** ***************************************/ int fl_library_version( int * ver, int * rev ) { if ( ver ) *ver = FL_VERSION; if ( rev ) *rev = FL_REVISION; return FL_VERSION * 1000 + FL_REVISION; } /*************************************** ***************************************/ long fl_library_full_version( int * version, int * revision, int * fix_level, const char ** extra ) { long flv; char *x; if ( version ) *version = FL_VERSION; if ( revision ) *revision = FL_REVISION; flv = strtol( fli_fix_level, &x, 10 ); if ( fix_level ) *fix_level = flv; if ( extra ) *extra = x; return FL_VERSION * 1000000 + FL_REVISION * 1000 + flv; } /*************************************** ***************************************/ void fli_print_version( int in_window ) { char *msg = fl_malloc( strlen( version ) + sizeof "FORMS Library Version " + 30 ); sprintf( msg, "FORMS Library Version %d.%d.%s\n%s", FL_VERSION, FL_REVISION, FL_FIXLEVEL, version ); if ( in_window ) fl_show_messages( msg ); else fprintf( stderr, "%s\n", msg ); fl_free( msg ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/listdir.c0000664000175000017500000006047612353623325012364 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file listdir.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao * All rights reserved. * * Read a directory. Hightly system dependent. * Seems opendir/readdir/closedir is the most portable. * * Original BSD scandir is emulated using the opendir stuff. * * This file has no xforms dependencies */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #ifndef _WIN32 #include #else #include #include #include #define FL_WIN32 #endif /* vms 7.0 has dirent.h */ #if defined(__VMS) && __VMS_VER < 70000000 #include "dirent_vms.h" #endif /* Work around the bugs in various cpp */ #if defined Lynx && ! defined __VMS #include #include #endif #if ! defined __VMS && ! defined Lynx && ! defined FL_WIN32 #include #endif #include #include "include/forms.h" /* for definitation of FL_EXPORT */ #include "flinternal.h" #include "local.h" #include "ulib.h" /******** limits and macros *********/ #ifndef S_ISREG #define S_ISREG( m ) ( ( ( m ) & S_IFREG ) == S_IFREG ) #define S_ISDIR( m ) ( ( ( m ) & S_IFDIR ) == S_IFDIR ) #endif #if defined (__EMX__) || defined (FL_WIN32) || defined (opennt) #define S_ISLNK( m ) 0 /* no links in OS/2 */ #define S_ISBLB( m ) 0 /* no blk devices in OS2 */ #else #ifndef S_ISLNK #define S_ISLNK( m ) ( ( ( m ) & S_IFLNK ) == S_IFLNK ) #endif #ifndef S_ISBLK #define S_ISBLK( m ) ( ( ( m ) & S_IFBLK ) == S_IFBLK ) #endif #endif /* __EMX__ */ #ifndef S_ISCHR #define S_ISCHR( m ) ( ( ( m ) & S_IFCHR ) == S_IFCHR ) #endif #ifndef S_ISSOCK # if defined( S_IFSOCK ) # ifdef S_IFMT # define S_ISSOCK( m ) ( ( ( m ) & S_IFMT ) == S_IFSOCK ) # else # define S_ISSOCK( m ) ( ( m ) & S_IFSOCK ) # endif /* S_IFMT */ # elif defined( S_ISNAM ) /* SCO OpenServer 5.0.7 */ # define S_ISSOCK S_ISNAM # endif /* !S_IFSOCK && S_ISNAM */ #endif /* !S_ISSOCK */ #define MAXCACHE 10 /* upto MAXCACHE dir will be cached */ #define MAXFL ( FL_PATH_MAX + FL_FLEN )/* maximum file length */ #ifndef StrReDup #define StrReDup( a, b ) do \ { \ if( a ) \ fl_free( a ); \ a = fl_strdup( b ); \ } while( 0 ) #endif #if defined NEED_DIRECT #define DIRENT direct #else #define DIRENT dirent #endif #if defined NEED_GETCWD #if defined Lynx /*************************************** ***************************************/ char * getcwd( char * a, int b ) { return getwd( a ); } #endif #if defined __VMS #define getcwd( a, b ) getcwd( a, b, 0 ) /* use unix file/path syntax */ #endif #endif #ifdef FL_WIN32 /*************************************** * Convert the backslash to slash ***************************************/ static char * fl_b2f_slash( char *dir ) { char *p = dir; while ( ( p = strchr( p, '\\' ) ) ) *p = '/'; return dir; } #else #define fl_b2f_slash( a ) #endif /************* local variables ****************/ static const char *cpat; /* current pattern */ static const char *cdir; /* current working directory */ static char fname[ MAXFL + 2 ]; #define FL_NONE 0 /******* local function forward dec **********/ static int fli_wildmat( const char *, const char * ); static int tc_sort( const void *, const void * ); static int tc_scandir( const char *, struct DIRENT *** ); static int default_filter( const char *, int ); /* default filter and sort method */ int fli_sort_method = FL_ALPHASORT; static FL_DIRLIST_FILTER ffilter = default_filter; static int filter_directory = 0; /* true to filter directory entries */ /* * convert native file types to FL */ #ifndef FL_WIN32 /* [ */ /*************************************** ***************************************/ static void mode2type( unsigned int mode, int * type ) { if ( S_ISDIR( mode ) ) *type = FT_DIR; else if ( S_ISREG( mode ) ) *type = FT_FILE; else if ( S_ISLNK( mode ) ) *type = FT_LINK; else if ( S_ISSOCK(mode ) ) *type = FT_SOCK; else if ( S_ISFIFO( mode ) ) *type = FT_FIFO; else if ( S_ISCHR( mode ) ) *type = FT_CHR; #if !defined __EMX__ else if ( S_ISBLK( mode ) ) *type = FT_BLK; #endif else *type = FT_OTHER; } /****************************************************************** * Filter the filename before handing it over to the "file is here" * list. Per default only files (including links) are shown. ******************************************************************/ static int fselect( const char * d_name, struct stat * ffstat, int * type ) { int ret = 0; unsigned int mode; strcat( strcpy( fname, cdir), d_name ); stat( fname, ffstat ); mode = ffstat->st_mode; mode2type( mode, type ); if ( ! ffilter ) ret = 1; else if ( ffilter == default_filter ) { /* Always keep directory and links */ ret = S_ISDIR(mode) || ( ( S_ISREG( mode ) || S_ISLNK( mode ) ) && fli_wildmat( d_name, cpat ) ); } else { /* We don't filter directories unless requested */ if ( ! filter_directory ) ret = *type == FT_DIR || ( fli_wildmat( d_name, cpat ) && ffilter( fname, *type ) ); else ret = ( *type == FT_DIR || fli_wildmat( d_name, cpat ) ) && ffilter( fname, *type ); } return ret; } #else /* WIN 32 ][ */ /*************************************** ***************************************/ static int fselect( struct _finddata_t * c_file, FL_Dirlist * dl ) { int type, ret = 0; if ( c_file->attrib & _A_SUBDIR ) type = FT_DIR; else type = FT_FILE; if ( ! ffilter ) ret = 1; else if ( ffilter == default_filter ) /* always keep directory and links */ ret = type == FT_DIR || fli_wildmat( c_file->name, cpat ); else { strcat( strcpy( fname, cdir ), c_file->name ); ret = type == FT_DIR || ( flo_wildmat( c_file->name, cpat ) && ffilter( fname, type ) ); } if ( ret ) { dl->name = fl_strdup( c_file->name ); dl->type = type; dl->dl_mtime = c_file->time_write; dl->dl_size = c_file->size; } return ret; } #endif /* FL_WIN32 ] */ /*************************************** * Sort the directory entries according to the sort method ***************************************/ static int tc_sort( const void * a, const void * b ) { FL_Dirlist *da = ( FL_Dirlist * ) a; FL_Dirlist *db = ( FL_Dirlist * ) b; switch ( fli_sort_method ) { case FL_RALPHASORT: return strcmp( db->name, da->name ); case FL_RCASEALPHASORT: return strcasecmp( db->name, da->name ); case FL_MTIMESORT: return da->dl_mtime - db->dl_mtime; case FL_RMTIMESORT: return db->dl_mtime - da->dl_mtime; case FL_SIZESORT: return da->dl_size > db->dl_size ? 1 : ( da->dl_size == db->dl_size ? 0 : -1 ); case FL_RSIZESORT: return da->dl_size < db->dl_size ? 1 : ( da->dl_size == db->dl_size ? 0 : -1 ); case FL_CASEALPHASORT: return strcasecmp( da->name, db->name ); case FL_ALPHASORT: default: return strcmp( da->name, db->name ); } } /******************************************************************* * On entry, dir must be no zero and be terminated properly, i.e., * ends with / *******************************************************************/ #ifndef FL_WIN32 static int scandir_get_entries( const char * dir, const char * pat, FL_Dirlist ** dirlist ) { static struct DIRENT **dlist; FL_Dirlist *dl; static int lastn; static struct stat ffstat; int n = 0; cpat = pat; cdir = dir; /* Free all memory used last time we were here */ if ( dlist ) { while ( --lastn >= 0 ) if ( dlist[ lastn ] ) fl_free( dlist[ lastn ]); fl_free( dlist ); dlist = NULL; } if ( ( lastn = tc_scandir( dir, &dlist ) ) > 0 ) { int i; dl = *dirlist = fl_malloc( ( lastn + 1 ) * sizeof **dirlist ); for ( i = n = 0; i < lastn; i++ ) { if ( fselect( dlist[ i ]->d_name, &ffstat, &dl->type ) ) { dl->name = fl_strdup( dlist[ i ]->d_name ); dl->dl_mtime = ffstat.st_mtime; dl->dl_size = ffstat.st_size; dl++; n++; } } dl->name = NULL; /* sentinel */ if ( fli_sort_method != FL_NONE ) qsort( *dirlist, n, sizeof **dirlist, tc_sort ); } return n; } #else /* FL_WIN32 */ /*************************************** ***************************************/ static int scandir_get_entries( const char * dir, const char * pat, FL_Dirlist ** dirlist ) { FL_Dirlist *dl; char cwd[ FL_PATH_MAX ]; struct _finddata_t c_file; long hFile; int n, lastn; cpat = pat; cdir = dir; n = 0; /* Save the working directory */ getcwd( cwd, FL_PATH_MAX ); if ( chdir( dir ) != 0 ) /* invalid directory */ return 0; /* Find all files matched the pattern in current directory */ if ( ( hFile = _findfirst( "*", &c_file ) ) == -1L ) { /* Directory is empty, nothing to do */ chdir( cwd ); return 0; } lastn = 10; dl = *dirlist = fl_malloc( ( lastn + 1 ) * sizeof **dirlist ); if ( fselect( &c_file, dl ) ) { dl++; n++; } /* Find the rest of the files */ while ( _findnext( hFile, &c_file ) == 0 ) { if ( fselect( &c_file, dl ) ) { dl++; n++; if ( n > lastn ) { lastn += 10; *dirlist = fl_realloc( *dirlist, ( lastn + 1 ) * sizeof **dirlist ); dl = *dirlist + n; } } } _findclose( hFile ); chdir( cwd ); dl->name = NULL; /* sentinel */ if ( fli_sort_method != FL_NONE ) qsort( *dirlist, n, sizeof **dirlist, tc_sort ); return n; } #endif /* FL_WIN32 */ /******************************************************************** * The user routine. * * Get a list of files in directory, subject to pattern matching, * and return the file list. Rescan will force a read even the requested * directory is cached. * ********************************************************************/ static char *lastdir[ MAXCACHE ], *lastpat[ MAXCACHE ]; static int lastn[ MAXCACHE ], last_sort[ MAXCACHE ]; static FL_Dirlist *dirlist[ MAXCACHE ]; /******************************************************************** * Check if a particular directory is cached ********************************************************************/ static int is_cached( const char * dir, const char * pat, int * c ) { int cached = 0, i = 0; static int lastcache; do { cached = lastpat[ i ] && lastdir[ i ] && strcmp( lastdir[ i ], dir ) == 0 && strcmp( lastpat[ i ], pat ) == 0 && dirlist[ i ] && dirlist[ i ]->name; *c = i++; } while ( ! cached && i < MAXCACHE ); /* search for the least used slot if not cached */ if ( ! cached ) *c = ++lastcache % MAXCACHE; lastcache = *c; M_info( "is_cached", "%s is %s cached", dir, cached ? "" : "not" ); return cached; } /*************************************** ***************************************/ void fl_free_dirlist( FL_Dirlist * dl ) { size_t i; for ( i = 0; i < MAXCACHE; i++ ) if ( dl == dirlist[ i ] ) break; if ( i >= MAXCACHE ) { M_err( "fl_free_dirlist", "Bad list" ); return; } while ( dl && dl->name ) { fl_free( dl->name ); dl->name = NULL; /* important: signifies empty list */ dl++; } if ( dirlist[ i ] ) { fl_free( dirlist[ i ] ); dirlist[ i ] = NULL; } } /********************************************************************** * The user callable routine to read a directory *********************************************************************/ const FL_Dirlist * fl_get_dirlist( const char * dir, const char * pattern, int * n, int rescan ) { int i, c; const char *pat = pattern; char okdir[ FL_PATH_MAX + 1 ]; if ( ! dir || ! *dir ) return NULL; if ( ! pat || ! *pat ) pat = "*"; /* Fix the directory on the fly */ i = strlen( strcpy( okdir, dir ) ); if ( okdir[ i - 1 ] != '/' ) { okdir[ i ] = '/'; okdir[ ++i ] = '\0'; } /* is_cached must go first to get correct cache location */ if ( ! is_cached( okdir, pat, &c ) || rescan ) { fl_free_dirlist( dirlist[ c ] ); lastn[ c ] = scandir_get_entries( okdir, pat, dirlist + c ); last_sort[ c ] = fli_sort_method; StrReDup( lastpat[ c ], pat ); StrReDup( lastdir[ c ], okdir ); } *n = lastn[ c ]; if ( last_sort[ c ] != fli_sort_method ) { qsort( dirlist[ c ], *n, sizeof **dirlist, tc_sort ); last_sort[ c ] = fli_sort_method; } return dirlist[ c ]; } /*********************************************************************** * Misc. routines related to directory handling **********************************************************************/ int fli_is_valid_dir( const char *name ) { struct stat stbuf; #ifdef __EMX__ if ( name && isalpha( ( unsigned char ) name[ 0 ] ) && name[ 1 ] == ':' && name[ 2 ] == '0' ) return 1; #endif /* On some machines name should be a plain char * (why? JTT) */ return name && *name && ! stat( ( char * ) name, &stbuf ) && S_ISDIR( stbuf.st_mode ); } /*************************************** * Fix directory names such as ../../a/b etc ***************************************/ static void add_one( char *, char * ); char * fli_fix_dirname( char * dir ) { static char ldir[ FL_PATH_MAX ], one[ FL_PATH_MAX ]; char *p = ldir, *q = one; fl_b2f_slash( dir ); if ( ! *dir ) /* Here's some bullshit going one, what's ldir set to ? */ return fli_getcwd( dir ? dir : ldir, FL_PATH_MAX - 2 ); else if ( dir[ 0 ] == '.' && dir[ 1 ] == '.' && dir[ 2 ] == '\0' ) { fli_getcwd( dir ? dir : ldir, FL_PATH_MAX - 2 ); if ( ( p = strrchr( dir ? dir : ldir, '/' ) ) ) *p = '\0'; return dir ? dir : ldir; } else if ( *dir == '/') { if ( dir[ 1 ] == '\0' || ( dir[ 1 ] == '.' && dir[ 2 ] == '.' && ( dir[ 3 ] == '/' || dir[ 3 ] == '\0' ) ) ) return strcpy( dir, "/" ); } strcpy( ldir, dir ); p = ldir; #if defined __EMX__ || defined FL_WIN32 if ( isalpha( ( unsigned char ) ldir[ 0 ] ) && ldir[ 1 ] == ':' ) { /* drive letter */ dir[ 0 ] = ldir[ 0 ]; dir[ 1 ] = ldir[ 1 ]; dir[ 2 ] = '\0'; p = ldir + 2; } else #elif defined opennt if ( ldir[ 0 ] == '/' && ldir[ 1 ] == '/' && isalpha( ( unsigned char ) ldir[ 2 ] ) ) { /* //E is E dirver */ dir[ 0 ] = ldir[ 0 ]; dir[ 1 ] = ldir[ 1 ]; dir[ 2 ] = ldir[ 2 ]; dir[ 3 ] = '\0'; p = ldir + 3; } else #endif if ( ldir[ 0 ] != '/' && ldir[ 0 ] != '~' ) fli_getcwd( dir, FL_PATH_MAX - 2 ); else dir[ 0 ] = '\0'; while ( *p ) { #ifdef __EMX__ if ( *p == '/' || *p == '\\' ) { #else if ( *p == '/' ) { #endif *q = '\0'; if ( q > one ) add_one( dir, q = one ); } else *q++ = *p; p++; } *q = '\0'; if ( q > one ) add_one( dir, one ); #if defined __EMX__ || defined FL_WIN32 if ( strlen( dir ) == 2 && dir[ 1 ] == ':' ) { /* fix a single "C:" */ dir[ 2 ] = '/'; dir[ 3 ] = '\0'; } #endif #if defined opennt if ( strlen( dir ) == 3 && dir[ 0 ] == '/' && dir[ 1 ] == '/' && isalpha( ( unsigned char ) ldir[ 2 ] ) ) { /* fix "//C" */ dir[ 3 ] = '/'; dir[ 4 ] = '\0'; } #endif fl_b2f_slash( dir ); return dir; } #ifndef FL_WIN32 #include #endif /*************************************** ***************************************/ static void add_one( char * dir, char * one ) { char *q; if ( one[ 0 ] == '.' && one[ 1] == '.' && one[ 2 ] == '\0' ) { if ( ( q = strrchr( dir, '/' ) ) ) *( q + ( q == dir ) ) = '\0'; #ifndef FL_WIN32 } else if ( one[ 0 ] == '~' ) { if ( one[ 1 ] == '\0' ) { /* must be ~/ ... */ strcat( dir, ( q = getenv( "HOME" ) ) ? q : "/" ); } else { /* must be ~name */ /* Mathod: vms <7.0 has no getpwnam(). Ignore ~name */ #if !defined __VMS || __VMS_VER >= 70000000 struct passwd *p = getpwnam( one + 1 ); strcat( dir, p ? p->pw_dir : "/" ); #ifndef opennt endpwent( ); #endif #endif } #endif /* FL_WIN32 */ } else if ( ! ( one[0] == '.' && one[ 1 ] == '\0' ) ) { strcat( strcat( dir, "/" ), one ); } #ifdef __VMS /* VMS has directory extensions, strip it */ { int n = strlen( dir ); char *p; if ( n > 4 ) { for ( p = dir + n - 4; *p; p++ ) *p = toupper( *p ); if ( strcmp( ( p = dir + n - 4 ), ".DIR" ) == 0 ) *p = '\0'; } } #endif } /* String matching routine is adapted from Rick Salz */ static int match_star( const char * s, const char * p ); /*************************************** * Match string "s" to pattern "p" ***************************************/ static int do_matching( const char * s, const char * p ) { int last, matched, reverse; for ( ; *p; s++, p++ ) { if ( *s == '\0' ) return *p == '*' && *++p == '\0' ? 1 : -1; switch ( *p ) /* parse pattern */ { case '\\': /* Literal match with following character. */ if ( *s != *++p ) return 0; continue; default: /* literal match */ #ifdef __VMS /* vms filenames are not case sensitive */ if ( toupper( *s ) != toupper( *p ) ) #else if ( *s != *p ) #endif return 0; continue; case '?': /* Match anything. */ continue; case '*': /* Trailing star matches everything. */ return *++p ? match_star( s, p ) : 1; case '[': /* [!....] means inverse character class. */ if ( ( reverse = ( p[ 1 ] == '!' ) ) ) p++; for ( last = 0400, matched = 0; *++p && *p != ']'; last = *p ) if ( ( *p == '-' && *s <= *++p && *s >= last ) || ( *p != '-' && *s == *p ) ) matched = 1; if ( matched == reverse ) return 0; continue; } } return *s == '\0'; } /*************************************** ***************************************/ static int match_star( const char * s, const char * p ) { int result; while ( ( result = do_matching( s, p ) ) == 0 ) /* gobble up * match */ if ( *++s == '\0' ) return -1; return result; } /*************************************** * check if s matches pattern p ***************************************/ static int fli_wildmat( const char * s, const char * p ) { if ( *p == '\0' && *s != '.' ) return 1; else if ( *p == '\0' ) return 0; else if ( ( *p == '?' || *p == '*' ) && *s == '.' ) return 0; else return do_matching( s, p ) == 1; } /*************************************** * scandir emulation ***************************************/ #ifndef FL_WIN32 static int tc_scandir( const char * dirname, struct DIRENT *** namelist ) { DIR *dir; struct DIRENT *dentry, **head = NULL; int n = 0, total; static int dname_is_1; if ( ! ( dir = opendir( dirname ) ) ) return -1; if ( sizeof( struct DIRENT ) < 100 && ! dname_is_1 ) { M_warn("tc_scandir", "Bad dirent -- will fix it on the fly" ); dname_is_1 = 1; } /* Start reading the darn thing */ for ( n = 0; ( dentry = readdir( dir ) ) != NULL; n++ ) { head = fl_realloc( head, ( n + 1 ) * sizeof *head ); /* Here it is even weirder: some systems have d_reclen = sizeof(struct dirent) + strlen(d_name) and some have it as d_reclen = strlen(d_name) */ /* Mathog, VMS<7.0, at least has no d_reclen *at all */ #if defined __VMS && __VMS_VER < 70000000 || defined opennt || defined __CYGWIN__ total = dname_is_1 ? strlen( dentry->d_name ) : sizeof *dentry; #else total = dname_is_1 ? dentry->d_reclen : sizeof *dentry; #endif memcpy( head[ n ] = fl_malloc( total ), dentry, total ); } closedir( dir ); *namelist = head; return n; } #endif /* ! FL_WIN32 */ /*************************************** ***************************************/ FL_DIRLIST_FILTER fl_set_dirlist_filter( FL_DIRLIST_FILTER filter ) { FL_DIRLIST_FILTER old = ffilter; ffilter = filter; return old; } /*************************************** ***************************************/ int fl_set_dirlist_filterdir( int yes ) { int old = filter_directory; filter_directory = yes; return old; } /*************************************** * for application's benifit ***************************************/ static int default_filter( const char * name FL_UNUSED_ARG, int type ) { return type == FT_FILE || type == FT_DIR || type == FT_LINK; } /*************************************** ***************************************/ int fl_set_dirlist_sort( int method ) { int old = fli_sort_method; fli_sort_method = method; return old; } #ifdef __VMS #include "vms_readdir.c" #endif /*************************************** ***************************************/ char * fli_getcwd( char * buf, int len ) { #ifdef FL_WIN32 return fl_b2f_slash( getcwd( buf, len ) ); #else return getcwd( buf, len ); #endif } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/Makefile.am0000664000175000017500000000342112353623325012565 00000000000000include $(top_srcdir)/config/common.am if USE_BWC_BS_HACK BWC = -DUSE_BWC_BS_HACK else BWC = endif CLEANFILES = forms.h xforms.5 EXTRA_DIST = xforms.man dirent_vms.h vms_readdir.c SUBDIRS = bitmaps fd include private INCLUDES = -DMAKING_FORMS $(X_CFLAGS) $(BWC) lib_LTLIBRARIES = libforms.la libforms_la_LDFLAGS = -no-undefined -version-info @SO_VERSION@ libforms_la_LIBADD = $(X_LIBS) $(XPM_LIB) -lX11 nodist_libforms_la_SOURCES = config.h man_MANS = xforms.5 xforms.5: cp -p ./xforms.man xforms.5 libforms_la_SOURCES = \ align.c \ appwin.c \ asyn_io.c \ bitmap.c \ box.c \ browser.c \ button.c \ canvas.c \ chart.c \ checkbut.c \ child.c \ choice.c \ clipboard.c \ clock.c \ cmd_br.c \ colsel.c \ combo.c \ counter.c \ cursor.c \ dial.c \ display.c \ dmalloc.h \ errmsg.c \ events.c \ extern.h \ flcolor.c \ fldraw.c \ flinternal.h \ flsnprintf.c \ flresource.c \ flvisual.c \ fonts.c \ formbrowser.c \ forms.c \ frame.c \ free.c \ fselect.c \ global.c \ goodie_alert.c \ goodie_choice.c \ goodie_input.c \ goodie_msg.c \ goodies.c \ goodie_sinput.c \ goodie_yesno.c \ goodie_colchooser.c \ handling.c \ input.c \ interpol.c \ keyboard.c \ labelbut.c \ lframe.c \ lightbut.c \ listdir.c \ local.h \ menu.c \ nmenu.c \ objects.c \ oneliner.c \ pixmap.c \ popup.c \ positioner.c \ read2lsbf.c \ read2msbf.c \ read4lsb.c \ read4msb.c \ readint.c \ round3d.c \ roundbut.c \ scrollbar.c \ scrollbut.c \ select.c \ signal.c \ sldraw.c \ slider.c \ space.c \ spinner.c \ strdup.c \ symbols.c \ sysdep.c \ tabfolder.c \ tbox.c \ text.c \ thumbwheel.c \ timeout.c \ timer.c \ tooltip.c \ ulib.h \ util.c \ valuator.c \ version.c \ vn_pair.c \ win.c \ xdraw.c \ xpopup.c \ xsupport.c \ xtext.c \ xyplot.c xforms-1.2.4/lib/align.c0000664000175000017500000002027412251554356012000 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file align.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * Handles align requests */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" /*************************************** ***************************************/ int fli_test_lalign( int align, const char * txt ) { if ( align < 0 || ( ( unsigned int ) align & ~ FL_ALIGN_INSIDE ) > FL_ALIGN_RIGHT_BOTTOM ) { M_err( txt, "Invalid value for align" ); return 0; } return 1; } /*************************************** ***************************************/ int fl_is_inside_lalign( int align ) { return fli_test_lalign( align, "fl_is_inside_lalign" ) && ( ( unsigned int ) align & FL_ALIGN_INSIDE || align == FL_ALIGN_CENTER ); } /*************************************** ***************************************/ int fl_is_outside_lalign( int align ) { return fli_test_lalign( align, "fl_is_outside_lalign" ) && ! fl_is_inside_lalign( align ); } /*************************************** ***************************************/ int fl_is_center_lalign( int align ) { return fli_test_lalign( align, "fl_is_center_lalign" ) && ( ( unsigned int ) align & ~ FL_ALIGN_INSIDE ) == FL_ALIGN_CENTER; } /*************************************** ***************************************/ int fl_to_inside_lalign( int align ) { if ( ! fli_test_lalign( align, "fl_to_inside_lalign" ) ) return -1; return fl_is_center_lalign( align ) ? FL_ALIGN_CENTER : ( ( unsigned int ) align | FL_ALIGN_INSIDE ); } /*************************************** ***************************************/ int fl_to_outside_lalign( int align ) { if ( ! fli_test_lalign( align, "fl_to_inside_lalign" ) ) return -1; return fl_is_center_lalign( align ) ? FL_ALIGN_CENTER : ( ( unsigned int ) align & ~FL_ALIGN_INSIDE ); } /*************************************** ***************************************/ void fli_get_hv_align( int align, int * halign, int * valign ) { align = fl_to_outside_lalign( align ); switch ( align ) { case FL_ALIGN_LEFT : *halign = FL_ALIGN_LEFT; *valign = FL_ALIGN_CENTER; break; case FL_ALIGN_RIGHT : *halign = FL_ALIGN_RIGHT; *valign = FL_ALIGN_CENTER; break; case FL_ALIGN_CENTER : *halign = FL_ALIGN_CENTER; *valign = FL_ALIGN_CENTER; break; case FL_ALIGN_TOP : *halign = FL_ALIGN_CENTER; *valign = FL_ALIGN_TOP; break; case FL_ALIGN_BOTTOM : *halign = FL_ALIGN_CENTER; *valign = FL_ALIGN_BOTTOM; break; case FL_ALIGN_LEFT_BOTTOM : *halign = FL_ALIGN_LEFT; *valign = FL_ALIGN_BOTTOM; break; case FL_ALIGN_RIGHT_BOTTOM : *halign = FL_ALIGN_RIGHT; *valign = FL_ALIGN_BOTTOM; break; case FL_ALIGN_LEFT_TOP : *halign = FL_ALIGN_LEFT; *valign = FL_ALIGN_TOP; break; case FL_ALIGN_RIGHT_TOP : *halign = FL_ALIGN_RIGHT; *valign = FL_ALIGN_TOP; break; default : M_err( "fli_get_hv_align", "Bad request: %d\n", align ); *halign = FL_ALIGN_CENTER; *valign = FL_ALIGN_CENTER; break; } } /*************************************** ***************************************/ void fli_get_outside_align( int align, int x, int y, int w, int h, int * new_align, int * newx, int * newy ) { *newx = x; *newy = y; *new_align = FL_ALIGN_CENTER; align = fl_to_outside_lalign( align ); switch ( align ) { case FL_ALIGN_LEFT : *new_align = FL_ALIGN_RIGHT; *newx = x - w; break; case FL_ALIGN_RIGHT : *new_align = FL_ALIGN_LEFT; *newx = x + w; break; case FL_ALIGN_TOP : *new_align = FL_ALIGN_BOTTOM; *newy = y - h; break; case FL_ALIGN_BOTTOM : *new_align = FL_ALIGN_TOP; *newy = y + h; break; case FL_ALIGN_LEFT_TOP : *new_align = FL_ALIGN_LEFT_BOTTOM; *newy = y - h; break; case FL_ALIGN_RIGHT_TOP : *new_align = FL_ALIGN_RIGHT_BOTTOM; *newy = y - h; break; case FL_ALIGN_LEFT_BOTTOM : *new_align = FL_ALIGN_LEFT_TOP; *newy = y + h; break; case FL_ALIGN_RIGHT_BOTTOM : *new_align = FL_ALIGN_RIGHT_TOP; *newy = y + h; break; } } /*************************************** ***************************************/ static void get_align_inside( int align, int x, int y, int w, int h, int xsize, int ysize, int xoff, int yoff, int * xx, int * yy ) { int hor, vert; fli_get_hv_align( align, &hor, &vert ); x += xoff; y += yoff; w -= 2 * xoff; h -= 2 * yoff; switch ( hor ) { case FL_ALIGN_LEFT : *xx = x; break; case FL_ALIGN_RIGHT : *xx = x + w - xsize; break; case FL_ALIGN_CENTER : default: *xx = x + ( w - xsize ) / 2; break; } switch ( vert ) { case FL_ALIGN_TOP : *yy = y; break; case FL_ALIGN_BOTTOM : *yy = y + h - ysize; break; case FL_ALIGN_CENTER : default : *yy = y + ( h - ysize ) / 2; break; } } /*************************************** ***************************************/ static void get_align_outside( int align, int x, int y, int w, int h, int xsize, int ysize, int xoff, int yoff, int * xx, int * yy ) { int newx, newy, new_align; fli_get_outside_align( align, x, y, w, h, &new_align, &newx, &newy ); get_align_inside( new_align, newx, newy, w, h, xsize, ysize, xoff, yoff, xx, yy ); } /*************************************** ***************************************/ void fl_get_align_xy( int align, int x, int y, int w, int h, int xsize, int ysize, int xoff, int yoff, int * xx, int * yy ) { ( fl_is_inside_lalign( align ) ? get_align_inside : get_align_outside ) ( align, x, y, w, h, xsize, ysize, xoff, yoff, xx, yy ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/tabfolder.c0000664000175000017500000007634612342657252012663 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file tabfolder.c * * This file is part of the XForms library package. * Copyright (c) 1997-2002 By T.C. Zhao * All rights reserved. * * tabbed folder */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "private/flvasprintf.h" typedef struct { FL_OBJECT * canvas; FL_OBJECT * parent; /* the tabfolder object */ FL_FORM ** forms; /* the folders */ FL_OBJECT ** title; /* the associted tab */ int nforms; /* number of folders */ int active_folder; /* current active folder */ int last_active; /* the previous active folder */ int x, y; int max_h; int h_pad, v_pad; int processing_destroy; int auto_fit; int offset; int num_visible; } FLI_TABFOLDER_SPEC; static void compute_position( FL_OBJECT * ); static void switch_folder( FL_OBJECT *, long ); static void program_switch( FL_OBJECT *, int ); static void get_tabsize( FL_OBJECT *, const char *, int *, int *, int ); static void shift_tabs( FL_OBJECT *, int left ); #define IsFolderClass( ob ) ( ( ob ) && ( ob )->objclass == FL_TABFOLDER ) /*************************************** ***************************************/ static int handle_tabfolder( FL_OBJECT * ob, int event, FL_Coord mx FL_UNUSED_ARG, FL_Coord my FL_UNUSED_ARG, int key FL_UNUSED_ARG, void * ev ) { FL_FORM *folder; FLI_TABFOLDER_SPEC *sp = ob->spec; switch ( event ) { case FL_RESIZED: if ( ( folder = fl_get_active_folder( ob ) ) && sp->auto_fit != FL_NO ) { if ( sp->auto_fit == FL_FIT ) fl_set_form_size( folder, sp->canvas->w, sp->canvas->h ); else if ( folder->w < sp->canvas->w || folder->h < sp->canvas->h ) fl_set_form_size( folder, sp->canvas->w, sp->canvas->h ); } break; case FL_MOVEORIGIN: if ( ( folder = fl_get_active_folder( ob ) ) ) { fl_get_winorigin( folder->window, &folder->x, &folder->y ); /* Don't forget nested folders */ fli_handle_form( folder, FL_MOVEORIGIN, 0, ev ); } break; case FL_DRAW: fl_set_object_boxtype( sp->canvas, fli_boxtype2frametype( ob->boxtype ) ); sp->processing_destroy = 0; compute_position( ob ); break; case FL_FREEMEM: fli_safe_free( sp->forms ); fli_safe_free( sp->title ); fl_free( sp ); break; } return 0; } /*************************************** * Canvas expose handler. ***************************************/ static int canvas_handler( FL_OBJECT * ob, Window win FL_UNUSED_ARG, int w FL_UNUSED_ARG, int h FL_UNUSED_ARG, XEvent * ev FL_UNUSED_ARG, void * data FL_UNUSED_ARG ) { FLI_TABFOLDER_SPEC *sp = ob->u_vdata; /* sp->nforms can be zero */ if ( sp->nforms == 0 || sp->active_folder >= sp->nforms ) return 0; if ( sp->active_folder >= 0 ) /* regular exposure, not first time */ program_switch( sp->title[ sp->active_folder ], sp->active_folder ); else if ( sp->last_active >= 0 && sp->last_active < sp->nforms ) program_switch( sp->title[ sp->last_active ], sp->last_active ); return 0; } /*************************************** * Before canvas is destroyed this routine will be called where * we need to close the form that is attached to this canvas ***************************************/ static int canvas_cleanup( FL_OBJECT * ob ) { FLI_TABFOLDER_SPEC *sp = ob->u_vdata; if ( sp->active_folder >= 0 && sp->active_folder < sp->nforms ) { sp->processing_destroy = 1; if ( sp->forms[ sp->active_folder ]->visible == FL_VISIBLE ) fl_hide_form( sp->forms[ sp->active_folder ] ); sp->last_active = sp->active_folder; if ( sp->active_folder >= 0 ) fl_set_object_boxtype( sp->title[ sp->active_folder ], ob->parent->type != FL_BOTTOM_TABFOLDER ? FL_TOPTAB_UPBOX : FL_BOTTOMTAB_UPBOX ); sp->active_folder = -1; } return 0; } /*************************************** * For all the folders set a dummy form callback to prevent * the contained objects from leaking thru to fl_do_forms ***************************************/ static void form_cb( FL_OBJECT * ob FL_UNUSED_ARG, void * data FL_UNUSED_ARG ) { } /*************************************** ***************************************/ FL_OBJECT * fl_create_tabfolder( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label ) { FL_OBJECT *ob; FLI_TABFOLDER_SPEC *sp; int absbw, oldu = fl_get_coordunit( );; ob = fl_make_object( FL_TABFOLDER, type, x, y, w, h, label, handle_tabfolder ); fl_set_coordunit( FL_COORD_PIXEL ); ob->boxtype = FL_UP_BOX; ob->spec = sp = fl_calloc( 1, sizeof *sp ); absbw = FL_abs( ob->bw ); sp->parent = ob; sp->forms = NULL; sp->title = NULL; sp->x = ob->x + absbw; sp->y = ob->y + absbw; sp->h_pad = 12; sp->v_pad = 5; sp->auto_fit = FL_NO; sp->canvas = fl_create_canvas( FL_SCROLLED_CANVAS, sp->x, sp->y, ob->w - 2 * absbw, ob->h - 2 * absbw, label ? label : "tab" ); sp->canvas->u_vdata = sp; fl_modify_canvas_prop( sp->canvas, 0, 0, canvas_cleanup ); fl_set_object_boxtype( sp->canvas, fli_boxtype2frametype( ob->boxtype ) ); fl_add_canvas_handler( sp->canvas, Expose, canvas_handler, 0 ); fl_set_object_color( sp->canvas, ob->col1, ob->col2 ); fl_set_object_bw( sp->canvas, ob->bw ); fl_set_object_gravity( sp->canvas, ob->nwgravity, ob->segravity ); fl_set_coordunit( oldu ); fl_add_child( ob, sp->canvas ); fl_set_object_return( ob, FL_RETURN_END_CHANGED ); return ob; } /*************************************** ***************************************/ FL_OBJECT * fl_add_tabfolder( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * l ) { FL_OBJECT *obj = fl_create_tabfolder( type, x, y, w, h, l ); /* Set the default return policy for the object */ fl_add_object( fl_current_form, obj ); return obj; } /*************************************** ***************************************/ void fli_detach_form( FL_FORM * form ) { form->attached = 0; if ( form->parent && form->parent->child == form ) form->parent->child = 0; form->parent = NULL; } /*************************************** ***************************************/ int fl_get_tabfolder_numfolders( FL_OBJECT * ob ) { return ( ( FLI_TABFOLDER_SPEC * ) ob->spec )->nforms; } /*************************************** * Tab is switched by the application, no need to invoke the callback * or report back to the user ***************************************/ static void program_switch( FL_OBJECT * obj, int folder ) { FLI_TABFOLDER_SPEC *sp; if ( folder >= 0 ) { sp = obj->u_vdata; switch_folder( obj, folder ); obj->parent->returned = FL_RETURN_NONE; /* This handles set_folder while hidden */ if ( ! obj->visible || ! obj->form->visible == FL_VISIBLE ) sp->last_active = folder; } } /*************************************** ***************************************/ static void switch_folder( FL_OBJECT * ob, long data ) { FLI_TABFOLDER_SPEC *sp = ob->u_vdata; FL_FORM *form; Window win; FL_OBJECT *bkob; if ( data < 0 || data >= sp->nforms ) { M_err( "switch_folder", "Invalid index"); return; } form = sp->forms[ data ]; if ( data == sp->active_folder && sp->active_folder >= 0 && ! sp->processing_destroy && ( ob->parent->how_return == FL_RETURN_ALWAYS || ob->parent->how_return == FL_RETURN_END ) ) { ob->parent->returned |= FL_RETURN_END; #if USE_BWC_BS_HACK if ( ! ob->parent->object_callback ) ob->parent->returned &= ~ FL_RETURN_END; #endif } if ( data == sp->active_folder || sp->processing_destroy ) { sp->processing_destroy = 0; return; } if ( ! ob->form->window || ! FL_ObjWin( sp->canvas ) ) return; if ( sp->auto_fit != FL_NO ) { if ( sp->auto_fit == FL_FIT ) fl_set_form_size( form, sp->canvas->w, sp->canvas->h ); else if ( form->w < sp->canvas->w || form->h < sp->canvas->h ) fl_set_form_size( form, sp->canvas->w, sp->canvas->h ); } /* We may have more tabs than can be shown */ if ( sp->num_visible < sp->nforms - 1 || sp->offset ) { if ( ( data && data == sp->offset ) || data > sp->num_visible ) { int last; shift_tabs( ob, data == sp->offset ? -1 : 1 ); sp->title[ data ]->boxtype &= ~ FLI_BROKEN_BOX; sp->title[ data ]->align = FL_ALIGN_CENTER; last = sp->num_visible + sp->offset + 1; last = FL_clamp( last, 0, sp->nforms - 1 ); sp->title[ last ]->boxtype |= FLI_BROKEN_BOX; sp->title[ last ]->align = fl_to_inside_lalign( FL_ALIGN_LEFT ); fl_redraw_form( ob->form ); } } win = fl_prepare_form_window( form, 0, FL_NOBORDER, "Folder" ); /* win reparent eats the reparent event */ fl_winreparent( win, FL_ObjWin( sp->canvas ) ); form->parent_obj = ob; fl_show_form_window( form ); /* Need to redraw the last selected folder tab */ if ( sp->active_folder >= 0 && sp->forms[ sp->active_folder ]->visible == FL_VISIBLE ) { FL_OBJECT *actobj; actobj = sp->title[ sp->active_folder ]; actobj->col1 = sp->parent->col1; fl_set_object_boxtype( actobj, ob->parent->type != FL_BOTTOM_TABFOLDER ? FL_TOPTAB_UPBOX : FL_BOTTOMTAB_UPBOX ); fl_draw_frame( FL_UP_FRAME, sp->canvas->x, sp->canvas->y, sp->canvas->w, sp->canvas->h, sp->canvas->col1, sp->canvas->bw ); fl_hide_form( sp->forms[ sp->active_folder ] ); sp->forms[ sp->active_folder ]->parent_obj = NULL; sp->last_active = sp->active_folder; } form->parent = ob->form; ob->form->child = form; /* Find out the color of the new form */ if ( ( bkob = form->first ) && bkob->type == FL_NO_BOX ) bkob = bkob->next; if ( bkob ) fl_set_object_color( ob, bkob->col1, ob->col2 ); fl_set_object_boxtype( ob, ob->parent->type != FL_BOTTOM_TABFOLDER ? FL_SELECTED_TOPTAB_UPBOX : FL_SELECTED_BOTTOMTAB_UPBOX ); if ( sp->active_folder >= 0 ) { ob->parent->returned = FL_RETURN_END | FL_RETURN_CHANGED; #if USE_BWC_BS_HACK if ( ! ob->parent->object_callback ) ob->parent->returned &= ~ ( FL_RETURN_END | FL_RETURN_CHANGED ); #endif } sp->active_folder = data; } /*************************************** * Add a new folder to the bunch ***************************************/ FL_OBJECT * fl_addto_tabfolder( FL_OBJECT * ob, const char * title, FL_FORM * form ) { FLI_TABFOLDER_SPEC *sp = ob->spec; FL_OBJECT *tab; if ( ! IsFolderClass( ob ) ) { M_err( "fl_addto_tabfolder", "%s not a folder class", ob ? ob->label : "null" ); return 0; } if ( ! form || ! title ) { M_err( "fl_addto_tabfolder", "Invalid argument(s)" ); return 0; } if ( form->attached ) { M_err( "fl_addto_tabfolder", "Seems as if the form is already attached" ); return 0; } if ( form->visible == FL_VISIBLE ) fl_hide_form( form ); sp->forms = fl_realloc( sp->forms, ( sp->nforms + 1 ) * sizeof *sp->forms ); sp->title = fl_realloc( sp->title, ( sp->nforms + 1 ) * sizeof *sp->title ); /* Plug the possible object leakage thru fl_do_forms */ if ( ! form->form_callback ) fl_set_form_callback( form, form_cb, NULL ); sp->forms[ sp->nforms ] = form; form->attached = 1; if ( form->pre_attach ) form->pre_attach( form ); tab = sp->title[ sp->nforms ] = fl_create_button( FL_NORMAL_BUTTON, 0, 0, 10, 10, title ); fli_inherit_attributes( ob, tab ); fl_set_object_boxtype( tab, ob->type != FL_BOTTOM_TABFOLDER ? FL_TOPTAB_UPBOX : FL_BOTTOMTAB_UPBOX ); tab->u_vdata = sp; fl_set_object_callback( tab, switch_folder, sp->nforms ); sp->nforms++; compute_position( ob ); fl_add_child( ob, tab ); tab->how_return = FL_RETURN_CHANGED; if ( sp->nforms == 1 ) { sp->last_active = 0; sp->active_folder = -1; program_switch( sp->title[ sp->last_active ], sp->last_active ); } /* If first time and the canvas is visible, refresh */ if ( sp->nforms == 1 && ob->visible ) fl_redraw_form( ob->form ); return tab; } /*************************************** ***************************************/ static void get_tabsize( FL_OBJECT * ob, const char * label, int * ww, int * hh, int fudge ) { int w, h, absbw = FL_abs( ob->bw ); FLI_TABFOLDER_SPEC *sp = ob->spec; fl_get_string_dimension( ob->lstyle, ob->lsize, label, strlen( label ), &w, &h ); w += sp->h_pad + 2 * absbw; h += sp->v_pad + 2 * absbw; *hh = h + fudge * absbw; *ww = w; return; } /*************************************** ***************************************/ void fl_delete_folder_byname( FL_OBJECT * ob, const char * name ) { FLI_TABFOLDER_SPEC *sp = ob->spec; int i, done; for ( done = i = 0; ! done && i < sp->nforms; i++ ) if ( ! strcmp( sp->title[ i ]->label, name ) ) done = i + 1; if ( done ) fl_delete_folder_bynumber( ob, done ); } /*************************************** ***************************************/ void fl_delete_folder_byname_f( FL_OBJECT * ob, const char * fmt, ... ) { char *buf; EXPAND_FORMAT_STRING( buf, fmt ); fl_delete_folder_byname( ob, buf ); fl_free( buf ); } /*************************************** ***************************************/ void fl_delete_folder_bynumber( FL_OBJECT * ob, int num ) { int i = num - 1; FLI_TABFOLDER_SPEC *sp = ob->spec; FL_OBJECT *deleted = NULL; FL_FORM *theform = NULL; if ( i >= 0 && i < sp->nforms ) { int j; deleted = sp->title[ i ]; fli_detach_form( theform = sp->forms[ i ] ); for ( j = i + 1; j < sp->nforms; j++ ) { sp->title[ j - 1 ] = sp->title[ j ]; sp->title[ j - 1 ]->argument = j - 1; sp->forms[ j - 1 ] = sp->forms[ j ]; } sp->nforms--; sp->forms = fl_realloc( sp->forms, sp->nforms * sizeof *sp->forms ); sp->title = fl_realloc( sp->title, sp->nforms * sizeof *sp->title ); } if ( deleted ) { fli_set_object_visibility( deleted, FL_INVISIBLE ); if ( theform->form_callback == form_cb ) theform->form_callback = NULL; if ( theform->visible == FL_VISIBLE ) fl_hide_form( theform ); /* Change active folder if need to */ sp->last_active = -1; if ( i < sp->active_folder ) sp->active_folder--; else if ( i == sp->active_folder ) { sp->active_folder = -1; fl_set_folder_bynumber( ob, i ); } fl_free_object( deleted ); fl_redraw_form( ob->form ); } } /*************************************** ***************************************/ FL_FORM * fl_get_tabfolder_folder_bynumber( FL_OBJECT * ob, int num ) { FLI_TABFOLDER_SPEC *sp = ob->spec; int i = num - 1; return ( i >= 0 && i < sp->nforms ) ? sp->forms[ i ] : NULL; } /*************************************** ***************************************/ FL_FORM * fl_get_tabfolder_folder_byname( FL_OBJECT * ob, const char * name ) { int i; FLI_TABFOLDER_SPEC *sp = ob->spec; for ( i = 0; i < sp->nforms; i++ ) if ( strcmp( sp->title[ i ]->label, name ) == 0 ) return fl_get_tabfolder_folder_bynumber( ob, i + 1 ); return NULL; } /*************************************** ***************************************/ FL_FORM * fl_get_tabfolder_folder_byname_f( FL_OBJECT * ob, const char * fmt, ...) { FL_FORM *f; char *buf; EXPAND_FORMAT_STRING( buf, fmt ); f = fl_get_tabfolder_folder_byname( ob, buf ); fl_free( buf ); return f; } /*************************************** ***************************************/ void fl_delete_folder( FL_OBJECT * ob, FL_FORM * form ) { int i, done; FLI_TABFOLDER_SPEC *sp = ob->spec; for ( done = i = 0; ! done && i < sp->nforms; i++ ) if ( form == sp->forms[ i ] ) done = i + 1; if ( done ) fl_delete_folder_bynumber( ob, done ); } /*************************************** ***************************************/ void fl_set_folder( FL_OBJECT * ob, FL_FORM * form ) { FLI_TABFOLDER_SPEC *sp; int i, done; if ( ! IsFolderClass( ob ) ) { M_err( "fl_set_folder", "%s is not tabfolder", ob ? ob->label : "null" ); return; } sp = ob->spec; for ( done = i = 0; ! done && i < sp->nforms; i++ ) if ( sp->forms[ i ] == form ) { program_switch( sp->title[ i ], i ); done = 1; } } /*************************************** ***************************************/ void fl_set_folder_byname( FL_OBJECT * ob, const char * name ) { FLI_TABFOLDER_SPEC *sp; int i, done; if ( ! IsFolderClass( ob ) ) { M_err( "fl_set_folder_byname", "%s is not tabfolder", ob ? ob->label : "null" ); return; } sp = ob->spec; for ( done = i = 0; ! done && i < sp->nforms; i++ ) if ( strcmp( sp->title[ i ]->label, name ) == 0 ) { program_switch( sp->title[ i ], i ); done = 1; } } /*************************************** ***************************************/ void fl_set_folder_byname_f( FL_OBJECT * ob, const char * fmt, ... ) { char *buf; EXPAND_FORMAT_STRING( buf, fmt ); fl_set_folder_byname( ob, buf ); fl_free( buf ); } /*************************************** ***************************************/ void fl_set_folder_bynumber( FL_OBJECT * ob, int num ) { FLI_TABFOLDER_SPEC *sp; int i = num - 1; if ( ! IsFolderClass( ob ) ) { M_err( "fl_set_folder_bynumber", "%s is not tabfolder", ob ? ob->label : "null" ); return; } sp = ob->spec; if ( i >= 0 && i < sp->nforms ) program_switch( sp->title[ i ], i ); } /*************************************** * Keep tab but replace the folder content ***************************************/ void fl_replace_folder_bynumber( FL_OBJECT * ob, int num, FL_FORM * form ) { FLI_TABFOLDER_SPEC *sp = ob->spec; int i = num - 1; if ( i >= 0 && i < sp->nforms && sp->forms[ i ] != form ) { sp->forms[ i ] = form; if ( i == sp->active_folder ) { sp->active_folder = -1; program_switch( sp->title[ i ], i ); } } } /*************************************** ***************************************/ int fl_get_folder_number( FL_OBJECT * ob ) { if ( ! IsFolderClass( ob ) ) { M_err( "fl_get_folder_number", "%s is not tabfolder", ob ? ob->label : "null" ); return 0; } return ( ( FLI_TABFOLDER_SPEC * ) ob->spec )->last_active + 1; } /*************************************** ***************************************/ int fl_get_active_folder_number( FL_OBJECT * ob ) { if ( ! IsFolderClass( ob ) ) { M_err( "fl_get_active_folder_number", "%s is not tabfolder", ob ? ob->label : "null" ); return 0; } return ( ( FLI_TABFOLDER_SPEC * ) ob->spec )->active_folder + 1; } /*************************************** ***************************************/ FL_FORM * fl_get_folder( FL_OBJECT * ob ) { FLI_TABFOLDER_SPEC *sp; if ( ! IsFolderClass( ob ) ) { M_err( "fl_get_folder", "%s is not tabfolder", ob ? ob->label : "null" ); return NULL; } sp = ob->spec; return sp->last_active >= 0 ? sp->forms[ sp->last_active ] : NULL; } /*************************************** ***************************************/ const char * fl_get_folder_name( FL_OBJECT * ob ) { FLI_TABFOLDER_SPEC *sp; if ( ! IsFolderClass( ob ) ) { M_err( "fl_get_folder_name", "%s is not tabfolder", ob ? ob->label : "null" ); return NULL; } sp = ob->spec; return sp->last_active >= 0 ? sp->title[ sp->last_active ]->label : NULL; } /*************************************** ***************************************/ FL_FORM * fl_get_active_folder( FL_OBJECT * ob ) { FLI_TABFOLDER_SPEC *sp; if ( ! IsFolderClass( ob ) ) { M_err( "fl_get_active_folder", "%s is not tabfolder", ob ? ob->label : "null" ); return NULL; } sp = ob->spec; return ( sp->forms && sp->active_folder >= 0 ) ? sp->forms[ sp->active_folder ] : NULL; } /*************************************** ***************************************/ const char * fl_get_active_folder_name( FL_OBJECT * ob ) { FLI_TABFOLDER_SPEC *sp; if ( ! IsFolderClass( ob ) ) { M_err( "fl_get_active_folder_name", "%s is not tabfolder", ob ? ob->label : "null" ); return NULL; } sp = ob->spec; return sp->active_folder >= 0 ? sp->title[ sp->active_folder ]->label : NULL; } /*************************************** ***************************************/ void fl_get_folder_area( FL_OBJECT * ob, FL_Coord * x, FL_Coord * y, FL_Coord * w, FL_Coord * h ) { FLI_TABFOLDER_SPEC *sp = ob->spec; compute_position( ob ); *x = sp->canvas->x; *y = sp->canvas->y; *w = sp->canvas->w; *h = sp->canvas->h; } /*************************************** ***************************************/ int fl_get_tabfolder_offset( FL_OBJECT * obj ) { return ( ( FLI_TABFOLDER_SPEC * ) obj->spec )->offset; } /*************************************** ***************************************/ int fl_set_tabfolder_offset( FL_OBJECT * obj, int offset ) { FLI_TABFOLDER_SPEC *sp = obj->spec; int old = sp->offset; if ( offset < 0 ) offset = 0; else if ( offset + sp->num_visible + 1 > sp->nforms - 1 ) offset = sp->nforms - sp->num_visible; if ( offset != sp->offset ) { shift_tabs( obj, offset - sp->offset ); fl_redraw_form( obj->form ); } return old; } /*************************************** * Compute the position and propagate the parent attributes ***************************************/ static void compute_top_position( FL_OBJECT * ob ) { FLI_TABFOLDER_SPEC *sp ; FL_OBJECT *tab; int i, max_h = 4; sp = ob->objclass == FL_TABFOLDER ? ob->spec : ob->u_vdata; sp->y = ob->y + 1; sp->x = sp->canvas->x - FL_abs( sp->canvas->bw ); for ( i = 0; i < sp->offset; i++ ) sp->title[ i ]->x = 2000; /* This gets the fl_get_folder_area() right (single line tab) - even if empty folder */ if ( sp->nforms == 0 ) { int junk; get_tabsize( ob, "AjbY", &junk, &max_h, 1 ); } for ( i = sp->offset; i < sp->nforms; i++ ) { tab = sp->title[ i ]; get_tabsize( ob, tab->label, &tab->w, &tab->h, 1 ); if ( tab->h > max_h ) max_h = tab->h; tab->x = sp->x; tab->y = sp->y; sp->x += tab->w + ( ob->bw > 0 ); if ( sp->x < sp->canvas->x + sp->canvas->w - 2 ) { sp->num_visible = i; tab->boxtype &= ~ FLI_BROKEN_BOX; tab->align = FL_ALIGN_CENTER; tab->visible = 1; } else if ( ( tab->w -= sp->x - sp->canvas->x - sp->canvas->w ) > 0 ) { tab->boxtype |= FLI_BROKEN_BOX; tab->align = fl_to_inside_lalign( FL_ALIGN_LEFT ); tab->visible = 1; } else { tab->w = 20; tab->visible = 0; } } for ( i = 0; i < sp->nforms; i++ ) sp->title[ i ]->h = max_h; /* This will be the canvas location */ if ( ob->objclass == FL_TABFOLDER ) { if ( ob->type != FL_BOTTOM_TABFOLDER ) sp->canvas->y = sp->y + max_h - ( ob->bw < 0 ); } else { if ( sp->parent->type != FL_BOTTOM_TABFOLDER ) sp->canvas->y = sp->y + max_h - ( ob->bw < 0 ); } sp->canvas->h = ob->h - max_h - FL_abs( ob->bw ) - 1; sp->max_h = max_h; fl_set_object_color( sp->canvas, ob->col1, ob->col2 ); } /*************************************** ***************************************/ static void compute_bottom_position( FL_OBJECT * ob ) { FLI_TABFOLDER_SPEC *sp; FL_OBJECT *tab; int i, max_h = 4, absbw = FL_abs( ob->bw ); sp = ob->objclass == FL_TABFOLDER ? ob->spec:ob->u_vdata; sp->x = ob->x; if ( sp->nforms == 0 ) { int junk; get_tabsize( ob, "AjbY", &junk, &max_h, -1 ); } for ( i = 0; i < sp->nforms; i++ ) { tab = sp->title[ i ]; get_tabsize( ob, tab->label, &tab->w, &tab->h, -1 ); if ( tab->h > max_h ) max_h = tab->h; tab->x = sp->x; sp->x += tab->w + ( ob->bw > 0 ); } sp->canvas->h = ob->h - 2 * absbw - max_h - 1; sp->y = sp->canvas->y + sp->canvas->h + absbw - ( ob->bw < 0 ); for ( i = 0; i < sp->nforms; i++ ) { sp->title[ i ]->h = max_h; sp->title[ i ]->y = sp->y; } sp->max_h = max_h; fl_set_object_color( sp->canvas, ob->col1, ob->col2 ); } /*************************************** ***************************************/ static void compute_position( FL_OBJECT * ob ) { if ( ob->type == FL_BOTTOM_TABFOLDER ) compute_bottom_position( ob ); else compute_top_position( ob ); } /*************************************** ***************************************/ int fl_set_tabfolder_autofit( FL_OBJECT * ob, int y ) { FLI_TABFOLDER_SPEC *sp = ob->spec; int old = sp->auto_fit; sp->auto_fit = y; return old; } /*************************************** ***************************************/ static void shift_tabs( FL_OBJECT * ob, int left ) { FLI_TABFOLDER_SPEC *sp = ob->u_vdata; int newp = sp->offset + left; if ( newp < 0 ) newp = 0; if ( newp == sp->offset ) return; sp->offset = newp; compute_position( ob ); } /*************************************** ***************************************/ void fli_set_tab_color( FL_OBJECT * obj, FL_COLOR col1, FL_COLOR col2 ) { FLI_TABFOLDER_SPEC *sp = obj->spec; int i; for ( i = 0; i < sp->nforms; i++ ) fl_set_object_color( sp->title[ i ], col1, col2 ); } /*************************************** ***************************************/ void fli_set_tab_lcolor( FL_OBJECT * obj, FL_COLOR lcol ) { FLI_TABFOLDER_SPEC *sp = obj->spec; int i; for ( i = 0; i < sp->nforms; i++ ) fl_set_object_lcolor( sp->title[ i ], lcol ); } /*************************************** ***************************************/ void fli_set_tab_lsize( FL_OBJECT * obj, int lsize ) { FLI_TABFOLDER_SPEC *sp = obj->spec; int i; for ( i = 0; i < sp->nforms; i++ ) fl_set_object_lsize( sp->title[ i ], lsize ); } /*************************************** ***************************************/ void fli_set_tab_lstyle( FL_OBJECT * obj, int lstyle ) { FLI_TABFOLDER_SPEC *sp = obj->spec; int i; for ( i = 0; i < sp->nforms; i++ ) fl_set_object_lstyle( sp->title[ i ], lstyle ); } /*************************************** ***************************************/ void fli_set_tab_lalign( FL_OBJECT * obj, int align ) { FLI_TABFOLDER_SPEC *sp = obj->spec; int i; for ( i = 0; i < sp->nforms; i++ ) fl_set_object_lalign( sp->title[ i ], align ); } /*************************************** ***************************************/ void fli_set_tab_bw( FL_OBJECT * obj, int bw ) { FLI_TABFOLDER_SPEC *sp = obj->spec; int i; for ( i = 0; i < sp->nforms; i++ ) fl_set_object_bw( sp->title[ i ], bw ); } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/fldraw.c0000644000175000017500000011243112342657767012173 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file fldraw.c * * This file is part of the XForms library package. * Copyright (c) 1996-2002 T.C. Zhao and Mark Overmars * All rights reserved. * * High level drawing routines. Uses the routines defined in xdraw.c */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #define FLI_SHADOW_COL FL_RIGHT_BCOL static void fl_foldertab_box( int, FL_Coord, FL_Coord, FL_Coord, FL_Coord, FL_COLOR, int ); /******************************************************************* * Rectangle routines ****************************************************************{**/ /*************************************** * Make an arbitary rectangle have positive width and height ***************************************/ void fli_canonicalize_rect( FL_Coord * x, FL_Coord * y, FL_Coord * w, FL_Coord * h ) { if ( *w < 0 ) { *w = -*w; *x -= *w; } if ( *h < 0 ) { *h = -*h; *y -= *h; } } /*************************************** * Draw a filled rectangle with a black boundary. Also compensates * for the inconsistency in Xlib ***************************************/ int flrectboundcolor = FL_BLACK; void fl_rectbound( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col ) { fli_canonicalize_rect( &x, &y, &w, &h ); /* 0 width has special meaning in Xlib */ if ( h < 2 ) h = 2; if ( w < 2 ) w = 2; fl_rectangle( 1, x + 1, y + 1, w - 1, h - 1, col ); fl_rectangle( 0, x, y, w, h, flrectboundcolor ); } /****** End of rectangle routines ***********************}***/ #define MAX_RADIUS 18 static double offset[ ] = { 0.0, 0.07612, 0.29289, 0.61732, 1.0 }; #define RN ( sizeof offset / sizeof *offset ) /*************************************** ***************************************/ static void compute_round_corners( FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_POINT * point ) { size_t i; double rs = 0.45 * FL_min( w, h ); static double old_rs = -1; static FL_Coord o[ RN ]; if ( rs > MAX_RADIUS ) rs = MAX_RADIUS; if ( rs < 0 ) rs = 0; if ( rs != old_rs ) { for ( i = 0; i < RN; i++ ) o[ i ] = FL_crnd( offset[ i ] * rs ); old_rs = rs; } for ( i = 0; i < RN; i++, point++ ) { point->x = x + o[ RN - i - 1 ]; point->y = y + o[ i ]; } for ( i = 0; i < RN; i++, point++ ) { point->x = x + o[ i ]; point->y = y + h - 1 - o[ RN - i - 1 ]; } for ( i = 0; i < RN; i++, point++ ) { point->x = x + w - 1 - o[ RN - i - 1 ]; point->y = y + h - 1 - o[ i ]; } for ( i = 0; i < RN; i++, point++ ) { point->x = x + w - 1 - o[ i ]; point->y = y + o[ RN - i - 1 ]; } } /*************************************** ***************************************/ void fl_roundrectangle( int fill, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col ) { FL_POINT point[ 4 * RN + 1 ]; /* need one extra for closing of polygon! */ compute_round_corners( x, y, w, h, point ); fl_polygon( fill, point, 4 * RN, col ); } #define SHRINK( x, y, w, h, d ) \ do { x += ( d ); \ y += ( d ); \ w -= 2 * ( d ); \ h -= 2 * ( d ); \ } while ( 0 ) /*************************************** ***************************************/ static void fl_rounded3dbox( int style, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col, int bw ) { FL_POINT point[ 4 * RN + 1 ]; /* on extra for closing of curve */ int lw = FL_abs( bw ); int n = 4 * RN, olw; SHRINK( x, y, w, h, ( int ) ( lw / 2 ) ); compute_round_corners( x, y, w, h, point ); fl_polyf( point, n, col ); olw = fl_get_linewidth( ); fl_linewidth( lw ); /* draw the shadow */ if ( style == FL_ROUNDED3D_UPBOX ) { fl_lines( point, 2 * RN, FL_LEFT_BCOL ); fl_lines( point + 2 * RN - 3, RN + 1, FL_BOTTOM_BCOL ); fl_lines( point + 3 * RN - 4, RN + 2, FL_RIGHT_BCOL ); point[ n ] = point[ 0 ]; fl_lines( point + n - 3, 4, FL_TOP_BCOL ); } else { fl_lines( point, 2 * RN, FL_BOTTOM_BCOL ); fl_lines( point + 2 * RN - 3, RN + 1, FL_TOP_BCOL ); fl_lines( point + 3 * RN - 4, RN + 2, FL_LEFT_BCOL ); point[ n ] = point[ 0 ]; fl_lines( point + n - 3, 4, FL_BOTTOM_BCOL ); } fl_linewidth( olw ); if ( bw > 0 && fli_dithered( fl_vmode ) ) { compute_round_corners( x, y, w, h, point ); fl_polyl( point, n, FL_BLACK ); } } /*************************************** ***************************************/ static void fl_oval3dbox( int style, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col, int bw ) { int absbw = FL_abs( bw ), olw = fl_get_linewidth( ); int extra = 1 + ( absbw > 3 ); int xx, yy, ww, hh; SHRINK( x, y, w, h, ( int ) ( absbw / 2 ) ); fl_pieslice( 1, x, y, w, h, 0, 3600, col ); xx = x + extra; yy = y + extra; ww = w - 2 * extra; hh = h - 2 * extra; fl_linewidth( absbw ); if ( style == FL_OVAL3D_UPBOX ) { fl_pieslice( 0, x, y, w, h, 450, 2250, FL_TOP_BCOL ); fl_pieslice( 0, x, y, w, h, 0, 450, FL_BOTTOM_BCOL ); fl_pieslice( 0, x, y, w, h, 2250, 3600, FL_BOTTOM_BCOL ); } else if ( style == FL_OVAL3D_FRAMEBOX ) { fl_linewidth( 0 ); fl_pieslice( 0, x, y, w, h, 450, 2250, FL_BOTTOM_BCOL ); fl_pieslice( 0, xx, yy, ww, hh, 450, 2250, FL_LEFT_BCOL ); fl_pieslice( 0, xx, yy, ww, hh, 0, 450, FL_BOTTOM_BCOL ); fl_pieslice( 0, x, y, w, h, 0, 450, FL_LEFT_BCOL ); fl_pieslice( 0, xx, yy, ww, hh, 2250, 3600, FL_BOTTOM_BCOL ); fl_pieslice( 0, x, y, w, h, 2250, 3600, FL_LEFT_BCOL ); } else if ( style == FL_OVAL3D_EMBOSSEDBOX ) { fl_linewidth( 0 ); fl_pieslice( 0, x, y, w, h, 450, 2250, FL_LEFT_BCOL ); fl_pieslice( 0, xx, yy, ww, hh, 450, 2250, FL_BOTTOM_BCOL ); fl_pieslice( 0, xx, yy, ww, hh, 0, 450, FL_LEFT_BCOL ); fl_pieslice( 0, x, y, w, h, 0, 450, FL_BOTTOM_BCOL ); fl_pieslice( 0, xx, yy, ww, hh, 2250, 3600, FL_LEFT_BCOL ); fl_pieslice( 0, x, y, w, h, 2250, 3600, FL_BOTTOM_BCOL ); } else { fl_pieslice( 0, x, y, w, h, 450, 2250, FL_BOTTOM_BCOL ); fl_pieslice( 0, x, y, w, h, 0, 450, FL_TOP_BCOL ); fl_pieslice( 0, x, y, w, h, 2250, 3600, FL_TOP_BCOL ); } fl_linewidth( olw ); if ( fli_dithered( fl_vmode ) ) fl_pieslice( 0, x, y, w, h, 0, 3600, FL_BLACK ); } #define SET_POINT( v, xp, yp ) \ do { ( v )->x = xp; \ ( v )->y = yp; \ } while ( 0 ) /*************************************** * Draw a rectangular box. TODO: need to change primitive box * drawing using frame ***************************************/ void fl_draw_box( int style, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR c, int bw_in ) { FL_POINT vert[ 5 ]; /* need one extra for closing of polygon! */ int B, dp = fli_dithered( fl_vmode ), bw = bw_in; FL_Coord cx, cy, cw, ch; if ( c == FL_NoColor ) c = FL_COL1; if ( style == FL_NO_BOX ) return; if ( ! ( B = ( bw > 0 ) ) ) bw = - bw; if ( bw == 0 ) style = FL_FLAT_BOX; /* We must guarantee width of rectangle is larger than 0 */ if ( w - 2 * bw <= 0 ) bw = w / 2 - 1; if ( h - 2 * bw <= 0 ) bw = h / 2 - 1; if ( w <= 0 || h <= 0 ) return; switch ( style ) { case FL_UP_BOX: fl_rectf( x + bw + B, y + bw + B, w - 2 * bw - 2 * B, h - 2 * bw - 2 * B, c ); fl_rectf( x + B, y + B, w - 1 - B, bw, FL_TOP_BCOL ); fl_rectf( x + B, y + h - bw - B, w - 1 - B, bw, FL_BOTTOM_BCOL ); SET_POINT( vert, x + w - B - bw, y + bw + B ); SET_POINT( vert + 1, x + w - B - bw, y + h - B - bw ); SET_POINT( vert + 2, x + w - B, y + h - B ); SET_POINT( vert + 3, x + w - B, y + B ); fl_polyf( vert, 4, FL_RIGHT_BCOL ); /* left trapzoidal */ SET_POINT( vert, x + B, y + B ); SET_POINT( vert + 1, x + B, y + h - B ); SET_POINT( vert + 2, x + bw + B, y + h - bw - B ); SET_POINT( vert + 3, x + bw + B, y + bw + B ); fl_polyf( vert, 4, FL_LEFT_BCOL ); if ( B || fli_dithered( fl_vmode ) ) fl_rect( x, y, w - 1, h - 1, FL_RIGHT_BCOL ); /* special hack for B&W */ if ( fli_dithered( fl_vmode ) ) { if ( bw > 2 ) { SET_POINT( vert, x + B, y + B ); SET_POINT( vert + 1, x + B + bw - 1, y + bw ); SET_POINT( vert + 2, x + w - bw, y + bw ); fl_lines( vert, 3, FL_BLACK ); fl_simple_line( x + B + bw - 1, y + B + bw, x + B + bw - 1, y + h - bw, FL_BLACK ); } else fl_rect( x, y, w - 1, h - 1, FL_BLACK ); } break; case FL_DOWN_BOX: fl_rectf( x + bw, y + bw, w - 2 * bw, h - 2 * bw, c ); fl_rectf( x, y + h - bw, w, bw - dp, FL_TOP_BCOL ); fl_rectf( x, y, w, bw, FL_BOTTOM_BCOL ); /* right trapzoid */ SET_POINT( vert, x + w - bw, y + bw ); SET_POINT( vert + 1, x + w - bw, y + h - bw ); SET_POINT( vert + 2, x + w - dp, y + h ); SET_POINT( vert + 3, x + w - dp, y ); fl_polyf( vert, 4, FL_LEFT_BCOL ); /* left trapzoid */ SET_POINT( vert, x, y ); SET_POINT( vert + 1, x, y + h - 1 ); SET_POINT( vert + 2, x + bw, y + h - bw ); SET_POINT( vert + 3, x + bw, y + bw ); fl_polyf( vert, 4, FL_RIGHT_BCOL ); /* special hack for B&W */ if ( fli_dithered( fl_vmode ) ) { SET_POINT( vert, x + B, y + h - 1 ); SET_POINT( vert + 1, x + w - 1, y + h - 1 ); SET_POINT( vert + 2, x + w - 1, y + B ); fl_lines( vert, 3, FL_BLACK ); } break; case FL_FLAT_BOX: fl_rectf( x, y, w, h, c ); break; case FL_BORDER_BOX: fl_rectbound( x, y, w - 1, h - 1, c ); break; case FL_FRAME_BOX: B = bw > 2 ? bw - 2 : 1; fl_draw_box( FL_DOWN_BOX, x, y, w, h, c, 1 ); x += B + 1; y += B + 1; w -= 2 * ( B + 1 ); h -= 2 * ( B + 1 ); fl_draw_frame( FL_UP_FRAME, x, y, w, h, c, -1 ); break; case FL_EMBOSSED_BOX: B = bw > 2 ? bw - 2 : 1; fl_draw_box( FL_UP_BOX, x, y, w, h, c, -1 ); x += B + 1; y += B + 1; w -= 2 * ( B + 1 ); h -= 2 * ( B + 1 ); fl_draw_frame( FL_DOWN_FRAME, x, y, w, h, c, 1 ); break; case FL_ROUNDED_BOX: fl_roundrectf( x + 1, y + 1, w - 1, h - 1, c ); fl_roundrect( x, y, w, h, FL_BLACK ); break; case FL_ROUNDED3D_UPBOX: case FL_ROUNDED3D_DOWNBOX: fl_rounded3dbox( style, x, y, w, h, c, bw ); break; case FL_SHADOW_BOX: bw++; fl_rectf( x + bw, y + h - bw, w - bw, bw, FLI_SHADOW_COL ); fl_rectf( x + w - bw, y + bw, bw, h - bw, FLI_SHADOW_COL ); fl_rectbound( x, y, w - bw, h - bw, c ); break; case FL_RSHADOW_BOX: if ( w > 70 && h > 70 ) bw++; if ( fl_get_clipping( 1, &cx, &cy, &cw, &ch ) && ( cw <= 0 || ch <= 0 ) ) break; /* Draw the shadow, raw it several times with clipping */ fl_roundrectf( x + bw, y + bw, w - bw, h - bw, FLI_SHADOW_COL ); /* Draw the box */ fli_set_additional_clipping( x, y, w, h ); fl_roundrectf( x + 1, y + 1, w - 1 - bw, h - 1 - bw, c ); fl_roundrect( x, y, w - bw, h - bw, FL_BLACK ); fl_set_clipping( cx, cy, cw, ch ); break; case FL_RFLAT_BOX: fl_roundrectf( x, y, w, h, c ); break; case FL_OVAL_BOX: fl_oval( 1, x + 1, y + 1, w - 1, h - 1, c ); fl_oval( 0, x + 1, y + 1, w - 2, h - 2, FL_BLACK ); break; case FL_OVAL3D_UPBOX: case FL_OVAL3D_DOWNBOX: case FL_OVAL3D_FRAMEBOX: case FL_OVAL3D_EMBOSSEDBOX: fl_oval3dbox( style, x, y, w, h, c, bw_in ); break; case FL_TOPTAB_UPBOX: case FL_SELECTED_TOPTAB_UPBOX: case FL_BOTTOMTAB_UPBOX: case FL_SELECTED_BOTTOMTAB_UPBOX: fl_foldertab_box( style, x, y, w, h, c, bw_in ); break; default: if ( style & FLI_BROKEN_BOX ) fl_foldertab_box( style, x, y, w, h, c, bw_in ); else M_err( "fl_draw_box", "Unkonwn boxtype: %d", style ); break; } } /*************************************** * 0 * 1 3 * 2 * Draws a box rotated by 45 degrees ***************************************/ void fli_draw_checkbox( int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR col, int bw ) { int halfw = w / 2, halfh = h / 2; FL_POINT allp[ 9 ];; w = 2 * halfw; h = 2 * halfh; /* Generate all points */ SET_POINT( allp, x + halfw, y ); SET_POINT( allp + 1, x, y + halfh ); SET_POINT( allp + 2, x + halfw, y + h ); SET_POINT( allp + 3, x + w, y + halfh ); SET_POINT( allp + 4, x + halfw, y + bw ); SET_POINT( allp + 5, x + bw, y + halfh ); SET_POINT( allp + 6, x + halfw, y + h - bw ); SET_POINT( allp + 7, x + w - bw, y + halfh ); SET_POINT( allp + 8, x + halfw, y + halfh ); /* center */ /* Draw the borders for up and down boxes (plus the interior, it will be overdrawn in the next step) */ if ( type == FL_UP_BOX || type == FL_DOWN_BOX ) { FL_POINT xp[ 4 ]; /* need one extra for closing of polygons! */ xp[ 2 ] = allp[ 8 ]; xp[ 0 ] = allp[ 0 ]; xp[ 1 ] = allp[ 1 ]; fl_polyf( xp, 3, type == FL_UP_BOX ? FL_LEFT_BCOL : FL_RIGHT_BCOL ); xp[ 0 ] = allp[ 1 ]; xp[ 1 ] = allp[ 2 ]; fl_polyf( xp, 3, type == FL_UP_BOX ? FL_BOTTOM_BCOL : FL_TOP_BCOL ); xp[ 0 ] = allp[ 2 ]; xp[ 1 ] = allp[ 3 ]; fl_polyf( xp, 3, type == FL_UP_BOX ? FL_RIGHT_BCOL : FL_LEFT_BCOL ); xp[ 0 ] = allp[ 3 ]; xp[ 1 ] = allp[ 0 ]; fl_polyf( xp, 3, type == FL_UP_BOX ? FL_TOP_BCOL : FL_BOTTOM_BCOL ); } /* Draw the interior */ fl_polyf( allp + 4, 4, col ); /* Special hack for B&W, add a border */ if ( fli_dithered( fl_vmode ) ) fl_polyl( allp, 4, FL_BLACK ); } /*************************************** * Draws a frame around a box. The frame is drawn that it is just * outside of the box without any gap. A flat box with the same * size as that frame just fit the inside the of the frame. ***************************************/ void fl_draw_frame( int style, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR c, int bw ) { FL_POINT vert[ 5 ]; /* need one extra for closing of polygon! */ int B, dp = fli_dithered( fl_vmode ); if ( w <= 0 || h <= 0 ) return; if ( ! ( B = ( bw > 0 ) ) ) bw = - bw; switch ( style ) { case FL_UP_FRAME: /* Must guarante that width of rectangle > 0 */ if ( ( w - 2 * bw ) <= 0 ) bw = w / 2; if ( ( h - 2 * bw ) <= 0 ) bw = h / 2; x -= bw + B; y -= bw + B; w += 2 * ( bw + B ); h += 2 * ( bw + B ); fl_rectf( x + B, y + B, w - 1 - B, bw, FL_TOP_BCOL ); fl_rectf( x + B, y + h - bw - B, w - 1 - B, bw, FL_BOTTOM_BCOL ); SET_POINT( vert, x + w - B - bw, y + bw + B ); SET_POINT( vert + 1, x + w - B - bw, y + h - B - bw ); SET_POINT( vert + 2, x + w - B, y + h - B ); SET_POINT( vert + 3, x + w - B, y + B ); fl_polyf( vert, 4, FL_RIGHT_BCOL ); /* Left trapzoidal */ SET_POINT( vert, x + B, y + B ); SET_POINT( vert + 1, x + B, y + h - B ); SET_POINT( vert + 2, x + bw + B, y + h - bw - B ); SET_POINT( vert + 3, x + bw + B, y + bw + B ); fl_polyf( vert, 4, FL_LEFT_BCOL ); if ( B || fli_dithered( fl_vmode ) ) fl_rect( x, y, w - 1, h - 1, FL_BLACK ); /* Special hack for B&W */ if ( dp ) { if ( bw > 2 ) { SET_POINT( vert, x + B, y + B ); SET_POINT( vert + 1, x + B + bw - 1, y + bw ); SET_POINT( vert + 2, x + w - bw, y + bw ); fl_lines( vert, 3, FL_BLACK ); fl_simple_line( x + B + bw - 1, y + B + bw, x + B + bw - 1, y + h - bw, FL_BLACK ); } else fl_rect( x, y, w - 1, h - 1, FL_BLACK ); } break; case FL_DOWN_FRAME: x -= bw; y -= bw; w += 2 * bw; h += 2 * bw; /* Top and bottom section */ fl_rectf( x, y, w, bw, FL_BOTTOM_BCOL ); /* top */ fl_rectf (x, y + h - bw, w, bw - dp, FL_TOP_BCOL); /* bottom */ /* Right trapzoid */ SET_POINT( vert, x + w - bw, y + bw ); SET_POINT( vert + 1, x + w - bw, y + h - bw ); SET_POINT( vert + 2, x + w - dp, y + h ); SET_POINT( vert + 3, x + w - dp, y ); fl_polyf( vert, 4, FL_LEFT_BCOL ); /* Left trapzoid */ SET_POINT( vert, x, y ); SET_POINT( vert + 1, x, y + h - 1 ); SET_POINT( vert + 2, x + bw, y + h - bw ); SET_POINT( vert + 3, x + bw, y + bw ); fl_polyf( vert, 4, FL_RIGHT_BCOL ); /* Special hack for B&W */ if ( dp ) { SET_POINT( vert, x + B, y + h - 1 ); SET_POINT( vert + 1, x + w - 1, y + h - 1 ); SET_POINT( vert + 2, x + w - 1, y + B ); fl_lines( vert, 3, FL_BLACK ); } break; case FL_SHADOW_FRAME: if ( w > 70 && h > 70 ) { if ( ( bw += ( w + h ) / 140 ) > 5 ) bw = 5; } fl_rectf( x + bw, y + h, w, bw, FLI_SHADOW_COL ); fl_rectf( x + w, y + bw, bw, h, FLI_SHADOW_COL ); fl_rect( x - 1, y - 1, w + 1, h + 1, FL_BLACK ); break; case FL_BORDER_FRAME: fl_rect( x - 1, y - 1, w + 1, h + 1, c ); break; case FL_EMBOSSED_FRAME: B = bw > 2 ? ( bw - 2 ) : 1; fl_draw_frame( FL_UP_FRAME, x, y, w, h, 0, -1 ); fl_draw_frame( FL_DOWN_FRAME, x + B, y + B, w - 2 * B, h - 2 * B, 0, 1 ); break; case FL_ENGRAVED_FRAME: B = bw > 2 ? bw - 2 : 1; fl_draw_frame( FL_DOWN_FRAME, x, y, w, h, 0, 1 ); fl_draw_frame( FL_UP_FRAME, x + B, y + B, w - 2 * B, h - 2 * B, 0, -1 ); break; case FL_ROUNDED_FRAME: fl_roundrect( x - 1, y - 1, w + 2, h + 2, c ); break; case FL_OVAL_FRAME: fl_oval( 0, x - 1, y - 1, w + 2, h + 2, c ); break; } } /********* Some convience functions, sort of GL in X ******{*****/ #define MAX_BUF_POINT 128 static FL_POINT xpbuf[ MAX_BUF_POINT ]; static int npt; static FL_COLOR pcol; /*************************************** ***************************************/ void fli_add_vertex( FL_Coord x, FL_Coord y ) { if ( npt >= MAX_BUF_POINT ) { M_err( "fli_add_vertex", "Vertices Out of bounds" ); return; } xpbuf[ npt ].x = x; xpbuf[ npt++ ].y = y; } /*************************************** ***************************************/ void fli_add_float_vertex( float x, float y ) { if ( npt >= MAX_BUF_POINT ) { M_err( "fli_add_float_vertex", "Vertices Out of bounds" ); return; } xpbuf[ npt ].x = FL_nint( x ); xpbuf[ npt++ ].y = FL_nint( y ); } /*************************************** ***************************************/ void fli_reset_vertex( void ) { npt = 0; pcol = flx->color; } /*************************************** ***************************************/ void fli_endline( void ) { if ( npt >= MAX_BUF_POINT ) { M_err( "fli_endline", "Vertices Out of bounds" ); return; } fl_lines( xpbuf, npt, flx->color ); } /*************************************** ***************************************/ void fli_endclosedline( void ) { if ( npt + 1 >= MAX_BUF_POINT ) { M_err( "fli_endclosedline", "Vertices Out of bounds" ); return; } fl_polyl( xpbuf, npt, pcol ); } /*************************************** ***************************************/ void fli_endpolygon( void ) { if ( npt + 1 >= MAX_BUF_POINT ) { M_err( "fli_endpolygon", "Vertices Out of bounds" ); return; } fl_polyf( xpbuf, npt, flx->color ); } static int Tabfolder_Corner = 3; /*************************************** ***************************************/ int fl_set_default_tabfolder_corner( int n ) { int old = Tabfolder_Corner; Tabfolder_Corner = FL_abs( n ); if ( Tabfolder_Corner > 10 ) Tabfolder_Corner = 10; return old; } /*************************************** ***************************************/ static void fl_foldertab_box( int style, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR c, int bw ) { int ctr, right, bott; FL_POINT vert[ 9 ]; /* need one extra for closing of polygon! */ int border = ( bw > 0 ); int absbw = FL_abs( bw ), i; int C = Tabfolder_Corner; int isbroken = style & FLI_BROKEN_BOX; style &= ~ FLI_BROKEN_BOX; /* for foldertab box, actual h is pre-enlarged by absbw pixels so the label is draw centered. Here we recover the pixels */ if ( style == FL_BOTTOMTAB_UPBOX || style == FL_SELECTED_BOTTOMTAB_UPBOX ) h += absbw; else h -= absbw; /* We must try to guarantee the width of the rectangle is larger than 0 */ if ( w - 2 * absbw <= 0 ) absbw = FL_abs( w / 2 - 1 ); if ( h - 2 * absbw <= 0 ) absbw = FL_abs( h / 2 - 1 ); ctr = absbw / 2; SHRINK( x, y, w, h, ctr ); right = x + w - 1; bott = y + h - 1; switch ( style ) { case FL_TOPTAB_UPBOX: SET_POINT( vert, x, y + h - ( ctr == 0 ) ); SET_POINT( vert + 1, x, y + C - 1 ); SET_POINT( vert + 2, x + C - 1, y ); SET_POINT( vert + 3, right - C, y ); SET_POINT( vert + 4, x + C - 1, y ); SET_POINT( vert + 5, right - C + 1, y ); SET_POINT( vert + 6, right, y + C - 1 ); SET_POINT( vert + 7, right, y + h - ( ctr == 0 ) ); fl_polyf( vert, 8, c ); fl_set_linewidth( absbw ); fl_lines( vert, 3, FL_LEFT_BCOL ); fl_lines( vert + 3, 2, FL_TOP_BCOL ); if ( ! isbroken ) fl_lines( vert + 5, 3, FL_BOTTOM_BCOL ); else { int yc = ( h - ( ctr == 0 ) ) / 2, yc2 = yc / 2, yc4 = yc / 4; fl_line( right, y, right, y + 4, FL_INACTIVE_COL ); fl_line( right, y + 4, right - 3, y + yc4, FL_INACTIVE_COL ); fl_line( right - 3, y + yc4, right - 2, y + yc2, FL_INACTIVE_COL ); fl_line( right - 2, y + yc2, right, y + yc, FL_INACTIVE_COL ); fl_line( right, y + yc, right, y + yc + 2, FL_INACTIVE_COL ); fl_line( right, y + yc + 2, right + 1, y + yc + yc4, FL_INACTIVE_COL ); fl_line( right + 1, y + yc + yc4, right - 2, y + yc + yc, FL_INACTIVE_COL ); } fl_set_linewidth( 0 ); if ( border || fli_dithered( fl_vmode ) ) { for ( i = 0; i < 8; i++ ) { if ( vert[ i ].x > x + w / 2 ) vert[ i ].x += ctr; else vert[ i ].x -= ctr + 1; if ( vert[ i ].y < y + h / 2 ) vert[ i ].y -= ctr + 1; } fl_lines( vert, 8, FL_RIGHT_BCOL ); } break; case FL_SELECTED_TOPTAB_UPBOX: SET_POINT( vert, x, bott + absbw + 3 ); SET_POINT( vert + 1, x, y + C - 1 ); SET_POINT( vert + 2, x + C - 1, y ); SET_POINT( vert + 3, right - C, y ); SET_POINT( vert + 4, x + C - 1, y ); SET_POINT( vert + 5, right - C + 1, y ); SET_POINT( vert + 6, right, y + C - 1 ); SET_POINT( vert + 7, right, bott + absbw + 3 ); fl_polyf( vert, 8, c ); fl_set_linewidth( absbw ); fl_lines( vert, 3, FL_LEFT_BCOL ); fl_lines( vert + 3, 2, FL_TOP_BCOL ); fl_lines( vert + 5, 3, FL_BOTTOM_BCOL ); fl_set_linewidth( 0 ); if ( border || fli_dithered( fl_vmode ) ) { for ( i = 0; i < 8; i++ ) { if ( vert[ i ].x > x + w / 2 ) vert[ i ].x += ctr; else vert[ i ].x -= ctr + 1; if ( vert[ i ].y < y + h / 2 ) vert[ i ].y -= ctr + 1; } vert[ 0 ].y -= absbw + 1; vert[ 7 ].y -= absbw + 1; fl_lines( vert, 8, FL_RIGHT_BCOL ); } break; case FL_BOTTOMTAB_UPBOX: SET_POINT( vert, x, y + ( ctr == 0 ) ); SET_POINT( vert + 1, x, bott - C + 1 ); SET_POINT( vert + 2, x + C - 1, bott ); SET_POINT( vert + 3, x + C - 1, bott ); SET_POINT( vert + 4, right - C, bott ); SET_POINT( vert + 5, right - C, bott ); SET_POINT( vert + 6, right, bott - C ); SET_POINT( vert + 7, right, y + ( ctr == 0 ) ); fl_polyf( vert, 8, c ); fl_linewidth( absbw ); fl_lines( vert, 3, FL_TOP_BCOL ); fl_lines( vert + 3, 2, FL_BOTTOM_BCOL ); fl_lines( vert + 5, 3, FL_RIGHT_BCOL ); fl_linewidth( 0 ); if ( border || fli_dithered( fl_vmode ) ) { for ( i = 0; i < 8; i++ ) { if ( vert[ i ].x > x + w / 2 ) vert[ i ].x += ctr; else vert[ i ].x -= ctr + 1; if ( vert[ i ].y > y + h / 2 ) vert[ i ].y += ctr; } fl_lines( vert, 8, FL_RIGHT_BCOL ); } break; case FL_SELECTED_BOTTOMTAB_UPBOX: SET_POINT( vert, x, y - absbw - 1 ); SET_POINT( vert + 1, x, bott - C + 1 ); SET_POINT( vert + 2, x + C - 1, bott ); SET_POINT( vert + 3, x + C - 1, bott ); SET_POINT( vert + 4, right - C, bott ); SET_POINT( vert + 5, right - C, bott ); SET_POINT( vert + 6, right, bott - C + 1 ); SET_POINT( vert + 7, right, y - absbw - 1 ); fl_polyf( vert, 8, c ); fl_linewidth( absbw ); fl_lines( vert, 3, FL_TOP_BCOL ); fl_lines( vert + 3, 2, FL_BOTTOM_BCOL ); fl_lines( vert + 5, 3, FL_RIGHT_BCOL ); fl_linewidth( 0 ); if ( border || fli_dithered( fl_vmode ) ) { for ( i = 0; i < 8; i++ ) { if ( vert[ i ].x > x + w / 2 ) vert[ i ].x += ctr; else vert[ i ].x -= ctr + 1; if ( vert[ i ].y > y + h / 2 ) vert[ i ].y += ctr; } fl_lines( vert, 8, FL_RIGHT_BCOL ); } break; } } /*************************************** * draw triangluar box ***************************************/ void fli_draw_tbox( int style, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, FL_COLOR c, int bw_in ) { FL_POINT vert[ 4 ]; /* need one extra for closing of polygon! */ int dp = fli_dithered( fl_vmode ), bw = bw_in; int xc = x + w / 2, yc = y + h / 2; int halfbw = bw / 2; if ( c == FL_NoColor ) c = FL_COL1; if ( bw < 0 ) bw = -bw; if ( bw == 0 && style != FL_NO_BOX ) style = FL_FLAT_BOX; switch ( style ) { case FLI_TRIANGLE_UPBOX8: SET_POINT( vert, xc, y + bw ); SET_POINT( vert + 1, x + bw, y + h - bw ); SET_POINT( vert + 2, x + w - bw, y + h - bw ); fl_polyf( vert, 3, c ); fl_linewidth( bw ); SHRINK( x, y, w, h, halfbw ); xc = x + w / 2; fl_line( xc, y, x, y + h - 1, FL_LEFT_BCOL ); fl_line( x, y + h - 1, x + w - 1, y + h - 1, FL_BOTTOM_BCOL ); fl_line( xc, y, x + w - 1, y + h - 1, FL_BOTTOM_BCOL ); fl_linewidth( 0 ); break; case FLI_TRIANGLE_DOWNBOX8: SET_POINT( vert, xc, y + bw ); SET_POINT( vert + 1, x + bw, y + h - bw ); SET_POINT( vert + 2, x + w - bw, y + h - bw ); fl_polyf( vert, 3, c ); fl_linewidth( bw ); SHRINK( x, y, w, h, halfbw ); xc = x + w / 2; fl_line( xc, y, x, y + h - 1, FL_BOTTOM_BCOL ); fl_line( x, y + h - 1, x + w - 1, y + h - 1, FL_TOP_BCOL ); fl_line( xc, y, x + w - 1, y + h - 1, FL_LEFT_BCOL ); fl_linewidth( 0 ); break; case FLI_TRIANGLE_UPBOX2: SET_POINT( vert, xc, y + h - bw ); SET_POINT( vert + 1, x + bw, y + bw ); SET_POINT( vert + 2, x + w - bw, y + bw ); fl_polyf( vert, 3, c ); fl_linewidth( bw ); SHRINK( x, y, w, h, halfbw ); xc = x + w / 2; fl_line( xc, y + h - 1, x, y, FL_LEFT_BCOL ); fl_line( x, y, x + w - 1, y, FL_TOP_BCOL ); fl_line( x + w - 1, y, xc, y + h - 1, FL_RIGHT_BCOL ); fl_linewidth( 0 ); break; case FLI_TRIANGLE_DOWNBOX2: SET_POINT( vert, xc, y + h - bw ); SET_POINT( vert + 1, x + bw, y + bw ); SET_POINT( vert + 2, x + w - bw, y + bw ); fl_polyf( vert, 3, c ); fl_linewidth( bw ); SHRINK( x, y, w, h, halfbw ); xc = x + w / 2; fl_line( xc, y + h - 1, x, y, FL_BOTTOM_BCOL ); fl_line( x, y, x + w - 1, y, FL_BOTTOM_BCOL ); fl_line( x + w - 1, y, xc, y + h - 1, FL_TOP_BCOL ); fl_linewidth( 0 ); break; case FLI_TRIANGLE_UPBOX4: SET_POINT( vert, x + bw, yc ); SET_POINT( vert + 1, x + w - bw, y + bw ); SET_POINT( vert + 2, x + w - bw, y + h - bw ); fl_polyf( vert, 3, c ); fl_linewidth( bw ); SHRINK( x, y, w, h, halfbw ); yc = y + h / 2; fl_line( x, yc, x + w - 1, y, FL_TOP_BCOL ); fl_line( x + w - 1, y, x + w - 1, y + h - 1, FL_RIGHT_BCOL ); fl_line( x + w - 1, y + h - 1, x, yc, FL_BOTTOM_BCOL ); fl_linewidth( 0 ); break; case FLI_TRIANGLE_DOWNBOX4: SET_POINT( vert, x + bw, yc ); SET_POINT( vert + 1, x + w - bw, y + bw ); SET_POINT( vert + 2, x + w - bw, y + h - bw ); fl_polyf( vert, 3, c ); fl_linewidth( bw ); SHRINK( x, y, w, h, halfbw ); yc = y + h / 2; fl_line( x, yc, x + w - 1, y, FL_BOTTOM_BCOL ); fl_line( x + w - 1, y, x + w - 1, y + h - 1, FL_LEFT_BCOL ); fl_line( x + w - 1, y + h - 1, x, yc, FL_LEFT_BCOL ); fl_linewidth( 0 ); break; case FLI_TRIANGLE_UPBOX6: SET_POINT( vert, x + bw, y + bw ); SET_POINT( vert + 1, x + w - bw, yc ); SET_POINT( vert + 2, x + bw, y + h - bw ); fl_polyf( vert, 3, c ); fl_linewidth( bw ); SHRINK( x, y, w, h, halfbw ); yc = y + h / 2; fl_line( x, y, x + w - 1, yc, FL_RIGHT_BCOL ); fl_line( x + w - 1, yc, x, y + h - 1, FL_BOTTOM_BCOL ); fl_line( x, y + h - 1, x, y, FL_LEFT_BCOL ); fl_linewidth( 0 ); break; case FLI_TRIANGLE_DOWNBOX6: SET_POINT( vert, x + bw, y + bw ); SET_POINT( vert + 1, x + w - bw, yc ); SET_POINT( vert + 2, x + bw, y + h - bw ); fl_polyf( vert, 3, c ); fl_linewidth( bw ); SHRINK( x, y, w, h, halfbw ); yc = y + h / 2; fl_line( x, y, x + w - 1, yc, FL_LEFT_BCOL ); fl_line( x + w - 1, yc, x, y + h - 1, FL_TOP_BCOL ); fl_line( x, y + h - 1, x, y, FL_RIGHT_BCOL ); fl_linewidth( 0 ); break; } /* handle black and white */ if ( dp ) fl_polyl( vert, 3, FL_BLACK ); } /*************************************** ***************************************/ int fli_boxtype2frametype( int btype ) { if ( btype <= FL_EMBOSSED_BOX ) return btype; else if ( btype == FL_FLAT_BOX ) return FL_NO_FRAME; return FL_DOWN_FRAME; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/lib/fd/0000775000175000017500000000000012353624652011206 500000000000000xforms-1.2.4/lib/fd/cmdbr.fd0000664000175000017500000000356212236221667012535 00000000000000Magic: 15000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL =============== FORM =============== Name: cmd Width: 430 Height: 190 Number of Objects: 5 -------------------- class: FL_BOX type: FL_UP_BOX box: 0 0 430 190 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: backface callback: argument: -------------------- class: FL_FRAME type: FL_ENGRAVED_FRAME box: 10 152 410 31 boxtype: FL_NO_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_SouthWest FL_SouthEast name: callback: argument: -------------------- class: FL_BROWSER type: FL_NORMAL_BROWSER box: 10 8 410 140 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthWest FL_SouthEast name: browser callback: argument: -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 299 155 60 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Close shortcut: resize: FL_RESIZE_ALL gravity: FL_SouthEast FL_SouthEast name: close_br callback: fl_cmdbr_close_cb argument: 0 -------------------- class: FL_BUTTON type: FL_NORMAL_BUTTON box: 238 155 61 25 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Clear shortcut: resize: FL_RESIZE_ALL gravity: FL_SouthEast FL_SouthEast name: clear_br callback: fl_cmdbr_clear_cb argument: 0 ============================== create_the_form xforms-1.2.4/lib/fd/Makefile.in0000664000175000017500000002451712353624173013202 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/common.am subdir = lib/fd ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FL_FIXLEVEL = @FL_FIXLEVEL@ FL_REVISION = @FL_REVISION@ FL_VERSION = @FL_VERSION@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIB = @JPEG_LIB@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ TEXI2DVI = @TEXI2DVI@ TEXI2DVI_NEEDS_PDF = @TEXI2DVI_NEEDS_PDF@ TEXI2HTML = @TEXI2HTML@ VERSION = @VERSION@ XMKMF = @XMKMF@ XPM_LIB = @XPM_LIB@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign DISTCLEANFILES = *.orig *.rej *~ *.bak core makelog MAINTAINERCLEANFILES = $(srcdir)/Makefile.in makelog AM_INSTALL_DATA_FLAGS = $(INSTALL) -m 644 -D EXTRA_DIST = \ cmdbr.c \ cmdbr.fd \ cmdbr.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/common.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/fd/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/fd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/common.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: xforms-1.2.4/lib/fd/cmdbr.h0000664000175000017500000000256212337325620012366 00000000000000/* * * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. * */ /* Header file generated by fdesign on Tue Nov 5 17:58:31 2013 */ #ifndef FD_cmd_h_ #define FD_cmd_h_ #include "../include/forms.h" /* Callbacks, globals and object handlers */ extern void fl_cmdbr_close_cb( FL_OBJECT *, long ); extern void fl_cmdbr_clear_cb( FL_OBJECT *, long ); /* Forms and Objects */ typedef struct { FL_FORM * cmd; void * vdata; char * cdata; long ldata; FL_OBJECT * backface; FL_OBJECT * browser; FL_OBJECT * close_br; FL_OBJECT * clear_br; } FD_cmd; extern FD_cmd * create_form_cmd( void ); #endif /* FD_cmd_h_ */ xforms-1.2.4/lib/fd/cmdbr.c0000664000175000017500000000416412236222217012355 00000000000000/* * * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with XForms; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. * */ /* Form definition file generated by fdesign on Tue Nov 5 17:58:31 2013 */ #include #include "cmdbr.h" /*************************************** ***************************************/ FD_cmd * create_form_cmd( void ) { FL_OBJECT *obj; FD_cmd *fdui = ( FD_cmd * ) fl_malloc( sizeof *fdui ); fdui->vdata = fdui->cdata = NULL; fdui->ldata = 0; fdui->cmd = fl_bgn_form( FL_NO_BOX, 430, 190 ); fdui->backface = obj = fl_add_box( FL_UP_BOX, 0, 0, 430, 190, "" ); obj = fl_add_frame( FL_ENGRAVED_FRAME, 10, 152, 410, 31, "" ); fl_set_object_color( obj, FL_COL1, FL_COL1 ); fl_set_object_gravity( obj, FL_SouthWest, FL_SouthEast ); fdui->browser = obj = fl_add_browser( FL_NORMAL_BROWSER, 10, 8, 410, 140, "" ); fl_set_object_color( obj, FL_COL1, FL_YELLOW ); fl_set_object_gravity( obj, FL_NorthWest, FL_SouthEast ); fdui->close_br = obj = fl_add_button( FL_NORMAL_BUTTON, 299, 155, 60, 25, "Close" ); fl_set_object_gravity( obj, FL_SouthEast, FL_SouthEast ); fl_set_object_callback( obj, fl_cmdbr_close_cb, 0 ); fdui->clear_br = obj = fl_add_button( FL_NORMAL_BUTTON, 238, 155, 61, 25, "Clear" ); fl_set_object_gravity( obj, FL_SouthEast, FL_SouthEast ); fl_set_object_callback( obj, fl_cmdbr_clear_cb, 0 ); fl_end_form( ); fdui->cmd->fdui = fdui; return fdui; } xforms-1.2.4/lib/fd/Makefile.am0000664000175000017500000000012712236271551013156 00000000000000include $(top_srcdir)/config/common.am EXTRA_DIST = \ cmdbr.c \ cmdbr.fd \ cmdbr.h xforms-1.2.4/lib/vn_pair.c0000644000175000017500000000353612251553671012343 00000000000000/* * This file is part of the XForms library package. * * XForms is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1, or * (at your option) any later version. * * XForms 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with XForms. If not, see . */ /** * \file vn_pair.c * * Name value pair stuff */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "include/forms.h" #include "flinternal.h" #include "ulib.h" #include #include /*************************************** ***************************************/ int fli_get_vn_value( FLI_VN_PAIR * vn_pair, const char * name ) { long val; char *ep; for ( ; vn_pair->name; vn_pair++ ) if ( ! strcmp( vn_pair->name, name ) ) return vn_pair->val; val = strtol( name, &ep, 10 ); if ( ep != name && ! *ep && val >= INT_MIN && val <= INT_MAX ) return val; return -1; } /*************************************** ***************************************/ const char * fli_get_vn_name( FLI_VN_PAIR * vn_pair, int val ) { static char buf[ 5 ][ 16 ]; static int k; k = ( k + 1 ) % 5; for ( ; vn_pair->name; vn_pair++ ) if ( vn_pair->val == val ) return vn_pair->name; sprintf( buf[ k ], "%d", val ); return buf[ k ]; } /* * Local variables: * tab-width: 4 * indent-tabs-mode: nil * End: */ xforms-1.2.4/autogen.sh0000755000175000017500000000515212256055351011765 00000000000000#!/bin/sh LIBTOOLIZE="libtoolize --force --copy" ACLOCAL="aclocal" AUTOHEADER="autoheader" AUTOMAKE="automake -a -c --foreign" AUTOCONF="autoconf" ACINCLUDE_FILES="libtool.m4 xformsinclude.m4 cygwin.m4" # Make sure there's no file named 'libtool.m4' in the 'config' # subdirectory, otherwise there might be trouble (wrong content # of the file for the libtool version installed on the machine # and subsequent failure to create a working'configure' script) rm -f config/libtool.m4 # Let libtoolize do its magic, preparing everything for # working with libtool. if ( $LIBTOOLIZE --version ) < /dev/null > /dev/null 2>&1; then echo "Running libtoolize" $LIBTOOLIZE > /dev/null else echo "-> libtoolize not found, aborting" exit fi # Older versions of libtoolize don't copy libtool.m4, so we try to get # it manually from the directory where aclocal should have stored it if [ ! -e config/libtool.m4 ]; then echo "Copying file libtool.m4" if ( $ACLOCAL --version ) < /dev/null > /dev/null 2>&1; then LM4=$($ACLOCAL --print-ac-dir)/libtool.m4 if [ -e $LM4 ]; then cp $LM4 config else echo "-> Can't find required file $LM4" exit fi else echo "-> aclocal not found, aborting" exit fi fi # Check that the version of autoconf we have is supported autoversion=`$AUTOCONF --version | head -n 1` echo "Using $autoversion" case $autoversion in *2.59) ;; *2.[6-9][0-9]) ;; *) echo "This autoconf version is not supported by XForms." echo "Please update to autoconf 2.59 or newer." exit ;; esac # Generate acinclude.m4 echo "Generating acinclude.m4" rm -f acinclude.m4 ( cd config; cat ${ACINCLUDE_FILES} ${EXTRA_ACINCLUDE_FILES} > ../acinclude.m4 ) # Generate the Makefiles and the configure file if ( $ACLOCAL --version ) < /dev/null > /dev/null 2>&1; then echo "Building macros" $ACLOCAL else echo "-> aclocal not found, aborting" exit fi if ( $AUTOHEADER --version ) < /dev/null > /dev/null 2>&1; then echo "Building config header template" $AUTOHEADER else echo "-> autoheader not found, aborting" exit fi if ( $AUTOMAKE --version ) < /dev/null > /dev/null 2>&1; then echo "Building Makefile templates" $AUTOMAKE else echo "-> automake not found, aborting" exit fi # There seem to have been versions where the install-sh script generated # by automae didn't had execute permissions... if [ ! -x config/install-sh ]; then chmod 755 config/install-sh fi if ( $AUTOCONF --version ) < /dev/null > /dev/null 2>&1; then echo "Building configure" $AUTOCONF else echo "-> autoconf not found, aborting" exit fi echo echo "Looks good, now run:" echo ' ./configure && make && sudo make install'